Files
mixly3-server/mixly/boards/default/python_pyodide/main.bundle.9eb2088b.js
2026-01-24 16:13:38 +08:00

18404 lines
4.4 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(()=>{var __webpack_modules__={20936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{cv_destroy_all:()=>cv_destroy_all,cv_face_classifier:()=>cv_face_classifier,cv_face_detect:()=>cv_face_detect,cv_face_detect_all:()=>cv_face_detect_all,cv_line_rect:()=>cv_line_rect,cv_read_image:()=>cv_read_image,cv_show_image:()=>cv_show_image,cv_text:()=>cv_text,cv_waitkey:()=>cv_waitkey,cv_write_image:()=>cv_write_image});const cv_read_image=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.imread("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_show_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imshow("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_write_image=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.imwrite("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+","+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},cv_waitkey=function(e,t){return t.definitions_.import_cv2="import cv2","cv2.waitKey("+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")\n"},cv_destroy_all=function(e,t){t.definitions_.import_cv2="import cv2";return"cv2.destroyAllWindows()\n"},cv_line_rect=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),x2=generator.valueToCode(this,"x2",generator.ORDER_ATOMIC),y2=generator.valueToCode(this,"y2",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),direction=this.getFieldValue("DIR"),code="cv2."+direction+"("+file+",("+x1+","+y1+"),("+x2+","+y2+"),("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_text=function(_,generator){generator.definitions_.import_cv2="import cv2";var file=generator.valueToCode(this,"FILE",generator.ORDER_ATOMIC),x1=generator.valueToCode(this,"x1",generator.ORDER_ATOMIC),y1=generator.valueToCode(this,"y1",generator.ORDER_ATOMIC),data=generator.valueToCode(this,"data",generator.ORDER_ATOMIC),size=generator.valueToCode(this,"size",generator.ORDER_ATOMIC),thick=generator.valueToCode(this,"thick",generator.ORDER_ATOMIC),color=this.getFieldValue("FIELDNAME"),color1=eval("0x"+color[1]+color[2]),color2=eval("0x"+color[3]+color[4]),color3=eval("0x"+color[5]+color[6]),font=this.getFieldValue("font"),code="cv2.putText("+file+","+data+",("+x1+","+y1+"),cv2.FONT_HERSHEY_"+font+","+size+",("+color3+","+color2+","+color1+"),"+thick+")\n";return code},cv_face_classifier=function(e,t){return t.definitions_.import_cv2="import cv2",["cv2.CascadeClassifier("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},cv_face_detect_all=function(e,t){t.definitions_.import_cv2="import cv2";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return[t.valueToCode(this,"FACE",t.ORDER_ATOMIC)+".detectMultiScale("+n+",scaleFactor="+t.valueToCode(this,"SCALE",t.ORDER_ATOMIC)+",minNeighbors="+t.valueToCode(this,"NEIGHBOR",t.ORDER_ATOMIC)+",minSize=("+t.valueToCode(this,"x1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y1",t.ORDER_ATOMIC)+"),maxSize=("+t.valueToCode(this,"x2",t.ORDER_ATOMIC)+","+t.valueToCode(this,"y2",t.ORDER_ATOMIC)+"))",t.ORDER_ATOMIC]}},15149:(e,t,n)=>{"use strict";n.d(t,{GJ:()=>i,uI:()=>r});class i{constructor(e,t){this.backend=e,this.dataMover=t,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,t){this.dataIdsCount++,this.data.set(e,t)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class r{refCount(e){return s("refCount")}incRef(e){return s("incRef")}timerAvailable(){return!0}time(e){return s("time")}read(e){return s("read")}readSync(e){return s("readSync")}readToGPU(e,t){return s("readToGPU")}numDataIds(){return s("numDataIds")}disposeData(e,t){return s("disposeData")}write(e,t,n){return s("write")}move(e,t,n,i,r){return s("move")}createTensorFromGPUData(e,t,n){return s("createTensorFromGPUData")}memory(){return s("memory")}floatPrecision(){return s("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}dispose(){return s("dispose")}}function s(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},8360:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i(e,t,n){const i=function(e,t,n){return function(e,t,n){let i=0,r=e.length,s=0,o=!1;for(;i<r;){s=i+(r-i>>>1);const a=n(t,e[s]);a>0?i=s+1:(r=s,o=!a)}return o?i:-i-1}(e,t,n||r)}(e,t,n),s=i<0?-(i+1):i;e.splice(s,0,t)}function r(e,t){return e>t?1:e<t?-1:0}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function s(e,t,n,i,r){return l(e,t,n,i,r,0)}function o(e,t,n,i,r,s){return l(e,t,n,i,r,0,!1,s,!0)}function a(e,t,n,i,r,s){return l(e,t,n,i,r,s,!0)}function l(e,t,n,r,s,o,a=!1,l=!1,h=!1){const p=[];for(let e=0;e<t.length;e++)t[e]>s&&p.push({score:t[e],boxIndex:e,suppressBeginIndex:0});p.sort(d);const f=o>0?-.5/o:0,m=[],g=[];for(;m.length<n&&p.length>0;){const t=p.pop(),{score:n,boxIndex:o,suppressBeginIndex:a}=t;if(n<s)break;let l=!1;for(let n=m.length-1;n>=a;--n){const i=u(e,o,m[n]);if(i>=r){l=!0;break}if(t.score=t.score*c(r,f,i),t.score<=s)break}t.suppressBeginIndex=m.length,l||(t.score===n?(m.push(o),g.push(t.score)):t.score>s&&i(p,t,d))}const _=m.length,y=n-_;l&&y>0&&(m.push(...new Array(y).fill(0)),g.push(...new Array(y).fill(0)));const v={selectedIndices:m};return a&&(v.selectedScores=g),h&&(v.validOutputs=_),v}function u(e,t,n){const i=e.subarray(4*t,4*t+4),r=e.subarray(4*n,4*n+4),s=Math.min(i[0],i[2]),o=Math.min(i[1],i[3]),a=Math.max(i[0],i[2]),l=Math.max(i[1],i[3]),u=Math.min(r[0],r[2]),c=Math.min(r[1],r[3]),d=Math.max(r[0],r[2]),h=Math.max(r[1],r[3]),p=(a-s)*(l-o),f=(d-u)*(h-c);if(p<=0||f<=0)return 0;const m=Math.max(s,u),g=Math.max(o,c),_=Math.min(a,d),y=Math.min(l,h),v=Math.max(_-m,0)*Math.max(y-g,0);return v/(p+f-v)}function c(e,t,n){const i=Math.exp(t*n*n);return n<=e?i:0}function d(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}n.d(t,{c7:()=>s,ZS:()=>o,ut:()=>a})},54411:(e,t,n)=>{"use strict";n.d(t,{Y:()=>r});var i=n(448);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/function r(e,t){const n=[];for(let e=0;e<t.length;e++)t[e]&&n.push(e);const r=(0,i.r)(e,"int32"),s=(0,i.r)([n.length,e.length],"int32");for(let t=0;t<n.length;t++){const i=r.indexToLoc(n[t]),o=t*e.length;s.values.set(i,o)}return s.toTensor()}},41585:(e,t,n)=>{"use strict";n.d(t,{T2:()=>b,Ye:()=>v});var i=n(15149),r=n(46574),s=n(41743),o=n(15441),a=n(37074),l=n(73673),u=n(83879),c=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class d{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new p)}profileKernel(e,t,n){let i;const s=()=>{i=n()};let o;const a=u.now();if(this.backendTimer.timerAvailable())o=this.backendTimer.time(s);else{s();for(const e of i)e.dataSync();o=Promise.resolve({kernelMs:u.now()-a})}if((0,r._K)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t<i.length;t++){const n=i[t];n.data().then(t=>{h(t,n.dtype,e)})}return{kernelName:e,outputs:i,inputs:t,timeMs:o.then(e=>e.kernelMs),extraInfo:o.then(e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:t,outputs:n,timeMs:i,inputs:r,extraInfo:s}=e;n.forEach(e=>{Promise.all([e.data(),i,s]).then(n=>{this.logger.logKernelProfile(t,e,n[0],n[1],r,n[2])})})}}function h(e,t,n){if("float32"!==t)return!1;for(let t=0;t<e.length;t++){const i=e[t];if(isNaN(i)||!isFinite(i))return console.warn(`Found ${i} in the result of '${n}'`),!0}return!1}class p{logKernelProfile(e,t,n,i,r,s){const o="number"==typeof i?c.av(`${i}ms`,9):i.error,a=c.av(e,25),l=t.rank,u=t.size,d=c.av(t.shape.toString(),14);let h="";for(const e in r){const n=r[e];if(null!=n){const i=n.shape||t.shape,r=i.length;h+=`${e}: ${r}D ${r>0?i:""} `}}console.log(`%c${a}\t%c${o}\t%c${l}D ${d}\t%c${u}\t%c${h}\t%c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}var f=n(50259),m=n(30565);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function g(e){return null!=e.kernelName}class _{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 y{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new _}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then(()=>{});if(null!=this.backendInstance)return;const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t];if(await this.initializeBackend(n).success)return void await this.setBackend(n)}throw new Error("Could not initialize any backends, all backend initializations failed.")}get backend(){if(null!=this.pendingBackendInit)throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);if(null==this.backendInstance){const{name:e,asyncInit:t}=this.initializeBackendsAndReturnBest();if(t)throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`);this.setBackend(e)}return this.backendInstance}backendNames(){return Object.keys(this.registryFactory)}findBackend(e){if(!(e in this.registry)){if(!(e in this.registryFactory))return null;{const{asyncInit:t}=this.initializeBackend(e);if(t)return null}}return this.registry[e]}findBackendFactory(e){return e in this.registryFactory?this.registryFactory[e].factory:null}registerBackend(e,t,n=1){return e in this.registryFactory?(l.i(`${e} backend was already registered. Reusing existing backend factory.`),!1):(this.registryFactory[e]={factory:t,priority:n},!0)}async setBackend(e){if(null==this.registryFactory[e])throw new Error(`Backend name '${e}' not found in registry`);if(this.backendName=e,null==this.registry[e]){this.backendInstance=null;const{success:t,asyncInit:n}=this.initializeBackend(e);if(!(n?await t:t))return!1}return this.backendInstance=this.registry[e],this.setupRegisteredKernels(),this.profiler=new d(this.backendInstance),!0}setupRegisteredKernels(){(0,a.Op)(this.backendName).forEach(e=>{null!=e.setupFunc&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){(0,a.Op)(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 i.uI||"function"!=typeof n.then)return this.registry[e]=n,{success:!0,asyncInit:!1};{const t=++this.pendingBackendInitId,i=n.then(n=>!(t<this.pendingBackendInitId)&&(this.registry[e]=n,this.pendingBackendInit=null,!0)).catch(n=>(t<this.pendingBackendInitId||(this.pendingBackendInit=null,l.i(`Initialization of backend ${e} failed`),l.i(n.stack||n.message)),!1));return this.pendingBackendInit=i,{success:i,asyncInit:!0}}}catch(t){return l.i(`Initialization of backend ${e} failed`),l.i(t.stack||t.message),{success:!1,asyncInit:!1}}}removeBackend(e){if(!(e in this.registryFactory))throw new Error(`${e} backend not found in registry`);this.backendName===e&&null!=this.pendingBackendInit&&this.pendingBackendInitId++,e in this.registry&&(this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e]),delete this.registryFactory[e],this.backendName===e&&(this.pendingBackendInit=null,this.backendName=null,this.backendInstance=null)}getSortedBackends(){if(0===Object.keys(this.registryFactory).length)throw new Error("No backend found in registry.");return Object.keys(this.registryFactory).sort((e,t)=>this.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let t=0;t<e.length;t++){const n=e[t],{success:i,asyncInit:r}=this.initializeBackend(n);if(r||i)return{name:n,asyncInit:r}}throw new Error("Could not initialize any backends, all backend initializations failed.")}moveData(e,t){const n=this.state.tensorInfo.get(t),i=n.backend,r=this.readSync(t),s=i.refCount(t);i.disposeData(t,!0),n.backend=e,e.move(t,r,n.shape,n.dtype,s),this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack[this.state.numDataMovesStack.length-1]++}tidy(e,t){let n,i=null;if(null==t){if("function"!=typeof e)throw new Error("Please provide a function to tidy()");t=e}else{if("string"!=typeof e&&!(e instanceof String))throw new Error("When calling with two arguments, the first argument to tidy() must be a string");if("function"!=typeof t)throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function");i=e}return this.scopedRun(()=>this.startScope(i),()=>this.endScope(n),()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(e,t,n){e();try{const e=n();return t(),e}catch(e){throw t(),e}}nextTensorId(){return y.nextTensorId++}nextVariableId(){return y.nextVariableId++}clone(e){const t=b.runKernel(o.lzr,{x:e}),n={x:e};return this.addTapeNode(this.state.activeScope.name,n,[t],e=>({x:()=>{const t={x:e},n={dtype:"float32"};return b.runKernel(o.KXH,t,n)}}),[],{}),t}runKernel(e,t,n){null==this.backendName&&this.backend;if(!(null!=(0,a._5)(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 i=this.backend.numDataIds();let r=0;n.forEach(e=>{r+="complex64"===e.dtype?3:1});const s=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=i-t-r-s;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,n=[];const i=this.isTapeOn(),r=this.state.numBytes,s=this.state.numTensors;let o,l;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;const u=g(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(g(e)){const{kernelName:t,inputs:r,attrs:s}=e;null==this.backendName&&this.backend;const u=(0,a._5)(t,this.backendName);c.vA(null!=u,()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`),o=()=>{const e=this.backend.numDataIds();l=u.kernelFunc({inputs:r,attrs:s,backend:this.backend});const o=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,o);const a=o.map(e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e));if(i){const e=this.getTensorsForGradient(t,r,a);n=this.saveTensorsForBackwardMode(e)}return a}}else{const{forwardFunc:t}=e,r=e=>{i&&(n=e.map(e=>this.keep(this.clone(e))))};o=()=>{const e=this.backend.numDataIds();l=this.tidy(()=>t(this.backend,r));const n=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,e,n),n}}const{inputs:d,attrs:h}=e,p=g(e)?null:e.backwardsFunc;let f;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(f=this.profiler.profileKernel(u,d,()=>o()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(f),t=f.outputs):t=o()}),i&&this.addTapeNode(u,d,t,p,n,h),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-r,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-s,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map(e=>null!=d[e]?d[e].shape:null),outputShapes:t.map(e=>e.shape),kernelTimeMs:f.timeMs,extraInfo:f.extraInfo}),Array.isArray(l)?t:t[0]}saveTensorsForBackwardMode(e){const t=e.map(e=>this.keep(this.clone(e)));return t}getTensorsForGradient(e,t,n){const i=(0,a.vQ)(e);if(null!=i){const e=i.inputsToSave||[],r=i.outputsToSave||[];let s;i.saveAllInputs?(c.vA(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),s=Object.keys(t).map(e=>t[e])):s=e.map(e=>t[e]);const o=n.filter((e,t)=>r[t]);return s.concat(o)}return[]}makeTensor(e,t,n,i){if(null==e)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",i=i||this.backend;let r=e;"string"===n&&c.Kg(e[0])&&(r=e.map(e=>u.encodeString(e)));const s=i.write(r,t,n),o=new f.qY(t,n,s,this.nextTensorId());if(this.trackTensor(o,i),"string"===n){const e=this.state.tensorInfo.get(s),t=(0,c.SL)(r);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,n,i){const r={dataId:e,shape:t,dtype:n=n||"float32"};return this.makeTensorFromTensorInfo(r,i)}makeTensorFromTensorInfo(e,t){const{dataId:n,shape:i,dtype:r}=e,s=new f.qY(i,r,n,this.nextTensorId());return this.trackTensor(s,t),s}makeVariable(e,t=!0,n,i){n=n||this.nextVariableId().toString(),null!=i&&i!==e.dtype&&(e=e.cast(i));const r=new f.rT(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*c.jv(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 f.rT||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*c.jv(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,i,r,s){const o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:n,saved:r},l=(0,a.vQ)(e);null!=l&&(i=l.gradFunc),null!=i&&(o.gradient=e=>(e=e.map((e,t)=>{if(null==e){const e=n[t],i=c.Ty(e.size,e.dtype);return this.makeTensor(i,e.shape,e.dtype)}return e}),i(e.length>1?e:e[0],r,s))),this.state.activeTape.push(o)}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=(0,m.getTensorsInContainer)(e),n=new Set(t.map(e=>e.id));for(let e=0;e<this.state.activeScope.track.length;e++){const t=this.state.activeScope.track[e];t.kept||n.has(t.id)||t.dispose()}const i=this.state.scopeStack.pop();this.state.activeScope=0===this.state.scopeStack.length?null:this.state.scopeStack[this.state.scopeStack.length-1],t.forEach(e=>{e.kept||e.scopeId!==i.id||this.track(e)})}gradients(e,t,n,i=!1){if(c.vA(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));c.vA(r instanceof f.qY,()=>"The result y returned by f() must be a tensor.");const s=
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i={},r={};for(let e=0;e<t.length;e++)i[t[e].id]=!0;for(let n=0;n<e.length;n++){const s=e[n],o=s.inputs;for(const e in o){const n=o[e];let a=!1;for(let e=0;e<t.length;e++)if(i[n.id]){s.outputs.forEach(e=>i[e.id]=!0),a=!0,r[s.id]=!0;break}if(a)break}}const s={};s[n.id]=!0;const o={};for(let t=e.length-1;t>=0;t--){const n=e[t],i=n.inputs;for(let e=0;e<n.outputs.length;e++)if(s[n.outputs[e].id]){for(const e in i)s[i[e].id]=!0,o[n.id]=!0;break}}const a=[];for(let t=0;t<e.length;t++){const n=e[t];if(r[n.id]&&o[n.id]){const e={};for(const t in n.inputs){const r=n.inputs[t];i[r.id]&&(e[t]=r)}const t=Object.assign({},n);t.inputs=e,t.outputs=n.outputs,a.push(t)}}return a}(this.state.activeTape,t,r);if(!i&&0===s.length&&t.length>0)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=(0,c.FZ)((0,c.Ze)(e),"float32");return b.makeTensor(t,e,"float32")}(r.shape):n,function(e,t,n,i){for(let r=t.length-1;r>=0;r--){const s=t[r],o=[];if(s.outputs.forEach(t=>{const n=e[t.id];null!=n?o.push(n):o.push(null)}),null==s.gradient)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);const a=s.gradient(o);for(const t in s.inputs){if(!(t in a))throw new Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(a)}.`);const r=n(()=>a[t]());if("float32"!==r.dtype)throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${r.dtype}'`);const o=s.inputs[t];if(!c.r1(r.shape,o.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${t}' has shape '${r.shape}', which does not match the shape of the input '${o.shape}'`);if(null==e[o.id])e[o.id]=r;else{const t=e[o.id];e[o.id]=i(t,r),t.dispose()}}}}(e,s,e=>this.tidy(e),T);const i=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:i}})}customGrad(e){return c.vA(c.Tn(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{let n;c.vA(t.every(e=>e instanceof f.qY),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");const i={};t.forEach((e,t)=>{i[t]=e});return this.runKernelFunc({forwardFunc:(i,r)=>(n=e(...t,r),c.vA(n.value instanceof f.qY,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),c.vA(c.Tn(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),backwardsFunc:(e,i)=>{const r=n.gradFunc(e,i),s=Array.isArray(r)?r:[r];c.vA(s.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(...)."),c.vA(s.every(e=>e instanceof f.qY),()=>"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 o={};return s.forEach((e,t)=>{o[t]=()=>e}),o},inputs:i})}}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=(0,u.now)(),n=await this.backend.time(e);return n.wallMs=(0,u.now)()-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 _;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 v(){const e=(0,s.L)();if(null==e._tfengine){const t=new r.OH(e);e._tfengine=new y(t)}return(0,r.tj)(e._tfengine.ENV),(0,f.qP)(()=>e._tfengine),e._tfengine}y.nextTensorId=0,y.nextVariableId=0;const b=v();function T(e,t){const n={a:e,b:t};return b.runKernel(o.OMN,n)}},46574:(e,t,n)=>{"use strict";n.d(t,{Km:()=>l,OH:()=>s,_K:()=>a,tj:()=>u});var i=n(45119);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/const r="tfjsflags";class s{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=o,this.populateURLFlags()}setPlatform(e,t){null!=this.platform&&(a().getBool("IS_TEST")||a().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)),this.platformName=e,this.platform=t}registerFlag(e,t,n){if(this.flagRegistry[e]={evaluationFn:t,setHook:n},null!=this.urlFlags[e]){const t=this.urlFlags[e];a().getBool("IS_TEST")||a().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];const t=this.evaluateFlag(e);if((0,i.yL)(t))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getString(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;const e=this.getQueryParams(this.global.location.search);if(r in e){e[r].split(",").forEach(e=>{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 o(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 a(){return l}let l=null;function u(e){l=e}},41743:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
let i;function r(){if(null==i){let e;if("undefined"!=typeof window)e=window;else if(void 0!==n.g)e=n.g;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}i=e}return i}function s(e,t){const n=function(){const e=r();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const i=t();return n.set(e,i),n.get(e)}}n.d(t,{L:()=>r,m:()=>s})},35287:(e,t,n)=>{"use strict";n.d(t,{AS:()=>g,DZ:()=>m,Gc:()=>b,Hi:()=>h,Hs:()=>A,IS:()=>u,ME:()=>f,Ok:()=>S,Sm:()=>a,W4:()=>w,aC:()=>_,fL:()=>c,gJ:()=>I,gY:()=>l,go:()=>E,jh:()=>v,jz:()=>T,kB:()=>y,m1:()=>p,rE:()=>x,rm:()=>d});var i=n(41585),r=n(46574),s=n(50259),o=n(30565);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function a(){(0,r._K)().set("PROD",!0)}function l(){(0,r._K)().set("DEBUG",!0)}function u(){(0,r._K)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function c(e){(0,r._K)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function d(){i.T2.disposeVariables()}function h(){return i.T2}function p(){return i.T2.memory()}function f(e){return i.T2.profile(e)}function m(e,t){return i.T2.tidy(e,t)}function g(e){(0,o.getTensorsInContainer)(e).forEach(e=>e.dispose())}function _(e){return i.T2.keep(e)}function y(e){return i.T2.time(e)}function v(e){return i.T2.setBackend(e)}function b(){return i.T2.ready()}function T(){return i.T2.backendName}function x(e){i.T2.removeBackend(e)}function E(e){return i.T2.findBackend(e)}function w(e){return i.T2.findBackendFactory(e)}function I(e,t,n=1){return i.T2.registerBackend(e,t,n)}function A(){return i.T2.backend}function S(e,t){(0,r._K)().setPlatform(e,t)}(0,s.B4)(c)},31830:(e,t,n)=>{"use strict";n.d(t,{Dv:()=>a,_X:()=>h,jY:()=>u,mu:()=>c,ok:()=>l,y7:()=>d});var i=n(41585),r=n(50259),s=n(28189),o=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function a(e){return o.vA(o.Tn(e),()=>"The f passed in grad(f) must be a function"),(t,n)=>{const r=(0,s.YT)(t,"x","tf.grad","string_or_numeric"),a=null!=n?(0,s.YT)(n,"dy","tf.grad"):null;return i.T2.tidy(()=>{const{value:t,grads:n}=i.T2.gradients(()=>e(r),[r],a);return null!=a&&o.O3(t.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),p(n),n[0]})}}function l(e){return o.vA(o.Tn(e),()=>"The f passed in grads(f) must be a function"),(t,n)=>{o.vA(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");const r=(0,s.j1)(t,"args","tf.grads","string_or_numeric"),a=null!=n?(0,s.YT)(n,"dy","tf.grads"):null;return i.T2.tidy(()=>{const{value:t,grads:n}=i.T2.gradients(()=>e(...r),r,a);return null!=a&&o.O3(t.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),p(n),n})}}function u(e){return o.vA(o.Tn(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,n)=>{o.vA(t instanceof r.qY,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),o.vA(null==n||n instanceof r.qY,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");const{grads:s,value:a}=i.T2.gradients(()=>e(t),[t],n);return p(s),{grad:s[0],value:a}}}function c(e){return o.vA(o.Tn(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,n)=>{o.vA(Array.isArray(t)&&t.every(e=>e instanceof r.qY),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),o.vA(null==n||n instanceof r.qY,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");const s=i.T2.gradients(()=>e(...t),t,n);return null!=n&&o.O3(s.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),p(s.grads),s}}function d(e,t){o.vA(o.Tn(e),()=>"The f passed in variableGrads(f) must be a function"),o.vA(null==t||Array.isArray(t)&&t.every(e=>e instanceof r.rT),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=null!=t;if(!n){t=[];for(const e in i.T2.registeredVariables)t.push(i.T2.registeredVariables[e])}const s=n?t.filter(e=>!e.trainable):null,a=t.length;t=t.filter(e=>e.trainable),o.vA(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`);const{value:l,grads:u}=i.T2.gradients(e,t,null,!0);o.vA(u.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()."),o.vA(0===l.rank,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${l.rank} tensor`);const c={};return t.forEach((e,t)=>{null!=u[t]&&(c[e.name]=u[t])}),null!=s&&s.forEach(e=>c[e.name]=null),{value:l,grads:c}}function h(e){return i.T2.customGrad(e)}function p(e){if(e.filter(e=>null==e).length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.")}},15838:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Abs:()=>_t.ljI,Acos:()=>_t.Vvy,Acosh:()=>_t.PH8,AdadeltaOptimizer:()=>Me,AdagradOptimizer:()=>Re,AdamOptimizer:()=>Fe,AdamaxOptimizer:()=>Be,Add:()=>_t.OMN,AddN:()=>_t.EkD,All:()=>_t.u8Z,Any:()=>_t.FSt,ArgMax:()=>_t.Jp_,ArgMin:()=>_t.p_m,Asin:()=>_t.QKF,Asinh:()=>_t.epO,Atan:()=>_t.TyE,Atan2:()=>_t.lxb,Atanh:()=>_t.zP9,AvgPool:()=>_t.ho8,AvgPool3D:()=>_t.cS,AvgPool3DGrad:()=>_t.wwC,AvgPoolGrad:()=>_t.VCH,BatchMatMul:()=>_t.jAQ,BatchToSpaceND:()=>_t.Ik2,Bincount:()=>_t.N4F,BitwiseAnd:()=>_t.HNs,BroadcastArgs:()=>_t.vj7,BroadcastTo:()=>_t.LB5,Cast:()=>_t.KXH,Ceil:()=>_t.QDP,ClipByValue:()=>_t.vaV,Complex:()=>_t.pr3,ComplexAbs:()=>_t.$zE,Concat:()=>_t.$dB,Conv2D:()=>_t.p2J,Conv2DBackpropFilter:()=>_t.rFm,Conv2DBackpropInput:()=>_t.jfg,Conv3D:()=>_t.A1h,Conv3DBackpropFilterV2:()=>_t.iGz,Conv3DBackpropInputV2:()=>_t.gC7,Cos:()=>_t.Mn0,Cosh:()=>_t.MnK,CropAndResize:()=>_t.MRQ,Cumprod:()=>_t.jj_,Cumsum:()=>_t.nY8,DataStorage:()=>pi.GJ,DenseBincount:()=>_t.wNW,DepthToSpace:()=>_t.TMz,DepthwiseConv2dNative:()=>_t.tGH,DepthwiseConv2dNativeBackpropFilter:()=>_t.X$8,DepthwiseConv2dNativeBackpropInput:()=>_t.nVu,Diag:()=>_t.ORI,Dilation2D:()=>_t.jxD,Dilation2DBackpropFilter:()=>_t.pk0,Dilation2DBackpropInput:()=>_t.bP9,Draw:()=>_t.XmO,ENV:()=>y.Km,Einsum:()=>_t.Qgm,Elu:()=>_t.Pah,EluGrad:()=>_t.rsH,Environment:()=>y.OH,Equal:()=>_t.BRl,Erf:()=>_t._s9,Exp:()=>_t.ox3,ExpandDims:()=>_t.ybN,Expm1:()=>_t.ybj,FFT:()=>_t.rGP,Fill:()=>_t.SQl,FlipLeftRight:()=>_t.BxF,Floor:()=>_t.ZgB,FloorDiv:()=>_t.ElG,FromPixels:()=>_t.awo,FusedBatchNorm:()=>_t.i5R,FusedConv2D:()=>_t.aAr,FusedDepthwiseConv2D:()=>_t.T7M,GatherNd:()=>_t.O4G,GatherV2:()=>_t.mxL,Greater:()=>_t.XhZ,GreaterEqual:()=>_t.lLS,IFFT:()=>_t.OAQ,Identity:()=>_t.lzr,Imag:()=>_t.dv8,IsFinite:()=>_t.gIW,IsInf:()=>_t.E3$,IsNan:()=>_t.iPs,KernelBackend:()=>pi.uI,LRN:()=>_t.jM4,LRNGrad:()=>_t.ToN,LeakyRelu:()=>_t.X0$,Less:()=>_t.mIA,LessEqual:()=>_t.CwD,LinSpace:()=>_t.mnI,Log:()=>_t.tG8,Log1p:()=>_t.Cg$,LogSoftmax:()=>_t.zfU,LogicalAnd:()=>_t.RUm,LogicalNot:()=>_t.nZd,LogicalOr:()=>_t.LXA,LogicalXor:()=>_t.RW8,LowerBound:()=>_t.yPW,MatrixBandPart:()=>_t.WRv,Max:()=>_t.VAI,MaxPool:()=>_t.t3d,MaxPool3D:()=>_t.ySp,MaxPool3DGrad:()=>_t.cHb,MaxPoolGrad:()=>_t.RXX,MaxPoolWithArgmax:()=>_t.TL8,Maximum:()=>_t.LDN,Mean:()=>_t.g5A,Min:()=>_t.lNG,Minimum:()=>_t.LG0,MirrorPad:()=>_t.x7F,Mod:()=>_t.BLA,MomentumOptimizer:()=>Ue,Multinomial:()=>_t.WT3,Multiply:()=>_t.xu7,Neg:()=>_t.l0G,NonMaxSuppressionV3:()=>_t.SDM,NonMaxSuppressionV4:()=>_t.Zl4,NonMaxSuppressionV5:()=>_t.e0f,NotEqual:()=>_t.ylV,OP_SCOPE_SUFFIX:()=>Zt.BTT,OneHot:()=>_t.urI,OnesLike:()=>_t.LWX,Optimizer:()=>Oe,OptimizerConstructors:()=>qt,Pack:()=>_t.mM$,PadV2:()=>_t.ODT,Pool:()=>_t.bCz,Pow:()=>_t.pyJ,Prelu:()=>_t.Ncv,Prod:()=>_t.kdj,RMSPropOptimizer:()=>Ve,RaggedGather:()=>_t.oJ2,RaggedRange:()=>_t.CQC,RaggedTensorToTensor:()=>_t.mH5,Range:()=>_t.Q6t,Rank:()=>Kt.rg,Real:()=>_t.LRy,RealDiv:()=>_t.sDr,Reciprocal:()=>_t.huO,Reduction:()=>Qt.i,Relu:()=>_t.fUj,Relu6:()=>_t.P_L,Reshape:()=>_t.R23,ResizeBilinear:()=>_t.hgw,ResizeBilinearGrad:()=>_t.FCQ,ResizeNearestNeighbor:()=>_t.jOE,ResizeNearestNeighborGrad:()=>_t.XQy,Reverse:()=>_t.D7i,RotateWithOffset:()=>_t.BK4,Round:()=>_t.hVg,Rsqrt:()=>_t.TOR,SGDOptimizer:()=>$e,ScatterNd:()=>_t.pJc,SearchSorted:()=>_t.uWl,Select:()=>_t.l6P,Selu:()=>_t.u$b,Sigmoid:()=>_t.vI1,Sign:()=>_t.YVe,Sin:()=>_t.hql,Sinh:()=>_t.J3C,Slice:()=>_t.JiE,Softmax:()=>_t.rFG,Softplus:()=>_t.Fin,SpaceToBatchND:()=>_t.A8B,SparseFillEmptyRows:()=>_t.C8s,SparseReshape:()=>_t.BoJ,SparseSegmentMean:()=>_t.L6G,SparseSegmentSum:()=>_t.DvZ,SparseToDense:()=>_t.jgd,SplitV:()=>_t.Blb,Sqrt:()=>_t.dFH,Square:()=>_t.M6A,SquaredDifference:()=>_t.Ddj,StaticRegexReplace:()=>_t.GZp,Step:()=>_t.pnw,StridedSlice:()=>_t.UcO,StringNGrams:()=>_t.YAb,StringSplit:()=>_t.iW0,StringToHashBucketFast:()=>_t.$jE,Sub:()=>_t.PbM,Sum:()=>_t.WuN,Tan:()=>_t.oFs,Tanh:()=>_t.iuW,Tensor:()=>he.qY,TensorBuffer:()=>he.yl,TensorScatterUpdate:()=>_t.X4r,Tile:()=>_t.FAs,TopK:()=>_t.TBb,Transform:()=>_t.dLy,Transpose:()=>_t.wx0,Unique:()=>_t.EwU,Unpack:()=>_t.dXR,UnsortedSegmentSum:()=>_t.pPe,UpperBound:()=>_t.RMm,Variable:()=>he.rT,ZerosLike:()=>_t.xJ3,_FusedMatMul:()=>_t.Dr,abs:()=>Zt.tnl,acos:()=>Zt.HQu,acosh:()=>Zt.FqL,add:()=>Zt.WQq,addN:()=>Zt.QiD,all:()=>Zt.Q7R,any:()=>Zt.bzn,argMax:()=>Zt.FLi,argMin:()=>Zt.XRg,asin:()=>Zt.qRo,asinh:()=>Zt.yHs,atan:()=>Zt.rYl,atan2:()=>Zt.FPz,atanh:()=>Zt.rfv,avgPool:()=>Zt.$jT,avgPool3d:()=>Zt.sub,backend:()=>fe.Hs,backend_util:()=>d,basicLSTMCell:()=>Zt.lZX,batchNorm:()=>Zt.$v7,batchNorm2d:()=>Zt.BFc,batchNorm3d:()=>Zt.kSi,batchNorm4d:()=>Zt.T5N,batchToSpaceND:()=>Zt.GTe,bincount:()=>Zt.HbZ,bitwiseAnd:()=>Zt.vjT,booleanMaskAsync:()=>Zt.ftb,broadcastArgs:()=>Zt.ROE,broadcastTo:()=>Zt.hOW,broadcast_util:()=>gt,browser:()=>a,buffer:()=>Zt.ra8,cast:()=>Zt.wgE,ceil:()=>Zt.mkO,clipByValue:()=>Zt.zQh,clone:()=>Zt.o8B,complex:()=>Zt.faB,concat:()=>Zt.xWs,concat1d:()=>Zt.I1m,concat2d:()=>Zt.RPU,concat3d:()=>Zt.O5O,concat4d:()=>Zt.P1l,conv1d:()=>Zt.kA9,conv2d:()=>Zt.Xtf,conv2dTranspose:()=>Zt.wX9,conv3d:()=>Zt.IPL,conv3dTranspose:()=>Zt.jIJ,copyRegisteredKernels:()=>yt.Cf,cos:()=>Zt.gnS,cosh:()=>Zt.yIG,cosineWindow:()=>Zt._jP,cumprod:()=>Zt.Lp0,cumsum:()=>Zt.rCv,customGrad:()=>Te._X,denseBincount:()=>Zt.aOp,deprecationWarn:()=>fe.fL,depthToSpace:()=>Zt.Rj8,depthwiseConv2d:()=>Zt.Gl3,device_util:()=>i,diag:()=>Zt.smy,dilation2d:()=>Zt.X7t,disableDeprecationWarnings:()=>fe.IS,dispose:()=>fe.AS,disposeVariables:()=>fe.rm,div:()=>Zt.y4m,divNoNan:()=>Zt.ek5,dot:()=>Zt.Omf,dropout:()=>Zt.EZY,einsum:()=>Zt._3C,elu:()=>Zt.Pqc,enableDebugMode:()=>fe.gY,enableProdMode:()=>fe.Sm,enclosingPowerOfTwo:()=>Zt.FJY,engine:()=>fe.Hi,ensureShape:()=>Zt.QP2,env:()=>y._K,equal:()=>Zt.LCg,erf:()=>Zt.Y12,euclideanNorm:()=>Zt.p4S,exp:()=>Zt.oNF,expandDims:()=>Zt.UG6,expm1:()=>Zt.IYd,eye:()=>Zt.y5U,fft:()=>Zt.hVP,fill:()=>Zt.GSj,findBackend:()=>fe.go,findBackendFactory:()=>fe.W4,floor:()=>Zt.RIf,floorDiv:()=>Zt.wh_,fused:()=>Zt.cZk,gather:()=>Zt.kgh,gatherND:()=>Zt.SY9,gather_util:()=>l,getBackend:()=>fe.jz,getGradient:()=>yt.vQ,getKernel:()=>yt._5,getKernelsForBackend:()=>yt.Op,grad:()=>Te.Dv,grads:()=>Te.ok,greater:()=>Zt.rhj,greaterEqual:()=>Zt.DQN,ifft:()=>Zt.KGM,imag:()=>Zt.ngS,image:()=>Zt.Slp,inTopKAsync:()=>Zt.U4u,io:()=>s,irfft:()=>Zt.ggX,isFinite:()=>Zt.MIs,isInf:()=>Zt.EN4,isNaN:()=>Zt.yrW,keep:()=>fe.aC,kernel_impls:()=>h,leakyRelu:()=>Zt.H8d,less:()=>Zt.M7h,lessEqual:()=>Zt.InN,linalg:()=>Zt.mPL,linspace:()=>Zt.mT8,localResponseNormalization:()=>Zt.Kgs,log:()=>Zt.Rm2,log1p:()=>Zt.Kko,logSigmoid:()=>Zt.nqI,logSoftmax:()=>Zt.HPB,logSumExp:()=>Zt.VZ,logicalAnd:()=>Zt.n76,logicalNot:()=>Zt.NSZ,logicalOr:()=>Zt.ztW,logicalXor:()=>Zt.rxB,losses:()=>Zt.YYh,lowerBound:()=>Zt.yzS,matMul:()=>Zt.NoW,math:()=>o,max:()=>Zt.T9B,maxPool:()=>Zt.jgi,maxPool3d:()=>Zt.NYV,maxPoolWithArgmax:()=>Zt.RO,maximum:()=>Zt.PhQ,mean:()=>Zt.i2o,memory:()=>fe.m1,meshgrid:()=>Zt.OYQ,min:()=>Zt.jkA,minimum:()=>Zt.BpO,mirrorPad:()=>Zt.FFZ,mod:()=>Zt.ziu,moments:()=>Zt.Clk,movingAverage:()=>Zt.CRk,mul:()=>Zt.lKK,multiRNNCell:()=>Zt.YDF,multinomial:()=>Zt.OjQ,neg:()=>Zt.HZy,nextFrame:()=>tn,norm:()=>Zt.xbf,notEqual:()=>Zt.Ec,oneHot:()=>Zt.Mw0,ones:()=>Zt.SaS,onesLike:()=>Zt.P61,op:()=>Zt.op,outerProduct:()=>Zt.X4o,pad:()=>Zt.eVF,pad1d:()=>Zt.BZs,pad2d:()=>Zt.grY,pad3d:()=>Zt.XHu,pad4d:()=>Zt.WLX,pool:()=>Zt.dzn,pow:()=>Zt.n7C,prelu:()=>Zt.NsG,print:()=>Zt.yyV,prod:()=>Zt._eU,profile:()=>fe.ME,raggedGather:()=>Zt.whe,raggedRange:()=>Zt.iyU,raggedTensorToTensor:()=>Zt.Q0_,rand:()=>Zt._9M,randomGamma:()=>Zt.pR9,randomNormal:()=>Zt.FE$,randomStandardNormal:()=>Zt.m0H,randomUniform:()=>Zt.YeY,randomUniformInt:()=>Zt.HYA,range:()=>Zt.y17,ready:()=>fe.Gc,real:()=>Zt.xav,reciprocal:()=>Zt.VOZ,registerBackend:()=>fe.gJ,registerGradient:()=>yt.kr,registerKernel:()=>yt.tA,relu:()=>Zt.VVh,relu6:()=>Zt.j__,removeBackend:()=>fe.rE,reshape:()=>Zt.tQQ,reverse:()=>Zt.BEg,reverse1d:()=>Zt.QD2,reverse2d:()=>Zt.LMr,reverse3d:()=>Zt.I2l,reverse4d:()=>Zt.JYU,rfft:()=>Zt.z8$,round:()=>Zt.LIG,rsqrt:()=>Zt.Z$r,scalar:()=>Zt.d_2,scatterND:()=>Zt.NFr,scatter_util:()=>Mt,searchSorted:()=>Zt.sZg,selu:()=>Zt.WfX,separableConv2d:()=>Zt.wdz,serialization:()=>r,setBackend:()=>fe.jh,setPlatform:()=>fe.Ok,setdiff1dAsync:()=>Zt.F12,sigmoid:()=>Zt.ry7,sign:()=>Zt._SZ,signal:()=>Zt.vPA,sin:()=>Zt.F8e,sinh:()=>Zt.L0l,slice:()=>Zt.dik,slice1d:()=>Zt.Q$M,slice2d:()=>Zt.zAd,slice3d:()=>Zt.wck,slice4d:()=>Zt.R0O,slice_util:()=>kt,softmax:()=>Zt.Vs9,softplus:()=>Zt.lw0,spaceToBatchND:()=>Zt.eDJ,sparse:()=>Zt.lMo,sparseToDense:()=>Zt.Zhr,spectral:()=>Zt.lOn,split:()=>Zt.lDo,sqrt:()=>Zt.RZD,square:()=>Zt.EwI,squaredDifference:()=>Zt.Pbu,squeeze:()=>Zt.r2V,stack:()=>Zt.t$z,step:()=>Zt.PMw,stridedSlice:()=>Zt.Ym9,string:()=>Zt.YjP,sub:()=>Zt.jbE,sum:()=>Zt.czq,sumOutType:()=>Kt.ch,tan:()=>Zt.Mlm,tanh:()=>Zt.ymU,tensor:()=>Zt.OEK,tensor1d:()=>Zt.tGX,tensor2d:()=>Zt.KtR,tensor3d:()=>Zt.$_$,tensor4d:()=>Zt.g9W,tensor5d:()=>Zt.Lpo,tensor6d:()=>Zt.yxw,tensorScatterUpdate:()=>Zt.NNh,tensor_util:()=>Rt,test_util:()=>u,tidy:()=>fe.DZ,tile:()=>Zt.Vsq,time:()=>fe.kB,topk:()=>Zt.rfw,train:()=>Jt,transpose:()=>Zt.mgz,truncatedNormal:()=>Zt.efE,unique:()=>Zt.AmM,unregisterGradient:()=>yt.rY,unregisterKernel:()=>yt.iP,unsortedSegmentSum:()=>Zt.zAU,unstack:()=>Zt.K$i,upcastType:()=>Kt.Tu,upperBound:()=>Zt.rni,util:()=>Nt,valueAndGrad:()=>Te.jY,valueAndGrads:()=>Te.mu,variable:()=>Zt.bvq,variableGrads:()=>Te.y7,version_core:()=>Xt,where:()=>Zt._M9,whereAsync:()=>Zt.YJN,zeros:()=>Zt.Ul9,zerosLike:()=>Zt.POl});var i={};n.r(i),n.d(i,{isBrowser:()=>_,isMobile:()=>g,mockIsMobile:()=>m});var r={};n.r(r),n.d(r,{Serializable:()=>Ie,SerializationMap:()=>Ae,getRegisteredName:()=>Ce,registerClass:()=>Se});var s={};n.r(s),n.d(s,{CompositeArrayBuffer:()=>A.D,browserFiles:()=>He,browserHTTPRequest:()=>nt,concatenateArrayBuffers:()=>b.AQ,copyModel:()=>te,decodeWeights:()=>b.CY,decodeWeightsStream:()=>b.s5,encodeWeights:()=>b.aG,fromMemory:()=>ot,fromMemorySync:()=>at,getLoadHandlers:()=>I,getModelArtifactsForJSON:()=>b.Ej,getModelArtifactsForJSONSync:()=>b.Rl,getModelArtifactsInfoForJSON:()=>b.oR,getSaveHandlers:()=>w,getWeightSpecs:()=>b.Xf,http:()=>tt,isHTTPScheme:()=>Je,listModels:()=>J,loadWeights:()=>Ke,moveModel:()=>ne,registerLoadRouter:()=>E,registerSaveRouter:()=>x,removeModel:()=>ee,weightsLoaderFactory:()=>Ze,withSaveHandler:()=>lt,withSaveHandlerSync:()=>ut});var o={};n.r(o),n.d(o,{confusionMatrix:()=>mt});var a={};n.r(a),n.d(a,{draw:()=>St,fromPixels:()=>Ct,fromPixelsAsync:()=>wt,toPixels:()=>At});var l={};n.r(l),n.d(l,{prepareAndValidate:()=>Ot});var u={};n.r(u),n.d(u,{TEST_EPSILON_FLOAT16:()=>Ft,createVideoElement:()=>Ht,encodeStrings:()=>Gt,expectArrayBuffersEqual:()=>Yt,expectArraysClose:()=>Lt,expectArraysEqual:()=>Ut,expectNumbersClose:()=>Vt,expectPromiseToFail:()=>$t,expectValuesInRange:()=>jt,play:()=>Wt,testEpsilon:()=>Pt});var c={};n.r(c),n.d(c,{collectGatherOpShapeInfo:()=>li,computeOutShape:()=>ai,segOpComputeOptimalWindowSize:()=>oi});var d={};n.r(d),n.d(d,{ERF_A1:()=>En,ERF_A2:()=>wn,ERF_A3:()=>In,ERF_A4:()=>An,ERF_A5:()=>Sn,ERF_P:()=>xn,PARALLELIZE_THRESHOLD:()=>pn,RowPartitionType:()=>on,SELU_SCALE:()=>Tn.X,SELU_SCALEALPHA:()=>Tn.j,applyActivation:()=>ln.f2,assertAndGetBroadcastShape:()=>gt.assertAndGetBroadcastShape,assertAxesAreInnerMostDims:()=>nn.WC,assertParamsConsistent:()=>rn,assignToTypedArray:()=>Dn,axesAreInnerMostDims:()=>nn.WH,calculateShapes:()=>Mt.calculateShapes,checkEinsumDimSizes:()=>jn,checkPadOnDimRoundingMode:()=>an.s_,combineLocations:()=>nn.aF,combineRaggedTensorToTensorShapes:()=>un,complexWithEvenIndex:()=>kn,complexWithOddIndex:()=>Rn,computeConv2DInfo:()=>an.uf,computeConv3DInfo:()=>an.p$,computeDefaultPad:()=>an.G8,computeDilation2DInfo:()=>an.YQ,computeOptimalWindowSize:()=>fn,computeOutAndReduceShapes:()=>nn.lb,computeOutShape:()=>sn,computePool2DInfo:()=>an.E6,computePool3DInfo:()=>an.l5,convertConv2DDataFormat:()=>an.$Q,decodeEinsumEquation:()=>Vn,eitherStridesOrDilationsAreOne:()=>an.G0,expandShapeToKeepDim:()=>nn.SM,exponent:()=>Ln,exponents:()=>Fn,fromStringArrayToUint8:()=>ci,fromUint8ToStringArray:()=>ui,getAxesPermutation:()=>nn.Em,getBroadcastDims:()=>gt.getBroadcastDims,getComplexWithIndex:()=>Nn,getEinsumComputePath:()=>Yn,getEinsumPermutation:()=>zn,getFusedBiasGradient:()=>ln.Do,getFusedDyActivation:()=>ln.XB,getImageCenter:()=>mn,getInnerMostAxes:()=>nn.fK,getPermuted:()=>_n,getRaggedRank:()=>dn,getReductionAxes:()=>gt.getReductionAxes,getReshaped:()=>gn,getReshapedPermuted:()=>yn,getRowPartitionTypesHelper:()=>cn,getSliceBeginCoords:()=>vn,getSliceSize:()=>bn,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>Xn,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>qn,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>Kn,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>Jn,getSparseReshapeInputOutputMismatchErrorMessage:()=>ti,getSparseReshapeInputOutputMultipleErrorMessage:()=>ei,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>Zn,getSparseReshapeNegativeOutputDimErrorMessage:()=>Qn,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>si,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>ni,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>ii,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>ri,getUndoAxesPermutation:()=>nn.gx,isIdentityPermutation:()=>Gn,log:()=>Cn.R,mergeRealAndImagArrays:()=>On,prepareAndValidate:()=>Ot,prepareSplitSize:()=>Wn,segment_util:()=>c,shouldFuse:()=>ln.zE,slice_util:()=>kt,splitRealAndImagArrays:()=>Mn,stridesOrDilationsArePositive:()=>an.qk,tupleValuesAreOne:()=>an.Dh,upcastType:()=>Kt.Tu,validateDefaultValueShape:()=>hn,validateInput:()=>Mt.validateInput,validateUpdateShape:()=>Mt.validateUpdateShape,warn:()=>Cn.i});var h={};n.r(h),n.d(h,{nonMaxSuppressionV3Impl:()=>di.c7,nonMaxSuppressionV4Impl:()=>di.ZS,nonMaxSuppressionV5Impl:()=>di.ut,whereImpl:()=>hi.Y});var p=n(41585);let f;function m(e){f=e}function g(e){if(void 0!==f)return f;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 _(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}var y=n(46574);
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const v=(0,y._K)();v.registerFlag("DEBUG",()=>!1,e=>{e&&console.warn("Debugging mode is ON. The output of every math call will be downloaded to CPU and checked for NaNs. This significantly impacts performance.")}),v.registerFlag("IS_BROWSER",()=>_()),v.registerFlag("IS_NODE",()=>"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node),v.registerFlag("IS_CHROME",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),v.registerFlag("IS_SAFARI",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor)),v.registerFlag("PROD",()=>!1),v.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>v.getBool("DEBUG")),v.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0),v.registerFlag("IS_TEST",()=>!1),v.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>v.getBool("DEBUG")),v.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1),v.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1),v.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);var b=n(77084);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class T{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==T.instance&&(T.instance=new T),T.instance}static registerSaveRouter(e){T.getInstance().saveRouters.push(e)}static registerLoadRouter(e){T.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return T.getHandlers(e,"save")}static getLoadHandlers(e,t){return T.getHandlers(e,"load",t)}static getHandlers(e,t,n){const i=[];return("load"===t?T.getInstance().loadRouters:T.getInstance().saveRouters).forEach(t=>{const r=t(e,n);null!==r&&i.push(r)}),i}}const x=e=>T.registerSaveRouter(e),E=e=>T.registerLoadRouter(e),w=e=>T.getSaveHandlers(e),I=(e,t)=>T.getLoadHandlers(e,t);var A=n(56734);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const S="tensorflowjs",C="models_store",O="model_info_store";function M(){if(!(0,y._K)().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 k(e){const t=e.result;t.createObjectStore(C,{keyPath:"modelPath"}),t.createObjectStore(O,{keyPath:"modelPath"})}class R{constructor(e){if(this.indexedDB=M(),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 i=this.indexedDB.open(S,1);i.onupgradeneeded=()=>k(i),i.onsuccess=()=>{const r=i.result;if(null==t){const t=r.transaction(C,"readonly"),i=t.objectStore(C).get(this.modelPath);i.onsuccess=()=>{if(null==i.result)return r.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(i.result.modelArtifacts)},i.onerror=e=>(r.close(),n(i.error)),t.oncomplete=()=>r.close()}else{t.weightData=A.D.join(t.weightData);const i=(0,b.oR)(t),s=r.transaction(O,"readwrite");let o,a,l=s.objectStore(O);try{o=l.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(e){return n(e)}o.onsuccess=()=>{a=r.transaction(C,"readwrite");const o=a.objectStore(C);let u;try{u=o.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(e){return n(e)}u.onsuccess=()=>e({modelArtifactsInfo:i}),u.onerror=e=>{l=s.objectStore(O);const t=l.delete(this.modelPath);t.onsuccess=()=>(r.close(),n(u.error)),t.onerror=e=>(r.close(),n(u.error))}},o.onerror=e=>(r.close(),n(o.error)),s.oncomplete=()=>{null==a?r.close():a.oncomplete=()=>r.close()}}},i.onerror=e=>n(i.error)})}}R.URL_SCHEME="indexeddb://";const N=e=>{return(0,y._K)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(R.URL_SCHEME)?(t=e.slice(R.URL_SCHEME.length),new R(t)):null;var t};T.registerSaveRouter(N),T.registerLoadRouter(N);class D{constructor(){this.indexedDB=M()}async listModels(){return new Promise((e,t)=>{const n=this.indexedDB.open(S,1);n.onupgradeneeded=()=>k(n),n.onsuccess=()=>{const i=n.result,r=i.transaction(O,"readonly"),s=r.objectStore(O).getAll();s.onsuccess=()=>{const t={};for(const e of s.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},s.onerror=e=>(i.close(),t(s.error)),r.oncomplete=()=>i.close()},n.onerror=e=>t(n.error)})}async removeModel(e){var t;return e=(t=e).startsWith(R.URL_SCHEME)?t.slice(R.URL_SCHEME.length):t,new Promise((t,n)=>{const i=this.indexedDB.open(S,1);i.onupgradeneeded=()=>k(i),i.onsuccess=()=>{const r=i.result,s=r.transaction(O,"readwrite"),o=s.objectStore(O),a=o.get(e);let l;a.onsuccess=()=>{if(null==a.result)return r.close(),n(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const i=o.delete(e),s=()=>{l=r.transaction(C,"readwrite");const i=l.objectStore(C).delete(e);i.onsuccess=()=>t(a.result.modelArtifactsInfo),i.onerror=e=>n(a.error)};i.onsuccess=s,i.onerror=e=>(s(),r.close(),n(a.error))}},a.onerror=e=>(r.close(),n(a.error)),s.oncomplete=()=>{null==l?r.close():l.oncomplete=()=>r.close()}},i.onerror=e=>n(i.error)})}}var F=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const L="/",P="tensorflowjs_models",B="info",$="model_topology",U="weight_specs",V="weight_data",z="model_metadata";function j(e){return{info:[P,e,B].join(L),topology:[P,e,$].join(L),weightSpecs:[P,e,U].join(L),weightData:[P,e,V].join(L),modelMetadata:[P,e,z].join(L)}}function Y(e){for(const t of Object.values(e))window.localStorage.removeItem(t)}function G(e){const t=e.split(L);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(L)}class H{constructor(e){if(!(0,y._K)().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=j(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),i=(0,b.oR)(e),r=A.D.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(i)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,n),this.LS.setItem(this.keys.weightData,(0,b.l3)(r));const s={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,initializerSignature:null!=e.initializerSignature?e.initializerSignature:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(s)),{modelArtifactsInfo:i}}catch(e){throw Y(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${i.modelTopologyBytes}, weightSpecsBytes=${i.weightSpecsBytes}, weightDataBytes=${i.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(null==e)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const t={},n=JSON.parse(this.LS.getItem(this.keys.topology));if(null==n)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=n;const i=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==i)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=i;const r=this.LS.getItem(this.keys.modelMetadata);if(null!=r){const e=JSON.parse(r);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(t.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}const s=this.LS.getItem(this.keys.weightData);if(null==s)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=(0,b.jf)(s),t}}H.URL_SCHEME="localstorage://";const W=e=>{return(0,y._K)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(H.URL_SCHEME)?(t=e.slice(H.URL_SCHEME.length),new H(t)):null;var t};T.registerSaveRouter(W),T.registerLoadRouter(W);class X{constructor(){(0,F.vA)((0,y._K)().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),(0,F.vA)("undefined"==typeof window||void 0!==window.localStorage,()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},t=P+L,n=L+B;for(let i=0;i<this.LS.length;++i){const r=this.LS.key(i);if(r.startsWith(t)&&r.endsWith(n)){e[G(r)]=JSON.parse(this.LS.getItem(r))}}return e}async removeModel(e){var t;const n=j(e=(t=e).startsWith(H.URL_SCHEME)?t.slice(H.URL_SCHEME.length):t);if(null==this.LS.getItem(n.info))throw new Error(`Cannot find model at path '${e}'`);const i=JSON.parse(this.LS.getItem(n.info));return Y(n),i}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const q="://";class K{constructor(){this.managers={}}static getInstance(){return null==K.instance&&(K.instance=new K),K.instance}static registerManager(e,t){(0,F.vA)(null!=e,()=>"scheme must not be undefined or null."),e.endsWith(q)&&(e=e.slice(0,e.indexOf(q))),(0,F.vA)(e.length>0,()=>"scheme must not be an empty string.");const n=K.getInstance();(0,F.vA)(null==n.managers[e],()=>`A model store manager is already registered for scheme '${e}'.`),n.managers[e]=t}static getManager(e){const t=K.getInstance().managers[e];if(null==t)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(K.getInstance().managers)}}function Z(e){if(-1===e.indexOf(q))throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${K.getSchemes().join(",")}`);return{scheme:e.split(q)[0],path:e.split(q)[1]}}async function Q(e,t,n=!1){(0,F.vA)(e!==t,()=>`Old path and new path are the same: '${e}'`);const i=T.getLoadHandlers(e);(0,F.vA)(i.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),(0,F.vA)(i.length<2,()=>`Copying failed because more than one (${i.length}) load handlers for source URL ${e}.`);const r=i[0],s=T.getSaveHandlers(t);(0,F.vA)(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),(0,F.vA)(s.length<2,()=>`Copying failed because more than one (${i.length}) save handlers for destination URL ${t}.`);const o=s[0],a=Z(e).scheme,l=Z(e).path,u=a===Z(e).scheme,c=await r.load();n&&u&&await K.getManager(a).removeModel(l);const d=await o.save(c);return n&&!u&&await K.getManager(a).removeModel(l),d.modelArtifactsInfo}async function J(){const e=K.getSchemes(),t={};for(const n of e){const e=await K.getManager(n).listModels();for(const i in e){t[n+q+i]=e[i]}}return t}async function ee(e){const t=Z(e);return K.getManager(t.scheme).removeModel(t.path)}async function te(e,t){return Q(e,t,!1)}async function ne(e,t){return Q(e,t,!0)}var ie=n(86448);
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class re{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&&(0,y._K)().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(0,ie.Y)(e)}}if((0,y._K)().get("IS_BROWSER")){(0,y._K)().setPlatform("browser",new re);try{K.registerManager(H.URL_SCHEME,new X)}catch(e){}try{K.registerManager(R.URL_SCHEME,new D)}catch(e){}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const se=()=>n(85817);let oe;class ae{constructor(){this.util=n(18590),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=(0,y._K)().global.fetch?(0,y._K)().global.fetch(e,t):(null==oe&&(oe=se()),oe(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)}}(0,y._K)().get("IS_NODE")&&!(0,y._K)().get("IS_BROWSER")&&(0,y._K)().setPlatform("node",new ae);var le=n(448),ue=n(29809),ce=n(70125),de=n(75295),he=n(50259);
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,p.Ye)();const pe={buffer:le.r,cast:ue.w,clone:ce.o,print:de.y};(0,he.Q5)(pe);var fe=n(35287),me=n(37523),ge=n(89359),_e=n(9258),ye=n(79348),ve=n(45793),be=n(55537),Te=n(31830),xe=n(45702);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Ee=new Map,we=new Map;class Ie{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class Ae{constructor(){this.classNameMap={}}static getMap(){return null==Ae.instance&&(Ae.instance=new Ae),Ae.instance}static register(e){Ae.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Se(e,t,n){(0,F.vA)(null!=e.className,()=>"Class being registered does not have the static className property defined."),(0,F.vA)("string"==typeof e.className,()=>"className is required to be a string, but got type "+typeof e.className),(0,F.vA)(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 i=t+">"+n;return Ae.register(e),Ee.set(i,e),we.set(e,i),e}function Ce(e){return we.has(e)?we.get(e):e.className}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Oe extends Ie{minimize(e,t=!1,n){const{value:i,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(0,fe.AS)(r),t?i:(i.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return(0,Te.y7)(e,t)}dispose(){null!=this.iterations_&&(0,fe.AS)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:(0,xe.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(Oe,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Me extends Oe{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=p.T2.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const i=p.T2.registeredVariables[t],r=!1;null==this.accumulatedGrads[n]&&(this.accumulatedGrads[n]={originalName:`${t}/accum_grad`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(r))}),null==this.accumulatedUpdates[n]&&(this.accumulatedUpdates[n]={originalName:`${t}/accum_var`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(r))});const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const o=this.accumulatedGrads[n].variable,a=this.accumulatedUpdates[n].variable;(0,fe.DZ)(()=>{const e=(0,me.W)((0,_e.l)(o,this.rho),(0,_e.l)((0,ve.E)(s),1-this.rho)),t=(0,_e.l)((0,ge.y)((0,ye.R)((0,me.W)(a,this.epsilon)),(0,ye.R)((0,me.W)(o,this.epsilon))),s),n=(0,me.W)((0,_e.l)(a,this.rho),(0,_e.l)((0,ve.E)(t),1-this.rho));o.assign(e),a.assign(n);const r=(0,me.W)((0,_e.l)(t,-this.learningRate),i);i.assign(r)})}),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&((0,fe.AS)(this.accumulatedGrads.map(e=>e.variable)),(0,fe.AS)(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)}}var ke=n(96111);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Re extends Oe{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 i=p.T2.registeredVariables[t];if(null==this.accumulatedGrads[n]){const e=!1;this.accumulatedGrads[n]={originalName:`${t}/accumulator`,variable:(0,fe.DZ)(()=>(0,ke.G)(i.shape,this.initialAccumulatorValue).variable(e))}}const r=Array.isArray(e)?e[n].tensor:e[t];if(null==r)return;const s=this.accumulatedGrads[n].variable;(0,fe.DZ)(()=>{const e=(0,me.W)(s,(0,ve.E)(r));s.assign(e);const t=(0,me.W)((0,_e.l)((0,ge.y)(r,(0,ye.R)((0,me.W)(e,p.T2.backend.epsilon()))),-this.learningRate),i);i.assign(t)})}),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&(0,fe.AS)(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)}}var Ne=n(98990),De=n(77126);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Fe extends Oe{static get className(){return"Adam"}constructor(e,t,n,i=null){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=i,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],(0,fe.DZ)(()=>{this.accBeta1=(0,xe.d)(t).variable(),this.accBeta2=(0,xe.d)(n).variable()}),null==i&&(this.epsilon=p.T2.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);(0,fe.DZ)(()=>{const n=(0,De.j)(1,this.accBeta1),i=(0,De.j)(1,this.accBeta2);t.forEach((t,r)=>{const s=p.T2.registeredVariables[t],o=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:(0,fe.DZ)(()=>(0,be.P)(s).variable(o))}),null==this.accumulatedSecondMoment[r]&&(this.accumulatedSecondMoment[r]={originalName:`${t}/v`,variable:(0,fe.DZ)(()=>(0,be.P)(s).variable(o))});const a=Array.isArray(e)?e[r].tensor:e[t];if(null==a)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedSecondMoment[r].variable,c=(0,me.W)((0,_e.l)(l,this.beta1),(0,_e.l)(a,1-this.beta1)),d=(0,me.W)((0,_e.l)(u,this.beta2),(0,_e.l)((0,ve.E)(a),1-this.beta2)),h=(0,ge.y)(c,n),f=(0,ge.y)(d,i);l.assign(c),u.assign(d);const m=(0,me.W)((0,_e.l)((0,ge.y)(h,(0,me.W)((0,ye.R)(f),this.epsilon)),-this.learningRate),s);s.assign(m)}),this.accBeta1.assign((0,_e.l)(this.accBeta1,this.beta1)),this.accBeta2.assign((0,_e.l)(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&(0,fe.AS)(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedSecondMoment&&(0,fe.AS)(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),(0,fe.DZ)(()=>{this.accBeta1.assign((0,Ne.n)(this.beta1,this.iterations_+1)),this.accBeta2.assign((0,Ne.n)(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)}}var Le=n(4888),Pe=n(30178);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Be extends Oe{static get className(){return"Adamax"}constructor(e,t,n,i=null,r=0){super(),this.learningRate=e,this.beta1=t,this.beta2=n,this.epsilon=i,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],(0,fe.DZ)(()=>{this.iteration=(0,xe.d)(0).variable(),this.accBeta1=(0,xe.d)(t).variable()}),null==i&&(this.epsilon=p.T2.backend.epsilon())}applyGradients(e){const t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);(0,fe.DZ)(()=>{const n=(0,De.j)(1,this.accBeta1),i=(0,ge.y)(-this.learningRate,(0,me.W)((0,_e.l)(this.iteration,this.decay),1));t.forEach((t,r)=>{const s=p.T2.registeredVariables[t],o=!1;null==this.accumulatedFirstMoment[r]&&(this.accumulatedFirstMoment[r]={originalName:`${t}/m`,variable:(0,be.P)(s).variable(o)}),null==this.accumulatedWeightedInfNorm[r]&&(this.accumulatedWeightedInfNorm[r]={originalName:`${t}/v`,variable:(0,be.P)(s).variable(o)});const a=Array.isArray(e)?e[r].tensor:e[t];if(null==a)return;const l=this.accumulatedFirstMoment[r].variable,u=this.accumulatedWeightedInfNorm[r].variable,c=(0,me.W)((0,_e.l)(l,this.beta1),(0,_e.l)(a,1-this.beta1)),d=(0,_e.l)(u,this.beta2),h=(0,Le.t)(a),f=(0,Pe.P)(d,h);l.assign(c),u.assign(f);const m=(0,me.W)((0,_e.l)((0,ge.y)(i,n),(0,ge.y)(c,(0,me.W)(f,this.epsilon))),s);s.assign(m)}),this.iteration.assign((0,me.W)(this.iteration,1)),this.accBeta1.assign((0,_e.l)(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&(0,fe.AS)(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedWeightedInfNorm&&(0,fe.AS)(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)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class $e extends Oe{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 i=Array.isArray(e)?e[n].tensor:e[t];if(null==i)return;const r=p.T2.registeredVariables[t];(0,fe.DZ)(()=>{const e=(0,me.W)((0,_e.l)(this.c,i),r);r.assign(e)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=(0,fe.aC)((0,xe.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)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Ue extends $e{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=(0,xe.d)(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,n)=>{const i=p.T2.registeredVariables[t];if(null==this.accumulations[n]){const e=!1;this.accumulations[n]={originalName:`${t}/momentum`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(e))}}const r=this.accumulations[n].variable,s=Array.isArray(e)?e[n].tensor:e[t];null!=s&&(0,fe.DZ)(()=>{let e;const t=(0,me.W)((0,_e.l)(this.m,r),s);e=this.useNesterov?(0,me.W)((0,_e.l)(this.c,(0,me.W)(s,(0,_e.l)(t,this.m))),i):(0,me.W)((0,_e.l)(this.c,t),i),r.assign(t),i.assign(e)})}),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&(0,fe.AS)(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)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Ve extends Oe{static get className(){return"RMSProp"}constructor(e,t=.9,n=0,i=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=n,this.epsilon=i,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,null==i&&(this.epsilon=p.T2.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 i=p.T2.registeredVariables[t],r=!1;null==this.accumulatedMeanSquares[n]&&(this.accumulatedMeanSquares[n]={originalName:`${t}/rms`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(r))}),null==this.accumulatedMoments[n]&&(this.accumulatedMoments[n]={originalName:`${t}/momentum`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(r))}),null==this.accumulatedMeanGrads[n]&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${t}/mg`,variable:(0,fe.DZ)(()=>(0,be.P)(i).variable(r))});const s=Array.isArray(e)?e[n].tensor:e[t];if(null==s)return;const o=this.accumulatedMeanSquares[n].variable,a=this.accumulatedMoments[n].variable;(0,fe.DZ)(()=>{const e=(0,me.W)((0,_e.l)(o,this.decay),(0,_e.l)((0,ve.E)(s),1-this.decay));if(this.centered){const t=this.accumulatedMeanGrads[n].variable,r=(0,me.W)((0,_e.l)(t,this.decay),(0,_e.l)(s,1-this.decay)),l=(0,ge.y)((0,_e.l)(s,this.learningRate),(0,ye.R)((0,De.j)(e,(0,me.W)((0,ve.E)(r),this.epsilon)))),u=(0,me.W)((0,_e.l)(a,this.momentum),l);o.assign(e),t.assign(r),a.assign(u);const c=(0,De.j)(i,u);i.assign(c)}else{const e=(0,me.W)((0,_e.l)(o,this.decay),(0,_e.l)((0,ve.E)(s),1-this.decay)),t=(0,me.W)((0,_e.l)(a,this.momentum),(0,ge.y)((0,_e.l)(s,this.learningRate),(0,ye.R)((0,me.W)(e,this.epsilon))));o.assign(e),a.assign(t);const n=(0,De.j)(i,t);i.assign(n)}})}),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&(0,fe.AS)(this.accumulatedMeanSquares.map(e=>e.variable)),null!=this.accumulatedMeanGrads&&this.centered&&(0,fe.AS)(this.accumulatedMeanGrads.map(e=>e.variable)),null!=this.accumulatedMoments&&(0,fe.AS)(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)}}
/**
* @license
* Copyright 2022 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const ze=[Me,Re,Fe,Be,Ue,Ve,$e];function je(e){return new Promise(e=>setTimeout(e)).then(e)}class Ye{constructor(e){if(!(0,y._K)().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(Ye.URL_SCHEME)&&(e=e.slice(Ye.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=A.D.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=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],i=(0,b.zV)(e,t),r=window.URL.createObjectURL(new Blob([JSON.stringify(i)],{type:"application/json"})),s=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(s.download=this.modelJsonFileName,s.href=r,await je(()=>s.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 je(()=>e.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:(0,b.oR)(e)}}}}Ye.URL_SCHEME="downloads://";class Ge{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 i=JSON.parse(n.target.result),r=i.modelTopology;if(null==r)return void t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));if(null==i.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 s=(0,b.Ej)(i,e=>this.loadWeights(e));e(s)},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 i of e)t.push(...i.weights),n.push(...i.paths);const i=this.checkManifestAndWeightFiles(e),r=n.map(e=>this.loadWeightsFile(e,i[e]));return Promise.all(r).then(e=>[t,e])}loadWeightsFile(e,t){return new Promise((n,i)=>{const r=new FileReader;r.onload=e=>{const t=e.target.result;n(t)},r.onerror=t=>i(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){const t=[],n=this.weightsFiles.map(e=>(0,b.P8)(e.name)),i={};for(const r of e)r.paths.forEach(e=>{const r=(0,b.P8)(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.`);i[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 i}}function He(e){return new Ge(e)}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function We(e,t,n,i){!function(e){(0,F.vA)(null!=e&&Array.isArray(e)&&e.length>0,()=>"promises must be a none empty array")}(e),function(e,t){(0,F.vA)(e>=0&&e<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${e}`),(0,F.vA)(t>=0&&t<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${t}`),(0,F.vA)(t>=e,()=>`startFraction must be no more than endFraction, but got startFraction ${e} and endFraction ${t}`)}(n=null==n?0:n,i=null==i?1:i);let r=0;return Promise.all(e.map(s=>(s.then(s=>{const o=n+ ++r/e.length*(i-n);return t(o),s}),s)))}T.registerSaveRouter(e=>(0,y._K)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Ye.URL_SCHEME)?function(e="model"){return new Ye(e)}(e.slice(Ye.URL_SCHEME.length)):null);var Xe=n(15685);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function qe(e,t){null==t&&(t={});const n=null==t.fetchFunc?(0,y._K)().platform.fetch:t.fetchFunc,i=e.map(e=>n(e,t.requestInit,{isBinary:!0})),r=(null==t.onProgress?await Promise.all(i):await We(i,t.onProgress,0,.5)).map(e=>e.arrayBuffer());return null==t.onProgress?await Promise.all(r):await We(r,t.onProgress,.5,1)}async function Ke(e,t="",n,i){return Ze(e=>qe(e,{requestInit:i}))(e,t,n)}function Ze(e){return async(t,n="",i)=>{const r=t.map(()=>!1),s={},o=null!=i?i.map(()=>!1):[],a=[];if(t.forEach((e,t)=>{let n=0;e.weights.forEach(e=>{const l="quantization"in e?e.quantization.dtype:e.dtype,u=Xe.i[l]*F.Ze(e.shape),c=()=>{r[t]=!0,null==s[t]&&(s[t]=[]),s[t].push({manifestEntry:e,groupOffset:n,sizeBytes:u})};null!=i?i.forEach((t,n)=>{t===e.name&&(c(),o[n]=!0)}):c(),a.push(e.name),n+=u})}),!o.every(e=>e)){const e=i.filter((e,t)=>!o[t]);throw new Error(`Could not find weights in manifest with names: ${e.join(", ")}. \nManifest JSON has weights with names: ${a.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),d={};let h=0;return l.forEach(e=>{const n=t[e].paths.length,i=new A.D(c.slice(h,h+n));s[e].forEach(e=>{const t=i.slice(e.groupOffset,e.groupOffset+e.sizeBytes),n=(0,b.CY)(t,[e.manifestEntry]);for(const e in n)d[e]=n[e]}),h+=n}),d}}class Qe{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?((0,F.vA)("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=(0,y._K)().platform.fetch,(0,F.vA)(null!=e&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&(0,F.vA)(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=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],i=(0,b.zV)(e,n);if(t.body.append("model.json",new Blob([JSON.stringify(i)],{type:"application/json"}),"model.json"),null!=e.weightData){const n=A.D.join(e.weightData);t.body.append("model.weights.bin",new Blob([n],{type:"application/octet-stream"}),"model.weights.bin")}const r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:(0,b.oR)(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.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,i=t.weightsManifest;if(null==n&&null==i)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();const e=await this.loadModelJSON();return(0,b.Ej)(e,e=>this.loadWeights(e))}async loadStream(){const e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),n=(0,b.Xf)(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:n,getWeightStream:()=>function(e,t){var n;const i=null==t.fetchFunc?(0,y._K)().platform.fetch:t.fetchFunc;let r,s=0;return null===(n=t.onProgress)||void 0===n||n.call(t,0),new ReadableStream({pull:async n=>{for(var o;s<e.length;){if(!r){const n=(await i(e[s],t.requestInit,{isBinary:!0})).body;r=n.getReader()}const{done:a,value:l}=await r.read();if(!a)return void n.enqueue(l);s++,r=void 0,null===(o=t.onProgress)||void 0===o||o.call(t,s/e.length)}n.close()}})}(t,this.loadOptions)})}async getWeightUrls(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[n,i]=function(e){const t=e.lastIndexOf("/"),n=e.lastIndexOf("?"),i=e.substring(0,t),r=n>t?e.substring(n):"";return[i+"/",r]}(t),r=this.weightPathPrefix||n,s=[],o=[];for(const t of e)for(const e of t.paths)null!=this.weightUrlConverter?o.push(this.weightUrlConverter(e)):s.push(r+e+i);return this.weightUrlConverter&&s.push(...await Promise.all(o)),s}async loadWeights(e){const t=await this.getWeightUrls(e);return[(0,b.Xf)(e),await qe(t,this.loadOptions)]}}function Je(e){return null!=e.match(Qe.URL_SCHEME_REGEX)}Qe.URL_SCHEME_REGEX=/^https?:\/\//;const et=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc))return null;{let n=!0;if(n=Array.isArray(e)?e.every(e=>Je(e)):Je(e),n)return tt(e,t)}return null};function tt(e,t){return new Qe(e,t)}function nt(e,t){return tt(e,t)}T.registerSaveRouter(et),T.registerLoadRouter(et);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class it{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class rt{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class st{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function ot(e,t,n,i){return new st(at(...arguments))}function at(e,t,n,i){if(1===arguments.length){return null!=e.modelTopology||null!=e.weightSpecs?new it(e):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new it({modelTopology:e}))}return console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new it({modelTopology:e,weightSpecs:t,weightData:n,trainingConfig:i})}function lt(e){return new rt(e)}function ut(e){return new rt(e)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var ct=n(28189),dt=n(65703),ht=n(11760),pt=n(70929),ft=n(7703);const mt=(0,pt.op)({confusionMatrix_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,ct.YT)(e,"labels","confusionMatrix"),r=(0,ct.YT)(t,"predictions","confusionMatrix");F.vA(null==n||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),F.vA(1===i.rank,()=>`Expected the rank of labels to be 1, but got ${i.rank}`),F.vA(1===r.rank,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),F.vA(i.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${i.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),F.vA(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);const s=(0,ht.M)((0,ue.w)(i,"int32"),n),o=(0,ht.M)((0,ue.w)(r,"int32"),n),a=(0,ft.m)(s),l=(0,dt.N)(a,o);return(0,ue.w)(l,"int32")}});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var gt=n(62198),_t=n(15441),yt=n(37074),vt=n(42768);
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
let bt,Tt=!1;function xt(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,i=!1,r=!1,s=!1,o=!1,a=!1;if(e.data instanceof Uint8Array)n=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)i=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)r=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)s=!0;else if(null!=e.getContext)o=!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}`);a=!0}if(null!=(0,yt._5)(_t.awo,p.T2.backendName)){const n={pixels:e},i={numChannels:t};return p.T2.runKernel(_t.awo,n,i)}const[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height];let c,d;if(o)c=e.getContext("2d").getImageData(0,0,l,u).data;else if(i||n)c=e.data;else if(s||r||a){if(null==bt)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.");bt=new OffscreenCanvas(1,1).getContext("2d")}else bt=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});bt.canvas.width=l,bt.canvas.height=u,bt.drawImage(e,0,0,l,u),c=bt.getImageData(0,0,l,u).data}if(4===t)d=new Int32Array(c);else{const e=l*u;d=new Int32Array(e*t);for(let n=0;n<e;n++)for(let e=0;e<t;++e)d[n*t+e]=c[4*n+e]}const h=[u,l,t];return(0,vt.$)(d,h,"int32")}function Et(e){return"undefined"!=typeof window&&"undefined"!=typeof ImageBitmap&&window.hasOwnProperty("createImageBitmap")&&!(e instanceof ImageBitmap)&&function(e){return null!=e&&0!==e.width&&0!==e.height}(e)&&!function(e){return null!=e&&e.data instanceof Uint8Array}(e)}async function wt(e,t=3){let n=null;if((0,y._K)().getBool("WRAP_TO_IMAGEBITMAP")&&Et(e)){let t;try{t=await createImageBitmap(e,{premultiplyAlpha:"none"})}catch(e){t=null}n=null!=t&&t.width===e.width&&t.height===e.height?t:e}else n=e;return xt(n,t)}function It(e){if(2!==e.rank&&3!==e.rank)throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${e.rank}.`);const t=2===e.rank?1:e.shape[2];if(t>4||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 At(e,t){let n=(0,ct.YT)(e,"img","toPixels");if(!(e instanceof he.qY)){const e=n;n=(0,ue.w)(e,"int32"),e.dispose()}It(n);const[i,r]=n.shape.slice(0,2),s=2===n.rank?1:n.shape[2],o=await n.data(),a="float32"===n.dtype?255:1,l=new Uint8ClampedArray(r*i*4);for(let e=0;e<i*r;++e){const t=[0,0,0,255];for(let i=0;i<s;i++){const r=o[e*s+i];if("float32"===n.dtype){if(r<0||r>1)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===s?(t[0]=r*a,t[1]=r*a,t[2]=r*a):t[i]=r*a}const i=4*e;l[i+0]=Math.round(t[0]),l[i+1]=Math.round(t[1]),l[i+2]=Math.round(t[2]),l[i+3]=Math.round(t[3])}if(null!=t){if(!Tt){null!=(0,yt._5)(_t.XmO,p.T2.backendName)&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),Tt=!0)}t.width=r,t.height=i;const e=t.getContext("2d"),n=new ImageData(l,r,i);e.putImageData(n,0,0)}return n!==e&&n.dispose(),l}function St(e,t,n){let i=(0,ct.YT)(e,"img","draw");if(!(e instanceof he.qY)){const e=i;i=(0,ue.w)(e,"int32"),e.dispose()}It(i),function(e){const t=(null==e?void 0:e.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}(null==n?void 0:n.imageOptions);const r={image:i},s={canvas:t,options:n};p.T2.runKernel(_t.XmO,r,s)}const Ct=(0,pt.op)({fromPixels_:xt});function Ot(e,t){const n=e.shape.length,i=t.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(i<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${i}.`);if("int32"!==t.dtype)throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[i-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[i-1]} vs. ${n}`);if(0===(0,F.Ze)(e.shape))throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);const r=t.shape,s=r[r.length-1];let o=1;for(let e=0;e<r.length-1;++e)o*=r[e];const a=e.shape,l=r.slice();l.pop();let u=1;for(let e=s;e<n;++e)u*=a[e],l.push(a[e]);const c=[...(0,F.Ur)(e.shape).map(e=>e/u),1].slice(0,s);return[l,o,u,c]}var Mt=n(26170),kt=n(34969),Rt=n(30565),Nt=n(83879);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Dt=.001,Ft=.1;function Lt(e,t,n){return null==n&&(n=Pt()),Bt(e,t,(e,t)=>zt(e,t,n))}function Pt(){return 32===p.T2.backend.floatPrecision()?Dt:Ft}function Bt(e,t,n){let i=!0;if(((0,Nt.isTypedArray)(e)||(0,Nt.isTypedArray)(t))&&(i=!1),(0,Nt.isTypedArray)(e)&&(0,Nt.isTypedArray)(t)&&(i=!0),i){const n=e.constructor.name,i=t.constructor.name;if(n!==i)throw new Error(`Arrays are of different type. Actual: ${n}. Expected: ${i}`)}if(Array.isArray(e)&&Array.isArray(t)){const n=(0,ct.MZ)(e),i=(0,ct.MZ)(t);if(!(0,F.r1)(n,i))throw new Error(`Arrays have different shapes. Actual: [${n}]. Expected: [${i}]`)}const r=(0,Nt.isTypedArray)(e)?e:(0,Nt.flatten)(e),s=(0,Nt.isTypedArray)(t)?t:(0,Nt.flatten)(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}.\nActual: ${r}.\nExpected: ${s}.`);for(let e=0;e<s.length;++e){const t=r[e],i=s[e];if(!n(t,i))throw new Error(`Arrays differ: actual[${e}] = ${t}, expected[${e}] = ${i}.\nActual: ${r}.\nExpected: ${s}.`)}"undefined"!=typeof expect&&expect().nothing()}function $t(e,t){e().then(()=>t.fail(),()=>t()),"undefined"!=typeof expect&&expect().nothing()}function Ut(e,t){const n="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return(0,F.Kg)(e)||(0,F.Kg)(e[0])||(0,F.Kg)(t)||(0,F.Kg)(t[0])?Bt(e,n,(e,t)=>e==t):Bt(e,t,(e,t)=>zt(e,t,0))}function Vt(e,t,n){if(null==n&&(n=Pt()),!zt(e,t,n))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`);"undefined"!=typeof expect&&expect().nothing()}function zt(e,t,n){return!isFinite(e)&&!isFinite(t)||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>n)}function jt(e,t,n){for(let i=0;i<e.length;i++)if(e[i]<t||e[i]>n)throw new Error(`Value out of range:${e[i]} low: ${t}, high: ${n}`)}function Yt(e,t){const n=new Float32Array(e),i=new Float32Array(t);if(n.length!==i.length)throw new Error(`Expected ArrayBuffer to be of length ${i.length}, but it was ${n.length}`);for(let e=0;e<i.length;e++)if(n[e]!==i[e])throw new Error(`Expected ArrayBuffer value at ${e} to be ${i[e]} but got ${n[e]} instead`)}function Gt(e){for(let t=0;t<e.length;t++){const n=e[t];Array.isArray(n)?Gt(n):e[t]=(0,Nt.encodeString)(n)}return e}function Ht(e){const t=document.createElement("video");return"playsInline"in t&&(t.playsInline=!0),t.muted=!0,t.loop=!0,t.style.position="fixed",t.style.left="0px",t.style.top="0px",t.preload="auto",t.appendChild(e),new Promise(e=>{t.addEventListener("loadeddata",n=>e(t)),t.load()})}async function Wt(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise(t=>{e.requestVideoFrameCallback(t)})}
/** @license See the LICENSE file. */
const Xt="4.22.0";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class qt{static sgd(e){return new $e(e)}static momentum(e,t,n=!1){return new Ue(e,t,n)}static rmsprop(e,t=.9,n=0,i=null,r=!1){return new Ve(e,t,n,i,r)}static adam(e=.001,t=.9,n=.999,i=null){return new Fe(e,t,n,i)}static adadelta(e=.001,t=.95,n=null){return new Me(e,t,n)}static adamax(e=.002,t=.9,n=.999,i=null,r=0){return new Be(e,t,n,i,r)}static adagrad(e,t=.1){return new Re(e,t)}}var Kt=n(52046),Zt=n(67270),Qt=n(27084);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Jt=qt,en="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function tn(){return new Promise(e=>en(()=>e()))}var nn=n(21078);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function rn(e,t){const n=e[0].length;e.forEach((e,t)=>{F.vA(e.length===n,()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`)}),F.vA(t>=0&&t<n,()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const i=e[0];e.forEach((e,r)=>{for(let s=0;s<n;s++)F.vA(s===t||e[s]===i[s],()=>`Error in concat${n}D: Shape of tensors[${r}] (${e}) does not match the shape of the rest (${i}) along the non-concatenated axis ${r}.`)})}function sn(e,t){const n=e[0].slice();for(let i=1;i<e.length;i++)n[t]+=e[i][t];return n}var on,an=n(47195),ln=n(68646);function un(e,t,n){let i=new Array;if(null==n&&null==t)return i;if(null==t)for(;i.length<e+n.length;)i.push(-1);else i=t.slice();if(null==n)return i;if(e+n.length!==i.length)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.rank = ${e+n.length}, but shape.rank = ${i.length}`);for(let r=1;r<n.length;++r){const s=n[r],o=i[i.length-n.length+r],a=i[o];if(s>=0)if(a>=0){if(a!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${s} but shape[${r+e}] = ${a}`)}else i[o]=s}return i}function cn(e){const t={FIRST_DIM_SIZE:on.FIRST_DIM_SIZE,VALUE_ROWIDS:on.VALUE_ROWIDS,ROW_LENGTHS:on.ROW_LENGTHS,ROW_SPLITS:on.ROW_SPLITS,ROW_LIMITS:on.ROW_LIMITS,ROW_STARTS:on.ROW_STARTS},n=[];for(const i of e){if(!(i in t))break;n.push(t[i])}return n}function dn(e){return 0===e.length?0:e[0]===on.FIRST_DIM_SIZE?e.length-1:e.length}function hn(e,t){if(null==e||null==t)return;const n=e.length,i=t.length;if(n>=i)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 = ${i})`);for(let r=0;r<Math.min(n,i-1);++r){const n=e[r],i=t[r+1];if(n>=0&&i>=0&&1!==n&&n!==i)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}] = ${i}`)}}!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"}(on||(on={}));
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const pn=30;function fn(e){return e<=pn?e:(0,F.lK)(e,Math.floor(Math.sqrt(e)))}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function mn(e,t,n){return[n*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function gn(e,t,n,i=!0){let r=[];if(i)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 i=0;i<n;++i)r=r.concat([e[i+1]/t[i],t[i]]);r=r.concat(e.slice(n+1))}return r}function _n(e,t,n=!0){const i=[];if(n){i.push(t);for(let n=t+1;n<e;++n)n<=2*t?(i.push(n),i.push(n-(t+1))):i.push(n)}else{const n=[],r=[];for(let i=1;i<e;++i)i>=2*t+1||i%2==1?r.push(i):n.push(i);i.push(...n),i.push(0),i.push(...r)}return i}function yn(e,t,n,i=!0){const r=[];i?r.push(e[0]/n):r.push(e[0]*n);for(let n=1;n<e.length;++n)n<=t.length?i?r.push(t[n-1]*e[n]):r.push(e[n]/t[n-1]):r.push(e[n]);return r}function vn(e,t){const n=[0];for(let i=0;i<t;++i)n.push(e[i][0]);return n}function bn(e,t,n){const i=e.slice(0,1);for(let r=0;r<n;++r)i.push(e[r+1]-t[r][0]-t[r][1]);return i}var Tn=n(28576);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const xn=.3275911,En=.254829592,wn=-.284496736,In=1.421413741,An=-1.453152027,Sn=1.061405429;var Cn=n(73673);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function On(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 i=0;i<n.length;i+=2)n[i]=e[i/2],n[i+1]=t[i/2];return n}function Mn(e){const t=new Float32Array(e.length/2),n=new Float32Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=e[i],n[i/2]=e[i+1];return{real:t,imag:n}}function kn(e){const t=Math.ceil(e.length/4),n=new Float32Array(t),i=new Float32Array(t);for(let t=0;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],i[Math.floor(t/4)]=e[t+1];return{real:n,imag:i}}function Rn(e){const t=Math.floor(e.length/4),n=new Float32Array(t),i=new Float32Array(t);for(let t=2;t<e.length;t+=4)n[Math.floor(t/4)]=e[t],i[Math.floor(t/4)]=e[t+1];return{real:n,imag:i}}function Nn(e,t){return{real:e[2*t],imag:e[2*t+1]}}function Dn(e,t,n,i){e[2*i]=t,e[2*i+1]=n}function Fn(e,t){const n=new Float32Array(e/2),i=new Float32Array(e/2);for(let r=0;r<Math.ceil(e/2);r++){const s=(t?2:-2)*Math.PI*(r/e);n[r]=Math.cos(s),i[r]=Math.sin(s)}return{real:n,imag:i}}function Ln(e,t,n){const i=(n?2:-2)*Math.PI*(e/t);return{real:Math.cos(i),imag:Math.sin(i)}}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Pn="->",Bn=/->/g,$n=",",Un="...";function Vn(e,t){const n=((e=e.replace(/\s/g,"")).length-e.replace(Bn,"").length)/Pn.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 ("${Pn}").`);const[i,r]=e.split(Pn);(0,F.vA)(-1===i.indexOf(Un),()=>`The ellipsis notation ("${Un}") is not supported yet.`);const s=i.split($n),o=s.length;if(t!==o)throw new Error(`Expected ${o} input tensors, received ${t}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const a=[];for(let e=0;e<r.length;++e){const t=r[e];if(!s.some(e=>-1!==e.indexOf(t)))throw new Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===a.indexOf(t)&&a.push(t)}for(let e=0;e<i.length;++e){const t=i[e];-1===a.indexOf(t)&&t!==$n&&a.push(t)}const l=new Array(s.length);for(let e=0;e<o;++e){if(new Set(s[e].split("")).size!==s[e].length)throw new Error(`Found duplicate axes in input component ${s[e]}. Support for duplicate axes in input is not implemented yet.`);l[e]=[];for(let t=0;t<s[e].length;++t)l[e].push(a.indexOf(s[e][t]))}const u=a.length,c=[];for(let e=r.length;e<u;++e)c.push(e);return{allDims:a,summedDims:c,idDims:l}}function zn(e,t){let n=new Array(e);n.fill(-1);for(let e=0;e<t.length;++e)n[t[e]]=e;const i=[];for(let t=0;t<e;++t)-1===n[t]&&i.push(t);return n=n.filter(e=>-1!==e),{permutationIndices:n,expandDims:i}}function jn(e,t,n){const i=new Array(e);for(let e=0;e<n.length;++e){const r=n[e].shape;for(let n=0;n<t[e].length;++n)void 0===i[t[e][n]]?i[t[e][n]]=r[n]:(0,F.vA)(i[t[e][n]]===r[n],()=>`Expected dimension ${i[t[e][n]]} at axis ${n} of input shaped ${JSON.stringify(r)}, but got dimension ${r[n]}`)}}function Yn(e,t){const n=e,i=[];let r=0;0===e.length&&n.push(-1),r=e.length+1;for(let e=0;e<r;++e)i.push([]);const s=[];for(let e=0;e<n.length;++e){const r=Hn(t,n[e]);for(const t of r)-1===s.indexOf(t)&&(i[e].push(t),s.push(t))}return{path:n,steps:i}}function Gn(e){return e.every((e,t)=>e===t)}function Hn(e,t){const n=[];for(let i=0;i<e.length;++i)0!==e[i].length&&-1===e[i].indexOf(t)&&-1!==t||n.push(i);return n}function Wn(e,t,n=0){let i=[];if("number"==typeof t)(0,F.vA)(e.shape[n]%t===0,()=>"Number of splits must evenly divide the axis."),i=new Array(t).fill(e.shape[n]/t);else{const r=t.reduce((e,t)=>(-1===t&&(e+=1),e),0);(0,F.vA)(r<=1,()=>"There should be only one negative value in split array.");const s=t.indexOf(-1);if(-1!==s){const i=t.reduce((e,t)=>t>0?e+t:e);t[s]=e.shape[n]-i}(0,F.vA)(e.shape[n]===t.reduce((e,t)=>e+t),()=>"The sum of sizes must match the size of the axis dimension."),i=t}return i}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Xn(e){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${e}`}function qn(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function Kn(e,t,n){return`indices(${e}, 0) is invalid: ${t} >= ${n}`}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Zn(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function Qn(e,t){return`size ${e} must be non-negative, not ${t}`}function Jn(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function ei(e,t){return`Input to reshape is a SparseTensor with ${(0,F.Ze)(e)}\n dense values, but the requested shape requires a multiple of ${(0,F.Ze)(t)}. inputShape=${e} outputShape= ${t}`}function ti(e,t){return`Input to reshape is a tensor with ${(0,F.Ze)(e)} dense values, but the requested shape has ${(0,F.Ze)(t)}. inputShape=${e} outputShape=${t}`}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ni(){return"segment ids must be >= 0"}function ii(){return"segment ids are not increasing"}function ri(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function si(e,t,n){return`Bad: indices[${e}] == ${t} out of range [0, ${n})`}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function oi(e,t){let n,i=!1;for(e<=pn?(n=e,i=!0):n=(0,F.lK)(e,Math.floor(Math.sqrt(e)));!i;)n>t||n===e?i=!0:n=(0,F.lK)(e,n+1);return n}function ai(e,t,n){const i=[],r=e.length;for(let s=0;s<r;s++)s!==t?i.push(e[s]):i.push(n);return i}function li(e,t,n,i){const r=t.shape.length,s=e.shape.length;if(0!==i&&(i<-r||i>r))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${i}`);if(i<0&&(i+=r),i>s)throw new Error(`batchDims (${i}) must be less than rank(x) (\n ${s}).`);if(n<i)throw new Error(`batchDims (${i}) must be less than or equal to axis (${n}).`);for(let n=0;n<i;++n)if(e.shape[n]!==t.shape[n])throw new Error(`x.shape[${n}]: ${e.shape[n]} should be equal to indices.shape[${n}]: ${t.shape[n]}.`);const o=e.shape[n],a=[];let l=1,u=1,c=1;for(let t=0;t<i;++t)a.push(e.shape[t]),l*=e.shape[t];for(let t=i;t<n;t++)a.push(e.shape[t]),u*=e.shape[t];for(let e=i;e<r;e++)a.push(t.shape[e]);for(let t=n+1;t<s;t++)a.push(e.shape[t]),c*=e.shape[t];return{batchSize:l,sliceSize:c,outerSize:u,dimSize:o,outputShape:a}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ui(e){try{return e.map(e=>(0,Nt.decodeString)(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function ci(e){return e.map(e=>(0,Nt.encodeString)(e))}var di=n(8360),hi=n(54411),pi=n(15149);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
!function(){for(const e of ze)Se(e)}()},56734:(e,t,n)=>{"use strict";n.d(t,{D:()=>r});var i=n(83879);class r{static join(e){return new r(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e)return;if(e instanceof Array||(e=[e]),0===(e=e.map(e=>i.isTypedArray(e)?e.buffer:e)).length)return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let n=0;n<e.length;n++){const i=e[n];n!==e.length-1&&i.byteLength!==this.bufferUniformSize&&(this.bufferUniformSize=void 0);const r=t+i.byteLength;this.shards.push({buffer:i,start:t,end:r}),t=r}0===this.shards.length&&(this.byteLength=0),this.byteLength=this.shards[this.shards.length-1].end}slice(e=0,t=this.byteLength){if(0===this.shards.length)return new ArrayBuffer(0);if(e=isNaN(Number(e))?0:e,t=isNaN(Number(t))?0:t,e=Math.max(0,e),(t=Math.min(this.byteLength,t))<=e)return new ArrayBuffer(0);const n=this.findShardForByte(e);if(-1===n)throw new Error(`Could not find start shard for byte ${e}`);const i=new ArrayBuffer(t-e),r=new Uint8Array(i);let s=0;for(let i=n;i<this.shards.length;i++){const n=this.shards[i],o=e+s-n.start,a=s,l=Math.min(t,n.end)-n.start,u=new Uint8Array(n.buffer,o,l-o);if(r.set(u,a),s+=u.length,t<n.end)break}return i}findShardForByte(e){if(0===this.shards.length||e<0||e>=this.byteLength)return-1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e<t.start?-1:e>=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;const n=function(e,t){let n=0,i=e.length;for(;n<=i;){const r=Math.floor((i-n)/2)+n,s=t(e[r]);if(0===s)return r;s<0?i=r:n=r+1}return-1}(this.shards,t);return-1===n?-1:(this.previousShardIndex=n,this.previousShardIndex)}}},77084:(e,t,n)=>{"use strict";n.d(t,{AQ:()=>E,CY:()=>h,Ej:()=>S,P8:()=>w,Rl:()=>A,Xf:()=>O,aG:()=>d,jf:()=>x,l3:()=>T,oR:()=>C,s5:()=>_,zV:()=>I});var i=n(37148),r=n(74027),s=n(45119),o=n(15685),a=n(56734),l=n(35287),u=n(46574);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const c=4;async function d(e,t){const n=[],i=[],r=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);for(let s=0;s<r.length;++s){const o=r[s],a=Array.isArray(e)?e[s].tensor:e[o];if("float32"!==a.dtype&&"int32"!==a.dtype&&"bool"!==a.dtype&&"string"!==a.dtype&&"complex64"!==a.dtype)throw new Error(`Unsupported dtype in weight '${o}': ${a.dtype}`);const l={name:o,shape:a.shape,dtype:a.dtype};if("string"===a.dtype){const e=new Promise(async e=>{const t=await a.bytes(),n=t.reduce((e,t)=>e+t.length,0)+c*t.length,i=new Uint8Array(n);let r=0;for(let e=0;e<t.length;e++){const n=t[e],s=new Uint8Array(new Uint32Array([n.length]).buffer);i.set(s,r),r+=c,i.set(n,r),r+=n.length}e(i)});i.push(e)}else i.push(a.data());null!=t&&(l.group=t),n.push(l)}return{data:y(await Promise.all(i)),specs:n}}function h(e,t){const n=new a.D(e),i={};let r=0;for(const e of t){const t=p(e,(e,t)=>n.slice(r+e,r+t));i[e.name]=m(e,n.slice(r,r+t)),r+=t}return i}function p(e,t){const n=(0,s.Ze)(e.shape);let i;if("quantization"in e){const t=e.quantization;i=o.i[t.dtype]}else{if("string"===e.dtype){let e=0;for(let i=0;i<n;i++)e+=c+new Uint32Array(t(e,e+c))[0];return e}i=o.i[e.dtype]}return n*i}async function f(e,t){const n=(0,s.Ze)(e.shape);let i;if("quantization"in e){const t=e.quantization;i=o.i[t.dtype]}else{if("string"===e.dtype){let e=0;for(let i=0;i<n;i++)e+=c+new Uint32Array(await t(e,e+c))[0];return e}i=o.i[e.dtype]}return n*i}function m(e,t){const n=e.name,a=e.dtype,l=e.shape,u=(0,s.Ze)(l);let d,h=0;if("quantization"in e){const i=e.quantization;if("uint8"===i.dtype||"uint16"===i.dtype){if(!("min"in i)||!("scale"in i))throw new Error(`Weight ${e.name} with quantization ${i.dtype} doesn't have corresponding metadata min and scale.`)}else{if("float16"!==i.dtype)throw new Error(`Weight ${e.name} has unknown quantization dtype ${i.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`);if("float32"!==a)throw new Error(`Weight ${e.name} is quantized with ${i.dtype} which only supports weights of type float32 not ${a}.`)}const r=o.i[i.dtype],s="uint8"===i.dtype?new Uint8Array(t):new Uint16Array(t);if("float32"===a)if("uint8"===i.dtype||"uint16"===i.dtype){d=new Float32Array(s.length);for(let e=0;e<s.length;e++){const t=s[e];d[e]=t*i.scale+i.min}}else{if("float16"!==i.dtype)throw new Error(`Unsupported quantization type ${i.dtype} for weight type float32.`);{const e=function(){const e=function(){const e=e=>{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 i=>{const r=new ArrayBuffer(4*i.length),s=new Uint32Array(r);for(let r=0;r<i.length;r++){const o=i[r],a=e[n[o>>10]+(1023&o)]+t[o>>10];s[r]=a}return new Float32Array(r)}}();d=e(s)}}else{if("int32"!==a)throw new Error(`Unsupported dtype in weight '${n}': ${a}`);if("uint8"!==i.dtype&&"uint16"!==i.dtype)throw new Error(`Unsupported quantization type ${i.dtype} for weight type int32.`);d=new Int32Array(s.length);for(let e=0;e<s.length;e++){const t=s[e];d[e]=Math.round(t*i.scale+i.min)}}h+=u*r}else if("string"===a){const n=(0,s.Ze)(e.shape);d=[];for(let e=0;e<n;e++){const e=new Uint32Array(t.slice(h,h+c))[0];h+=c;const n=new Uint8Array(t.slice(h,h+e));d.push(n),h+=e}}else{const e=o.i[a];if("float32"===a)d=new Float32Array(t);else if("int32"===a)d=new Int32Array(t);else{if("bool"!==a){if("complex64"===a){d=new Float32Array(t);const e=new Float32Array(d.length/2),n=new Float32Array(d.length/2);for(let t=0;t<e.length;t++)e[t]=d[2*t],n[t]=d[2*t+1];const s=(0,r.O)(e,l,"float32"),o=(0,r.O)(n,l,"float32"),a=(0,i.f)(s,o);return s.dispose(),o.dispose(),a}throw new Error(`Unsupported dtype in weight '${n}': ${a}`)}d=new Uint8Array(t)}h+=u*e}return(0,r.O)(d,l,a)}async function g(e,t,n){let i=new Uint8Array(t);for(;i.byteLength<n;){const{done:t,value:r}=await e.read();if(t&&null==r){const e=n-i.byteLength;throw new Error(`Reader is done but ${e} bytes are still expected`)}const s=new Uint8Array(i.length+r.byteLength);s.set(i,0),s.set(new Uint8Array(r),i.length),i=s}return i.buffer}async function _(e,t){const n={},i=e.getReader();let r=new ArrayBuffer(0);for(const e of t){const t=await f(e,async(e,t)=>(r=await g(i,r,t),r.slice(e,t)));r=await g(i,r,t);const o=r.slice(0,t);r=r.slice(t);const a=m(e,o);if(n[e.name]=a,"webgpu"===(0,l.jz)()){const e=(0,l.Hs)();"uploadToGPU"in e&&(0,s.Ze)(a.shape)>=(0,u._K)().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(a.dataId)}}return n}function y(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 i=new Uint8Array(t);let r=0;return n.forEach(e=>{i.set(new Uint8Array(e.buffer),r),r+=e.byteLength}),i.buffer}const v="undefined"!=typeof Buffer&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function b(e){return v?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function T(e){if(v)return Buffer.from(e).toString("base64");const t=new Uint8Array(e);let n="";for(let e=0,i=t.length;e<i;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function x(e){if(v){const t=Buffer.from(e,"base64");return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n.set([t.charCodeAt(e)],e);return n.buffer}function E(e){return a.D.join(e)}function w(e){for(e=e.trim();e.endsWith("/");)e=e.slice(0,e.length-1);const t=e.split("/");return t[t.length-1]}function I(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 A(e,t,n){const i={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy};if(null!=e.trainingConfig&&(i.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");i.weightSpecs=t,i.weightData=n}return null!=e.signature&&(i.signature=e.signature),null!=e.userDefinedMetadata&&(i.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(i.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(i.initializerSignature=e.initializerSignature),i}async function S(e,t){let n,i;return null!=e.weightsManifest&&([n,i]=await t(e.weightsManifest)),A(e,n,i)}function C(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:b(JSON.stringify(e.modelTopology)),weightSpecsBytes:null==e.weightSpecs?0:b(JSON.stringify(e.weightSpecs)),weightDataBytes:null==e.weightData?0:new a.D(e.weightData).byteLength}}function O(e){const t=[];for(const n of e)t.push(...n.weights);return t}},15685:(e,t,n)=>{"use strict";n.d(t,{i:()=>i});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const i={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},15441:(e,t,n)=>{"use strict";n.d(t,{$dB:()=>R,$jE:()=>nn,$zE:()=>k,A1h:()=>L,A8B:()=>zt,BK4:()=>yn,BLA:()=>Ze,BRl:()=>se,Blb:()=>jt,BoJ:()=>Ht,BxF:()=>de,C8s:()=>Gt,CQC:()=>ft,Cg$:()=>Me,CwD:()=>Se,D7i:()=>At,Ddj:()=>Kt,Dr:()=>vn,DvZ:()=>Xt,E3$:()=>Ee,EkD:()=>a,ElG:()=>pe,EwU:()=>dn,FAs:()=>an,FCQ:()=>wt,FSt:()=>u,Fin:()=>$t,GZp:()=>Qt,HNs:()=>w,Ik2:()=>x,J3C:()=>Lt,JiE:()=>Dt,Jp_:()=>c,KXH:()=>S,L6G:()=>Wt,LB5:()=>I,LDN:()=>Ve,LG0:()=>qe,LRy:()=>_t,LWX:()=>st,LXA:()=>Ne,M6A:()=>Zt,MRQ:()=>j,Mn0:()=>$,MnK:()=>U,N4F:()=>E,Ncv:()=>dt,O4G:()=>ge,OAQ:()=>be,ODT:()=>lt,OMN:()=>o,ORI:()=>q,PH8:()=>s,P_L:()=>It,Pah:()=>ne,PbM:()=>rn,Q6t:()=>gt,QDP:()=>C,QKF:()=>h,Qgm:()=>te,R23:()=>bt,RMm:()=>fn,RUm:()=>ke,RW8:()=>De,RXX:()=>je,SDM:()=>nt,SQl:()=>ce,T7M:()=>Tn,TBb:()=>ln,TL8:()=>He,TMz:()=>G,TOR:()=>Ct,ToN:()=>Be,TyE:()=>f,UcO:()=>Jt,VAI:()=>Ue,VCH:()=>y,Vvy:()=>r,WRv:()=>$e,WT3:()=>Qe,WuN:()=>Vt,X$8:()=>W,X0$:()=>Ie,X4r:()=>Mt,XQy:()=>xt,XhZ:()=>_e,XmO:()=>J,YAb:()=>en,YVe:()=>Pt,ZgB:()=>he,Zl4:()=>it,_s9:()=>re,aAr:()=>bn,awo:()=>_n,bCz:()=>ut,bP9:()=>Z,cHb:()=>Ge,cS:()=>v,dFH:()=>Ut,dLy:()=>un,dXR:()=>hn,dv8:()=>Te,e0f:()=>rt,epO:()=>p,fUj:()=>vt,g5A:()=>We,gC7:()=>B,gIW:()=>xe,hVg:()=>St,hgw:()=>Et,ho8:()=>_,hql:()=>Ft,huO:()=>yt,i5R:()=>fe,iGz:()=>P,iPs:()=>we,iW0:()=>tn,iuW:()=>on,jAQ:()=>T,jM4:()=>Pe,jOE:()=>Tt,jfg:()=>F,jgd:()=>qt,jj_:()=>V,jxD:()=>K,kdj:()=>ht,l0G:()=>et,l6P:()=>Rt,lLS:()=>ye,lNG:()=>Xe,ljI:()=>i,lxb:()=>g,lzr:()=>ve,mH5:()=>mt,mIA:()=>Ae,mM$:()=>at,mnI:()=>Ce,mxL:()=>me,nVu:()=>X,nY8:()=>z,nZd:()=>Re,oFs:()=>sn,oJ2:()=>pt,ox3:()=>oe,p2J:()=>N,pJc:()=>Ot,pPe:()=>pn,p_m:()=>d,pk0:()=>Q,pnw:()=>gn,pr3:()=>M,pyJ:()=>ct,rFG:()=>Yt,rFm:()=>D,rGP:()=>ue,rsH:()=>ie,sDr:()=>ee,t3d:()=>ze,tG8:()=>Oe,tGH:()=>H,u$b:()=>Nt,u8Z:()=>l,uWl:()=>kt,urI:()=>ot,vI1:()=>Bt,vaV:()=>O,vj7:()=>A,wNW:()=>Y,wwC:()=>b,wx0:()=>cn,x7F:()=>Ke,xJ3:()=>mn,xu7:()=>Je,yPW:()=>Le,ySp:()=>Ye,ybN:()=>ae,ybj:()=>le,ylV:()=>tt,zP9:()=>m,zfU:()=>Fe});const i="Abs",r="Acos",s="Acosh",o="Add",a="AddN",l="All",u="Any",c="ArgMax",d="ArgMin",h="Asin",p="Asinh",f="Atan",m="Atanh",g="Atan2",_="AvgPool",y="AvgPoolGrad",v="AvgPool3D",b="AvgPool3DGrad",T="BatchMatMul",x="BatchToSpaceND",E="Bincount",w="BitwiseAnd",I="BroadcastTo",A="BroadcastArgs",S="Cast",C="Ceil",O="ClipByValue",M="Complex",k="ComplexAbs",R="Concat",N="Conv2D",D="Conv2DBackpropFilter",F="Conv2DBackpropInput",L="Conv3D",P="Conv3DBackpropFilterV2",B="Conv3DBackpropInputV2",$="Cos",U="Cosh",V="Cumprod",z="Cumsum",j="CropAndResize",Y="DenseBincount",G="DepthToSpace",H="DepthwiseConv2dNative",W="DepthwiseConv2dNativeBackpropFilter",X="DepthwiseConv2dNativeBackpropInput",q="Diag",K="Dilation2D",Z="Dilation2DBackpropInput",Q="Dilation2DBackpropFilter",J="Draw",ee="RealDiv",te="Einsum",ne="Elu",ie="EluGrad",re="Erf",se="Equal",oe="Exp",ae="ExpandDims",le="Expm1",ue="FFT",ce="Fill",de="FlipLeftRight",he="Floor",pe="FloorDiv",fe="FusedBatchNorm",me="GatherV2",ge="GatherNd",_e="Greater",ye="GreaterEqual",ve="Identity",be="IFFT",Te="Imag",xe="IsFinite",Ee="IsInf",we="IsNan",Ie="LeakyRelu",Ae="Less",Se="LessEqual",Ce="LinSpace",Oe="Log",Me="Log1p",ke="LogicalAnd",Re="LogicalNot",Ne="LogicalOr",De="LogicalXor",Fe="LogSoftmax",Le="LowerBound",Pe="LRN",Be="LRNGrad",$e="MatrixBandPart",Ue="Max",Ve="Maximum",ze="MaxPool",je="MaxPoolGrad",Ye="MaxPool3D",Ge="MaxPool3DGrad",He="MaxPoolWithArgmax",We="Mean",Xe="Min",qe="Minimum",Ke="MirrorPad",Ze="Mod",Qe="Multinomial",Je="Multiply",et="Neg",tt="NotEqual",nt="NonMaxSuppressionV3",it="NonMaxSuppressionV4",rt="NonMaxSuppressionV5",st="OnesLike",ot="OneHot",at="Pack",lt="PadV2",ut="Pool",ct="Pow",dt="Prelu",ht="Prod",pt="RaggedGather",ft="RaggedRange",mt="RaggedTensorToTensor",gt="Range",_t="Real",yt="Reciprocal",vt="Relu",bt="Reshape",Tt="ResizeNearestNeighbor",xt="ResizeNearestNeighborGrad",Et="ResizeBilinear",wt="ResizeBilinearGrad",It="Relu6",At="Reverse",St="Round",Ct="Rsqrt",Ot="ScatterNd",Mt="TensorScatterUpdate",kt="SearchSorted",Rt="Select",Nt="Selu",Dt="Slice",Ft="Sin",Lt="Sinh",Pt="Sign",Bt="Sigmoid",$t="Softplus",Ut="Sqrt",Vt="Sum",zt="SpaceToBatchND",jt="SplitV",Yt="Softmax",Gt="SparseFillEmptyRows",Ht="SparseReshape",Wt="SparseSegmentMean",Xt="SparseSegmentSum",qt="SparseToDense",Kt="SquaredDifference",Zt="Square",Qt="StaticRegexReplace",Jt="StridedSlice",en="StringNGrams",tn="StringSplit",nn="StringToHashBucketFast",rn="Sub",sn="Tan",on="Tanh",an="Tile",ln="TopK",un="Transform",cn="Transpose",dn="Unique",hn="Unpack",pn="UnsortedSegmentSum",fn="UpperBound",mn="ZerosLike",gn="Step",_n="FromPixels",yn="RotateWithOffset",vn="_FusedMatMul",bn="FusedConv2D",Tn="FusedDepthwiseConv2D"},37074:(e,t,n)=>{"use strict";n.d(t,{Cf:()=>m,Op:()=>c,_5:()=>l,iP:()=>p,kr:()=>h,rY:()=>f,tA:()=>d,vQ:()=>u});var i=n(46574),r=n(41743),s=n(73673);
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const o=(0,r.m)("kernelRegistry",()=>new Map),a=(0,r.m)("gradRegistry",()=>new Map);function l(e,t){const n=g(e,t);return o.get(n)}function u(e){return a.get(e)}function c(e){const t=o.entries(),n=[];for(;;){const{done:i,value:r}=t.next();if(i)break;const[s,o]=r,[a]=s.split("_");a===e&&n.push(o)}return n}function d(e){const{kernelName:t,backendName:n}=e,i=g(t,n);o.has(i)&&s.i(`The kernel '${t}' for backend '${n}' is already registered`),o.set(i,e)}function h(e){const{kernelName:t}=e;a.has(t)&&(0,i._K)().getBool("DEBUG")&&s.i(`Overriding the gradient for '${t}'`),a.set(t,e)}function p(e,t){const n=g(e,t);if(!o.has(n))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);o.delete(n)}function f(e){if(!a.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);a.delete(e)}function m(e,t){c(e).forEach(e=>{d(Object.assign({},e,{backendName:t}))})}function g(e,t){return`${t}_${e}`}},73673:(e,t,n)=>{"use strict";n.d(t,{R:()=>s,i:()=>r});var i=n(46574);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/function r(...e){(0,i._K)().getBool("IS_TEST")||(0,i._K)().getBool("PROD")||console.warn(...e)}function s(...e){(0,i._K)().getBool("IS_TEST")||(0,i._K)().getBool("PROD")||console.log(...e)}},4888:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({abs_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,s.YT)(e,"x","abs");if("complex64"===t.dtype){const e={x:t};return i.T2.runKernel(r.$zE,e)}{const e={x:t};return i.T2.runKernel(r.ljI,e)}}})},12804:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({acos_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","acos")};return i.T2.runKernel(r.Vvy,t)}})},37558:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({acosh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","acosh")};return i.T2.runKernel(r.PH8,t)}})},37523:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({add_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","add"),a=(0,o.YT)(t,"b","add");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.OMN,l)}})},12307:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({all_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const o={x:(0,s.YT)(e,"x","all","bool")},a={axis:t,keepDims:n};return i.T2.runKernel(r.u8Z,o,a)}})},89326:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({any_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const o={x:(0,s.YT)(e,"x","any","bool")},a={axis:t,keepDims:n};return i.T2.runKernel(r.FSt,o,a)}})},10897:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({argMax_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n={x:(0,s.YT)(e,"x","argMax")},o={axis:t};return i.T2.runKernel(r.Jp_,n,o)}})},54339:(e,t,n)=>{"use strict";n.d(t,{X:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({argMin_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n={x:(0,s.YT)(e,"x","argMin")},o={axis:t};return i.T2.runKernel(r.p_m,n,o)}})},66841:(e,t,n)=>{"use strict";n.d(t,{q:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({asin_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","asin")};return i.T2.runKernel(r.QKF,t)}})},50269:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({asinh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","asinh")};return i.T2.runKernel(r.epO,t)}})},29580:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({atan_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","atan")};return i.T2.runKernel(r.TyE,t)}})},21404:(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({atan2_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","atan2"),a=(0,o.YT)(t,"b","atan2");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.lxb,l)}})},63774:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({atanh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","atanh")};return i.T2.runKernel(r.zP9,t)}})},53909:(e,t,n)=>{"use strict";n.d(t,{$:()=>d});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(29809),l=n(47195),u=n(70929),c=n(62302);const d=(0,u.op)({avgPool_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,u,d){const h=(0,s.YT)(e,"x","avgPool","float32");o.vA(l.G0(n,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`);let p=h,f=!1;3===h.rank&&(f=!0,p=(0,c.t)(h,[1,h.shape[0],h.shape[1],h.shape[2]])),o.vA(4===p.rank,()=>`Error in avgPool: x must be rank 4 but got rank ${p.rank}.`),l.s_("avgPool",u,d);const m={x:p},g={filterSize:t,strides:n,pad:u,dimRoundingMode:d};let _=i.T2.runKernel(r.ho8,m,g);return _=(0,a.w)(_,h.dtype),f?(0,c.t)(_,[_.shape[1],_.shape[2],_.shape[3]]):_}})},21078:(e,t,n)=>{"use strict";n.d(t,{Em:()=>u,SM:()=>a,WC:()=>l,WH:()=>r,aF:()=>s,fK:()=>d,gx:()=>c,lb:()=>o});var i=n(45119);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/function r(e,t){for(let n=0;n<e.length;++n)if(e[e.length-n-1]!==t-1-n)return!1;return!0}function s(e,t,n){const i=e.length+t.length,r=[];let s=0,o=0;for(let a=0;a<i;a++)-1===n.indexOf(a)?r.push(e[s++]):r.push(t[o++]);return r}function o(e,t){const n=[],i=e.length;for(let r=0;r<i;r++)-1===t.indexOf(r)&&n.push(e[r]);return[n,t.map(t=>e[t])]}function a(e,t){return s(e,t.map(e=>1),t)}function l(e,t,n){i.vA(r(t,n),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${n} input.`)}function u(e,t){if(r(e,t))return null;const n=[];for(let i=0;i<t;++i)-1===e.indexOf(i)&&n.push(i);return e.forEach(e=>n.push(e)),n}function c(e){return e.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function d(e,t){const n=[];for(let i=t-e;i<t;++i)n.push(i);return n}},69772:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({batchToSpaceND_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const a=(0,s.YT)(e,"x","batchToSpaceND"),l=t.reduce((e,t)=>e*t);o.vA(a.rank>=1+t.length,()=>`input rank is ${a.rank} but should be > than blockShape.length ${t.length}`),o.vA(n.length===t.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${t.length}`),o.vA(a.shape[0]%l===0,()=>`input tensor batch is ${a.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${l}`);const u={x:a},c={blockShape:t,crops:n};return i.T2.runKernel(r.Ik2,u,c)}})},9160:(e,t,n)=>{"use strict";n.d(t,{$:()=>l});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(62302);const l=(0,n(70929).op)({batchNorm_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,l,u,c){null==c&&(c=.001);const d=(0,s.YT)(e,"x","batchNorm"),h=(0,s.YT)(t,"mean","batchNorm"),p=(0,s.YT)(n,"variance","batchNorm");let f,m;null!=u&&(f=(0,s.YT)(u,"scale","batchNorm")),null!=l&&(m=(0,s.YT)(l,"offset","batchNorm")),o.vA(h.rank===p.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),o.vA(null==m||h.rank===m.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),o.vA(null==f||h.rank===f.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const g={x:function(e){let t;return t=0===e.rank||1===e.rank?(0,a.t)(e,[1,1,1,e.size]):2===e.rank?(0,a.t)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?(0,a.t)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(d),scale:f,offset:m,mean:h,variance:p},_={varianceEpsilon:c},y=i.T2.runKernel(r.i5R,g,_);return(0,a.t)(y,d.shape)}})},63567:(e,t,n)=>{"use strict";n.d(t,{h:()=>c});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70125),l=n(70929),u=n(62302);const c=(0,l.op)({broadcastTo_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,s.YT)(e,"broadcastTo","x");const l=n.shape;if((0,o.SA)(t),t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=(0,u.t)(n,e)}const c=n.shape,d=Array.from(t);for(let e=t.length-1;e>=0;e--)if(c[e]===t[e])d[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${l}] cannot be broadcast to [${t}].`);if(0===d.map((e,t)=>e>1?t:-1).filter(e=>e>=0).length)return(0,a.o)(n);const h={x:n},p={reps:d};return i.T2.runKernel(r.FAs,h,p)}})},62198:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i(e,t){const n=e.length,i=[];for(let r=0;r<n;r++){const s=n-1-r,o=e[s]||1;(t[t.length-1-r]||1)>1&&1===o&&i.unshift(s)}return i}function r(e,t){const n=[];for(let i=0;i<t.length;i++){const r=e[e.length-i-1],s=t.length-i-1,o=t[s];(null==r||1===r&&o>1)&&n.unshift(s)}return n}function s(e,t){const n=Math.max(e.length,t.length),i=new Array(n);for(let r=0;r<n;r++){let s=e[e.length-r-1];null==s&&(s=1);let o=t[t.length-r-1];if(null==o&&(o=1),1===s)i[n-r-1]=o;else if(1===o)i[n-r-1]=s;else{if(s!==o){throw Error(`Operands could not be broadcast together with shapes ${e} and ${t}.`)}i[n-r-1]=s}}return i}n.r(t),n.d(t,{assertAndGetBroadcastShape:()=>s,getBroadcastDims:()=>i,getReductionAxes:()=>r})},448:(e,t,n)=>{"use strict";n.d(t,{r:()=>s});var i=n(50259),r=n(45119);
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function s(e,t="float32",n){return t=t||"float32",r.SA(e),new i.yl(e,t,n)}},29809:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({cast_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,s.YT)(e,"x","cast");if(!o.xn(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 a={x:n},l={dtype:t};return i.T2.runKernel(r.KXH,a,l)}})},30855:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({ceil_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","ceil","float32")};return i.T2.runKernel(r.QDP,t)}})},96928:(e,t,n)=>{"use strict";n.d(t,{z:()=>l});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(96111);const l=(0,n(70929).op)({clipByValue_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const l=(0,s.YT)(e,"x","clipByValue");if(o.vA(t<=n,()=>`Error in clip: min (${t}) must be less than or equal to max (${n}).`),t===n)return(0,a.G)(l.shape,t,l.dtype);const u={x:l},c={clipValueMin:t,clipValueMax:n};return i.T2.runKernel(r.vaV,u,c)}})},70125:(e,t,n)=>{"use strict";n.d(t,{o:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({clone_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","clone","string_or_numeric")};return i.T2.runKernel(r.lzr,t)}})},37148:(e,t,n)=>{"use strict";n.d(t,{f:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({complex_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,s.YT)(e,"real","complex"),a=(0,s.YT)(t,"imag","complex");o.O3(n.shape,a.shape,`real and imag shapes, ${n.shape} and ${a.shape}, must match in call to tf.complex().`);const l={real:n,imag:a};return i.T2.runKernel(r.pr3,l)}})},25030:(e,t,n)=>{"use strict";n.d(t,{x:()=>l});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70125);const l=(0,n(70929).op)({concat_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){(0,o.vA)(e.length>=1,()=>"Pass at least one tensor to concat");const n=(0,s.j1)(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(0,a.o)(n[0]);const l=n,u={axis:t};return i.T2.runKernel(r.$dB,l,u)}})},3701:(e,t,n)=>{"use strict";n.d(t,{k:()=>u});var i=n(28189),r=n(45119),s=n(28794),o=n(47195),a=n(70929),l=n(62302);const u=(0,a.op)({conv1d_:function(e,t,n,a,u="NWC",c=1,d){const h=(0,i.YT)(e,"x","conv1d"),p=(0,i.YT)(t,"filter","conv1d");let f=h,m=!1;2===h.rank&&(m=!0,f=(0,l.t)(h,[1,h.shape[0],h.shape[1]])),r.vA(3===f.rank,()=>`Error in conv1d: input must be rank 3, but got rank ${f.rank}.`),r.vA(3===p.rank,()=>`Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`),o.s_("conv1d",a,d),r.vA(f.shape[2]===p.shape[1],()=>`Error in conv1d: depth of input (${f.shape[2]}) must match input depth for filter ${p.shape[1]}.`),r.vA(o.G0(n,c),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${c}'`),r.vA(o.qk(c),()=>"Error in conv1D: Dilated rates should be larger than 0."),r.vA(o.qk(n),()=>"Error in conv1D: Stride should be larger than 0."),r.vA("NWC"===u,()=>`Error in conv1d: got dataFormat of ${u} but only NWC is currently supported.`);const g=(0,l.t)(p,[1,p.shape[0],p.shape[1],p.shape[2]]),_=(0,l.t)(f,[f.shape[0],1,f.shape[1],f.shape[2]]),y=[1,n],v=[1,c],b=(0,s.X)(_,g,y,a,"NHWC",v,d);return m?(0,l.t)(b,[b.shape[2],b.shape[3]]):(0,l.t)(b,[b.shape[0],b.shape[2],b.shape[3]])}})},28794:(e,t,n)=>{"use strict";n.d(t,{X:()=>c});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(47195),l=n(70929),u=n(62302);const c=(0,l.op)({conv2d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,l,c="NHWC",d=[1,1],h){const p=(0,s.YT)(e,"x","conv2d","float32"),f=(0,s.YT)(t,"filter","conv2d","float32");let m=p,g=!1;3===p.rank&&(g=!0,m=(0,u.t)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.vA(4===m.rank,()=>`Error in conv2d: input must be rank 4, but got rank ${m.rank}.`),o.vA(4===f.rank,()=>`Error in conv2d: filter must be rank 4, but got rank ${f.rank}.`),a.s_("conv2d",l,h);const _="NHWC"===c?m.shape[3]:m.shape[1];o.vA(_===f.shape[2],()=>`Error in conv2d: depth of input (${_}) must match input depth for filter ${f.shape[2]}.`),o.vA(a.G0(n,d),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${d}'`),o.vA(a.qk(d),()=>"Error in conv2D: Dilated rates should be larger than 0."),o.vA(a.qk(n),()=>"Error in conv2D: Strides should be larger than 0.");const y={x:m,filter:f},v={strides:n,pad:l,dataFormat:c,dilations:d,dimRoundingMode:h},b=i.T2.runKernel(r.p2J,y,v);return g?(0,u.t)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},25248:(e,t,n)=>{"use strict";n.d(t,{H:()=>u});var i=n(41585),r=n(15441),s=n(45119),o=n(47195),a=n(70929),l=n(62302);const u=(0,a.op)({conv2DBackpropFilter_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,a,u,c="NHWC",d){let h=e;3===e.rank&&(h=(0,l.t)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let p=t;3===p.rank&&(p=(0,l.t)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),s.vA(4===h.rank,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${h.shape}.`),s.vA(4===p.rank,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`),s.vA(4===n.length,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const f="NHWC"===c?h.shape[3]:h.shape[1],m="NHWC"===c?p.shape[3]:p.shape[1];s.vA(f===n[2],()=>`Error in conv2dDerFilter: depth of input ${f}) must match input depth in filter (${n[2]}.`),s.vA(m===n[3],()=>`Error in conv2dDerFilter: depth of dy (${m}) must match output depth for filter (${n[3]}).`),o.s_("conv2dDerFilter",u,d);const g={x:h,dy:p},_={strides:a,pad:u,dataFormat:c,dimRoundingMode:d,filterShape:n};return i.T2.runKernel(r.rFm,g,_)}})},80252:(e,t,n)=>{"use strict";n.d(t,{v:()=>u});var i=n(41585),r=n(15441),s=n(45119),o=n(47195),a=n(70929),l=n(62302);const u=(0,a.op)({conv2DBackpropInput_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,a,u,c="NHWC",d){s.vA(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let h=e,p=t,f=!1;3===t.rank&&(f=!0,p=(0,l.t)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),h=[1,e[0],e[1],e[2]]),s.vA(4===h.length,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${h.length}.`),s.vA(4===p.rank,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`),s.vA(4===n.rank,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const m="NHWC"===c?h[3]:h[1],g="NHWC"===c?p.shape[3]:p.shape[1];s.vA(m===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${m}) must match input depth for filter ${n.shape[2]}.`),s.vA(g===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${g}) must match output depth for filter ${n.shape[3]}.`),o.s_("conv2dDerInput",u,d);const _={dy:p,filter:n},y={strides:a,pad:u,dataFormat:c,dimRoundingMode:d,inputShape:h},v=i.T2.runKernel(r.jfg,_,y);return f?(0,l.t)(v,[v.shape[1],v.shape[2],v.shape[3]]):v}})},41106:(e,t,n)=>{"use strict";n.d(t,{w:()=>s});var i=n(28189),r=n(80252);const s=(0,n(70929).op)({conv2dTranspose_:function(e,t,n,s,o,a){const l=(0,i.YT)(e,"x","conv2dTranspose"),u=(0,i.YT)(t,"filter","conv2dTranspose");return(0,r.v)(n,l,u,s,o,"NHWC",a)}})},31895:(e,t,n)=>{"use strict";n.d(t,{c:()=>l});var i=n(41585),r=n(15441),s=n(45119),o=n(70929),a=n(62302);const l=(0,o.op)({conv3DBackpropInput_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,o,l){s.vA(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let u=e,c=t,d=!1;4===t.rank&&(d=!0,c=(0,a.t)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),u=[1,e[0],e[1],e[2],e[3]]);const h=u[4],p=c.shape[4];s.vA(5===u.length,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${u.length}.`),s.vA(5===c.rank,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${c.rank}`),s.vA(5===n.rank,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),s.vA(h===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${h}) must match input depth for filter ${n.shape[3]}.`),s.vA(p===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${p}) must match output depth for filter ${n.shape[4]}.`);const f={dy:c,filter:n},m={pad:l,strides:o,inputShape:u},g=i.T2.runKernel(r.gC7,f,m);return d?(0,a.t)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},47195:(e,t,n)=>{"use strict";n.d(t,{$Q:()=>_,Dh:()=>f,E6:()=>s,G0:()=>m,G8:()=>u,YQ:()=>r,l5:()=>o,p$:()=>l,qk:()=>g,s_:()=>y,uf:()=>a});var i=n(45119);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/function r(e,t,n,i,r="NHWC",s){return a(e,[...t,e[3]],n,s,i,null,null,_(r))}function s(e,t,n,i,r,s,o="channelsLast"){const[l,u]=c(t);let d;if("channelsLast"===o)d=[l,u,e[3],e[3]];else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);d=[l,u,e[1],e[1]]}return a(e,d,n,i,r,s,!1,o)}function o(e,t,n,i,r,s,o="NDHWC"){const[a,u,c]=d(t);let h,p;if("NDHWC"===o)p="channelsLast",h=[a,u,c,e[4],e[4]];else{if("NCDHW"!==o)throw new Error(`Unknown dataFormat ${o}`);p="channelsFirst",h=[a,u,c,e[1],e[1]]}return l(e,h,n,i,r,!1,p,s)}function a(e,t,n,i,r,s,o=!1,a="channelsLast"){let[l,d,f,m]=[-1,-1,-1,-1];if("channelsLast"===a)[l,d,f,m]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[l,m,d,f]=e}const[g,_,,y]=t,[v,b]=c(n),[T,x]=c(i),E=h(g,T),w=h(_,x),{padInfo:I,outHeight:A,outWidth:S}=function(e,t,n,i,r,s,o,a,l){let c,d,h;if("number"==typeof e){c={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const r=function(e,t,n,i,r){null==i&&(i=u(e,t,n));const s=e[0],o=e[1],a=p((s-t+2*i)/n+1,r),l=p((o-t+2*i)/n+1,r);return[a,l]}([t,n],s,i,e,a);d=r[0],h=r[1]}else if("same"===e){d=Math.ceil(t/i),h=Math.ceil(n/r);const e=Math.max(0,(d-1)*i+s-t),a=Math.max(0,(h-1)*r+o-n),l=Math.floor(e/2),u=e-l,p=Math.floor(a/2);c={top:l,bottom:u,left:p,right:a-p,type:"SAME"}}else if("valid"===e)c={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/i),h=Math.ceil((n-o+1)/r);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const u="channelsLast"===l?e[1][0]:e[2][0],f="channelsLast"===l?e[1][1]:e[2][1],m="channelsLast"===l?e[2][0]:e[3][0],g="channelsLast"===l?e[2][1]:e[3][1];c={top:u,bottom:f,left:m,right:g,type:0===u&&0===f&&0===m&&0===g?"VALID":"EXPLICIT"},d=p((t-s+u+f)/i+1,a),h=p((n-o+m+g)/r+1,a)}}return{padInfo:c,outHeight:d,outWidth:h}}(r,d,f,v,b,E,w,s,a),C=o?y*m:y;let O;return"channelsFirst"===a?O=[l,C,A,S]:"channelsLast"===a&&(O=[l,A,S,C]),{batchSize:l,dataFormat:a,inHeight:d,inWidth:f,inChannels:m,outHeight:A,outWidth:S,outChannels:C,padInfo:I,strideHeight:v,strideWidth:b,filterHeight:g,filterWidth:_,effectiveFilterHeight:E,effectiveFilterWidth:w,dilationHeight:T,dilationWidth:x,inShape:e,outShape:O,filterShape:t}}function l(e,t,n,i,r,s=!1,o="channelsLast",a){let[l,c,f,m,g]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[l,c,f,m,g]=e;else{if("channelsFirst"!==o)throw new Error(`Unknown dataFormat ${o}`);[l,g,c,f,m]=e}const[_,y,v,,b]=t,[T,x,E]=d(n),[w,I,A]=d(i),S=h(_,w),C=h(y,I),O=h(v,A),{padInfo:M,outDepth:k,outHeight:R,outWidth:N}=function(e,t,n,i,r,s,o,a,l,c,d){let h,f,m,g;"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 _=function(e,t,n,i,r,s){null==r&&(r=u(e,t[0],i[0]));const o=[0,0,0,n];for(let n=0;n<3;n++)e[n]+2*r>=t[n]&&(o[n]=p((e[n]-t[n]+2*r)/i[n]+1,s));return o}([t,n,i,1],[a,l,c],1,[r,s,o],e,d);f=_[0],m=_[1],g=_[2]}else{if("same"!==e)throw Error(`Unknown padding parameter: ${e}`);{f=Math.ceil(t/r),m=Math.ceil(n/s),g=Math.ceil(i/o);const e=(f-1)*r+a-t,u=(m-1)*s+l-n,d=(g-1)*o+c-i,p=Math.floor(e/2),_=e-p,y=Math.floor(u/2),v=u-y,b=Math.floor(d/2);h={top:y,bottom:v,left:b,right:d-b,front:p,back:_,type:"SAME"}}}return{padInfo:h,outDepth:f,outHeight:m,outWidth:g}}(r,c,f,m,T,x,E,S,C,O,a),D=s?b*g:b;let F;return"channelsFirst"===o?F=[l,D,k,R,N]:"channelsLast"===o&&(F=[l,k,R,N,D]),{batchSize:l,dataFormat:o,inDepth:c,inHeight:f,inWidth:m,inChannels:g,outDepth:k,outHeight:R,outWidth:N,outChannels:D,padInfo:M,strideDepth:T,strideHeight:x,strideWidth:E,filterDepth:_,filterHeight:y,filterWidth:v,effectiveFilterDepth:S,effectiveFilterHeight:C,effectiveFilterWidth:O,dilationDepth:w,dilationHeight:I,dilationWidth:A,inShape:e,outShape:F,filterShape:t}}function u(e,t,n,i=1){const r=h(t,i);return Math.floor((e[0]*(n-1)-n+r)/2)}function c(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function d(e){return"number"==typeof e?[e,e,e]:e}function h(e,t){return t<=1?e:e+(e-1)*(t-1)}function p(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 f(e){const[t,n,i]=c(e);return 1===t&&1===n&&1===i}function m(e,t){return f(e)||f(t)}function g(e){return c(e).every(e=>e>0)}function _(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function y(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)i.vA(i.E6(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=>{i.vA(i.E6(t),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${n} but got pad ${t}.`)})})}}}},99907:(e,t,n)=>{"use strict";n.d(t,{g:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({cos_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","cos","float32")};return i.T2.runKernel(r.Mn0,t)}})},27451:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({cosh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","cosh","float32")};return i.T2.runKernel(r.MnK,t)}})},10302:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({cumprod_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0,n=!1,o=!1){const a={x:(0,s.YT)(e,"x","cumprod")},l={axis:t,exclusive:n,reverse:o};return i.T2.runKernel(r.jj_,a,l)}})},76808:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({cumsum_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0,n=!1,o=!1){const a={x:(0,s.YT)(e,"x","cumsum")},l={axis:t,exclusive:n,reverse:o};return i.T2.runKernel(r.nY8,a,l)}})},31216:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({depthToSpace_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n="NHWC"){const a=(0,s.YT)(e,"x","depthToSpace","float32"),l="NHWC"===n?a.shape[1]:a.shape[2],u="NHWC"===n?a.shape[2]:a.shape[3],c="NHWC"===n?a.shape[3]:a.shape[1];o.vA(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),o.vA(l*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${l} and ${t} for depthToSpace with input shape\n ${a.shape}`),o.vA(u*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${u} and ${t} for depthToSpace with input shape\n ${a.shape}`),o.vA(c%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${c} for depthToSpace with input shape ${a.shape}`);const d={x:a},h={blockSize:t,dataFormat:n};return i.T2.runKernel(r.TMz,d,h)}})},10676:(e,t,n)=>{"use strict";n.d(t,{G:()=>c});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(47195),l=n(70929),u=n(62302);const c=(0,l.op)({depthwiseConv2d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,l,c="NHWC",d=[1,1],h){const p=(0,s.YT)(e,"x","depthwiseConv2d","float32"),f=(0,s.YT)(t,"filter","depthwiseConv2d","float32");let m=p,g=!1;3===p.rank&&(g=!0,m=(0,u.t)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),o.vA(4===m.rank,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`),o.vA(4===f.rank,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${f.rank}.`);const _="NHWC"===c?m.shape[3]:m.shape[1];o.vA(_===f.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${_}) must match the inChannels dimension in filter ${f.shape[2]}.`),a.s_("depthwiseConv2d",l,h);const y={x:m,filter:f},v={strides:n,pad:l,dataFormat:c,dilations:d,dimRoundingMode:h},b=i.T2.runKernel(r.tGH,y,v);return g?(0,u.t)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},41890:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(41585),r=n(15441),s=n(70929),o=n(62302);const a=(0,s.op)({depthwiseConv2dNativeBackpropFilter_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,s,a,l=[1,1],u){let c=e;3===e.rank&&(c=(0,o.t)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let d=t;3===d.rank&&(d=(0,o.t)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const h={x:c,dy:d},p={strides:s,pad:a,dimRoundingMode:u,dilations:l,filterShape:n};return i.T2.runKernel(r.X$8,h,p)}})},83134:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var i=n(41585),r=n(15441),s=n(70929),o=n(62302);const a=(0,s.op)({depthwiseConv2dNativeBackpropInput_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,s,a,l=[1,1],u){let c=t,d=!1;3===t.rank&&(d=!0,c=(0,o.t)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));const h={dy:c,filter:n},p={strides:s,pad:a,dimRoundingMode:u,dilations:l,inputShape:e},f=i.T2.runKernel(r.nVu,h,p);return d?(0,o.t)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},93002:(e,t,n)=>{"use strict";n.d(t,{X:()=>u});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70929),l=n(62302);const u=(0,a.op)({dilation2d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,a,u=[1,1],c="NHWC"){const d=(0,s.YT)(e,"x","dilation2d"),h=(0,s.YT)(t,"filter","dilation2d");o.vA(3===d.rank||4===d.rank,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${d.rank}.`),o.vA(3===h.rank,()=>`Error in dilation2d: filter must be rank 3, but got rank ${h.rank}.`),o.vA("NHWC"===c,()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${c}`);let p=d,f=!1;3===d.rank&&(p=(0,l.t)(d,[1,d.shape[0],d.shape[1],d.shape[2]]),f=!0),o.vA(p.shape[3]===h.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${h.shape[2]}`);const m={x:p,filter:h},g={strides:n,pad:a,dilations:u},_=i.T2.runKernel(r.jxD,m,g);return f?(0,l.t)(_,[_.shape[1],_.shape[2],_.shape[3]]):_}})},89359:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(88991);const l=(0,n(70929).op)({div_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","div"),l=(0,o.YT)(t,"b","div");if([n,l]=(0,s.makeTypesMatch)(n,l),"int32"===n.dtype&&"int32"===l.dtype)return(0,a.w)(n,l);const u={a:n,b:l};return i.T2.runKernel(r.sDr,u,{})}})},919:(e,t,n)=>{"use strict";n.d(t,{e:()=>c});var i=n(30565),r=n(28189),s=n(89359),o=n(13020),a=n(70929),l=n(12151),u=n(55537);const c=(0,a.op)({divNoNan_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,r.YT)(e,"a","div"),a=(0,r.YT)(t,"b","div");[n,a]=(0,i.makeTypesMatch)(n,a);const c=(0,s.y)(n,a),d=(0,u.P)(c),h=(0,o.L)(a,d);return(0,l._)(h,d,c)}})},69759:(e,t,n)=>{"use strict";n.d(t,{O:()=>l});var i=n(28189),r=n(45119),s=n(65703),o=n(70929),a=n(62302);const l=(0,o.op)({dot_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,i.YT)(e,"t1","dot"),o=(0,i.YT)(t,"t2","dot");r.vA(!(1!==n.rank&&2!==n.rank||1!==o.rank&&2!==o.rank),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${o.rank}.`);const l=1===n.rank?n.size:n.shape[1],u=1===o.rank?o.size:o.shape[0];if(r.vA(l===u,()=>`Error in dot: inner dimensions of inputs must match, but got ${l} and ${u}.`),1===n.rank&&1===o.rank){const e=(0,a.t)(n,[1,-1]),t=(0,a.t)(o,[-1,1]),i=(0,s.N)(e,t);return(0,a.t)(i,[])}if(1===n.rank&&2===o.rank){const e=(0,a.t)(n,[1,-1]),t=(0,a.t)(o,[o.shape[0],o.shape[1]]),i=(0,s.N)(e,t);return(0,a.t)(i,[i.size])}if(2===n.rank&&1===o.rank){const e=(0,a.t)(o,[-1,1]),t=(0,s.N)(n,e);return(0,a.t)(t,[t.size])}{const e=(0,a.t)(o,[o.shape[0],o.shape[1]]);return(0,s.N)(n,e)}}})},83416:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({elu_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","elu","float32")};return i.T2.runKernel(r.Pah,t)}})},13020:(e,t,n)=>{"use strict";n.d(t,{L:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({equal_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","equal","string_or_numeric"),l=(0,o.YT)(t,"b","equal","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.BRl,u)}})},95207:(e,t,n)=>{"use strict";n.d(t,{Y:()=>l});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(29809);const l=(0,n(70929).op)({erf_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){let t=(0,s.YT)(e,"x","erf");o.vA("int32"===t.dtype||"float32"===t.dtype,()=>"Input dtype must be `int32` or `float32`."),"int32"===t.dtype&&(t=(0,a.w)(t,"float32"));const n={x:t};return i.T2.runKernel(r._s9,n)}})},44881:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});var i=n(92596);const r=(0,n(70929).op)({euclideanNorm_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){return(0,i.x)(e,"euclidean",t,n)}})},8631:(e,t,n)=>{"use strict";n.d(t,{o:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({exp_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","exp")};return i.T2.runKernel(r.ox3,t)}})},8710:(e,t,n)=>{"use strict";n.d(t,{U:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({expandDims_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n=(0,s.YT)(e,"x","expandDims","string_or_numeric");o.vA(t<=n.rank,()=>"Axis must be <= rank of the tensor");const a={input:n},l={dim:t};return i.T2.runKernel(r.ybN,a,l)}})},40517:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({expm1_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","expm1")};return i.T2.runKernel(r.ybj,t)}})},96111:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var i=n(41585),r=n(15441),s=n(45119);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function o(e,t,n){(0,s.SA)(e);const o={shape:e,value:t,dtype:n=n||(0,s.X$)(t)};return i.T2.runKernel(r.SQl,{},o)}},15606:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({floor_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","floor","float32")};return i.T2.runKernel(r.ZgB,t)}})},88991:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({floorDiv_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","floorDiv"),a=(0,o.YT)(t,"b","floorDiv");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.ElG,l)}})},68646:(e,t,n)=>{"use strict";n.d(t,{Do:()=>m,XB:()=>f,f2:()=>g,zE:()=>_});var i=n(62198),r=n(83416),s=n(66919),o=n(9258),a=n(64394),l=n(90112),u=n(83732),c=n(62302),d=n(28968),h=n(10700),p=n(83791);
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function f(e,t,n){if(null==n||"linear"===n)return e;if("relu"===n)return(0,o.l)(e,(0,h.P)(t));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function m(e,t){let n=t;const r=i.getReductionAxes(e.shape,t.shape);return r.length>0&&(n=(0,p.c)(n,r)),(0,c.t)(n,e.shape)}function g(e,t,n,i){if("linear"===t)return e;if("relu"===t)return(0,l.V)(e);if("elu"===t)return(0,r.P)(e);if("relu6"===t)return(0,u.j)(e);if("prelu"===t)return(0,a.N)(e,n);if("leakyrelu"===t)return(0,s.H)(e,i);if("sigmoid"===t)return(0,d.r)(e);throw new Error(`Unknown fused activation ${t}.`)}const _=(e,t)=>!(e>0)||"linear"===t},48229:(e,t,n)=>{"use strict";n.d(t,{k:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({gather_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=0,o=0){const a={x:(0,s.YT)(e,"x","gather"),indices:(0,s.YT)(t,"indices","gather","int32")},l={axis:n,batchDims:o};return i.T2.runKernel(r.mxL,a,l)}})},62058:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({greater_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","greater","string_or_numeric"),l=(0,o.YT)(t,"b","greater","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.XhZ,u)}})},13337:(e,t,n)=>{"use strict";n.d(t,{D:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({greaterEqual_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","greaterEqual","string_or_numeric"),l=(0,o.YT)(t,"b","greaterEqual","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.lLS,u)}})},35040:(e,t,n)=>{"use strict";n.d(t,{n:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({imag_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={input:(0,s.YT)(e,"input","imag")};return i.T2.runKernel(r.dv8,t)}})},44711:(e,t,n)=>{"use strict";n.d(t,{v:()=>u});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70929),l=n(62302);const u=(0,a.op)({resizeBilinear_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=!1,a=!1){const u=(0,s.YT)(e,"images","resizeBilinear");o.vA(3===u.rank||4===u.rank,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${u.rank}.`),o.vA(2===t.length,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),o.vA(!1===a||!1===n,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let c=u,d=!1;3===u.rank&&(d=!0,c=(0,l.t)(u,[1,u.shape[0],u.shape[1],u.shape[2]]));const[]=t,h={images:c},p={alignCorners:n,halfPixelCenters:a,size:t},f=i.T2.runKernel(r.hgw,h,p);return d?(0,l.t)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},42954:(e,t,n)=>{"use strict";n.d(t,{b:()=>u});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70929),l=n(62302);const u=(0,a.op)({resizeNearestNeighbor_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=!1,a=!1){const u=(0,s.YT)(e,"images","resizeNearestNeighbor");o.vA(3===u.rank||4===u.rank,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${u.rank}.`),o.vA(2===t.length,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),o.vA("float32"===u.dtype||"int32"===u.dtype,()=>"`images` must have `int32` or `float32` as dtype"),o.vA(!1===a||!1===n,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let c=u,d=!1;3===u.rank&&(d=!0,c=(0,l.t)(u,[1,u.shape[0],u.shape[1],u.shape[2]]));const[]=t,h={images:c},p={alignCorners:n,halfPixelCenters:a,size:t},f=i.T2.runKernel(r.jOE,h,p);return d?(0,l.t)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},68318:(e,t,n)=>{"use strict";n.d(t,{M:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({isFinite_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","isFinite")};return i.T2.runKernel(r.gIW,t)}})},33454:(e,t,n)=>{"use strict";n.d(t,{E:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({isInf_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","isInf")};return i.T2.runKernel(r.E3$,t)}})},6300:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({isNaN_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","isNaN")};return i.T2.runKernel(r.iPs,t)}})},66919:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({leakyRelu_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=.2){const n={x:(0,s.YT)(e,"x","leakyRelu")},o={alpha:t};return i.T2.runKernel(r.X0$,n,o)}})},61303:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({less_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","less","string_or_numeric"),l=(0,o.YT)(t,"b","less","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.mIA,u)}})},56508:(e,t,n)=>{"use strict";n.d(t,{I:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({lessEqual_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","lessEqual","string_or_numeric"),l=(0,o.YT)(t,"b","lessEqual","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.CwD,u)}})},93531:(e,t,n)=>{"use strict";n.d(t,{K:()=>u});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(70929),l=n(62302);const u=(0,a.op)({localResponseNormalization_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=5,n=1,a=1,u=.5){const c=(0,s.YT)(e,"x","localResponseNormalization");o.vA(4===c.rank||3===c.rank,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${c.rank}.`),o.vA(o.E6(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let d=c,h=!1;3===c.rank&&(h=!0,d=(0,l.t)(c,[1,c.shape[0],c.shape[1],c.shape[2]]));const p={x:d},f={depthRadius:t,bias:n,alpha:a,beta:u},m=i.T2.runKernel(r.jM4,p,f);return h?(0,l.t)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}})},44010:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({log_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","log","float32")};return i.T2.runKernel(r.tG8,t)}})},12015:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({log1p_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","log1p")};return i.T2.runKernel(r.Cg$,t)}})},95645:(e,t,n)=>{"use strict";n.d(t,{n:()=>c});var i=n(31830),r=n(28189),s=n(9258),o=n(96522),a=n(70929),l=n(28968),u=n(66030);const c=(0,a.op)({logSigmoid_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,r.YT)(e,"x","logSigmoid");return(0,i._X)(e=>({value:(0,o.H)((0,u.l)((0,o.H)(e))),gradFunc:t=>(0,s.l)(t,(0,l.r)((0,o.H)(e)))}))(t)}})},97991:(e,t,n)=>{"use strict";n.d(t,{H:()=>p});var i=n(31830),r=n(28189),s=n(29809),o=n(8631),a=n(44010),l=n(41938),u=n(9258),c=n(70929),d=n(77126),h=n(83791);const p=(0,c.op)({logSoftmax_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=-1){const n=(0,r.YT)(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}`);return(0,i._X)((e,n)=>{const i=(0,l.T)(e,t,!0),r=(0,d.j)(e,i),c=(0,d.j)((0,s.w)(r,"float32"),(0,a.R)((0,h.c)((0,o.o)(r),t,!0)));n([c]);return{value:c,gradFunc:(e,n)=>{const[i]=n,r=(0,o.o)(i);return(0,d.j)(e,(0,u.l)((0,h.c)(e,t,!0),r))}}})(n)}})},13330:(e,t,n)=>{"use strict";n.d(t,{V:()=>f});var i=n(28189),r=n(45119),s=n(37523),o=n(21078),a=n(8631),l=n(44010),u=n(41938),c=n(70929),d=n(62302),h=n(77126),p=n(83791);const f=(0,c.op)({logSumExp_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const c=(0,i.YT)(e,"x","logSumExp"),f=(0,r.Y6)(t,c.shape),m=(0,u.T)(c,f,!0),g=(0,h.j)(c,m),_=(0,a.o)(g),y=(0,p.c)(_,f),v=(0,l.R)(y),b=(0,s.W)((0,d.t)(m,v.shape),v);if(n){const e=(0,o.SM)(b.shape,f);return(0,d.t)(b,e)}return b}})},13789:(e,t,n)=>{"use strict";n.d(t,{n:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(62198);const a=(0,n(70929).op)({logicalAnd_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,s.YT)(e,"a","logicalAnd","bool"),a=(0,s.YT)(t,"b","logicalAnd","bool");(0,o.assertAndGetBroadcastShape)(n.shape,a.shape);const l={a:n,b:a};return i.T2.runKernel(r.RUm,l)}})},89881:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({logicalNot_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","logicalNot","bool")};return i.T2.runKernel(r.nZd,t)}})},9879:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(62198);const a=(0,n(70929).op)({logicalOr_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,s.YT)(e,"a","logicalOr","bool"),a=(0,s.YT)(t,"b","logicalOr","bool");(0,o.assertAndGetBroadcastShape)(n.shape,a.shape);const l={a:n,b:a};return i.T2.runKernel(r.LXA,l)}})},19925:(e,t,n)=>{"use strict";n.d(t,{r:()=>l});var i=n(28189),r=n(62198),s=n(13789),o=n(89881),a=n(9879);const l=(0,n(70929).op)({logicalXor_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,i.YT)(e,"a","logicalXor","bool"),l=(0,i.YT)(t,"b","logicalXor","bool");return(0,r.assertAndGetBroadcastShape)(n.shape,l.shape),(0,s.n)((0,a.z)(e,t),(0,o.N)((0,s.n)(e,t)))}})},27084:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var i;n.d(t,{i:()=>i}),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"}(i||(i={}))},65703:(e,t,n)=>{"use strict";n.d(t,{N:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({matMul_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=!1,a=!1){let l=(0,o.YT)(e,"a","matMul"),u=(0,o.YT)(t,"b","matMul");[l,u]=(0,s.makeTypesMatch)(l,u);const c={a:l,b:u},d={transposeA:n,transposeB:a};return i.T2.runKernel(r.jAQ,c,d)}})},41938:(e,t,n)=>{"use strict";n.d(t,{T:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({max_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const o={x:(0,s.YT)(e,"x","max")},a={reductionIndices:t,keepDims:n};return i.T2.runKernel(r.VAI,o,a)}})},86999:(e,t,n)=>{"use strict";n.d(t,{j:()=>c});var i=n(41585),r=n(15441),s=n(28189),o=n(45119),a=n(47195),l=n(70929),u=n(62302);const c=(0,l.op)({maxPool_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,l,c){const d=(0,s.YT)(e,"x","maxPool");let h=d,p=!1;3===d.rank&&(p=!0,h=(0,u.t)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),o.vA(4===h.rank,()=>`Error in maxPool: input must be rank 4 but got rank ${h.rank}.`),o.vA(a.G0(n,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`),a.s_("maxPool",l,c);const f={x:h},m={filterSize:t,strides:n,pad:l,dimRoundingMode:c},g=i.T2.runKernel(r.t3d,f,m);return p?(0,u.t)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},30178:(e,t,n)=>{"use strict";n.d(t,{P:()=>u});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198),l=n(29809);const u=(0,n(70929).op)({maximum_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","maximum"),u=(0,o.YT)(t,"b","maximum");[n,u]=(0,s.makeTypesMatch)(n,u),"bool"===n.dtype&&(n=(0,l.w)(n,"int32"),u=(0,l.w)(u,"int32")),(0,a.assertAndGetBroadcastShape)(n.shape,u.shape);const c={a:n,b:u};return i.T2.runKernel(r.LDN,c)}})},12611:(e,t,n)=>{"use strict";n.d(t,{i:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({mean_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const o={x:(0,s.YT)(e,"x","mean")},a={axis:t,keepDims:n};return i.T2.runKernel(r.g5A,o,a)}})},57436:(e,t,n)=>{"use strict";n.d(t,{j:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({min_:
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){const o={x:(0,s.YT)(e,"x","min")},a={axis:t,keepDims:n};return i.T2.runKernel(r.lNG,o,a)}})},12644:(e,t,n)=>{"use strict";n.d(t,{B:()=>u});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198),l=n(29809);const u=(0,n(70929).op)({minimum_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","minimum"),u=(0,o.YT)(t,"b","minimum");[n,u]=(0,s.makeTypesMatch)(n,u),"bool"===n.dtype&&(n=(0,l.w)(n,"int32"),u=(0,l.w)(u,"int32")),(0,a.assertAndGetBroadcastShape)(n.shape,u.shape);const c={a:n,b:u};return i.T2.runKernel(r.LG0,c)}})},66567:(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({mirrorPad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){o.vA("reflect"===n||"symmetric"===n,()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const a=(0,s.YT)(e,"x","mirrorPad");if(0===a.rank)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");o.vA(t.length===a.rank,()=>`Padding doesn't match input. Must be ${a.rank}. Got ${t.length}.`);const l="reflect"===n?1:0;for(let e=0;e<a.rank;e++)o.vA(2===t[e].length,()=>"Invalid number of paddings. Must be length of 2 each."),o.vA(t[e][0]>=0&&t[e][0]<=a.shape[e]-l&&t[e][1]>=0&&t[e][1]<=a.shape[e]-l,()=>`Padding in dimension ${e} cannot be greater than or equal to ${a.shape[e]-l} or less than 0 for input of shape ${a.shape}`);const u={paddings:t,mode:n},c={x:a};return i.T2.runKernel(r.x7F,c,u)}})},60152:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({mod_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","mod"),a=(0,o.YT)(t,"b","mod");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.BLA,l)}})},9258:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({mul_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","mul"),a=(0,o.YT)(t,"b","mul");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.xu7,l)}})},96522:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({neg_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","neg")};return i.T2.runKernel(r.l0G,t)}})},92596:(e,t,n)=>{"use strict";n.d(t,{x:()=>_});var i=n(28189),r=n(45119),s=n(4888),o=n(21078),a=n(41938),l=n(57436),u=n(70929),c=n(98990),d=n(62302),h=n(45702),p=n(79348),f=n(45793),m=n(83791);function g(e,t,n=null){if(0===e.rank)return(0,s.t)(e);if(1!==e.rank&&null===n)return g((0,d.t)(e,[-1]),t,n);if(1===e.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===t)return(0,m.c)((0,s.t)(e),n);if(t===1/0)return(0,a.T)((0,s.t)(e),n);if(t===-1/0)return(0,l.j)((0,s.t)(e),n);if("euclidean"===t||2===t)return(0,p.R)((0,m.c)((0,c.n)((0,s.t)(e),(0,h.d)(2,"int32")),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}if(Array.isArray(n)&&2===n.length){if(1===t)return(0,a.T)((0,m.c)((0,s.t)(e),n[0]),n[1]-1);if(t===1/0)return(0,a.T)((0,m.c)((0,s.t)(e),n[1]),n[0]);if(t===-1/0)return(0,l.j)((0,m.c)((0,s.t)(e),n[1]),n[0]);if("fro"===t||"euclidean"===t)return(0,p.R)((0,m.c)((0,f.E)(e),n));throw new Error(`Error in norm: invalid ord value: ${t}`)}throw new Error(`Error in norm: invalid axis: ${n}`)}const _=(0,u.op)({norm_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t="euclidean",n=null,s=!1){const a=g(e=(0,i.YT)(e,"x","norm"),t,n);let l=a.shape;if(s){const t=(0,r.Y6)(n,e.shape);l=o.SM(a.shape,t)}return(0,d.t)(a,l)}})},42118:(e,t,n)=>{"use strict";n.d(t,{E:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({notEqual_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","notEqual","string_or_numeric"),l=(0,o.YT)(t,"b","notEqual","string_or_numeric");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.ylV,u)}})},11760:(e,t,n)=>{"use strict";n.d(t,{M:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({oneHot_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=1,o=0,a="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const l={indices:(0,s.YT)(e,"indices","oneHot","int32")},u={dtype:a,depth:t,onValue:n,offValue:o};return i.T2.runKernel(r.urI,l,u)}})},61411:(e,t,n)=>{"use strict";n.d(t,{S:()=>a});var i=n(41585),r=n(45119),s=n(37148),o=n(42855);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function a(e,t="float32"){if((0,r.SA)(e),"complex64"===t){const t=a(e,"float32"),n=(0,o.U)(e,"float32");return(0,s.f)(t,n)}const n=(0,r.FZ)((0,r.Ze)(e),t);return i.T2.makeTensor(n,e,t)}},69885:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({onesLike_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","onesLike")};return i.T2.runKernel(r.LWX,t)}})},70929:(e,t,n)=>{"use strict";n.d(t,{B:()=>s,op:()=>o});var i=n(41585),r=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const s="__op";function o(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 o=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=s;const a=(...e)=>{i.T2.startScope(n);try{const t=o(...e);return(0,r.yL)(t)&&console.error("Cannot return a Promise inside of tidy."),i.T2.endScope(t),t}catch(e){throw i.T2.endScope(null),e}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}},67270:(e,t,n)=>{"use strict";n.d(t,{BTT:()=>h.B,tnl:()=>r.t,HQu:()=>s.H,FqL:()=>o.F,WQq:()=>a.W,QiD:()=>p,Q7R:()=>f.Q,bzn:()=>m.b,FLi:()=>g.F,XRg:()=>_.X,qRo:()=>y.q,yHs:()=>v.y,rYl:()=>b.r,FPz:()=>T.F,rfv:()=>x.r,$jT:()=>E.$,sub:()=>S,lZX:()=>D,$v7:()=>L.$,BFc:()=>P,kSi:()=>B,T5N:()=>$,GTe:()=>F.G,HbZ:()=>U,vjT:()=>V,ftb:()=>ni,ROE:()=>z,hOW:()=>j.h,ra8:()=>Y.r,wgE:()=>w.w,mkO:()=>G.m,zQh:()=>H.z,o8B:()=>W.o,faB:()=>X.f,xWs:()=>C.x,I1m:()=>q,RPU:()=>K,O5O:()=>Z,P1l:()=>Q,kA9:()=>J.k,Xtf:()=>ee.X,wX9:()=>te.w,IPL:()=>ne,jIJ:()=>re,gnS:()=>se.g,yIG:()=>oe.y,_jP:()=>hi,Lp0:()=>ae.L,rCv:()=>le.r,aOp:()=>ue,Rj8:()=>ce.R,Gl3:()=>de.G,smy:()=>he,X7t:()=>pe.X,y4m:()=>fe.y,ek5:()=>me.e,Omf:()=>ge.O,EZY:()=>ci,_3C:()=>_e,Pqc:()=>ye.P,FJY:()=>di,QP2:()=>ve,LCg:()=>be.L,Y12:()=>Te.Y,p4S:()=>xe.p,oNF:()=>Ee.o,UG6:()=>we.U,IYd:()=>Ie.I,y5U:()=>Se,hVP:()=>Tn.h,GSj:()=>Ce.G,RIf:()=>Oe.R,wh_:()=>Me.w,cZk:()=>i,kgh:()=>ke.k,SY9:()=>ui,rhj:()=>Re.r,DQN:()=>Ne.D,KGM:()=>xn.K,ngS:()=>De.n,Slp:()=>gr,U4u:()=>pi,ggX:()=>En.g,MIs:()=>Fe.M,EN4:()=>Le.E,yrW:()=>Pe.y,H8d:()=>Be.H,M7h:()=>$e.M,InN:()=>Ue.I,mPL:()=>_r,mT8:()=>Ve,Kgs:()=>ze.K,Rm2:()=>je.R,Kko:()=>Ye.K,nqI:()=>Ge.n,HPB:()=>He.H,VZ:()=>We.V,n76:()=>Xe.n,NSZ:()=>qe.N,ztW:()=>Ke.z,rxB:()=>Ze.r,YYh:()=>yr,yzS:()=>et,NoW:()=>O.N,T9B:()=>tt.T,jgi:()=>nt.j,NYV:()=>it,RO:()=>rt,PhQ:()=>st.P,i2o:()=>ot.i,OYQ:()=>ut,jkA:()=>ct.j,BpO:()=>dt.B,FFZ:()=>ht.F,ziu:()=>pt.z,Clk:()=>_t,CRk:()=>oi,lKK:()=>M.l,YDF:()=>yt,OjQ:()=>vt,HZy:()=>bt.H,xbf:()=>ri.x,Ec:()=>Tt.E,Mw0:()=>xt.M,SaS:()=>at.S,P61:()=>Et.P,op:()=>h.op,X4o:()=>wt,eVF:()=>It.e,BZs:()=>At,grY:()=>St,XHu:()=>Ct,WLX:()=>Ot,dzn:()=>Mt.d,n7C:()=>kt.n,NsG:()=>Rt.N,yyV:()=>Nt.y,_eU:()=>Dt._,whe:()=>Ft,iyU:()=>Lt,Q0_:()=>Pt,_9M:()=>Bt,pR9:()=>jt,FE$:()=>Yt,m0H:()=>Gt,YeY:()=>Ht,HYA:()=>Wt,y17:()=>Xt,xav:()=>qt.x,VOZ:()=>Kt.V,VVh:()=>Zt.V,j__:()=>Qt.j,tQQ:()=>A.t,BEg:()=>Jt.B,QD2:()=>en,LMr:()=>tn,I2l:()=>nn,JYU:()=>rn,z8$:()=>wn.z,LIG:()=>sn.L,Z$r:()=>on.Z,d_2:()=>an.d,NFr:()=>ai,sZg:()=>Je,WfX:()=>ln.W,wdz:()=>un.w,F12:()=>cn,ry7:()=>k.r,_SZ:()=>dn._,vPA:()=>mr,F8e:()=>hn.F,L0l:()=>pn.L,dik:()=>R.d,Q$M:()=>fn,zAd:()=>mn,wck:()=>gn,R0O:()=>_n,Vs9:()=>yn.V,lw0:()=>vn.l,eDJ:()=>bn.e,lMo:()=>vr,Zhr:()=>li,lOn:()=>fr,lDo:()=>In.l,RZD:()=>An.R,EwI:()=>mt.E,Pbu:()=>Sn.P,r2V:()=>Cn.r,t$z:()=>On.t,PMw:()=>Mn.P,Ym9:()=>kn.Y,YjP:()=>br,jbE:()=>gt.j,czq:()=>Rn.c,Mlm:()=>Nn.M,ymU:()=>N.y,OEK:()=>Dn.O,tGX:()=>Ln,KtR:()=>Pn,$_$:()=>Bn.$,g9W:()=>$n,Lpo:()=>Un,yxw:()=>Vn,NNh:()=>jn,Vsq:()=>Ae.V,rfw:()=>Yn.r,mgz:()=>ii.m,efE:()=>Gn,AmM:()=>Hn.A,zAU:()=>Wn.z,K$i:()=>Xn.K,rni:()=>qn,bvq:()=>Kn,_M9:()=>Zn._,YJN:()=>Jn,Ul9:()=>ei.U,POl:()=>ti.P});var i={};n.r(i),n.d(i,{conv2d:()=>vi,depthwiseConv2d:()=>xi,matMul:()=>Ei});var r=n(4888),s=n(12804),o=n(37558),a=n(37523),l=n(41585),u=n(15441),c=n(28189),d=n(45119),h=n(70929);const p=(0,h.op)({addN_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){d.vA(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),d.vA(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);const t=e.map((e,t)=>(0,c.YT)(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(!d.r1(e.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const i=t;return l.T2.runKernel(u.EkD,i)}});var f=n(12307),m=n(89326),g=n(10897),_=n(54339),y=n(66841),v=n(50269),b=n(29580),T=n(21404),x=n(63774),E=n(53909),w=n(29809),I=n(47195),A=n(62302);const S=(0,h.op)({avgPool3d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s="NDHWC"){const o=(0,c.YT)(e,"x","avgPool3d","float32");let a=o,h=!1;4===o.rank&&(h=!0,a=(0,A.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),d.vA(5===a.rank,()=>`Error in avgPool3d: x must be rank 5 but got rank ${a.rank}.`),d.vA("NDHWC"===s,()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),d.vA("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}'`),(0,I.s_)("avgPool3d",i,r);const p={x:a},f={filterSize:t,strides:n,pad:i,dimRoundingMode:r,dataFormat:s};let m=l.T2.runKernel(u.cS,p,f);return m=(0,w.w)(m,a.dtype),h?(0,A.t)(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}});var C=n(25030),O=n(65703),M=n(9258),k=n(28968),R=n(17986),N=n(57311);const D=(0,h.op)({basicLSTMCell_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s){const o=(0,c.YT)(e,"forgetBias","basicLSTMCell"),l=(0,c.YT)(t,"lstmKernel","basicLSTMCell"),u=(0,c.YT)(n,"lstmBias","basicLSTMCell"),d=(0,c.YT)(i,"data","basicLSTMCell"),h=(0,c.YT)(r,"c","basicLSTMCell"),p=(0,c.YT)(s,"h","basicLSTMCell"),f=(0,C.x)([d,p],1),m=(0,O.N)(f,l),g=(0,a.W)(m,u),_=g.shape[0],y=g.shape[1]/4,v=[_,y],b=(0,R.d)(g,[0,0],v),T=(0,R.d)(g,[0,y],v),x=(0,R.d)(g,[0,2*y],v),E=(0,R.d)(g,[0,3*y],v),w=(0,a.W)((0,M.l)((0,k.r)(b),(0,N.y)(T)),(0,M.l)(h,(0,k.r)((0,a.W)(o,x))));return[w,(0,M.l)((0,N.y)(w),(0,k.r)(E))]}});var F=n(69772),L=n(9160);const P=(0,h.op)({batchNorm2d_:function(e,t,n,i,r,s){const o=(0,c.YT)(e,"x","batchNorm"),a=(0,c.YT)(t,"mean","batchNorm"),l=(0,c.YT)(n,"variance","batchNorm");let u,h;return null!=r&&(u=(0,c.YT)(r,"scale","batchNorm")),null!=i&&(h=(0,c.YT)(i,"offset","batchNorm")),d.vA(2===o.rank,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`),d.vA(2===a.rank||1===a.rank,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${a.rank}.`),d.vA(2===l.rank||1===l.rank,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),null!=u&&d.vA(2===u.rank||1===u.rank,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),null!=h&&d.vA(2===h.rank||1===h.rank,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${h.rank}.`),(0,L.$)(o,a,l,h,u,s)}});const B=(0,h.op)({batchNorm3d_:function(e,t,n,i,r,s){const o=(0,c.YT)(e,"x","batchNorm"),a=(0,c.YT)(t,"mean","batchNorm"),l=(0,c.YT)(n,"variance","batchNorm");let u,h;return null!=r&&(u=(0,c.YT)(r,"scale","batchNorm")),null!=i&&(h=(0,c.YT)(i,"offset","batchNorm")),d.vA(3===o.rank,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`),d.vA(3===a.rank||1===a.rank,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${a.rank}.`),d.vA(3===l.rank||1===l.rank,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),null!=u&&d.vA(3===u.rank||1===u.rank,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),null!=h&&d.vA(3===h.rank||1===h.rank,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${h.rank}.`),(0,L.$)(o,a,l,h,u,s)}});const $=(0,h.op)({batchNorm4d_:function(e,t,n,i,r,s){const o=(0,c.YT)(e,"x","batchNorm"),a=(0,c.YT)(t,"mean","batchNorm"),l=(0,c.YT)(n,"variance","batchNorm");let u,h;return null!=r&&(u=(0,c.YT)(r,"scale","batchNorm")),null!=i&&(h=(0,c.YT)(i,"offset","batchNorm")),d.vA(4===o.rank,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`),d.vA(4===a.rank||1===a.rank,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${a.rank}.`),d.vA(4===l.rank||1===l.rank,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),null!=u&&d.vA(4===u.rank||1===u.rank,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),null!=h&&d.vA(4===h.rank||1===h.rank,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${h.rank}.`),(0,L.$)(o,a,l,h,u,s)}});const U=(0,h.op)({bincount_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"x","bincount"),r=(0,c.YT)(t,"weights","bincount");d.vA("int32"===i.dtype,()=>`Error in bincount: input dtype must be int32, but got ${i.dtype}`),d.vA(n>=0,()=>`size must be non-negative, but got ${n}.`),d.vA(r.size===i.size||0===r.size,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${i.shape}, weights shape: ${r.shape}.`);const s={x:i,weights:r},o={size:n};return l.T2.runKernel(u.N4F,s,o)}});const V=(0,h.op)({bitwiseAnd_:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"x","bitwiseAnd"),i=(0,c.YT)(t,"y","bitwiseAnd");if(!(0,d.r1)(n.shape,i.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${n.shape}, y: ${i.shape}`);if("int32"!==n.dtype||"int32"!==i.dtype)throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${n.dtype} and type of y: ${i.dtype}`);const r={a:n,b:i};return l.T2.runKernel(u.HNs,r)}});const z=(0,h.op)({broadcastArgs_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"s0","broadcastArgs","int32"),i=(0,c.YT)(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!==i.rank)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${i.rank}`);const r={s0:n,s1:i};return l.T2.runKernel(u.vj7,r)}});var j=n(63567),Y=n(448),G=n(30855),H=n(96928),W=n(70125),X=n(37148);const q=(0,h.op)({concat1d_:function(e){return(0,C.x)(e,0)}});const K=(0,h.op)({concat2d_:function(e,t){return(0,C.x)(e,t)}});const Z=(0,h.op)({concat3d_:function(e,t){return(0,C.x)(e,t)}});const Q=(0,h.op)({concat4d_:function(e,t){return(0,C.x)(e,t)}});var J=n(3701),ee=n(28794),te=n(41106);const ne=(0,h.op)({conv3d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r="NDHWC",s=[1,1,1]){const o=(0,c.YT)(e,"x","conv3d"),a=(0,c.YT)(t,"filter","conv3d");let h=o,p=!1;4===o.rank&&(p=!0,h=(0,A.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),d.vA(5===h.rank,()=>`Error in conv3d: input must be rank 5, but got rank ${h.rank}.`),d.vA(5===a.rank,()=>`Error in conv3d: filter must be rank 5, but got rank ${a.rank}.`),d.vA(h.shape[4]===a.shape[3],()=>`Error in conv3d: depth of input (${h.shape[4]}) must match input depth for filter ${a.shape[3]}.`),d.vA((0,I.G0)(n,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),d.vA("NDHWC"===r,()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`),d.vA((0,I.qk)(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),d.vA((0,I.qk)(n),()=>"Error in conv3D: Strides should be larger than 0.");const f={x:h,filter:a},m={strides:n,pad:i,dataFormat:r,dilations:s},g=l.T2.runKernel(u.A1h,f,m);return p?(0,A.t)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}});var ie=n(31895);const re=(0,h.op)({conv3dTranspose_:function(e,t,n,i,r){const s=(0,c.YT)(e,"x","conv3dTranspose"),o=(0,c.YT)(t,"filter","conv3dTranspose");return(0,ie.c)(n,s,o,i,r)}});var se=n(99907),oe=n(27451),ae=n(10302),le=n(76808);const ue=(0,h.op)({denseBincount_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=!1){const r=(0,c.YT)(e,"x","denseBincount"),s=(0,c.YT)(t,"weights","denseBincount");d.vA("int32"===r.dtype,()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),d.vA(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),d.vA(n>=0,()=>`size must be non-negative, but got ${n}.`),d.vA(s.size===r.size||0===s.size,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${r.shape}, weights shape: ${s.shape}.`);const o={x:r,weights:s},a={size:n,binaryOutput:i};return l.T2.runKernel(u.wNW,o,a)}});var ce=n(31216),de=n(10676);const he=(0,h.op)({diag_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,c.YT)(e,"x","diag")};return l.T2.runKernel(u.ORI,t)}});var pe=n(93002),fe=n(89359),me=n(919),ge=n(69759);const _e=(0,h.op)({einsum_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,...t){const n=t.map((e,t)=>(0,c.YT)(e,`tensors${t}`,"einsum")),i={equation:e};return l.T2.runKernel(u.Qgm,n,i)}});var ye=n(83416);const ve=(0,h.op)({ensureShape_:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"x","ensureShape","string_or_numeric");if(!(0,d.e_)(n.shape,t))throw new Error(`EnsureShape: Shape of tensor ${n.shape} is not compatible with expected shape ${t}`);return e}});var be=n(13020),Te=n(95207),xe=n(44881),Ee=n(8631),we=n(8710),Ie=n(40517),Ae=n(64826);const Se=(0,h.op)({eye_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i="float32"){null==t&&(t=e);const r=(0,Y.r)([e,t],i),s=e<=t?e:t;for(let e=0;e<s;++e)r.set(1,e,e);const o=(0,A.t)(r.toTensor(),[e,t]);if(null==n)return o;if(1===n.length)return(0,Ae.V)((0,we.U)(o,0),[n[0],1,1]);if(2===n.length)return(0,Ae.V)((0,we.U)((0,we.U)(o,0),0),[n[0],n[1],1,1]);if(3===n.length)return(0,Ae.V)((0,we.U)((0,we.U)((0,we.U)(o,0),0),0),[n[0],n[1],n[2],1,1]);throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${n.length}D.`)}});var Ce=n(96111),Oe=n(15606),Me=n(88991),ke=n(48229),Re=n(62058),Ne=n(13337),De=n(35040),Fe=n(68318),Le=n(33454),Pe=n(6300),Be=n(66919),$e=n(61303),Ue=n(56508);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ve(e,t,n){if(n<=0)throw new Error("The number of values should be positive.");const i={start:e,stop:t,num:n};return l.T2.runKernel(u.mnI,{},i)}var ze=n(93531),je=n(44010),Ye=n(12015),Ge=n(95645),He=n(97991),We=n(13330),Xe=n(13789),qe=n(89881),Ke=n(9879),Ze=n(19925);
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Qe=2147483648;const Je=(0,h.op)({searchSorted_:function(e,t,n="left"){const i=(0,c.YT)(e,"sortedSequence","searchSorted"),r=(0,c.YT)(t,"values","searchSorted"),s=i.shape[i.shape.length-1],o=r.shape[r.shape.length-1],a=(0,A.t)(i,[-1,s]),h=(0,A.t)(r,[-1,o]);if(a.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(a.shape[0]!==h.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if((0,d.Ze)(h.shape)>=Qe)throw new Error("values tensor size must less than 2147483648");if(a.shape[1]>=Qe)throw new Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${a.shape[1]}`);const p={sortedSequence:a,values:h},f={side:n};return l.T2.runKernel(u.uWl,p,f)}});
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function et(e,t){return Je(e,t,"left")}var tt=n(41938),nt=n(86999);const it=(0,h.op)({maxPool3d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=[1,1,1],n,i,r,s="NDHWC"){const o=(0,c.YT)(e,"x","maxPool3d");let a=o,h=!1;4===o.rank&&(h=!0,a=(0,A.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),d.vA(5===a.rank,()=>`Error in maxPool3d: x must be rank 5 but got rank ${a.rank}.`),d.vA("NDHWC"===s,()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),(0,I.s_)("maxPool3d",i,r);const p={x:a},f={filterSize:t,strides:n,pad:i,dimRoundingMode:r,dataFormat:s},m=l.T2.runKernel(u.ySp,p,f);return h?(0,A.t)(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}});const rt=(0,h.op)({maxPoolWithArgmax_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r=!1){const s={x:(0,c.YT)(e,"x","maxPoolWithArgmax")},o={filterSize:t,strides:n,pad:i,includeBatchInIndex:r},a=l.T2.runKernel(u.TL8,s,o);return{result:a[0],indexes:a[1]}}});var st=n(30178),ot=n(12611),at=n(61411),lt=n(50259);
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ut(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 i=(0,c.YT)(e,"x","meshgrid",e instanceof lt.qY?e.dtype:"float32");if(void 0===t)return[i];let r=(0,c.YT)(t,"y","meshgrid",t instanceof lt.qY?t.dtype:"float32");const s=(0,d.Ze)(i.shape),o=(0,d.Ze)(r.shape);return"xy"===n?(i=(0,A.t)(i,[1,-1]),r=(0,A.t)(r,[-1,1]),[(0,O.N)((0,at.S)([o,1],i.dtype),i),(0,O.N)(r,(0,at.S)([1,s],r.dtype))]):(i=(0,A.t)(i,[-1,1]),r=(0,A.t)(r,[1,-1]),[(0,O.N)(i,(0,at.S)([1,o],i.dtype)),(0,O.N)((0,at.S)([s,1],r.dtype),r)])}var ct=n(57436),dt=n(12644),ht=n(66567),pt=n(60152),ft=n(21078),mt=n(45793),gt=n(77126);const _t=(0,h.op)({moments_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){e=(0,c.YT)(e,"x","moments");const i=(0,d.Y6)(t,e.shape),r=(0,ot.i)(e,i,n);let s=r.shape;n||(s=(0,ft.SM)(r.shape,i));const o=(0,mt.E)((0,gt.j)((0,w.w)(e,"float32"),(0,A.t)(r,s)));return{mean:r,variance:(0,ot.i)(o,i,n)}}});const yt=(0,h.op)({multiRNNCell_:function(e,t,n,i){const r=(0,c.YT)(t,"data","multiRNNCell"),s=(0,c.j1)(n,"c","multiRNNCell"),o=(0,c.j1)(i,"h","multiRNNCell");let a=r;const l=[];for(let t=0;t<e.length;t++){const n=e[t](a,s[t],o[t]);l.push(n[0]),l.push(n[1]),a=n[1]}const u=[],d=[];for(let e=0;e<l.length;e+=2)u.push(l[e]),d.push(l[e+1]);return[u,d]}});const vt=(0,h.op)({multinomial_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=!1){const r=(0,c.YT)(e,"logits","multinomial"),s=r.size,o=r.rank;if(s<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${s}.`);if(o>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);n=n||Math.random();const a={logits:1===o?(0,A.t)(r,[1,-1]):r},d={numSamples:t,seed:n,normalized:i},h=l.T2.runKernel(u.WT3,a,d);return 1===o?(0,A.t)(h,[h.size]):h}});var bt=n(96522),Tt=n(42118),xt=n(11760),Et=n(69885);const wt=(0,h.op)({outerProduct_:function(e,t){const n=(0,c.YT)(e,"v1","outerProduct"),i=(0,c.YT)(t,"v2","outerProduct");d.vA(1===n.rank&&1===i.rank,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${i.rank}.`);const r=(0,A.t)(n,[-1,1]),s=(0,A.t)(i,[1,-1]);return(0,O.N)(r,s)}});var It=n(65661);const At=(0,h.op)({pad1d_:function(e,t,n=0){return(0,d.vA)(2===t.length,()=>"Invalid number of paddings. Must be length of 2."),(0,It.e)(e,[t],n)}});const St=(0,h.op)({pad2d_:function(e,t,n=0){return(0,d.vA)(2===t.length&&2===t[0].length&&2===t[1].length,()=>"Invalid number of paddings. Must be length of 2 each."),(0,It.e)(e,t,n)}});const Ct=(0,h.op)({pad3d_:function(e,t,n=0){return(0,d.vA)(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."),(0,It.e)(e,t,n)}});const Ot=(0,h.op)({pad4d_:function(e,t,n=0){return(0,d.vA)(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."),(0,It.e)(e,t,n)}});var Mt=n(17872),kt=n(98990),Rt=n(64394),Nt=n(75295),Dt=n(67771);const Ft=(0,h.op)({raggedGather_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r={paramsNestedSplits:e.map((e,t)=>(0,c.YT)(e,`tensors${t}`,"raggedGather","int32")),paramsDenseValues:(0,c.YT)(t,"paramsDenseValues","raggedGather"),indices:(0,c.YT)(n,"indices","raggedGather","int32")},s={outputRaggedRank:i},o=l.T2.runKernel(u.oJ2,r,s);return{outputNestedSplits:o.slice(0,o.length-1),outputDenseValues:o[o.length-1]}}});const Lt=(0,h.op)({raggedRange_:
/**
* @license
* Copyright 2022 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"starts","raggedRange"),r={starts:i,limits:(0,c.YT)(t,"limits","raggedRange",i.dtype),deltas:(0,c.YT)(n,"deltas","raggedRange",i.dtype)},s=l.T2.runKernel(u.CQC,r);return{rtNestedSplits:s[0],rtDenseValues:s[1]}}});const Pt=(0,h.op)({raggedTensorToTensor_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r){const s=(0,c.YT)(e,"shape","raggedTensorToTensor","int32"),o=(0,c.YT)(t,"values","raggedTensorToTensor"),a={shape:s,values:o,defaultValue:(0,c.YT)(n,"defaultValue","raggedTensorToTensor",o.dtype),rowPartitionTensors:i.map((e,t)=>(0,c.YT)(e,`tensors${t}`,"raggedTensorToTensor","int32"))},d={rowPartitionTypes:r};return l.T2.runKernel(u.mH5,a,d)}});const Bt=(0,h.op)({rand_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){(0,d.SA)(e);const i=(0,d.Ze)(e);let r=null;if(null==n||"float32"===n)r=new Float32Array(i);else if("int32"===n)r=new Int32Array(i);else{if("bool"!==n)throw new Error(`Unknown data type ${n}`);r=new Uint8Array(i)}for(let e=0;e<i;e++)r[e]=t();return l.T2.makeTensor(r,e,n)}});var $t=n(7391);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Ut{constructor(e,t,n,i,r){this.mean=e,this.stdDev=t,this.dtype=n,this.nextVal=NaN,this.truncated=i,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);const s=r||Math.random();this.random=$t.alea(s.toString())}nextValue(){if(!isNaN(this.nextVal)){const e=this.nextVal;return this.nextVal=NaN,e}let e,t,n=!1;for(;!n;){let i,r,s;do{i=2*this.random()-1,r=2*this.random()-1,s=i*i+r*r}while(s>=1||0===s);const o=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*i*o,t=this.mean+this.stdDev*r*o,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 Vt{constructor(e,t,n,i){this.alpha=e,this.beta=1/t,this.dtype=n;const r=i||Math.random();this.randu=$t.alea(r.toString()),this.randn=new Ut(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,i,r,s;for(;;){do{i=this.randn.nextValue(),s=1+this.c*i}while(s<=0);if(s*=s*s,e=i*i,t=1-.331*e*e,n=.5*e+this.d*(1-s+Math.log(s)),r=this.randu(),r<t||Math.log(r)<n)break}return s=1/this.beta*this.d*s,this.alpha<1&&(s*=Math.pow(this.randu(),1/this.alpha)),this.convertValue(s)}convertValue(e){return"float32"===this.dtype?e:Math.round(e)}}class zt{constructor(e=0,t=1,n,i){if(this.canReturnFloat=()=>null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=n,null==i&&(i=Math.random()),"number"==typeof i&&(i=i.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=$t.alea(i)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}const jt=(0,h.op)({randomGamma_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=1,i="float32",r){if((0,d.SA)(e),null==n&&(n=1),null==i&&(i="float32"),"float32"!==i&&"int32"!==i)throw new Error(`Unsupported data type ${i}`);const s=new Vt(t,n,i,r),o=(0,Y.r)(e,i);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const Yt=(0,h.op)({randomNormal_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0,n=1,i,r){if((0,d.SA)(e),null!=i&&"bool"===i)throw new Error(`Unsupported data type ${i}`);const s=new Ut(t,n,i,!1,r),o=(0,Y.r)(e,i);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});const Gt=(0,h.op)({randomStandardNormal_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){if(null!=t&&"bool"===t)throw new Error(`Unsupported data type ${t}`);return Yt(e,0,1,t,n)}});const Ht=(0,h.op)({randomUniform_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0,n=1,i="float32",r){(0,d.SA)(e);const s=(0,Y.r)(e,i),o=new zt(t,n,null,r);for(let e=0;e<s.values.length;e++)s.values[e]=o.nextValue();return s.toTensor()}});const Wt=(0,h.op)({randomUniformInt_:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){return Ht(e,t,n,"int32",i)}});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Xt(e,t,n=1,i="float32"){if(0===n)throw new Error("Cannot have a step of zero");const r={start:e,stop:t,step:n,dtype:i};return l.T2.runKernel(u.Q6t,{},r)}var qt=n(1902),Kt=n(19870),Zt=n(90112),Qt=n(83732),Jt=n(53262);const en=(0,h.op)({reverse1d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,c.YT)(e,"x","reverse");return d.vA(1===t.rank,()=>`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),(0,Jt.B)(t,0)}});const tn=(0,h.op)({reverse2d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"x","reverse");return d.vA(2===n.rank,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),(0,Jt.B)(n,t)}});const nn=(0,h.op)({reverse3d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"x","reverse");return d.vA(3===n.rank,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),(0,Jt.B)(n,t)}});const rn=(0,h.op)({reverse4d_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"x","reverse");return d.vA(4===n.rank,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),(0,Jt.B)(n,t)}});var sn=n(25912),on=n(17820),an=n(45702),ln=n(26325),un=n(89986);const cn=
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t){const n=(0,c.YT)(e,"x","setdiff1d"),i=(0,c.YT)(t,"y","setdiff1d");d.vA(n.dtype===i.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${i.dtype}).`),d.vA(1===n.rank,()=>`x should be 1D tensor, but got x (${n.shape}).`),d.vA(1===i.rank,()=>`y should be 1D tensor, but got y (${i.shape}).`);const r=await n.data(),s=await i.data(),o=new Set(s);let a=0;for(let e=0;e<r.length;e++)o.has(r[e])||a++;const l=new lt.yl([a],n.dtype),u=new lt.yl([a],"int32");for(let e=0,t=0;e<r.length;e++)o.has(r[e])||(l.values[t]=r[e],u.values[t]=e,t++);return[l.toTensor(),u.toTensor()]};var dn=n(51115),hn=n(33726),pn=n(58276);const fn=(0,h.op)({slice1d_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"x","slice1d");return d.vA(1===i.rank,()=>`slice1d expects a rank-1 tensor, but got a rank-${i.rank} tensor`),(0,R.d)(i,[t],[n])}});const mn=(0,h.op)({slice2d_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"x","slice2d");return d.vA(2===i.rank,()=>`slice2d expects a rank-2 tensor, but got a rank-${i.rank} tensor`),(0,R.d)(i,t,n)}});const gn=(0,h.op)({slice3d_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"x","slice3d");return d.vA(3===i.rank,()=>`slice3d expects a rank-3 tensor, but got a rank-${i.rank} tensor`),(0,R.d)(i,t,n)}});const _n=(0,h.op)({slice4d_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"x","slice4d");return d.vA(4===i.rank,()=>`slice4d expects a rank-4 tensor, but got a rank-${i.rank} tensor`),(0,R.d)(i,t,n)}});var yn=n(26346),vn=n(66030),bn=n(10776),Tn=n(41361),xn=n(13108),En=n(22292),wn=n(8775),In=n(66512),An=n(79348),Sn=n(53427),Cn=n(5932),On=n(54268),Mn=n(10700),kn=n(45894),Rn=n(83791),Nn=n(77823),Dn=n(74027),Fn=n(19171);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ln(e,t){(0,d.HO)(e);const n=(0,c.MZ)(e,t);if(1!==n.length)throw new Error("tensor1d() requires values to be a flat/TypedArray");return(0,Fn.Q)(e,null,n,t)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Pn(e,t,n){if((0,d.HO)(e),null!=t&&2!==t.length)throw new Error("tensor2d() requires shape to have two numbers");const i=(0,c.MZ)(e,n);if(2!==i.length&&1!==i.length)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===i.length&&null==t)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return(0,Fn.Q)(e,t,i,n)}var Bn=n(42768);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function $n(e,t,n){if((0,d.HO)(e),null!=t&&4!==t.length)throw new Error("tensor4d() requires shape to have four numbers");const i=(0,c.MZ)(e,n);if(4!==i.length&&1!==i.length)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===i.length&&null==t)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return(0,Fn.Q)(e,t,i,n)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Un(e,t,n){if((0,d.HO)(e),null!=t&&5!==t.length)throw new Error("tensor5d() requires shape to have five numbers");const i=(0,c.MZ)(e,n);if(5!==i.length&&1!==i.length)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===i.length&&null==t)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return(0,Fn.Q)(e,t,i,n)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Vn(e,t,n){if((0,d.HO)(e),null!=t&&6!==t.length)throw new Error("tensor6d() requires shape to have six numbers");const i=(0,c.MZ)(e,n);if(6!==i.length&&1!==i.length)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===i.length&&null==t)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||i,(0,Fn.Q)(e,t,i,n)}var zn=n(26170);const jn=(0,h.op)({tensorScatterUpdate_:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"tensor","tensorScatterupdate"),r=(0,c.YT)(t,"indices","tensorScatterupdate","int32"),s=(0,c.YT)(n,"updates","tensorScatterupdate");if(zn.validateInput(s,r,i.shape),i.dtype!==s.dtype)throw new Error(`tensor and updates must have the same dtype, instead they are ${i.dtype} and ${s.dtype}.`);const o={tensor:i,indices:r,updates:s};return l.T2.runKernel(u.X4r,o,{})}});var Yn=n(21190);const Gn=(0,h.op)({truncatedNormal_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0,n=1,i,r){if((0,d.SA)(e),null!=i&&"bool"===i)throw new Error("Unsupported data type $ { dtype }");const s=new Ut(t,n,i,!0,r),o=(0,Y.r)(e,i);for(let e=0;e<o.values.length;e++)o.values[e]=s.nextValue();return o.toTensor()}});var Hn=n(73937),Wn=n(97706),Xn=n(67261);
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function qn(e,t){return Je(e,t,"right")}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Kn(e,t=!0,n,i){return l.T2.makeVariable(e,t,n,i)}var Zn=n(12151),Qn=n(54411);const Jn=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e){const t=(0,c.YT)(e,"condition","whereAsync","bool"),n=await t.data(),i=(0,Qn.Y)(t.shape,n);return e!==t&&t.dispose(),i};var ei=n(42855),ti=n(55537);const ni=
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t,n){const i=(0,c.YT)(e,"tensor","boolMask"),r=(0,c.YT)(t,"mask","boolMask","bool"),s=null==n?0:n,o=r.rank,a=i.shape;d.vA(o>0,()=>"mask cannot be scalar"),d.O3(a.slice(s,s+o),r.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let e=s;e<s+o;e++)l*=a[e];const u=a.slice(0,s).concat([l],a.slice(s+o)),h=(0,A.t)(i,u),p=(0,A.t)(r,[-1]),f=await Jn(p),m=(0,Cn.r)(f,[1]),g=(0,ke.k)(h,m,s);return e!==i&&i.dispose(),t!==r&&r.dispose(),m.dispose(),h.dispose(),p.dispose(),f.dispose(),g};var ii=n(7703),ri=n(92596),si=n(30565);const oi=(0,h.op)({movingAverage_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r=!0){const s=(0,c.YT)(e,"v","movingAverage"),o=(0,c.YT)(t,"x","movingAverage"),l=(0,c.YT)(n,"decay","movingAverage");(0,si.assertTypesMatch)(s,o),d.vA(d.r1(s.shape,o.shape),()=>"Shape mismatch in v and x");const u=(0,an.d)(1),h=(0,gt.j)(u,l);let p=(0,M.l)((0,gt.j)(o,s),h);if(r){d.vA(null!=i,()=>"When using zeroDebias: true, step is required.");const e=(0,c.YT)(i,"step","movingAverage");p=(0,fe.y)(p,(0,gt.j)(u,(0,kt.n)(l,e)))}return(0,a.W)(s,p)}});const ai=(0,h.op)({scatterND_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){(0,d.SA)(n);const i=(0,c.YT)(e,"indices","scatterND","int32"),r=(0,c.YT)(t,"updates","scatterND");zn.validateInput(r,i,n);const s={indices:i,updates:r},o={shape:n};return l.T2.runKernel(u.pJc,s,o)}});const li=(0,h.op)({sparseToDense_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=0){(0,d.SA)(n);const r=(0,c.YT)(e,"sparseIndices","sparseToDense","int32"),s=(0,c.YT)(t,"sparseValues","sparseToDense","string_or_numeric"),o=(0,c.YT)(i,"defaultValue","sparseToDense",s.dtype);!function(e,t,n,i){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,s=e.rank>1?e.shape[1]:1;if(n.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${s}.`);const o=t.size;if(0!==t.rank&&(1!==t.rank||o!==r))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${r}]`);if(t.dtype!==i.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}(r,s,n,o);const a={sparseIndices:r,sparseValues:s,defaultValue:o},h={outputShape:n};return l.T2.runKernel(u.jgd,a,h)}});const ui=(0,h.op)({gatherND_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(t,"indices","gatherND","int32"),i={params:(0,c.YT)(e,"x","gatherND","string_or_numeric"),indices:n};return l.T2.runKernel(u.O4G,i)}});const ci=(0,h.op)({dropout_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=(0,c.YT)(e,"x","dropout");if(d.vA("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.`),d.vA(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),0===t)return e instanceof lt.qY?r.clone():r;const s=
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){if(null==t)return e.shape.slice();if(d.r1(e.shape,t))return t;if(e.shape.length===t.length){const n=[];for(let i=0;i<e.shape.length;i++)null==t[i]&&null!=e.shape[i]?n.push(e.shape[i]):n.push(t[i]);return n}return t}(r,n),o=1-t,l=(0,fe.y)((0,Oe.R)((0,a.W)(Ht(s,0,1,"float32",i),o)),o);return(0,M.l)(r,l)}});
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function di(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function hi(e,t,n){const i=1-e%2,r=new Float32Array(e);for(let s=0;s<e;++s){const o=2*Math.PI*s/(e+i-1);r[s]=t-n*Math.cos(o)}return Ln(r,"float32")}const pi=
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t,n=1){const i=(0,c.YT)(e,"predictions","inTopK"),r=(0,c.YT)(t,"targets","inTopK");(0,d.vA)(i.rank>1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${i.rank}`),(0,d.vA)(i.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${i.rank} and targets rank ${r.rank}`),(0,d.O3)(i.shape.slice(0,i.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const s=i.shape[i.shape.length-1];(0,d.vA)(n>0&&n<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${n}`);const o=await i.data(),a=await r.data(),[l,u]=[o.length/s,s],h=(0,d.ce)("bool",l);for(let e=0;e<l;e++){const t=e*u,i=o.subarray(t,t+u),r=[];for(let e=0;e<i.length;e++)r.push({value:i[e],index:e});r.sort((e,t)=>t.value-e.value),h[e]=0;for(let t=0;t<n;t++)if(r[t].index===a[e]){h[e]=1;break}}return e!==i&&i.dispose(),t!==r&&r.dispose(),(0,Dn.O)(h,r.shape,"bool")};var fi=n(31830),mi=n(62198),gi=n(25248),_i=n(80252),yi=n(68646);const vi=(0,h.op)({fusedConv2d_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function({x:e,filter:t,strides:n,pad:i,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:o,bias:h,activation:p="linear",preluActivationWeights:f,leakyreluAlpha:m}){if(p=p||"linear",!1===(0,yi.zE)(l.T2.state.gradientDepth,p)){d.vA("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 l=(0,ee.X)(e,t,n,i,r,s,o);return null!=h&&(l=(0,a.W)(l,h)),(0,yi.f2)(l,p,f,m)}const g=(0,c.YT)(e,"x","conv2d","float32"),_=(0,c.YT)(t,"filter","conv2d","float32");let y=g,v=!1;3===g.rank&&(v=!0,y=(0,A.t)(g,[1,g.shape[0],g.shape[1],g.shape[2]])),d.vA(4===y.rank,()=>`Error in fused conv2d: input must be rank 4, but got rank ${y.rank}.`),d.vA(4===_.rank,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${_.rank}.`),I.s_("fused conv2d",i,o);const b="NHWC"===r?y.shape[3]:y.shape[1];d.vA(_.shape[2]===b,()=>`Error in conv2d: depth of input (${b}) must match input depth for filter ${_.shape[2]}.`),d.vA(I.G0(n,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`);const T=I.uf(y.shape,_.shape,n,s,i,o);let x,E;if(null!=h&&(x=(0,c.YT)(h,"bias","fused conv2d"),[x]=(0,si.makeTypesMatch)(x,g),"NHWC"===r?mi.assertAndGetBroadcastShape(T.outShape,x.shape):(d.vA(x.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`),d.vA(0===x.shape.length||x.shape[0]===T.outChannels||1===x.shape[0],()=>`Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${T.outChannels})`))),null!=f){const e=f.shape;if(d.vA(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)d.vA(1===e[0]||e[0]===T.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${T.outChannels}).`);else if(3===e.length)try{mi.assertAndGetBroadcastShape(e,T.outShape)}catch(t){const n=`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${T.outShape}).`;throw Error(n)}E=(0,c.YT)(f,"prelu weights","fused conv2d")}const w=(e,t)=>{d.vA("NHWC"===r,()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`);const[o,a,l,u]=t,c=(0,yi.XB)(e,l,p);d.vA(I.Dh(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);const h=[(0,_i.v)(a.shape,c,o,n,i),(0,gi.H)(a,c,o.shape,n,i)];if(null!=u){const e=(0,yi.Do)(u,c);h.push(e)}return h},S={x:y,filter:_,bias:x,preluActivationWeights:E},C={strides:n,pad:i,dataFormat:r,dilations:s,dimRoundingMode:o,activation:p,leakyreluAlpha:m};if(null==h){const e=(0,fi._X)((e,t,n)=>{let i=l.T2.runKernel(u.aAr,S,C);return n([t,e,i]),v&&(i=(0,A.t)(i,[i.shape[1],i.shape[2],i.shape[3]])),{value:i,gradFunc:w}});return e(y,_)}{const e=(0,fi._X)((e,t,n,i)=>{let r=l.T2.runKernel(u.aAr,S,C);return i([t,e,r,n]),v&&(r=(0,A.t)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:w}});return e(y,_,x)}}});var bi=n(41890),Ti=n(83134);const xi=(0,h.op)({fusedDepthwiseConv2d_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function({x:e,filter:t,strides:n,pad:i,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:o,bias:h,activation:p="linear",preluActivationWeights:f,leakyreluAlpha:m}){if(!1===(0,yi.zE)(l.T2.state.gradientDepth,p)){let l=(0,de.G)(e,t,n,i,r,s,o);return null!=h&&(l=(0,a.W)(l,h)),(0,yi.f2)(l,p,f,m)}const g=(0,c.YT)(e,"x","depthwiseConv2d","float32"),_=(0,c.YT)(t,"filter","depthwiseConv2d","float32");let y=g,v=!1;3===g.rank&&(v=!0,y=(0,A.t)(g,[1,g.shape[0],g.shape[1],g.shape[2]])),d.vA(4===y.rank,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${y.rank}.`),d.vA(4===_.rank,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${_.rank}.`),d.vA(y.shape[3]===_.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${y.shape[3]}) must match the inChannels dimension in filter ${_.shape[2]}.`),null==s&&(s=[1,1]),d.vA(I.G0(n,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${s}'`),I.s_("fused depthwiseConv2d",i,o);const b=I.uf(y.shape,_.shape,n,s,i,o,!0);let T,x;null!=h&&(T=(0,c.YT)(h,"bias","fused conv2d"),[T]=(0,si.makeTypesMatch)(T,g),mi.assertAndGetBroadcastShape(b.outShape,T.shape)),null!=f&&(x=(0,c.YT)(f,"prelu weights","fused depthwiseConv2d"));const E=(e,t)=>{d.vA(I.Dh(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);const[r,a,l,u]=t,c=(0,yi.XB)(e,l,p),h=(0,Ti.l)(a.shape,c,r,n,i,s,o),f=(0,bi.x)(a,c,r.shape,n,i,s,o);if(null!=u){return[h,f,(0,yi.Do)(T,c)]}return[h,f]},w={x:y,filter:_,bias:T,preluActivationWeights:x},S={strides:n,pad:i,dataFormat:r,dilations:s,dimRoundingMode:o,activation:p,leakyreluAlpha:m};if(null==h){const e=(0,fi._X)((e,t,n)=>{let i=l.T2.runKernel(u.T7M,w,S);return n([t,e,i]),v&&(i=(0,A.t)(i,[i.shape[1],i.shape[2],i.shape[3]])),{value:i,gradFunc:E}});return e(y,_)}{const e=(0,fi._X)((e,t,n,i)=>{let r=l.T2.runKernel(u.T7M,w,S);return i([t,e,r,n]),v&&(r=(0,A.t)(r,[r.shape[1],r.shape[2],r.shape[3]])),{value:r,gradFunc:E}});return e(y,_,T)}}});const Ei=(0,h.op)({fusedMatMul_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function({a:e,b:t,transposeA:n=!1,transposeB:i=!1,bias:r,activation:s="linear",preluActivationWeights:o,leakyreluAlpha:h=.2}){if(!1===(0,yi.zE)(l.T2.state.gradientDepth,s)){let l=(0,O.N)(e,t,n,i);return null!=r&&(l=(0,a.W)(l,r)),(0,yi.f2)(l,s,o,h)}let p=(0,c.YT)(e,"a","fused matMul"),f=(0,c.YT)(t,"b","fused matMul");[p,f]=(0,si.makeTypesMatch)(p,f);const m=n?p.shape[p.rank-2]:p.shape[p.rank-1],g=i?f.shape[f.rank-1]:f.shape[f.rank-2],_=n?p.shape[p.rank-1]:p.shape[p.rank-2],y=i?f.shape[f.rank-2]:f.shape[f.rank-1],v=p.shape.slice(0,-2),b=f.shape.slice(0,-2),T=d.Ze(v),x=d.Ze(b);d.vA(m===g,()=>`Error in fused matMul: inner shapes (${m}) and (${g}) of Tensors with shapes ${p.shape} and ${f.shape} and transposeA=${n} and transposeB=${i} must match.`);const E=mi.assertAndGetBroadcastShape(p.shape.slice(0,-2),f.shape.slice(0,-2)).concat([_,y]),w=n?(0,A.t)(p,[T,m,_]):(0,A.t)(p,[T,_,m]),I=i?(0,A.t)(f,[x,y,g]):(0,A.t)(f,[x,g,y]);let S,C;null!=r&&(S=(0,c.YT)(r,"bias","fused matMul"),[S]=(0,si.makeTypesMatch)(S,p),mi.assertAndGetBroadcastShape(E,S.shape)),null!=o&&(C=(0,c.YT)(o,"prelu weights","fused matMul"));const M=(e,t)=>{const[o,a,l,u]=t,c=(0,yi.XB)((0,A.t)(e,l.shape),l,s);let d,h;if(n||i?!n&&i?(d=(0,O.N)(c,a,!1,!1),h=(0,O.N)(c,o,!0,!1)):n&&!i?(d=(0,O.N)(a,c,!1,!0),h=(0,O.N)(o,c,!1,!1)):(d=(0,O.N)(a,c,!0,!0),h=(0,O.N)(c,o,!0,!0)):(d=(0,O.N)(c,a,!1,!0),h=(0,O.N)(o,c,!0,!1)),null!=r){return[d,h,(0,yi.Do)(u,c)]}return[d,h]},k={a:w,b:I,bias:S,preluActivationWeights:C},R={transposeA:n,transposeB:i,activation:s,leakyreluAlpha:h};if(null==r){const e=(0,fi._X)((e,t,n)=>{const i=l.T2.runKernel(u.Dr,k,R);return n([e,t,i]),{value:(0,A.t)(i,E),gradFunc:M}});return e(w,I)}{const e=(0,fi._X)((e,t,n,i)=>{const r=l.T2.runKernel(u.Dr,k,R);return i([e,t,r,n]),{value:(0,A.t)(r,E),gradFunc:M}});return e(w,I,S)}}});const wi=(0,h.op)({hammingWindow_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){return hi(e,.54,.46)}});const Ii=(0,h.op)({hannWindow_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){return hi(e,.5,.5)}});const Ai=(0,h.op)({frame_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=!1,r=0){let s=0;const o=[];for(;s+t<=e.size;)o.push((0,R.d)(e,s,t)),s+=n;if(i)for(;s<e.size;){const i=s+t-e.size,a=(0,C.x)([(0,R.d)(e,s,t-i),(0,Ce.G)([i],r)]);o.push(a),s+=n}return 0===o.length?Pn([],[0,t]):(0,A.t)((0,C.x)(o),[o.length,t])}});const Si=(0,h.op)({stft_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r=Ii){null==i&&(i=di(t));const s=Ai(e,t,n),o=(0,M.l)(s,r(t));return(0,wn.z)(o,i)}});const Ci=(0,h.op)({cropAndResize_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r="bilinear",s=0){const o=(0,c.YT)(e,"image","cropAndResize"),a=(0,c.YT)(t,"boxes","cropAndResize","float32"),h=(0,c.YT)(n,"boxInd","cropAndResize","int32"),p=a.shape[0];d.vA(4===o.rank,()=>`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`),d.vA(2===a.rank&&4===a.shape[1],()=>`Error in cropAndResize: boxes must be have size [${p},4] but had shape ${a.shape}.`),d.vA(1===h.rank&&h.shape[0]===p,()=>`Error in cropAndResize: boxInd must be have size [${p}] but had shape ${a.shape}.`),d.vA(2===i.length,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${i.length}.`),d.vA(i[0]>=1&&i[1]>=1,()=>`cropSize must be atleast [1,1], but was ${i}`),d.vA("bilinear"===r||"nearest"===r,()=>`method must be bilinear or nearest, but was ${r}`);const f={image:o,boxes:a,boxInd:h},m={method:r,extrapolationValue:s,cropSize:i};return l.T2.runKernel(u.MRQ,f,m)}});const Oi=(0,h.op)({flipLeftRight_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,c.YT)(e,"image","flipLeftRight","float32");d.vA(4===t.rank,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);const n={image:t};return l.T2.runKernel(u.BxF,n,{})}});const Mi=(0,h.op)({grayscaleToRGB_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,c.YT)(e,"image","grayscaleToRGB"),n=t.rank-1,i=t.shape[n];d.vA(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),d.vA(1===i,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${i}.`);const r=new Array(t.rank);return r.fill(1,0,n),r[n]=3,(0,Ae.V)(t,r)}});const ki=(0,h.op)({rgbToGrayscale_:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,c.YT)(e,"image","RGBToGrayscale"),n=t.rank-1,i=t.shape[n];d.vA(t.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`),d.vA(3===i,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${i}.`);const r=t.dtype,s=(0,w.w)(t,"float32"),o=Ln([.2989,.587,.114]);let a;switch(t.rank){case 2:a=_e("ij,j->i",s,o);break;case 3:a=_e("ijk,k->ij",s,o);break;case 4:a=_e("ijkl,l->ijk",s,o);break;case 5:a=_e("ijklm,m->ijkl",s,o);break;case 6:a=_e("ijklmn,n->ijklm",s,o);break;default:throw new Error("Not a valid tensor rank.")}return a=(0,we.U)(a,-1),(0,w.w)(a,r)}});const Ri=(0,h.op)({rotateWithOffset_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=0,i=.5){const r=(0,c.YT)(e,"image","rotateWithOffset","float32");d.vA(4===r.rank,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);const s={image:r},o={radians:t,fillValue:n,center:i};return l.T2.runKernel(u.BK4,s,o)}});
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ni(e,t,n,i,r,s){null==i&&(i=.5),null==r&&(r=Number.NEGATIVE_INFINITY),null==s&&(s=0);const o=e.shape[0];return n=Math.min(n,o),d.vA(0<=i&&i<=1,()=>`iouThreshold must be in [0, 1], but was '${i}'`),d.vA(2===e.rank,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),d.vA(4===e.shape[1],()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),d.vA(1===t.rank,()=>"scores must be a 1D tensor"),d.vA(t.shape[0]===o,()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${t.shape[0]}`),d.vA(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:n,iouThreshold:i,scoreThreshold:r,softNmsSigma:s}}const Di=(0,h.op)({nonMaxSuppression_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY){const s=(0,c.YT)(e,"boxes","nonMaxSuppression","float32"),o=(0,c.YT)(t,"scores","nonMaxSuppression","float32"),a=Ni(s,o,n,i,r),d={maxOutputSize:n=a.maxOutputSize,iouThreshold:i=a.iouThreshold,scoreThreshold:r=a.scoreThreshold};return l.T2.runKernel(u.SDM,{boxes:s,scores:o},d)}});var Fi=n(8360);const Li=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY){const s=(0,c.YT)(e,"boxes","nonMaxSuppressionAsync"),o=(0,c.YT)(t,"scores","nonMaxSuppressionAsync"),a=Ni(s,o,n,i,r);n=a.maxOutputSize,i=a.iouThreshold,r=a.scoreThreshold;const l=await Promise.all([s.data(),o.data()]),u=l[0],d=l[1],{selectedIndices:h}=(0,Fi.c7)(u,d,n,i,r);return s!==e&&s.dispose(),o!==t&&o.dispose(),Ln(h,"int32")};const Pi=(0,h.op)({nonMaxSuppressionWithScore_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY,s=0){const o=(0,c.YT)(e,"boxes","nonMaxSuppression"),a=(0,c.YT)(t,"scores","nonMaxSuppression"),d=Ni(o,a,n,i,r,s),h={boxes:o,scores:a},p={maxOutputSize:n=d.maxOutputSize,iouThreshold:i=d.iouThreshold,scoreThreshold:r=d.scoreThreshold,softNmsSigma:s=d.softNmsSigma},f=l.T2.runKernel(u.e0f,h,p);return{selectedIndices:f[0],selectedScores:f[1]}}});const Bi=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY,s=0){const o=(0,c.YT)(e,"boxes","nonMaxSuppressionAsync"),a=(0,c.YT)(t,"scores","nonMaxSuppressionAsync"),l=Ni(o,a,n,i,r,s);n=l.maxOutputSize,i=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;const u=await Promise.all([o.data(),a.data()]),d=u[0],h=u[1],{selectedIndices:p,selectedScores:f}=(0,Fi.ut)(d,h,n,i,r,s);return o!==e&&o.dispose(),a!==t&&a.dispose(),{selectedIndices:Ln(p,"int32"),selectedScores:Ln(f)}};const $i=(0,h.op)({nonMaxSuppressionPadded_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY,s=!1){const o=(0,c.YT)(e,"boxes","nonMaxSuppression"),a=(0,c.YT)(t,"scores","nonMaxSuppression"),d=Ni(o,a,n,i,r,null),h={boxes:o,scores:a},p={maxOutputSize:d.maxOutputSize,iouThreshold:d.iouThreshold,scoreThreshold:d.scoreThreshold,padToMaxOutputSize:s},f=l.T2.runKernel(u.Zl4,h,p);return{selectedIndices:f[0],validOutputs:f[1]}}});const Ui=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
async function(e,t,n,i=.5,r=Number.NEGATIVE_INFINITY,s=!1){const o=(0,c.YT)(e,"boxes","nonMaxSuppressionAsync"),a=(0,c.YT)(t,"scores","nonMaxSuppressionAsync"),l=Ni(o,a,n,i,r,null),u=l.maxOutputSize,d=l.iouThreshold,h=l.scoreThreshold,[p,f]=await Promise.all([o.data(),a.data()]),{selectedIndices:m,validOutputs:g}=(0,Fi.ZS)(p,f,u,d,h,s);return o!==e&&o.dispose(),a!==t&&a.dispose(),{selectedIndices:Ln(m,"int32"),validOutputs:(0,an.d)(g,"int32")}};var Vi=n(44711),zi=n(42954);const ji=(0,h.op)({threshold_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t="binary",n=!1,i=.5){const r=(0,c.YT)(e,"image","threshold"),s=r.shape[0]*r.shape[1];let o,l,u,h,p=(0,M.l)(Ln([i]),255);if(d.vA(3===r.rank,()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`),d.vA(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]}.`),d.vA("int32"===r.dtype||"float32"===r.dtype,()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`),d.vA("otsu"===t||"binary"===t,()=>`Method must be binary or otsu, but was ${t}`),3===r.shape[2]){[o,l,u]=(0,In.l)(r,[1,1,1],-1);const e=(0,M.l)(o,.2989),t=(0,M.l)(l,.587),n=(0,M.l)(u,.114);h=(0,a.W)((0,a.W)(e,t),n)}else h=e;if("otsu"===t){p=function(e,t){let n,i,r,s,o,l,u=Ln([-1]),c=Ln([0]),d=Ln([0]);for(let h=0;h<e.size-1;h++){n=(0,R.d)(e,0,h+1),i=(0,R.d)(e,h+1),o=(0,fe.y)((0,Rn.c)(n),t),l=(0,fe.y)((0,Rn.c)(i),t);const p=(0,Rn.c)((0,M.l)(n,Xt(0,n.size)));r=(0,fe.y)(p,(0,Rn.c)(n));const f=(0,Ce.G)(i.shape,n.size),m=(0,a.W)(Xt(0,i.size),f),g=(0,M.l)(i,m);s=(0,fe.y)((0,Rn.c)(g),(0,Rn.c)(i));const _=(0,gt.j)(r,s),y=(0,gt.j)(r,s),v=(0,M.l)(o,l);d=(0,M.l)((0,M.l)(v,_),y);const b=(0,Re.r)(d,c);c=(0,Zn._)(b,d,c),u=(0,Zn._)(b,Ln([h]),u)}return u}(U((0,w.w)((0,sn.L)(h),"int32"),(0,Dn.O)([]),256),s)}const f=n?(0,Ue.I)(h,p):(0,Re.r)(h,p);return(0,w.w)((0,M.l)(f,255),"int32")}});const Yi=(0,h.op)({transform_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n="nearest",i="constant",r=0,s){const o=(0,c.YT)(e,"image","transform","float32"),a=(0,c.YT)(t,"transforms","transform","float32");d.vA(4===o.rank,()=>`Error in transform: image must be rank 4,but got rank ${o.rank}.`),d.vA(2===a.rank&&(a.shape[0]===o.shape[0]||1===a.shape[0])&&8===a.shape[1],()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),d.vA(null==s||2===s.length,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);const h={image:o,transforms:a},p={interpolation:n,fillMode:i,fillValue:r,outputShape:s};return l.T2.runKernel(u.dLy,h,p)}});const Gi=(0,h.op)({bandPart_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"a","bandPart");(0,d.vA)(i.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${i.rank}.`);const r=i.shape,[s,o]=i.shape.slice(-2);let a,l;"number"==typeof t?((0,d.vA)(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),(0,d.vA)(t<=s,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`),a=(0,c.YT)(t<0?s:t,"numLower","bandPart")):((0,d.vA)("int32"===t.dtype,()=>"bandPart(): numLower's dtype must be an int32."),a=(0,Zn._)((0,$e.M)(t,0),s,(0,dt.B)(t,s))),"number"==typeof n?((0,d.vA)(n%1==0,()=>`bandPart(): numUpper must be an integer, got ${n}.`),(0,d.vA)(n<=o,()=>`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`),l=(0,c.YT)(n<0?o:n,"numUpper","bandPart")):((0,d.vA)("int32"===n.dtype,()=>"bandPart(): numUpper's dtype must be an int32."),l=(0,Zn._)((0,$e.M)(n,0),o,(0,dt.B)(n,o)));const u=(0,A.t)(Xt(0,s,1,"int32"),[-1,1]),h=Xt(0,o,1,"int32"),p=(0,gt.j)(u,h),f=(0,Xe.n)((0,Ue.I)(p,a),(0,Ne.D)(p,(0,bt.H)(l))),m=(0,ei.U)([s,o],i.dtype);return(0,A.t)((0,On.t)((0,Xn.K)((0,A.t)(i,[-1,s,o])).map(e=>(0,Zn._)(f,e,m))),r)}});const Hi=(0,h.op)({gramSchmidt_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){let t;if(Array.isArray(e)){t=!1,(0,d.vA)(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<e.length;++t)(0,d.vA)(e[t].shape[0]===n,()=>`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${n})`)}else t=!0,e=(0,In.l)(e,e.shape[0],0).map(e=>(0,Cn.r)(e,[0]));(0,d.vA)(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);const n=[],i=e;for(let t=0;t<e.length;++t)n.push(l.T2.tidy(()=>{let e=i[t];if(t>0)for(let i=0;i<t;++i){const t=(0,M.l)((0,Rn.c)((0,M.l)(n[i],e)),n[i]);e=(0,gt.j)(e,t)}return(0,fe.y)(e,(0,ri.x)(e,"euclidean"))}));return t?(0,On.t)(n,0):n}});var Wi=n(35287);function Xi(e,t=!1){return l.T2.tidy(()=>{(0,d.vA)(2===e.shape.length,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);const n=e.shape[0],i=e.shape[1];let r=Se(n),s=(0,W.o)(e);const o=Pn([[1]],[1,1]);let a=(0,W.o)(o);const u=n>=i?i:n;for(let e=0;e<u;++e){const t=s,u=a,c=r;[a,s,r]=l.T2.tidy(()=>{const t=(0,R.d)(s,[e,e],[n-e,1]),l=(0,ri.x)(t),u=(0,R.d)(s,[e,e],[1,1]),c=(0,Zn._)((0,Re.r)(u,0),Pn([[-1]]),Pn([[1]])),d=(0,gt.j)(u,(0,M.l)(c,l)),h=(0,fe.y)(t,d);a=1===h.shape[0]?(0,W.o)(o):(0,C.x)([o,(0,R.d)(h,[1,0],[h.shape[0]-1,h.shape[1]])],0);const p=(0,bt.H)((0,fe.y)((0,O.N)(c,d),l)),f=(0,R.d)(s,[e,0],[n-e,i]),m=(0,M.l)(p,a),g=(0,ii.m)(a);if(0===e)s=(0,gt.j)(f,(0,O.N)(m,(0,O.N)(g,f)));else{const t=(0,gt.j)(f,(0,O.N)(m,(0,O.N)(g,f)));s=(0,C.x)([(0,R.d)(s,[0,0],[e,i]),t],0)}const _=(0,ii.m)(m),y=(0,R.d)(r,[0,e],[n,r.shape[1]-e]);if(0===e)r=(0,gt.j)(y,(0,O.N)((0,O.N)(y,a),_));else{const t=(0,gt.j)(y,(0,O.N)((0,O.N)(y,a),_));r=(0,C.x)([(0,R.d)(r,[0,0],[n,e]),t],1)}return[a,s,r]}),(0,Wi.AS)([t,u,c])}return!t&&n>i&&(r=(0,R.d)(r,[0,0],[n,i]),s=(0,R.d)(s,[0,0],[i,i])),[r,s]})}const qi=(0,h.op)({qr_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=!1){if((0,d.vA)(e.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),2===e.rank)return Xi(e,t);{const n=e.shape.slice(0,e.shape.length-2).reduce((e,t)=>e*t),i=(0,Xn.K)((0,A.t)(e,[n,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];i.forEach(e=>{const[n,i]=Xi(e,t);r.push(n),s.push(i)});return[(0,A.t)((0,On.t)(r,0),e.shape),(0,A.t)((0,On.t)(s,0),e.shape)]}}});var Ki=n(27084);const Zi=(0,h.op)({computeWeightedLoss_:function(e,t,n=Ki.i.SUM_BY_NONZERO_WEIGHTS){const i=(0,c.YT)(e,"losses","computeWeightedLoss");let r=null;null!=t&&(r=(0,c.YT)(t,"weights","computeWeightedLoss"));const s=null==r?i:(0,M.l)(i,r);if(n===Ki.i.NONE)return s;if(n===Ki.i.SUM)return(0,Rn.c)(s);if(n===Ki.i.MEAN){if(null==r)return(0,ot.i)(s);{const e=i.size/r.size,t=(0,fe.y)((0,Rn.c)(s),(0,Rn.c)(r));return e>1?(0,fe.y)(t,(0,an.d)(e)):t}}if(n===Ki.i.SUM_BY_NONZERO_WEIGHTS){if(null==r)return(0,fe.y)((0,Rn.c)(s),(0,an.d)(i.size));{const e=(0,M.l)(r,(0,at.S)(i.shape)),t=(0,w.w)((0,Rn.c)((0,Tt.E)(e,(0,an.d)(0))),"float32");return(0,fe.y)((0,Rn.c)(s),t)}}throw Error(`Unknown reduction: ${n}`)}});const Qi=(0,h.op)({absoluteDifference_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=Ki.i.SUM_BY_NONZERO_WEIGHTS){const s=(0,c.YT)(e,"labels","absoluteDifference"),o=(0,c.YT)(t,"predictions","absoluteDifference");let a=null;null!=n&&(a=(0,c.YT)(n,"weights","absoluteDifference")),(0,d.O3)(s.shape,o.shape,"Error in absoluteDifference: ");const l=(0,r.t)((0,gt.j)(s,o));return Zi(l,a,i)}});const Ji=(0,h.op)({cosineDistance_:function(e,t,n,i,r=Ki.i.SUM_BY_NONZERO_WEIGHTS){const s=(0,c.YT)(e,"labels","cosineDistance"),o=(0,c.YT)(t,"predictions","cosineDistance");let a=null;null!=i&&(a=(0,c.YT)(i,"weights","cosineDistance")),(0,d.O3)(s.shape,o.shape,"Error in cosineDistance: ");const l=(0,an.d)(1),u=(0,gt.j)(l,(0,Rn.c)((0,M.l)(s,o),n,!0));return Zi(u,a,r)}});const er=(0,h.op)({hingeLoss_:function(e,t,n,i=Ki.i.SUM_BY_NONZERO_WEIGHTS){let r=(0,c.YT)(e,"labels","hingeLoss");const s=(0,c.YT)(t,"predictions","hingeLoss");let o=null;null!=n&&(o=(0,c.YT)(n,"weights","hingeLoss")),(0,d.O3)(r.shape,s.shape,"Error in hingeLoss: ");const a=(0,an.d)(1);r=(0,gt.j)((0,M.l)((0,an.d)(2),r),a);const l=(0,Zt.V)((0,gt.j)(a,(0,M.l)(r,s)));return Zi(l,o,i)}});const tr=(0,h.op)({huberLoss_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=1,s=Ki.i.SUM_BY_NONZERO_WEIGHTS){const o=(0,c.YT)(e,"labels","huberLoss"),l=(0,c.YT)(t,"predictions","huberLoss");let u=null;null!=n&&(u=(0,c.YT)(n,"weights","huberLoss")),(0,d.O3)(o.shape,l.shape,"Error in huberLoss: ");const h=(0,an.d)(i),p=(0,r.t)((0,gt.j)(l,o)),f=(0,dt.B)(p,h),m=(0,gt.j)(p,f),g=(0,a.W)((0,M.l)((0,an.d)(.5),(0,mt.E)(f)),(0,M.l)(h,m));return Zi(g,u,s)}});const nr=(0,h.op)({logLoss_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=1e-7,r=Ki.i.SUM_BY_NONZERO_WEIGHTS){const s=(0,c.YT)(e,"labels","logLoss"),o=(0,c.YT)(t,"predictions","logLoss");let l=null;null!=n&&(l=(0,c.YT)(n,"weights","logLoss")),(0,d.O3)(s.shape,o.shape,"Error in logLoss: ");const u=(0,an.d)(1),h=(0,an.d)(i),p=(0,bt.H)((0,M.l)(s,(0,je.R)((0,a.W)(o,h)))),f=(0,M.l)((0,gt.j)(u,s),(0,je.R)((0,a.W)((0,gt.j)(u,o),h))),m=(0,gt.j)(p,f);return Zi(m,l,r)}});const ir=(0,h.op)({meanSquaredError_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=Ki.i.SUM_BY_NONZERO_WEIGHTS){const r=(0,c.YT)(e,"labels","meanSquaredError"),s=(0,c.YT)(t,"predictions","meanSquaredError");let o=null;null!=n&&(o=(0,c.YT)(n,"weights","meanSquaredError")),(0,d.O3)(r.shape,s.shape,"Error in meanSquaredError: ");const a=(0,Sn.P)(r,s);return Zi(a,o,i)}});const rr=(0,h.op)({sigmoidCrossEntropy_:function(e,t,n,i=0,s=Ki.i.SUM_BY_NONZERO_WEIGHTS){let o=(0,c.YT)(e,"multiClassLabels","sigmoidCrossEntropy");const l=(0,c.YT)(t,"logits","sigmoidCrossEntropy");let u=null;if(null!=n&&(u=(0,c.YT)(n,"weights","sigmoidCrossEntropy")),(0,d.O3)(o.shape,l.shape,"Error in sigmoidCrossEntropy: "),i>0){const e=(0,an.d)(i),t=(0,an.d)(1),n=(0,an.d)(.5);o=(0,a.W)((0,M.l)(o,(0,gt.j)(t,e)),(0,M.l)(n,e))}const h=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"labels","sigmoidCrossEntropyWithLogits"),i=(0,c.YT)(t,"logits","sigmoidCrossEntropyWithLogits");(0,d.O3)(n.shape,i.shape,"Error in sigmoidCrossEntropyWithLogits: ");const s=(0,Zt.V)(i),o=(0,M.l)(i,n),l=(0,Ye.K)((0,Ee.o)((0,bt.H)((0,r.t)(i))));return(0,a.W)((0,gt.j)(s,o),l)}(o,l);return Zi(h,u,s)}});const sr=(0,h.op)({softmaxCrossEntropy_:function(e,t,n,i=0,r=Ki.i.SUM_BY_NONZERO_WEIGHTS){let s=(0,c.YT)(e,"onehotLabels","softmaxCrossEntropy");const o=(0,c.YT)(t,"logits","softmaxCrossEntropy");let l=null;if(null!=n&&(l=(0,c.YT)(n,"weights","softmaxCrossEntropy")),(0,d.O3)(s.shape,o.shape,"Error in softmaxCrossEntropy: "),i>0){const e=(0,an.d)(i),t=(0,an.d)(1),n=(0,an.d)(s.shape[1]);s=(0,a.W)((0,M.l)(s,(0,gt.j)(t,e)),(0,fe.y)(e,n))}const u=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
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 i=(0,fi._X)((e,t,i)=>{const r=(0,We.V)(t,[n],!0),s=(0,gt.j)((0,w.w)(t,"float32"),r);i([e,s]);const o=(0,bt.H)((0,M.l)(s,e));return{value:(0,Rn.c)(o,[n]),gradFunc:(e,t)=>{const[i,r]=t,s=(0,ft.SM)(e.shape,[n]);return[(0,M.l)((0,A.t)(e,s),(0,gt.j)((0,w.w)(i,"float32"),(0,Ee.o)(r))),(0,M.l)((0,A.t)(e,s),(0,gt.j)((0,Ee.o)(r),(0,w.w)(i,"float32")))]}}});return i(e,t)}(s,o);return Zi(u,l,r)}});const or=(0,h.op)({sparseFillEmptyRows_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=(0,c.YT)(e,"indices","sparseFillEmptyRows","int32"),s=(0,c.YT)(t,"values","sparseFillEmptyRows"),o=(0,c.YT)(n,"denseShape","sparseFillEmptyRows","int32"),a=(0,c.YT)(i,"defaultValue","sparseFillEmptyRows",s.dtype);if(2!==r.rank)throw new Error(`Indices should be Tensor2D but received shape\n ${r.shape}`);if(1!==s.rank)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(1!==o.rank)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(0!==a.rank)throw new Error(`Default value should be a scalar but received shape ${a.shape}`);const d={indices:r,values:s,denseShape:o,defaultValue:a},h=l.T2.runKernel(u.C8s,d);return{outputIndices:h[0],outputValues:h[1],emptyRowIndicator:h[2],reverseIndexMap:h[3]}}});const ar=(0,h.op)({sparseReshape_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"inputIndices","sparseReshape","int32"),r=(0,c.YT)(t,"inputShape","sparseReshape","int32"),s=(0,c.YT)(n,"newShape","sparseReshape","int32");if(2!==i.rank)throw new Error(`Input indices should be Tensor2D but received shape\n ${i.shape}`);if(1!==r.rank)throw new Error(`Input shape should be Tensor1D but received shape ${r.shape}`);if(1!==s.rank)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);const o={inputIndices:i,inputShape:r,newShape:s},a=l.T2.runKernel(u.BoJ,o);return{outputIndices:a[0],outputShape:a[1]}}});const lr=(0,h.op)({sparseSegmentMean_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"data","sparseSegmentMean"),r=(0,c.YT)(t,"indices","sparseSegmentMean","int32"),s=(0,c.YT)(n,"segmentIds","sparseSegmentMean","int32");if(i.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!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:i,indices:r,segmentIds:s};return l.T2.runKernel(u.L6G,o)}});const ur=(0,h.op)({sparseSegmentSum_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=(0,c.YT)(e,"data","sparseSegmentSum"),r=(0,c.YT)(t,"indices","sparseSegmentSum","int32"),s=(0,c.YT)(n,"segmentIds","sparseSegmentSum","int32");if(i.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!==s.rank)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);const o={data:i,indices:r,segmentIds:s};return l.T2.runKernel(u.DvZ,o)}});const cr=(0,h.op)({stringNGrams_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s,o,a){const d=(0,c.YT)(e,"data","stringNGrams","string");if("string"!==d.dtype)throw new Error("Data must be of datatype string");if(1!==d.shape.length)throw new Error(`Data must be a vector, saw: ${d.shape}`);const h=(0,c.YT)(t,"dataSplits","stringNGrams");if("int32"!==h.dtype)throw new Error("Data splits must be of datatype int32");const p={separator:n,nGramWidths:i,leftPad:r,rightPad:s,padWidth:o,preserveShortSequences:a},f={data:d,dataSplits:h},m=l.T2.runKernel(u.YAb,f,p);return{nGrams:m[0],nGramsSplits:m[1]}}});const dr=(0,h.op)({stringSplit_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=!0){const i=(0,c.YT)(e,"input","stringSplit","string"),r=(0,c.YT)(t,"delimiter","stringSplit","string");if(1!==i.rank)throw new Error(`Input should be Tensor1D but received shape ${i.shape}`);if(0!==r.rank)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);const s={skipEmpty:n},o={input:i,delimiter:r},a=l.T2.runKernel(u.iW0,o,s);return{indices:a[0],values:a[1],shape:a[2]}}});const hr=(0,h.op)({stringToHashBucketFast_:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,c.YT)(e,"input","stringToHashBucketFast","string"),i={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");const r={input:n};return l.T2.runKernel(u.$jE,r,i)}});const pr=(0,h.op)({staticRegexReplace_:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=!0){const r=(0,c.YT)(e,"input","staticRegexReplace","string"),s={pattern:t,rewrite:n,replaceGlobal:i};return l.T2.runKernel(u.GZp,{x:r},s)}}),fr={fft:Tn.h,ifft:xn.K,rfft:wn.z,irfft:En.g},mr={hammingWindow:wi,hannWindow:Ii,frame:Ai,stft:Si},gr={flipLeftRight:Oi,grayscaleToRGB:Mi,resizeNearestNeighbor:zi.b,resizeBilinear:Vi.v,rgbToGrayscale:ki,rotateWithOffset:Ri,cropAndResize:Ci,nonMaxSuppression:Di,nonMaxSuppressionAsync:Li,nonMaxSuppressionWithScore:Pi,nonMaxSuppressionWithScoreAsync:Bi,nonMaxSuppressionPadded:$i,nonMaxSuppressionPaddedAsync:Ui,threshold:ji,transform:Yi},_r={bandPart:Gi,gramSchmidt:Hi,qr:qi},yr={absoluteDifference:Qi,computeWeightedLoss:Zi,cosineDistance:Ji,hingeLoss:er,huberLoss:tr,logLoss:nr,meanSquaredError:ir,sigmoidCrossEntropy:rr,softmaxCrossEntropy:sr},vr={sparseFillEmptyRows:or,sparseReshape:ar,sparseSegmentMean:lr,sparseSegmentSum:ur},br={stringNGrams:cr,stringSplit:dr,stringToHashBucketFast:hr,staticRegexReplace:pr}},65661:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({pad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=0){const o=(0,s.YT)(e,"x","pad");if(0===o.rank)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const a={paddings:t,constantValue:n},l={x:o};return i.T2.runKernel(r.ODT,l,a)}})},17872:(e,t,n)=>{"use strict";n.d(t,{d:()=>h});var i=n(28189),r=n(45119),s=n(53909),o=n(69772),a=n(47195),l=n(86999),u=n(70929),c=n(62302),d=n(10776);const h=(0,u.op)({pool_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,u,h,p,f){null==h&&(h=[1,1]),null==p&&(p=1),0===u&&(u="valid");const m=(0,i.YT)(e,"x","maxPool");let g=m,_=!1;3===m.rank&&(_=!0,g=(0,c.t)(m,[1,m.shape[0],m.shape[1],m.shape[2]])),r.vA(a.G0(p,h),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);const y=a.E6(g.shape,t,p,h,u),v=[y.dilationHeight,y.dilationWidth];let b;b="same"===u?function(e,t){const n=e.map((e,n)=>e+(e-1)*(t[n]-1)),i=n.map(e=>e-1),r=i.map(e=>Math.floor(e/2)),s=i.map((e,t)=>e-r[t]);return i.map((e,t)=>[r[t],s[t]])}([y.filterHeight,y.filterWidth],v):[[0,0],[0,0]];const T=1===v[0]&&1===v[1],[x,E]=function(e,t,n){const i=n.map(e=>e[0]),r=n.map(e=>e[1]),s=e.concat(i,r),o=t.map((e,t)=>(e-s[t]%e)%e),a=r.map((e,t)=>e+o[t]),l=t.map((e,t)=>[i[t],a[t]]),u=t.map((e,t)=>[0,o[t]]);return[l,u]}([y.inHeight,y.inWidth],v,b),w=T?u:"valid",I=T?g:(0,d.e)(g,v,x),A=("avg"===n?()=>(0,s.$)(I,t,p,w,f):()=>(0,l.j)(I,t,p,w,f))(),S=T?A:(0,o.G)(A,v,E);return _?(0,c.t)(S,[S.shape[1],S.shape[2],S.shape[3]]):S}})},98990:(e,t,n)=>{"use strict";n.d(t,{n:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({pow_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"base","pow"),a=(0,o.YT)(t,"exp","pow");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.pyJ,l)}})},64394:(e,t,n)=>{"use strict";n.d(t,{N:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({prelu_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n={x:(0,s.YT)(e,"x","prelu"),alpha:(0,s.YT)(t,"alpha","prelu")};return i.T2.runKernel(r.Ncv,n)}})},75295:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i(e,t=!1){console.log(e.toString(t))}n.d(t,{y:()=>i})},67771:(e,t,n)=>{"use strict";n.d(t,{_:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(29809);const a=(0,n(70929).op)({prod_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){let a=(0,s.YT)(e,"x","prod");"bool"===a.dtype&&(a=(0,o.w)(a,"int32"));const l={x:a},u={axis:t,keepDims:n};return i.T2.runKernel(r.kdj,l,u)}})},1902:(e,t,n)=>{"use strict";n.d(t,{x:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({real_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={input:(0,s.YT)(e,"input","real")};return i.T2.runKernel(r.LRy,t)}})},19870:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({reciprocal_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","reciprocal")};return i.T2.runKernel(r.huO,t)}})},90112:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({relu_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","relu")};return i.T2.runKernel(r.fUj,t)}})},83732:(e,t,n)=>{"use strict";n.d(t,{j:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({relu6_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","relu6")};return i.T2.runKernel(r.P_L,t)}})},62302:(e,t,n)=>{"use strict";n.d(t,{t:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({reshape_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n={x:(0,s.YT)(e,"x","reshape","string_or_numeric")},o={shape:t};return i.T2.runKernel(r.R23,n,o)}})},53262:(e,t,n)=>{"use strict";n.d(t,{B:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({reverse_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n={x:(0,s.YT)(e,"x","reverse")},o={dims:t};return i.T2.runKernel(r.D7i,n,o)}})},25912:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({round_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","round")};return i.T2.runKernel(r.hVg,t)}})},17820:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({rsqrt_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","rsqrt","float32")};return i.T2.runKernel(r.TOR,t)}})},45702:(e,t,n)=>{"use strict";n.d(t,{d:()=>s});var i=n(83879),r=n(19171);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function s(e,t){if(((0,i.isTypedArray)(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&&(0,i.isTypedArray)(e)&&!(e instanceof Uint8Array))throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return(0,r.Q)(e,[],[],t)}},26170:(e,t,n)=>{"use strict";n.r(t),n.d(t,{calculateShapes:()=>o,validateInput:()=>s,validateUpdateShape:()=>r});var i=n(45119);function r(e,t,n){const i=t.rank>1?t.shape[t.rank-1]:1,r=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${i}, and batchDim: ${r}.`;if(n.rank<r)throw new Error(s+` update.rank < ${r}. `);if(e.length<i+(n.rank-r))throw new Error(s+` Output shape length < ${i+(n.rank-r)}`);if(n.rank!==r+e.length-i)throw new Error(s+" update.rank != "+(r+e.length-i));for(let e=0;e<r;++e)if(n.shape[e]!==t.shape[e])throw new Error(s+` updates.shape[${e}] (${n.shape[e]}) != indices.shape[${e}] (${t.shape[e]}).`);for(let t=0;t<n.rank-r;++t)if(n.shape[t+r]!==e[t+i])throw new Error(s+` updates.shape[${t+r}] (${n.shape[t+r]}) != shape[${t+r}] (${e[t+r]})`)}function s(e,t,n){if(t.rank<1)throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t.rank}.`);if(e.rank<1)throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${e.rank}.`);if("int32"!==t.dtype)throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t.dtype}`);if(n.length<1)throw new Error(`Output rank must be greater or equal to 1, but got shape: ${n}`);if(0===n.length){if(0===t.size)throw new Error(`Indices specified for empty output. indices shape: ${t.shape}`);if(0===e.size)throw new Error(`Updates specified for empty output. updates shape: ${e.shape}`)}r(n,t,e)}function o(e,t,n){const r=t.shape.length,s=r>1?t.shape[r-1]:1,o=n.length;let a=1;for(let e=s;e<o;++e)a*=n[e];const l=s<1?1:s;return{sliceRank:s,numUpdates:(0,i.Ze)(t.shape)/l,sliceSize:a,strides:[...(0,i.Ur)(n.slice(0,s)),1],outputSize:(0,i.Ze)(n)}}},26325:(e,t,n)=>{"use strict";n.d(t,{W:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({selu_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","selu")};return i.T2.runKernel(r.u$b,t)}})},28576:(e,t,n)=>{"use strict";n.d(t,{X:()=>r,j:()=>i});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const i=1.7580993408473768,r=1.0507009873554805},89986:(e,t,n)=>{"use strict";n.d(t,{w:()=>u});var i=n(28189),r=n(45119),s=n(28794),o=n(10676),a=n(70929),l=n(62302);const u=(0,a.op)({separableConv2d_:function(e,t,n,a,u,c=[1,1],d="NHWC"){const h=(0,i.YT)(e,"x","separableConv2d"),p=(0,i.YT)(t,"depthwiseFilter","separableConv2d"),f=(0,i.YT)(n,"pointwiseFilter","separableConv2d");let m=h,g=!1;if(3===h.rank&&(g=!0,m=(0,l.t)(h,[1,h.shape[0],h.shape[1],h.shape[2]])),"NCHW"===d)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");r.vA(4===m.rank,()=>`Error in separableConv2d: input must be rank 4, but got rank ${m.rank}.`),r.vA(4===p.rank,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`),r.vA(4===f.rank,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`),r.vA(1===f.shape[0],()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${f.shape[0]}.`),r.vA(1===f.shape[1],()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${f.shape[1]}.`);const _=p.shape[2],y=p.shape[3];r.vA(f.shape[2]===_*y,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${_*y}, but got ${f.shape[2]}.`);const v=(0,o.G)(m,p,a,u,d,c),b=(0,s.X)(v,f,1,"valid",d);return g?(0,l.t)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},28968:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({sigmoid_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","sigmoid","float32")};return i.T2.runKernel(r.vI1,t)}})},51115:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({sign_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","sign")};return i.T2.runKernel(r.YVe,t)}})},33726:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({sin_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","sin","float32")};return i.T2.runKernel(r.hql,t)}})},58276:(e,t,n)=>{"use strict";n.d(t,{L:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({sinh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","sinh")};return i.T2.runKernel(r.J3C,t)}})},17986:(e,t,n)=>{"use strict";n.d(t,{d:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({slice_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const o=(0,s.YT)(e,"x","slice","string_or_numeric");if(0===o.rank)throw new Error("Slicing scalar is not possible");const a={x:o},l={begin:t,size:n};return i.T2.runKernel(r.JiE,a,l)}})},34969:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assertParamsValid:()=>o,computeFlatOffset:()=>v,computeOutShape:()=>l,getNormalizedAxes:()=>h,isSliceContinous:()=>y,maskToAxes:()=>a,parseSliceParams:()=>b,sliceInfo:()=>T,startForAxis:()=>g,startIndicesWithElidedDims:()=>p,stopForAxis:()=>_,stopIndicesWithElidedDims:()=>f,stridesForAxis:()=>m,stridesWithElidedDims:()=>u});var i=n(45119);
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/const r=-2,s=-1;function o(e,t,n){const r=e.shape.length;i.vA(r===t.length,()=>`Error in slice${r}D: Length of begin ${t} must match the rank of the array (${r}).`),i.vA(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let s=0;s<r;++s)i.vA(t[s]+n[s]<=e.shape[s],()=>`Error in slice${r}D: begin[${s}] + size[${s}] (${t[s]+n[s]}) would overflow input.shape[${s}] (${e.shape[s]})`)}function a(e){const t=[];let n=0;for(;e>0;)1&e&&t.push(n),e/=2,n++;return t}function l(e,t,n){const i=[];for(let r=0;r<e.length;r++)i[r]=Math.ceil((t[r]-e[r])/n[r]);return i}function u(e,t,n,i){const r=[...e];for(let e=r.length;e<i.length;e++)r.push(1);for(let e=0;e<n;e++)0===e?r[t]=1:(r.splice(t,0,1),r.pop());return r}function c(e,t,n){return n<=e?n:n-(t-1)}function d(e,t){const n=[];for(let i=0;i<e;i++)n.push(t+i);return n}function h(e,t,n,i,r,s,o,a,l){const c=e.length;let d=new Array(c),h=new Array(c),y=new Array(c);if(t.length&&n>0){const l=t[0],c=n+1;d=p(o,l,c,i,e),h=f(a,l,c,r,e),y=u(s,l,c,e)}else for(let t=0;t<c;t++)d[t]=g(o,i,s,e,t,l),h[t]=_(a,r,s,e,t,l),y[t]=m(s,t,l);return{begin:d,end:h,strides:y}}function p(e,t,n,i,r){const s=[...r],o=d(n,t);for(let r=0;r<s.length;r++)if(o.indexOf(r)>-1)s[r]=0;else{const o=c(t,n,r);let a=i[o];e&1<<o&&(a=0),s[r]=a}return s}function f(e,t,n,r,s){const o=[...s],a=d(n,t);for(let i=0;i<o.length;i++)if(a.indexOf(i)>-1)o[i]=Number.MAX_SAFE_INTEGER;else{const s=c(t,n,i);let a=r[s];e&1<<s&&(a=Number.MAX_SAFE_INTEGER),o[i]=a}for(let e=0;e<o.length;e++){const t=s[e];o[e]<0&&(o[e]+=t),o[e]=i.qE(0,o[e],s[e])}return o}function m(e,t,n){let i=e[t];return(n&1<<t||null==i)&&(i=1),i}function g(e,t,n,r,s,o){let a=t[s];const l=n[s]||1;(e&1<<s||o&1<<s||null==a)&&(a=l>0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);const u=r[s];return a<0&&(a+=u),a=i.qE(0,a,u-1),a}function _(e,t,n,r,s,o){let a=t[s];const l=n[s]||1;(e&1<<s||o&1<<s||null==a)&&(a=l>0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);const u=r[s];return a<0&&(a+=u),a=l>0?i.qE(0,a,u):i.qE(-1,a,u-1),a}function y(e,t,n){let i=n.length;for(let e=0;e<n.length;e++)if(n[e]>1){i=e;break}for(let r=i+1;r<n.length;r++)if(t[r]>0||n[r]!==e[r])return!1;return!0}function v(e,t){let n=e.length>0?e[e.length-1]:1;for(let i=0;i<e.length-1;i++)n+=e[i]*t[i];return n}function b(e,t,n){let r;const s=e.shape.length;let o;return r="number"==typeof t?[t,...new Array(s-1).fill(0)]:t.length<s?t.concat(new Array(s-t.length).fill(0)):t.slice(),r.forEach(e=>{i.vA(-1!==e,()=>"slice() does not support negative begin indexing.")}),o=null==n?new Array(s).fill(-1):"number"==typeof n?[n,...new Array(s-1).fill(-1)]:n.length<s?n.concat(new Array(s-n.length).fill(-1)):n,o=o.map((t,n)=>t>=0?t:(i.vA(-1===t,()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${n}.`),e.shape[n]-r[n])),[r,o]}function T(e,t,n,i,o,a,l,u,c){let d;if(null==i?(d=new Array(t.length),d.fill(1)):d=i,null!=l&&l&l-1)throw new Error("Multiple ellipses in slice is not allowed.");let h=!1;const p={dims:d.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:n.slice(),strides:d.slice(),beginMask:o,endMask:a,ellipsisMask:l,newAxisMask:u,shrinkAxisMask:c};for(let e=0;e<p.dims;e++)h&&1<<e&u&&p.numAddAxisAfterEllipsis++,1<<e&l&&(h=!0);h||(p.ellipsisMask|=1<<p.dims,p.dims++);const f={dims:e.length,beginMask:0,endMask:0,beginValid:!1,endValid:!1};!function(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let n=0;t.beginValid=null!=e.begin,t.endValid=null!=e.end,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let i=0;i<e.dims;i++)if(1<<i&e.ellipsisMask){const r=Math.min(t.dims-(e.dims-i)+1+e.numAddAxisAfterEllipsis,t.dims);for(;n<r;n++)t.begin[n]=0,t.end[n]=0,t.strides[n]=1,t.beginMask|=1<<n,t.endMask|=1<<n,t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(-1),t.inputShapeGatherIndicesSparse[n]=i}else if(1<<i&e.newAxisMask)t.finalShapeGatherIndices.push(r),t.finalShapeGatherIndicesSparse.push(-1);else{if(n===t.begin.length)throw Error(`Index out of range using input dim ${n}; input has only ${t.dims} dims, ${t.begin.length}.`);null!=e.begin&&(t.begin[n]=e.begin[i]),null!=e.end&&(t.end[n]=e.end[i]),t.strides[n]=e.strides[i],e.beginMask&1<<i&&(t.beginMask|=1<<n),e.endMask&1<<i&&(t.endMask|=1<<n),e.shrinkAxisMask&1<<i?(t.finalShapeGatherIndices.push(s),t.finalShapeGatherIndicesSparse.push(-1),t.shrinkAxisMask|=1<<n):(t.finalShapeGatherIndices.push(n),t.finalShapeGatherIndicesSparse.push(i)),t.inputShapeGatherIndicesSparse[n]=i,n++}}(p,f);let m=!0,g=!0,_=!0;const y=[],v=[];for(let t=0;t<e.length;++t){if(0===f.strides[t])throw Error(`strides[${t}] must be non-zero`);const n=!!(f.shrinkAxisMask&1<<t),i=e[t];if(-1===i){y.push(n?1:-1);continue}const r=[f.beginMask&1<<t,f.endMask&1<<t],s=[f.strides[t]>0?0:-1,f.strides[t]>0?i:i-1];if(n&&f.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");_=_&&1===f.strides[t];const o=!!(f.beginMask&1<<t&&f.endMask&1<<t);if(f.beginValid&&f.endValid){if(n){const e=f.begin[t]<0?i+f.begin[t]:f.begin[t];if(f.begin[t]=e,f.end[t]=f.begin[t]+1,e<0||e>=i)throw Error(`slice index ${f.begin[t]} of dimension ${t} out of bounds.`)}else f.begin[t]=x(f.begin[t],0,f.strides[t],i,r,s),f.end[t]=x(f.end[t],1,f.strides[t],i,r,s);const e=1===f.strides[t]&&0===f.begin[t]&&f.end[t]===i;m=m&&e,g=g&&(0===t&&1===f.strides[t]||e)}else m=m&&1===f.strides[t]&&o,g=g&&(0===t&&1===f.strides[t]||o);let a,l=!1;if(f.beginValid&&f.endValid?(a=f.end[t]-f.begin[t],l=!0):n?(a=1,l=!0):o&&i>=0&&(a=f.strides[t]<0?-i:i,l=!0),l){let e;e=0===a||a<0!=f.strides[t]<0?0:Math.trunc(a/f.strides[t])+(a%f.strides[t]!==0?1:0),y.push(e)}else y.push(-1)}for(let e=0;e<f.finalShapeGatherIndices.length;++e){const t=f.finalShapeGatherIndices[e];t>=0?v.push(y[t]):t===r&&v.push(1)}return{finalShapeSparse:v.filter((e,t)=>f.finalShapeGatherIndices[t]!==r),finalShape:v,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:f.begin,end:f.end,strides:f.strides}}function x(e,t,n,i,r,s){if(r[t])return n>0?s[t]:s[t+1&1];{const t=e<0?i+e:e;return t<s[0]?s[0]:t>s[1]?s[1]:t}}},26346:(e,t,n)=>{"use strict";n.d(t,{V:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({softmax_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=-1){const n=(0,s.YT)(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 o={logits:n},a={dim:t};return i.T2.runKernel(r.rFG,o,a)}})},66030:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({softplus_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","softplus")};return i.T2.runKernel(r.Fin,t)}})},10776:(e,t,n)=>{"use strict";n.d(t,{e:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({spaceToBatchND_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const a=(0,s.YT)(e,"x","spaceToBatchND");o.vA(a.rank>=1+t.length,()=>`input rank ${a.rank} should be > than [blockShape] ${t.length}`),o.vA(n.length===t.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${t.length}`),o.vA(a.shape.reduce((e,i,r)=>r>0&&r<=t.length?e&&(i+n[r-1][0]+n[r-1][1])%t[r-1]===0:e,!0),()=>`input spatial dimensions ${a.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${t.toString()}`);const l={x:a},u={blockShape:t,paddings:n};return i.T2.runKernel(r.A8B,l,u)}})},41361:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var i=n(41585),r=n(15441),s=n(45119);const o=(0,n(70929).op)({fft_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){(0,s.vA)("complex64"===e.dtype,()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);const t={input:e};return i.T2.runKernel(r.rGP,t)}})},13108:(e,t,n)=>{"use strict";n.d(t,{K:()=>o});var i=n(41585),r=n(15441),s=n(45119);const o=(0,n(70929).op)({ifft_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){(0,s.vA)("complex64"===e.dtype,()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);const t={input:e};return i.T2.runKernel(r.OAQ,t)}})},22292:(e,t,n)=>{"use strict";n.d(t,{g:()=>f});var i=n(37148),r=n(25030),s=n(35040),o=n(9258),a=n(70929),l=n(1902),u=n(62302),c=n(53262),d=n(45702),h=n(17986),p=n(13108);const f=(0,a.op)({irfft_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=e.shape[e.shape.length-1],n=e.size/t;let a;if(t<=2){const i=(0,u.t)(e,[n,t]);a=(0,p.K)(i)}else{const f=[n,2*(t-1)],m=(0,u.t)((0,l.x)(e),[n,t]),g=(0,u.t)((0,s.n)(e),[n,t]),_=(0,c.B)((0,h.d)(m,[0,1],[n,t-2]),1),y=(0,o.l)((0,c.B)((0,h.d)(g,[0,1],[n,t-2]),1),(0,d.d)(-1)),v=(0,r.x)([m,_],1),b=(0,r.x)([g,y],1),T=(0,u.t)((0,i.f)(v,b),[f[0],f[1]]);a=(0,p.K)(T)}if(a=(0,l.x)(a),3===e.rank&&0!==e.shape[0]){const t=a,n=e.shape[0];a=(0,u.t)(a,[n,a.shape[0]/n,a.shape[1]]),t.dispose()}return a}})},8775:(e,t,n)=>{"use strict";n.d(t,{z:()=>m});var i=n(45119),r=n(37148),s=n(25030),o=n(35040),a=n(70929),l=n(1902),u=n(62302),c=n(17986),d=n(66512),h=n(42855),p=n(55537),f=n(41361);const m=(0,a.op)({rfft_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){(0,i.vA)("float32"===e.dtype,()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1];const a=e.size/n;let m;if(null!=t&&t<n){const i=e.shape.map(e=>0),r=e.shape.map(e=>e);r[e.shape.length-1]=t,m=(0,c.d)(e,i,r),n=t}else if(null!=t&&t>n){const i=e.shape.map(e=>e);i[e.shape.length-1]=t-n,m=(0,s.x)([e,(0,h.U)(i)],e.shape.length-1),n=t}else m=e;const g=(0,p.P)(m),_=(0,u.t)((0,r.f)(m,g),[a,n]),y=(0,f.h)(_),v=Math.floor(n/2)+1,b=(0,l.x)(y),T=(0,o.n)(y),x=(0,d.l)(b,[v,n-v],b.shape.length-1),E=(0,d.l)(T,[v,n-v],T.shape.length-1),w=m.shape.slice();return w[m.shape.length-1]=v,(0,u.t)((0,r.f)(x[0],E[0]),w)}})},66512:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({split_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n=0){const o={x:(0,s.YT)(e,"x","split")},a={numOrSizeSplits:t,axis:n};return i.T2.runKernel(r.Blb,o,a)}})},79348:(e,t,n)=>{"use strict";n.d(t,{R:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({sqrt_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","sqrt","float32")};return i.T2.runKernel(r.dFH,t)}})},45793:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var i=n(41585),r=n(28189);const s=(0,n(70929).op)({square_:
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t=(0,r.YT)(e,"x","square");return i.T2.runKernel("Square",{x:t},{})}})},53427:(e,t,n)=>{"use strict";n.d(t,{P:()=>l});var i=n(41585),r=n(15441),s=n(30565),o=n(28189),a=n(62198);const l=(0,n(70929).op)({squaredDifference_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","squaredDifference"),l=(0,o.YT)(t,"b","squaredDifference");[n,l]=(0,s.makeTypesMatch)(n,l),(0,a.assertAndGetBroadcastShape)(n.shape,l.shape);const u={a:n,b:l};return i.T2.runKernel(r.Ddj,u,{})}})},5932:(e,t,n)=>{"use strict";n.d(t,{r:()=>a});var i=n(28189),r=n(45119),s=n(70929),o=n(62302);const a=(0,s.op)({squeeze_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,i.YT)(e,"x","squeeze","string_or_numeric");return(0,o.t)(n,(0,r.gx)(n.shape,t).newShape)}})},54268:(e,t,n)=>{"use strict";n.d(t,{t:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({stack_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n=(0,s.j1)(e,"tensors","stack","string_or_numeric");o.vA(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&o.vA(t<=n[0].rank,()=>"Axis must be <= rank of the tensor");const a=n,l={axis:t};return i.T2.runKernel(r.mM$,a,l)}})},10700:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({step_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n={x:(0,s.YT)(e,"x","step")},o={alpha:t};return i.T2.runKernel(r.pnw,n,o)}})},45894:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({stridedSlice_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,o,a=0,l=0,u=0,c=0,d=0){const h={x:(0,s.YT)(e,"x","stridedSlice","string_or_numeric")},p={begin:t,end:n,strides:o,beginMask:a,endMask:l,ellipsisMask:u,newAxisMask:c,shrinkAxisMask:d};return i.T2.runKernel(r.UcO,h,p)}})},77126:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var i=n(41585),r=n(15441),s=n(30565),o=n(28189);const a=(0,n(70929).op)({sub_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){let n=(0,o.YT)(e,"a","sub"),a=(0,o.YT)(t,"b","sub");[n,a]=(0,s.makeTypesMatch)(n,a);const l={a:n,b:a};return i.T2.runKernel(r.PbM,l)}})},83791:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(29809);const a=(0,n(70929).op)({sum_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=null,n=!1){let a=(0,s.YT)(e,"x","sum");"bool"===a.dtype&&(a=(0,o.w)(a,"int32"));const l={x:a},u={axis:t,keepDims:n};return i.T2.runKernel(r.WuN,l,u)}})},77823:(e,t,n)=>{"use strict";n.d(t,{M:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({tan_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","tan","float32")};return i.T2.runKernel(r.oFs,t)}})},57311:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({tanh_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","tanh","float32")};return i.T2.runKernel(r.iuW,t)}})},74027:(e,t,n)=>{"use strict";n.d(t,{O:()=>s});var i=n(28189),r=n(19171);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function s(e,t,n){const s=(0,i.MZ)(e,n);return(0,r.Q)(e,t,s,n)}},42768:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var i=n(28189),r=n(45119),s=n(19171);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function o(e,t,n){if((0,r.HO)(e),null!=t&&3!==t.length)throw new Error("tensor3d() requires shape to have three numbers");const o=(0,i.MZ)(e,n);if(3!==o.length&&1!==o.length)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===o.length&&null==t)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return(0,s.Q)(e,t,o,n)}},19171:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var i=n(41585),r=n(52046),s=n(45119),o=n(83879);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function a(e,t,n,a){if(null==a)a=(0,s.X$)(e);else if("complex64"===a)throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if((0,r.Nw)(e)||(0,r.Oj)(e)){if("float32"!==a&&"int32"!==a)throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${a}.`);return i.T2.backend.createTensorFromGPUData(e,t||n,a)}if(!(0,o.isTypedArray)(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){(0,s.SA)(t);const e=(0,s.Ze)(t),i=(0,s.Ze)(n);(0,s.vA)(e===i,()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${i}`);for(let e=0;e<n.length;++e){const i=n[e],r=e!==n.length-1||i!==(0,s.Ze)(t.slice(e));(0,s.vA)(n[e]===t[e]||!r,()=>`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${t}). `)}}return(0,o.isTypedArray)(e)||Array.isArray(e)||(e=[e]),t=t||n,e="string"!==a?(0,o.toTypedArray)(e,a):(0,o.flatten)(e,[],!0),i.T2.makeTensor(e,t,a)}},64826:(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({tile_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t){const n=(0,s.YT)(e,"x","tile","string_or_numeric");o.vA(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${t}.`);const a={x:n},l={reps:t};return i.T2.runKernel(r.FAs,a,l)}})},21190:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({topk_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=1,n=!0){const o=(0,s.YT)(e,"x","topk");if(0===o.rank)throw new Error("topk() expects the input to be of rank 1 or higher");const a=o.shape[o.shape.length-1];if(t<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${t}`);const l={x:o},u={k:t,sorted:n},[c,d]=i.T2.runKernel(r.TBb,l,u);return{values:c,indices:d}}})},7703:(e,t,n)=>{"use strict";n.d(t,{m:()=>p});var i=n(41585),r=n(35287),s=n(15441),o=n(28189),a=n(45119),l=n(37148),u=n(35040),c=n(96522),d=n(70929),h=n(1902);const p=(0,d.op)({transpose_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const d=(0,o.YT)(e,"x","transpose");if(null==t&&(t=d.shape.map((e,t)=>t).reverse()),a.vA(d.rank===t.length,()=>`Error in transpose: rank of input ${d.rank} must match length of perm ${t}.`),t.forEach(e=>{a.vA(e>=0&&e<d.rank,()=>"All entries in 'perm' must be between 0 and "+(d.rank-1)+` but got ${t}`)}),d.rank<=1)return d.clone();const p={x:d},f={perm:t};return"complex64"===d.dtype?(0,r.DZ)(()=>{let e=(0,h.x)(d),t=(0,u.n)(d);return e=i.T2.runKernel(s.wx0,{x:e},f),t=i.T2.runKernel(s.wx0,{x:t},f),n&&(t=(0,c.H)(t)),(0,l.f)(e,t)}):i.T2.runKernel(s.wx0,p,f)}})},73937:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({unique_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n=(0,s.YT)(e,"x","unique","string_or_numeric");(0,o.vA)(n.rank>0,()=>"The input tensor must be at least 1D");const a={x:n},l={axis:t},[u,c]=i.T2.runKernel(r.EwU,a,l);return{values:u,indices:c}}})},97706:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({unsortedSegmentSum_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const a=(0,s.YT)(e,"x","unsortedSegmentSum"),l=(0,s.YT)(t,"segmentIds","unsortedSegmentSum","int32");(0,o.vA)((0,o.E6)(n),()=>"numSegments must be of dtype int");const u={x:a,segmentIds:l},c={numSegments:n};return i.T2.runKernel(r.pPe,u,c)}})},67261:(e,t,n)=>{"use strict";n.d(t,{K:()=>a});var i=n(41585),r=n(15441),s=n(28189),o=n(45119);const a=(0,n(70929).op)({unstack_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t=0){const n=(0,s.YT)(e,"x","unstack","string_or_numeric");o.vA(t>=-n.shape.length&&t<n.shape.length,()=>`Axis = ${t} is not in [-${n.shape.length}, ${n.shape.length})`);const a={value:n},l={axis:t};return i.T2.runKernel(r.dXR,a,l)}})},12151:(e,t,n)=>{"use strict";n.d(t,{_:()=>l});var i=n(41585),r=n(15441),s=n(28189),o=n(63567),a=n(62198);const l=(0,n(70929).op)({where_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const l=(0,s.YT)(t,"a","where"),u=(0,s.YT)(n,"b","where"),c=(0,s.YT)(e,"condition","where","bool"),d=(0,a.assertAndGetBroadcastShape)((0,a.assertAndGetBroadcastShape)(c.shape,l.shape),u.shape),h={condition:(0,o.h)(c,d),t:(0,o.h)(l,d),e:(0,o.h)(u,d)};return i.T2.runKernel(r.l6P,h)}})},42855:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var i=n(41585),r=n(45119),s=n(37148);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function o(e,t="float32"){if((0,r.SA)(e),"complex64"===t){const t=o(e,"float32"),n=o(e,"float32");return(0,s.f)(t,n)}const n=(0,r.Ty)((0,r.Ze)(e),t);return i.T2.makeTensor(n,e,t)}},55537:(e,t,n)=>{"use strict";n.d(t,{P:()=>o});var i=n(41585),r=n(15441),s=n(28189);const o=(0,n(70929).op)({zerosLike_:
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const t={x:(0,s.YT)(e,"x","zerosLike")};return i.T2.runKernel(r.xJ3,t)}})},86448:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}n.d(t,{Y:()=>i})},20455:(e,t,n)=>{"use strict";var i=n(4888),r=n(50259);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.abs=function(){return this.throwIfDisposed(),(0,i.t)(this)};var s=n(12804);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.acos=function(){return this.throwIfDisposed(),(0,s.H)(this)};var o=n(37558);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.acosh=function(){return this.throwIfDisposed(),(0,o.F)(this)};var a=n(37523);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.add=function(e){return this.throwIfDisposed(),(0,a.W)(this,e)};var l=n(12307);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.all=function(e,t){return this.throwIfDisposed(),(0,l.Q)(this,e,t)};var u=n(89326);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.any=function(e,t){return this.throwIfDisposed(),(0,u.b)(this,e,t)};var c=n(10897);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.argMax=function(e){return this.throwIfDisposed(),(0,c.F)(this,e)};var d=n(54339);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.argMin=function(e){return this.throwIfDisposed(),(0,d.X)(this,e)};var h=n(62302),p=n(45119);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.asScalar=function(){return this.throwIfDisposed(),(0,p.vA)(1===this.size,()=>"The array must have only 1 element."),(0,h.t)(this,[])};var f=n(29809);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.asType=function(e){return this.throwIfDisposed(),(0,f.w)(this,e)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.as1D=function(){return this.throwIfDisposed(),(0,h.t)(this,[this.size])},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.as2D=function(e,t){return this.throwIfDisposed(),(0,h.t)(this,[e,t])},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.as3D=function(e,t,n){return this.throwIfDisposed(),(0,h.t)(this,[e,t,n])},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.as4D=function(e,t,n,i){return this.throwIfDisposed(),(0,h.t)(this,[e,t,n,i])},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.as5D=function(e,t,n,i,r){return this.throwIfDisposed(),(0,h.t)(this,[e,t,n,i,r])};var m=n(66841);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.asin=function(){return this.throwIfDisposed(),(0,m.q)(this)};var g=n(50269);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.asinh=function(){return this.throwIfDisposed(),(0,g.y)(this)};var _=n(29580);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.atan=function(){return this.throwIfDisposed(),(0,_.r)(this)};var y=n(21404);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.atan2=function(e){return this.throwIfDisposed(),(0,y.F)(this,e)};var v=n(63774);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.atanh=function(){return this.throwIfDisposed(),(0,v.r)(this)};var b=n(53909);(0,r.tp)().prototype.avgPool=function(e,t,n,i){return this.throwIfDisposed(),(0,b.$)(this,e,t,n,i)};var T=n(69772);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.batchToSpaceND=function(e,t){return this.throwIfDisposed(),(0,T.G)(this,e,t)};var x=n(9160);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.batchNorm=function(e,t,n,i,r){return this.throwIfDisposed(),(0,x.$)(this,e,t,n,i,r)};var E=n(63567);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.broadcastTo=function(e){return this.throwIfDisposed(),(0,E.h)(this,e)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.cast=function(e){return this.throwIfDisposed(),(0,f.w)(this,e)};var w=n(30855);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.ceil=function(){return this.throwIfDisposed(),(0,w.m)(this)};var I=n(96928);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.clipByValue=function(e,t){return this.throwIfDisposed(),(0,I.z)(this,e,t)};var A=n(25030);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.concat=function(e,t){return this.throwIfDisposed(),e instanceof r.qY&&(e=[e]),(0,A.x)([this,...e],t)};var S=n(3701);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.conv1d=function(e,t,n,i,r,s){return this.throwIfDisposed(),(0,S.k)(this,e,t,n,i,r,s)};var C=n(41106);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.conv2dTranspose=function(e,t,n,i,r){return this.throwIfDisposed(),(0,C.w)(this,e,t,n,i,r)};var O=n(28794);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.conv2d=function(e,t,n,i,r,s){return this.throwIfDisposed(),(0,O.X)(this,e,t,n,i,r,s)};var M=n(99907);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.cos=function(){return this.throwIfDisposed(),(0,M.g)(this)};var k=n(27451);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.cosh=function(){return this.throwIfDisposed(),(0,k.y)(this)};var R=n(10302);
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.cumprod=function(e,t,n){return this.throwIfDisposed(),(0,R.L)(this,e,t,n)};var N=n(76808);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.cumsum=function(e,t,n){return this.throwIfDisposed(),(0,N.r)(this,e,t,n)};var D=n(31216);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.depthToSpace=function(e,t){return this.throwIfDisposed(),(0,D.R)(this,e,t)};var F=n(10676);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.depthwiseConv2d=function(e,t,n,i,r,s){return this.throwIfDisposed(),(0,F.G)(this,e,t,n,i,r,s)};var L=n(93002);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.dilation2d=function(e,t,n,i,r){return this.throwIfDisposed(),(0,L.X)(this,e,t,n,i,r)};var P=n(919);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.divNoNan=function(e){return this.throwIfDisposed(),(0,P.e)(this,e)};var B=n(89359);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.div=function(e){return this.throwIfDisposed(),(0,B.y)(this,e)};var $=n(69759);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.dot=function(e){return this.throwIfDisposed(),(0,$.O)(this,e)};var U=n(83416);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.elu=function(){return this.throwIfDisposed(),(0,U.P)(this)};var V=n(13020);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.equal=function(e){return this.throwIfDisposed(),(0,V.L)(this,e)};var z=n(95207);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.erf=function(){return this.throwIfDisposed(),(0,z.Y)(this)};var j=n(44881);
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.euclideanNorm=function(e,t){return this.throwIfDisposed(),(0,j.p)(this,e,t)};var Y=n(8631);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.exp=function(){return this.throwIfDisposed(),(0,Y.o)(this)};var G=n(8710);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.expandDims=function(e){return this.throwIfDisposed(),(0,G.U)(this,e)};var H=n(40517);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.expm1=function(){return this.throwIfDisposed(),(0,H.I)(this)};var W=n(41361);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.fft=function(){return this.throwIfDisposed(),(0,W.h)(this)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.flatten=function(){return this.throwIfDisposed(),(0,h.t)(this,[this.size])};var X=n(15606);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.floor=function(){return this.throwIfDisposed(),(0,X.R)(this)};var q=n(88991);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.floorDiv=function(e){return this.throwIfDisposed(),(0,q.w)(this,e)};var K=n(48229);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.gather=function(e,t,n){return this.throwIfDisposed(),(0,K.k)(this,e,t,n)};var Z=n(13337);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.greaterEqual=function(e){return this.throwIfDisposed(),(0,Z.D)(this,e)};var Q=n(62058);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.greater=function(e){return this.throwIfDisposed(),(0,Q.r)(this,e)};var J=n(13108);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.ifft=function(){return this.throwIfDisposed(),(0,J.K)(this)};var ee=n(22292);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.irfft=function(){return this.throwIfDisposed(),(0,ee.g)(this)};var te=n(68318);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.isFinite=function(){return this.throwIfDisposed(),(0,te.M)(this)};var ne=n(33454);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.isInf=function(){return this.throwIfDisposed(),(0,ne.E)(this)};var ie=n(6300);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.isNaN=function(){return this.throwIfDisposed(),(0,ie.y)(this)};var re=n(66919);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.leakyRelu=function(e){return this.throwIfDisposed(),(0,re.H)(this,e)};var se=n(56508);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.lessEqual=function(e){return this.throwIfDisposed(),(0,se.I)(this,e)};var oe=n(61303);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.less=function(e){return this.throwIfDisposed(),(0,oe.M)(this,e)};var ae=n(93531);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.localResponseNormalization=function(e,t,n,i){return this.throwIfDisposed(),(0,ae.K)(this,e,t,n,i)};var le=n(95645);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logSigmoid=function(){return this.throwIfDisposed(),(0,le.n)(this)};var ue=n(97991);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logSoftmax=function(e){return this.throwIfDisposed(),(0,ue.H)(this,e)};var ce=n(13330);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logSumExp=function(e,t){return this.throwIfDisposed(),(0,ce.V)(this,e,t)};var de=n(44010);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.log=function(){return this.throwIfDisposed(),(0,de.R)(this)};var he=n(12015);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.log1p=function(){return this.throwIfDisposed(),(0,he.K)(this)};var pe=n(13789);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logicalAnd=function(e){return this.throwIfDisposed(),(0,pe.n)(this,e)};var fe=n(89881);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logicalNot=function(){return this.throwIfDisposed(),(0,fe.N)(this)};var me=n(9879);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logicalOr=function(e){return this.throwIfDisposed(),(0,me.z)(this,e)};var ge=n(19925);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.logicalXor=function(e){return this.throwIfDisposed(),(0,ge.r)(this,e)};var _e=n(65703);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.matMul=function(e,t,n){return this.throwIfDisposed(),(0,_e.N)(this,e,t,n)};var ye=n(86999);(0,r.tp)().prototype.maxPool=function(e,t,n,i){return this.throwIfDisposed(),(0,ye.j)(this,e,t,n,i)};var ve=n(41938);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.max=function(e,t){return this.throwIfDisposed(),(0,ve.T)(this,e,t)};var be=n(30178);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.maximum=function(e){return this.throwIfDisposed(),(0,be.P)(this,e)};var Te=n(12611);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.mean=function(e,t){return this.throwIfDisposed(),(0,Te.i)(this,e,t)};var xe=n(57436);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.min=function(e,t){return this.throwIfDisposed(),(0,xe.j)(this,e,t)};var Ee=n(12644);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.minimum=function(e){return this.throwIfDisposed(),(0,Ee.B)(this,e)};var we=n(66567);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.mirrorPad=function(e,t){return this.throwIfDisposed(),(0,we.F)(this,e,t)};var Ie=n(60152);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.mod=function(e){return this.throwIfDisposed(),(0,Ie.z)(this,e)};var Ae=n(9258);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.mul=function(e){return this.throwIfDisposed(),(0,Ae.l)(this,e)};var Se=n(96522);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.neg=function(){return this.throwIfDisposed(),(0,Se.H)(this)};var Ce=n(92596);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.norm=function(e,t,n){return this.throwIfDisposed(),(0,Ce.x)(this,e,t,n)};var Oe=n(42118);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.notEqual=function(e){return this.throwIfDisposed(),(0,Oe.E)(this,e)};var Me=n(11760);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.oneHot=function(e,t=1,n=0){return this.throwIfDisposed(),(0,Me.M)(this,e,t,n)};var ke=n(69885);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.onesLike=function(){return this.throwIfDisposed(),(0,ke.P)(this)};var Re=n(65661);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.pad=function(e,t){return this.throwIfDisposed(),(0,Re.e)(this,e,t)};var Ne=n(17872);(0,r.tp)().prototype.pool=function(e,t,n,i,r,s){return this.throwIfDisposed(),(0,Ne.d)(this,e,t,n,i,r,s)};var De=n(98990);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.pow=function(e){return this.throwIfDisposed(),(0,De.n)(this,e)};var Fe=n(64394);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.prelu=function(e){return this.throwIfDisposed(),(0,Fe.N)(this,e)};var Le=n(67771);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.prod=function(e,t){return this.throwIfDisposed(),(0,Le._)(this,e,t)};var Pe=n(19870);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.reciprocal=function(){return this.throwIfDisposed(),(0,Pe.V)(this)};var Be=n(90112);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.relu=function(){return this.throwIfDisposed(),(0,Be.V)(this)};var $e=n(83732);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.relu6=function(){return this.throwIfDisposed(),(0,$e.j)(this)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.reshapeAs=function(e){return this.throwIfDisposed(),(0,h.t)(this,e.shape)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.reshape=function(e){return this.throwIfDisposed(),(0,h.t)(this,e)};var Ue=n(44711);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.resizeBilinear=function(e,t,n){return this.throwIfDisposed(),(0,Ue.v)(this,e,t,n)};var Ve=n(42954);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.resizeNearestNeighbor=function(e,t,n){return this.throwIfDisposed(),(0,Ve.b)(this,e,t,n)};var ze=n(53262);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.reverse=function(e){return this.throwIfDisposed(),(0,ze.B)(this,e)};var je=n(8775);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.rfft=function(){return this.throwIfDisposed(),(0,je.z)(this)};var Ye=n(25912);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.round=function(){return this.throwIfDisposed(),(0,Ye.L)(this)};var Ge=n(17820);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.rsqrt=function(){return this.throwIfDisposed(),(0,Ge.Z)(this)};var He=n(26325);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.selu=function(){return this.throwIfDisposed(),(0,He.W)(this)};var We=n(89986);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.separableConv2d=function(e,t,n,i,r,s){return this.throwIfDisposed(),(0,We.w)(this,e,t,n,i,r,s)};var Xe=n(28968);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sigmoid=function(){return this.throwIfDisposed(),(0,Xe.r)(this)};var qe=n(51115);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sign=function(){return this.throwIfDisposed(),(0,qe._)(this)};var Ke=n(33726);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sin=function(){return this.throwIfDisposed(),(0,Ke.F)(this)};var Ze=n(58276);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sinh=function(){return this.throwIfDisposed(),(0,Ze.L)(this)};var Qe=n(17986);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.slice=function(e,t){return this.throwIfDisposed(),(0,Qe.d)(this,e,t)};var Je=n(26346);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.softmax=function(e){return this.throwIfDisposed(),(0,Je.V)(this,e)};var et=n(66030);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.softplus=function(){return this.throwIfDisposed(),(0,et.l)(this)};var tt=n(10776);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.spaceToBatchND=function(e,t){return this.throwIfDisposed(),(0,tt.e)(this,e,t)};var nt=n(66512);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.split=function(e,t){return this.throwIfDisposed(),(0,nt.l)(this,e,t)};var it=n(79348);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sqrt=function(){return this.throwIfDisposed(),(0,it.R)(this)};var rt=n(45793);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.square=function(){return this.throwIfDisposed(),(0,rt.E)(this)};var st=n(53427);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.squaredDifference=function(e){return this.throwIfDisposed(),(0,st.P)(this,e)};var ot=n(5932);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.squeeze=function(e){return this.throwIfDisposed(),(0,ot.r)(this,e)};var at=n(54268);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.stack=function(e,t){this.throwIfDisposed();const n=e instanceof r.qY?[this,e]:[this,...e];return(0,at.t)(n,t)};var lt=n(10700);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.step=function(e){return this.throwIfDisposed(),(0,lt.P)(this,e)};var ut=n(45894);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.stridedSlice=function(e,t,n,i,r,s,o,a){return this.throwIfDisposed(),(0,ut.Y)(this,e,t,n,i,r,s,o,a)};var ct=n(77126);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sub=function(e){return this.throwIfDisposed(),(0,ct.j)(this,e)};var dt=n(83791);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.sum=function(e,t){return this.throwIfDisposed(),(0,dt.c)(this,e,t)};var ht=n(77823);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.tan=function(){return this.throwIfDisposed(),(0,ht.M)(this)};var pt=n(57311);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.tanh=function(){return this.throwIfDisposed(),(0,pt.y)(this)};var ft=n(64826);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.tile=function(e){return this.throwIfDisposed(),(0,ft.V)(this,e)},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.toBool=function(){return this.throwIfDisposed(),(0,f.w)(this,"bool")},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.toFloat=function(){return this.throwIfDisposed(),(0,f.w)(this,"float32")},
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.toInt=function(){return this.throwIfDisposed(),(0,f.w)(this,"int32")};var mt=n(21190);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.topk=function(e,t){return this.throwIfDisposed(),(0,mt.r)(this,e,t)};var gt=n(7703);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.transpose=function(e){return this.throwIfDisposed(),(0,gt.m)(this,e)};var _t=n(73937);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.unique=function(e){return this.throwIfDisposed(),(0,_t.A)(this,e)};var yt=n(97706);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.unsortedSegmentSum=function(e,t){return this.throwIfDisposed(),(0,yt.z)(this,e,t)};var vt=n(67261);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.unstack=function(e){return this.throwIfDisposed(),(0,vt.K)(this,e)};var bt=n(12151);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.where=function(e,t){return this.throwIfDisposed(),(0,bt._)(e,this,t)};var Tt=n(55537);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,r.tp)().prototype.zerosLike=function(){return this.throwIfDisposed(),(0,Tt.P)(this)}},50259:(e,t,n)=>{"use strict";n.d(t,{qY:()=>y,yl:()=>d,rT:()=>b,tp:()=>v,B4:()=>_,Q5:()=>g,qP:()=>m});var i=n(41743),r=n(45119);function s(e,t,n,i){const s=(0,r.Ur)(t),a=function(e,t,n,i){const s=(0,r.Ze)(t),a=i[i.length-1],l=new Array(a).fill(0),c=t.length,d="complex64"===n?u(e):e;if(c>1)for(let e=0;e<s/a;e++){const t=e*a;for(let e=0;e<a;e++)l[e]=Math.max(l[e],o(d[t+e],0,n).length)}return l}(e,t,n,s),c=t.length,d=l(e,t,n,s,a),h=["Tensor"];return i&&(h.push(` dtype: ${n}`),h.push(` rank: ${c}`),h.push(` shape: [${t}]`),h.push(" values:")),h.push(d.map(e=>" "+e).join("\n")),h.join("\n")}function o(e,t,n){let i;return i=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:(0,r.Kg)(e)?`'${e}'`:"bool"===n?a(e):parseFloat(e.toFixed(7)).toString(),(0,r.av)(i,t)}function a(e){return 0===e?"false":"true"}function l(e,t,n,i,r,s=!0){const c="complex64"===n?2:1,d=t[0],h=t.length;if(0===h){if("complex64"===n){return[o(u(e)[0],0,n)]}return"bool"===n?[a(e[0])]:[e[0].toString()]}if(1===h){if(d>20){const t=3*c;let i=Array.from(e.slice(0,t)),s=Array.from(e.slice((d-3)*c,d*c));return"complex64"===n&&(i=u(i),s=u(s)),["["+i.map((e,t)=>o(e,r[t],n)).join(", ")+", ..., "+s.map((e,t)=>o(e,r[d-3+t],n)).join(", ")+"]"]}return["["+("complex64"===n?u(e):Array.from(e)).map((e,t)=>o(e,r[t],n)).join(", ")+"]"]}const p=t.slice(1),f=i.slice(1),m=i[0]*c,g=[];if(d>20){for(let t=0;t<3;t++){const i=t*m,s=i+m;g.push(...l(e.slice(i,s),p,n,f,r,!1))}g.push("...");for(let t=d-3;t<d;t++){const i=t*m,s=i+m;g.push(...l(e.slice(i,s),p,n,f,r,t===d-1))}}else for(let t=0;t<d;t++){const i=t*m,s=i+m;g.push(...l(e.slice(i,s),p,n,f,r,t===d-1))}const _=2===h?",":"";g[0]="["+(d>0?g[0]+_:"");for(let e=1;e<g.length-1;e++)g[e]=" "+g[e]+_;let y=",\n";for(let e=2;e<h;e++)y+="\n";return g[g.length-1]=" "+g[g.length-1]+"]"+(s?"":y),g}function u(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var c=n(83879);
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class d{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=r.Ze(e),null!=n){const e=n.length;r.vA(e===this.size,()=>`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||r.Ab(t,this.size),this.strides=(0,r.Ur)(e)}set(e,...t){0===t.length&&(t=[0]),r.vA(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;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return h().makeTensor(this.values,this.shape,this.dtype)}}let h=null,p=null,f=null;function m(e){h=e}function g(e){p=e}function _(e){f=e}class y{constructor(e,t,n,i){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=r.Ze(e),this.strides=(0,r.Ur)(e),this.dataId=n,this.id=i,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return p.buffer(this.shape,this.dtype,e)}bufferSync(){return p.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return(0,r.yw)(this.shape,e,"complex64"===this.dtype)}arraySync(){return(0,r.yw)(this.shape,this.dataSync(),"complex64"===this.dtype)}async data(){this.throwIfDisposed();const e=h().read(this.dataId);if("string"===this.dtype){const t=await e;try{return t.map(e=>c.decodeString(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(),h().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=h().readSync(this.dataId);if("string"===this.dtype)try{return e.map(e=>c.decodeString(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 h().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),h().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return p.print(this,e)}clone(){return this.throwIfDisposed(),p.clone(this)}toString(e=!1){return s(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),p.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),h().makeVariable(this,e,t,n)}}function v(){return(0,i.m)("Tensor",()=>y)}Object.defineProperty(y,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),v();class b extends y{constructor(e,t,n,i){super(e.shape,e.dtype,e.dataId,i),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(!r.r1(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);h().disposeTensor(this),this.dataId=e.dataId,h().incRef(this,null)}dispose(){h().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(b,Symbol.hasInstance,{value:e=>e instanceof y&&null!=e.assign&&e.assign instanceof Function})},30565:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assertTypesMatch:()=>a,getTensorsInContainer:()=>u,isTensorInList:()=>l,makeTypesMatch:()=>o});var i=n(50259),r=n(52046),s=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function o(e,t){if(e.dtype===t.dtype)return[e,t];const n=(0,r.Tu)(e.dtype,t.dtype);return[e.cast(n),t.cast(n)]}function a(e,t){(0,s.vA)(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function l(e,t){return t.some(t=>t.id===e.id)}function u(e){const t=[];return c(e,t,new Set),t}function c(e,t,n){if(null==e)return;if(e instanceof i.qY)return void t.push(e);if(r=e,!Array.isArray(r)&&"object"!=typeof r)return;var r;const s=e;for(const e in s){const i=s[e];n.has(i)||(n.add(i),c(i,t,n))}}},28189:(e,t,n)=>{"use strict";n.d(t,{MZ:()=>u,YT:()=>h,j1:()=>p});var i=n(41585),r=n(46574),s=n(50259),o=n(52046),a=n(83879),l=n(45119);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function u(e,t){let n=e;if((0,a.isTypedArray)(e))return"string"===t?[]:[e.length];if((0,o.Oj)(e)){const t=e.channels||"RGBA";return[e.height,e.width*t.length]}if((0,o.Nw)(e))return[e.buffer.size/(null==t?4:(0,l.jv)(t))];if(!Array.isArray(e))return[];const i=[];for(;Array.isArray(n)||(0,a.isTypedArray)(n)&&"string"!==t;)i.push(n.length),n=n[0];return Array.isArray(e)&&(0,r._K)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&c(e,i,[]),i}function c(e,t,n){if(n=n||[],!Array.isArray(e)&&!(0,a.isTypedArray)(e))return void(0,l.vA)(0===t.length,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);(0,l.vA)(t.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${e.length} elements`),(0,l.vA)(e.length===t[0],()=>`Element arr[${n.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);const i=t.slice(1);for(let t=0;t<e.length;++t)c(e[t],i,n.concat(t))}function d(e,t,n,i){if("string_or_numeric"!==e){if(null==e)throw new Error("Expected dtype cannot be null.");if("numeric"!==e&&e!==t||"numeric"===e&&"string"===t)throw new Error(`Argument '${n}' passed to '${i}' must be ${e} tensor, but got ${t} tensor`)}}function h(e,t,n,r="numeric"){if(e instanceof(0,s.tp)())return d(r,e.dtype,t,n),e;let o=(0,l.X$)(e);if("string"!==o&&["bool","int32","float32"].indexOf(r)>=0&&(o=r),d(r,o,t,n),null==e||!(0,a.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){const i=null==e?"null":e.constructor.name;throw new Error(`Argument '${t}' passed to '${n}' must be a Tensor or TensorLike, but got '${i}'`)}const c=u(e,o);(0,a.isTypedArray)(e)||Array.isArray(e)||(e=[e]);const h="string"!==o?(0,a.toTypedArray)(e,o):(0,a.flatten)(e,[],!0);return i.T2.makeTensor(h,c,o)}function p(e,t,n,i="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((e,r)=>h(e,`${t}[${r}]`,n,i))}},52046:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var i,r,s,o,a;n.d(t,{Nw:()=>h,Oj:()=>d,Tu:()=>u,ch:()=>c,rg:()=>i}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(i||(i={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(s||(s={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(a||(a={}));const l={float32:o,int32:r,bool:s,complex64:a};function u(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return l[e][t]}function c(e){return u(e,"int32")}function d(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function h(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}},83879:(e,t,n)=>{"use strict";n.r(t),n.d(t,{arraysEqual:()=>s.r1,arraysEqualWithNull:()=>s.e_,assert:()=>s.vA,assertNonNegativeIntegerDimensions:()=>s.SA,assertNonNull:()=>s.HO,assertShapesMatch:()=>s.O3,bytesFromStringArray:()=>s.SL,bytesPerElement:()=>s.jv,checkConversionForErrors:()=>s.nd,clamp:()=>s.qE,computeStrides:()=>s.Ur,convertBackendValuesAndArrayBuffer:()=>s.o2,createScalarValue:()=>b,createShuffledIndices:()=>s.P8,decodeString:()=>I,distSquared:()=>s.oO,encodeString:()=>w,fetch:()=>E,fingerPrint64:()=>v,flatten:()=>S,getArrayFromDType:()=>s.Ab,getTypedArrayFromDType:()=>s.ce,hasEncodingLoss:()=>s.BE,hexToLong:()=>l,indexToLoc:()=>s._k,inferDtype:()=>s.X$,inferFromImplicitShape:()=>s.XT,isBoolean:()=>s.Lm,isFunction:()=>s.Tn,isInt:()=>s.E6,isNumber:()=>s.Et,isPromise:()=>s.yL,isScalarShape:()=>s.Sf,isString:()=>s.Kg,isTypedArray:()=>A,isValidDtype:()=>s.xn,locToIndex:()=>s.sX,makeOnesTypedArray:()=>s.FZ,makeZerosNestedTypedArray:()=>s.c7,makeZerosTypedArray:()=>s.Ty,nearestDivisor:()=>s.lK,nearestLargerEven:()=>s.eV,now:()=>x,parseAxisParam:()=>s.Y6,randUniform:()=>s.so,repeatedTry:()=>s._q,rightPad:()=>s.av,shuffle:()=>s.k4,shuffleCombo:()=>s.a0,sizeFromShape:()=>s.Ze,sizeToSquarishShape:()=>s.gS,squeezeShape:()=>s.gx,sum:()=>s.cz,swap:()=>s.wg,tanh:()=>s.ym,toNestedArray:()=>s.yw,toTypedArray:()=>T});var i=n(46574),r=n(86448),s=n(45119),o=n(28570);
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const a=n.n(o)()||o;function l(e){return a.fromString(e,!0,16)}const u=l("c3a5c85c97cb3127"),c=l("b492b66fbe98f273"),d=l("9ae16a3b2f90404f");function h(e){return e.xor(e.shru(47))}function p(e,t,n){const i=e.slice(t,t+n);return a.fromBytes(Array.from(i),!0,!0)}function f(e,t){return p(e,t,8)}function m(e,t){return p(e,t,4)}function g(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function _(e,t,n=l("9ddfea08eb382d69")){let i=e.xor(t).mul(n);i=i.xor(i.shru(47));let r=t.xor(i).mul(n);return r=r.xor(r.shru(47)),r=r.mul(n),r}function y(e,t,n,i){return function(e,t,n,i,r,s){r=r.add(e),s=g(s.add(r).add(i),21);const o=r;return r=(r=r.add(t)).add(n),s=s.add(g(r,44)),[r.add(i),s.add(o)]}(f(e,t),f(e,t+8),f(e,t+16),f(e,t+24),n,i)}function v(e,t=e.length){const n=a.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){const n=d.add(2*t),i=f(e,0).add(d),r=f(e,t-8);return _(g(r,37).mul(n).add(i),g(i,25).add(r).mul(n),n)}if(t>=4){const n=d.add(2*t);return _(m(e,0).shl(3).add(t),m(e,t-4),n)}if(t>0){const n=e[0]+(e[t>>1]<<8),i=t+(e[t-1]<<2);return h(d.mul(n).xor(u.mul(i))).mul(d)}return d}(e,t):function(e,t=e.length){const n=d.add(2*t),i=f(e,0).mul(c),r=f(e,8),s=f(e,t-8).mul(n),o=f(e,t-16).mul(d);return _(g(i.add(r),43).add(g(s,30)).add(o),i.add(g(r.add(d),18)).add(s),n)}(e,t);if(t<=64)return function(e,t=e.length){const n=d.add(2*t),i=f(e,0).mul(d),r=f(e,8),s=f(e,t-8).mul(n),o=f(e,t-16).mul(d),a=g(i.add(r),43).add(g(s,30)).add(o),l=_(a,i.add(g(r.add(d),18)).add(s),n),u=f(e,16).mul(n),c=f(e,24),h=a.add(f(e,t-32)).mul(n),p=l.add(f(e,t-24)).mul(n);return _(g(u.add(c),43).add(g(h,30)).add(p),u.add(g(c.add(i),18)).add(h),n)}(e,t);let i=n,r=n.mul(c).add(113),s=h(r.mul(d).add(113)).mul(d),o=[a.UZERO,a.UZERO],l=[a.UZERO,a.UZERO];i=i.mul(d).add(f(e,0));let p=0;const v=64*(t-1>>6),b=v+(t-1&63)-63;do{i=g(i.add(r).add(o[0]).add(f(e,p+8)),37).mul(c),r=g(r.add(o[1]).add(f(e,p+48)),42).mul(c),i=i.xor(l[1]),r=r.add(o[0]).add(f(e,p+40)),s=g(s.add(l[0]),33).mul(c),o=y(e,p,o[1].mul(c),i.add(l[0])),l=y(e,p+32,s.add(l[1]),r.add(f(e,p+16))),[s,i]=[i,s],p+=64}while(p!==v);const T=c.add(s.and(255).shl(1));return p=b,l[0]=l[0].add(t-1&63),o[0]=o[0].add(l[0]),l[0]=l[0].add(o[0]),i=g(i.add(r).add(o[0]).add(f(e,p+8)),37).mul(T),r=g(r.add(o[1]).add(f(e,p+48)),42).mul(T),i=i.xor(l[1].mul(9)),r=r.add(o[0].mul(9).add(f(e,p+40))),s=g(s.add(l[0]),33).mul(T),o=y(e,p,o[1].mul(T),i.add(l[0])),l=y(e,p+32,s.add(l[1]),r.add(f(e,p+16))),[s,i]=[i,s],_(_(o[0],l[0],T).add(h(r).mul(u)).add(s),_(o[1],l[1],T).add(i),T)}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function b(e,t){return"string"===t?w(e):T([e],t)}function T(e,t){if("string"===t)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=S(e)),(0,i._K)().getBool("DEBUG")&&s.nd(e,t),function(e,t){return e instanceof Float32Array&&"float32"===t||e instanceof Int32Array&&"int32"===t||e instanceof Uint8Array&&"bool"===t}(e,t))return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){const t=new Uint8Array(e.length);for(let n=0;n<t.length;++n)0!==Math.round(e[n])&&(t[n]=1);return t}throw new Error(`Unknown data type ${t}`)}function x(){return(0,i._K)().platform.now()}function E(e,t){return(0,i._K)().platform.fetch(e,t)}function w(e,t="utf-8"){return t=t||"utf-8",(0,i._K)().platform.encode(e,t)}function I(e,t="utf-8"){return t=t||"utf-8",(0,i._K)().platform.decode(e,t)}function A(e){return null!=(0,i._K)().platform.isTypedArray?(0,i._K)().platform.isTypedArray(e):(0,r.Y)(e)}function S(e,t=[],n=!1){if(null==t&&(t=[]),"boolean"==typeof e||"number"==typeof e||"string"==typeof e||s.yL(e)||null==e||A(e)&&n)t.push(e);else if(Array.isArray(e)||A(e))for(let i=0;i<e.length;++i)S(e[i],t,n);else{let i=-1;for(const t of Object.keys(e))/^([1-9]+[0-9]*|0)$/.test(t)&&(i=Math.max(i,Number(t)));for(let r=0;r<=i;r++)S(e[r],t,n)}return t}},45119:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function i(e){let t=e.length,n=0;for(;t>0;)n=Math.random()*t|0,t--,a(e,t,n)}function r(e,t){if(e.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let n=e.length,i=0;for(;n>0;)i=Math.random()*n|0,n--,a(e,n,i),a(t,n,i)}function s(e,t,n){return Math.max(e,Math.min(t,n))}function o(e){return e%2==0?e:e+1}function a(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function l(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t}function u(e,t){const n=Math.random();return t*n+(1-n)*e}function c(e,t){let n=0;for(let i=0;i<e.length;i++){const r=Number(e[i])-Number(t[i]);n+=r*r}return n}function d(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function h(e,t,n=""){d(_(e,t),()=>n+` Shapes ${e} and ${t} must match`)}function p(e){d(null!=e,()=>"The input to the tensor constructor must be a non-null value.")}function f(e){if(0===e.length)return 1;let t=e[0];for(let n=1;n<e.length;n++)t*=e[n];return t}function m(e){return 0===e.length}function g(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<e.length;n++)if(null!==e[n]&&null!==t[n]&&e[n]!==t[n])return!1;return!0}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<e.length;n++)if(e[n]!==t[n])return!1;return!0}function y(e){return e%1==0}function v(e){if(null!=Math.tanh)return Math.tanh(e);if(e===1/0)return 1;if(e===-1/0)return-1;{const t=Math.exp(2*e);return(t-1)/(t+1)}}function b(e){const t=Math.ceil(Math.sqrt(e));return[t,Math.ceil(e/t)]}function T(e){const t=new Uint32Array(e);for(let n=0;n<e;++n)t[n]=n;return i(t),t}function x(e,t){return t<=e.length?e:e+" ".repeat(t-e.length)}function E(e,t=e=>0,n,i){return new Promise((r,s)=>{let o=0;const a=()=>{if(e())return void r();o++;const l=t(o);null!=n&&o>=n?s():null!=i?i(a,l):setTimeout(a,l)};a()})}function w(e,t){let n=1,i=-1;for(let t=0;t<e.length;++t)if(e[t]>=0)n*=e[t];else if(-1===e[t]){if(-1!==i)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${i} and dim ${t}`);i=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===i){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[i]=t/n,r}function I(e,t){const n=t.length;return d((e=null==e?t.map((e,t)=>t):[].concat(e)).every(e=>e>=-n&&e<n),()=>`All values in axis param must be in range [-${n}, ${n}) but got axis ${e}`),d(e.every(e=>y(e)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?n+e:e)}function A(e,t){const n=[],i=[],r=null!=t&&Array.isArray(t)&&0===t.length,s=null==t||r?null:I(t,e).sort();let o=0;for(let t=0;t<e.length;++t){if(null!=s){if(s[o]===t&&1!==e[t])throw new Error(`Can't squeeze axis ${t} since its dim '${e[t]}' is not 1`);(null==s[o]||s[o]>t)&&1===e[t]&&(n.push(e[t]),i.push(t)),s[o]<=t&&o++}1!==e[t]&&(n.push(e[t]),i.push(t))}return{newShape:n,keptDims:i}}function S(e,t){return C(e,t)}function C(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 O(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(isNaN(i)||!isFinite(i))throw Error(`A tensor of type ${t} being uploaded contains ${i}.`)}}function M(e){return"bool"===e||"complex64"===e||"float32"===e||"int32"===e||"string"===e}function k(e,t){return"complex64"!==t&&(("float32"!==t||"complex64"===e)&&(("int32"!==t||"float32"===e||"complex64"===e)&&("bool"!==t||"bool"!==e)))}function R(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 N(e){if(null==e)return 0;let t=0;return e.forEach(e=>t+=e.length),t}function D(e){return"string"==typeof e||e instanceof String}function F(e){return"boolean"==typeof e}function L(e){return"number"==typeof e}function P(e){return Array.isArray(e)?P(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":L(e)?"float32":D(e)?"string":F(e)?"bool":"float32"}function B(e){return!!(e&&e.constructor&&e.call&&e.apply)}function $(e,t){for(let n=t;n<e;++n)if(e%n===0)return n;return e}function U(e){const t=e.length;if(t<2)return[];const n=new Array(t-1);n[t-2]=e[t-1];for(let i=t-3;i>=0;--i)n[i]=n[i+1]*e[i+1];return n}function V(e,t,n,i=!1){const r=new Array;if(1===t.length){const s=t[0]*(i?2:1);for(let t=0;t<s;t++)r[t]=n[e+t]}else{const s=t[0],o=t.slice(1),a=o.reduce((e,t)=>e*t)*(i?2:1);for(let t=0;t<s;t++)r[t]=V(e+t*a,o,n,i)}return r}function z(e,t,n=!1){if(0===e.length)return t[0];const i=e.reduce((e,t)=>e*t)*(n?2:1);if(0===i)return[];if(i!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${n?" for a complex tensor":""}.`);return V(0,e,t,n)}function j(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}`)}function Y(e,t){const n=G(e,t);for(let e=0;e<n.length;e++)n[e]=1;return n}function G(e,t){if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t)return new Uint8Array(e);throw new Error(`Unknown data type ${t}`)}function H(e,t){const n=e.reduce((e,t)=>e*t,1);if(null==t||"float32"===t)return z(e,new Float32Array(n));if("int32"===t)return z(e,new Int32Array(n));if("bool"===t)return z(e,new Uint8Array(n));throw new Error(`Unknown data type ${t}`)}function W(e){e.forEach(t=>{d(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function X(e,t,n){if(0===t)return 0;if(1===t)return e[0];let i=e[e.length-1];for(let t=0;t<e.length-1;++t)i+=n[t]*e[t];return i}function q(e,t,n){if(0===t)return[];if(1===t)return[e];const i=new Array(t);for(let t=0;t<i.length-1;++t)i[t]=Math.floor(e/n[t]),e-=i[t]*n[t];return i[i.length-1]=e,i}function K(e){return e&&e.then&&"function"==typeof e.then}n.d(t,{Ab:()=>C,BE:()=>k,E6:()=>y,Et:()=>L,FZ:()=>Y,HO:()=>p,Kg:()=>D,Lm:()=>F,O3:()=>h,P8:()=>T,SA:()=>W,SL:()=>N,Sf:()=>m,Tn:()=>B,Ty:()=>G,Ur:()=>U,X$:()=>P,XT:()=>w,Y6:()=>I,Ze:()=>f,_k:()=>q,_q:()=>E,a0:()=>r,av:()=>x,c7:()=>H,ce:()=>S,cz:()=>l,eV:()=>o,e_:()=>g,gS:()=>b,gx:()=>A,jv:()=>R,k4:()=>i,lK:()=>$,nd:()=>O,o2:()=>j,oO:()=>c,qE:()=>s,r1:()=>_,sX:()=>X,so:()=>u,vA:()=>d,wg:()=>a,xn:()=>M,yL:()=>K,ym:()=>v,yw:()=>z})},1936:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(95237),r=n(38205);class s extends i.Component{componentDidMount(){const{name:e,tab:t}=this.props;this.props.registerSurface(e,t,this)}componentDidUpdate(){return!1}render(){const{name:e,visible:t,styles:n}=this.props,o=Object.assign({},s.defaultStyles,n),{width:a,height:l}=o;let{maxHeight:u,maxWidth:c}=o;u=l===s.defaultStyles.height?u:l,c=a===s.defaultStyles.width?c:a;const d=r.css({display:t?"block":"none",backgroundColor:"white",marginTop:"10px",marginBottom:"10px",boxShadow:"0 0 6px -3px #777",padding:"10px !important",height:l,width:a,maxHeight:u,maxWidth:c,overflow:"auto"}),h=r.css({backgroundColor:"white",boxSizing:"border-box",borderBottom:"1px solid #357EDD",lineHeight:"2em",marginBottom:"20px",fontWeight:"600",textAlign:"center"}),p=r.css({boxSizing:"border-box"});return i.h("div",{className:`${d} tf-surface`,ref:e=>this.container=e,"data-visible":t},i.h("div",{className:`${h} tf-label`,ref:e=>this.label=e},e),i.h("div",{className:`${p} tf-draw-area`,ref:e=>this.drawArea=e}))}}s.defaultStyles={maxWidth:"550px",maxHeight:"580px",height:"auto",width:"auto"},t.SurfaceComponent=s},9779:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(95237),r=n(38205);class s extends i.Component{render(){const{tabNames:e,activeTab:t,handleClick:n}=this.props,s=e.length>0?e.map(e=>i.h(o,{key:e,id:e,handleClick:n,isActive:e===t},e)):null,a=r.css({overflowX:"scroll",overflowY:"hidden",whiteSpace:"nowrap",borderBottomStyle:"solid",borderBottomWidth:"1px",borderColor:"#eee",paddingBottom:"1rem",marginTop:"1rem"});return i.h("div",{className:`${a} visor-tabs`},s)}}t.Tabs=s;class o extends i.Component{render(){const{children:e,isActive:t,handleClick:n,id:s}=this.props,o=r.css({borderBottomColor:t?"#357EDD":"#AAAAAA",borderBottomWidth:"1px",borderBottomStyle:"solid",cursor:"pointer",":hover":{color:"#357EDD"},display:"inline-block",marginRight:"1rem",padding:".5rem",fontSize:"1rem",fontWeight:"bold"});return i.h("a",{className:`${o} tf-tab`,"data-isactive":t,onClick:()=>n(s)},e)}}},25976:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(95237),r=n(38205),s=n(1936),o=n(9779);class a extends i.Component{static render(e,t,n){return i.render(i.h(a,Object.assign({},n)),e,t)}constructor(e){super(e),this.surfaces=new Map;const t=null==e.startOpen||e.startOpen;this.state={isOpen:t,isFullscreen:!1,activeTab:null,tabs:new Set},this.keyHandler=this.keyHandler.bind(this)}close(){this.setState({isOpen:!1})}open(){this.setState({isOpen:!0})}toggle(){this.setState({isOpen:!this.state.isOpen})}toggleFullScreen(){this.setState({isFullscreen:!this.state.isFullscreen})}isOpen(){return this.state.isOpen}isFullscreen(){return this.state.isFullscreen}getSurface(e,t){const n=this.surfaceId(e,t);let i;if(!this.surfaces.has(n))throw Error(`Surface not found with id: ${n}`);return i=this.surfaces.get(n),{container:i.container,label:i.label,drawArea:i.drawArea}}bindKeys(){document.addEventListener("keydown",this.keyHandler,!1)}unbindKeys(){document.removeEventListener("keydown",this.keyHandler)}surfaceId(e,t){return e+t}setTabs(e){const t=e.map(e=>e.tab),n=this.state.tabs;let i;for(const e of t)n.has(e)||(n.add(e),i=e);null!=i&&this.setState({tabs:n,activeTab:i})}getTabs(){return this.state.tabs}registerSurface(e,t,n){const i=this.surfaceId(e,t);this.surfaces.set(i,n)}keyHandler(e){192===e.keyCode&&(e.shiftKey?this.toggleFullScreen():this.toggle())}setActiveTab(e){this.setState({activeTab:e})}componentDidMount(){this.bindKeys()}componentWillMount(){this.setTabs(this.props.surfaceList)}componentWillReceiveProps(e){this.setTabs(e.surfaceList)}render(){const{isOpen:e,isFullscreen:t,activeTab:n}=this.state,{surfaceList:a}=this.props,u=Array.from(this.getTabs().values()),c=t?"90vw":"550px",d=r.css({width:c,height:"100%",backgroundColor:"#fafafa",boxSizing:"border-box",padding:"10px",position:"fixed",top:"0px",transition:"right 0.5s cubic-bezier(0.645, 0.045, 0.355, 1), width 0.5s cubic-bezier(0.645, 0.045, 0.355, 1)",boxShadow:"0 2px 5px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 0, 0, 0.24)",overflow:"auto",fontFamily:"sans-serif",fontSize:"14px",zIndex:1e3}),h=r.css({right:"0"}),p=r.css({right:`calc(-${c} - 10px)`}),f=e?h:p,m=r.css({});return i.h("div",{className:`${d} ${f} visor`,"data-isopen":e,"data-isfullscreen":t},i.h(l,{fullScreenHandler:this.toggleFullScreen.bind(this),closeHandler:this.close.bind(this),isFullScreen:t}),i.h(o.Tabs,{tabNames:u,activeTab:n,handleClick:this.setActiveTab.bind(this)}),i.h("div",{className:`${m} visor-surfaces`},a.map(e=>i.h(s.SurfaceComponent,{key:e.name+e.tab,name:e.name,tab:e.tab,styles:e.styles,registerSurface:this.registerSurface.bind(this),visible:n===e.tab}))))}}function l(e){const{isFullScreen:t,fullScreenHandler:n,closeHandler:s}=e,o=r.css({display:"flex",backgroundColor:"white",border:"1px solid white",padding:"6px",paddingTop:"10px",marginBottom:"10px",borderRadius:"6px",marginTop:"-16px"}),a=r.css({fontSize:".875rem",borderRadius:".25rem",paddingLeft:"1rem",paddingRight:"1rem",paddingTop:".5rem",paddingBottom:".5rem",textDecoration:"none",transition:"color .15s ease-in",color:"#111"}),l=r.css({marginLeft:"auto"});return i.h("div",{className:`${o} visor-controls`},i.h("button",{className:`${a}`,onClick:n},t?"Minimize":"Maximize"),i.h("button",{className:`${a} ${l}`,onClick:s},"Hide"))}t.VisorComponent=a},99778:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
n(15838),n(20455);const i=n(42784),r=n(13739),s=n(87483),o=n(45877),a=n(44857),l=n(80898),u=n(19827),c=n(10062),d=n(63559),h=n(15727),p=n(64853),f=n(32729),m=n(10454);t.version_vis=m.version;const g={barchart:i.barchart,table:u.table,histogram:o.histogram,linechart:a.linechart,scatterplot:l.scatterplot,confusionMatrix:r.confusionMatrix,heatmap:s.heatmap};t.render=g;const _={accuracy:f.accuracy,perClassAccuracy:f.perClassAccuracy,confusionMatrix:f.confusionMatrix};t.metrics=_;const y={history:c.history,fitCallbacks:c.fitCallbacks,perClassAccuracy:h.perClassAccuracy,valuesDistribution:p.valuesDistribution,layer:d.layer,modelSummary:d.modelSummary};t.show=y;var v=n(4701);t.visor=v.visor,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(65759))},42784:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(n(45780)),o=n(88227),a=n(56857);t.barchart=function(e,t,n={}){return i(this,void 0,void 0,function*(){const i=a.getDrawArea(e),r=t,c=Object.assign({},l,n);if(u.has(i)){const e=u.get(i);if(a.shallowEquals(c,e.lastOptions)){yield a.nextFrame();const t=e.view,n=t.changeset().remove(()=>!0).insert(r);return void(yield t.change("values",n).runAsync())}}const{xLabel:d,yLabel:h,xType:p,yType:f}=c;let m=null;null!=d&&(m={title:d});let g=null;null!=h&&(g={title:h});let _;_=null!=c.color?Array.isArray(c.color)?{field:"index",type:"nominal",scale:{range:c.color}}:{value:c.color}:{value:"#4C78A0"};const y={width:c.width||o.getDefaultWidth(i),height:c.height||o.getDefaultHeight(i),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},config:{axis:{labelFontSize:c.fontSize,titleFontSize:c.fontSize},text:{fontSize:c.fontSize},legend:{labelFontSize:c.fontSize,titleFontSize:c.fontSize}},data:{values:r,name:"values"},mark:{type:"bar",tooltip:!0},encoding:{x:{field:"index",type:p,axis:m},y:{field:"value",type:f,axis:g},color:_}};yield a.nextFrame();const v=yield s.default(i,y,{actions:!1,mode:"vega-lite",defaultStyle:!1});u.set(i,{view:v.view,lastOptions:c})})};const l={xLabel:"",yLabel:"",xType:"ordinal",yType:"quantitative",fontSize:11},u=new Map},13739:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(n(45780)),o=n(88227),a=n(56857);t.confusionMatrix=function(e,t,n={}){return i(this,void 0,void 0,function*(){const i=Object.assign({},l,n),r=a.getDrawArea(e),u=[],c=t.values,d=t.tickLabels||[],h=0===d.length;let p=!0;for(let e=0;e<c.length;e++){const t=h?`Class ${e}`:d[e];h&&d.push(t);for(let n=0;n<c[e].length;n++){const r=h?`Class ${n}`:d[n],s=c[e][n];e!==n||i.shadeDiagonal?(u.push({label:t,prediction:r,count:s,scaleCount:s}),0!==s&&(p=!1)):u.push({label:t,prediction:r,count:s,noFill:!0})}}if(!i.shadeDiagonal&&p)for(const e of u)!0===e.noFill&&(e.noFill=!1,e.scaleCount=e.count);const f={width:i.width||o.getDefaultWidth(r),height:i.height||o.getDefaultHeight(r),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},config:{axis:{labelFontSize:i.fontSize,titleFontSize:i.fontSize},text:{fontSize:i.fontSize},legend:{labelFontSize:i.fontSize,titleFontSize:i.fontSize}},data:{values:u},encoding:{x:{field:"prediction",type:"ordinal",title:i.xLabel||"prediction",scale:{domain:d}},y:{field:"label",type:"ordinal",title:i.yLabel||"label",scale:{domain:d}}},layer:[{transform:[{filter:"datum.noFill != true"}],mark:{type:"rect"},encoding:{color:{field:"scaleCount",type:"quantitative",scale:{range:i.colorMap}},tooltip:[{field:"label",type:"nominal"},{field:"prediction",type:"nominal"},{field:"count",type:"quantitative"}]}}]};!1===i.shadeDiagonal&&f.layer.push({transform:[{filter:"datum.noFill == true"}],mark:{type:"rect",fill:"white"},encoding:{tooltip:[{field:"label",type:"nominal"},{field:"prediction",type:"nominal"},{field:"count",type:"quantitative"}]}}),i.showTextOverlay&&f.layer.push({mark:{type:"text",baseline:"middle"},encoding:{text:{field:"count",type:"nominal"}}});const m="string"==typeof i.colorMap?{scheme:i.colorMap}:i.colorMap;f.layer[0].encoding.color.scale.range=m,yield s.default(r,f,{actions:!1,mode:"vega-lite",defaultStyle:!1})})};const l={xLabel:null,yLabel:null,xType:"nominal",yType:"nominal",shadeDiagonal:!0,fontSize:12,showTextOverlay:!0,height:400,colorMap:["#f7fbff","#4292c6"]}},87483:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(15838)),a=s(n(45780)),l=n(88227),u=n(56286),c=n(56857);function d(e,t,n){const i=e instanceof o.Tensor?e.shape:[e.length,e[0].length];0===n?u.assert(i[0]===t.length,`Length of xTickLabels (${t.length}) must match number of rows (${i[0]})`):1===n&&u.assert(i[1]===t.length,`Length of yTickLabels (${t.length}) must match number of columns (${i[1]})`)}t.heatmap=function(e,t,n={}){return i(this,void 0,void 0,function*(){const r=Object.assign({},h,n),s=c.getDrawArea(e);let p=t.values;r.rowMajor&&(p=yield function(e){return i(this,void 0,void 0,function*(){let t,n;e instanceof o.Tensor?(t=e.shape,n=e.transpose()):(t=[e.length,e[0].length],n=o.tidy(()=>o.tensor2d(e).transpose())),u.assert(2===n.rank,"Input to renderHeatmap must be a 2d array or Tensor2d");const i=yield n.array();n.dispose();const r=[i.length,i[0].length];return u.assert(t[0]===r[1]&&t[1]===r[0],`Unexpected transposed shape. Original ${t} : Transposed ${r}`),i})}(t.values));const{xTickLabels:f,yTickLabels:m}=t;if(null!=f){d(p,f,0)}if(null!=m){d(p,m,1)}const g="@tfidx@",_=[];if(p instanceof o.Tensor){u.assert(2===p.rank,"Input to renderHeatmap must be a 2d array or Tensor2d");const e=yield p.data(),[t,n]=p.shape;for(let i=0;i<t;i++){const t=f?`${f[i]}${g}${i}`:i;for(let r=0;r<n;r++){const s=m?`${m[r]}${g}${r}`:r,o=e[i*n+r];_.push({x:t,y:s,value:o})}}}else{const e=p;for(let t=0;t<e.length;t++){const n=f?`${f[t]}${g}${t}`:t;for(let i=0;i<e[t].length;i++){const r=m?`${m[i]}${g}${i}`:i,s=e[t][i];_.push({x:n,y:r,value:s})}}}const y={actions:!1,mode:"vega-lite",defaultStyle:!1},v={width:r.width||l.getDefaultWidth(s),height:r.height||l.getDefaultHeight(s),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},config:{axis:{labelFontSize:r.fontSize,titleFontSize:r.fontSize},text:{fontSize:r.fontSize},legend:{labelFontSize:r.fontSize,titleFontSize:r.fontSize},scale:{bandPaddingInner:0,bandPaddingOuter:0}},data:{values:_},mark:{type:"rect",tooltip:!0},encoding:{x:{field:"x",type:r.xType,title:r.xLabel,sort:!1},y:{field:"y",type:r.yType,title:r.yLabel,sort:!1},fill:{field:"value",type:"quantitative"}}},b=`${g}\\d+$`,T=new RegExp(b);let x;switch(f&&(v.encoding.x.axis={labelExpr:`replace(datum.value, regexp(/${b}/), '')`}),m&&(v.encoding.y.axis={labelExpr:`replace(datum.value, regexp(/${b}/), '')`}),(f||m)&&(y.tooltip={sanitize:e=>String(e).replace(T,"")}),r.colorMap){case"blues":x=["#f7fbff","#4292c6"];break;case"greyscale":x=["#000000","#ffffff"];break;default:x="viridis"}if("viridis"!==x){v.encoding.fill.scale={range:x}}if(r.domain){const e=v.encoding.fill;null!=e.scale?e.scale=Object.assign({},e.scale,{domain:r.domain}):e.scale={domain:r.domain}}yield a.default(s,v,y)})};const h={xLabel:null,yLabel:null,xType:"ordinal",yType:"ordinal",colorMap:"viridis",fontSize:12,domain:null,rowMajor:!1}},45877:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=n(34410),o=r(n(45780)),a=n(88227),l=n(32729),u=n(19827),c={maxBins:12,fontSize:11};t.histogram=function(e,t,n={}){return i(this,void 0,void 0,function*(){const i=function(e){if(null==e.length)throw new Error("input data must be an array");if(0===e.length)return[];if("object"==typeof e[0]){if(null==e[0].value)throw new Error("input data must have a value field");return e}{const t=Array(e.length);for(let n=0;n<e.length;n++)t[n]={value:e[n]};return t}}(t),r=Object.assign({},c,n),d=a.subSurface(e,"histogram");if(!1!==n.stats){const t=a.subSurface(e,"stats",{prepend:!0});let o;o=n.stats?n.stats:l.arrayStats(i.map(e=>e.value)),function(e,t,n){const i=s.format(",.4~f"),r=s.format(".4~p"),o=[],a=[];null!=e.numVals&&(o.push("Num Vals"),a.push(i(e.numVals)));null!=e.min&&(o.push("Min"),a.push(i(e.min)));null!=e.max&&(o.push("Max"),a.push(i(e.max)));if(null!=e.numZeros){o.push("# Zeros");let t="";e.numVals&&(t=e.numZeros>0?`(${r(e.numZeros/e.numVals)})`:""),a.push(`${i(e.numZeros)} ${t}`)}if(null!=e.numNans){o.push("# NaNs");let t="";e.numVals&&(t=e.numNans>0?`(${r(e.numNans/e.numVals)})`:""),a.push(`${i(e.numNans)} ${t}`)}if(null!=e.numInfs){o.push("# Infinity");let t="";e.numVals&&(t=e.numInfs>0?`(${r(e.numInfs/e.numVals)})`:""),a.push(`${i(e.numInfs)} ${t}`)}u.table(t,{headers:o,values:[a]},n)}(o,t,{fontSize:r.fontSize})}if(0===i.length)return;const h=[];for(let e=0;e<i.length;e++){const t=i[e].value;null!=t&&isFinite(t)&&h.push(i[e])}const p={width:r.width||a.getDefaultWidth(d),height:r.height||a.getDefaultHeight(d),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},data:{values:h},mark:{type:"bar",tooltip:!0},config:{axis:{labelFontSize:r.fontSize,titleFontSize:r.fontSize},text:{fontSize:r.fontSize},legend:{labelFontSize:r.fontSize,titleFontSize:r.fontSize}},encoding:{x:{bin:{maxbins:r.maxBins},field:"value",type:"quantitative"},y:{aggregate:"count",type:"quantitative"},color:{value:r.color||"#001B44"}}};return o.default(d,p,{actions:!1,mode:"vega-lite",defaultStyle:!1})})}},44857:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(n(45780)),o=n(88227),a=n(56286),l=n(56857);t.linechart=function(e,t,n={}){return i(this,void 0,void 0,function*(){const i=Array.isArray(t.values[0])?t.values:[t.values],r=i[0].length,c=t.series?t.series:i.map((e,t)=>`Series ${t+1}`);a.assert(c.length===i.length,"Must have an equal number of series labels as there are data series"),null!=n.seriesColors&&a.assert(n.seriesColors.length===i.length,"Must have an equal number of series colors as there are data series");const d=[];for(let e=0;e<r;e++){const t={x:e};c.forEach((n,r)=>{const s=i[r][e].y;t[n]=s,t[`${n}-name`]=n}),d.push(t)}const h=Object.assign({},u,n),p={x:{field:"x",type:h.xType,title:h.xLabel},tooltip:[{field:"x",type:"quantitative"},...c.map(e=>({field:e,type:"quantitative"}))]},f=c.map(e=>({data:void 0,mark:{type:"line",clip:!0},encoding:{y:{field:e,type:h.yType,title:h.yLabel,scale:h.zoomToFit?{zero:!1}:null!=h.yAxisDomain?{domain:h.yAxisDomain}:void 0},color:{field:`${e}-name`,type:"nominal",legend:{values:c,title:null},scale:{range:h.seriesColors}}}})),m=l.getDrawArea(e),g={width:h.width||o.getDefaultWidth(m),height:h.height||o.getDefaultHeight(m),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},config:{axis:{labelFontSize:h.fontSize,titleFontSize:h.fontSize},text:{fontSize:h.fontSize},legend:{labelFontSize:h.fontSize,titleFontSize:h.fontSize}},data:{values:d},encoding:p,layer:[...f,{mark:"rule",selection:{hover:{type:"single",on:"mouseover",nearest:!0,clear:"mouseout"}},encoding:{color:{value:"grey",condition:{selection:{not:"hover"},value:"transparent"}}}}]};return yield s.default(m,g,{actions:!1,mode:"vega-lite",defaultStyle:!1}),Promise.resolve()})};const u={xLabel:"x",yLabel:"y",xType:"quantitative",yType:"quantitative",zoomToFit:!1,fontSize:11}},56857:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(65759),s=n(4701);t.getDrawArea=function(e){if(e instanceof HTMLElement)return e;if(r.isSurface(e))return e.drawArea;if(r.isSurfaceInfo(e)){return s.visor().surface({name:e.name,tab:e.tab,styles:e.styles}).drawArea}throw new Error("Not a drawable")},t.shallowEquals=function(e,t){const n=Object.getOwnPropertyNames(e),i=Object.getOwnPropertyNames(t);if(n.length!==i.length)return!1;for(let i=0;i<n.length;i++){const r=n[i];if(e[r]!==t[r])return!1}return!0},t.nextFrame=function(){return i(this,void 0,void 0,function*(){yield new Promise(e=>requestAnimationFrame(e))})}},80898:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=r(n(45780)),o=n(88227),a=n(56286),l=n(56857);t.scatterplot=function(e,t,n={}){return i(this,void 0,void 0,function*(){let i=t.values;const r=null==t.series?[]:t.series;i=Array.isArray(i[0])?i:[i];const c=[];i.forEach((e,t)=>{const n=null!=r[t]?r[t]:`Series ${t+1}`,i=e.map(e=>Object.assign({},e,{series:n}));c.push(...i)}),null!=n.seriesColors&&a.assert(n.seriesColors.length===i.length,"Must have an equal number of series colors as there are data series");const d=l.getDrawArea(e),h=Object.assign({},u,n),p={width:h.width||o.getDefaultWidth(d),height:h.height||o.getDefaultHeight(d),padding:0,autosize:{type:"fit",contains:"padding",resize:!0},config:{axis:{labelFontSize:h.fontSize,titleFontSize:h.fontSize},text:{fontSize:h.fontSize},legend:{labelFontSize:h.fontSize,titleFontSize:h.fontSize}},data:{values:c},mark:{type:"point",clip:!0,tooltip:{content:"data"}},encoding:{x:{field:"x",type:h.xType,title:h.xLabel,scale:h.zoomToFit?{zero:!1}:null!=h.xAxisDomain?{domain:h.xAxisDomain}:void 0},y:{field:"y",type:h.yType,title:h.yLabel,scale:h.zoomToFit?{zero:!1}:null!=h.yAxisDomain?{domain:h.yAxisDomain}:void 0},color:{field:"series",type:"nominal",scale:{range:h.seriesColors}},shape:{field:"series",type:"nominal"}}};return yield s.default(d,p,{actions:!1,mode:"vega-lite",defaultStyle:!1}),Promise.resolve()})};const u={xLabel:"x",yLabel:"y",xType:"quantitative",yType:"quantitative",zoomToFit:!1,fontSize:11}},19827:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(34410),r=n(90716),s=n(38205),o=n(56857);t.table=function(e,t,n={}){if(t&&null==t.headers)throw new Error('Data to render must have a "headers" property');if(t&&null==t.values)throw new Error('Data to render must have a "values" property');const l=o.getDrawArea(e),u=Object.assign({},a,n);let c=r.select(l).select("table.tf-table");const d=s.css({fontSize:u.fontSize||".875rem",width:"100%",maxWidth:"64rem",marginRight:"auto",marginLeft:"auto"});if(0===c.size()&&(c=r.select(l).append("table"),c.attr("class",` ${d} tf-table`),c.append("thead").append("tr"),c.append("tbody")),1!==c.size())throw new Error("Error inserting table");const h=s.css({fontWeight:"600",borderBottomStyle:"solid",borderBottomWidth:"1px",borderColor:"rgba( 0, 0, 0, .2 )",textAlign:"left",paddingBottom:"1rem",paddingRight:"1rem",backgroundColor:"#fff"}),p=c.select("thead").select("tr").selectAll("th").data(t.headers),f=p.enter().append("th").attr("class",`${h}`);p.merge(f).html(e=>e),p.exit().remove();const m=i.format(",.4~f"),g=c.select("tbody").selectAll("tr").data(t.values),_=g.enter().append("tr"),y=s.css({padding:"0.25rem",borderBottomStyle:"solid",borderBottomWidth:"1px",borderColor:"rgba( 0, 0, 0, .2 )"}),v=g.merge(_).selectAll("td").data(e=>e),b=v.enter().append("td").attr("class",`${y}`);v.merge(b).html(e=>"number"==typeof e?m(e):e),v.exit().remove(),g.exit().remove()};const a={fontSize:14}},10062:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(44857),s=n(56857),o=n(88227);function a(e,t,n,a={}){return i(this,void 0,void 0,function*(){const i=s.getDrawArea(e),c={};for(const e of n)if(/val_/.test(e)){const i=e.replace("val_","");l(c,i);const r=u(t,e,n.indexOf(e));c[i].series.push(e),c[i].values.push(r)}else{const i=u(t,e,n.indexOf(e));l(c,e),c[e].series.push(e),c[e].values.push(i)}const d=Object.keys(c),h=Object.assign({},{xLabel:"Iteration",yLabel:"Value"},a),p=[];for(const e of d){const t=o.subSurface(i,e),n=c[e].series,s=c[e].values;n.every(e=>Boolean(e.match("acc")))&&(h.zoomToFitAccuracy?h.zoomToFit=!0:(h.yAxisDomain=[0,1],delete h.zoomToFit));const a=r.linechart(t,{values:s,series:n},h);p.push(a)}yield Promise.all(p)})}function l(e,t){null==e[t]&&(e[t]={series:[],values:[]})}function u(e,t,n){if(Array.isArray(e)){const i=Array.isArray(e[0])?e[n]:e,r=[];for(let e=0;e<i.length;e++){const n=i[e];r.push({x:e,y:n[t]})}return r}return e.history[t].map((e,t)=>({x:t,y:e}))}function c(e,t,n){return null==e[t]&&(e[t]={}),null==e[t][n]&&(e[t][n]=[]),e[t][n]}t.history=a,t.fitCallbacks=function(e,t,n={}){const r={},l=n.callbacks||["onEpochEnd","onBatchEnd"],u=s.getDrawArea(e),d=Object.assign({},n);delete d.callbacks;const h={};return l.forEach(e=>{h[e]=function(e){return(n,l)=>i(this,void 0,void 0,function*(){/batch/i.test(e)?d.xLabel="Batch":/epoch/i.test(e)&&(d.xLabel="Epoch");const n=[],i=[];for(const s of t)if(null!=l[s]){i.push(s);const t=c(r,e,s);t.push({[s]:l[s]}),n.push(t)}a(o.subSurface(u,e,{title:e}),n,i,d),yield s.nextFrame()})}(e)}),h}},63559:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(45877),s=n(56857),o=n(19827),a=n(88227),l=n(32729);function u(e){let t;if(Array.isArray(e.outputShape[0])){t=`[${e.outputShape.map(e=>c(e)).join(", ")}]`}else t=c(e.outputShape);return{name:e.name,trainable:e.trainable,parameters:e.countParams(),outputShape:t}}function c(e){const t=e.slice();return 0===t.length?"Scalar":(null===t[0]&&(t[0]="batch"),`[${t.join(",")}]`)}t.modelSummary=function(e,t){return i(this,void 0,void 0,function*(){const n=s.getDrawArea(e),i=function(e){return{layers:e.layers.map(u)}}(t),r=i.layers.map(e=>[e.name,e.outputShape,e.parameters,e.trainable]);o.table(n,{headers:["Layer Name","Output Shape","# Of Params","Trainable"],values:r})})},t.layer=function(e,t){return i(this,void 0,void 0,function*(){const n=s.getDrawArea(e),u=yield function(e){return i(this,void 0,void 0,function*(){const t=e.getWeights(),n=e.weights,i=t.map(l.tensorStats),r=yield Promise.all(i),s=t.map(e=>e.shape);return t.map((e,t)=>({name:n[t].name,stats:r[t],shape:c(s[t]),weight:e}))})}(t),d=a.subSurface(n,"layer-weights-info"),h=u.map(e=>[e.name,e.shape,e.stats.min,e.stats.max,e.weight.size,e.stats.numZeros,e.stats.numNans,e.stats.numInfs]);o.table(d,{headers:["Weight Name","Shape","Min","Max","# Params","# Zeros","# NaNs","# Infinity"],values:h});const p=a.subSurface(n,"select-layer"),f=a.subSurface(n,"param-distribution");!function(e,t,n){const i=`\n <select>\n ${e.map(e=>`<option value=${e}>${e}</option>`)}\n </select>\n `,r=`<div><button>Show Values Distribution for:</button>${i}</div>`;t.innerHTML=r;const s=t.querySelector("button"),o=t.querySelector("select");s.addEventListener("click",()=>{n(o.selectedOptions[0].label)})}(u.map(e=>e.name),p,e=>i(this,void 0,void 0,function*(){const t=u.filter(t=>t.name===e)[0],n=yield t.weight.data();r.histogram(f,n,{height:150,width:460,stats:!1})}))})}},15727:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(56857),s=n(19827);t.perClassAccuracy=function(e,t,n){return i(this,void 0,void 0,function*(){const i=r.getDrawArea(e),o=[];for(let e=0;e<t.length;e++){const i=n?n[e]:e.toString(),r=t[e];o.push([i,r.accuracy,r.count])}return s.table(i,{headers:["Class","Accuracy","# Samples"],values:o})})}},64853:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(45877),s=n(56857),o=n(32729);t.valuesDistribution=function(e,t){return i(this,void 0,void 0,function*(){const n=s.getDrawArea(e),i=yield o.tensorStats(t),a=yield t.data();r.histogram(n,a,{height:150,stats:i})})}},65759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSurfaceInfo=function(e){return null!=e.name},t.isSurface=function(e){return e.drawArea instanceof HTMLElement}},88227:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(38205),r=n(56857),s={prepend:!1};t.subSurface=function(e,t,n={}){const o=r.getDrawArea(e),a=i.css({"& canvas":{display:"block"},marginTop:".5rem",marginBottom:".5rem"}),l=i.css({backgroundColor:"white",display:"inline-block",boxSizing:"border-box",borderBottom:"1px solid #357EDD",lineHeight:"2em",padding:"0 10px 0 10px",marginBottom:"20px",fontWeight:"600",textAlign:"left"}),u=Object.assign({},s,n);let c=o.querySelector(`div[data-name=${t}]`);if(!c){if(c=document.createElement("div"),c.setAttribute("class",`${a}`),c.dataset.name=t,u.title){const e=document.createElement("div");e.setAttribute("class",`subsurface-title ${l}`),e.innerText=u.title,c.appendChild(e)}u.prepend?o.insertBefore(c,o.firstChild):o.appendChild(c)}return c},t.getDefaultWidth=function(e){let t=0,n=e;for(;n&&0===n.clientWidth;)n=n.parentElement,t=50;return n.clientWidth-t},t.getDefaultHeight=function(e){return 0===e.clientHeight?200:e.clientHeight}},32729:function(e,t,n){"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(o,a)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(15838),s=n(56286);t.arrayStats=function(e){if(!Array.isArray(e))throw new Error("input must be an array");if(0===e.length)return{numVals:0,numNans:0,numZeros:0,max:void 0,min:void 0};const t=e.length;let n=-1/0,i=1/0,r=0,s=0,o=0;for(let a=0;a<t;a++){const t=e[a];t>n&&(n=t),t<i&&(i=t),0===t&&(r+=1),isNaN(t)?s+=1:isFinite(t)||(o+=1)}const a={numVals:t,numZeros:r,numNans:s,max:n,min:i,numInfs:o};return a.max===-1/0&&(a.max=NaN),a.min===1/0&&(a.min=NaN),a},t.tensorStats=function(e){return i(this,void 0,void 0,function*(){const[t,n,i]=r.tidy(()=>{const t=r.scalar(0,e.dtype);return[e.min(),e.max(),e.equal(t).sum()]});return Promise.all([e.data(),t.data(),n.data(),i.data()]).then(([e,t,n,i])=>{const r=e.length;let s=0,o=0;for(let t=0;t<r;t++){const n=e[t];isNaN(n)?s+=1:isFinite(n)||(o+=1)}let a=t[0],l=n[0];s===r&&(a=NaN,l=NaN);return{numVals:r,numZeros:i[0],numNans:s,min:a,max:l,numInfs:o}})})},t.confusionMatrix=function(e,t,n,o){return i(this,void 0,void 0,function*(){s.assert(1===e.rank,"labels must be a 1D tensor"),s.assert(1===t.rank,"predictions must be a 1D tensor"),s.assert(e.size===t.size,"labels and predictions must be the same length"),null!=o&&s.assert(o.size===t.size,"labels and predictions must be the same length");const i=e.cast("int32"),a=t.cast("int32");null==n&&(n=r.tidy(()=>r.maximum(i.max(),a.max()).cast("int32").dataSync()[0]+1));let l=Promise.resolve(null);return null!=o&&(l=o.data()),Promise.all([i.data(),a.data(),l]).then(([e,t,i])=>{const r=Array(n).fill(0);for(let e=0;e<n;e++)r[e]=Array(n).fill(0);for(let n=0;n<e.length;n++){const s=e[n],o=t[n];r[s][o]+=null!=i?i[n]:1}return r})})},t.accuracy=function(e,t){return i(this,void 0,void 0,function*(){s.assertShapesMatch(e.shape,t.shape,"Error computing accuracy.");const n=e.equal(t),i=n.mean(),o=(yield i.data())[0];return r.dispose([n,i]),o})},t.perClassAccuracy=function(e,t,n){return i(this,void 0,void 0,function*(){return s.assert(1===e.rank,"labels must be a 1D tensor"),s.assert(1===t.rank,"predictions must be a 1D tensor"),s.assert(e.size===t.size,"labels and predictions must be the same length"),null==n&&(n=r.tidy(()=>r.maximum(e.max(),t.max()).dataSync()[0]+1)),Promise.all([e.data(),t.data()]).then(([e,t])=>{const i=Array(n).fill(0),r=Array(n).fill(0);for(let n=0;n<e.length;n++){const s=e[n],o=t[n];i[s]+=1,s===o&&(r[s]+=1)}const s=[];for(let e=0;e<i.length;e++)s.push({count:i[e],accuracy:0===i[e]?0:r[e]/i[e]});return s})})}},56286:(e,t)=>{"use strict";
/*
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function n(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function i(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=n,t.assertShapesMatch=function(e,t,r=""){n(i(e,t),r+` Shapes ${e} and ${t} must match`)},t.arraysEqual=i,t.DECIMAL_PLACES_TO_CHECK=4},10454:(e,t)=>{"use strict";
/** @license See the LICENSE file. */Object.defineProperty(t,"__esModule",{value:!0});t.version="1.5.1"},4701:(e,t,n)=>{"use strict";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/Object.defineProperty(t,"__esModule",{value:!0});const i=n(25976);let r;const s="tfjs-visor-container";t.visor=function(){if("undefined"==typeof document)throw new Error("No document defined. This library needs a browser/dom to work");if(document.getElementById(s)&&null!=r)return r;let e,t=document.getElementById(s);function n(t,n){let r=null;return e=i.VisorComponent.render(t,e,{ref:e=>r=e,surfaceList:Array.from(n.values())}),r}null==t&&(t=document.createElement("div"),t.id=s,document.body.appendChild(t));const a=new Map,l=n(t,a);return r=new o(l,t,a,n),r};class o{constructor(e,t,n,i){this.visorComponent=e,this.el=t,this.surfaceList=n,this.renderVisor=i}surface(e){const{name:t}=e,n=null==e.tab?"Visor":e.tab;if(null==t||!("string"==typeof t||t instanceof String))throw new Error("You must pass a config object with a 'name' property to create or retrieve a surface");const i=Object.assign({},e,{tab:n}),r=`${t}-${n}`;return this.surfaceList.has(r)||this.surfaceList.set(r,i),this.renderVisor(this.el,this.surfaceList),this.visorComponent.getSurface(t,n)}isFullscreen(){return this.visorComponent.isFullscreen()}isOpen(){return this.visorComponent.isOpen()}close(){return this.visorComponent.close()}open(){return this.visorComponent.open()}toggle(){return this.visorComponent.toggle()}toggleFullScreen(){return this.visorComponent.toggleFullScreen()}bindKeys(){return this.visorComponent.bindKeys()}unbindKeys(){return this.visorComponent.unbindKeys()}setActiveTab(e){if(!this.visorComponent.state.tabs.has(e))throw new Error(`Tab '${e}' does not exist`);this.visorComponent.setState({activeTab:e})}}t.Visor=o},30153:(e,t,n)=>{"use strict";const{SymbolDispose:i}=n(4184),{AbortError:r,codes:s}=n(66605),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=n(66569),u=n(29700),{ERR_INVALID_ARG_TYPE:c}=s;let d;e.exports.addAbortSignal=function(t,n){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new c(t,"AbortSignal",e)})(t,"signal"),!o(n)&&!a(n))throw new c("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const s=o(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[l](new r(void 0,{cause:e.reason}))};if(e.aborted)s();else{d=d||n(20798).addAbortListener;const r=d(e,s);u(t,r[i])}return t}},1515:(e,t,n)=>{"use strict";const{StringPrototypeSlice:i,SymbolIterator:r,TypedArrayPrototypeSet:s,Uint8Array:o}=n(4184),{Buffer:a}=n(48287),{inspect:l}=n(20798);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let n=this.head,i=0;for(;n;)s(t,n.data,i),i+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[r](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,r=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(t+=s,++r,n.next?this.head=n.next:this.head=this.tail=null):(t+=i(s,0,e),this.head=n,n.data=i(s,e));break}t+=s,e-=s.length,++r}while(null!==(n=n.next));return this.length-=r,t}_getBuffer(e){const t=a.allocUnsafe(e),n=e;let i=this.head,r=0;do{const a=i.data;if(!(e>a.length)){e===a.length?(s(t,a,n-e),++r,i.next?this.head=i.next:this.head=this.tail=null):(s(t,new o(a.buffer,a.byteOffset,e),n-e),this.head=i,i.data=a.slice(e));break}s(t,a,n-e),e-=a.length,++r}while(null!==(i=i.next));return this.length-=r,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},6864:(e,t,n)=>{"use strict";const{pipeline:i}=n(60872),r=n(94992),{destroyer:s}=n(42430),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:u,isTransformStream:c,isWritableStream:d,isReadableStream:h}=n(66569),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:f,ERR_MISSING_ARGS:m}}=n(66605),g=n(29700);e.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return r.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=r.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=r.from(e[t])}for(let n=0;n<e.length;++n)if(o(e[n])||u(e[n])){if(n<e.length-1&&!(a(e[n])||h(e[n])||c(e[n])))throw new f(`streams[${n}]`,t[n],"must be readable");if(n>0&&!(l(e[n])||d(e[n])||c(e[n])))throw new f(`streams[${n}]`,t[n],"must be writable")}let n,_,y,v,b;const T=e[0],x=i(e,function(e){const t=v;v=null,t?t(e):e?b.destroy(e):w||E||b.destroy()}),E=!!(l(T)||d(T)||c(T)),w=!!(a(x)||h(x)||c(x));if(b=new r({writableObjectMode:!(null==T||!T.writableObjectMode),readableObjectMode:!(null==x||!x.readableObjectMode),writable:E,readable:w}),E){if(o(T))b._write=function(e,t,i){T.write(e,t)?i():n=i},b._final=function(e){T.end(),_=e},T.on("drain",function(){if(n){const e=n;n=null,e()}});else if(u(T)){const e=(c(T)?T.writable:T).getWriter();b._write=async function(t,n,i){try{await e.ready,e.write(t).catch(()=>{}),i()}catch(e){i(e)}},b._final=async function(t){try{await e.ready,e.close().catch(()=>{}),_=t}catch(e){t(e)}}}const e=c(x)?x.readable:x;g(e,()=>{if(_){const e=_;_=null,e()}})}if(w)if(o(x))x.on("readable",function(){if(y){const e=y;y=null,e()}}),x.on("end",function(){b.push(null)}),b._read=function(){for(;;){const e=x.read();if(null===e)return void(y=b._read);if(!b.push(e))return}};else if(u(x)){const e=(c(x)?x.readable:x).getReader();b._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!b.push(t))return;if(n)return void b.push(null)}catch{return}}}return b._destroy=function(e,t){e||null===v||(e=new p),y=null,n=null,_=null,null===v?t(e):(v=t,o(x)&&s(x,e))},b}},42430:(e,t,n)=>{"use strict";const i=n(65606),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=n(66605),{Symbol:a}=n(4184),{kIsDestroyed:l,isDestroyed:u,isFinished:c,isServerRequest:d}=n(66569),h=a("kDestroy"),p=a("kConstruct");function f(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function m(e,t,n){let r=!1;function s(t){if(r)return;r=!0;const s=e._readableState,o=e._writableState;f(t,o,s),o&&(o.closed=!0),s&&(s.closed=!0),"function"==typeof n&&n(t),t?i.nextTick(g,e,t):i.nextTick(_,e)}try{e._destroy(t||null,s)}catch(t){s(t)}}function g(e,t){y(e,t),_(e)}function _(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=n&&n.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function y(e,t){const n=e._readableState,i=e._writableState;null!=i&&i.errorEmitted||null!=n&&n.errorEmitted||(i&&(i.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function v(e,t,n){const r=e._readableState,s=e._writableState;if(null!=s&&s.destroyed||null!=r&&r.destroyed)return this;null!=r&&r.autoDestroy||null!=s&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),r&&!r.errored&&(r.errored=t),n?i.nextTick(y,e,t):y(e,t))}function b(e){let t=!1;function n(n){if(t)return void v(e,null!=n?n:new s);t=!0;const r=e._readableState,o=e._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(h,n):n?v(e,n,!0):i.nextTick(T,e)}try{e._construct(e=>{i.nextTick(n,e)})}catch(e){i.nextTick(n,e)}}function T(e){e.emit(p)}function x(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function w(e,t){e.emit("error",t),i.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const n=e._readableState,r=e._writableState;n&&(n.constructed=!1),r&&(r.constructed=!1),e.once(p,t),e.listenerCount(p)>1||i.nextTick(b,e)},destroyer:function(e,t){e&&!u(e)&&(t||c(e)||(t=new o),d(e)?(e.socket=null,e.destroy(t)):x(e)?e.abort():x(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?i.nextTick(w,e,t):i.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,i=this._writableState,s=i||n;return null!=i&&i.destroyed||null!=n&&n.destroyed?("function"==typeof t&&t(),this):(f(e,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),s.constructed?m(this,e,t):this.once(h,function(n){m(this,r(n,e),t)}),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},94992:(e,t,n)=>{"use strict";const{ObjectDefineProperties:i,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:s,ObjectSetPrototypeOf:o}=n(4184);e.exports=u;const a=n(76566),l=n(10394);o(u.prototype,a.prototype),o(u,a);{const e=s(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];u.prototype[n]||(u.prototype[n]=l.prototype[n])}}function u(e){if(!(this instanceof u))return new u(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let c,d;function h(){return void 0===c&&(c={}),c}i(u.prototype,{writable:{__proto__:null,...r(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...r(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...r(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...r(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...r(l.prototype,"writableLength")},writableFinished:{__proto__:null,...r(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...r(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...r(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...r(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),u.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},u.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},u.from=function(e){return d||(d=n(34512)),d(e,"body")}},34512:(e,t,n)=>{const i=n(65606),r=n(48287),{isReadable:s,isWritable:o,isIterable:a,isNodeStream:l,isReadableNodeStream:u,isWritableNodeStream:c,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:p}=n(66569),f=n(29700),{AbortError:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:_}}=n(66605),{destroyer:y}=n(42430),v=n(94992),b=n(76566),T=n(10394),{createDeferredPromise:x}=n(20798),E=n(3182),w=globalThis.Blob||r.Blob,I=void 0!==w?function(e){return e instanceof w}:function(e){return!1},A=globalThis.AbortController||n(25568).AbortController,{FunctionPrototypeCall:S}=n(4184);class C extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function O(e){const t=e.readable&&"function"!=typeof e.readable.read?b.wrap(e.readable):e.readable,n=e.writable;let i,r,a,l,u,c=!!s(t),d=!!o(n);function h(e){const t=l;l=null,t?t(e):e&&u.destroy(e)}return u=new C({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:c,writable:d}),d&&(f(n,e=>{d=!1,e&&y(t,e),h(e)}),u._write=function(e,t,r){n.write(e,t)?r():i=r},u._final=function(e){n.end(),r=e},n.on("drain",function(){if(i){const e=i;i=null,e()}}),n.on("finish",function(){if(r){const e=r;r=null,e()}})),c&&(f(t,e=>{c=!1,e&&y(t,e),h(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){u.push(null)}),u._read=function(){for(;;){const e=t.read();if(null===e)return void(a=u._read);if(!u.push(e))return}}),u._destroy=function(e,s){e||null===l||(e=new m),a=null,i=null,r=null,null===l?s(e):(l=s,y(n,e),y(t,e))},u}e.exports=function e(t,n){if(d(t))return t;if(u(t))return O({readable:t});if(c(t))return O({writable:t});if(l(t))return O({writable:!1,readable:!1});if(h(t))return O({readable:b.fromWeb(t)});if(p(t))return O({writable:T.fromWeb(t)});if("function"==typeof t){const{value:e,write:r,final:s,destroy:o}=function(e){let{promise:t,resolve:n}=x();const r=new A,s=r.signal,o=e(async function*(){for(;;){const e=t;t=null;const{chunk:r,done:o,cb:a}=await e;if(i.nextTick(a),o)return;if(s.aborted)throw new m(void 0,{cause:s.reason});({promise:t,resolve:n}=x()),yield r}}(),{signal:s});return{value:o,write(e,t,i){const r=n;n=null,r({chunk:e,done:!1,cb:i})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){r.abort(),t(e)}}}(t);if(a(e))return E(C,e,{objectMode:!0,write:r,final:s,destroy:o});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const n=S(l,e,e=>{if(null!=e)throw new _("nully","body",e)},e=>{y(t,e)});return t=new C({objectMode:!0,readable:!1,write:r,final(e){s(async()=>{try{await n,i.nextTick(e,null)}catch(t){i.nextTick(e,t)}})},destroy:o})}throw new _("Iterable, AsyncIterable or AsyncFunction",n,e)}if(I(t))return e(t.arrayBuffer());if(a(t))return E(C,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&p(null==t?void 0:t.writable))return C.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable)){return O({readable:null!=t&&t.readable?u(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?c(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0})}const r=null==t?void 0:t.then;if("function"==typeof r){let e;return S(r,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{y(e,t)}),e=new C({objectMode:!0,writable:!1,read(){}})}throw new g(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},29700:(e,t,n)=>{const i=n(65606),{AbortError:r,codes:s}=n(66605),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=s,{kEmptyObject:l,once:u}=n(20798),{validateAbortSignal:c,validateFunction:d,validateObject:h,validateBoolean:p}=n(86283),{Promise:f,PromisePrototypeThen:m,SymbolDispose:g}=n(4184),{isClosed:_,isReadable:y,isReadableNodeStream:v,isReadableStream:b,isReadableFinished:T,isReadableErrored:x,isWritable:E,isWritableNodeStream:w,isWritableStream:I,isWritableFinished:A,isWritableErrored:S,isNodeStream:C,willEmitClose:O,kIsClosedPromise:M}=n(66569);let k;const R=()=>{};function N(e,t,s){var p,f;if(2===arguments.length?(s=t,t=l):null==t?t=l:h(t,"options"),d(s,"callback"),c(t.signal,"options.signal"),s=u(s),b(e)||I(e))return function(e,t,s){let o=!1,a=R;if(t.signal)if(a=()=>{o=!0,s.call(e,new r(void 0,{cause:t.signal.reason}))},t.signal.aborted)i.nextTick(a);else{k=k||n(20798).addAbortListener;const i=k(t.signal,a),r=s;s=u((...t)=>{i[g](),r.apply(e,t)})}const l=(...t)=>{o||i.nextTick(()=>s.apply(e,t))};return m(e[M].promise,l,l),R}(e,t,s);if(!C(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const N=null!==(p=t.readable)&&void 0!==p?p:v(e),D=null!==(f=t.writable)&&void 0!==f?f:w(e),F=e._writableState,L=e._readableState,P=()=>{e.writable||U()};let B=O(e)&&v(e)===N&&w(e)===D,$=A(e,!1);const U=()=>{$=!0,e.destroyed&&(B=!1),(!B||e.readable&&!N)&&(N&&!V||s.call(e))};let V=T(e,!1);const z=()=>{V=!0,e.destroyed&&(B=!1),(!B||e.writable&&!D)&&(D&&!$||s.call(e))},j=t=>{s.call(e,t)};let Y=_(e);const G=()=>{Y=!0;const t=S(e)||x(e);return t&&"boolean"!=typeof t?s.call(e,t):N&&!V&&v(e,!0)&&!T(e,!1)?s.call(e,new a):!D||$||A(e,!1)?void s.call(e):s.call(e,new a)},H=()=>{Y=!0;const t=S(e)||x(e);if(t&&"boolean"!=typeof t)return s.call(e,t);s.call(e)},W=()=>{e.req.on("finish",U)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?D&&!F&&(e.on("end",P),e.on("close",P)):(e.on("complete",U),B||e.on("abort",G),e.req?W():e.on("request",W)),B||"boolean"!=typeof e.aborted||e.on("aborted",G),e.on("end",z),e.on("finish",U),!1!==t.error&&e.on("error",j),e.on("close",G),Y?i.nextTick(G):null!=F&&F.errorEmitted||null!=L&&L.errorEmitted?B||i.nextTick(H):(N||B&&!y(e)||!$&&!1!==E(e))&&(D||B&&!E(e)||!V&&!1!==y(e))?L&&e.req&&e.aborted&&i.nextTick(H):i.nextTick(H);const X=()=>{s=R,e.removeListener("aborted",G),e.removeListener("complete",U),e.removeListener("abort",G),e.removeListener("request",W),e.req&&e.req.removeListener("finish",U),e.removeListener("end",P),e.removeListener("close",P),e.removeListener("finish",U),e.removeListener("end",z),e.removeListener("error",j),e.removeListener("close",G)};if(t.signal&&!Y){const o=()=>{const n=s;X(),n.call(e,new r(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)i.nextTick(o);else{k=k||n(20798).addAbortListener;const i=k(t.signal,o),r=s;s=u((...t)=>{i[g](),r.apply(e,t)})}}return X}e.exports=N,e.exports.finished=function(e,t){var n;let i=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(p(t.cleanup,"cleanup"),i=t.cleanup),new f((n,r)=>{const s=N(e,t,e=>{i&&s(),e?r(e):n()})})}},3182:(e,t,n)=>{"use strict";const i=n(65606),{PromisePrototypeThen:r,SymbolAsyncIterator:s,SymbolIterator:o}=n(4184),{Buffer:a}=n(48287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:u}=n(66605).codes;e.exports=function(e,t,n){let c,d;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[s])d=!0,c=t[s]();else{if(!t||!t[o])throw new l("iterable",["Iterable"],t);d=!1,c=t[o]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let p=!1;return h._read=function(){p||(p=!0,async function(){for(;;){try{const{value:e,done:t}=d?await c.next():c.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw p=!1,new u;if(h.push(t))continue;p=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){r(async function(e){const t=null!=e,n="function"==typeof c.throw;if(t&&n){const{value:t,done:n}=await c.throw(e);if(await t,n)return}if("function"==typeof c.return){const{value:e}=await c.return();await e}}(e),()=>i.nextTick(t,e),n=>i.nextTick(t,n||e))},h}},32913:(e,t,n)=>{"use strict";const{ArrayIsArray:i,ObjectSetPrototypeOf:r}=n(4184),{EventEmitter:s}=n(37007);function o(e){s.call(this,e)}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?i(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}r(o.prototype,s.prototype),r(o,s),o.prototype.pipe=function(e,t){const n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function r(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",r),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",u));let o=!1;function l(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){d(),0===s.listenerCount(this,"error")&&this.emit("error",e)}function d(){n.removeListener("data",i),e.removeListener("drain",r),n.removeListener("end",l),n.removeListener("close",u),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",d),n.removeListener("close",d),e.removeListener("close",d)}return a(n,"error",c),a(e,"error",c),n.on("end",d),n.on("close",d),e.on("close",d),e.emit("pipe",n),e},e.exports={Stream:o,prependListener:a}},65589:(e,t,n)=>{"use strict";const i=globalThis.AbortController||n(25568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=n(66605),{validateAbortSignal:u,validateInteger:c,validateObject:d}=n(86283),h=n(4184).Symbol("kWeak"),p=n(4184).Symbol("kResistStopPropagation"),{finished:f}=n(29700),m=n(6864),{addAbortSignalNoValidate:g}=n(30153),{isWritable:_,isNodeStream:y}=n(66569),{deprecate:v}=n(20798),{ArrayPrototypePush:b,Boolean:T,MathFloor:x,Number:E,NumberIsNaN:w,Promise:I,PromiseReject:A,PromiseResolve:S,PromisePrototypeThen:C,Symbol:O}=n(4184),M=O("kEmpty"),k=O("kEof");function R(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal");let i=1;null!=(null==t?void 0:t.concurrency)&&(i=x(t.concurrency));let r=i-1;return null!=(null==t?void 0:t.highWaterMark)&&(r=x(t.highWaterMark)),c(i,"options.concurrency",1),c(r,"options.highWaterMark",0),r+=i,async function*(){const s=n(20798).AbortSignalAny([null==t?void 0:t.signal].filter(T)),o=this,a=[],u={signal:s};let c,d,h=!1,p=0;function f(){h=!0,m()}function m(){p-=1,g()}function g(){d&&!h&&p<i&&a.length<r&&(d(),d=null)}!async function(){try{for await(let t of o){if(h)return;if(s.aborted)throw new l;try{if(t=e(t,u),t===M)continue;t=S(t)}catch(e){t=A(e)}p+=1,C(t,m,f),a.push(t),c&&(c(),c=null),!h&&(a.length>=r||p>=i)&&await new I(e=>{d=e})}a.push(k)}catch(e){const t=A(e);C(t,m,f),a.push(t)}finally{h=!0,c&&(c(),c=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===k)return;if(s.aborted)throw new l;e!==M&&(yield e),a.shift(),g()}await new I(e=>{c=e})}}finally{h=!0,d&&(d(),d=null)}}.call(this)}async function N(e,t=void 0){for await(const n of D.call(this,e,t))return!0;return!1}function D(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return R.call(this,async function(t,n){return await e(t,n)?t:M},t)}class F extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=E(e),w(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v(function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal"),async function*(){let t=0;for await(const i of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,i]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;e--<=0&&(yield n)}}.call(this)},filter:D,flatMap:function(e,t){const n=R.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:R,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),e=L(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var i;if(null!=t&&null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&u(t.signal,"options.signal"),y(e)&&!_(e))throw new r("stream",e,"must be writable");const n=m(this,e);return null!=t&&t.signal&&g(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await N.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);for await(const n of R.call(this,async function(t,n){return await e(t,n),M},t));},reduce:async function(e,t,n){var r;if("function"!=typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=n&&d(n,"options"),null!=(null==n?void 0:n.signal)&&u(n.signal,"options.signal");let o=arguments.length>1;if(null!=n&&null!==(r=n.signal)&&void 0!==r&&r.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await f(this.destroy(e)),e}const a=new i,c=a.signal;if(null!=n&&n.signal){const e={once:!0,[h]:this,[p]:!0};n.signal.addEventListener("abort",()=>a.abort(),e)}let m=!1;try{for await(const i of this){var g;if(m=!0,null!=n&&null!==(g=n.signal)&&void 0!==g&&g.aborted)throw new l;o?t=await e(t,i,{signal:c}):(t=i,o=!0)}if(!m&&!o)throw new F}finally{a.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&u(e.signal,"options.signal");const t=[];for await(const i of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});b(t,i)}return t},some:N,find:async function(e,t){for await(const n of D.call(this,e,t))return n}}},6898:(e,t,n)=>{"use strict";const{ObjectSetPrototypeOf:i}=n(4184);e.exports=s;const r=n(50208);function s(e){if(!(this instanceof s))return new s(e);r.call(this,e)}i(s.prototype,r.prototype),i(s,r),s.prototype._transform=function(e,t,n){n(null,e)}},60872:(e,t,n)=>{const i=n(65606),{ArrayIsArray:r,Promise:s,SymbolAsyncIterator:o,SymbolDispose:a}=n(4184),l=n(29700),{once:u}=n(20798),c=n(42430),d=n(94992),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:f,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:_},AbortError:y}=n(66605),{validateFunction:v,validateAbortSignal:b}=n(86283),{isIterable:T,isReadable:x,isReadableNodeStream:E,isNodeStream:w,isTransformStream:I,isWebStream:A,isReadableStream:S,isReadableFinished:C}=n(66569),O=globalThis.AbortController||n(25568).AbortController;let M,k,R;function N(e,t,n){let i=!1;e.on("close",()=>{i=!0});return{destroy:t=>{i||(i=!0,c.destroyer(e,t||new g("pipe")))},cleanup:l(e,{readable:t,writable:n},e=>{i=!e})}}function D(e){if(T(e))return e;if(E(e))return async function*(e){k||(k=n(76566));yield*k.prototype[o].call(e)}(e);throw new p("val",["Readable","Iterable","AsyncIterable"],e)}async function F(e,t,n,{end:i}){let r,o=null;const a=e=>{if(e&&(r=e),o){const e=o;o=null,e()}},u=()=>new s((e,t)=>{r?t(r):o=()=>{r?t(r):e()}});t.on("drain",a);const c=l(t,{readable:!1},a);try{t.writableNeedDrain&&await u();for await(const n of e)t.write(n)||await u();i&&(t.end(),await u()),n()}catch(e){n(r!==e?h(r,e):e)}finally{c(),t.off("drain",a)}}async function L(e,t,n,{end:i}){I(t)&&(t=t.writable);const r=t.getWriter();try{for await(const t of e)await r.ready,r.write(t).catch(()=>{});await r.ready,i&&await r.close(),n()}catch(e){try{await r.abort(e),n(e)}catch(e){n(e)}}}function P(e,t,s){if(1===e.length&&r(e[0])&&(e=e[0]),e.length<2)throw new m("streams");const o=new O,l=o.signal,u=null==s?void 0:s.signal,c=[];function h(){U(new y)}let g,_,v;b(u,"options.signal"),R=R||n(20798).addAbortListener,u&&(g=R(u,h));const C=[];let k,P=0;function $(e){U(e,0===--P)}function U(e,n){var r;if(!e||_&&"ERR_STREAM_PREMATURE_CLOSE"!==_.code||(_=e),_||n){for(;C.length;)C.shift()(_);null===(r=g)||void 0===r||r[a](),o.abort(),n&&(_||c.forEach(e=>e()),i.nextTick(t,_,v))}}for(let Y=0;Y<e.length;Y++){const G=e[Y],H=Y<e.length-1,W=Y>0,X=H||!1!==(null==s?void 0:s.end),q=Y===e.length-1;if(w(G)){if(X){const{destroy:K,cleanup:Z}=N(G,H,W);C.push(K),x(G)&&q&&c.push(Z)}function V(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&$(e)}G.on("error",V),x(G)&&q&&c.push(()=>{G.removeListener("error",V)})}if(0===Y)if("function"==typeof G){if(k=G({signal:l}),!T(k))throw new f("Iterable, AsyncIterable or Stream","source",k)}else k=T(G)||E(G)||I(G)?G:d.from(G);else if("function"==typeof G){var z;if(I(k))k=D(null===(z=k)||void 0===z?void 0:z.readable);else k=D(k);if(k=G(k,{signal:l}),H){if(!T(k,!0))throw new f("AsyncIterable",`transform[${Y-1}]`,k)}else{var j;M||(M=n(6898));const Q=new M({objectMode:!0}),J=null===(j=k)||void 0===j?void 0:j.then;if("function"==typeof J)P++,J.call(k,e=>{v=e,null!=e&&Q.write(e),X&&Q.end(),i.nextTick($)},e=>{Q.destroy(e),i.nextTick($,e)});else if(T(k,!0))P++,F(k,Q,$,{end:X});else{if(!S(k)&&!I(k))throw new f("AsyncIterable or Promise","destination",k);{const ne=k.readable||k;P++,F(ne,Q,$,{end:X})}}k=Q;const{destroy:ee,cleanup:te}=N(k,!1,!0);C.push(ee),q&&c.push(te)}}else if(w(G)){if(E(k)){P+=2;const ie=B(k,G,$,{end:X});x(G)&&q&&c.push(ie)}else if(I(k)||S(k)){const re=k.readable||k;P++,F(re,G,$,{end:X})}else{if(!T(k))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,F(k,G,$,{end:X})}k=G}else if(A(G)){if(E(k))P++,L(D(k),G,$,{end:X});else if(S(k)||T(k))P++,L(k,G,$,{end:X});else{if(!I(k))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,L(k.readable,G,$,{end:X})}k=G}else k=d.from(G)}return(null!=l&&l.aborted||null!=u&&u.aborted)&&i.nextTick(h),k}function B(e,t,n,{end:r}){let s=!1;if(t.on("close",()=>{s||n(new _)}),e.pipe(t,{end:!1}),r){function o(){s=!0,t.end()}C(e)?i.nextTick(o):e.once("end",o)}else n();return l(e,{readable:!0,writable:!1},t=>{const i=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?e.once("end",n).once("error",n):n(t)}),l(t,{readable:!1,writable:!0},n)}e.exports={pipelineImpl:P,pipeline:function(...e){return P(e,u(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},76566:(e,t,n)=>{const i=n(65606),{ArrayPrototypeIndexOf:r,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:u,ObjectSetPrototypeOf:c,Promise:d,SafeSet:h,SymbolAsyncDispose:p,SymbolAsyncIterator:f,Symbol:m}=n(4184);e.exports=W,W.ReadableState=H;const{EventEmitter:g}=n(37007),{Stream:_,prependListener:y}=n(32913),{Buffer:v}=n(48287),{addAbortSignal:b}=n(30153),T=n(29700);let x=n(20798).debuglog("stream",e=>{x=e});const E=n(1515),w=n(42430),{getHighWaterMark:I,getDefaultHighWaterMark:A}=n(19153),{aggregateTwoErrors:S,codes:{ERR_INVALID_ARG_TYPE:C,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_OUT_OF_RANGE:M,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:R},AbortError:N}=n(66605),{validateObject:D}=n(86283),F=m("kPaused"),{StringDecoder:L}=n(98707),P=n(3182);c(W.prototype,_.prototype),c(W,_);const B=()=>{},{errorOrDestroy:$}=w,U=1,V=16,z=32,j=2048,Y=4096;function G(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function H(e,t,i){"boolean"!=typeof i&&(i=t instanceof n(94992)),this.state=j|Y|V|z,e&&e.objectMode&&(this.state|=U),i&&e&&e.readableObjectMode&&(this.state|=U),this.highWaterMark=e?I(this,e,"readableHighWaterMark",i):A(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[F]=null,e&&!1===e.emitClose&&(this.state&=~j),e&&!1===e.autoDestroy&&(this.state&=~Y),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function W(e){if(!(this instanceof W))return new W(e);const t=this instanceof n(94992);this._readableState=new H(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&b(e.signal,this)),_.call(this,e),w.construct(this,()=>{this._readableState.needReadable&&J(this,this._readableState)})}function X(e,t,n,i){x("readableAddChunk",t);const r=e._readableState;let s;if(0===(r.state&U)&&("string"==typeof t?(n=n||r.defaultEncoding,r.encoding!==n&&(i&&r.encoding?t=v.from(t,n).toString(r.encoding):(t=v.from(t,n),n=""))):t instanceof v?n="":_._isUint8Array(t)?(t=_._uint8ArrayToBuffer(t),n=""):null!=t&&(s=new C("chunk",["string","Buffer","Uint8Array"],t))),s)$(e,s);else if(null===t)r.state&=-9,function(e,t){if(x("onEofChunk"),t.ended)return;if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,Q(e))}(e,r);else if(0!==(r.state&U)||t&&t.length>0)if(i)if(4&r.state)$(e,new R);else{if(r.destroyed||r.errored)return!1;q(e,r,t,!0)}else if(r.ended)$(e,new k);else{if(r.destroyed||r.errored)return!1;r.state&=-9,r.decoder&&!n?(t=r.decoder.write(t),r.objectMode||0!==t.length?q(e,r,t,!1):J(e,r)):q(e,r,t,!1)}else i||(r.state&=-9,J(e,r));return!r.ended&&(r.length<r.highWaterMark||0===r.length)}function q(e,t,n,i){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),64&t.state&&Z(e)),J(e,t)}l(H.prototype,{objectMode:G(U),ended:G(2),endEmitted:G(4),reading:G(8),constructed:G(V),sync:G(z),needReadable:G(64),emittedReadable:G(128),readableListening:G(256),resumeScheduled:G(512),errorEmitted:G(1024),emitClose:G(j),autoDestroy:G(Y),destroyed:G(8192),closed:G(16384),closeEmitted:G(32768),multiAwaitDrain:G(65536),readingMore:G(1<<17),dataEmitted:G(1<<18)}),W.prototype.destroy=w.destroy,W.prototype._undestroy=w.undestroy,W.prototype._destroy=function(e,t){t(e)},W.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},W.prototype[p]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new N,this.destroy(e)),new d((t,n)=>T(this,i=>i&&i!==e?n(i):t(null)))},W.prototype.push=function(e,t){return X(this,e,t,!1)},W.prototype.unshift=function(e,t){return X(this,e,t,!0)},W.prototype.isPaused=function(){const e=this._readableState;return!0===e[F]||!1===e.flowing},W.prototype.setEncoding=function(e){const t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let i="";for(const e of n)i+=t.write(e);return n.clear(),""!==i&&n.push(i),this._readableState.length=i.length,this};function K(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&U)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){const t=e._readableState;x("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(Q,e))}function Q(e){const t=e._readableState;x("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,re(e)}function J(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,i.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(x("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[F]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ne(e){x("readable nexttick read 0"),e.read(0)}function ie(e,t){x("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),re(e),t.flowing&&!t.reading&&e.read(0)}function re(e){const t=e._readableState;for(x("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=W.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,i=B;function r(t){this===e?(i(),i=B):i=t}e.on("readable",r);const s=T(e,{writable:!1},e=>{n=e?S(n,e):null,i(),i=B});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new d(r)}}}catch(e){throw n=S(n,e),n}finally{!n&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",r),s()):w.destroyer(e,null)}}(e,t);return n.stream=e,n}function oe(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function ae(e){const t=e._readableState;x("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(le,t,e))}function le(e,t){if(x("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)i.nextTick(ue,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ue(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ce;function de(){return void 0===ce&&(ce={}),ce}W.prototype.read=function(e){x("read",e),void 0===e?e=NaN:s(e)||(e=a(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new M("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return x("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Z(this),null;if(0===(e=K(e,t))&&t.ended)return 0===t.length&&ae(this),null;let i,r=!!(64&t.state);if(x("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,x("length less than watermark",r)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)r=!1,x("reading, ended or constructing",r);else if(r){x("do read"),t.state|=8|z,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){$(this,e)}t.state&=~z,t.reading||(e=K(n,t))}return i=e>0?oe(e,t):null,null===i?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ae(this)),null===i||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",i)),i},W.prototype._read=function(e){throw new O("_read()")},W.prototype.pipe=function(e,t){const n=this,r=this._readableState;1===r.pipes.length&&(r.multiAwaitDrain||(r.multiAwaitDrain=!0,r.awaitDrainWriters=new h(r.awaitDrainWriters?[r.awaitDrainWriters]:[]))),r.pipes.push(e),x("pipe count=%d opts=%j",r.pipes.length,t);const s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?a:g;function o(t,i){x("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,function(){x("cleanup"),e.removeListener("close",f),e.removeListener("finish",m),l&&e.removeListener("drain",l);e.removeListener("error",p),e.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",d),u=!0,l&&r.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}())}function a(){x("onend"),e.end()}let l;r.endEmitted?i.nextTick(s):n.once("end",s),e.on("unpipe",o);let u=!1;function c(){u||(1===r.pipes.length&&r.pipes[0]===e?(x("false write response, pause",0),r.awaitDrainWriters=e,r.multiAwaitDrain=!1):r.pipes.length>1&&r.pipes.includes(e)&&(x("false write response, pause",r.awaitDrainWriters.size),r.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){const n=e._readableState;n.awaitDrainWriters===t?(x("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(x("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",l))}function d(t){x("ondata");const n=e.write(t);x("dest.write",n),!1===n&&c()}function p(t){if(x("onerror",t),g(),e.removeListener("error",p),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?$(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",m),g()}function m(){x("onfinish"),e.removeListener("close",f),g()}function g(){x("unpipe"),n.unpipe(e)}return n.on("data",d),y(e,"error",p),e.once("close",f),e.once("finish",m),e.emit("pipe",n),!0===e.writableNeedDrain?c():r.flowing||(x("pipe resume"),n.resume()),e},W.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=r(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},W.prototype.on=function(e,t){const n=_.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,x("on readable",r.length,r.reading),r.length?Z(this):r.reading||i.nextTick(ne,this))),n},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(e,t){const n=_.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(te,this),n},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(e){const t=_.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(te,this),t},W.prototype.resume=function(){const e=this._readableState;return e.flowing||(x("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(ie,e,t))}(this,e)),e[F]=!1,this},W.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[F]=!0,this},W.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{$(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=u(e);for(let t=1;t<n.length;t++){const i=n[t];void 0===this[i]&&"function"==typeof e[i]&&(this[i]=e[i].bind(e))}return this},W.prototype[f]=function(){return se(this)},W.prototype.iterator=function(e){return void 0!==e&&D(e,"options"),se(this,e)},l(W.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[F]},set(e){this[F]=!!e}}}),W._fromList=oe,W.from=function(e,t){return P(W,e,t)},W.fromWeb=function(e,t){return de().newStreamReadableFromReadableStream(e,t)},W.toWeb=function(e,t){return de().newReadableStreamFromStreamReadable(e,t)},W.wrap=function(e,t){var n,i;return new W({objectMode:null===(n=null!==(i=e.readableObjectMode)&&void 0!==i?i:e.objectMode)||void 0===n||n,...t,destroy(t,n){w.destroyer(e,t),n(t)}}).wrap(e)}},19153:(e,t,n)=>{"use strict";const{MathFloor:i,NumberIsInteger:r}=n(4184),{validateInteger:s}=n(86283),{ERR_INVALID_ARG_VALUE:o}=n(66605).codes;let a=16384,l=16;function u(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,n,s){const a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,s,n);if(null!=a){if(!r(a)||a<0){throw new o(s?`options.${n}`:"options.highWaterMark",a)}return i(a)}return u(e.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(e,t){s(t,"value",0),e?l=t:a=t}}},50208:(e,t,n)=>{"use strict";const{ObjectSetPrototypeOf:i,Symbol:r}=n(4184);e.exports=u;const{ERR_METHOD_NOT_IMPLEMENTED:s}=n(66605).codes,o=n(94992),{getHighWaterMark:a}=n(19153);i(u.prototype,o.prototype),i(u,o);const l=r("kCallback");function u(e){if(!(this instanceof u))return new u(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function c(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())})}function d(){this._final!==c&&c.call(this)}u.prototype._final=c,u.prototype._transform=function(e,t,n){throw new s("_transform()")},u.prototype._write=function(e,t,n){const i=this._readableState,r=this._writableState,s=i.length;this._transform(e,t,(e,t)=>{e?n(e):(null!=t&&this.push(t),r.ended||s===i.length||i.length<i.highWaterMark?n():this[l]=n)})},u.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},66569:(e,t,n)=>{"use strict";const{SymbolAsyncIterator:i,SymbolIterator:r,SymbolFor:s}=n(4184),o=s("nodejs.stream.destroyed"),a=s("nodejs.stream.errored"),l=s("nodejs.stream.readable"),u=s("nodejs.stream.writable"),c=s("nodejs.stream.disturbed"),d=s("nodejs.webstream.isClosedPromise"),h=s("nodejs.webstream.controllerErrorFunction");function p(e,t=!1){var n;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function f(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function m(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function _(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function y(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!m(e))return null;const t=e._writableState,n=e._readableState,i=t||n;return!!(e.destroyed||e[o]||null!=i&&i.destroyed)}function b(e){if(!f(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function T(e,t){if(!p(e))return null;const n=e._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function x(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&(p(e)&&e.readable&&!T(e))}function E(e){return e&&null!=e[u]?e[u]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&(f(e)&&e.writable&&!b(e))}function w(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&w(e)}e.exports={isDestroyed:v,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[c])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:c,isErrored:function(e){var t,n,i,r,s,o,l,u,c,d;return!(!e||!(null!==(t=null!==(n=null!==(i=null!==(r=null!==(s=null!==(o=e[a])&&void 0!==o?o:e.readableErrored)&&void 0!==s?s:e.writableErrored)&&void 0!==r?r:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==i?i:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==n?n:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:a,isReadable:x,kIsReadable:l,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:u,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==t?void 0:t.closed)||(null==n?void 0:n.closed):"boolean"==typeof e._closed&&w(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return m(e)?!!v(e)||(!1===(null==t?void 0:t.readable)||!x(e))&&(!1===(null==t?void 0:t.writable)||!E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[i]:!1===t?"function"==typeof e[r]:"function"==typeof e[i]||"function"==typeof e[r])},isReadableNodeStream:p,isReadableStream:g,isReadableEnded:function(e){if(!p(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:T,isReadableErrored:function(e){var t,n;return m(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:m,isWebStream:function(e){return g(e)||_(e)||y(e)},isWritable:E,isWritableNodeStream:f,isWritableStream:_,isWritableEnded:b,isWritableFinished:function(e,t){if(!f(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return m(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!m(e))return null;const t=e._writableState,n=e._readableState,i=t||n;return!i&&I(e)||!!(i&&i.autoDestroy&&i.emitClose&&!1===i.closed)},isTransformStream:y}},10394:(e,t,n)=>{const i=n(65606),{ArrayPrototypeSlice:r,Error:s,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:c,Symbol:d,SymbolHasInstance:h}=n(4184);e.exports=D,D.WritableState=R;const{EventEmitter:p}=n(37007),f=n(32913).Stream,{Buffer:m}=n(48287),g=n(42430),{addAbortSignal:_}=n(30153),{getHighWaterMark:y,getDefaultHighWaterMark:v}=n(19153),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:w,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:A,ERR_STREAM_WRITE_AFTER_END:S,ERR_UNKNOWN_ENCODING:C}=n(66605).codes,{errorOrDestroy:O}=g;function M(){}u(D.prototype,f.prototype),u(D,f);const k=d("kOnFinished");function R(e,t,i){"boolean"!=typeof i&&(i=t instanceof n(94992)),this.objectMode=!(!e||!e.objectMode),i&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?y(this,e,"writableHighWaterMark",i):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const r=!(!e||!1!==e.decodeStrings);this.decodeStrings=!r,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=B.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[k]=[]}function N(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function D(e){const t=this instanceof n(94992);if(!t&&!o(D,this))return new D(e);this._writableState=new R(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&_(e.signal,this)),f.call(this,e),g.construct(this,()=>{const e=this._writableState;e.writing||z(this,e),G(this,e)})}function F(e,t,n,r){const s=e._writableState;if("function"==typeof n)r=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!m.isEncoding(n))throw new C(n)}else n=s.defaultEncoding;"function"!=typeof r&&(r=M)}if(null===t)throw new A;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=m.from(t,n),n="buffer");else if(t instanceof m)n="buffer";else{if(!f._isUint8Array(t))throw new b("chunk",["string","Buffer","Uint8Array"],t);t=f._uint8ArrayToBuffer(t),n="buffer"}let o;return s.ending?o=new S:s.destroyed&&(o=new w("write")),o?(i.nextTick(r,o),O(e,o,!0),o):(s.pendingcb++,function(e,t,n,i,r){const s=t.objectMode?1:n.length;t.length+=s;const o=t.length<t.highWaterMark;o||(t.needDrain=!0);t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:i,callback:r}),t.allBuffers&&"buffer"!==i&&(t.allBuffers=!1),t.allNoop&&r!==M&&(t.allNoop=!1)):(t.writelen=s,t.writecb=r,t.writing=!0,t.sync=!0,e._write(n,i,t.onwrite),t.sync=!1);return o&&!t.errored&&!t.destroyed}(e,s,t,n,r))}function L(e,t,n,i,r,s,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new w("write")):n?e._writev(r,t.onwrite):e._write(r,s,t.onwrite),t.sync=!1}function P(e,t,n,i){--t.pendingcb,i(n),V(t),O(e,n)}function B(e,t){const n=e._writableState,r=n.sync,s=n.writecb;"function"==typeof s?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),r?i.nextTick(P,e,n,t,s):P(e,n,t,s)):(n.buffered.length>n.bufferedIndex&&z(e,n),r?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===s?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:s,stream:e,state:n},i.nextTick($,n.afterWriteTickInfo)):U(e,n,1,s))):O(e,new x)}function $({stream:e,state:t,count:n,cb:i}){return t.afterWriteTickInfo=null,U(e,t,n,i)}function U(e,t,n,i){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,i();t.destroyed&&V(t),G(e,t)}function V(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;const{chunk:i,callback:r}=e.buffered[n],s=e.objectMode?1:i.length;e.length-=s,r(null!==(t=e.errored)&&void 0!==t?t:new w("write"))}const n=e[k].splice(0);for(let t=0;t<n.length;t++){var i;n[t](null!==(i=e.errored)&&void 0!==i?i:new w("end"))}N(e)}function z(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:i,objectMode:s}=t,o=n.length-i;if(!o)return;let a=i;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;const i=t.allNoop?M:e=>{for(let t=a;t<n.length;++t)n[t].callback(e)},s=t.allNoop&&0===a?n:r(n,a);s.allBuffers=t.allBuffers,L(e,t,!0,t.length,s,"",i),N(t)}else{do{const{chunk:i,encoding:r,callback:o}=n[a];n[a++]=null;L(e,t,!1,s?1:i.length,i,r,o)}while(a<n.length&&!t.writing);a===n.length?N(t):a>256?(n.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function j(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function Y(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function r(r){if(n)O(e,null!=r?r:x());else if(n=!0,t.pendingcb--,r){const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e](r);O(e,r,t.sync)}else j(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,i.nextTick(H,e,t))}t.sync=!0,t.pendingcb++;try{e._final(r)}catch(e){r(e)}t.sync=!1}(e,t)))}function G(e,t,n){j(t)&&(Y(e,t),0===t.pendingcb&&(n?(t.pendingcb++,i.nextTick((e,t)=>{j(t)?H(e,t):t.pendingcb--},e,t)):j(t)&&(t.pendingcb++,H(e,t))))}function H(e,t){t.pendingcb--,t.finished=!0;const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}R.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},a(R.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(D,h,{__proto__:null,value:function(e){return!!o(this,e)||this===D&&(e&&e._writableState instanceof R)}}),D.prototype.pipe=function(){O(this,new E)},D.prototype.write=function(e,t,n){return!0===F(this,e,t,n)},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||z(this,e))},D.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=c(e)),!m.isEncoding(e))throw new C(e);return this._writableState.defaultEncoding=e,this},D.prototype._write=function(e,t,n){if(!this._writev)throw new T("_write()");this._writev([{chunk:e,encoding:t}],n)},D.prototype._writev=null,D.prototype.end=function(e,t,n){const r=this._writableState;let o;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){const n=F(this,e,t);n instanceof s&&(o=n)}return r.corked&&(r.corked=1,this.uncork()),o||(r.errored||r.ending?r.finished?o=new I("end"):r.destroyed&&(o=new w("end")):(r.ending=!0,G(this,r,!0),r.ended=!0)),"function"==typeof n&&(o||r.finished?i.nextTick(n,o):r[k].push(n)),this},l(D.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const W=g.destroy;let X;function q(){return void 0===X&&(X={}),X}D.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[k].length)&&i.nextTick(V,n),W.call(this,e,t),this},D.prototype._undestroy=g.undestroy,D.prototype._destroy=function(e,t){t(e)},D.prototype[p.captureRejectionSymbol]=function(e){this.destroy(e)},D.fromWeb=function(e,t){return q().newStreamWritableFromWritableStream(e,t)},D.toWeb=function(e){return q().newWritableStreamFromStreamWritable(e)}},86283:(e,t,n)=>{"use strict";const{ArrayIsArray:i,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:s,ArrayPrototypeMap:o,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:c,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:p,String:f,StringPrototypeToUpperCase:m,StringPrototypeTrim:g}=n(4184),{hideStackFrames:_,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:T,ERR_UNKNOWN_SIGNAL:x}}=n(66605),{normalizeEncoding:E}=n(20798),{isAsyncFunction:w,isArrayBufferView:I}=n(20798).types,A={};const S=/^[0-7]+$/;const C=_((e,t,n=c,i=u)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new T(t,"an integer",e);if(e<n||e>i)throw new T(t,`>= ${n} && <= ${i}`,e)}),O=_((e,t,n=-2147483648,i=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new T(t,"an integer",e);if(e<n||e>i)throw new T(t,`>= ${n} && <= ${i}`,e)}),M=_((e,t,n=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new T(t,"an integer",e);const i=n?1:0,r=4294967295;if(e<i||e>r)throw new T(t,`>= ${i} && <= ${r}`,e)});function k(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const R=_((e,t,n)=>{if(!r(n,e)){const i=s(o(n,e=>"string"==typeof e?`'${e}'`:f(e)),", ");throw new b(t,e,"must be one of: "+i)}});function N(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function D(e,t,n){return null!=e&&h(e,t)?e[t]:n}const F=_((e,t,n=null)=>{const r=D(n,"allowArray",!1),s=D(n,"allowFunction",!1);if(!D(n,"nullable",!1)&&null===e||!r&&i(e)||"object"!=typeof e&&(!s||"function"!=typeof e))throw new v(t,"Object",e)}),L=_((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)}),P=_((e,t,n=0)=>{if(!i(e))throw new v(t,"Array",e);if(e.length<n){throw new b(t,e,`must be longer than ${n}`)}});const B=_((e,t="buffer")=>{if(!I(e))throw new v(t,["Buffer","TypedArray","DataView"],e)});const $=_((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)}),U=_((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)}),V=_((e,t)=>{if("function"!=typeof e||w(e))throw new v(t,"Function",e)}),z=_((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)});const j=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Y(e,t){if(void 0===e||!p(j,e))throw new b(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if(void 0===e&&(e=n),"string"==typeof e){if(null===p(S,e))throw new b(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return M(e,t),e},validateArray:P,validateStringArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)k(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)N(e[n],`${t}[${n}]`)},validateAbortSignalArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++){const i=e[n],r=`${t}[${n}]`;if(null==i)throw new v(r,"AbortSignal",i);$(i,r)}},validateBoolean:N,validateBuffer:B,validateDictionary:L,validateEncoding:function(e,t){const n=E(t),i=e.length;if("hex"===n&&i%2!=0)throw new b("encoding",t,`is invalid for data of length ${i}`)},validateFunction:U,validateInt32:O,validateInteger:C,validateNumber:function(e,t,n=void 0,i){if("number"!=typeof e)throw new v(t,"number",e);if(null!=n&&e<n||null!=i&&e>i||(null!=n||null!=i)&&l(e))throw new T(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,e)},validateObject:F,validateOneOf:R,validatePlainFunction:V,validatePort:function(e,t="Port",n=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new y(t,e,n);return 0|e},validateSignalName:function(e,t="signal"){if(k(e,t),void 0===A[e]){if(void 0!==A[m(e)])throw new x(e+" (signals must use all capital letters)");throw new x(e)}},validateString:k,validateUint32:M,validateUndefined:z,validateUnion:function(e,t,n){if(!r(n,e))throw new v(t,`('${s(n,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"==typeof e)return Y(e,"hints"),e;if(i(e)){const t=e.length;let n="";if(0===t)return n;for(let i=0;i<t;i++){const r=e[i];Y(r,"hints"),n+=r,i!==t-1&&(n+=", ")}return n}throw new b("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},86248:(e,t,n)=>{"use strict";const i=n(54612),r=n(70105),s=i.Readable.destroy;e.exports=i.Readable,e.exports._uint8ArrayToBuffer=i._uint8ArrayToBuffer,e.exports._isUint8Array=i._isUint8Array,e.exports.isDisturbed=i.isDisturbed,e.exports.isErrored=i.isErrored,e.exports.isReadable=i.isReadable,e.exports.Readable=i.Readable,e.exports.Writable=i.Writable,e.exports.Duplex=i.Duplex,e.exports.Transform=i.Transform,e.exports.PassThrough=i.PassThrough,e.exports.addAbortSignal=i.addAbortSignal,e.exports.finished=i.finished,e.exports.destroy=i.destroy,e.exports.destroy=s,e.exports.pipeline=i.pipeline,e.exports.compose=i.compose,Object.defineProperty(i,"promises",{configurable:!0,enumerable:!0,get:()=>r}),e.exports.Stream=i.Stream,e.exports.default=e.exports},66605:(e,t,n)=>{"use strict";const{format:i,inspect:r,AggregateError:s}=n(20798),o=globalThis.AggregateError||s,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,c={};function d(e,t){if(!e)throw new c.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function p(e,t,n){n||(n=Error);class r extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return d(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const r=(t.match(/%[dfijoOs]/g)||[]).length;return d(r===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${r}).`),0===n.length?t:i(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[a]=!0,c[e]=r}function f(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class m extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new c.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(e,t,n)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";const s=[],o=[],a=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?s.push(e.toLowerCase()):u.test(e)?o.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(o.length>0){const e=s.indexOf("object");-1!==e&&(s.splice(s,e,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:i+=`of type ${s[0]}`;break;case 2:i+=`one of type ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();i+=`one of type ${s.join(", ")}, or ${e}`}}(o.length>0||a.length>0)&&(i+=" or ")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();i+=`an instance of ${o.join(", ")}, or ${e}`}}a.length>0&&(i+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(i+="an "),i+=`${a[0]}`;break;case 2:i+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();i+=`one of ${a.join(", ")}, or ${e}`}}if(null==n)i+=`. Received ${n}`;else if("function"==typeof n&&n.name)i+=`. Received function ${n.name}`;else if("object"==typeof n){var c;if(null!==(c=n.constructor)&&void 0!==c&&c.name)i+=`. Received an instance of ${n.constructor.name}`;else{i+=`. Received ${r(n,{depth:-1})}`}}else{let e=r(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof n} (${e})`}return i},TypeError),p("ERR_INVALID_ARG_VALUE",(e,t,n="is invalid")=>{let i=r(t);i.length>128&&(i=i.slice(0,128)+"...");return`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${i}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(e,t,n)=>{var i;return`Expected ${e} to be returned from the "${t}" function but got ${null!=n&&null!==(i=n.constructor)&&void 0!==i&&i.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`},TypeError),p("ERR_MISSING_ARGS",(...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}}return`${t} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(e,t,n)=>{let i;return d(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?i=h(String(n)):"bigint"==typeof n?(i=String(n),(n>2n**32n||n<-(2n**32n))&&(i=h(i)),i+="n"):i=r(n),`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:m,aggregateTwoErrors:f(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new o([t,e],t.message);return n.code=t.code,n}return e||t}),hideStackFrames:f,codes:c}},4184:e=>{"use strict";e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error,FunctionPrototypeCall:(e,t,...n)=>e.call(t,...n),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,n)=>e.set(t,n),Boolean,Uint8Array}},20798:(e,t,n)=>{"use strict";const i=n(48287),{kResistStopPropagation:r,SymbolDispose:s}=n(4184),o=globalThis.AbortSignal||n(25568).AbortSignal,a=globalThis.AbortController||n(25568).AbortController,l=Object.getPrototypeOf(async function(){}).constructor,u=globalThis.Blob||i.Blob,c=void 0!==u?function(e){return e instanceof u}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class h extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}},promisify:e=>new Promise((t,n)=>{e((e,...i)=>e?n(e):t(...i))}),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,n]){const i=t.shift();if("f"===n)return i.toFixed(6);if("j"===n)return JSON.stringify(i);if("s"===n&&"object"==typeof i){return`${i.constructor!==Object?i.constructor.name:""} {}`.trim()}return i.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:c,deprecate:(e,t)=>e,addAbortListener:n(37007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let n;return d(e,"signal"),((e,t)=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE(t,"Function",e)})(t,"listener"),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[r]:!0}),n=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[s](){var e;null===(e=n)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new a,n=()=>t.abort();return e.forEach(e=>{d(e,"signals"),e.addEventListener("abort",n,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",n))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},54612:(e,t,n)=>{const{Buffer:i}=n(48287),{ObjectDefineProperty:r,ObjectKeys:s,ReflectApply:o}=n(4184),{promisify:{custom:a}}=n(20798),{streamReturningOperators:l,promiseReturningOperators:u}=n(65589),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=n(66605),d=n(6864),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:p}=n(19153),{pipeline:f}=n(60872),{destroyer:m}=n(42430),g=n(29700),_=n(70105),y=n(66569),v=e.exports=n(32913).Stream;v.isDestroyed=y.isDestroyed,v.isDisturbed=y.isDisturbed,v.isErrored=y.isErrored,v.isReadable=y.isReadable,v.isWritable=y.isWritable,v.Readable=n(76566);for(const x of s(l)){const E=l[x];function b(...e){if(new.target)throw c();return v.Readable.from(o(E,this,e))}r(b,"name",{__proto__:null,value:E.name}),r(b,"length",{__proto__:null,value:E.length}),r(v.Readable.prototype,x,{__proto__:null,value:b,enumerable:!1,configurable:!0,writable:!0})}for(const w of s(u)){const I=u[w];function b(...e){if(new.target)throw c();return o(I,this,e)}r(b,"name",{__proto__:null,value:I.name}),r(b,"length",{__proto__:null,value:I.length}),r(v.Readable.prototype,w,{__proto__:null,value:b,enumerable:!1,configurable:!0,writable:!0})}v.Writable=n(10394),v.Duplex=n(94992),v.Transform=n(50208),v.PassThrough=n(6898),v.pipeline=f;const{addAbortSignal:T}=n(30153);v.addAbortSignal=T,v.finished=g,v.destroy=m,v.compose=d,v.setDefaultHighWaterMark=h,v.getDefaultHighWaterMark=p,r(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>_}),r(f,a,{__proto__:null,enumerable:!0,get:()=>_.pipeline}),r(g,a,{__proto__:null,enumerable:!0,get:()=>_.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return i.from(e.buffer,e.byteOffset,e.byteLength)}},70105:(e,t,n)=>{"use strict";const{ArrayPrototypePop:i,Promise:r}=n(4184),{isIterable:s,isNodeStream:o,isWebStream:a}=n(66569),{pipelineImpl:l}=n(60872),{finished:u}=n(29700);n(54612),e.exports={finished:u,pipeline:function(...e){return new r((t,n)=>{let r,u;const c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!s(c)&&!a(c)){const t=i(e);r=t.signal,u=t.end}l(e,(e,i)=>{e?n(e):t(i)},{signal:r,end:u})})}}},98707:(e,t,n)=>{"use strict";var i=n(92861).Buffer,r=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},s.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var r=o(t[i]);if(r>=0)return r>0&&(e.lastNeed=r-1),r;if(--i<n||-2===r)return 0;if(r=o(t[i]),r>=0)return r>0&&(e.lastNeed=r-2),r;if(--i<n||-2===r)return 0;if(r=o(t[i]),r>=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},25568:e=>{"use strict";const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},44083:(e,t,n)=>{var i;
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/!function(){var r,s={};function o(){}function a(e){return e}function l(e){return!!e}function u(e){return!e}var c="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||this;function d(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}function h(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}null!=c&&(r=c.async),s.noConflict=function(){return c.async=r,s};var p=Object.prototype.toString,f=Array.isArray||function(e){return"[object Array]"===p.call(e)};function m(e){return f(e)||"number"==typeof e.length&&e.length>=0&&e.length%1==0}function g(e,t){for(var n=-1,i=e.length;++n<i;)t(e[n],n,e)}function _(e,t){for(var n=-1,i=e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function y(e){return _(Array(e),function(e,t){return t})}function v(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}var b=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};function T(e){var t,n,i=-1;return m(e)?(t=e.length,function(){return++i<t?i:null}):(n=b(e),t=n.length,function(){return++i<t?n[i]:null})}function x(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),i=Array(n),r=0;r<n;r++)i[r]=arguments[r+t];switch(t){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i)}}}function E(e){return function(t,n,i){return e(t,i)}}var w="function"==typeof setImmediate&&setImmediate,I=w?function(e){w(e)}:function(e){setTimeout(e,0)};function A(e){return function(t,n,i){i=h(i||o);var r=T(t=t||[]);if(e<=0)return i(null);var s=!1,a=0,l=!1;!function o(){if(s&&a<=0)return i(null);for(;a<e&&!l;){var u=r();if(null===u)return s=!0,void(a<=0&&i(null));a+=1,n(t[u],u,d(function(e){a-=1,e?(i(e),l=!0):o()}))}}()}}function S(e){return function(t,n,i){return e(s.eachOf,t,n,i)}}function C(e){return function(t,n,i,r){return e(A(n),t,i,r)}}function O(e){return function(t,n,i){return e(s.eachOfSeries,t,n,i)}}function M(e,t,n,i){i=h(i||o);var r=m(t=t||[])?[]:{};e(t,function(e,t,i){n(e,function(e,n){r[t]=n,i(e)})},function(e){i(e,r)})}function k(e,t,n,i){var r=[];e(t,function(e,t,i){n(e,function(n){n&&r.push({index:t,value:e}),i()})},function(){i(_(r.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})}function R(e,t,n,i){k(e,t,function(e,t){n(e,function(e){t(!e)})},i)}function N(e,t,n){return function(i,r,s,o){function a(){o&&o(n(!1,void 0))}function l(e,i,r){if(!o)return r();s(e,function(i){o&&t(i)&&(o(n(!0,e)),o=s=!1),r()})}arguments.length>3?e(i,r,l,a):(o=s,s=r,e(i,l,a))}}function D(e,t){return t}function F(e,t,n){n=n||o;var i=m(t)?[]:{};e(t,function(e,t,n){e(x(function(e,r){r.length<=1&&(r=r[0]),i[t]=r,n(e)}))},function(e){n(e,i)})}function L(e,t,n,i){var r=[];e(t,function(e,t,i){n(e,function(e,t){r=r.concat(t||[]),i(e)})},function(e){i(e,r)})}function P(e,t,n){if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");function i(e,t,n,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(e.started=!0,f(t)||(t=[t]),0===t.length&&e.idle())return s.setImmediate(function(){e.drain()});g(t,function(t){var r={data:t,callback:i||o};n?e.tasks.unshift(r):e.tasks.push(r),e.tasks.length===e.concurrency&&e.saturated()}),s.setImmediate(e.process)}function r(e,t){return function(){a-=1;var n=!1,i=arguments;g(t,function(e){g(l,function(t,i){t!==e||n||(l.splice(i,1),n=!0)}),e.callback.apply(e,i)}),e.tasks.length+a===0&&e.drain(),e.process()}}var a=0,l=[],u={tasks:[],concurrency:t,payload:n,saturated:o,empty:o,drain:o,started:!1,paused:!1,push:function(e,t){i(u,e,!1,t)},kill:function(){u.drain=o,u.tasks=[]},unshift:function(e,t){i(u,e,!0,t)},process:function(){for(;!u.paused&&a<u.concurrency&&u.tasks.length;){var t=u.payload?u.tasks.splice(0,u.payload):u.tasks.splice(0,u.tasks.length),n=_(t,function(e){return e.data});0===u.tasks.length&&u.empty(),a+=1,l.push(t[0]);var i=d(r(u,t));e(n,i)}},length:function(){return u.tasks.length},running:function(){return a},workersList:function(){return l},idle:function(){return u.tasks.length+a===0},pause:function(){u.paused=!0},resume:function(){if(!1!==u.paused){u.paused=!1;for(var e=Math.min(u.concurrency,u.tasks.length),t=1;t<=e;t++)s.setImmediate(u.process)}}};return u}function B(e){return x(function(t,n){t.apply(null,n.concat([x(function(t,n){"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&g(n,function(t){console[e](t)}))})]))})}function $(e){return function(t,n,i){e(y(t),n,i)}}function U(e){return x(function(t,n){var i=x(function(n){var i=this,r=n.pop();return e(t,function(e,t,r){e.apply(i,n.concat([r]))},r)});return n.length?i.apply(this,n):i})}function V(e){return x(function(t){var n=t.pop();t.push(function(){var e=arguments;i?s.setImmediate(function(){n.apply(null,e)}):n.apply(null,e)});var i=!0;e.apply(this,t),i=!1})}"object"==typeof process&&"function"==typeof process.nextTick?s.nextTick=process.nextTick:s.nextTick=I,s.setImmediate=w?I:s.nextTick,s.forEach=s.each=function(e,t,n){return s.eachOf(e,E(t),n)},s.forEachSeries=s.eachSeries=function(e,t,n){return s.eachOfSeries(e,E(t),n)},s.forEachLimit=s.eachLimit=function(e,t,n,i){return A(t)(e,E(n),i)},s.forEachOf=s.eachOf=function(e,t,n){n=h(n||o);for(var i,r=T(e=e||[]),s=0;null!=(i=r());)s+=1,t(e[i],i,d(a));function a(e){s--,e?n(e):null===i&&s<=0&&n(null)}0===s&&n(null)},s.forEachOfSeries=s.eachOfSeries=function(e,t,n){n=h(n||o);var i=T(e=e||[]),r=i();!function o(){var a=!0;if(null===r)return n(null);t(e[r],r,d(function(e){if(e)n(e);else{if(null===(r=i()))return n(null);a?s.setImmediate(o):o()}})),a=!1}()},s.forEachOfLimit=s.eachOfLimit=function(e,t,n,i){A(t)(e,n,i)},s.map=S(M),s.mapSeries=O(M),s.mapLimit=C(M),s.inject=s.foldl=s.reduce=function(e,t,n,i){s.eachOfSeries(e,function(e,i,r){n(t,e,function(e,n){t=n,r(e)})},function(e){i(e,t)})},s.foldr=s.reduceRight=function(e,t,n,i){var r=_(e,a).reverse();s.reduce(r,t,n,i)},s.transform=function(e,t,n,i){3===arguments.length&&(i=n,n=t,t=f(e)?[]:{}),s.eachOf(e,function(e,i,r){n(t,e,i,r)},function(e){i(e,t)})},s.select=s.filter=S(k),s.selectLimit=s.filterLimit=C(k),s.selectSeries=s.filterSeries=O(k),s.reject=S(R),s.rejectLimit=C(R),s.rejectSeries=O(R),s.any=s.some=N(s.eachOf,l,a),s.someLimit=N(s.eachOfLimit,l,a),s.all=s.every=N(s.eachOf,u,u),s.everyLimit=N(s.eachOfLimit,u,u),s.detect=N(s.eachOf,a,D),s.detectSeries=N(s.eachOfSeries,a,D),s.detectLimit=N(s.eachOfLimit,a,D),s.sortBy=function(e,t,n){function i(e,t){var n=e.criteria,i=t.criteria;return n<i?-1:n>i?1:0}s.map(e,function(e,n){t(e,function(t,i){t?n(t):n(null,{value:e,criteria:i})})},function(e,t){if(e)return n(e);n(null,_(t.sort(i),function(e){return e.value}))})},s.auto=function(e,t,n){"function"==typeof arguments[1]&&(n=t,t=null),n=h(n||o);var i=b(e),r=i.length;if(!r)return n(null);t||(t=r);var a={},l=0,u=!1,c=[];function d(e){c.unshift(e)}function p(){r--,g(c.slice(0),function(e){e()})}d(function(){r||n(null,a)}),g(i,function(i){if(!u){for(var r,o=f(e[i])?e[i]:[e[i]],h=x(function(e,t){if(l--,t.length<=1&&(t=t[0]),e){var r={};c=function(e,t){r[t]=e},g(b(o=a),function(e){c(o[e],e)}),r[i]=t,u=!0,n(e,r)}else a[i]=t,s.setImmediate(p);var o,c}),m=o.slice(0,o.length-1),_=m.length;_--;){if(!(r=e[m[_]]))throw new Error("Has nonexistent dependency in "+m.join(", "));if(f(r)&&v(r,i)>=0)throw new Error("Has cyclic dependencies")}y()?(l++,o[o.length-1](h,a)):d(function e(){y()&&(l++,(t=v(c,e))>=0&&c.splice(t,1),o[o.length-1](h,a));var t})}function y(){return l<t&&(e=function(e,t){return e&&a.hasOwnProperty(t)},n=!0,g(m,function(t,i,r){n=e(n,t,i,r)}),n)&&!a.hasOwnProperty(i);var e,n}})},s.retry=function(e,t,n){var i=[],r={times:5,interval:0};var o=arguments.length;if(o<1||o>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");function a(e,t){function n(e,n){return function(i){e(function(e,t){i(!e||n,{err:e,result:t})},t)}}function o(e){return function(t){setTimeout(function(){t(null)},e)}}for(;r.times;){var a=!(r.times-=1);i.push(n(r.task,a)),!a&&r.interval>0&&i.push(o(r.interval))}s.series(i,function(t,n){n=n[n.length-1],(e||r.callback)(n.err,n.result)})}return o<=2&&"function"==typeof e&&(n=t,t=e),"function"!=typeof e&&function(e,t){if("number"==typeof t)e.times=parseInt(t,10)||5;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);e.times=parseInt(t.times,10)||5,e.interval=parseInt(t.interval,10)||0}}(r,e),r.callback=n,r.task=t,r.callback?a():a},s.waterfall=function(e,t){if(t=h(t||o),!f(e)){var n=new Error("First argument to waterfall must be an array of functions");return t(n)}if(!e.length)return t();!function e(n){return x(function(i,r){if(i)t.apply(null,[i].concat(r));else{var s=n.next();s?r.push(e(s)):r.push(t),V(n).apply(null,r)}})}(s.iterator(e))()},s.parallel=function(e,t){F(s.eachOf,e,t)},s.parallelLimit=function(e,t,n){F(A(t),e,n)},s.series=function(e,t){F(s.eachOfSeries,e,t)},s.iterator=function(e){return function t(n){function i(){return e.length&&e[n].apply(null,arguments),i.next()}return i.next=function(){return n<e.length-1?t(n+1):null},i}(0)},s.apply=x(function(e,t){return x(function(n){return e.apply(null,t.concat(n))})}),s.concat=S(L),s.concatSeries=O(L),s.whilst=function(e,t,n){if(n=n||o,e()){var i=x(function(r,s){r?n(r):e.apply(this,s)?t(i):n.apply(null,[null].concat(s))});t(i)}else n(null)},s.doWhilst=function(e,t,n){var i=0;return s.whilst(function(){return++i<=1||t.apply(this,arguments)},e,n)},s.until=function(e,t,n){return s.whilst(function(){return!e.apply(this,arguments)},t,n)},s.doUntil=function(e,t,n){return s.doWhilst(e,function(){return!t.apply(this,arguments)},n)},s.during=function(e,t,n){n=n||o;var i=x(function(t,i){t?n(t):(i.push(r),e.apply(this,i))}),r=function(e,r){e?n(e):r?t(i):n(null)};e(r)},s.doDuring=function(e,t,n){var i=0;s.during(function(e){i++<1?e(null,!0):t.apply(this,arguments)},e,n)},s.queue=function(e,t){return P(function(t,n){e(t[0],n)},t,1)},s.priorityQueue=function(e,t){function n(e,t){return e.priority-t.priority}var i=s.queue(e,t);return i.push=function(e,t,r){!function(e,t,i,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(e.started=!0,f(t)||(t=[t]),0===t.length)return s.setImmediate(function(){e.drain()});g(t,function(t){var a={data:t,priority:i,callback:"function"==typeof r?r:o};e.tasks.splice(function(e,t,n){for(var i=-1,r=e.length-1;i<r;){var s=i+(r-i+1>>>1);n(t,e[s])>=0?i=s:r=s-1}return i}(e.tasks,a,n)+1,0,a),e.tasks.length===e.concurrency&&e.saturated(),s.setImmediate(e.process)})}(i,e,t,r)},delete i.unshift,i},s.cargo=function(e,t){return P(e,1,t)},s.log=B("log"),s.dir=B("dir"),s.memoize=function(e,t){var n={},i={},r=Object.prototype.hasOwnProperty;t=t||a;var o=x(function(o){var a=o.pop(),l=t.apply(null,o);r.call(n,l)?s.setImmediate(function(){a.apply(null,n[l])}):r.call(i,l)?i[l].push(a):(i[l]=[a],e.apply(null,o.concat([x(function(e){n[l]=e;var t=i[l];delete i[l];for(var r=0,s=t.length;r<s;r++)t[r].apply(null,e)})])))});return o.memo=n,o.unmemoized=e,o},s.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},s.times=$(s.map),s.timesSeries=$(s.mapSeries),s.timesLimit=function(e,t,n,i){return s.mapLimit(y(e),t,n,i)},s.seq=function(){var e=arguments;return x(function(t){var n=this,i=t[t.length-1];"function"==typeof i?t.pop():i=o,s.reduce(e,t,function(e,t,i){t.apply(n,e.concat([x(function(e,t){i(e,t)})]))},function(e,t){i.apply(n,[e].concat(t))})})},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))},s.applyEach=U(s.eachOf),s.applyEachSeries=U(s.eachOfSeries),s.forever=function(e,t){var n=d(t||o),i=V(e);!function e(t){if(t)return n(t);i(e)}()},s.ensureAsync=V,s.constant=x(function(e){var t=[null].concat(e);return function(e){return e.apply(this,t)}}),s.wrapSync=s.asyncify=function(e){return x(function(t){var n,i,r,s=t.pop();try{n=e.apply(this,t)}catch(e){return s(e)}("function"===(r=typeof(i=n))||"object"===r&&i)&&"function"==typeof n.then?n.then(function(e){s(null,e)}).catch(function(e){s(e.message?e:new Error(e))}):s(null,n)})},e.exports?e.exports=s:void 0===(i=function(){return s}.apply(t,[]))||(e.exports=i)}()},67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,s=a(e),o=s[0],l=s[1],u=new r(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),c=0,d=l>0?o-4:o;for(n=0;n<d;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===l&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===l&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,s=[],o=16383,a=0,l=i-r;a<l;a+=o)s.push(u(e,a,a+o>l?l:a+o));1===r?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,n){for(var i,r=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),r.push(l(i));return r.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},48287:(e,t,n)=>{"use strict";
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/const i=n(67526),r=n(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,n)}function u(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let i=a(n);const r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,n);const r=function(e){if(l.isBuffer(e)){const t=0|f(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?a(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),a(e<0?0:0|f(e))}function h(e){const t=e.length<0?0:0|f(e.length),n=a(t);for(let i=0;i<t;i+=1)n[i]=255&e[i];return n}function p(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(i,l.prototype),i}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return i?-1:H(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function _(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function y(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),K(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){let s,o=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let i=-1;for(s=n;s<a;s++)if(u(e,s)===u(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===l)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(n+l>a&&(n=a-l),s=n;s>=0;s--){let n=!0;for(let i=0;i<l;i++)if(u(e,s+i)!==u(t,i)){n=!1;break}if(n)return s}return-1}function b(e,t,n,i){n=Number(n)||0;const r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;const s=t.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(K(i))return o;e[n+o]=i}return o}function T(e,t,n,i){return X(H(t,e.length-n),e,n,i)}function x(e,t,n,i){return X(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function E(e,t,n,i){return X(W(t),e,n,i)}function w(e,t,n,i){return X(function(e,t){let n,i,r;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),i=n>>8,r=n%256,s.push(r),s.push(i);return s}(t,e.length-n),e,n,i)}function I(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);const i=[];let r=t;for(;r<n;){const t=e[r];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(r+o<=n){let n,i,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:n=e[r+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(s=l));break;case 3:n=e[r+1],i=e[r+2],128==(192&n)&&128==(192&i)&&(l=(15&t)<<12|(63&n)<<6|63&i,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:n=e[r+1],i=e[r+2],a=e[r+3],128==(192&n)&&128==(192&i)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=o}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=S));return n}(i)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return u(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return c(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let r=0,s=Math.min(n,i);r<s;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const i=l.allocUnsafe(t);let r=0;for(n=0;n<e.length;++n){let t=e[n];if(q(t,Uint8Array))r+t.length>i.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(i,r)):Uint8Array.prototype.set.call(i,t,r);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,r)}r+=t.length}return i},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,n,i,r){if(q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(i,r),c=e.slice(t,n);for(let e=0;e<a;++e)if(u[e]!==c[e]){s=u[e],o=c[e];break}return s<o?-1:o<s?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},l.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return T(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function C(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function O(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function M(e,t,n){const i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);let r="";for(let i=t;i<n;++i)r+=Z[e[i]];return r}function k(e,t,n){const i=e.slice(t,n);let r="";for(let e=0;e<i.length-1;e+=2)r+=String.fromCharCode(i[e]+256*i[e+1]);return r}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,i,r,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function D(e,t,n,i,r){z(t,i,r,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function F(e,t,n,i,r){z(t,i,r,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function L(e,t,n,i,r,s){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,i,s){return t=+t,n>>>=0,s||L(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function B(e,t,n,i,s){return t=+t,n>>>=0,s||L(e,0,n,8),r.write(e,t,n,i,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let i=this[e],r=1,s=0;for(;++s<t&&(r*=256);)i+=this[e+s]*r;return i},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let i=this[e+--t],r=1;for(;t>0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(r)<<BigInt(32))}),l.prototype.readBigUInt64BE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<<BigInt(32))+BigInt(r)}),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let i=this[e],r=1,s=0;for(;++s<t&&(r*=256);)i+=this[e+s]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||R(e,t,this.length);let i=t,r=1,s=this[e+--i];for(;i>0&&(r*=256);)s+=this[e+--i]*r;return r*=128,s>=r&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=Q(function(e){j(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=1,s=0;for(this[t]=255&e;++s<n&&(r*=256);)this[t+s]=e/r&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t>>>=0,n>>>=0,!i){N(this,e,t,n,Math.pow(2,8*n)-1,0)}let r=n-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Q(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}let r=0,s=1,o=0;for(this[t]=255&e;++r<n&&(s*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/s|0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}let r=n-1,s=1,o=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Q(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);const r=i-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),r},l.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{const s=l.isBuffer(e)?e:l.from(e,i),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=s[r%o]}return this};const $={};function U(e,t,n){$[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function z(e,t,n,i,r,s){if(e>n||e<t){const i="bigint"==typeof t?"n":"";let r;throw r=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${n}${i}`,new $.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,n){j(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Y(t,e.length-(n+1))}(i,r,s)}function j(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,n){if(Math.floor(e)!==e)throw j(e,n),new $.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,n){let i=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=V(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=V(r)),r+="n"),i+=` It must be ${t}. Received ${r}`,i},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function H(e,t){let n;t=t||1/0;const i=e.length;let r=null;const s=[];for(let o=0;o<i;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function W(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,n,i){let r;for(r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let r=0;r<16;++r)t[i+r]=e[n]+e[r]}return t}();function Q(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},1779:e=>{var t=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{i=Promise}catch(e){i=function(){}}function r(s,a,l,u,c){"object"==typeof a&&(l=a.depth,u=a.prototype,c=a.includeNonEnumerable,a=a.circular);var d=[],h=[],p="undefined"!=typeof Buffer;return void 0===a&&(a=!0),void 0===l&&(l=1/0),function s(l,f){if(null===l)return null;if(0===f)return l;var m,g;if("object"!=typeof l)return l;if(e(l,t))m=new t;else if(e(l,n))m=new n;else if(e(l,i))m=new i(function(e,t){l.then(function(t){e(s(t,f-1))},function(e){t(s(e,f-1))})});else if(r.__isArray(l))m=[];else if(r.__isRegExp(l))m=new RegExp(l.source,o(l)),l.lastIndex&&(m.lastIndex=l.lastIndex);else if(r.__isDate(l))m=new Date(l.getTime());else{if(p&&Buffer.isBuffer(l))return m=Buffer.allocUnsafe?Buffer.allocUnsafe(l.length):new Buffer(l.length),l.copy(m),m;e(l,Error)?m=Object.create(l):void 0===u?(g=Object.getPrototypeOf(l),m=Object.create(g)):(m=Object.create(u),g=u)}if(a){var _=d.indexOf(l);if(-1!=_)return h[_];d.push(l),h.push(m)}for(var y in e(l,t)&&l.forEach(function(e,t){var n=s(t,f-1),i=s(e,f-1);m.set(n,i)}),e(l,n)&&l.forEach(function(e){var t=s(e,f-1);m.add(t)}),l){var v;g&&(v=Object.getOwnPropertyDescriptor(g,y)),v&&null==v.set||(m[y]=s(l[y],f-1))}if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(l);for(y=0;y<b.length;y++){var T=b[y];(!(E=Object.getOwnPropertyDescriptor(l,T))||E.enumerable||c)&&(m[T]=s(l[T],f-1),E.enumerable||Object.defineProperty(m,T,{enumerable:!1}))}}if(c){var x=Object.getOwnPropertyNames(l);for(y=0;y<x.length;y++){var E,w=x[y];(E=Object.getOwnPropertyDescriptor(l,w))&&E.enumerable||(m[w]=s(l[w],f-1),Object.defineProperty(m,w,{enumerable:!1}))}}return m}(s,l)}function s(e){return Object.prototype.toString.call(e)}function o(e){var t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}return r.clonePrototype=function(e){if(null===e)return null;var t=function(){};return t.prototype=e,new t},r.__objToStr=s,r.__isDate=function(e){return"object"==typeof e&&"[object Date]"===s(e)},r.__isArray=function(e){return"object"==typeof e&&"[object Array]"===s(e)},r.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===s(e)},r.__getRegExpFlags=o,r}();e.exports&&(e.exports=t)},65721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,s.default)(e)};var i,r=n(45685),s=(i=r)&&i.__esModule?i:{default:i};e.exports=t.default},44014:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e&&n.test(e)};var n=/-webkit-|-moz-|-ms-/;e.exports=t.default},34410:(e,t,n)=>{"use strict";function i(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function r(e){return(e=i(Math.abs(e)))?e[1]:NaN}n.r(t),n.d(t,{format:()=>p,formatDefaultLocale:()=>_,formatLocale:()=>g,formatPrefix:()=>f,formatSpecifier:()=>a,precisionFixed:()=>y,precisionPrefix:()=>v,precisionRound:()=>b});var s,o=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){return new l(e)}function l(e){if(!(t=o.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function u(e,t){var n=i(e,t);if(!n)return e+"";var r=n[0],s=n[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}a.prototype=l.prototype,l.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const c={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return u(100*e,t)},r:u,s:function(e,t){var n=i(e,t);if(!n)return e+"";var r=n[0],o=n[1],a=o-(s=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+i(e,Math.max(0,t+a-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function d(e){return e}var h,p,f,m=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function g(e){var t,n,i=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,i){for(var r=e.length,s=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[o=(o+1)%t.length];return s.reverse().join(n)}):d,o=e.currency,l=e.decimal,u=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(e.numerals):d,h=e.percent||"%";function p(e){var t=(e=a(e)).fill,n=e.align,r=e.sign,d=e.symbol,p=e.zero,f=e.width,g=e.comma,_=e.precision,y=e.trim,v=e.type;"n"===v?(g=!0,v="g"):c[v]||(null==_&&(_=12),y=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===d?o[0]:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",T="$"===d?o[1]:/[%p]/.test(v)?h:"",x=c[v],E=/[defgprs%]/.test(v);function w(e){var o,a,c,d=b,h=T;if("c"===v)h=x(e)+h,e="";else{var w=(e=+e)<0;if(e=x(Math.abs(e),_),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(r>0){if(!+e[i])break e;r=0}}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),w&&0===+e&&(w=!1),d=(w?"("===r?r:"-":"-"===r||"("===r?"":r)+d,h=("s"===v?m[8+s/3]:"")+h+(w&&"("===r?")":""),E)for(o=-1,a=e.length;++o<a;)if(48>(c=e.charCodeAt(o))||c>57){h=(46===c?l+e.slice(o+1):e.slice(o))+h,e=e.slice(0,o);break}}g&&!p&&(e=i(e,1/0));var I=d.length+e.length+h.length,A=I<f?new Array(f-I+1).join(t):"";switch(g&&p&&(e=i(A+e,A.length?f-h.length:1/0),A=""),n){case"<":e=d+e+h+A;break;case"=":e=d+A+e+h;break;case"^":e=A.slice(0,I=A.length>>1)+d+e+h+A.slice(I);break;default:e=A+d+e+h}return u(e)}return _=null==_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),w.toString=function(){return e+""},w}return{format:p,formatPrefix:function(e,t){var n=p(((e=a(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),s=Math.pow(10,-i),o=m[8+i/3];return function(e){return n(s*e)+o}}}}function _(e){return h=g(e),p=h.format,f=h.formatPrefix,h}function y(e){return Math.max(0,-r(Math.abs(e)))}function v(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))}function b(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1}_({decimal:".",thousands:",",grouping:[3],currency:["$",""]})},90716:(e,t,n)=>{"use strict";n.r(t),n.d(t,{clientPoint:()=>xe,create:()=>_e,creator:()=>l,customEvent:()=>le,event:()=>ie,local:()=>ve,matcher:()=>g,mouse:()=>Ee,namespace:()=>s,namespaces:()=>r,select:()=>ge,selectAll:()=>we,selection:()=>me,selector:()=>c,selectorAll:()=>h,style:()=>R,touch:()=>Ie,touches:()=>Ae,window:()=>C});var i="http://www.w3.org/1999/xhtml";const r={svg:"http://www.w3.org/2000/svg",xhtml:i,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function s(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.hasOwnProperty(t)?{space:r[t],local:e}:e}function o(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===i&&t.documentElement.namespaceURI===i?t.createElement(e):t.createElementNS(n,e)}}function a(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function l(e){var t=s(e);return(t.local?a:o)(t)}function u(){}function c(e){return null==e?u:function(){return this.querySelector(e)}}function d(){return[]}function h(e){return null==e?d:function(){return this.querySelectorAll(e)}}var p=function(e){return function(){return this.matches(e)}};if("undefined"!=typeof document){var f=document.documentElement;if(!f.matches){var m=f.webkitMatchesSelector||f.msMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector;p=function(e){return function(){return m.call(this,e)}}}}const g=p;function _(e){return new Array(e.length)}function y(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}y.prototype={constructor:y,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function v(e,t,n,i,r,s){for(var o,a=0,l=t.length,u=s.length;a<u;++a)(o=t[a])?(o.__data__=s[a],i[a]=o):n[a]=new y(e,s[a]);for(;a<l;++a)(o=t[a])&&(r[a]=o)}function b(e,t,n,i,r,s,o){var a,l,u,c={},d=t.length,h=s.length,p=new Array(d);for(a=0;a<d;++a)(l=t[a])&&(p[a]=u="$"+o.call(l,l.__data__,a,t),u in c?r[a]=l:c[u]=l);for(a=0;a<h;++a)(l=c[u="$"+o.call(e,s[a],a,s)])?(i[a]=l,l.__data__=s[a],c[u]=null):n[a]=new y(e,s[a]);for(a=0;a<d;++a)(l=t[a])&&c[p[a]]===l&&(r[a]=l)}function T(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function x(e){return function(){this.removeAttribute(e)}}function E(e){return function(){this.removeAttributeNS(e.space,e.local)}}function w(e,t){return function(){this.setAttribute(e,t)}}function I(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function A(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function S(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function C(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function O(e){return function(){this.style.removeProperty(e)}}function M(e,t,n){return function(){this.style.setProperty(e,t,n)}}function k(e,t,n){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function R(e,t){return e.style.getPropertyValue(t)||C(e).getComputedStyle(e,null).getPropertyValue(t)}function N(e){return function(){delete this[e]}}function D(e,t){return function(){this[e]=t}}function F(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function L(e){return e.trim().split(/^|\s+/)}function P(e){return e.classList||new B(e)}function B(e){this._node=e,this._names=L(e.getAttribute("class")||"")}function $(e,t){for(var n=P(e),i=-1,r=t.length;++i<r;)n.add(t[i])}function U(e,t){for(var n=P(e),i=-1,r=t.length;++i<r;)n.remove(t[i])}function V(e){return function(){$(this,e)}}function z(e){return function(){U(this,e)}}function j(e,t){return function(){(t.apply(this,arguments)?$:U)(this,e)}}function Y(){this.textContent=""}function G(e){return function(){this.textContent=e}}function H(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function W(){this.innerHTML=""}function X(e){return function(){this.innerHTML=e}}function q(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function K(){this.nextSibling&&this.parentNode.appendChild(this)}function Z(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Q(){return null}function J(){var e=this.parentNode;e&&e.removeChild(this)}function ee(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function te(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}B.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ne={},ie=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(ne={mouseenter:"mouseover",mouseleave:"mouseout"}));function re(e,t,n){return e=se(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function se(e,t,n){return function(i){var r=ie;ie=i;try{e.call(this,this.__data__,t,n)}finally{ie=r}}}function oe(e){return function(){var t=this.__on;if(t){for(var n,i=0,r=-1,s=t.length;i<s;++i)n=t[i],e.type&&n.type!==e.type||n.name!==e.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?t.length=r:delete this.__on}}}function ae(e,t,n){var i=ne.hasOwnProperty(e.type)?re:se;return function(r,s,o){var a,l=this.__on,u=i(t,s,o);if(l)for(var c=0,d=l.length;c<d;++c)if((a=l[c]).type===e.type&&a.name===e.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=u,a.capture=n),void(a.value=t);this.addEventListener(e.type,u,n),a={type:e.type,name:e.name,value:t,listener:u,capture:n},l?l.push(a):this.__on=[a]}}function le(e,t,n,i){var r=ie;e.sourceEvent=ie,ie=e;try{return t.apply(n,i)}finally{ie=r}}function ue(e,t,n){var i=C(e),r=i.CustomEvent;"function"==typeof r?r=new r(t,n):(r=i.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function ce(e,t){return function(){return ue(this,e,t)}}function de(e,t){return function(){return ue(this,e,t.apply(this,arguments))}}var he=[null];function pe(e,t){this._groups=e,this._parents=t}function fe(){return new pe([[document.documentElement]],he)}pe.prototype=fe.prototype={constructor:pe,select:function(e){"function"!=typeof e&&(e=c(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s,o,a=t[r],l=a.length,u=i[r]=new Array(l),d=0;d<l;++d)(s=a[d])&&(o=e.call(s,s.__data__,d,a))&&("__data__"in s&&(o.__data__=s.__data__),u[d]=o);return new pe(i,this._parents)},selectAll:function(e){"function"!=typeof e&&(e=h(e));for(var t=this._groups,n=t.length,i=[],r=[],s=0;s<n;++s)for(var o,a=t[s],l=a.length,u=0;u<l;++u)(o=a[u])&&(i.push(e.call(o,o.__data__,u,a)),r.push(o));return new pe(i,r)},filter:function(e){"function"!=typeof e&&(e=g(e));for(var t=this._groups,n=t.length,i=new Array(n),r=0;r<n;++r)for(var s,o=t[r],a=o.length,l=i[r]=[],u=0;u<a;++u)(s=o[u])&&e.call(s,s.__data__,u,o)&&l.push(s);return new pe(i,this._parents)},data:function(e,t){if(!e)return f=new Array(this.size()),c=-1,this.each(function(e){f[++c]=e}),f;var n,i=t?b:v,r=this._parents,s=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var o=s.length,a=new Array(o),l=new Array(o),u=new Array(o),c=0;c<o;++c){var d=r[c],h=s[c],p=h.length,f=e.call(d,d&&d.__data__,c,r),m=f.length,g=l[c]=new Array(m),_=a[c]=new Array(m);i(d,h,g,_,u[c]=new Array(p),f,t);for(var y,T,x=0,E=0;x<m;++x)if(y=g[x]){for(x>=E&&(E=x+1);!(T=_[E])&&++E<m;);y._next=T||null}}return(a=new pe(a,r))._enter=l,a._exit=u,a},enter:function(){return new pe(this._enter||this._groups.map(_),this._parents)},exit:function(){return new pe(this._exit||this._groups.map(_),this._parents)},merge:function(e){for(var t=this._groups,n=e._groups,i=t.length,r=n.length,s=Math.min(i,r),o=new Array(i),a=0;a<s;++a)for(var l,u=t[a],c=n[a],d=u.length,h=o[a]=new Array(d),p=0;p<d;++p)(l=u[p]||c[p])&&(h[p]=l);for(;a<i;++a)o[a]=t[a];return new pe(o,this._parents)},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i,r=e[t],s=r.length-1,o=r[s];--s>=0;)(i=r[s])&&(o&&o!==i.nextSibling&&o.parentNode.insertBefore(i,o),o=i);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=T);for(var n=this._groups,i=n.length,r=new Array(i),s=0;s<i;++s){for(var o,a=n[s],l=a.length,u=r[s]=new Array(l),c=0;c<l;++c)(o=a[c])&&(u[c]=o);u.sort(t)}return new pe(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){var e=new Array(this.size()),t=-1;return this.each(function(){e[++t]=this}),e},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],r=0,s=i.length;r<s;++r){var o=i[r];if(o)return o}return null},size:function(){var e=0;return this.each(function(){++e}),e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var r,s=t[n],o=0,a=s.length;o<a;++o)(r=s[o])&&e.call(r,r.__data__,o,s);return this},attr:function(e,t){var n=s(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==t?n.local?E:x:"function"==typeof t?n.local?S:A:n.local?I:w)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?O:"function"==typeof t?k:M)(e,t,null==n?"":n)):R(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?N:"function"==typeof t?F:D)(e,t)):this.node()[e]},classed:function(e,t){var n=L(e+"");if(arguments.length<2){for(var i=P(this.node()),r=-1,s=n.length;++r<s;)if(!i.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?j:t?V:z)(n,t))},text:function(e){return arguments.length?this.each(null==e?Y:("function"==typeof e?H:G)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?W:("function"==typeof e?q:X)(e)):this.node().innerHTML},raise:function(){return this.each(K)},lower:function(){return this.each(Z)},append:function(e){var t="function"==typeof e?e:l(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:l(e),i=null==t?Q:"function"==typeof t?t:c(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(J)},clone:function(e){return this.select(e?te:ee)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var i,r,s=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),o=s.length;if(!(arguments.length<2)){for(a=t?ae:oe,null==n&&(n=!1),i=0;i<o;++i)this.each(a(s[i],t,n));return this}var a=this.node().__on;if(a)for(var l,u=0,c=a.length;u<c;++u)for(i=0,l=a[u];i<o;++i)if((r=s[i]).type===l.type&&r.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?de:ce)(e,t))}};const me=fe;function ge(e){return"string"==typeof e?new pe([[document.querySelector(e)]],[document.documentElement]):new pe([[e]],he)}function _e(e){return ge(l(e).call(document.documentElement))}var ye=0;function ve(){return new be}function be(){this._="@"+(++ye).toString(36)}function Te(){for(var e,t=ie;e=t.sourceEvent;)t=e;return t}function xe(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}function Ee(e){var t=Te();return t.changedTouches&&(t=t.changedTouches[0]),xe(e,t)}function we(e){return"string"==typeof e?new pe([document.querySelectorAll(e)],[document.documentElement]):new pe([null==e?[]:e],he)}function Ie(e,t,n){arguments.length<3&&(n=t,t=Te().changedTouches);for(var i,r=0,s=t?t.length:0;r<s;++r)if((i=t[r]).identifier===n)return xe(e,i);return null}function Ae(e,t){null==t&&(t=Te().touches);for(var n=0,i=t?t.length:0,r=new Array(i);n<i;++n)r[n]=xe(e,t[n]);return r}be.prototype=ve.prototype={constructor:be,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}}},66570:e=>{"use strict";function t(e,t,i){i=i||2;var s,o,a,l,d,h,f,m=t&&t.length,g=m?t[0]*i:e.length,_=n(e,0,g,i,!0),y=[];if(!_||_.next===_.prev)return y;if(m&&(_=function(e,t,i,r){var s,o,a,l=[];for(s=0,o=t.length;s<o;s++)(a=n(e,t[s]*r,s<o-1?t[s+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),l.push(p(a));for(l.sort(u),s=0;s<l.length;s++)i=c(l[s],i);return i}(e,t,_,i)),e.length>80*i){s=a=e[0],o=l=e[1];for(var v=i;v<g;v+=i)(d=e[v])<s&&(s=d),(h=e[v+1])<o&&(o=h),d>a&&(a=d),h>l&&(l=h);f=0!==(f=Math.max(a-s,l-o))?32767/f:0}return r(_,y,i,s,o,f,0),y}function n(e,t,n,i,r){var s,o;if(r===A(e,t,n,i)>0)for(s=t;s<n;s+=i)o=E(s,e[s],e[s+1],o);else for(s=n-i;s>=t;s-=i)o=E(s,e[s],e[s+1],o);return o&&_(o,o.next)&&(w(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!_(i,i.next)&&0!==g(i.prev,i,i.next))i=i.next;else{if(w(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function r(e,t,n,u,c,d,p){if(e){!p&&d&&function(e,t,n,i){var r=e;do{0===r.z&&(r.z=h(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,s,o,a,l,u=1;do{for(n=e,e=null,s=null,o=0;n;){for(o++,i=n,a=0,t=0;t<u&&(a++,i=i.nextZ);t++);for(l=u;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;n=i}s.nextZ=null,u*=2}while(o>1)}(r)}(e,u,c,d);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):s(e))t.push(f.i/n|0),t.push(e.i/n|0),t.push(m.i/n|0),w(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?r(e=a(i(e),t,n),t,n,u,c,d,2):2===p&&l(e,t,n,u,c,d):r(i(e),t,n,u,c,d,1);break}}}function s(e){var t=e.prev,n=e,i=e.next;if(g(t,n,i)>=0)return!1;for(var r=t.x,s=n.x,o=i.x,a=t.y,l=n.y,u=i.y,c=r<s?r<o?r:o:s<o?s:o,d=a<l?a<u?a:u:l<u?l:u,h=r>s?r>o?r:o:s>o?s:o,p=a>l?a>u?a:u:l>u?l:u,m=i.next;m!==t;){if(m.x>=c&&m.x<=h&&m.y>=d&&m.y<=p&&f(r,a,s,l,o,u,m.x,m.y)&&g(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(e,t,n,i){var r=e.prev,s=e,o=e.next;if(g(r,s,o)>=0)return!1;for(var a=r.x,l=s.x,u=o.x,c=r.y,d=s.y,p=o.y,m=a<l?a<u?a:u:l<u?l:u,_=c<d?c<p?c:p:d<p?d:p,y=a>l?a>u?a:u:l>u?l:u,v=c>d?c>p?c:p:d>p?d:p,b=h(m,_,t,n,i),T=h(y,v,t,n,i),x=e.prevZ,E=e.nextZ;x&&x.z>=b&&E&&E.z<=T;){if(x.x>=m&&x.x<=y&&x.y>=_&&x.y<=v&&x!==r&&x!==o&&f(a,c,l,d,u,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,E.x>=m&&E.x<=y&&E.y>=_&&E.y<=v&&E!==r&&E!==o&&f(a,c,l,d,u,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;x&&x.z>=b;){if(x.x>=m&&x.x<=y&&x.y>=_&&x.y<=v&&x!==r&&x!==o&&f(a,c,l,d,u,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;E&&E.z<=T;){if(E.x>=m&&E.x<=y&&E.y>=_&&E.y<=v&&E!==r&&E!==o&&f(a,c,l,d,u,p,E.x,E.y)&&g(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(e,t,n){var r=e;do{var s=r.prev,o=r.next.next;!_(s,o)&&y(s,r,r.next,o)&&T(s,o)&&T(o,s)&&(t.push(s.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),w(r),w(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,s,o,a){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=x(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,s,o,a,0),void r(c,t,n,s,o,a,0)}u=u.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function c(e,t){var n=function(e,t){var n,i=t,r=e.x,s=e.y,o=-1/0;do{if(s<=i.y&&s>=i.next.y&&i.next.y!==i.y){var a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>o&&(o=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==t);if(!n)return null;var l,u=n,c=n.x,h=n.y,p=1/0;i=n;do{r>=i.x&&i.x>=c&&r!==i.x&&f(s<h?r:o,s,c,h,s<h?o:r,s,i.x,i.y)&&(l=Math.abs(s-i.y)/(r-i.x),T(i,e)&&(l<p||l===p&&(i.x>n.x||i.x===n.x&&d(n,i)))&&(n=i,p=l)),i=i.next}while(i!==u);return n}(e,t);if(!n)return t;var r=x(n,e);return i(r,r.next),i(n,n.next)}function d(e,t){return g(e.prev,e,t.prev)<0&&g(t.next,e,e.next)<0}function h(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function f(e,t,n,i,r,s,o,a){return(r-o)*(t-a)>=(e-o)*(s-a)&&(e-o)*(i-a)>=(n-o)*(t-a)&&(n-o)*(s-a)>=(r-o)*(i-a)}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&y(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(T(e,t)&&T(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(g(e.prev,e,t.prev)||g(e,t.prev,t))||_(e,t)&&g(e.prev,e,e.next)>0&&g(t.prev,t,t.next)>0)}function g(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function _(e,t){return e.x===t.x&&e.y===t.y}function y(e,t,n,i){var r=b(g(e,t,n)),s=b(g(e,t,i)),o=b(g(n,i,e)),a=b(g(n,i,t));return r!==s&&o!==a||(!(0!==r||!v(e,n,t))||(!(0!==s||!v(e,i,t))||(!(0!==o||!v(n,e,i))||!(0!==a||!v(n,t,i)))))}function v(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function b(e){return e>0?1:e<0?-1:0}function T(e,t){return g(e.prev,e,e.next)<0?g(e,t,e.next)>=0&&g(e,e.prev,t)>=0:g(e,t,e.prev)<0||g(e,e.next,t)<0}function x(e,t){var n=new I(e.i,e.x,e.y),i=new I(t.i,t.x,t.y),r=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function E(e,t,n,i){var r=new I(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function w(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,n,i){for(var r=0,s=t,o=n-i;s<n;s+=i)r+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return r}e.exports=t,e.exports.default=t,t.deviation=function(e,t,n,i){var r=t&&t.length,s=r?t[0]*n:e.length,o=Math.abs(A(e,0,s,n));if(r)for(var a=0,l=t.length;a<l;a++){var u=t[a]*n,c=a<l-1?t[a+1]*n:e.length;o-=Math.abs(A(e,u,c,n))}var d=0;for(a=0;a<i.length;a+=3){var h=i[a]*n,p=i[a+1]*n,f=i[a+2]*n;d+=Math.abs((e[h]-e[f])*(e[p+1]-e[h+1])-(e[h]-e[p])*(e[f+1]-e[h+1]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},t.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var s=0;s<e[r].length;s++)for(var o=0;o<t;o++)n.vertices.push(e[r][s][o]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}},30228:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,s||e,o),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},a.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,r,s,o){var a=n?n+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,r),!0;case 5:return c.fn.call(c.context,t,i,r,s),!0;case 6:return c.fn.call(c.context,t,i,r,s,o),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var h,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,i);break;case 4:c[u].fn.call(c[u].context,t,i,r);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];c[u].fn.apply(c[u].context,l)}}return!0},a.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,i,r){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||i&&a.context!==i||o(this,s);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||r&&!a[l].once||i&&a[l].context!==i)&&u.push(a[l]);u.length?this._events[s]=1===u.length?u[0]:u:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a},37007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(n,i){function r(n){e.removeListener(t,s),i(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,r,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,s,o,u;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=l(e))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,u=c,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=c.bind(i);return r.listener=n,i.wrapFn=r,r}function h(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):f(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function m(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function r(s){i.once&&e.removeEventListener(t,r),n(s)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=f(l,u);for(n=0;n<u;++n)i(c[n],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,i,r,s,o;if(a(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,s=Object.keys(n);for(i=0;i<s.length;++i)"removeListener"!==(r=s[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},32017:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;0!==r--;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!=t&&n!=n}},72492:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var n,i="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(n=t.cmp,function(e){return function(t,i){var r={key:t,value:e[t]},s={key:i,value:e[i]};return n(r,s)}}),s=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var n,o;if(Array.isArray(t)){for(o="[",n=0;n<t.length;n++)n&&(o+=","),o+=e(t[n])||"null";return o+"]"}if(null===t)return"null";if(-1!==s.indexOf(t)){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=s.push(t)-1,l=Object.keys(t).sort(r&&r(t));for(o="",n=0;n<l.length;n++){var u=l[n],c=e(t[u]);c&&(o&&(o+=","),o+=JSON.stringify(u)+":"+c)}return s.splice(a,1),"{"+o+"}"}}(e)}},8748:e=>{"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,function(e,t){return t.toUpperCase()})}},70480:(e,t,n)=>{"use strict";var i=n(8748),r=/^-ms-/;e.exports=function(e){return i(e.replace(r,"ms-"))}},59395:e=>{"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},13998:e=>{"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},61254:(e,t,n)=>{"use strict";var i=n(13998),r=/^ms-/;e.exports=function(e){return i(e).replace(r,"-ms-")}},94793:e=>{"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},14594:(e,t,n)=>{"use strict";var i=n(59395);e.exports=i},4213:function(e,t,n){var i,r,s;r=[],void 0===(s="function"==typeof(i=function(){"use strict";function t(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}function i(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){l(i.response,t,n)},i.onerror=function(){console.error("could not download file")},i.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,t,n){var a=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?s(l):r(l.href)?i(e,t,n):s(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout(function(){a.revokeObjectURL(l.href)},4e4),setTimeout(function(){s(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,n,o){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,o),n);else if(r(e))i(e,n,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){s(a)})}}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return i(e,t,n);var s="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||s&&l||a)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});o.saveAs=l.saveAs=l,e.exports=l})?i.apply(t,r):i)||(e.exports=s)},52208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowStart:!0,gridRowEnd:!0,gridColumn:!0,gridColumnStart:!0,gridColumnEnd:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};var i=["Webkit","ms","Moz","O"];Object.keys(n).forEach(function(e){i.forEach(function(t){n[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(t,e)]=n[e]})});var r={isUnitlessNumber:n,shorthandPropertyExpansions:{background:{backgroundAttachment:!0,backgroundColor:!0,backgroundImage:!0,backgroundPositionX:!0,backgroundPositionY:!0,backgroundRepeat:!0},backgroundPosition:{backgroundPositionX:!0,backgroundPositionY:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0},outline:{outlineWidth:!0,outlineStyle:!0,outlineColor:!0}}};t.default=r},11104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(52208));r(n(14594));function r(e){return e&&e.__esModule?e:{default:e}}var s=i.default.isUnitlessNumber;t.default=function(e,t,n){return null==t||"boolean"==typeof t||""===t?"":isNaN(t)||0===t||s.hasOwnProperty(e)&&s[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}},26050:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processStyleName=void 0,t.createMarkupForStyles=function(e,t){var n="";for(var r in e){var s=0===r.indexOf("--");if(e.hasOwnProperty(r)&&"label"!==r){var o=e[r];0,null!=o&&(s?n+=r+":"+o+";":(n+=a(r)+":",n+=(0,i.default)(r,o,t)+";"))}}return n||null};o(n(70480));var i=o(n(11104)),r=o(n(61254)),s=o(n(94793));o(n(14594));function o(e){return e&&e.__esModule?e:{default:e}}var a=t.processStyleName=(0,s.default)(r.default)},5960:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="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};function i(e){if(function(e){return null==e||!1===e||"object"===(void 0===e?"undefined":n(e))&&0===Object.keys(e).length}(e))return null;if("object"!==(void 0===e?"undefined":n(e)))return e;for(var t={},i=Object.keys(e),s=!1,o=0;o<i.length;o++){var a=e[i[o]],l=r(a);null!==l&&l===a||(s=!0),null!==l&&(t[i[o]]=l)}return 0===Object.keys(t).length?null:s?t:e}function r(e){return Array.isArray(e)?(n=!1,s=[],(t=e).forEach(function(e){var t=r(e);null!==t&&t===e||(n=!0),null!==t&&s.push(t)}),0==s.length?null:n?s:t):i(e);var t,n,s}t.default=r},2493:(e,t)=>{"use strict";function n(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function i(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function r(e,t){return(65535&(e|=0))*(t|=0)+(((e>>>16)*t&65535)<<16)|0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var s=1540483477,o=t^e.length,a=e.length,l=0;for(;a>=4;){var u=n(e,l);u=r(u,s),u=r(u^=u>>>24,s),o=r(o,s),o^=u,l+=4,a-=4}switch(a){case 3:o^=i(e,l),o=r(o^=e.charCodeAt(l+2)<<16,s);break;case 2:o=r(o^=i(e,l),s);break;case 1:o=r(o^=e.charCodeAt(l),s)}return o=r(o^=o>>>13,s),(o^=o>>>15)>>>0}},38205:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compose=t.merge=t.$=t.style=t.presets=t.keyframes=t.fontFace=t.insertGlobal=t.insertRule=t.plugins=t.styleSheet=void 0,t.speedy=function(e){return d.speedy(e)},t.simulations=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];g=!!e},t.simulate=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!(t=(0,o.default)(t)))return{};if(!g)return _||(console.warn("can't simulate without once calling simulations(true)"),_=!0),p||f||y||(console.warn("don't use simulation outside dev"),y=!0),{};return t.reduce(function(e,t){return e["data-simulate-"+b(t)]="",e},{})},t.cssLabels=function(e){v=!!e},t.isLikeRule=x,t.idFor=E,t.css=H,t.rehydrate=function(e){(0,i.default)(M,e.reduce(function(e,t){return e[t]=!0,e},{}))},t.flush=function(){M=d.inserted={},k=d.registered={},N={},d.flush(),d.inject()},t.select=X,t.parent=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return H(c({},e+" &",n))},t.media=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return H(c({},"@media "+e,n))},t.pseudo=q,t.active=function(e){return q(":active",e)},t.any=function(e){return q(":any",e)},t.checked=function(e){return q(":checked",e)},t.disabled=function(e){return q(":disabled",e)},t.empty=function(e){return q(":empty",e)},t.enabled=function(e){return q(":enabled",e)},t._default=function(e){return q(":default",e)},t.first=function(e){return q(":first",e)},t.firstChild=function(e){return q(":first-child",e)},t.firstOfType=function(e){return q(":first-of-type",e)},t.fullscreen=function(e){return q(":fullscreen",e)},t.focus=function(e){return q(":focus",e)},t.hover=function(e){return q(":hover",e)},t.indeterminate=function(e){return q(":indeterminate",e)},t.inRange=function(e){return q(":in-range",e)},t.invalid=function(e){return q(":invalid",e)},t.lastChild=function(e){return q(":last-child",e)},t.lastOfType=function(e){return q(":last-of-type",e)},t.left=function(e){return q(":left",e)},t.link=function(e){return q(":link",e)},t.onlyChild=function(e){return q(":only-child",e)},t.onlyOfType=function(e){return q(":only-of-type",e)},t.optional=function(e){return q(":optional",e)},t.outOfRange=function(e){return q(":out-of-range",e)},t.readOnly=function(e){return q(":read-only",e)},t.readWrite=function(e){return q(":read-write",e)},t.required=function(e){return q(":required",e)},t.right=function(e){return q(":right",e)},t.root=function(e){return q(":root",e)},t.scope=function(e){return q(":scope",e)},t.target=function(e){return q(":target",e)},t.valid=function(e){return q(":valid",e)},t.visited=function(e){return q(":visited",e)},t.dir=function(e,t){return q(":dir("+e+")",t)},t.lang=function(e,t){return q(":lang("+e+")",t)},t.not=function(e,t){var n=e.split(",").map(function(e){return e.trim()}).map(function(e){return":not("+e+")"});if(1===n.length)return q(":not("+e+")",t);return X(n.join(""),t)},t.nthChild=function(e,t){return q(":nth-child("+e+")",t)},t.nthLastChild=function(e,t){return q(":nth-last-child("+e+")",t)},t.nthLastOfType=function(e,t){return q(":nth-last-of-type("+e+")",t)},t.nthOfType=function(e,t){return q(":nth-of-type("+e+")",t)},t.after=function(e){return q("::after",e)},t.before=function(e){return q("::before",e)},t.firstLetter=function(e){return q("::first-letter",e)},t.firstLine=function(e){return q("::first-line",e)},t.selection=function(e){return q("::selection",e)},t.backdrop=function(e){return q("::backdrop",e)},t.placeholder=function(e){return H({"::placeholder":e})},t.cssFor=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(t=(0,o.default)(t))?t.map(function(e){var t={label:[]};return $(t,{src:e}),O(T(t),C(t)).join("")}).join(""):""},t.attribsFor=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(t=(0,o.default)(t))?t.map(function(e){E(e);var t=Object.keys(e)[0];return t+'="'+(e[t]||"")+'"'}).join(" "):""};var i=u(n(45228)),r=n(56314),s=n(26050),o=u(n(5960)),a=n(77769),l=u(n(2493));function u(e){return e&&e.__esModule?e:{default:e}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=t.styleSheet=new r.StyleSheet;d.inject();var h=t.plugins=d.plugins=new a.PluginSet([a.prefixes,a.contentWrap,a.fallbacks]);h.media=new a.PluginSet,h.fontFace=new a.PluginSet,h.keyframes=new a.PluginSet([a.prefixes,a.fallbacks]);var p=!1,f=!1,m="undefined"!=typeof window,g=p,_=!1,y=!1;var v=p;function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.toLowerCase().replace(/[^a-z0-9]/g,t)}function T(e){var t=JSON.stringify(e),n=(0,l.default)(t).toString(36);return e.label&&e.label.length>0&&p?b(e.label.join("."),"-")+"-"+n:n}function x(e){var t=Object.keys(e).filter(function(e){return"toString"!==e});return 1===t.length&&!!/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0])}function E(e){var t=Object.keys(e).filter(function(e){return"toString"!==e});if(1!==t.length)throw new Error("not a rule");var n=/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0]);if(!n)throw new Error("not a rule");return n[1]}var w=/[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g;function I(e){if(-1===e.indexOf(","))return[e];for(var t,n=[],i=[],r=0;t=w.exec(e);)switch(t[0]){case"(":r++;break;case")":r--;break;case",":if(r)break;n.push(t.index)}for(t=n.length;t--;)i.unshift(e.slice(n[t]+1)),e=e.slice(0,n[t]);return i.unshift(e),i}function A(e,t){if(!e)return t.replace(/\&/g,"");if(!t)return".css-"+e+",[data-css-"+e+"]";var n=I(t).map(function(t){return t.indexOf("&")>=0?[t.replace(/\&/gm,".css-"+e),t.replace(/\&/gm,"[data-css-"+e+"]")].join(","):".css-"+e+t+",[data-css-"+e+"]"+t}).join(",");return g&&/^\&\:/.exec(t)&&!/\s/.exec(t)&&(n+=",.css-"+e+"[data-simulate-"+b(t)+"],[data-css-"+e+"][data-simulate-"+b(t)+"]"),n}function S(e){var t=e.selector,n=e.style,i=h.transform({selector:t,style:n});return i.selector+"{"+(0,s.createMarkupForStyles)(i.style)+"}"}function C(e){var t=void 0,n=void 0,i=void 0,r=void 0;return Object.keys(e).forEach(function(s){s.indexOf("&")>=0?(n=n||{})[s]=e[s]:0===s.indexOf("@media")?(i=i||{})[s]=C(e[s]):0===s.indexOf("@supports")?(r=r||{})[s]=C(e[s]):"label"===s?e.label.length>0&&((t=t||{}).label=v?e.label.join("."):""):(t=t||{})[s]=e[s]}),{plain:t,selects:n,medias:i,supports:r}}function O(e,t){var n=[],i=t.plain,r=t.selects,s=t.medias,o=t.supports;return i&&n.push(S({style:i,selector:A(e)})),r&&Object.keys(r).forEach(function(t){return n.push(S({style:r[t],selector:A(e,t)}))}),s&&Object.keys(s).forEach(function(t){return n.push(t+"{"+O(e,s[t]).join("")+"}")}),o&&Object.keys(o).forEach(function(t){return n.push(t+"{"+O(e,o[t]).join("")+"}")}),n}var M=d.inserted={};var k=d.registered={};function R(e){k[e.id]||(k[e.id]=e)}var N={};function D(e){if(R(e),function(e){if(!M[e.id]){M[e.id]=!0;var t=C(e.style),n=O(e.id,t);M[e.id]=!!m||n,n.forEach(function(e){return d.insert(e)})}}(e),N[e.id])return N[e.id];var t=c({},"data-css-"+e.id,v&&e.label||"");return Object.defineProperty(t,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),N[e.id]=t,t}function F(e,t){var n=I(e).map(function(e){return e.indexOf("&")>=0?e:"&"+e}),i=I(t).map(function(e){return e.indexOf("&")>=0?e:"&"+e});return i.reduce(function(e,t){return e.concat(n.map(function(e){return t.replace(/\&/g,e)}))},[]).join(",")}function L(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function P(e){for(var t=[],n=0;n<e.length;n++)t=Array.isArray(e[n])?t.concat(P(e[n])):t.concat(e[n]);return t}var B={"::placeholder":["::-webkit-input-placeholder","::-moz-placeholder","::-ms-input-placeholder"],":fullscreen":[":-webkit-full-screen",":-moz-full-screen",":-ms-fullscreen"]};function $(e,t){var n=t.selector,i=void 0===n?"":n,r=t.mq,s=void 0===r?"":r,a=t.supp,l=void 0===a?"":a,u=t.src,c=void 0===u?{}:u;Array.isArray(c)||(c=[c]),(c=P(c)).forEach(function(t){if(x(t)){var n=function(e){if(x(e)){var t=k[E(e)];if(null==t)throw new Error("[glamor] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79");return t}return e}(t);if("css"!==n.type)throw new Error("cannot merge this rule");t=n.style}(t=(0,o.default)(t))&&t.composes&&$(e,{selector:i,mq:s,supp:l,src:t.composes}),Object.keys(t||{}).forEach(function(n){if(function(e){for(var t=[":",".","[",">"," "],n=!1,i=e.charAt(0),r=0;r<t.length;r++)if(i===t[r]){n=!0;break}return n||e.indexOf("&")>=0}(n))B[n]&&B[n].forEach(function(r){return $(e,{selector:F(i,r),mq:s,supp:l,src:t[n]})}),$(e,{selector:F(i,n),mq:s,supp:l,src:t[n]});else if(function(e){return 0===e.indexOf("@media")}(n))$(e,{selector:i,mq:(o=s,a=n,o?"@media "+o.substring(6)+" and "+a.substring(6):a),supp:l,src:t[n]});else if(function(e){return 0===e.indexOf("@supports")}(n))$(e,{selector:i,mq:s,supp:L(l,n),src:t[n]});else if("composes"===n);else{var r=e;l&&(r[l]=r[l]||{},r=r[l]),s&&(r[s]=r[s]||{},r=r[s]),i&&(r[i]=r[i]||{},r=r[i]),"label"===n?v&&(e.label=e.label.concat(t.label)):r[n]=t[n]}var o,a})})}function U(e){var t={label:[]};return $(t,{src:e}),D({id:T(t),style:t,label:v?t.label.join("."):"",type:"css"})}var V={};Object.defineProperty(V,"toString",{enumerable:!1,value:function(){return"css-nil"}});var z="undefined"!=typeof WeakMap?[V,new WeakMap,new WeakMap,new WeakMap]:[V],j=!1;var Y,G="undefined"!=typeof WeakMap?(Y=U,function(e){if(z[e.length]){for(var t=z[e.length],n=0;n<e.length-1;)t.has(e[n])||t.set(e[n],new WeakMap),t=t.get(e[n]),n++;if(t.has(e[e.length-1])){var i=t.get(e[n]);if(k[i.toString().substring(4)])return i}}var r=Y(e);if(z[e.length]){for(var s=0,o=z[e.length];s<e.length-1;)o=o.get(e[s]),s++;try{o.set(e[s],r)}catch(t){var a;p&&!j&&(j=!0,(a=console).warn.apply(a,["failed setting the WeakMap cache for args:"].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(e))),console.warn("this should NOT happen, please file a bug on the github repo."))}}return r}):U;function H(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0]&&t[0].length&&t[0].raw)throw new Error("you forgot to include glamor/babel in your babel plugins.");return(t=(0,o.default)(t))?G(t):V}H.insert=function(e){var t={id:T(e),css:e,type:"raw"};R(t),M[t.id]||(d.insert(t.css),M[t.id]=!!m||[t.css])};t.insertRule=H.insert;H.global=function(e,t){if(t=(0,o.default)(t))return H.insert(S({selector:e,style:t}))};t.insertGlobal=H.global;H.keyframes=function(e,t){t||(t=e,e="animation");var n={id:T({name:e,kfs:t=(0,o.default)(t)||{}}),type:"keyframes",name:e,keyframes:t};return R(n),function(e){if(!M[e.id]){var t=Object.keys(e.keyframes).map(function(t){var n=h.keyframes.transform({id:e.id,name:t,style:e.keyframes[t]});return n.name+"{"+(0,s.createMarkupForStyles)(n.style)+"}"}).join(""),n=["-webkit-","-moz-","-o-",""].map(function(n){return"@"+n+"keyframes "+e.name+"_"+e.id+"{"+t+"}"});n.forEach(function(e){return d.insert(e)}),M[e.id]=!!m||n}}(n),e+"_"+n.id},H.fontFace=function(e){var t={id:T(e=(0,o.default)(e)),type:"font-face",font:e};return R(t),function(e){if(!M[e.id]){var t="@font-face{"+(0,s.createMarkupForStyles)(e.font)+"}";d.insert(t),M[e.id]=!!m||[t]}}(t),e.fontFamily};t.fontFace=H.fontFace,t.keyframes=H.keyframes;t.presets={mobile:"(min-width: 400px)",Mobile:"@media (min-width: 400px)",phablet:"(min-width: 550px)",Phablet:"@media (min-width: 550px)",tablet:"(min-width: 750px)",Tablet:"@media (min-width: 750px)",desktop:"(min-width: 1000px)",Desktop:"@media (min-width: 1000px)",hd:"(min-width: 1200px)",Hd:"@media (min-width: 1200px)"};var W=t.style=H;function X(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e?H(c({},e,n)):W(n)}t.$=X;t.merge=H,t.compose=H;function q(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return H(c({},e,n))}},77769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};t.PluginSet=l,t.fallbacks=function(e){if(Object.keys(e.style).map(function(t){return Array.isArray(e.style[t])}).indexOf(!0)>=0){var t=e.style,n=Object.keys(t).reduce(function(e,n){return e[n]=Array.isArray(t[n])?t[n].join("; "+(0,s.processStyleName)(n)+": "):t[n],e},{});return(0,r.default)({},e,{style:n})}return e},t.contentWrap=function(e){if(e.style.content){var t=e.style.content;return u.indexOf(t)>=0||/^(attr|calc|counters?|url)\(/.test(t)?e:t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)?i({},e,{style:i({},e.style,{content:'"'+t+'"'})}):e}return e},t.prefixes=function(e){return(0,r.default)({},e,{style:(0,o.default)(i({},e.style))})};var r=a(n(45228)),s=n(26050),o=a(n(19654));function a(e){return e&&e.__esModule?e:{default:e}}function l(e){this.fns=e||[]}(0,r.default)(l.prototype,{add:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];n.forEach(function(t){e.fns.indexOf(t)>=0||(e.fns=[t].concat(e.fns))})},remove:function(e){this.fns=this.fns.filter(function(t){return t!==e})},clear:function(){this.fns=[]},transform:function(e){return this.fns.reduce(function(e,t){return t(e)},e)}});var u=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit"]},19654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){for(var t in e){var n=e[t],i=(0,s.default)(_,t,n,e,y);i&&(e[t]=i),(0,r.default)(y,t,e)}return e};var i=g(n(10113)),r=g(n(84397)),s=g(n(66127)),o=g(n(91244)),a=g(n(93038)),l=g(n(80436)),u=g(n(1421)),c=g(n(80807)),d=g(n(65086)),h=g(n(77637)),p=g(n(18877)),f=g(n(14796)),m=g(n(55309));function g(e){return e&&e.__esModule?e:{default:e}}var _=[a.default,o.default,l.default,c.default,d.default,h.default,p.default,f.default,m.default,u.default],y=i.default.prefixMap},56314:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StyleSheet=p;var i,r=n(45228),s=(i=r)&&i.__esModule?i:{default:i};function o(e){return e[e.length-1]}function a(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}var l="undefined"!=typeof window,u=!1,c=!1,d=function(){if(l){var e=document.createElement("div");return e.innerHTML="\x3c!--[if lt IE 10]><i></i><![endif]--\x3e",1===e.getElementsByTagName("i").length}}();function h(){var e=document.createElement("style");return e.type="text/css",e.setAttribute("data-glamor",""),e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function p(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.speedy,n=void 0===t?!u&&!c:t,i=e.maxLength,r=void 0===i?l&&d?4e3:65e3:i;this.isSpeedy=n,this.sheet=void 0,this.tags=[],this.maxLength=r,this.ctr=0}(0,s.default)(p.prototype,{getSheet:function(){return a(o(this.tags))},inject:function(){var e=this;if(this.injected)throw new Error("already injected stylesheet!");l?this.tags[0]=h():this.sheet={cssRules:[],insertRule:function(t){e.sheet.cssRules.push({cssText:t})}},this.injected=!0},speedy:function(e){if(0!==this.ctr)throw new Error("cannot change speedy mode after inserting any rule to sheet. Either call speedy("+e+") earlier in your app, or call flush() before speedy("+e+")");this.isSpeedy=!!e},_insert:function(e){try{var t=this.getSheet();t.insertRule(e,-1!==e.indexOf("@import")?0:t.cssRules.length)}catch(t){u&&console.warn("whoops, illegal rule inserted",e)}},insert:function(e){if(l)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(e);else if(-1!==e.indexOf("@import")){var t=o(this.tags);t.insertBefore(document.createTextNode(e),t.firstChild)}else o(this.tags).appendChild(document.createTextNode(e));else this.sheet.insertRule(e,-1!==e.indexOf("@import")?0:this.sheet.cssRules.length);return this.ctr++,l&&this.ctr%this.maxLength===0&&this.tags.push(h()),this.ctr-1},delete:function(e){return this.replace(e,"")},flush:function(){l?(this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},rules:function(){if(!l)return this.sheet.cssRules;var e=[];return this.tags.forEach(function(t){return e.splice.apply(e,[e.length,0].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(Array.from(a(t).cssRules))))}),e}})},45685:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>a});var i=/[A-Z]/g,r=/^ms-/,s={};function o(e){return"-"+e.toLowerCase()}const a=function(e){if(s.hasOwnProperty(e))return s[e];var t=e.replace(i,o);return s[e]=r.test(t)?"-"+t:t}},251:(e,t)=>{
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,l=(1<<a)-1,u=l>>1,c=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,s=p&(1<<-c)-1,p>>=-c,c+=a;c>0;s=256*s+e[t+d],d+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=i;c>0;o=256*o+e[t+d],d+=h,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,n,i,r,s){var o,a,l,u=8*s-r-1,c=(1<<u)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=c?(a=0,o=c):o+d>=1?(a=(t*l-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<<r|a,u+=r;u>0;e[n+p]=255&o,p+=f,o/=256,u-=8);e[n+p-f]|=128*m}},93038:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,s.default)(t)&&t.indexOf("cross-fade(")>-1)return o.map(function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")})};var i,r=n(44014),s=(i=r)&&i.__esModule?i:{default:i};var o=["-webkit-",""];e.exports=t.default},91244:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("cursor"===e&&i.hasOwnProperty(t))return n.map(function(e){return e+t})};var n=["-webkit-","-moz-",""],i={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};e.exports=t.default},80436:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,s.default)(t)&&t.indexOf("filter(")>-1)return o.map(function(e){return t.replace(/filter\(/g,e+"filter(")})};var i,r=n(44014),s=(i=r)&&i.__esModule?i:{default:i};var o=["-webkit-",""];e.exports=t.default},1421:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("display"===e&&n.hasOwnProperty(t))return n[t]};var n={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};e.exports=t.default},80807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){"flexDirection"===e&&"string"==typeof t&&(t.indexOf("column")>-1?r.WebkitBoxOrient="vertical":r.WebkitBoxOrient="horizontal",t.indexOf("reverse")>-1?r.WebkitBoxDirection="reverse":r.WebkitBoxDirection="normal");i.hasOwnProperty(e)&&(r[i[e]]=n[t]||t)};var n={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},i={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};e.exports=t.default},65086:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,s.default)(t)&&a.test(t))return o.map(function(e){return e+t})};var i,r=n(44014),s=(i=r)&&i.__esModule?i:{default:i};var o=["-webkit-","-moz-",""],a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;e.exports=t.default},77637:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("string"==typeof t&&!(0,s.default)(t)&&t.indexOf("image-set(")>-1)return o.map(function(e){return t.replace(/image-set\(/g,e+"image-set(")})};var i,r=n(44014),s=(i=r)&&i.__esModule?i:{default:i};var o=["-webkit-",""];e.exports=t.default},18877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]},e.exports=t.default},14796:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(i.hasOwnProperty(e)&&r.hasOwnProperty(t))return n.map(function(e){return e+t})};var n=["-webkit-","-moz-",""],i={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},r={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};e.exports=t.default},55309:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,o){if("string"==typeof t&&a.hasOwnProperty(e)){var u=function(e,t){if((0,r.default)(e))return e;for(var n=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),s=0,o=n.length;s<o;++s){var a=n[s],u=[a];for(var c in t){var d=(0,i.default)(c);if(a.indexOf(d)>-1&&"order"!==d)for(var h=t[c],p=0,f=h.length;p<f;++p)u.unshift(a.replace(d,l[h[p]]+d))}n[s]=u.join(",")}return n.join(",")}(t,o),c=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-moz-|-ms-/.test(e)}).join(",");if(e.indexOf("Webkit")>-1)return c;var d=u.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-webkit-|-ms-/.test(e)}).join(",");return e.indexOf("Moz")>-1?d:(n["Webkit"+(0,s.default)(e)]=c,n["Moz"+(0,s.default)(e)]=d,u)}};var i=o(n(65721)),r=o(n(44014)),s=o(n(87479));function o(e){return e&&e.__esModule?e:{default:e}}var a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},l={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};e.exports=t.default},10113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["Webkit"],i=["Moz"],r=["ms"],s=["Webkit","Moz"],o=["Webkit","ms"],a=["Webkit","Moz","ms"];t.default={plugins:[],prefixMap:{appearance:s,userSelect:a,textEmphasisPosition:n,textEmphasis:n,textEmphasisStyle:n,textEmphasisColor:n,boxDecorationBreak:n,clipPath:n,maskImage:n,maskMode:n,maskRepeat:n,maskPosition:n,maskClip:n,maskOrigin:n,maskSize:n,maskComposite:n,mask:n,maskBorderSource:n,maskBorderMode:n,maskBorderSlice:n,maskBorderWidth:n,maskBorderOutset:n,maskBorderRepeat:n,maskBorder:n,maskType:n,textDecorationStyle:n,textDecorationSkip:n,textDecorationLine:n,textDecorationColor:n,filter:n,fontFeatureSettings:n,breakAfter:a,breakBefore:a,breakInside:a,columnCount:s,columnFill:s,columnGap:s,columnRule:s,columnRuleColor:s,columnRuleStyle:s,columnRuleWidth:s,columns:s,columnSpan:s,columnWidth:s,writingMode:o,flex:n,flexBasis:n,flexDirection:n,flexGrow:n,flexFlow:n,flexShrink:n,flexWrap:n,alignContent:n,alignItems:n,alignSelf:n,justifyContent:n,order:n,transform:n,transformOrigin:n,transformOriginX:n,transformOriginY:n,backfaceVisibility:n,perspective:n,perspectiveOrigin:n,transformStyle:n,transformOriginZ:n,animation:n,animationDelay:n,animationDirection:n,animationFillMode:n,animationDuration:n,animationIterationCount:n,animationName:n,animationPlayState:n,animationTimingFunction:n,backdropFilter:n,fontKerning:n,scrollSnapType:o,scrollSnapPointsX:o,scrollSnapPointsY:o,scrollSnapDestination:o,scrollSnapCoordinate:o,shapeImageThreshold:n,shapeImageMargin:n,shapeImageOutside:n,hyphens:a,flowInto:o,flowFrom:o,regionFragment:o,textAlignLast:i,tabSize:i,wrapFlow:r,wrapThrough:r,wrapMargin:r,gridTemplateColumns:r,gridTemplateRows:r,gridTemplateAreas:r,gridTemplate:r,gridAutoColumns:r,gridAutoRows:r,gridAutoFlow:r,grid:r,gridRowStart:r,gridColumnStart:r,gridRowEnd:r,gridRow:r,gridColumn:r,gridColumnEnd:r,gridColumnGap:r,gridRowGap:r,gridArea:r,gridGap:r,textSizeAdjust:o,borderImage:n,borderImageOutset:n,borderImageRepeat:n,borderImageSlice:n,borderImageSource:n,borderImageWidth:n,transitionDelay:n,transitionDuration:n,transitionProperty:n,transitionTimingFunction:n}},e.exports=t.default},87479:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},e.exports=t.default},84397:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(e.hasOwnProperty(t))for(var i=e[t],r=0,o=i.length;r<o;++r)n[i[r]+(0,s.default)(t)]=n[t]};var i,r=n(87479),s=(i=r)&&i.__esModule?i:{default:i};e.exports=t.default},66127:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,r){for(var s=0,o=e.length;s<o;++s){var a=e[s](t,n,i,r);if(a)return a}},e.exports=t.default},71710:(e,t,n)=>{
/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/
e.exports=function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){return r(t[o][1][e]||e)},u,u.exports,e,t,n,i)}return n[o].exports}for(var s=void 0,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t,n){"use strict";var i=e("./utils"),r=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,r,o,a,l,u,c=[],d=0,h=e.length,p=h,f="string"!==i.getTypeOf(e);d<e.length;)p=h-d,r=f?(t=e[d++],n=d<h?e[d++]:0,d<h?e[d++]:0):(t=e.charCodeAt(d++),n=d<h?e.charCodeAt(d++):0,d<h?e.charCodeAt(d++):0),o=t>>2,a=(3&t)<<4|n>>4,l=1<p?(15&n)<<2|r>>6:64,u=2<p?63&r:64,c.push(s.charAt(o)+s.charAt(a)+s.charAt(l)+s.charAt(u));return c.join("")},n.decode=function(e){var t,n,i,o,a,l,u=0,c=0,d="data:";if(e.substr(0,d.length)===d)throw new Error("Invalid base64 input, it looks like a data url.");var h,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&p--,e.charAt(e.length-2)===s.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=r.uint8array?new Uint8Array(0|p):new Array(0|p);u<e.length;)t=s.indexOf(e.charAt(u++))<<2|(o=s.indexOf(e.charAt(u++)))>>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(u++)))>>2,i=(3&a)<<6|(l=s.indexOf(e.charAt(u++))),h[c++]=t,64!==a&&(h[c++]=n),64!==l&&(h[c++]=i);return h}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var i=e("./external"),r=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function a(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,n){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var i=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==i.getTypeOf(e)?function(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,n,i){var s=r,o=i+n;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var i=null;i="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:i}},{lie:37}],7:[function(e,t,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),s=e("./utils"),o=e("./stream/GenericWorker"),a=i?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",s.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function i(e,t){var n,i="";for(n=0;n<t;n++)i+=String.fromCharCode(255&e),e>>>=8;return i}function r(e,t,n,r,o,c){var d,h,p=e.file,f=e.compression,m=c!==a.utf8encode,g=s.transformTo("string",c(p.name)),_=s.transformTo("string",a.utf8encode(p.name)),y=p.comment,v=s.transformTo("string",c(y)),b=s.transformTo("string",a.utf8encode(y)),T=_.length!==p.name.length,x=b.length!==y.length,E="",w="",I="",A=p.dir,S=p.date,C={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),m||!T&&!x||(O|=2048);var M=0,k=0;A&&(M|=16),"UNIX"===o?(k=798,M|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,A)):(k=20,M|=function(e){return 63&(e||0)}(p.dosPermissions)),d=S.getUTCHours(),d<<=6,d|=S.getUTCMinutes(),d<<=5,d|=S.getUTCSeconds()/2,h=S.getUTCFullYear()-1980,h<<=4,h|=S.getUTCMonth()+1,h<<=5,h|=S.getUTCDate(),T&&(w=i(1,1)+i(l(g),4)+_,E+="up"+i(w.length,2)+w),x&&(I=i(1,1)+i(l(v),4)+b,E+="uc"+i(I.length,2)+I);var R="";return R+="\n\0",R+=i(O,2),R+=f.magic,R+=i(d,2),R+=i(h,2),R+=i(C.crc32,4),R+=i(C.compressedSize,4),R+=i(C.uncompressedSize,4),R+=i(g.length,2),R+=i(E.length,2),{fileRecord:u.LOCAL_FILE_HEADER+R+g+E,dirRecord:u.CENTRAL_FILE_HEADER+i(k,2)+R+i(v.length,2)+"\0\0\0\0"+i(M,4)+i(r,4)+g+E+v}}var s=e("../utils"),o=e("../stream/GenericWorker"),a=e("../utf8"),l=e("../crc32"),u=e("../signature");function c(e,t,n,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(c,o),c.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=r(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+i(e.crc32,4)+i(e.compressedSize,4)+i(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,r=function(e,t,n,r,o){var a=s.transformTo("string",o(r));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(e,2)+i(e,2)+i(t,4)+i(n,4)+i(a.length,2)+a}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},c.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},c.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=c},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var i=e("../compressions"),r=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var s=new r(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,n){o++;var r=function(e,t){var n=e||t,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,t.compression),a=n.options.compressionOptions||t.compressionOptions||{},l=n.dir,u=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:e,dir:l,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(s)}),s.entriesCount=o}catch(e){s.error(e)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new i;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(i.prototype=e("./object")).loadAsync=e("./load"),i.support=e("./support"),i.defaults=e("./defaults"),i.version="3.10.1",i.loadAsync=function(e,t){return(new i).loadAsync(e,t)},i.external=e("./external"),t.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){"use strict";var i=e("./utils"),r=e("./external"),s=e("./utf8"),o=e("./zipEntries"),a=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function u(e){return new r.Promise(function(t,n){var i=e.decompressed.getContentWorker().pipe(new a);i.on("error",function(e){n(e)}).on("end",function(){i.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var n=this;return t=i.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),l.isNode&&l.isStream(e)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new o(t);return n.load(e),n}).then(function(e){var n=[r.Promise.resolve(e)],i=e.files;if(t.checkCRC32)for(var s=0;s<i.length;s++)n.push(u(i[s]));return r.Promise.all(n)}).then(function(e){for(var r=e.shift(),s=r.files,o=0;o<s.length;o++){var a=s[o],l=a.fileNameStr,u=i.resolve(a.fileNameStr);n.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders}),a.dir||(n.file(u).unsafeOriginalName=l)}return r.zipComment.length&&(n.comment=r.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){"use strict";var i=e("../utils"),r=e("../stream/GenericWorker");function s(e,t){r.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}i.inherits(s,r),s.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},s.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){"use strict";var i=e("readable-stream").Readable;function r(e,t,n){i.call(this,t),this._helper=e;var r=this;e.on("data",function(e,t){r.push(e)||r._helper.pause(),n&&n(t)}).on("error",function(e){r.emit("error",e)}).on("end",function(){r.push(null)})}e("../utils").inherits(r,i),r.prototype._read=function(){this._helper.resume()},t.exports=r},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){"use strict";function i(e,t,n){var i,r=s.getTypeOf(t),a=s.extend(n||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(e=m(e)),a.createFolders&&(i=f(e))&&g.call(this,i,!0);var d="string"===r&&!1===a.binary&&!1===a.base64;n&&void 0!==n.binary||(a.binary=!d),(t instanceof u&&0===t.uncompressedSize||a.dir||!t||0===t.length)&&(a.base64=!1,a.binary=!0,t="",a.compression="STORE",r="string");var _=null;_=t instanceof u||t instanceof o?t:h.isNode&&h.isStream(t)?new p(e,t):s.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var y=new c(e,_,a);this.files[e]=y}var r=e("./utf8"),s=e("./utils"),o=e("./stream/GenericWorker"),a=e("./stream/StreamHelper"),l=e("./defaults"),u=e("./compressedObject"),c=e("./zipObject"),d=e("./generate"),h=e("./nodejsUtils"),p=e("./nodejs/NodejsStreamInputAdapter"),f=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||i.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,i;for(t in this.files)i=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,i)},filter:function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(i)}),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,i.call(this,e,t,n),this;if(_(e)){var r=e;return this.filter(function(e,t){return!t.dir&&r.test(e)})}var s=this.files[this.root+e];return s&&!s.dir?s:null},folder:function(e){if(!e)return this;if(_(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),i=this.clone();return i.root=n.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=s.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");s.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var i=n.comment||this.comment||"";t=d.generateWorker(this,n,i)}catch(e){(t=new o("error")).error(e)}return new a(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){"use strict";var i=e("./DataReader");function r(e){i.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data[this.zero+e]},r.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===t&&this.data[s+1]===n&&this.data[s+2]===i&&this.data[s+3]===r)return s-this.zero;return-1},r.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&n===s[1]&&i===s[2]&&r===s[3]},r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){"use strict";var i=e("../utils");function r(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){"use strict";var i=e("./Uint8ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var i=e("./DataReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var i=e("./ArrayReader");function r(e){i.call(this,e)}e("../utils").inherits(r,i),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var i=e("../utils"),r=e("../support"),s=e("./ArrayReader"),o=e("./StringReader"),a=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new a(e):r.uint8array?new l(i.transformTo("uint8array",e)):new s(i.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){"use strict";var i=e("./GenericWorker"),r=e("../utils");function s(e){i.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(s,i),s.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var i=e("./GenericWorker"),r=e("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,i),s.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var i=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(s,r),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var i=e("../utils"),r=e("./GenericWorker");function s(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}i.inherits(s,r),s.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function i(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=i},{}],29:[function(e,t,n){"use strict";var i=e("../utils"),r=e("./ConvertWorker"),s=e("./GenericWorker"),o=e("../base64"),a=e("../support"),l=e("../external"),u=null;if(a.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t){return new l.Promise(function(n,r){var s=[],a=e._internalType,l=e._outputType,u=e._mimeType;e.on("data",function(e,n){s.push(e),t&&t(n)}).on("error",function(e){s=[],r(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),n);case"base64":return o.encode(t);default:return i.transformTo(e,t)}}(l,function(e,t){var n,i=0,r=null,s=0;for(n=0;n<t.length;n++)s+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(s),n=0;n<t.length;n++)r.set(t[n],i),i+=t[n].length;return r;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(a,s),u);n(e)}catch(e){r(e)}s=[]}).resume()})}function d(e,t,n){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=n,i.checkSupport(o),this._worker=e.pipe(new r(o)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}d.prototype={accumulate:function(e){return c(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){i.delay(t,arguments,n)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(i),n.blob=0===r.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var i=e("./utils"),r=e("./support"),s=e("./nodejsUtils"),o=e("./stream/GenericWorker"),a=new Array(256),l=0;l<256;l++)a[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function c(){o.call(this,"utf-8 encode")}a[254]=a[254]=1,n.utf8encode=function(e){return r.nodebuffer?s.newBufferFrom(e,"utf-8"):function(e){var t,n,i,s,o,a=e.length,l=0;for(s=0;s<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(i-56320),s++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=r.uint8array?new Uint8Array(l):new Array(l),s=o=0;o<l;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(i-56320),s++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return r.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,s,o=e.length,l=new Array(2*o);for(t=n=0;t<o;)if((r=e[t++])<128)l[n++]=r;else if(4<(s=a[r]))l[n++]=65533,t+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&t<o;)r=r<<6|63&e[t++],s--;1<s?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),i.applyFromCharCode(l)}(e=i.transformTo(r.uint8array?"uint8array":"array",e))},i.inherits(u,o),u.prototype.processChunk=function(e){var t=i.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var s=t;(t=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),t.set(s,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}(t),l=t;o!==t.length&&(r.uint8array?(l=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(l=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,i.inherits(c,o),c.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var i=e("./support"),r=e("./base64"),s=e("./nodejsUtils"),o=e("./external");function a(e){return e}function l(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(e),i.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,n){var i=[],r=0,s=e.length;if(s<=n)return String.fromCharCode.apply(null,e);for(;r<s;)"array"===t||"nodebuffer"===t?i.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+n,s)))):i.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+n,s)))),r+=n;return i.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(e){return!1}}()}};function c(e){var t=65536,i=n.getTypeOf(e),r=!0;if("uint8array"===i?r=u.applyCanBeUsed.uint8array:"nodebuffer"===i&&(r=u.applyCanBeUsed.nodebuffer),r)for(;1<t;)try{return u.stringifyByChunk(e,i,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=c;var h={};h.string={string:a,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,s.allocBuffer(e.length))}},h.array={string:c,array:a,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(e)}},h.arraybuffer={string:function(e){return c(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:a,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:c,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:a,nodebuffer:function(e){return s.newBufferFrom(e)}},h.nodebuffer={string:c,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:a},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var i=n.getTypeOf(t);return h[i][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],i=0;i<t.length;i++){var r=t[i];"."===r||""===r&&0!==i&&i!==t.length-1||(".."===r?n.pop():n.push(r))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":i.nodebuffer&&s.isBuffer(e)?"nodebuffer":i.uint8array&&e instanceof Uint8Array?"uint8array":i.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!i[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,i="";for(n=0;n<(e||"").length;n++)i+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return i},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,s,a,u){return o.Promise.resolve(t).then(function(e){return i.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new o.Promise(function(t,n){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=function(e){n(e.target.error)},i.readAsArrayBuffer(e)}):e}).then(function(t){var c=n.getTypeOf(t);return c?("arraybuffer"===c?t=n.transformTo("uint8array",t):"string"===c&&(u?t=r.decode(t):s&&!0!==a&&(t=function(e){return l(e,i.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):o.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){"use strict";var i=e("./reader/readerFor"),r=e("./utils"),s=e("./signature"),o=e("./zipEntry"),a=e("./support");function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(t)+", expected "+r.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var i=this.reader.readString(4)===t;return this.reader.setIndex(n),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=a.uint8array?"uint8array":"array",n=r.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,i=this.zip64EndOfCentralSize-44;0<i;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=t-n;if(0<i)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(e){this.reader=i(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){"use strict";var i=e("./reader/readerFor"),r=e("./utils"),s=e("./compressedObject"),o=e("./crc32"),a=e("./utf8"),l=e("./compressions"),u=e("./support");function c(e,t){this.options=e,this.loadOptions=t}c.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(Object.prototype.hasOwnProperty.call(l,t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<r;)t=e.readInt(2),n=e.readInt(2),i=e.readData(n),this.extraFields[t]={id:t,length:n,value:i};e.setIndex(r)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=r.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var s=r.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=i(e.value);return 1!==t.readInt(1)||o(this.fileName)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=i(e.value);return 1!==t.readInt(1)||o(this.fileComment)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null}},t.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){"use strict";function i(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var r=e("./stream/StreamHelper"),s=e("./stream/DataWorker"),o=e("./utf8"),a=e("./compressedObject"),l=e("./stream/GenericWorker");i.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var i="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var s=!this._dataBinary;s&&!i&&(t=t.pipe(new o.Utf8EncodeWorker)),!s&&i&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new r(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof a&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),a.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof a?this._data.getContentWorker():this._data instanceof l?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<u.length;d++)i.prototype[u[d]]=c;t.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,i){(function(e){"use strict";var n,i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var s=0,o=new r(c),a=e.document.createTextNode("");o.observe(a,{characterData:!0}),n=function(){a.data=s=++s%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,n=function(){l.port2.postMessage(0)}}var u=[];function c(){var e,t;i=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}i=!1}t.exports=function(e){1!==u.push(e)||i||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){"use strict";var i=e("immediate");function r(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==r&&p(this,e)}function c(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){i(function(){var i;try{i=t(n)}catch(i){return s.reject(e,i)}i===e?s.reject(e,new TypeError("Cannot resolve promise with itself")):s.resolve(e,i)})}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function i(t){n||(n=!0,s.reject(e,t))}function r(t){n||(n=!0,s.resolve(e,t))}var o=f(function(){t(r,i)});"error"===o.status&&i(o.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=u).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(r);return this.state!==l?d(n,this.state===a?e:t,this.outcome):this.queue.push(new c(n,e,t)),n},c.prototype.callFulfilled=function(e){s.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){s.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},s.resolve=function(e,t){var n=f(h,t);if("error"===n.status)return s.reject(e,n.value);var i=n.value;if(i)p(e,i);else{e.state=a,e.outcome=t;for(var r=-1,o=e.queue.length;++r<o;)e.queue[r].callFulfilled(t)}return e},s.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:s.resolve(new this(r),e)},u.reject=function(e){var t=new this(r);return s.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var o=new Array(n),a=0,l=-1,u=new this(r);++l<n;)c(e[l],l);return u;function c(e,r){t.resolve(e).then(function(e){o[r]=e,++a!==n||i||(i=!0,s.resolve(u,o))},function(e){i||(i=!0,s.reject(u,e))})}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var o,a=-1,l=new this(r);++a<n;)o=e[a],t.resolve(o).then(function(e){i||(i=!0,s.resolve(l,e))},function(e){i||(i=!0,s.reject(l,e))});return l}},{immediate:36}],38:[function(e,t,n){"use strict";var i={};(0,e("./lib/utils/common").assign)(i,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";var i=e("./zlib/deflate"),r=e("./utils/common"),s=e("./utils/strings"),o=e("./zlib/messages"),a=e("./zlib/zstream"),l=Object.prototype.toString,u=0,c=-1,d=0,h=8;function p(e){if(!(this instanceof p))return new p(e);this.options=r.assign({level:c,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==u)throw new Error(o[n]);if(t.header&&i.deflateSetHeader(this.strm,t.header),t.dictionary){var f;if(f="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=i.deflateSetDictionary(this.strm,f))!==u)throw new Error(o[n]);this._dict_set=!0}}function f(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}p.prototype.push=function(e,t){var n,o,a=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=s.string2buf(e):"[object ArrayBuffer]"===l.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(c),a.next_out=0,a.avail_out=c),1!==(n=i.deflate(a,o))&&n!==u)return this.onEnd(n),!(this.ended=!0);0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||0===a.avail_out)&&1!==n);return 4===o?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u):2!==o||(this.onEnd(u),!(a.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=f,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";var i=e("./zlib/inflate"),r=e("./utils/common"),s=e("./utils/strings"),o=e("./zlib/constants"),a=e("./zlib/messages"),l=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw new Error(a[n]);this.header=new u,i.inflateGetHeader(this.strm,this.header)}function h(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}d.prototype.push=function(e,t){var n,a,l,u,d,h,p=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?p.input=s.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new r.Buf8(f),p.next_out=0,p.avail_out=f),(n=i.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(h="string"==typeof m?s.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,h)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(0!==p.avail_out&&n!==o.Z_STREAM_END&&(0!==p.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=s.utf8border(p.output,p.next_out),u=p.next_out-l,d=s.buf2string(p.output,l),p.next_out=u,p.avail_out=f-u,u&&r.arraySet(p.output,p.output,l,u,0),this.onData(d)):this.onData(r.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)}while((0<p.avail_in||0===p.avail_out)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=h,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},n.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(e[i]=n[i])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var s=0;s<i;s++)e[r+s]=t[n+s]},flattenChunks:function(e){var t,n,i,r,s,o;for(t=i=0,n=e.length;t<n;t++)i+=e[t].length;for(o=new Uint8Array(i),t=r=0,n=e.length;t<n;t++)s=e[t],o.set(s,r),r+=s.length;return o}},s={arraySet:function(e,t,n,i,r){for(var s=0;s<i;s++)e[r+s]=t[n+s]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,s))},n.setTyped(i)},{}],42:[function(e,t,n){"use strict";var i=e("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var o=new i.Buf8(256),a=0;a<256;a++)o[a]=252<=a?6:248<=a?5:240<=a?4:224<=a?3:192<=a?2:1;function l(e,t){if(t<65537&&(e.subarray&&s||!e.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var n="",o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,r,s,o,a=e.length,l=0;for(s=0;s<a;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new i.Buf8(l),s=o=0;o<l;s++)55296==(64512&(n=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(n=65536+(n-55296<<10)+(r-56320),s++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new i.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,i,r,s,a=t||e.length,u=new Array(2*a);for(n=i=0;n<a;)if((r=e[n++])<128)u[i++]=r;else if(4<(s=o[r]))u[i++]=65533,n+=s-1;else{for(r&=2===s?31:3===s?15:7;1<s&&n<a;)r=r<<6|63&e[n++],s--;1<s?u[i++]=65533:r<65536?u[i++]=r:(r-=65536,u[i++]=55296|r>>10&1023,u[i++]=56320|1023&r)}return l(u,i)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,i){for(var r=65535&e,s=e>>>16&65535,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;s=s+(r=r+t[i++]|0)|0,--o;);r%=65521,s%=65521}return r|s<<16}},{}],44:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){"use strict";var i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var s=i,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){"use strict";var i,r=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),l=e("./messages"),u=0,c=4,d=0,h=-2,p=-1,f=4,m=2,g=8,_=9,y=286,v=30,b=19,T=2*y+1,x=15,E=3,w=258,I=w+E+1,A=42,S=113,C=1,O=2,M=3,k=4;function R(e,t){return e.msg=l[t],t}function N(e){return(e<<1)-(4<e?9:0)}function D(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function L(e,t){s._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function P(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function $(e,t){var n,i,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-I?e.strstart-(e.w_size-I):0,u=e.window,c=e.w_mask,d=e.prev,h=e.strstart+w,p=u[s+o-1],f=u[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(n=t)+o]===f&&u[n+o-1]===p&&u[n]===u[s]&&u[++n]===u[s+1]){s+=2,n++;do{}while(u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&u[++s]===u[++n]&&s<h);if(i=w-(h-s),s=h-w,o<i){if(e.match_start=t,a<=(o=i))break;p=u[s+o-1],f=u[s+o]}}}while((t=d[t&c])>l&&0!=--r);return o<=e.lookahead?o:e.lookahead}function U(e){var t,n,i,s,l,u,c,d,h,p,f=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-I)){for(r.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;i=e.head[--t],e.head[t]=f<=i?i-f:0,--n;);for(t=n=f;i=e.prev[--t],e.prev[t]=f<=i?i-f:0,--n;);s+=f}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,d=e.strstart+e.lookahead,p=void 0,(h=s)<(p=u.avail_in)&&(p=h),n=0===p?0:(u.avail_in-=p,r.arraySet(c,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=o(u.adler,c,p,d):2===u.state.wrap&&(u.adler=a(u.adler,c,p,d)),u.next_in+=p,u.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=E)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+E-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<E)););}while(e.lookahead<I&&0!==e.strm.avail_in)}function V(e,t){for(var n,i;;){if(e.lookahead<I){if(U(e),e.lookahead<I&&t===u)return C;if(0===e.lookahead)break}if(n=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-I&&(e.match_length=$(e,n)),e.match_length>=E)if(i=s._tr_tally(e,e.strstart-e.match_start,e.match_length-E),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=E){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(L(e,!1),0===e.strm.avail_out))return C}return e.insert=e.strstart<E-1?e.strstart:E-1,t===c?(L(e,!0),0===e.strm.avail_out?M:k):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?C:O}function z(e,t){for(var n,i,r;;){if(e.lookahead<I){if(U(e),e.lookahead<I&&t===u)return C;if(0===e.lookahead)break}if(n=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=E-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-I&&(e.match_length=$(e,n),e.match_length<=5&&(1===e.strategy||e.match_length===E&&4096<e.strstart-e.match_start)&&(e.match_length=E-1)),e.prev_length>=E&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-E,i=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-E),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=E-1,e.strstart++,i&&(L(e,!1),0===e.strm.avail_out))return C}else if(e.match_available){if((i=s._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return C}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<E-1?e.strstart:E-1,t===c?(L(e,!0),0===e.strm.avail_out?M:k):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?C:O}function j(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}function Y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*T),this.dyn_dtree=new r.Buf16(2*(2*v+1)),this.bl_tree=new r.Buf16(2*(2*b+1)),D(this.dyn_ltree),D(this.dyn_dtree),D(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(x+1),this.heap=new r.Buf16(2*y+1),D(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*y+1),D(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function G(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?A:S,e.adler=2===t.wrap?0:1,t.last_flush=u,s._tr_init(t),d):R(e,h)}function H(e){var t=G(e);return t===d&&function(e){e.window_size=2*e.w_size,D(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=E-1,e.match_available=0,e.ins_h=0}(e.state),t}function W(e,t,n,i,s,o){if(!e)return h;var a=1;if(t===p&&(t=6),i<0?(a=0,i=-i):15<i&&(a=2,i-=16),s<1||_<s||n!==g||i<8||15<i||t<0||9<t||o<0||f<o)return R(e,h);8===i&&(i=9);var l=new Y;return(e.state=l).strm=e,l.wrap=a,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+E-1)/E),l.window=new r.Buf8(2*l.w_size),l.head=new r.Buf16(l.hash_size),l.prev=new r.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new r.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=n,H(e)}i=[new j(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(U(e),0===e.lookahead&&t===u)return C;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,L(e,!1),0===e.strm.avail_out))return C;if(e.strstart-e.block_start>=e.w_size-I&&(L(e,!1),0===e.strm.avail_out))return C}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?M:k):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),C)}),new j(4,4,8,4,V),new j(4,5,16,8,V),new j(4,6,32,32,V),new j(4,4,16,16,z),new j(8,16,32,32,z),new j(8,16,128,128,z),new j(8,32,128,256,z),new j(32,128,258,1024,z),new j(32,258,258,4096,z)],n.deflateInit=function(e,t){return W(e,t,g,15,8,0)},n.deflateInit2=W,n.deflateReset=H,n.deflateResetKeep=G,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,d):h},n.deflate=function(e,t){var n,r,o,l;if(!e||!e.state||5<t||t<0)return e?R(e,h):h;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&t!==c)return R(e,0===e.avail_out?-5:h);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===A)if(2===r.wrap)e.adler=0,P(r,31),P(r,139),P(r,8),r.gzhead?(P(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),P(r,255&r.gzhead.time),P(r,r.gzhead.time>>8&255),P(r,r.gzhead.time>>16&255),P(r,r.gzhead.time>>24&255),P(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),P(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(P(r,255&r.gzhead.extra.length),P(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=a(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(P(r,0),P(r,0),P(r,0),P(r,0),P(r,0),P(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),P(r,3),r.status=S);else{var p=g+(r.w_bits-8<<4)<<8;p|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(p|=32),p+=31-p%31,r.status=S,B(r,p),0!==r.strstart&&(B(r,e.adler>>>16),B(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),F(e),o=r.pending,r.pending!==r.pending_buf_size));)P(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),F(e),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,P(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),F(e),o=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,P(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&F(e),r.pending+2<=r.pending_buf_size&&(P(r,255&e.adler),P(r,e.adler>>8&255),e.adler=0,r.status=S)):r.status=S),0!==r.pending){if(F(e),0===e.avail_out)return r.last_flush=-1,d}else if(0===e.avail_in&&N(t)<=N(n)&&t!==c)return R(e,-5);if(666===r.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==u&&666!==r.status){var f=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(U(e),0===e.lookahead)){if(t===u)return C;break}if(e.match_length=0,n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return C}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?M:k):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?C:O}(r,t):3===r.strategy?function(e,t){for(var n,i,r,o,a=e.window;;){if(e.lookahead<=w){if(U(e),e.lookahead<=w&&t===u)return C;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=E&&0<e.strstart&&(i=a[r=e.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){o=e.strstart+w;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<o);e.match_length=w-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=E?(n=s._tr_tally(e,1,e.match_length-E),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return C}return e.insert=0,t===c?(L(e,!0),0===e.strm.avail_out?M:k):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?C:O}(r,t):i[r.level].func(r,t);if(f!==M&&f!==k||(r.status=666),f===C||f===M)return 0===e.avail_out&&(r.last_flush=-1),d;if(f===O&&(1===t?s._tr_align(r):5!==t&&(s._tr_stored_block(r,0,0,!1),3===t&&(D(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),F(e),0===e.avail_out))return r.last_flush=-1,d}return t!==c?d:r.wrap<=0?1:(2===r.wrap?(P(r,255&e.adler),P(r,e.adler>>8&255),P(r,e.adler>>16&255),P(r,e.adler>>24&255),P(r,255&e.total_in),P(r,e.total_in>>8&255),P(r,e.total_in>>16&255),P(r,e.total_in>>24&255)):(B(r,e.adler>>>16),B(r,65535&e.adler)),F(e),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?d:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==A&&69!==t&&73!==t&&91!==t&&103!==t&&t!==S&&666!==t?R(e,h):(e.state=null,t===S?R(e,-3):d):h},n.deflateSetDictionary=function(e,t){var n,i,s,a,l,u,c,p,f=t.length;if(!e||!e.state)return h;if(2===(a=(n=e.state).wrap)||1===a&&n.status!==A||n.lookahead)return h;for(1===a&&(e.adler=o(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===a&&(D(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new r.Buf8(n.w_size),r.arraySet(p,t,f-n.w_size,n.w_size,0),t=p,f=n.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=f,e.next_in=0,e.input=t,U(n);n.lookahead>=E;){for(i=n.strstart,s=n.lookahead-(E-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+E-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--s;);n.strstart=i,n.lookahead=E-1,U(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=E-1,n.match_available=0,e.next_in=u,e.input=c,e.avail_in=l,n.wrap=a,d},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){"use strict";t.exports=function(e,t){var n,i,r,s,o,a,l,u,c,d,h,p,f,m,g,_,y,v,b,T,x,E,w,I,A;n=e.state,i=e.next_in,I=e.input,r=i+(e.avail_in-5),s=e.next_out,A=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=n.dmax,u=n.wsize,c=n.whave,d=n.wnext,h=n.window,p=n.hold,f=n.bits,m=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{f<15&&(p+=I[i++]<<f,f+=8,p+=I[i++]<<f,f+=8),v=m[p&_];t:for(;;){if(p>>>=b=v>>>24,f-=b,0==(b=v>>>16&255))A[s++]=65535&v;else{if(!(16&b)){if(!(64&b)){v=m[(65535&v)+(p&(1<<b)-1)];continue t}if(32&b){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}T=65535&v,(b&=15)&&(f<b&&(p+=I[i++]<<f,f+=8),T+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=I[i++]<<f,f+=8,p+=I[i++]<<f,f+=8),v=g[p&y];n:for(;;){if(p>>>=b=v>>>24,f-=b,!(16&(b=v>>>16&255))){if(!(64&b)){v=g[(65535&v)+(p&(1<<b)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(x=65535&v,f<(b&=15)&&(p+=I[i++]<<f,(f+=8)<b&&(p+=I[i++]<<f,f+=8)),l<(x+=p&(1<<b)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=b,f-=b,(b=s-o)<x){if(c<(b=x-b)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(w=h,(E=0)===d){if(E+=u-b,b<T){for(T-=b;A[s++]=h[E++],--b;);E=s-x,w=A}}else if(d<b){if(E+=u+d-b,(b-=d)<T){for(T-=b;A[s++]=h[E++],--b;);if(E=0,d<T){for(T-=b=d;A[s++]=h[E++],--b;);E=s-x,w=A}}}else if(E+=d-b,b<T){for(T-=b;A[s++]=h[E++],--b;);E=s-x,w=A}for(;2<T;)A[s++]=w[E++],A[s++]=w[E++],A[s++]=w[E++],T-=3;T&&(A[s++]=w[E++],1<T&&(A[s++]=w[E++]))}else{for(E=s-x;A[s++]=A[E++],A[s++]=A[E++],A[s++]=A[E++],2<(T-=3););T&&(A[s++]=A[E++],1<T&&(A[s++]=A[E++]))}break}}break}}while(i<r&&s<a);i-=T=f>>3,p&=(1<<(f-=T<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=s<a?a-s+257:257-(s-a),n.hold=p,n.bits=f}},{}],49:[function(e,t,n){"use strict";var i=e("../utils/common"),r=e("./adler32"),s=e("./crc32"),o=e("./inffast"),a=e("./inftrees"),l=1,u=2,c=0,d=-2,h=1,p=852,f=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=h,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(p),t.distcode=t.distdyn=new i.Buf32(f),t.sane=1,t.back=-1,c):d}function y(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function v(e,t){var n,i;return e&&e.state?(i=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?d:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,y(e))):d}function b(e,t){var n,i;return e?(i=new g,(e.state=i).window=null,(n=v(e,t))!==c&&(e.state=null),n):d}var T,x,E=!0;function w(e){if(E){var t;for(T=new i.Buf32(512),x=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(l,e.lens,0,288,T,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(u,e.lens,0,32,x,0,e.work,{bits:5}),E=!1}e.lencode=T,e.lenbits=9,e.distcode=x,e.distbits=5}function I(e,t,n,r){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new i.Buf8(o.wsize)),r>=o.wsize?(i.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(r<(s=o.wsize-o.wnext)&&(s=r),i.arraySet(o.window,t,n-r,s,o.wnext),(r-=s)?(i.arraySet(o.window,t,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}n.inflateReset=y,n.inflateReset2=v,n.inflateResetKeep=_,n.inflateInit=function(e){return b(e,15)},n.inflateInit2=b,n.inflate=function(e,t){var n,p,f,g,_,y,v,b,T,x,E,A,S,C,O,M,k,R,N,D,F,L,P,B,$=0,U=new i.Buf8(4),V=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return d;12===(n=e.state).mode&&(n.mode=13),_=e.next_out,f=e.output,v=e.avail_out,g=e.next_in,p=e.input,y=e.avail_in,b=n.hold,T=n.bits,x=y,E=v,L=c;e:for(;;)switch(n.mode){case h:if(0===n.wrap){n.mode=13;break}for(;T<16;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(2&n.wrap&&35615===b){U[n.check=0]=255&b,U[1]=b>>>8&255,n.check=s(n.check,U,2,0),T=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&b)){e.msg="unknown compression method",n.mode=30;break}if(T-=4,F=8+(15&(b>>>=4)),0===n.wbits)n.wbits=F;else if(F>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<F,e.adler=n.check=1,n.mode=512&b?10:12,T=b=0;break;case 2:for(;T<16;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(n.flags=b,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(U[0]=255&b,U[1]=b>>>8&255,n.check=s(n.check,U,2,0)),T=b=0,n.mode=3;case 3:for(;T<32;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.head&&(n.head.time=b),512&n.flags&&(U[0]=255&b,U[1]=b>>>8&255,U[2]=b>>>16&255,U[3]=b>>>24&255,n.check=s(n.check,U,4,0)),T=b=0,n.mode=4;case 4:for(;T<16;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(U[0]=255&b,U[1]=b>>>8&255,n.check=s(n.check,U,2,0)),T=b=0,n.mode=5;case 5:if(1024&n.flags){for(;T<16;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(U[0]=255&b,U[1]=b>>>8&255,n.check=s(n.check,U,2,0)),T=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(y<(A=n.length)&&(A=y),A&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,p,g,A,F)),512&n.flags&&(n.check=s(n.check,p,A,g)),y-=A,g+=A,n.length-=A),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===y)break e;for(A=0;F=p[g+A++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&A<y;);if(512&n.flags&&(n.check=s(n.check,p,A,g)),y-=A,g+=A,F)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===y)break e;for(A=0;F=p[g+A++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&A<y;);if(512&n.flags&&(n.check=s(n.check,p,A,g)),y-=A,g+=A,F)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;T<16;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(b!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}T=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;T<32;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}e.adler=n.check=m(b),T=b=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=_,e.avail_out=v,e.next_in=g,e.avail_in=y,n.hold=b,n.bits=T,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){b>>>=7&T,T-=7&T,n.mode=27;break}for(;T<3;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}switch(n.last=1&b,T-=1,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,6!==t)break;b>>>=2,T-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}b>>>=2,T-=2;break;case 14:for(b>>>=7&T,T-=7&T;T<32;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if((65535&b)!=(b>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&b,T=b=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(A=n.length){if(y<A&&(A=y),v<A&&(A=v),0===A)break e;i.arraySet(f,p,g,A,_),y-=A,g+=A,v-=A,_+=A,n.length-=A;break}n.mode=12;break;case 17:for(;T<14;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(n.nlen=257+(31&b),b>>>=5,T-=5,n.ndist=1+(31&b),b>>>=5,T-=5,n.ncode=4+(15&b),b>>>=4,T-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;T<3;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.lens[V[n.have++]]=7&b,b>>>=3,T-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},L=a(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,L){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;M=($=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,k=65535&$,!((O=$>>>24)<=T);){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(k<16)b>>>=O,T-=O,n.lens[n.have++]=k;else{if(16===k){for(B=O+2;T<B;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(b>>>=O,T-=O,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}F=n.lens[n.have-1],A=3+(3&b),b>>>=2,T-=2}else if(17===k){for(B=O+3;T<B;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}T-=O,F=0,A=3+(7&(b>>>=O)),b>>>=3,T-=3}else{for(B=O+7;T<B;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}T-=O,F=0,A=11+(127&(b>>>=O)),b>>>=7,T-=7}if(n.have+A>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;A--;)n.lens[n.have++]=F}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,P={bits:n.lenbits},L=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,L){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},L=a(u,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,L){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=y&&258<=v){e.next_out=_,e.avail_out=v,e.next_in=g,e.avail_in=y,n.hold=b,n.bits=T,o(e,E),_=e.next_out,f=e.output,v=e.avail_out,g=e.next_in,p=e.input,y=e.avail_in,b=n.hold,T=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;M=($=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,k=65535&$,!((O=$>>>24)<=T);){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(M&&!(240&M)){for(R=O,N=M,D=k;M=($=n.lencode[D+((b&(1<<R+N)-1)>>R)])>>>16&255,k=65535&$,!(R+(O=$>>>24)<=T);){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}b>>>=R,T-=R,n.back+=R}if(b>>>=O,T-=O,n.back+=O,n.length=k,0===M){n.mode=26;break}if(32&M){n.back=-1,n.mode=12;break}if(64&M){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&M,n.mode=22;case 22:if(n.extra){for(B=n.extra;T<B;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,T-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;M=($=n.distcode[b&(1<<n.distbits)-1])>>>16&255,k=65535&$,!((O=$>>>24)<=T);){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(!(240&M)){for(R=O,N=M,D=k;M=($=n.distcode[D+((b&(1<<R+N)-1)>>R)])>>>16&255,k=65535&$,!(R+(O=$>>>24)<=T);){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}b>>>=R,T-=R,n.back+=R}if(b>>>=O,T-=O,n.back+=O,64&M){e.msg="invalid distance code",n.mode=30;break}n.offset=k,n.extra=15&M,n.mode=24;case 24:if(n.extra){for(B=n.extra;T<B;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,T-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===v)break e;if(A=E-v,n.offset>A){if((A=n.offset-A)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}S=A>n.wnext?(A-=n.wnext,n.wsize-A):n.wnext-A,A>n.length&&(A=n.length),C=n.window}else C=f,S=_-n.offset,A=n.length;for(v<A&&(A=v),v-=A,n.length-=A;f[_++]=C[S++],--A;);0===n.length&&(n.mode=21);break;case 26:if(0===v)break e;f[_++]=n.length,v--,n.mode=21;break;case 27:if(n.wrap){for(;T<32;){if(0===y)break e;y--,b|=p[g++]<<T,T+=8}if(E-=v,e.total_out+=E,n.total+=E,E&&(e.adler=n.check=n.flags?s(n.check,f,E,_-E):r(n.check,f,E,_-E)),E=v,(n.flags?b:m(b))!==n.check){e.msg="incorrect data check",n.mode=30;break}T=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;T<32;){if(0===y)break e;y--,b+=p[g++]<<T,T+=8}if(b!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}T=b=0}n.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;default:return d}return e.next_out=_,e.avail_out=v,e.next_in=g,e.avail_in=y,n.hold=b,n.bits=T,(n.wsize||E!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&I(e,e.output,e.next_out,E-e.avail_out)?(n.mode=31,-4):(x-=e.avail_in,E-=e.avail_out,e.total_in+=x,e.total_out+=E,n.total+=E,n.wrap&&E&&(e.adler=n.check=n.flags?s(n.check,f,E,e.next_out-E):r(n.check,f,E,e.next_out-E)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==x&&0===E||4===t)&&L===c&&(L=-5),L)},n.inflateEnd=function(e){if(!e||!e.state)return d;var t=e.state;return t.window&&(t.window=null),e.state=null,c},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,c):d},n.inflateSetDictionary=function(e,t){var n,i=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?d:11===n.mode&&r(1,t,i,0)!==n.check?-3:I(e,t,i,i)?(n.mode=31,-4):(n.havedict=1,c):d},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){"use strict";var i=e("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,l,u,c,d,h){var p,f,m,g,_,y,v,b,T,x=h.bits,E=0,w=0,I=0,A=0,S=0,C=0,O=0,M=0,k=0,R=0,N=null,D=0,F=new i.Buf16(16),L=new i.Buf16(16),P=null,B=0;for(E=0;E<=15;E++)F[E]=0;for(w=0;w<l;w++)F[t[n+w]]++;for(S=x,A=15;1<=A&&0===F[A];A--);if(A<S&&(S=A),0===A)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(I=1;I<A&&0===F[I];I++);for(S<I&&(S=I),E=M=1;E<=15;E++)if(M<<=1,(M-=F[E])<0)return-1;if(0<M&&(0===e||1!==A))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+F[E];for(w=0;w<l;w++)0!==t[n+w]&&(d[L[t[n+w]]++]=w);if(y=0===e?(N=P=d,19):1===e?(N=r,D-=257,P=s,B-=257,256):(N=o,P=a,-1),E=I,_=c,O=w=R=0,m=-1,g=(k=1<<(C=S))-1,1===e&&852<k||2===e&&592<k)return 1;for(;;){for(v=E-O,T=d[w]<y?(b=0,d[w]):d[w]>y?(b=P[B+d[w]],N[D+d[w]]):(b=96,0),p=1<<E-O,I=f=1<<C;u[_+(R>>O)+(f-=p)]=v<<24|b<<16|T,0!==f;);for(p=1<<E-1;R&p;)p>>=1;if(0!==p?(R&=p-1,R+=p):R=0,w++,0==--F[E]){if(E===A)break;E=t[n+d[w]]}if(S<E&&(R&g)!==m){for(0===O&&(O=S),_+=I,M=1<<(C=E-O);C+O<A&&!((M-=F[C+O])<=0);)C++,M<<=1;if(k+=1<<C,1===e&&852<k||2===e&&592<k)return 1;u[m=R&g]=S<<24|C<<16|_-c}}return 0!==R&&(u[_+R]=E-O<<24|64<<16),h.bits=S,0}},{"../utils/common":41}],51:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";var i=e("../utils/common"),r=0,s=1;function o(e){for(var t=e.length;0<=--t;)e[t]=0}var a=0,l=29,u=256,c=u+1+l,d=30,h=19,p=2*c+1,f=15,m=16,g=7,_=256,y=16,v=17,b=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(c+2));o(I);var A=new Array(2*d);o(A);var S=new Array(512);o(S);var C=new Array(256);o(C);var O=new Array(l);o(O);var M,k,R,N=new Array(d);function D(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?S[e]:S[256+(e>>>7)]}function P(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,n){e.bi_valid>m-n?(e.bi_buf|=t<<e.bi_valid&65535,P(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=n-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function $(e,t,n){B(e,n[2*t],n[2*t+1])}function U(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function V(e,t,n){var i,r,s=new Array(f+1),o=0;for(i=1;i<=f;i++)s[i]=o=o+n[i-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=U(s[a]++,a))}}function z(e){var t;for(t=0;t<c;t++)e.dyn_ltree[2*t]=0;for(t=0;t<d;t++)e.dyn_dtree[2*t]=0;for(t=0;t<h;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function j(e){8<e.bi_valid?P(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Y(e,t,n,i){var r=2*t,s=2*n;return e[r]<e[s]||e[r]===e[s]&&i[t]<=i[n]}function G(e,t,n){for(var i=e.heap[n],r=n<<1;r<=e.heap_len&&(r<e.heap_len&&Y(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!Y(t,i,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=i}function H(e,t,n){var i,r,s,o,a=0;if(0!==e.last_lit)for(;i=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],r=e.pending_buf[e.l_buf+a],a++,0===i?$(e,r,t):($(e,(s=C[r])+u+1,t),0!==(o=T[s])&&B(e,r-=O[s],o),$(e,s=L(--i),n),0!==(o=x[s])&&B(e,i-=N[s],o)),a<e.last_lit;);$(e,_,t)}function W(e,t){var n,i,r,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<l;n++)0!==s[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):s[2*n+1]=0;for(;e.heap_len<2;)s[2*(r=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[r]=0,e.opt_len--,a&&(e.static_len-=o[2*r+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)G(e,s,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,s[2*r]=s[2*n]+s[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,s[2*n+1]=s[2*i+1]=r,e.heap[1]=r++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,s,o,a,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,d=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(s=0;s<=f;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(s=l[2*l[2*(i=e.heap[n])+1]+1]+1)&&(s=g,_++),l[2*i+1]=s,u<i||(e.bl_count[s]++,o=0,m<=i&&(o=h[i-m]),a=l[2*i],e.opt_len+=a*(s+o),d&&(e.static_len+=a*(c[2*i+1]+o)));if(0!==_){do{for(s=g-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(s=g;0!==s;s--)for(i=e.bl_count[s];0!==i;)u<(r=e.heap[--n])||(l[2*r+1]!==s&&(e.opt_len+=(s-l[2*r+1])*l[2*r],l[2*r+1]=s),i--)}}(e,t),V(s,u,e.bl_count)}function X(e,t,n){var i,r,s=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=t[2*(i+1)+1],++a<l&&r===o||(a<u?e.bl_tree[2*r]+=a:0!==r?(r!==s&&e.bl_tree[2*r]++,e.bl_tree[2*y]++):a<=10?e.bl_tree[2*v]++:e.bl_tree[2*b]++,s=r,u=(a=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4))}function q(e,t,n){var i,r,s=-1,o=t[1],a=0,l=7,u=4;for(0===o&&(l=138,u=3),i=0;i<=n;i++)if(r=o,o=t[2*(i+1)+1],!(++a<l&&r===o)){if(a<u)for(;$(e,r,e.bl_tree),0!=--a;);else 0!==r?(r!==s&&($(e,r,e.bl_tree),a--),$(e,y,e.bl_tree),B(e,a-3,2)):a<=10?($(e,v,e.bl_tree),B(e,a-3,3)):($(e,b,e.bl_tree),B(e,a-11,7));s=r,u=(a=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4)}}o(N);var K=!1;function Z(e,t,n,r){B(e,(a<<1)+(r?1:0),3),function(e,t,n,r){j(e),r&&(P(e,n),P(e,~n)),i.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){K||(function(){var e,t,n,i,r,s=new Array(f+1);for(i=n=0;i<l-1;i++)for(O[i]=n,e=0;e<1<<T[i];e++)C[n++]=i;for(C[n-1]=i,i=r=0;i<16;i++)for(N[i]=r,e=0;e<1<<x[i];e++)S[r++]=i;for(r>>=7;i<d;i++)for(N[i]=r<<7,e=0;e<1<<x[i]-7;e++)S[256+r++]=i;for(t=0;t<=f;t++)s[t]=0;for(e=0;e<=143;)I[2*e+1]=8,e++,s[8]++;for(;e<=255;)I[2*e+1]=9,e++,s[9]++;for(;e<=279;)I[2*e+1]=7,e++,s[7]++;for(;e<=287;)I[2*e+1]=8,e++,s[8]++;for(V(I,c+1,s),e=0;e<d;e++)A[2*e+1]=5,A[2*e]=U(e,5);M=new D(I,T,u+1,c,f),k=new D(A,x,0,d,f),R=new D(new Array(0),E,0,h,g)}(),K=!0),e.l_desc=new F(e.dyn_ltree,M),e.d_desc=new F(e.dyn_dtree,k),e.bl_desc=new F(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,z(e)},n._tr_stored_block=Z,n._tr_flush_block=function(e,t,n,i){var o,a,l=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return r;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return s;for(t=32;t<u;t++)if(0!==e.dyn_ltree[2*t])return s;return r}(e)),W(e,e.l_desc),W(e,e.d_desc),l=function(e){var t;for(X(e,e.dyn_ltree,e.l_desc.max_code),X(e,e.dyn_dtree,e.d_desc.max_code),W(e,e.bl_desc),t=h-1;3<=t&&0===e.bl_tree[2*w[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=o&&(o=a)):o=a=n+5,n+4<=o&&-1!==t?Z(e,t,n,i):4===e.strategy||a===o?(B(e,2+(i?1:0),3),H(e,I,A)):(B(e,4+(i?1:0),3),function(e,t,n,i){var r;for(B(e,t-257,5),B(e,n-1,5),B(e,i-4,4),r=0;r<i;r++)B(e,e.bl_tree[2*w[r]+1],3);q(e,e.dyn_ltree,t-1),q(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),H(e,e.dyn_ltree,e.dyn_dtree)),z(e),i&&j(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(C[n]+u+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){B(e,2,3),$(e,_,I),function(e){16===e.bi_valid?(P(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,i){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var n,i,r,s,o=1,a={},l=!1,u=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",p,!1):e.attachEvent("onmessage",p),function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):function(e){setTimeout(h,0,e)},c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i<t.length;i++)t[i]=arguments[i+1];var r={callback:e,args:t};return a[o]=r,n(o),o++},c.clearImmediate=d}function d(e){delete a[e]}function h(e){if(l)setTimeout(h,0,e);else{var n=a[e];if(n){l=!0;try{!function(e){var n=e.callback,i=e.args;switch(i.length){case 0:n();break;case 1:n(i[0]);break;case 2:n(i[0],i[1]);break;case 3:n(i[0],i[1],i[2]);break;default:n.apply(t,i)}}(n)}finally{d(e),l=!1}}}}function p(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},28570:e=>{e.exports=n;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var r={},s={};function o(e,t){var n,i,o;return t?(o=0<=(e>>>=0)&&e<256)&&(i=s[e])?i:(n=l(e,(0|e)<0?-1:0,!0),o&&(s[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(i=r[e])?i:(n=l(e,e<0?-1:0,!1),o&&(r[e]=n),n)}function a(e,t){if(isNaN(e))return t?_:g;if(t){if(e<0)return _;if(e>=p)return x}else{if(e<=-f)return E;if(e+1>=f)return T}return e<0?a(-e,t).neg():l(e%h|0,e/h|0,t)}function l(e,t,i){return new n(e,t,i)}n.fromInt=o,n.fromNumber=a,n.fromBits=l;var u=Math.pow;function c(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return c(e.substring(1),t,n).neg();for(var r=a(u(n,8)),s=g,o=0;o<e.length;o+=8){var l=Math.min(8,e.length-o),d=parseInt(e.substring(o,o+l),n);if(l<8){var h=a(u(n,l));s=s.mul(h).add(a(d))}else s=(s=s.mul(r)).add(a(d))}return s.unsigned=t,s}function d(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?c(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=c,n.fromValue=d;var h=4294967296,p=h*h,f=p/2,m=o(1<<24),g=o(0);n.ZERO=g;var _=o(0,!0);n.UZERO=_;var y=o(1);n.ONE=y;var v=o(1,!0);n.UONE=v;var b=o(-1);n.NEG_ONE=b;var T=l(-1,2147483647,!1);n.MAX_VALUE=T;var x=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=x;var E=l(0,-2147483648,!1);n.MIN_VALUE=E;var w=n.prototype;w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var t=a(e),n=this.div(t),i=n.mul(t).sub(this);return n.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=a(u(e,6),this.unsigned),s=this,o="";;){var l=s.div(r),c=(s.sub(l.mul(r)).toInt()>>>0).toString(e);if((s=l).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},w.isZero=function(){return 0===this.high&&0===this.low},w.eqz=w.isZero,w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return!(1&~this.low)},w.isEven=function(){return!(1&this.low)},w.equals=function(e){return i(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.ne=w.notEquals,w.lessThan=function(e){return this.comp(e)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return this.comp(e)<=0},w.lte=w.lessThanOrEqual,w.le=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.ge=w.greaterThanOrEqual,w.compare=function(e){if(i(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(y)},w.neg=w.negate,w.add=function(e){i(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,h=0,p=0,f=0;return p+=(f+=s+(65535&e.low))>>>16,h+=(p+=r+u)>>>16,c+=(h+=n+a)>>>16,c+=t+o,l((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},w.subtract=function(e){return i(e)||(e=d(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=d(e)),t)return l(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(E))return e.isOdd()?E:g;if(e.eq(E))return this.isOdd()?E: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 a(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,u=e.high>>>16,c=65535&e.high,h=e.low>>>16,p=65535&e.low,f=0,_=0,y=0,v=0;return y+=(v+=o*p)>>>16,_+=(y+=s*p)>>>16,y&=65535,_+=(y+=o*h)>>>16,f+=(_+=r*p)>>>16,_&=65535,f+=(_+=s*h)>>>16,_&=65535,f+=(_+=o*c)>>>16,f+=n*p+r*h+s*c+o*u,l((y&=65535)<<16|(v&=65535),(f&=65535)<<16|(_&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(i(e)||(e=d(e)),e.isZero())throw Error("division by zero");var n,r,s;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?_:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return v;s=_}else{if(this.eq(E))return e.eq(y)||e.eq(b)?E:e.eq(E)?y:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:b:(r=this.sub(e.mul(n)),s=n.add(r.div(e)));if(e.eq(E))return this.unsigned?_: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();s=g}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),c=o<=48?1:u(2,o-48),h=a(n),p=h.mul(e);p.isNegative()||p.gt(r);)p=(h=a(n-=c,this.unsigned)).mul(e);h.isZero()&&(h=y),s=s.add(h),r=r.sub(p)}return s},w.div=w.divide,w.modulo=function(e){return i(e)||(e=d(e)),t?l((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.rem=w.modulo,w.not=function(){return l(~this.low,~this.high,this.unsigned)},w.and=function(e){return i(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return i(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return i(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(i(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)},w.shru=w.shiftRightUnsigned,w.shr_u=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.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]},w.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,i){return i?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)}},45228:e=>{"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var s,o,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var u in s=Object(arguments[l]))n.call(s,u)&&(a[u]=s[u]);if(t){o=t(s);for(var c=0;c<o.length;c++)i.call(s,o[c])&&(a[o[c]]=s[o[c]])}}return a}},84678:e=>{"use strict";e.exports=(e,t={})=>{if(!e)return;const n={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,loose:/^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?:\/\/)?([^/?#]*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/}},i=(t.strictMode?n.parser.strict:n.parser.loose).exec(e);if(!i)return;const r={};if(r[n.key[0]]=e,r[n.key[1]]=i[1]||"",r[n.key[2]]=i[2]||"",r[n.key[8]]=i[3]||"",r[n.key[12]]=i[4]||"",r[n.key[13]]=i[5]||"",r[n.key[2]]){const e=/^(?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?/.exec(r[n.key[2]]);e&&(r[n.key[3]]=e[1]||"",r[n.key[4]]=e[2]||"",r[n.key[5]]=e[3]||"",r[n.key[6]]=e[4]||"",r[n.key[7]]=e[5]||"")}return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(e,t,i){t&&(r[n.q.name][t]=i)}),r}},65585:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="function"!=typeof Object.create&&"~";function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function r(){}r.prototype._events=void 0,r.prototype.eventNames=function(){var e,i=this._events,r=[];if(!i)return r;for(e in i)t.call(i,e)&&r.push(n?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(i)):r},r.prototype.listeners=function(e,t){var i=n?n+e:e,r=this._events&&this._events[i];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var s=0,o=r.length,a=new Array(o);s<o;s++)a[s]=r[s].fn;return a},r.prototype.emit=function(e,t,i,r,s,o){var a=n?n+e:e;if(!this._events||!this._events[a])return!1;var l,u,c=this._events[a],d=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,r),!0;case 5:return c.fn.call(c.context,t,i,r,s),!0;case 6:return c.fn.call(c.context,t,i,r,s,o),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var h,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,i);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];c[u].fn.apply(c[u].context,l)}}return!0},r.prototype.on=function(e,t,r){var s=new i(t,r||this),o=n?n+e:e;return this._events||(this._events=n?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],s]:this._events[o].push(s):this._events[o]=s,this},r.prototype.once=function(e,t,r){var s=new i(t,r||this,!0),o=n?n+e:e;return this._events||(this._events=n?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],s]:this._events[o].push(s):this._events[o]=s,this},r.prototype.removeListener=function(e,t,i,r){var s=n?n+e:e;if(!this._events||!this._events[s])return this;var o=this._events[s],a=[];if(t)if(o.fn)(o.fn!==t||r&&!o.once||i&&o.context!==i)&&a.push(o);else for(var l=0,u=o.length;l<u;l++)(o[l].fn!==t||r&&!o[l].once||i&&o[l].context!==i)&&a.push(o[l]);return a.length?this._events[s]=1===a.length?a[0]:a:delete this._events[s],this},r.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[n?n+e:e]:this._events=n?{}:Object.create(null),this):this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=n,e.exports=r},46192:(e,t,n)=>{var i={VERSION:n(21045).rE,PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},SPRITE_BATCH_SIZE:2e3};e.exports=i},67673:(e,t,n)=>{var i=n(74650),r=n(52295),s=n(57443),o=new i.Matrix;function a(){r.call(this),this.children=[]}a.prototype=Object.create(r.prototype),a.prototype.constructor=a,e.exports=a,Object.defineProperties(a.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(e){var t=this.getLocalBounds().width;this.scale.x=0!==t?e/t:1,this._width=e}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(e){var t=this.getLocalBounds().height;this.scale.y=0!==t?e/t:1,this._height=e}}}),a.prototype.onChildrenChange=function(){},a.prototype.addChild=function(e){return this.addChildAt(e,this.children.length)},a.prototype.addChildAt=function(e,t){if(e===this)return e;if(t>=0&&t<=this.children.length)return e.parent&&e.parent.removeChild(e),e.parent=this,this.children.splice(t,0,e),this.onChildrenChange(t),e.emit("added",this),e;throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length)},a.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),i=this.getChildIndex(t);if(n<0||i<0)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[n]=t,this.children[i]=e,this.onChildrenChange(n<i?n:i)}},a.prototype.getChildIndex=function(e){var t=this.children.indexOf(e);if(-1===t)throw new Error("The supplied DisplayObject must be a child of the caller");return t},a.prototype.setChildIndex=function(e,t){if(t<0||t>=this.children.length)throw new Error("The supplied index is out of bounds");var n=this.getChildIndex(e);this.children.splice(n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},a.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Supplied index "+e+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[e]},a.prototype.removeChild=function(e){var t=this.children.indexOf(e);if(-1!==t)return this.removeChildAt(t)},a.prototype.removeChildAt=function(e){var t=this.getChildAt(e);return t.parent=null,this.children.splice(e,1),this.onChildrenChange(e),t.emit("removed",this),t},a.prototype.removeChildren=function(e,t){var n,i,r=e||0,s="number"==typeof t?t:this.children.length,o=s-r;if(o>0&&o<=s){for(n=this.children.splice(r,o),i=0;i<n.length;++i)n[i].parent=null;for(this.onChildrenChange(e),i=0;i<n.length;++i)n[i].emit("removed",this);return n}if(0===o&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},a.prototype.generateTexture=function(e,t,n){var i=this.getLocalBounds(),r=new s(e,0|i.width,0|i.height,n,t);return o.tx=-i.x,o.ty=-i.y,r.render(this,o),r},a.prototype.updateTransform=function(){if(this.visible){this.displayObjectUpdateTransform();for(var e=0,t=this.children.length;e<t;++e)this.children[e].updateTransform()}},a.prototype.containerUpdateTransform=a.prototype.updateTransform,a.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return i.Rectangle.EMPTY;for(var e,t,n,r=1/0,s=1/0,o=-1/0,a=-1/0,l=!1,u=0,c=this.children.length;u<c;++u){this.children[u].visible&&(l=!0,r=r<(e=this.children[u].getBounds()).x?r:e.x,s=s<e.y?s:e.y,o=o>(t=e.width+e.x)?o:t,a=a>(n=e.height+e.y)?a:n)}if(!l)return i.Rectangle.EMPTY;var d=this._bounds;d.x=r,d.y=s,d.width=o-r,d.height=a-s,this._currentBounds=d}return this._currentBounds},a.prototype.containerGetBounds=a.prototype.getBounds,a.prototype.getLocalBounds=function(){var e=this.worldTransform;this.worldTransform=i.Matrix.IDENTITY;for(var t=0,n=this.children.length;t<n;++t)this.children[t].updateTransform();return this.worldTransform=e,this._currentBounds=null,this.getBounds(i.Matrix.IDENTITY)},a.prototype.renderWebGL=function(e){var t,n;if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this._filters){for(e.currentRenderer.flush(),this._filters&&this._filters.length&&e.filterManager.pushFilter(this,this._filters),this._mask&&e.maskManager.pushMask(this,this._mask),e.currentRenderer.start(),this._renderWebGL(e),t=0,n=this.children.length;t<n;t++)this.children[t].renderWebGL(e);e.currentRenderer.flush(),this._mask&&e.maskManager.popMask(this,this._mask),this._filters&&e.filterManager.popFilter(),e.currentRenderer.start()}else for(this._renderWebGL(e),t=0,n=this.children.length;t<n;++t)this.children[t].renderWebGL(e)},a.prototype._renderWebGL=function(e){},a.prototype._renderCanvas=function(e){},a.prototype.renderCanvas=function(e){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&e.maskManager.pushMask(this._mask,e),this._renderCanvas(e);for(var t=0,n=this.children.length;t<n;++t)this.children[t].renderCanvas(e);this._mask&&e.maskManager.popMask(e)}},a.prototype.destroy=function(e){if(r.prototype.destroy.call(this),e)for(var t=0,n=this.children.length;t<n;++t)this.children[t].destroy(e);this.removeChildren(),this.children=null}},52295:(e,t,n)=>{var i=n(74650),r=n(57443),s=n(65585),o=n(46192),a=new i.Matrix,l={worldTransform:new i.Matrix,worldAlpha:1,children:[]};function u(){s.call(this),this.position=new i.Point,this.scale=new i.Point(1,1),this.pivot=new i.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new i.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new i.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}u.prototype=Object.create(s.prototype),u.prototype.constructor=u,e.exports=u,Object.defineProperties(u.prototype,{x:{get:function(){return this.position.x},set:function(e){this.position.x=e}},y:{get:function(){return this.position.y},set:function(e){this.position.y=e}},worldVisible:{get:function(){var e=this;do{if(!e.visible)return!1;e=e.parent}while(e);return!0}},mask:{get:function(){return this._mask},set:function(e){this._mask&&(this._mask.renderable=!0),this._mask=e,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(e){this._filters=e&&e.slice()}}}),u.prototype.updateTransform=function(){var e,t,n,i,r,s,a=this.parent.worldTransform,l=this.worldTransform;this.rotation%o.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),e=this._cr*this.scale.x,t=this._sr*this.scale.x,n=-this._sr*this.scale.y,i=this._cr*this.scale.y,r=this.position.x,s=this.position.y,(this.pivot.x||this.pivot.y)&&(r-=this.pivot.x*e+this.pivot.y*n,s-=this.pivot.x*t+this.pivot.y*i),l.a=e*a.a+t*a.c,l.b=e*a.b+t*a.d,l.c=n*a.a+i*a.c,l.d=n*a.b+i*a.d,l.tx=r*a.a+s*a.c+a.tx,l.ty=r*a.b+s*a.d+a.ty):(e=this.scale.x,i=this.scale.y,r=this.position.x-this.pivot.x*e,s=this.position.y-this.pivot.y*i,l.a=e*a.a,l.b=e*a.b,l.c=i*a.c,l.d=i*a.d,l.tx=r*a.a+s*a.c+a.tx,l.ty=r*a.b+s*a.d+a.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},u.prototype.displayObjectUpdateTransform=u.prototype.updateTransform,u.prototype.getBounds=function(e){return i.Rectangle.EMPTY},u.prototype.getLocalBounds=function(){return this.getBounds(i.Matrix.IDENTITY)},u.prototype.toGlobal=function(e){return this.parent?this.displayObjectUpdateTransform():(this.parent=l,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(e)},u.prototype.toLocal=function(e,t){return t&&(e=t.toGlobal(e)),this.parent?this.displayObjectUpdateTransform():(this.parent=l,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(e)},u.prototype.renderWebGL=function(e){},u.prototype.renderCanvas=function(e){},u.prototype.generateTexture=function(e,t,n){var i=this.getLocalBounds(),s=new r(e,0|i.width,0|i.height,t,n);return a.tx=-i.x,a.ty=-i.y,s.render(this,a),s},u.prototype.setParent=function(e){if(!e||!e.addChild)throw new Error("setParent: Argument must be a Container");return e.addChild(this),e},u.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},6720:(e,t,n)=>{var i=n(67673),r=n(22699),s=n(61549),o=n(34694),a=n(7240),l=n(74650),u=n(46192),c=new l.Point;function d(){i.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}d.prototype=Object.create(i.prototype),d.prototype.constructor=d,e.exports=d,d.prototype.clone=function(){var e=new d;e.renderable=this.renderable,e.fillAlpha=this.fillAlpha,e.lineWidth=this.lineWidth,e.lineColor=this.lineColor,e.tint=this.tint,e.blendMode=this.blendMode,e.isMask=this.isMask,e.boundsPadding=this.boundsPadding,e.dirty=!0,e.glDirty=!0,e.cachedSpriteDirty=this.cachedSpriteDirty;for(var t=0;t<this.graphicsData.length;++t)e.graphicsData.push(this.graphicsData[t].clone());return e.currentPath=e.graphicsData[e.graphicsData.length-1],e.updateLocalBounds(),e},d.prototype.lineStyle=function(e,t,n){if(this.lineWidth=e||0,this.lineColor=t||0,this.lineAlpha=void 0===n?1:n,this.currentPath)if(this.currentPath.shape.points.length){var i=new l.Polygon(this.currentPath.shape.points.slice(-2));i.closed=!1,this.drawShape(i)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha;return this},d.prototype.moveTo=function(e,t){var n=new l.Polygon([e,t]);return n.closed=!1,this.drawShape(n),this},d.prototype.lineTo=function(e,t){return this.currentPath.shape.points.push(e,t),this.dirty=!0,this},d.prototype.quadraticCurveTo=function(e,t,n,i){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var r,s,o=this.currentPath.shape.points;0===o.length&&this.moveTo(0,0);for(var a=o[o.length-2],l=o[o.length-1],u=0,c=1;c<=20;++c)r=a+(e-a)*(u=c/20),s=l+(t-l)*u,o.push(r+(e+(n-e)*u-r)*u,s+(t+(i-t)*u-s)*u);return this.dirty=this.boundsDirty=!0,this},d.prototype.bezierCurveTo=function(e,t,n,i,r,s){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var o,a,l,u,c,d=this.currentPath.shape.points,h=d[d.length-2],p=d[d.length-1],f=0,m=1;m<=20;++m)l=(a=(o=1-(f=m/20))*o)*o,c=(u=f*f)*f,d.push(l*h+3*a*f*e+3*o*u*n+c*r,l*p+3*a*f*t+3*o*u*i+c*s);return this.dirty=this.boundsDirty=!0,this},d.prototype.arcTo=function(e,t,n,i,r){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(e,t):this.moveTo(e,t);var s=this.currentPath.shape.points,o=s[s.length-2],a=s[s.length-1]-t,l=o-e,u=i-t,c=n-e,d=Math.abs(a*c-l*u);if(d<1e-8||0===r)s[s.length-2]===e&&s[s.length-1]===t||s.push(e,t);else{var h=a*a+l*l,p=u*u+c*c,f=a*u+l*c,m=r*Math.sqrt(h)/d,g=r*Math.sqrt(p)/d,_=m*f/h,y=g*f/p,v=m*c+g*l,b=m*u+g*a,T=l*(g+_),x=a*(g+_),E=c*(m+y),w=u*(m+y),I=Math.atan2(x-b,T-v),A=Math.atan2(w-b,E-v);this.arc(v+e,b+t,r,I,A,l*u>c*a)}return this.dirty=this.boundsDirty=!0,this},d.prototype.arc=function(e,t,n,i,r,s){if(i===r)return this;!(s=s||!1)&&r<=i?r+=2*Math.PI:s&&i<=r&&(i+=2*Math.PI);var o=s?-1*(i-r):r-i,a=40*Math.ceil(Math.abs(o)/(2*Math.PI));if(0===o)return this;var l=e+Math.cos(i)*n,u=t+Math.sin(i)*n;this.currentPath?this.currentPath.shape.points.push(l,u):this.moveTo(l,u);for(var c=this.currentPath.shape.points,d=o/(2*a),h=2*d,p=Math.cos(d),f=Math.sin(d),m=a-1,g=m%1/m,_=0;_<=m;_++){var y=d+i+h*(_+g*_),v=Math.cos(y),b=-Math.sin(y);c.push((p*v+f*b)*n+e,(p*-b+f*v)*n+t)}return this.dirty=this.boundsDirty=!0,this},d.prototype.beginFill=function(e,t){return this.filling=!0,this.fillColor=e||0,this.fillAlpha=void 0===t?1:t,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},d.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},d.prototype.drawRect=function(e,t,n,i){return this.drawShape(new l.Rectangle(e,t,n,i)),this},d.prototype.drawRoundedRect=function(e,t,n,i,r){return this.drawShape(new l.RoundedRectangle(e,t,n,i,r)),this},d.prototype.drawCircle=function(e,t,n){return this.drawShape(new l.Circle(e,t,n)),this},d.prototype.drawEllipse=function(e,t,n,i){return this.drawShape(new l.Ellipse(e,t,n,i)),this},d.prototype.drawPolygon=function(e){var t=e,n=!0;if(t instanceof l.Polygon&&(n=t.closed,t=t.points),!Array.isArray(t)){t=new Array(arguments.length);for(var i=0;i<t.length;++i)t[i]=arguments[i]}var r=new l.Polygon(t);return r.closed=n,this.drawShape(r),this},d.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},d.prototype.generateTexture=function(e,t,n){t=t||1;var i=this.getLocalBounds(),a=new s(i.width*t,i.height*t),l=r.fromCanvas(a.canvas,n);return l.baseTexture.resolution=t,a.context.scale(t,t),a.context.translate(-i.x,-i.y),o.renderGraphics(this,a.context),l},d.prototype._renderWebGL=function(e){this.glDirty&&(this.dirty=!0,this.glDirty=!1),e.setObjectRenderer(e.plugins.graphics),e.plugins.graphics.render(this)},d.prototype._renderCanvas=function(e){if(!0!==this.isMask){this._prevTint!==this.tint&&(this.dirty=!0);var t=e.context,n=this.worldTransform,i=e.blendModes[this.blendMode];i!==t.globalCompositeOperation&&(t.globalCompositeOperation=i);var r=e.resolution;t.setTransform(n.a*r,n.b*r,n.c*r,n.d*r,n.tx*r,n.ty*r),o.renderGraphics(this,t)}},d.prototype.getBounds=function(e){if(!this._currentBounds){if(!this.renderable)return l.Rectangle.EMPTY;this.boundsDirty&&(this.updateLocalBounds(),this.glDirty=!0,this.cachedSpriteDirty=!0,this.boundsDirty=!1);var t=this._localBounds,n=t.x,i=t.width+t.x,r=t.y,s=t.height+t.y,o=e||this.worldTransform,a=o.a,u=o.b,c=o.c,d=o.d,h=o.tx,p=o.ty,f=a*i+c*s+h,m=d*s+u*i+p,g=a*n+c*s+h,_=d*s+u*n+p,y=a*n+c*r+h,v=d*r+u*n+p,b=a*i+c*r+h,T=d*r+u*i+p,x=f,E=m,w=f,I=m;w=b<(w=y<(w=g<w?g:w)?y:w)?b:w,I=T<(I=v<(I=_<I?_:I)?v:I)?T:I,x=b>(x=y>(x=g>x?g:x)?y:x)?b:x,E=T>(E=v>(E=_>E?_:E)?v:E)?T:E,this._bounds.x=w,this._bounds.width=x-w,this._bounds.y=I,this._bounds.height=E-I,this._currentBounds=this._bounds}return this._currentBounds},d.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,c);for(var t=this.graphicsData,n=0;n<t.length;n++){var i=t[n];if(i.fill&&(i.shape&&i.shape.contains(c.x,c.y)))return!0}return!1},d.prototype.updateLocalBounds=function(){var e=1/0,t=-1/0,n=1/0,i=-1/0;if(this.graphicsData.length)for(var r,s,o,a,l,c,d=0;d<this.graphicsData.length;d++){var h=this.graphicsData[d],p=h.type,f=h.lineWidth;if(r=h.shape,p===u.SHAPES.RECT||p===u.SHAPES.RREC)o=r.x-f/2,a=r.y-f/2,e=o<e?o:e,t=o+(l=r.width+f)>t?o+l:t,n=a<n?a:n,i=a+(c=r.height+f)>i?a+c:i;else if(p===u.SHAPES.CIRC)o=r.x,a=r.y,e=o-(l=r.radius+f/2)<e?o-l:e,t=o+l>t?o+l:t,n=a-(c=r.radius+f/2)<n?a-c:n,i=a+c>i?a+c:i;else if(p===u.SHAPES.ELIP)o=r.x,a=r.y,e=o-(l=r.width+f/2)<e?o-l:e,t=o+l>t?o+l:t,n=a-(c=r.height+f/2)<n?a-c:n,i=a+c>i?a+c:i;else{s=r.points;for(var m=0;m<s.length;m+=2)e=(o=s[m])-f<e?o-f:e,t=o+f>t?o+f:t,n=(a=s[m+1])-f<n?a-f:n,i=a+f>i?a+f:i}}else e=0,t=0,n=0,i=0;var g=this.boundsPadding;this._localBounds.x=e-g,this._localBounds.width=t-e+2*g,this._localBounds.y=n-g,this._localBounds.height=i-n+2*g},d.prototype.drawShape=function(e){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var t=new a(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,e);return this.graphicsData.push(t),t.type===u.SHAPES.POLY&&(t.shape.closed=t.shape.closed||this.filling,this.currentPath=t),this.dirty=this.boundsDirty=!0,t},d.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();for(var t in this._webgl)for(var n=0;n<this._webgl[t].data.length;++n)this._webgl[t].data[n].destroy();this.graphicsData=null,this.currentPath=null,this._webgl=null,this._localBounds=null}},7240:e=>{function t(e,t,n,i,r,s,o){this.lineWidth=e,this.lineColor=t,this.lineAlpha=n,this._lineTint=t,this.fillColor=i,this.fillAlpha=r,this._fillTint=i,this.fill=s,this.shape=o,this.type=o.type}t.prototype.constructor=t,e.exports=t,t.prototype.clone=function(){return new t(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)},t.prototype.destroy=function(){this.shape=null}},84237:(e,t,n)=>{var i=n(70501),r=n(74650),s=n(46192),o=n(91830),a=n(65092),l=n(65075),u=n(66570);function c(e){o.call(this,e),this.graphicsDataPool=[],this.primitiveShader=null,this.complexPrimitiveShader=null,this.maximumSimplePolySize=200}c.prototype=Object.create(o.prototype),c.prototype.constructor=c,e.exports=c,a.registerPlugin("graphics",c),c.prototype.onContextChange=function(){},c.prototype.destroy=function(){o.prototype.destroy.call(this);for(var e=0;e<this.graphicsDataPool.length;++e)this.graphicsDataPool[e].destroy();this.graphicsDataPool=null},c.prototype.render=function(e){var t,n=this.renderer,r=n.gl,s=n.shaderManager.plugins.primitiveShader;e.dirty&&this.updateGraphics(e);var o=e._webGL[r.id];n.blendModeManager.setBlendMode(e.blendMode);for(var a=0,l=o.data.length;a<l;a++)t=o.data[a],1===o.data[a].mode?(n.stencilManager.pushStencil(e,t),r.uniform1f(n.shaderManager.complexPrimitiveShader.uniforms.alpha._location,e.worldAlpha*t.alpha),r.drawElements(r.TRIANGLE_FAN,4,r.UNSIGNED_SHORT,2*(t.indices.length-4)),n.stencilManager.popStencil(e,t)):(s=n.shaderManager.primitiveShader,n.shaderManager.setShader(s),r.uniformMatrix3fv(s.uniforms.translationMatrix._location,!1,e.worldTransform.toArray(!0)),r.uniformMatrix3fv(s.uniforms.projectionMatrix._location,!1,n.currentRenderTarget.projectionMatrix.toArray(!0)),r.uniform3fv(s.uniforms.tint._location,i.hex2rgb(e.tint)),r.uniform1f(s.uniforms.alpha._location,e.worldAlpha),r.bindBuffer(r.ARRAY_BUFFER,t.buffer),r.vertexAttribPointer(s.attributes.aVertexPosition,2,r.FLOAT,!1,24,0),r.vertexAttribPointer(s.attributes.aColor,4,r.FLOAT,!1,24,8),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.indexBuffer),r.drawElements(r.TRIANGLE_STRIP,t.indices.length,r.UNSIGNED_SHORT,0)),n.drawCount++},c.prototype.updateGraphics=function(e){var t,n,i=this.renderer.gl,r=e._webGL[i.id];if(r||(r=e._webGL[i.id]={lastIndex:0,data:[],gl:i}),e.dirty=!1,e.clearDirty){for(e.clearDirty=!1,t=0;t<r.data.length;t++){var o=r.data[t];o.reset(),this.graphicsDataPool.push(o)}r.data=[],r.lastIndex=0}for(t=r.lastIndex;t<e.graphicsData.length;t++){var a=e.graphicsData[t];if(a.type===s.SHAPES.POLY){if(a.points=a.shape.points.slice(),a.shape.closed&&(a.points[0]===a.points[a.points.length-2]&&a.points[1]===a.points[a.points.length-1]||a.points.push(a.points[0],a.points[1])),a.fill)if(a.points.length>=6)if(a.points.length<2*this.maximumSimplePolySize)n=this.switchMode(r,0),this.buildPoly(a,n)||(n=this.switchMode(r,1),this.buildComplexPoly(a,n));else n=this.switchMode(r,1),this.buildComplexPoly(a,n);a.lineWidth>0&&(n=this.switchMode(r,0),this.buildLine(a,n))}else n=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,n):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,n):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,n);r.lastIndex++}for(t=0;t<r.data.length;t++)(n=r.data[t]).dirty&&n.upload()},c.prototype.switchMode=function(e,t){var n;return e.data.length?((n=e.data[e.data.length-1]).points.length>32e4||n.mode!==t||1===t)&&((n=this.graphicsDataPool.pop()||new l(e.gl)).mode=t,e.data.push(n)):((n=this.graphicsDataPool.pop()||new l(e.gl)).mode=t,e.data.push(n)),n.dirty=!0,n},c.prototype.buildRectangle=function(e,t){var n=e.shape,r=n.x,s=n.y,o=n.width,a=n.height;if(e.fill){var l=i.hex2rgb(e.fillColor),u=e.fillAlpha,c=l[0]*u,d=l[1]*u,h=l[2]*u,p=t.points,f=t.indices,m=p.length/6;p.push(r,s),p.push(c,d,h,u),p.push(r+o,s),p.push(c,d,h,u),p.push(r,s+a),p.push(c,d,h,u),p.push(r+o,s+a),p.push(c,d,h,u),f.push(m,m,m+1,m+2,m+3,m+3)}if(e.lineWidth){var g=e.points;e.points=[r,s,r+o,s,r+o,s+a,r,s+a,r,s],this.buildLine(e,t),e.points=g}},c.prototype.buildRoundedRectangle=function(e,t){var n=e.shape,r=n.x,s=n.y,o=n.width,a=n.height,l=n.radius,c=[];if(c.push(r,s+l),this.quadraticBezierCurve(r,s+a-l,r,s+a,r+l,s+a,c),this.quadraticBezierCurve(r+o-l,s+a,r+o,s+a,r+o,s+a-l,c),this.quadraticBezierCurve(r+o,s+l,r+o,s,r+o-l,s,c),this.quadraticBezierCurve(r+l,s,r,s,r,s+l+1e-10,c),e.fill){var d=i.hex2rgb(e.fillColor),h=e.fillAlpha,p=d[0]*h,f=d[1]*h,m=d[2]*h,g=t.points,_=t.indices,y=g.length/6,v=u(c,null,2),b=0;for(b=0;b<v.length;b+=3)_.push(v[b]+y),_.push(v[b]+y),_.push(v[b+1]+y),_.push(v[b+2]+y),_.push(v[b+2]+y);for(b=0;b<c.length;b++)g.push(c[b],c[++b],p,f,m,h)}if(e.lineWidth){var T=e.points;e.points=c,this.buildLine(e,t),e.points=T}},c.prototype.quadraticBezierCurve=function(e,t,n,i,r,s,o){var a,l,u,c,d,h,p=o||[];function f(e,t,n){return e+(t-e)*n}for(var m=0,g=0;g<=20;g++)a=f(e,n,m=g/20),l=f(t,i,m),u=f(n,r,m),c=f(i,s,m),d=f(a,u,m),h=f(l,c,m),p.push(d,h);return p},c.prototype.buildCircle=function(e,t){var n,r,o=e.shape,a=o.x,l=o.y;e.type===s.SHAPES.CIRC?(n=o.radius,r=o.radius):(n=o.width,r=o.height);var u=Math.floor(30*Math.sqrt(o.radius))||Math.floor(15*Math.sqrt(o.width+o.height)),c=2*Math.PI/u,d=0;if(e.fill){var h=i.hex2rgb(e.fillColor),p=e.fillAlpha,f=h[0]*p,m=h[1]*p,g=h[2]*p,_=t.points,y=t.indices,v=_.length/6;for(y.push(v),d=0;d<u+1;d++)_.push(a,l,f,m,g,p),_.push(a+Math.sin(c*d)*n,l+Math.cos(c*d)*r,f,m,g,p),y.push(v++,v++);y.push(v-1)}if(e.lineWidth){var b=e.points;for(e.points=[],d=0;d<u+1;d++)e.points.push(a+Math.sin(c*d)*n,l+Math.cos(c*d)*r);this.buildLine(e,t),e.points=b}},c.prototype.buildLine=function(e,t){var n=0,s=e.points;if(0!==s.length){var o=new r.Point(s[0],s[1]),a=new r.Point(s[s.length-2],s[s.length-1]);if(o.x===a.x&&o.y===a.y){(s=s.slice()).pop(),s.pop();var l=(a=new r.Point(s[s.length-2],s[s.length-1])).x+.5*(o.x-a.x),u=a.y+.5*(o.y-a.y);s.unshift(l,u),s.push(l,u)}var c,d,h,p,f,m,g,_,y,v,b,T,x,E,w,I,A,S,C,O,M,k,R=t.points,N=t.indices,D=s.length/2,F=s.length,L=R.length/6,P=e.lineWidth/2,B=i.hex2rgb(e.lineColor),$=e.lineAlpha,U=B[0]*$,V=B[1]*$,z=B[2]*$;for(h=s[0],p=s[1],f=s[2],y=-(p-(m=s[3])),v=h-f,y/=k=Math.sqrt(y*y+v*v),v/=k,y*=P,v*=P,R.push(h-y,p-v,U,V,z,$),R.push(h+y,p+v,U,V,z,$),n=1;n<D-1;n++)h=s[2*(n-1)],p=s[2*(n-1)+1],f=s[2*n],m=s[2*n+1],g=s[2*(n+1)],_=s[2*(n+1)+1],y=-(p-m),v=h-f,y/=k=Math.sqrt(y*y+v*v),v/=k,y*=P,v*=P,b=-(m-_),T=f-g,b/=k=Math.sqrt(b*b+T*T),T/=k,A=(-y+h)*(-v+m)-(-y+f)*(-v+p),O=(-(b*=P)+g)*(-(T*=P)+m)-(-b+f)*(-T+_),M=(w=-v+p-(-v+m))*(C=-b+f-(-b+g))-(S=-T+_-(-T+m))*(I=-y+f-(-y+h)),Math.abs(M)<.1?(M+=10.1,R.push(f-y,m-v,U,V,z,$),R.push(f+y,m+v,U,V,z,$)):((c=(I*O-C*A)/M)-f)*(c-f)+((d=(S*A-w*O)/M)-m)+(d-m)>19600?(x=y-b,E=v-T,x/=k=Math.sqrt(x*x+E*E),E/=k,x*=P,E*=P,R.push(f-x,m-E),R.push(U,V,z,$),R.push(f+x,m+E),R.push(U,V,z,$),R.push(f-x,m-E),R.push(U,V,z,$),F++):(R.push(c,d),R.push(U,V,z,$),R.push(f-(c-f),m-(d-m)),R.push(U,V,z,$));for(h=s[2*(D-2)],p=s[2*(D-2)+1],f=s[2*(D-1)],y=-(p-(m=s[2*(D-1)+1])),v=h-f,y/=k=Math.sqrt(y*y+v*v),v/=k,y*=P,v*=P,R.push(f-y,m-v),R.push(U,V,z,$),R.push(f+y,m+v),R.push(U,V,z,$),N.push(L),n=0;n<F;n++)N.push(L++);N.push(L-1)}},c.prototype.buildComplexPoly=function(e,t){var n=e.points.slice();if(!(n.length<6)){var r=t.indices;t.points=n,t.alpha=e.fillAlpha,t.color=i.hex2rgb(e.fillColor);for(var s,o,a=1/0,l=-1/0,u=1/0,c=-1/0,d=0;d<n.length;d+=2)a=(s=n[d])<a?s:a,l=s>l?s:l,u=(o=n[d+1])<u?o:u,c=o>c?o:c;n.push(a,u,l,u,l,c,a,c);var h=n.length/2;for(d=0;d<h;d++)r.push(d)}},c.prototype.buildPoly=function(e,t){var n=e.points;if(!(n.length<6)){var r=t.points,s=t.indices,o=n.length/2,a=i.hex2rgb(e.fillColor),l=e.fillAlpha,c=a[0]*l,d=a[1]*l,h=a[2]*l,p=u(n,null,2);if(!p)return!1;var f=r.length/6,m=0;for(m=0;m<p.length;m+=3)s.push(p[m]+f),s.push(p[m]+f),s.push(p[m+1]+f),s.push(p[m+2]+f),s.push(p[m+2]+f);for(m=0;m<o;m++)r.push(n[2*m],n[2*m+1],c,d,h,l);return!0}}},65075:e=>{function t(e){this.gl=e,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}t.prototype.constructor=t,e.exports=t,t.prototype.reset=function(){this.points.length=0,this.indices.length=0},t.prototype.upload=function(){var e=this.gl;this.glPoints=new Float32Array(this.points),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,this.glPoints,e.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.glIndices,e.STATIC_DRAW),this.dirty=!1},t.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},44651:(e,t,n)=>{
/**
* @file Main export of the PIXI core library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
var i=e.exports=Object.assign(n(46192),n(74650),{utils:n(70501),ticker:n(2410),DisplayObject:n(52295),Container:n(67673),Sprite:n(52861),ParticleContainer:n(53326),SpriteRenderer:n(77920),ParticleRenderer:n(22952),Text:n(99252),Graphics:n(6720),GraphicsData:n(7240),GraphicsRenderer:n(84237),Texture:n(22699),BaseTexture:n(61936),RenderTexture:n(57443),VideoBaseTexture:n(3367),TextureUvs:n(21507),CanvasRenderer:n(88010),CanvasGraphics:n(34694),CanvasBuffer:n(61549),WebGLRenderer:n(65092),ShaderManager:n(43779),Shader:n(8306),ObjectRenderer:n(91830),RenderTarget:n(97955),AbstractFilter:n(50580),FXAAFilter:n(1438),SpriteMaskFilter:n(45207),autoDetectRenderer:function(e,t,n,r){return e=e||800,t=t||600,!r&&i.utils.isWebGLSupported()?new i.WebGLRenderer(e,t,n):new i.CanvasRenderer(e,t,n)}})},2825:(e,t,n)=>{var i=n(8840);function r(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}r.prototype.constructor=r,e.exports=r,r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var n=t||this.array;return e?(n[0]=this.a,n[1]=this.b,n[2]=0,n[3]=this.c,n[4]=this.d,n[5]=0,n[6]=this.tx,n[7]=this.ty,n[8]=1):(n[0]=this.a,n[1]=this.c,n[2]=this.tx,n[3]=this.b,n[4]=this.d,n[5]=this.ty,n[6]=0,n[7]=0,n[8]=1),n},r.prototype.apply=function(e,t){t=t||new i;var n=e.x,r=e.y;return t.x=this.a*n+this.c*r+this.tx,t.y=this.b*n+this.d*r+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new i;var n=1/(this.a*this.d+this.c*-this.b),r=e.x,s=e.y;return t.x=this.d*n*r+-this.c*n*s+(this.ty*this.c-this.tx*this.d)*n,t.y=this.a*n*s+-this.b*n*r+(-this.ty*this.a+this.tx*this.b)*n,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),n=Math.sin(e),i=this.a,r=this.c,s=this.tx;return this.a=i*t-this.b*n,this.b=i*n+this.b*t,this.c=r*t-this.d*n,this.d=r*n+this.d*t,this.tx=s*t-this.ty*n,this.ty=s*n+this.ty*t,this},r.prototype.append=function(e){var t=this.a,n=this.b,i=this.c,r=this.d;return this.a=e.a*t+e.b*i,this.b=e.a*n+e.b*r,this.c=e.c*t+e.d*i,this.d=e.c*n+e.d*r,this.tx=e.tx*t+e.ty*i+this.tx,this.ty=e.tx*n+e.ty*r+this.ty,this},r.prototype.prepend=function(e){var t=this.tx;if(1!==e.a||0!==e.b||0!==e.c||1!==e.d){var n=this.a,i=this.c;this.a=n*e.a+this.b*e.c,this.b=n*e.b+this.b*e.d,this.c=i*e.a+this.d*e.c,this.d=i*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.invert=function(){var e=this.a,t=this.b,n=this.c,i=this.d,r=this.tx,s=e*i-t*n;return this.a=i/s,this.b=-t/s,this.c=-n/s,this.d=e/s,this.tx=(n*this.ty-i*r)/s,this.ty=-(e*this.ty-t*r)/s,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copy=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.IDENTITY=new r,r.TEMP_MATRIX=new r},8840:e=>{function t(e,t){this.x=e||0,this.y=t||0}t.prototype.constructor=t,e.exports=t,t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copy=function(e){this.set(e.x,e.y)},t.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},t.prototype.set=function(e,t){this.x=e||0,this.y=t||(0!==t?this.x:0)}},74650:(e,t,n)=>{e.exports={Point:n(8840),Matrix:n(2825),Circle:n(25385),Ellipse:n(28419),Polygon:n(83671),Rectangle:n(92068),RoundedRectangle:n(71347)}},25385:(e,t,n)=>{var i=n(92068),r=n(46192);function s(e,t,n){this.x=e||0,this.y=t||0,this.radius=n||0,this.type=r.SHAPES.CIRC}s.prototype.constructor=s,e.exports=s,s.prototype.clone=function(){return new s(this.x,this.y,this.radius)},s.prototype.contains=function(e,t){if(this.radius<=0)return!1;var n=this.x-e,i=this.y-t;return(n*=n)+(i*=i)<=this.radius*this.radius},s.prototype.getBounds=function(){return new i(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},28419:(e,t,n)=>{var i=n(92068),r=n(46192);function s(e,t,n,i){this.x=e||0,this.y=t||0,this.width=n||0,this.height=i||0,this.type=r.SHAPES.ELIP}s.prototype.constructor=s,e.exports=s,s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height)},s.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var n=(e-this.x)/this.width,i=(t-this.y)/this.height;return(n*=n)+(i*=i)<=1},s.prototype.getBounds=function(){return new i(this.x-this.width,this.y-this.height,this.width,this.height)}},83671:(e,t,n)=>{var i=n(8840),r=n(46192);function s(e){var t=e;if(!Array.isArray(t)){t=new Array(arguments.length);for(var n=0;n<t.length;++n)t[n]=arguments[n]}if(t[0]instanceof i){for(var s=[],o=0,a=t.length;o<a;o++)s.push(t[o].x,t[o].y);t=s}this.closed=!0,this.points=t,this.type=r.SHAPES.POLY}s.prototype.constructor=s,e.exports=s,s.prototype.clone=function(){return new s(this.points.slice())},s.prototype.contains=function(e,t){for(var n=!1,i=this.points.length/2,r=0,s=i-1;r<i;s=r++){var o=this.points[2*r],a=this.points[2*r+1],l=this.points[2*s],u=this.points[2*s+1];a>t!=u>t&&e<(l-o)*(t-a)/(u-a)+o&&(n=!n)}return n}},92068:(e,t,n)=>{var i=n(46192);function r(e,t,n,r){this.x=e||0,this.y=t||0,this.width=n||0,this.height=r||0,this.type=i.SHAPES.RECT}r.prototype.constructor=r,e.exports=r,r.EMPTY=new r(0,0,0,0),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&(e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height)}},71347:(e,t,n)=>{var i=n(46192);function r(e,t,n,r,s){this.x=e||0,this.y=t||0,this.width=n||0,this.height=r||0,this.radius=s||20,this.type=i.SHAPES.RREC}r.prototype.constructor=r,e.exports=r,r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(e,t){return!(this.width<=0||this.height<=0)&&(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height)}},53326:(e,t,n)=>{var i=n(67673),r=n(46192);function s(e,t,n){i.call(this);(n=n||15e3)>16384&&(n=16384),n>(e=e||15e3)&&(n=e),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=n,this._buffers=null,this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=r.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(t)}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.setProperties=function(e){e&&(this._properties[0]="scale"in e?!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="alpha"in e?!!e.alpha:this._properties[4])},s.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},s.prototype.renderWebGL=function(e){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(e.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},s.prototype.onChildrenChange=function(e){var t=Math.floor(e/this._batchSize);t<this._bufferToUpdate&&(this._bufferToUpdate=t)},s.prototype.renderCanvas=function(e){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var t=e.context,n=this.worldTransform,i=!0,r=0,s=0,o=0,a=0;t.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var l=0;l<this.children.length;++l){var u=this.children[l];if(u.visible){var c=u.texture.frame;if(t.globalAlpha=this.worldAlpha*u.alpha,u.rotation%(2*Math.PI)==0)i&&(t.setTransform(n.a,n.b,n.c,n.d,n.tx,n.ty),i=!1),r=u.anchor.x*(-c.width*u.scale.x)+u.position.x+.5,s=u.anchor.y*(-c.height*u.scale.y)+u.position.y+.5,o=c.width*u.scale.x,a=c.height*u.scale.y;else{i||(i=!0),u.displayObjectUpdateTransform();var d=u.worldTransform;e.roundPixels?t.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):t.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),r=u.anchor.x*-c.width+.5,s=u.anchor.y*-c.height+.5,o=c.width,a=c.height}t.drawImage(u.texture.baseTexture.source,c.x,c.y,c.width,c.height,r,s,o,a)}}}},s.prototype.destroy=function(){if(i.prototype.destroy.apply(this,arguments),this._buffers)for(var e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._properties=null,this._buffers=null}},33361:e=>{function t(e,t,n,i){this.gl=e,this.vertSize=2,this.vertByteSize=4*this.vertSize,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var r=0;r<t.length;r++){var s=t[r];n[r]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.initBuffers()}t.prototype.constructor=t,e.exports=t,t.prototype.initBuffers=function(){var e,t,n=this.gl,i=0;for(this.dynamicStride=0,e=0;e<this.dynamicProperties.length;e++)(t=this.dynamicProperties[e]).offset=i,i+=t.size,this.dynamicStride+=t.size;this.dynamicData=new Float32Array(this.size*this.dynamicStride*4),this.dynamicBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this.dynamicBuffer),n.bufferData(n.ARRAY_BUFFER,this.dynamicData,n.DYNAMIC_DRAW);var r=0;for(this.staticStride=0,e=0;e<this.staticProperties.length;e++)(t=this.staticProperties[e]).offset=r,r+=t.size,this.staticStride+=t.size;this.staticData=new Float32Array(this.size*this.staticStride*4),this.staticBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this.staticBuffer),n.bufferData(n.ARRAY_BUFFER,this.staticData,n.DYNAMIC_DRAW)},t.prototype.uploadDynamic=function(e,t,n){for(var i=this.gl,r=0;r<this.dynamicProperties.length;r++){var s=this.dynamicProperties[r];s.uploadFunction(e,t,n,this.dynamicData,this.dynamicStride,s.offset)}i.bindBuffer(i.ARRAY_BUFFER,this.dynamicBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,this.dynamicData)},t.prototype.uploadStatic=function(e,t,n){for(var i=this.gl,r=0;r<this.staticProperties.length;r++){var s=this.staticProperties[r];s.uploadFunction(e,t,n,this.staticData,this.staticStride,s.offset)}i.bindBuffer(i.ARRAY_BUFFER,this.staticBuffer),i.bufferSubData(i.ARRAY_BUFFER,0,this.staticData)},t.prototype.bind=function(){var e,t,n=this.gl;for(n.bindBuffer(n.ARRAY_BUFFER,this.dynamicBuffer),e=0;e<this.dynamicProperties.length;e++)t=this.dynamicProperties[e],n.vertexAttribPointer(t.attribute,t.size,n.FLOAT,!1,4*this.dynamicStride,4*t.offset);for(n.bindBuffer(n.ARRAY_BUFFER,this.staticBuffer),e=0;e<this.staticProperties.length;e++)t=this.staticProperties[e],n.vertexAttribPointer(t.attribute,t.size,n.FLOAT,!1,4*this.staticStride,4*t.offset)},t.prototype.destroy=function(){this.dynamicProperties=null,this.dynamicData=null,this.gl.deleteBuffer(this.dynamicBuffer),this.staticProperties=null,this.staticData=null,this.gl.deleteBuffer(this.staticBuffer)}},22952:(e,t,n)=>{var i=n(91830),r=n(65092),s=n(63646),o=n(33361),a=n(74650);function l(e){i.call(this,e);this.indices=new Uint16Array(98304);for(var t=0,n=0;t<98304;t+=6,n+=4)this.indices[t+0]=n+0,this.indices[t+1]=n+1,this.indices[t+2]=n+2,this.indices[t+3]=n+0,this.indices[t+4]=n+2,this.indices[t+5]=n+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new a.Matrix}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,e.exports=l,r.registerPlugin("particle",l),l.prototype.onContextChange=function(){var e=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,uploadFunction:this.uploadAlpha,offset:0}]},l.prototype.start=function(){var e=this.renderer.gl;e.activeTexture(e.TEXTURE0),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var t=this.shader;this.renderer.shaderManager.setShader(t)},l.prototype.render=function(e){var t=e.children,n=t.length,i=e._maxSize,r=e._batchSize;if(0!==n){n>i&&(n=i),e._buffers||(e._buffers=this.generateBuffers(e)),this.renderer.blendModeManager.setBlendMode(e.blendMode);var s=this.renderer.gl,o=e.worldTransform.copy(this.tempMatrix);o.prepend(this.renderer.currentRenderTarget.projectionMatrix),s.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,o.toArray(!0)),s.uniform1f(this.shader.uniforms.uAlpha._location,e.worldAlpha);var a=t[0]._texture.baseTexture;if(a._glTextures[s.id])s.bindTexture(s.TEXTURE_2D,a._glTextures[s.id]);else{if(!this.renderer.updateTexture(a))return;e._properties[0]&&e._properties[3]||(e._bufferToUpdate=0)}for(var l=0,u=0;l<n;l+=r,u+=1){var c=n-l;c>r&&(c=r);var d=e._buffers[u];d.uploadDynamic(t,l,c),e._bufferToUpdate===u&&(d.uploadStatic(t,l,c),e._bufferToUpdate=u+1),d.bind(this.shader),s.drawElements(s.TRIANGLES,6*c,s.UNSIGNED_SHORT,0),this.renderer.drawCount++}}},l.prototype.generateBuffers=function(e){var t,n=this.renderer.gl,i=[],r=e._maxSize,s=e._batchSize,a=e._properties;for(t=0;t<r;t+=s)i.push(new o(n,this.properties,a,s));return i},l.prototype.uploadVertices=function(e,t,n,i,r,s){for(var o,a,l,u,c,d,h,p,f,m=0;m<n;m++)a=(o=e[t+m])._texture,u=o.scale.x,c=o.scale.y,a.trim?(d=(h=(l=a.trim).x-o.anchor.x*l.width)+a.crop.width,p=(f=l.y-o.anchor.y*l.height)+a.crop.height):(d=a._frame.width*(1-o.anchor.x),h=a._frame.width*-o.anchor.x,p=a._frame.height*(1-o.anchor.y),f=a._frame.height*-o.anchor.y),i[s]=h*u,i[s+1]=f*c,i[s+r]=d*u,i[s+r+1]=f*c,i[s+2*r]=d*u,i[s+2*r+1]=p*c,i[s+3*r]=h*u,i[s+3*r+1]=p*c,s+=4*r},l.prototype.uploadPosition=function(e,t,n,i,r,s){for(var o=0;o<n;o++){var a=e[t+o].position;i[s]=a.x,i[s+1]=a.y,i[s+r]=a.x,i[s+r+1]=a.y,i[s+2*r]=a.x,i[s+2*r+1]=a.y,i[s+3*r]=a.x,i[s+3*r+1]=a.y,s+=4*r}},l.prototype.uploadRotation=function(e,t,n,i,r,s){for(var o=0;o<n;o++){var a=e[t+o].rotation;i[s]=a,i[s+r]=a,i[s+2*r]=a,i[s+3*r]=a,s+=4*r}},l.prototype.uploadUvs=function(e,t,n,i,r,s){for(var o=0;o<n;o++){var a=e[t+o]._texture._uvs;a?(i[s]=a.x0,i[s+1]=a.y0,i[s+r]=a.x1,i[s+r+1]=a.y1,i[s+2*r]=a.x2,i[s+2*r+1]=a.y2,i[s+3*r]=a.x3,i[s+3*r+1]=a.y3,s+=4*r):(i[s]=0,i[s+1]=0,i[s+r]=0,i[s+r+1]=0,i[s+2*r]=0,i[s+2*r+1]=0,i[s+3*r]=0,i[s+3*r+1]=0,s+=4*r)}},l.prototype.uploadAlpha=function(e,t,n,i,r,s){for(var o=0;o<n;o++){var a=e[t+o].alpha;i[s]=a,i[s+r]=a,i[s+2*r]=a,i[s+3*r]=a,s+=4*r}},l.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},63646:(e,t,n)=>{var i=n(38297);function r(e){i.call(this,e,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},56820:(e,t,n)=>{var i=n(70501),r=n(74650),s=n(46192),o=n(65585);function a(e,t,n,a){if(o.call(this),i.sayHello(e),a)for(var l in s.DEFAULT_RENDER_OPTIONS)void 0===a[l]&&(a[l]=s.DEFAULT_RENDER_OPTIONS[l]);else a=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=t||800,this.height=n||600,this.view=a.view||document.createElement("canvas"),this.resolution=a.resolution,this.transparent=a.transparent,this.autoResize=a.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=a.preserveDrawingBuffer,this.clearBeforeRender=a.clearBeforeRender,this.roundPixels=a.roundPixels,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=a.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new r.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a,Object.defineProperties(a.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=e,this._backgroundColorString=i.hex2string(e),i.hex2rgb(e,this._backgroundColorRgb)}}}),a.prototype.resize=function(e,t){this.width=e*this.resolution,this.height=t*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},a.prototype.destroy=function(e){e&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},88010:(e,t,n)=>{var i=n(56820),r=n(39252),s=n(70501),o=n(74650),a=n(46192);function l(e,t,n){n=n||{},i.call(this,"Canvas",e,t,n),this.type=a.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new r,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1},this.resize(e,t)}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,e.exports=l,s.pluginTarget.mixin(l),l.prototype.render=function(e){var t=e.parent;this._lastObjectRendered=e,e.parent=this._tempDisplayObjectParent,e.updateTransform(),e.parent=t,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.context.globalCompositeOperation=this.blendModes[a.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(e,this.context)},l.prototype.destroy=function(e){this.destroyPlugins(),i.prototype.destroy.call(this,e),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},l.prototype.renderDisplayObject=function(e,t){var n=this.context;this.context=t,e.renderCanvas(this),this.context=n},l.prototype.resize=function(e,t){i.prototype.resize.call(this,e,t),this.smoothProperty&&(this.context[this.smoothProperty]=a.SCALE_MODES.DEFAULT===a.SCALE_MODES.LINEAR)},l.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[a.BLEND_MODES.SCREEN]="screen",this.blendModes[a.BLEND_MODES.OVERLAY]="overlay",this.blendModes[a.BLEND_MODES.DARKEN]="darken",this.blendModes[a.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[a.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[a.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[a.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[a.BLEND_MODES.HUE]="hue",this.blendModes[a.BLEND_MODES.SATURATION]="saturate",this.blendModes[a.BLEND_MODES.COLOR]="color",this.blendModes[a.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[a.BLEND_MODES.NORMAL]="source-over",this.blendModes[a.BLEND_MODES.ADD]="lighter",this.blendModes[a.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[a.BLEND_MODES.SCREEN]="source-over",this.blendModes[a.BLEND_MODES.OVERLAY]="source-over",this.blendModes[a.BLEND_MODES.DARKEN]="source-over",this.blendModes[a.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[a.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[a.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[a.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[a.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[a.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[a.BLEND_MODES.HUE]="source-over",this.blendModes[a.BLEND_MODES.SATURATION]="source-over",this.blendModes[a.BLEND_MODES.COLOR]="source-over",this.blendModes[a.BLEND_MODES.LUMINOSITY]="source-over"))}},61549:e=>{function t(e,t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=e,this.canvas.height=t}t.prototype.constructor=t,e.exports=t,Object.defineProperties(t.prototype,{width:{get:function(){return this.canvas.width},set:function(e){this.canvas.width=e}},height:{get:function(){return this.canvas.height},set:function(e){this.canvas.height=e}}}),t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(e,t){this.canvas.width=e,this.canvas.height=t},t.prototype.destroy=function(){this.context=null,this.canvas=null}},34694:(e,t,n)=>{var i=n(46192),r={};e.exports=r,r.renderGraphics=function(e,t){var n=e.worldAlpha;e.dirty&&(this.updateGraphicsTint(e),e.dirty=!1);for(var r=0;r<e.graphicsData.length;r++){var s=e.graphicsData[r],o=s.shape,a=s._fillTint,l=s._lineTint;if(t.lineWidth=s.lineWidth,s.type===i.SHAPES.POLY){t.beginPath();var u=o.points;t.moveTo(u[0],u[1]);for(var c=1;c<u.length/2;c++)t.lineTo(u[2*c],u[2*c+1]);o.closed&&t.lineTo(u[0],u[1]),u[0]===u[u.length-2]&&u[1]===u[u.length-1]&&t.closePath(),s.fill&&(t.globalAlpha=s.fillAlpha*n,t.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),t.fill()),s.lineWidth&&(t.globalAlpha=s.lineAlpha*n,t.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),t.stroke())}else if(s.type===i.SHAPES.RECT)(s.fillColor||0===s.fillColor)&&(t.globalAlpha=s.fillAlpha*n,t.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),t.fillRect(o.x,o.y,o.width,o.height)),s.lineWidth&&(t.globalAlpha=s.lineAlpha*n,t.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),t.strokeRect(o.x,o.y,o.width,o.height));else if(s.type===i.SHAPES.CIRC)t.beginPath(),t.arc(o.x,o.y,o.radius,0,2*Math.PI),t.closePath(),s.fill&&(t.globalAlpha=s.fillAlpha*n,t.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),t.fill()),s.lineWidth&&(t.globalAlpha=s.lineAlpha*n,t.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),t.stroke());else if(s.type===i.SHAPES.ELIP){var d=2*o.width,h=2*o.height,p=o.x-d/2,f=o.y-h/2;t.beginPath();var m=.5522848,g=d/2*m,_=h/2*m,y=p+d,v=f+h,b=p+d/2,T=f+h/2;t.moveTo(p,T),t.bezierCurveTo(p,T-_,b-g,f,b,f),t.bezierCurveTo(b+g,f,y,T-_,y,T),t.bezierCurveTo(y,T+_,b+g,v,b,v),t.bezierCurveTo(b-g,v,p,T+_,p,T),t.closePath(),s.fill&&(t.globalAlpha=s.fillAlpha*n,t.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),t.fill()),s.lineWidth&&(t.globalAlpha=s.lineAlpha*n,t.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),t.stroke())}else if(s.type===i.SHAPES.RREC){var x=o.x,E=o.y,w=o.width,I=o.height,A=o.radius,S=Math.min(w,I)/2|0;A=A>S?S:A,t.beginPath(),t.moveTo(x,E+A),t.lineTo(x,E+I-A),t.quadraticCurveTo(x,E+I,x+A,E+I),t.lineTo(x+w-A,E+I),t.quadraticCurveTo(x+w,E+I,x+w,E+I-A),t.lineTo(x+w,E+A),t.quadraticCurveTo(x+w,E,x+w-A,E),t.lineTo(x+A,E),t.quadraticCurveTo(x,E,x,E+A),t.closePath(),(s.fillColor||0===s.fillColor)&&(t.globalAlpha=s.fillAlpha*n,t.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),t.fill()),s.lineWidth&&(t.globalAlpha=s.lineAlpha*n,t.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),t.stroke())}}},r.renderGraphicsMask=function(e,t){var n=e.graphicsData.length;if(0!==n){t.beginPath();for(var r=0;r<n;r++){var s=e.graphicsData[r],o=s.shape;if(s.type===i.SHAPES.POLY){var a=o.points;t.moveTo(a[0],a[1]);for(var l=1;l<a.length/2;l++)t.lineTo(a[2*l],a[2*l+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&t.closePath()}else if(s.type===i.SHAPES.RECT)t.rect(o.x,o.y,o.width,o.height),t.closePath();else if(s.type===i.SHAPES.CIRC)t.arc(o.x,o.y,o.radius,0,2*Math.PI),t.closePath();else if(s.type===i.SHAPES.ELIP){var u=2*o.width,c=2*o.height,d=o.x-u/2,h=o.y-c/2,p=.5522848,f=u/2*p,m=c/2*p,g=d+u,_=h+c,y=d+u/2,v=h+c/2;t.moveTo(d,v),t.bezierCurveTo(d,v-m,y-f,h,y,h),t.bezierCurveTo(y+f,h,g,v-m,g,v),t.bezierCurveTo(g,v+m,y+f,_,y,_),t.bezierCurveTo(y-f,_,d,v+m,d,v),t.closePath()}else if(s.type===i.SHAPES.RREC){var b=o.x,T=o.y,x=o.width,E=o.height,w=o.radius,I=Math.min(x,E)/2|0;w=w>I?I:w,t.moveTo(b,T+w),t.lineTo(b,T+E-w),t.quadraticCurveTo(b,T+E,b+w,T+E),t.lineTo(b+x-w,T+E),t.quadraticCurveTo(b+x,T+E,b+x,T+E-w),t.lineTo(b+x,T+w),t.quadraticCurveTo(b+x,T,b+x-w,T),t.lineTo(b+w,T),t.quadraticCurveTo(b,T,b,T+w),t.closePath()}}}},r.updateGraphicsTint=function(e){if(16777215!==e.tint||e._prevTint!==e.tint){e._prevTint=e.tint;for(var t=(e.tint>>16&255)/255,n=(e.tint>>8&255)/255,i=(255&e.tint)/255,r=0;r<e.graphicsData.length;r++){var s=e.graphicsData[r],o=0|s.fillColor,a=0|s.lineColor;s._fillTint=((o>>16&255)/255*t*255<<16)+((o>>8&255)/255*n*255<<8)+(255&o)/255*i*255,s._lineTint=((a>>16&255)/255*t*255<<16)+((a>>8&255)/255*n*255<<8)+(255&a)/255*i*255}}}},39252:(e,t,n)=>{var i=n(34694);function r(){}r.prototype.constructor=r,e.exports=r,r.prototype.pushMask=function(e,t){t.context.save();var n=e.alpha,r=e.worldTransform,s=t.resolution;t.context.setTransform(r.a*s,r.b*s,r.c*s,r.d*s,r.tx*s,r.ty*s),e.texture||(i.renderGraphicsMask(e,t.context),t.context.clip()),e.worldAlpha=n},r.prototype.popMask=function(e){e.context.restore()},r.prototype.destroy=function(){}},87809:(e,t,n)=>{var i=n(70501),r={};e.exports=r,r.getTintedTexture=function(e,t){var n=e.texture,i="#"+("00000"+(0|(t=r.roundColor(t))).toString(16)).substr(-6);if(n.tintCache=n.tintCache||{},n.tintCache[i])return n.tintCache[i];var s=r.canvas||document.createElement("canvas");if(r.tintMethod(n,t,s),r.convertTintToImage){var o=new Image;o.src=s.toDataURL(),n.tintCache[i]=o}else n.tintCache[i]=s,r.canvas=null;return s},r.tintWithMultiply=function(e,t,n){var i=n.getContext("2d"),r=e.baseTexture.resolution,s=e.crop.clone();s.x*=r,s.y*=r,s.width*=r,s.height*=r,n.width=s.width,n.height=s.height,i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,s.width,s.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height)},r.tintWithOverlay=function(e,t,n){var i=n.getContext("2d"),r=e.baseTexture.resolution,s=e.crop.clone();s.x*=r,s.y*=r,s.width*=r,s.height*=r,n.width=s.width,n.height=s.height,i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,s.width,s.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height)},r.tintWithPerPixel=function(e,t,n){var r=n.getContext("2d"),s=e.baseTexture.resolution,o=e.crop.clone();o.x*=s,o.y*=s,o.width*=s,o.height*=s,n.width=o.width,n.height=o.height,r.globalCompositeOperation="copy",r.drawImage(e.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var a=i.hex2rgb(t),l=a[0],u=a[1],c=a[2],d=r.getImageData(0,0,o.width,o.height),h=d.data,p=0;p<h.length;p+=4)h[p+0]*=l,h[p+1]*=u,h[p+2]*=c;r.putImageData(d,0,0)},r.roundColor=function(e){var t=r.cacheStepsPerColorChannel,n=i.hex2rgb(e);return n[0]=Math.min(255,n[0]/t*t),n[1]=Math.min(255,n[1]/t*t),n[2]=Math.min(255,n[2]/t*t),i.rgb2hex(n)},r.cacheStepsPerColorChannel=8,r.convertTintToImage=!1,r.canUseMultiply=i.canUseNewCanvasBlendModes(),r.tintMethod=r.canUseMultiply?r.tintWithMultiply:r.tintWithPerPixel},65092:(e,t,n)=>{var i=n(56820),r=n(43779),s=n(89240),o=n(15468),a=n(64598),l=n(25396),u=n(97955),c=n(91830),d=n(1438),h=n(70501),p=n(46192);function f(e,t,n){n=n||{},i.call(this,"WebGL",e,t,n),this.type=p.RENDERER_TYPE.WEBGL,this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.handleContextLost,!1),this.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1),this._useFXAA=!!n.forceFXAA&&n.antialias,this._FXAAFilter=null,this._contextOptions={alpha:this.transparent,antialias:n.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:n.preserveDrawingBuffer},this.drawCount=0,this.shaderManager=new r(this),this.maskManager=new s(this),this.stencilManager=new o(this),this.filterManager=new a(this),this.blendModeManager=new l(this),this.currentRenderTarget=null,this.currentRenderer=new c(this),this.initPlugins(),this._createContext(),this._initContext(),this._mapGlModes(),this._renderTargetStack=[]}f.prototype=Object.create(i.prototype),f.prototype.constructor=f,e.exports=f,h.pluginTarget.mixin(f),f.glContextId=0,f.prototype._createContext=function(){var e=this.view.getContext("webgl",this._contextOptions)||this.view.getContext("experimental-webgl",this._contextOptions);if(this.gl=e,!e)throw new Error("This browser does not support webGL. Try using the canvas renderer");this.glContextId=f.glContextId++,e.id=this.glContextId,e.renderer=this},f.prototype._initContext=function(){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),this.renderTarget=new u(e,this.width,this.height,null,this.resolution,!0),this.setRenderTarget(this.renderTarget),this.emit("context",e),this.resize(this.width,this.height),this._useFXAA||(this._useFXAA=this._contextOptions.antialias&&!e.getContextAttributes().antialias),this._useFXAA&&(window.console.warn("FXAA antialiasing being used instead of native antialiasing"),this._FXAAFilter=[new d])},f.prototype.render=function(e){if(!this.gl.isContextLost()){this.drawCount=0,this._lastObjectRendered=e,this._useFXAA&&(this._FXAAFilter[0].uniforms.resolution.value.x=this.width,this._FXAAFilter[0].uniforms.resolution.value.y=this.height,e.filterArea=this.renderTarget.size,e.filters=this._FXAAFilter);var t=e.parent;e.parent=this._tempDisplayObjectParent,e.updateTransform(),e.parent=t;var n=this.gl;this.setRenderTarget(this.renderTarget),this.clearBeforeRender&&(this.transparent?n.clearColor(0,0,0,0):n.clearColor(this._backgroundColorRgb[0],this._backgroundColorRgb[1],this._backgroundColorRgb[2],1),n.clear(n.COLOR_BUFFER_BIT)),this.renderDisplayObject(e,this.renderTarget)}},f.prototype.renderDisplayObject=function(e,t,n){this.setRenderTarget(t),n&&t.clear(),this.filterManager.setFilterStack(t.filterStack),e.renderWebGL(this),this.currentRenderer.flush()},f.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},f.prototype.setRenderTarget=function(e){this.currentRenderTarget!==e&&(this.currentRenderTarget=e,this.currentRenderTarget.activate(),this.stencilManager.setMaskStack(e.stencilMaskStack))},f.prototype.resize=function(e,t){i.prototype.resize.call(this,e,t),this.filterManager.resize(e,t),this.renderTarget.resize(e,t),this.currentRenderTarget===this.renderTarget&&(this.renderTarget.activate(),this.gl.viewport(0,0,this.width,this.height))},f.prototype.updateTexture=function(e){if((e=e.baseTexture||e).hasLoaded){var t=this.gl;return e._glTextures[t.id]||(e._glTextures[t.id]=t.createTexture(),e.on("update",this.updateTexture,this),e.on("dispose",this.destroyTexture,this)),t.bindTexture(t.TEXTURE_2D,e._glTextures[t.id]),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultipliedAlpha),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.source),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e.scaleMode===p.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),e.mipmap&&e.isPowerOfTwo?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e.scaleMode===p.SCALE_MODES.LINEAR?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST),t.generateMipmap(t.TEXTURE_2D)):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e.scaleMode===p.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),e.isPowerOfTwo?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),e._glTextures[t.id]}},f.prototype.destroyTexture=function(e){(e=e.baseTexture||e).hasLoaded&&e._glTextures[this.gl.id]&&this.gl.deleteTexture(e._glTextures[this.gl.id])},f.prototype.handleContextLost=function(e){e.preventDefault()},f.prototype.handleContextRestored=function(){for(var e in this._initContext(),h.BaseTextureCache)h.BaseTextureCache[e]._glTextures.length=0},f.prototype.destroy=function(e){for(var t in this.destroyPlugins(),this.view.removeEventListener("webglcontextlost",this.handleContextLost),this.view.removeEventListener("webglcontextrestored",this.handleContextRestored),h.BaseTextureCache){var n=h.BaseTextureCache[t];n.off("update",this.updateTexture,this),n.off("dispose",this.destroyTexture,this)}i.prototype.destroy.call(this,e),this.uid=0,this.shaderManager.destroy(),this.maskManager.destroy(),this.stencilManager.destroy(),this.filterManager.destroy(),this.blendModeManager.destroy(),this.shaderManager=null,this.maskManager=null,this.filterManager=null,this.blendModeManager=null,this.currentRenderer=null,this.handleContextLost=null,this.handleContextRestored=null,this._contextOptions=null,this.drawCount=0,this.gl.useProgram(null),this.gl=null},f.prototype._mapGlModes=function(){var e=this.gl;this.blendModes||(this.blendModes={},this.blendModes[p.BLEND_MODES.NORMAL]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.ADD]=[e.SRC_ALPHA,e.DST_ALPHA],this.blendModes[p.BLEND_MODES.MULTIPLY]=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SCREEN]=[e.SRC_ALPHA,e.ONE],this.blendModes[p.BLEND_MODES.OVERLAY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.DARKEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.LIGHTEN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR_DODGE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR_BURN]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.HARD_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SOFT_LIGHT]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.DIFFERENCE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.EXCLUSION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.HUE]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.SATURATION]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.COLOR]=[e.ONE,e.ONE_MINUS_SRC_ALPHA],this.blendModes[p.BLEND_MODES.LUMINOSITY]=[e.ONE,e.ONE_MINUS_SRC_ALPHA]),this.drawModes||(this.drawModes={},this.drawModes[p.DRAW_MODES.POINTS]=e.POINTS,this.drawModes[p.DRAW_MODES.LINES]=e.LINES,this.drawModes[p.DRAW_MODES.LINE_LOOP]=e.LINE_LOOP,this.drawModes[p.DRAW_MODES.LINE_STRIP]=e.LINE_STRIP,this.drawModes[p.DRAW_MODES.TRIANGLES]=e.TRIANGLES,this.drawModes[p.DRAW_MODES.TRIANGLE_STRIP]=e.TRIANGLE_STRIP,this.drawModes[p.DRAW_MODES.TRIANGLE_FAN]=e.TRIANGLE_FAN)}},50580:(e,t,n)=>{var i=n(38297);function r(e,t,n){this.shaders=[],this.padding=0,this.uniforms=n||{},this.vertexSrc=e||i.defaultVertexSrc,this.fragmentSrc=t||i.defaultFragmentSrc}r.prototype.constructor=r,e.exports=r,r.prototype.getShader=function(e){var t=e.gl,n=this.shaders[t.id];return n||(n=new i(e.shaderManager,this.vertexSrc,this.fragmentSrc,this.uniforms,this.attributes),this.shaders[t.id]=n),n},r.prototype.applyFilter=function(e,t,n,i){var r=this.getShader(e);e.filterManager.applyFilter(r,t,n,i)},r.prototype.syncUniform=function(e){for(var t=0,n=this.shaders.length;t<n;++t)this.shaders[t].syncUniform(e)}},1438:(e,t,n)=>{var i=n(50580),r=n(67425);function s(){i.call(this,r.readFileSync("//FXAA.vert","utf8"),r.readFileSync("//FXAA.frag","utf8"),{resolution:{type:"v2",value:{x:1,y:1}}})}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n){var i=e.filterManager,r=this.getShader(e);i.applyFilter(r,t,n)}},45207:(e,t,n)=>{var i=n(50580),r=n(74650),s=n(67425);function o(e){var t=new r.Matrix;i.call(this,s.readFileSync("//spriteMaskFilter.vert","utf8"),s.readFileSync("//spriteMaskFilter.frag","utf8"),{mask:{type:"sampler2D",value:e._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:t.toArray(!0)}}),this.maskSprite=e,this.maskMatrix=t}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.applyFilter=function(e,t,n){var i=e.filterManager;this.uniforms.mask.value=this.maskSprite._texture,i.calculateMappedMatrix(t.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var r=this.getShader(e);i.applyFilter(r,t,n)},Object.defineProperties(o.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(e){this.uniforms.mask.value=e}},offset:{get:function(){return this.uniforms.offset.value},set:function(e){this.uniforms.offset.value=e}}})},25396:(e,t,n)=>{var i=n(61103);function r(e){i.call(this,e),this.currentBlendMode=99999}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.setBlendMode=function(e){if(this.currentBlendMode===e)return!1;this.currentBlendMode=e;var t=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(t[0],t[1]),!0}},64598:(e,t,n)=>{var i=n(61103),r=n(97955),s=n(46192),o=n(3885),a=n(74650);function l(e){i.call(this,e),this.filterStack=[],this.filterStack.push({renderTarget:e.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new a.Rectangle(0,0,e.width,e.height),this.currentFrame=null}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,e.exports=l,l.prototype.onContextChange=function(){this.texturePool.length=0;var e=this.renderer.gl;this.quad=new o(e)},l.prototype.setFilterStack=function(e){this.filterStack=e},l.prototype.pushFilter=function(e,t){var n=e.filterArea?e.filterArea.clone():e.getBounds();n.x=0|n.x,n.y=0|n.y,n.width=0|n.width,n.height=0|n.height;var i=0|t[0].padding;if(n.x-=i,n.y-=i,n.width+=2*i,n.height+=2*i,this.renderer.currentRenderTarget.transform){var r=this.renderer.currentRenderTarget.transform;n.x+=r.tx,n.y+=r.ty,this.capFilterArea(n),n.x-=r.tx,n.y-=r.ty}else this.capFilterArea(n);if(n.width>0&&n.height>0){this.currentFrame=n;var s=this.getRenderTarget();this.renderer.setRenderTarget(s),s.clear(),this.filterStack.push({renderTarget:s,filter:t})}else this.filterStack.push({renderTarget:null,filter:t})},l.prototype.popFilter=function(){var e=this.filterStack.pop(),t=this.filterStack[this.filterStack.length-1],n=e.renderTarget;if(e.renderTarget){var i=t.renderTarget,r=this.renderer.gl;this.currentFrame=n.frame,this.quad.map(this.textureSize,n.frame),r.bindBuffer(r.ARRAY_BUFFER,this.quad.vertexBuffer),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=e.filter;if(r.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,r.FLOAT,!1,0,32),r.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,r.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,n,i),this.returnRenderTarget(n);else{for(var a=n,l=this.getRenderTarget(!0),u=0;u<o.length-1;u++){var c=o[u];c.uniforms.dimensions&&(c.uniforms.dimensions.value[0]=this.renderer.width,c.uniforms.dimensions.value[1]=this.renderer.height,c.uniforms.dimensions.value[2]=this.quad.vertices[0],c.uniforms.dimensions.value[3]=this.quad.vertices[5]),c.applyFilter(this.renderer,a,l);var d=a;a=l,l=d}o[o.length-1].applyFilter(this.renderer,a,i),this.returnRenderTarget(a),this.returnRenderTarget(l)}return e.filter}},l.prototype.getRenderTarget=function(e){var t=this.texturePool.pop()||new r(this.renderer.gl,this.textureSize.width,this.textureSize.height,s.SCALE_MODES.LINEAR,this.renderer.resolution*s.FILTER_RESOLUTION);return t.frame=this.currentFrame,e&&t.clear(!0),t},l.prototype.returnRenderTarget=function(e){this.texturePool.push(e)},l.prototype.applyFilter=function(e,t,n,i){var r=this.renderer.gl;this.renderer.setRenderTarget(n),i&&n.clear(),this.renderer.shaderManager.setShader(e),e.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),e.syncUniforms(),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0),this.renderer.drawCount++},l.prototype.calculateMappedMatrix=function(e,t,n){var i=t.worldTransform.copy(a.Matrix.TEMP_MATRIX),r=t._texture.baseTexture,s=n.identity(),o=this.textureSize.height/this.textureSize.width;s.translate(e.x/this.textureSize.width,e.y/this.textureSize.height),s.scale(1,o);var l=this.textureSize.width/r.width,u=this.textureSize.height/r.height;return i.tx/=r.width*l,i.ty/=r.width*l,i.invert(),s.prepend(i),s.scale(1,1/o),s.scale(l,u),s.translate(t.anchor.x,t.anchor.y),s},l.prototype.capFilterArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0),e.x+e.width>this.textureSize.width&&(e.width=this.textureSize.width-e.x),e.y+e.height>this.textureSize.height&&(e.height=this.textureSize.height-e.y)},l.prototype.resize=function(e,t){this.textureSize.width=e,this.textureSize.height=t;for(var n=0;n<this.texturePool.length;n++)this.texturePool[n].resize(e,t)},l.prototype.destroy=function(){this.quad.destroy(),i.prototype.destroy.call(this),this.filterStack=null,this.offsetY=0;for(var e=0;e<this.texturePool.length;e++)this.texturePool[e].destroy();this.texturePool=null}},89240:(e,t,n)=>{var i=n(61103),r=n(45207);function s(e){i.call(this,e),this.stencilStack=[],this.reverse=!0,this.count=0,this.alphaMaskPool=[]}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.pushMask=function(e,t){t.texture?this.pushSpriteMask(e,t):this.pushStencilMask(e,t)},s.prototype.popMask=function(e,t){t.texture?this.popSpriteMask(e,t):this.popStencilMask(e,t)},s.prototype.pushSpriteMask=function(e,t){var n=this.alphaMaskPool.pop();n||(n=[new r(t)]),n[0].maskSprite=t,this.renderer.filterManager.pushFilter(e,n)},s.prototype.popSpriteMask=function(){var e=this.renderer.filterManager.popFilter();this.alphaMaskPool.push(e)},s.prototype.pushStencilMask=function(e,t){this.renderer.stencilManager.pushMask(t)},s.prototype.popStencilMask=function(e,t){this.renderer.stencilManager.popMask(t)}},43779:(e,t,n)=>{var i=n(61103),r=n(38297),s=n(47151),o=n(69691),a=n(70501);function l(e){i.call(this,e),this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var t=0;t<this.maxAttibs;t++)this.attribState[t]=!1;this.stack=[],this._currentId=-1,this.currentShader=null}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,a.pluginTarget.mixin(l),e.exports=l,l.prototype.onContextChange=function(){this.initPlugins();var e=this.renderer.gl;this.maxAttibs=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.attribState=[];for(var t=0;t<this.maxAttibs;t++)this.attribState[t]=!1;this.defaultShader=new r(this),this.primitiveShader=new o(this),this.complexPrimitiveShader=new s(this)},l.prototype.setAttribs=function(e){var t;for(t=0;t<this.tempAttribState.length;t++)this.tempAttribState[t]=!1;for(var n in e)this.tempAttribState[e[n]]=!0;var i=this.renderer.gl;for(t=0;t<this.attribState.length;t++)this.attribState[t]!==this.tempAttribState[t]&&(this.attribState[t]=this.tempAttribState[t],this.attribState[t]?i.enableVertexAttribArray(t):i.disableVertexAttribArray(t))},l.prototype.setShader=function(e){return this._currentId!==e.uid&&(this._currentId=e.uid,this.currentShader=e,this.renderer.gl.useProgram(e.program),this.setAttribs(e.attributes),!0)},l.prototype.destroy=function(){this.primitiveShader.destroy(),this.complexPrimitiveShader.destroy(),i.prototype.destroy.call(this),this.destroyPlugins(),this.attribState=null,this.tempAttribState=null}},15468:(e,t,n)=>{var i=n(61103),r=n(70501);function s(e){i.call(this,e),this.stencilMaskStack=null}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.setMaskStack=function(e){this.stencilMaskStack=e;var t=this.renderer.gl;0===e.stencilStack.length?t.disable(t.STENCIL_TEST):t.enable(t.STENCIL_TEST)},s.prototype.pushStencil=function(e,t){this.renderer.currentRenderTarget.attachStencilBuffer();var n=this.renderer.gl,i=this.stencilMaskStack;this.bindGraphics(e,t),0===i.stencilStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),i.reverse=!0,i.count=0),i.stencilStack.push(t);var r=i.count;n.colorMask(!1,!1,!1,!1),n.stencilFunc(n.ALWAYS,0,255),n.stencilOp(n.KEEP,n.KEEP,n.INVERT),1===t.mode?(n.drawElements(n.TRIANGLE_FAN,t.indices.length-4,n.UNSIGNED_SHORT,0),i.reverse?(n.stencilFunc(n.EQUAL,255-r,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)):(n.stencilFunc(n.EQUAL,r,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)),n.drawElements(n.TRIANGLE_FAN,4,n.UNSIGNED_SHORT,2*(t.indices.length-4)),i.reverse?n.stencilFunc(n.EQUAL,255-(r+1),255):n.stencilFunc(n.EQUAL,r+1,255),i.reverse=!i.reverse):(i.reverse?(n.stencilFunc(n.EQUAL,r,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,255-r,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),n.drawElements(n.TRIANGLE_STRIP,t.indices.length,n.UNSIGNED_SHORT,0),i.reverse?n.stencilFunc(n.EQUAL,r+1,255):n.stencilFunc(n.EQUAL,255-(r+1),255)),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),i.count++},s.prototype.bindGraphics=function(e,t){var n,i=this.renderer.gl;1===t.mode?(n=this.renderer.shaderManager.complexPrimitiveShader,this.renderer.shaderManager.setShader(n),i.uniformMatrix3fv(n.uniforms.translationMatrix._location,!1,e.worldTransform.toArray(!0)),i.uniformMatrix3fv(n.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(n.uniforms.tint._location,r.hex2rgb(e.tint)),i.uniform3fv(n.uniforms.color._location,t.color),i.uniform1f(n.uniforms.alpha._location,e.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,t.buffer),i.vertexAttribPointer(n.attributes.aVertexPosition,2,i.FLOAT,!1,8,0),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.indexBuffer)):(n=this.renderer.shaderManager.primitiveShader,this.renderer.shaderManager.setShader(n),i.uniformMatrix3fv(n.uniforms.translationMatrix._location,!1,e.worldTransform.toArray(!0)),i.uniformMatrix3fv(n.uniforms.projectionMatrix._location,!1,this.renderer.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(n.uniforms.tint._location,r.hex2rgb(e.tint)),i.uniform1f(n.uniforms.alpha._location,e.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,t.buffer),i.vertexAttribPointer(n.attributes.aVertexPosition,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(n.attributes.aColor,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.indexBuffer))},s.prototype.popStencil=function(e,t){var n=this.renderer.gl,i=this.stencilMaskStack;if(i.stencilStack.pop(),i.count--,0===i.stencilStack.length)n.disable(n.STENCIL_TEST);else{var r=i.count;this.bindGraphics(e,t),n.colorMask(!1,!1,!1,!1),1===t.mode?(i.reverse=!i.reverse,i.reverse?(n.stencilFunc(n.EQUAL,255-(r+1),255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,r+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),n.drawElements(n.TRIANGLE_FAN,4,n.UNSIGNED_SHORT,2*(t.indices.length-4)),n.stencilFunc(n.ALWAYS,0,255),n.stencilOp(n.KEEP,n.KEEP,n.INVERT),n.drawElements(n.TRIANGLE_FAN,t.indices.length-4,n.UNSIGNED_SHORT,0),this.renderer.drawCount+=2,i.reverse?n.stencilFunc(n.EQUAL,r,255):n.stencilFunc(n.EQUAL,255-r,255)):(i.reverse?(n.stencilFunc(n.EQUAL,r+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)):(n.stencilFunc(n.EQUAL,255-(r+1),255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)),n.drawElements(n.TRIANGLE_STRIP,t.indices.length,n.UNSIGNED_SHORT,0),this.renderer.drawCount++,i.reverse?n.stencilFunc(n.EQUAL,r,255):n.stencilFunc(n.EQUAL,255-r,255)),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP)}},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.stencilMaskStack.stencilStack=null},s.prototype.pushMask=function(e){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),e.dirty&&this.renderer.plugins.graphics.updateGraphics(e,this.renderer.gl),e._webGL[this.renderer.gl.id].data.length&&this.pushStencil(e,e._webGL[this.renderer.gl.id].data[0])},s.prototype.popMask=function(e){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),this.popStencil(e,e._webGL[this.renderer.gl.id].data[0])}},61103:e=>{function t(e){this.renderer=e,this.renderer.on("context",this.onContextChange,this)}t.prototype.constructor=t,e.exports=t,t.prototype.onContextChange=function(){},t.prototype.destroy=function(){this.renderer.off("context",this.onContextChange,this),this.renderer=null}},47151:(e,t,n)=>{var i=n(8306);function r(e){i.call(this,e,["attribute vec2 aVertexPosition;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform vec3 tint;","uniform float alpha;","uniform vec3 color;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = vec4(color * alpha * tint, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},color:{type:"3f",value:[0,0,0]},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0})}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},69691:(e,t,n)=>{var i=n(8306);function r(e){i.call(this,e,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform float flipY;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"),{tint:{type:"3f",value:[0,0,0]},alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aColor:0})}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r},8306:(e,t,n)=>{var i=n(70501);function r(e,t,n,r,s){if(!t||!n)throw new Error("Pixi.js Error. Shader requires vertexSrc and fragmentSrc");this.uid=i.uid(),this.gl=e.renderer.gl,this.shaderManager=e,this.program=null,this.uniforms=r||{},this.attributes=s||{},this.textureCount=1,this.vertexSrc=t,this.fragmentSrc=n,this.init()}r.prototype.constructor=r,e.exports=r,r.prototype.init=function(){this.compile(),this.gl.useProgram(this.program),this.cacheUniformLocations(Object.keys(this.uniforms)),this.cacheAttributeLocations(Object.keys(this.attributes))},r.prototype.cacheUniformLocations=function(e){for(var t=0;t<e.length;++t)this.uniforms[e[t]]._location=this.gl.getUniformLocation(this.program,e[t])},r.prototype.cacheAttributeLocations=function(e){for(var t=0;t<e.length;++t)this.attributes[e[t]]=this.gl.getAttribLocation(this.program,e[t])},r.prototype.compile=function(){var e=this.gl,t=this._glCompile(e.VERTEX_SHADER,this.vertexSrc),n=this._glCompile(e.FRAGMENT_SHADER,this.fragmentSrc),i=e.createProgram();return e.attachShader(i,t),e.attachShader(i,n),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",e.getProgramParameter(i,e.VALIDATE_STATUS)),console.error("gl.getError()",e.getError()),""!==e.getProgramInfoLog(i)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",e.getProgramInfoLog(i)),e.deleteProgram(i),i=null),e.deleteShader(t),e.deleteShader(n),this.program=i},r.prototype.syncUniform=function(e){var t,n,r=e._location,s=e.value,o=this.gl;switch(e.type){case"b":case"bool":case"boolean":o.uniform1i(r,s?1:0);break;case"i":case"1i":o.uniform1i(r,s);break;case"f":case"1f":o.uniform1f(r,s);break;case"2f":o.uniform2f(r,s[0],s[1]);break;case"3f":o.uniform3f(r,s[0],s[1],s[2]);break;case"4f":o.uniform4f(r,s[0],s[1],s[2],s[3]);break;case"v2":o.uniform2f(r,s.x,s.y);break;case"v3":o.uniform3f(r,s.x,s.y,s.z);break;case"v4":o.uniform4f(r,s.x,s.y,s.z,s.w);break;case"1iv":case"iv1":o.uniform1iv(r,s);break;case"2iv":o.uniform2iv(r,s);break;case"3iv":case"iv":o.uniform3iv(r,s);break;case"4iv":o.uniform4iv(r,s);break;case"1fv":case"fv1":o.uniform1fv(r,s);break;case"2fv":o.uniform2fv(r,s);break;case"3fv":case"fv":o.uniform3fv(r,s);break;case"4fv":o.uniform4fv(r,s);break;case"m2":case"mat2":case"Matrix2fv":o.uniformMatrix2fv(r,e.transpose,s);break;case"m3":case"mat3":case"Matrix3fv":o.uniformMatrix3fv(r,e.transpose,s);break;case"m4":case"mat4":case"Matrix4fv":o.uniformMatrix4fv(r,e.transpose,s);break;case"c":"number"==typeof s&&(s=i.hex2rgb(s)),o.uniform3f(r,s[0],s[1],s[2]);break;case"v2v":for(e._array||(e._array=new Float32Array(2*s.length)),t=0,n=s.length;t<n;++t)e._array[2*t]=s[t].x,e._array[2*t+1]=s[t].y;o.uniform2fv(r,e._array);break;case"v3v":for(e._array||(e._array=new Float32Array(3*s.length)),t=0,n=s.length;t<n;++t)e._array[3*t]=s[t].x,e._array[3*t+1]=s[t].y,e._array[3*t+2]=s[t].z;o.uniform3fv(r,e._array);break;case"v4v":for(e._array||(e._array=new Float32Array(4*s.length)),t=0,n=s.length;t<n;++t)e._array[4*t]=s[t].x,e._array[4*t+1]=s[t].y,e._array[4*t+2]=s[t].z,e._array[4*t+3]=s[t].w;o.uniform4fv(r,e._array);break;case"t":case"sampler2D":if(!e.value||!e.value.baseTexture.hasLoaded)break;o.activeTexture(o["TEXTURE"+this.textureCount]);var a=e.value.baseTexture._glTextures[o.id];a||(this.initSampler2D(e),a=e.value.baseTexture._glTextures[o.id]),o.bindTexture(o.TEXTURE_2D,a),o.uniform1i(e._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+e.type)}},r.prototype.syncUniforms=function(){for(var e in this.textureCount=1,this.uniforms)this.syncUniform(this.uniforms[e])},r.prototype.initSampler2D=function(e){var t=this.gl,n=e.value.baseTexture;if(n.hasLoaded)if(e.textureData){var i=e.textureData;n._glTextures[t.id]=t.createTexture(),t.bindTexture(t.TEXTURE_2D,n._glTextures[t.id]),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultipliedAlpha),t.texImage2D(t.TEXTURE_2D,0,i.luminance?t.LUMINANCE:t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n.source),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,i.magFilter?i.magFilter:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,i.wrapS?i.wrapS:t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,i.wrapS?i.wrapS:t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,i.wrapT?i.wrapT:t.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(n)},r.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},r.prototype._glCompile=function(e,t){var n=this.gl.createShader(e);return this.gl.shaderSource(n,t),this.gl.compileShader(n),this.gl.getShaderParameter(n,this.gl.COMPILE_STATUS)?n:(console.log(this.gl.getShaderInfoLog(n)),null)}},38297:(e,t,n)=>{var i=n(8306);function r(e,t,n,s,o){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(s)for(var l in s)a[l]=s[l];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(o)for(var c in o)u[c]=o[c];t=t||r.defaultVertexSrc,n=n||r.defaultFragmentSrc,i.call(this,e,t,n,a,u)}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),r.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},91830:(e,t,n)=>{var i=n(61103);function r(e){i.call(this,e)}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.flush=function(){},r.prototype.render=function(e){}},3885:e=>{function t(e){this.gl=e,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,128,e.DYNAMIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW),this.upload()}t.prototype.constructor=t,t.prototype.map=function(e,t){var n=0,i=0;this.uvs[0]=n,this.uvs[1]=i,this.uvs[2]=n+t.width/e.width,this.uvs[3]=i,this.uvs[4]=n+t.width/e.width,this.uvs[5]=i+t.height/e.height,this.uvs[6]=n,this.uvs[7]=i+t.height/e.height,n=t.x,i=t.y,this.vertices[0]=n,this.vertices[1]=i,this.vertices[2]=n+t.width,this.vertices[3]=i,this.vertices[4]=n+t.width,this.vertices[5]=i+t.height,this.vertices[6]=n,this.vertices[7]=i+t.height,this.upload()},t.prototype.upload=function(){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices),e.bufferSubData(e.ARRAY_BUFFER,32,this.uvs),e.bufferSubData(e.ARRAY_BUFFER,64,this.colors)},t.prototype.destroy=function(){var e=this.gl;e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer)},e.exports=t},97955:(e,t,n)=>{var i=n(74650),r=n(70501),s=n(46192),o=n(68614),a=function(e,t,n,a,l,u){(this.gl=e,this.frameBuffer=null,this.texture=null,this.size=new i.Rectangle(0,0,1,1),this.resolution=l||s.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new o,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||s.SCALE_MODES.DEFAULT,this.root=u,this.root)||(this.frameBuffer=e.createFramebuffer(),this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,a===s.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a===s.SCALE_MODES.LINEAR?e.LINEAR:e.NEAREST),r.isPowerOfTwo(t,n)?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0));this.resize(t,n)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(e){var t=this.gl;e&&t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var e=this.gl;this.stencilBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencilBuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer);var t=this.frame||this.size;this.calculateProjection(t),this.transform&&this.projectionMatrix.append(this.transform),e.viewport(0,0,t.width*this.resolution,t.height*this.resolution)},a.prototype.calculateProjection=function(e){var t=this.projectionMatrix;t.identity(),this.root?(t.a=1/e.width*2,t.d=-1/e.height*2,t.tx=-1-e.x*t.a,t.ty=1-e.y*t.d):(t.a=1/e.width*2,t.d=1/e.height*2,t.tx=-1-e.x*t.a,t.ty=-1-e.y*t.d)},a.prototype.resize=function(e,t){if(e|=0,t|=0,this.size.width!==e||this.size.height!==t){if(this.size.width=e,this.size.height=t,!this.root){var n=this.gl;n.bindTexture(n.TEXTURE_2D,this.texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e*this.resolution,t*this.resolution,0,n.RGBA,n.UNSIGNED_BYTE,null),this.stencilBuffer&&(n.bindRenderbuffer(n.RENDERBUFFER,this.stencilBuffer),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e*this.resolution,t*this.resolution))}var i=this.frame||this.size;this.calculateProjection(i)}},a.prototype.destroy=function(){var e=this.gl;e.deleteRenderbuffer(this.stencilBuffer),e.deleteFramebuffer(this.frameBuffer),e.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},68614:e=>{function t(){this.stencilStack=[],this.reverse=!0,this.count=0}t.prototype.constructor=t,e.exports=t},52861:(e,t,n)=>{var i=n(74650),r=n(22699),s=n(67673),o=n(87809),a=n(70501),l=n(46192),u=new i.Point;function c(e){s.call(this),this.anchor=new i.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=e||r.EMPTY}c.prototype=Object.create(s.prototype),c.prototype.constructor=c,e.exports=c,Object.defineProperties(c.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture._frame.width},set:function(e){this.scale.x=a.sign(this.scale.x)*e/this.texture._frame.width,this._width=e}},height:{get:function(){return Math.abs(this.scale.y)*this.texture._frame.height},set:function(e){this.scale.y=a.sign(this.scale.y)*e/this.texture._frame.height,this._height=e}},texture:{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e,this.cachedTint=16777215,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}}),c.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=a.sign(this.scale.x)*this._width/this.texture.frame.width),this._height&&(this.scale.y=a.sign(this.scale.y)*this._height/this.texture.frame.height)},c.prototype._renderWebGL=function(e){e.setObjectRenderer(e.plugins.sprite),e.plugins.sprite.render(this)},c.prototype.getBounds=function(e){if(!this._currentBounds){var t,n,i,r,s=this._texture._frame.width,o=this._texture._frame.height,a=s*(1-this.anchor.x),l=s*-this.anchor.x,u=o*(1-this.anchor.y),c=o*-this.anchor.y,d=e||this.worldTransform,h=d.a,p=d.b,f=d.c,m=d.d,g=d.tx,_=d.ty;if(0===p&&0===f)h<0&&(h*=-1),m<0&&(m*=-1),t=h*l+g,n=h*a+g,i=m*c+_,r=m*u+_;else{var y=h*l+f*c+g,v=m*c+p*l+_,b=h*a+f*c+g,T=m*c+p*a+_,x=h*a+f*u+g,E=m*u+p*a+_,w=h*l+f*u+g,I=m*u+p*l+_;t=w<(t=x<(t=b<(t=y)?b:t)?x:t)?w:t,i=I<(i=E<(i=T<(i=v)?T:i)?E:i)?I:i,n=w>(n=x>(n=b>(n=y)?b:n)?x:n)?w:n,r=I>(r=E>(r=T>(r=v)?T:r)?E:r)?I:r}if(this.children.length){var A=this.containerGetBounds();a=A.x,l=A.x+A.width,t=t<a?t:a,i=i<(u=A.y)?i:u,n=n>l?n:l,r=r>(c=A.y+A.height)?r:c}var S=this._bounds;S.x=t,S.width=n-t,S.y=i,S.height=r-i,this._currentBounds=S}return this._currentBounds},c.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},c.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,u);var t,n=this._texture._frame.width,i=this._texture._frame.height,r=-n*this.anchor.x;return u.x>r&&u.x<r+n&&(t=-i*this.anchor.y,u.y>t&&u.y<t+i)},c.prototype._renderCanvas=function(e){if(!(this.texture.crop.width<=0||this.texture.crop.height<=0)){var t=e.blendModes[this.blendMode];if(t!==e.context.globalCompositeOperation&&(e.context.globalCompositeOperation=t),this.texture.valid){var n,i,r,s,a=this._texture,u=this.worldTransform;e.context.globalAlpha=this.worldAlpha;var c=a.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;if(e.smoothProperty&&e.context[e.smoothProperty]!==c&&(e.context[e.smoothProperty]=c),a.rotate){var d=u.a,h=u.b;u.a=-u.c,u.b=-u.d,u.c=d,u.d=h,r=a.crop.height,s=a.crop.width,n=a.trim?a.trim.y-this.anchor.y*a.trim.height:this.anchor.y*-a._frame.height,i=a.trim?a.trim.x-this.anchor.x*a.trim.width:this.anchor.x*-a._frame.width}else r=a.crop.width,s=a.crop.height,n=a.trim?a.trim.x-this.anchor.x*a.trim.width:this.anchor.x*-a._frame.width,i=a.trim?a.trim.y-this.anchor.y*a.trim.height:this.anchor.y*-a._frame.height;e.roundPixels?(e.context.setTransform(u.a,u.b,u.c,u.d,u.tx*e.resolution|0,u.ty*e.resolution|0),n|=0,i|=0):e.context.setTransform(u.a,u.b,u.c,u.d,u.tx*e.resolution,u.ty*e.resolution);var p=a.baseTexture.resolution;16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=o.getTintedTexture(this,this.tint)),e.context.drawImage(this.tintedTexture,0,0,r*p,s*p,n*e.resolution,i*e.resolution,r*e.resolution,s*e.resolution)):e.context.drawImage(a.baseTexture.source,a.crop.x*p,a.crop.y*p,r*p,s*p,n*e.resolution,i*e.resolution,r*e.resolution,s*e.resolution)}}},c.prototype.destroy=function(e,t){s.prototype.destroy.call(this),this.anchor=null,e&&this._texture.destroy(t),this._texture=null,this.shader=null},c.fromFrame=function(e){var t=a.TextureCache[e];if(!t)throw new Error('The frameId "'+e+'" does not exist in the texture cache');return new c(t)},c.fromImage=function(e,t,n){return new c(r.fromImage(e,t,n))}},77920:(e,t,n)=>{var i=n(91830),r=n(65092),s=n(46192);function o(e){i.call(this,e),this.vertSize=5,this.vertByteSize=4*this.vertSize,this.size=s.SPRITE_BATCH_SIZE;var t=4*this.size*this.vertByteSize,n=6*this.size;this.vertices=new ArrayBuffer(t),this.positions=new Float32Array(this.vertices),this.colors=new Uint32Array(this.vertices),this.indices=new Uint16Array(n);for(var r=0,o=0;r<n;r+=6,o+=4)this.indices[r+0]=o+0,this.indices[r+1]=o+1,this.indices[r+2]=o+2,this.indices[r+3]=o+0,this.indices[r+4]=o+2,this.indices[r+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,e.exports=o,r.registerPlugin("sprite",o),o.prototype.onContextChange=function(){var e=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,this.vertices,e.DYNAMIC_DRAW),this.currentBlendMode=99999},o.prototype.render=function(e){var t=e._texture;this.currentBatchSize>=this.size&&this.flush();var n=t._uvs;if(n){var i,r,s,o,a=e.anchor.x,l=e.anchor.y;if(t.trim&&void 0===e.tileScale){var u=t.trim;i=(r=u.x-a*u.width)+t.crop.width,s=(o=u.y-l*u.height)+t.crop.height}else i=t._frame.width*(1-a),r=t._frame.width*-a,s=t._frame.height*(1-l),o=t._frame.height*-l;var c=this.currentBatchSize*this.vertByteSize,d=e.worldTransform,h=d.a,p=d.b,f=d.c,m=d.d,g=d.tx,_=d.ty,y=this.colors,v=this.positions;this.renderer.roundPixels?(v[c]=h*r+f*o+g|0,v[c+1]=m*o+p*r+_|0,v[c+5]=h*i+f*o+g|0,v[c+6]=m*o+p*i+_|0,v[c+10]=h*i+f*s+g|0,v[c+11]=m*s+p*i+_|0,v[c+15]=h*r+f*s+g|0,v[c+16]=m*s+p*r+_|0):(v[c]=h*r+f*o+g,v[c+1]=m*o+p*r+_,v[c+5]=h*i+f*o+g,v[c+6]=m*o+p*i+_,v[c+10]=h*i+f*s+g,v[c+11]=m*s+p*i+_,v[c+15]=h*r+f*s+g,v[c+16]=m*s+p*r+_),v[c+2]=n.x0,v[c+3]=n.y0,v[c+7]=n.x1,v[c+8]=n.y1,v[c+12]=n.x2,v[c+13]=n.y2,v[c+17]=n.x3,v[c+18]=n.y3;var b=e.tint;y[c+4]=y[c+9]=y[c+14]=y[c+19]=(b>>16)+(65280&b)+((255&b)<<16)+(255*e.worldAlpha<<24),this.sprites[this.currentBatchSize++]=e}},o.prototype.flush=function(){if(0!==this.currentBatchSize){var e,t,n,i,r=this.renderer.gl;if(this.currentBatchSize>.5*this.size)r.bufferSubData(r.ARRAY_BUFFER,0,this.vertices);else{var s=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);r.bufferSubData(r.ARRAY_BUFFER,0,s)}for(var o,a=0,l=0,u=null,c=this.renderer.blendModeManager.currentBlendMode,d=null,h=!1,p=!1,f=0,m=this.currentBatchSize;f<m;f++)t=(o=this.sprites[f])._texture.baseTexture,h=c!==(n=o.blendMode),p=d!==(i=o.shader||this.shader),(u!==t||h||p)&&(this.renderBatch(u,a,l),l=f,a=0,u=t,h&&(c=n,this.renderer.blendModeManager.setBlendMode(c)),p&&((e=(d=i).shaders?d.shaders[r.id]:d)||(e=d.getShader(this.renderer)),this.renderer.shaderManager.setShader(e),e.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),e.syncUniforms(),r.activeTexture(r.TEXTURE0))),a++;this.renderBatch(u,a,l),this.currentBatchSize=0}},o.prototype.renderBatch=function(e,t,n){if(0!==t){var i=this.renderer.gl;e._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,e._glTextures[i.id]):this.renderer.updateTexture(e),i.drawElements(i.TRIANGLES,6*t,i.UNSIGNED_SHORT,6*n*2),this.renderer.drawCount++}},o.prototype.start=function(){var e=this.renderer.gl;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var t=this.vertByteSize;e.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,e.FLOAT,!1,t,0),e.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,e.FLOAT,!1,t,8),e.vertexAttribPointer(this.shader.attributes.aColor,4,e.UNSIGNED_BYTE,!0,t,16)},o.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),i.prototype.destroy.call(this),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},99252:(e,t,n)=>{var i=n(52861),r=n(22699),s=n(74650),o=n(70501),a=n(46192);function l(e,t,n){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=n||a.RESOLUTION,this._text=null,this._style=null;var o=r.fromCanvas(this.canvas);o.trim=new s.Rectangle,i.call(this,o),this.text=e,this.style=t}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,e.exports=l,l.fontPropertiesCache={},l.fontPropertiesCanvas=document.createElement("canvas"),l.fontPropertiesContext=l.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(l.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(e){this.scale.x=e/this._texture._frame.width,this._width=e}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(e){this.scale.y=e/this._texture._frame.height,this._height=e}},style:{get:function(){return this._style},set:function(e){"number"==typeof(e=e||{}).fill&&(e.fill=o.hex2string(e.fill)),"number"==typeof e.stroke&&(e.stroke=o.hex2string(e.stroke)),"number"==typeof e.dropShadowColor&&(e.dropShadowColor=o.hex2string(e.dropShadowColor)),e.font=e.font||"bold 20pt Arial",e.fill=e.fill||"black",e.align=e.align||"left",e.stroke=e.stroke||"black",e.strokeThickness=e.strokeThickness||0,e.wordWrap=e.wordWrap||!1,e.wordWrapWidth=e.wordWrapWidth||100,e.dropShadow=e.dropShadow||!1,e.dropShadowColor=e.dropShadowColor||"#000000",e.dropShadowAngle=e.dropShadowAngle||Math.PI/6,e.dropShadowDistance=e.dropShadowDistance||5,e.padding=e.padding||0,e.textBaseline=e.textBaseline||"alphabetic",e.lineJoin=e.lineJoin||"miter",e.miterLimit=e.miterLimit||10,this._style=e,this.dirty=!0}},text:{get:function(){return this._text},set:function(e){e=e.toString()||" ",this._text!==e&&(this._text=e,this.dirty=!0)}}}),l.prototype.updateText=function(){var e=this._style;this.context.font=e.font;for(var t=(e.wordWrap?this.wordWrap(this._text):this._text).split(/(?:\r\n|\r|\n)/),n=new Array(t.length),i=0,r=this.determineFontProperties(e.font),s=0;s<t.length;s++){var o=this.context.measureText(t[s]).width;n[s]=o,i=Math.max(i,o)}var a=i+e.strokeThickness;e.dropShadow&&(a+=e.dropShadowDistance),this.canvas.width=(a+this.context.lineWidth)*this.resolution;var l,u,c=this.style.lineHeight||r.fontSize+e.strokeThickness,d=c*t.length;if(e.dropShadow&&(d+=e.dropShadowDistance),this.canvas.height=(d+2*this._style.padding)*this.resolution,this.context.scale(this.resolution,this.resolution),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.font=e.font,this.context.strokeStyle=e.stroke,this.context.lineWidth=e.strokeThickness,this.context.textBaseline=e.textBaseline,this.context.lineJoin=e.lineJoin,this.context.miterLimit=e.miterLimit,e.dropShadow){this.context.fillStyle=e.dropShadowColor;var h=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,p=Math.sin(e.dropShadowAngle)*e.dropShadowDistance;for(s=0;s<t.length;s++)l=e.strokeThickness/2,u=e.strokeThickness/2+s*c+r.ascent,"right"===e.align?l+=i-n[s]:"center"===e.align&&(l+=(i-n[s])/2),e.fill&&this.context.fillText(t[s],l+h,u+p+this._style.padding)}for(this.context.fillStyle=e.fill,s=0;s<t.length;s++)l=e.strokeThickness/2,u=e.strokeThickness/2+s*c+r.ascent,"right"===e.align?l+=i-n[s]:"center"===e.align&&(l+=(i-n[s])/2),e.stroke&&e.strokeThickness&&this.context.strokeText(t[s],l,u+this._style.padding),e.fill&&this.context.fillText(t[s],l,u+this._style.padding);this.updateTexture()},l.prototype.updateTexture=function(){var e=this._texture;e.baseTexture.hasLoaded=!0,e.baseTexture.resolution=this.resolution,e.baseTexture.width=this.canvas.width/this.resolution,e.baseTexture.height=this.canvas.height/this.resolution,e.crop.width=e._frame.width=this.canvas.width/this.resolution,e.crop.height=e._frame.height=this.canvas.height/this.resolution,e.trim.x=0,e.trim.y=-this._style.padding,e.trim.width=e._frame.width,e.trim.height=e._frame.height-2*this._style.padding,this._width=this.canvas.width/this.resolution,this._height=this.canvas.height/this.resolution,e.baseTexture.emit("update",e.baseTexture),this.dirty=!1},l.prototype.renderWebGL=function(e){this.dirty&&this.updateText(),i.prototype.renderWebGL.call(this,e)},l.prototype._renderCanvas=function(e){this.dirty&&this.updateText(),i.prototype._renderCanvas.call(this,e)},l.prototype.determineFontProperties=function(e){var t=l.fontPropertiesCache[e];if(!t){t={};var n=l.fontPropertiesCanvas,i=l.fontPropertiesContext;i.font=e;var r=Math.ceil(i.measureText("|MÉq").width),s=Math.ceil(i.measureText("M").width),o=2*s;s=1.4*s|0,n.width=r,n.height=o,i.fillStyle="#f00",i.fillRect(0,0,r,o),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText("|MÉq",0,s);var a,u,c=i.getImageData(0,0,r,o).data,d=c.length,h=4*r,p=0,f=!1;for(a=0;a<s;a++){for(u=0;u<h;u+=4)if(255!==c[p+u]){f=!0;break}if(f)break;p+=h}for(t.ascent=s-a,p=d-h,f=!1,a=o;a>s;a--){for(u=0;u<h;u+=4)if(255!==c[p+u]){f=!0;break}if(f)break;p-=h}t.descent=a-s,t.fontSize=t.ascent+t.descent,l.fontPropertiesCache[e]=t}return t},l.prototype.wordWrap=function(e){for(var t="",n=e.split("\n"),i=this._style.wordWrapWidth,r=0;r<n.length;r++){for(var s=i,o=n[r].split(" "),a=0;a<o.length;a++){var l=this.context.measureText(o[a]).width,u=l+this.context.measureText(" ").width;0===a||u>s?(a>0&&(t+="\n"),t+=o[a],s=i-l):(s-=u,t+=" "+o[a])}r<n.length-1&&(t+="\n")}return t},l.prototype.getBounds=function(e){return this.dirty&&this.updateText(),i.prototype.getBounds.call(this,e)},l.prototype.destroy=function(e){this.context=null,this.canvas=null,this._style=null,this._texture.destroy(void 0===e||e)}},61936:(e,t,n)=>{var i=n(70501),r=n(46192),s=n(65585);function o(e,t,n){s.call(this),this.uid=i.uid(),this.resolution=n||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=t||r.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=!1,this._glTextures=[],e&&this.loadSource(e)}o.prototype=Object.create(s.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=i.isPowerOfTwo(this.realWidth,this.realHeight),this.emit("update",this)},o.prototype.loadSource=function(e){var t=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,t&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=e,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!e.getContext){this.isLoading=!0;var n=this;e.onload=function(){e.onload=null,e.onerror=null,n.isLoading&&(n.isLoading=!1,n._sourceLoaded(),n.emit("loaded",n))},e.onerror=function(){e.onload=null,e.onerror=null,n.isLoading&&(n.isLoading=!1,n.emit("error",n))},e.complete&&e.src&&(this.isLoading=!1,e.onload=null,e.onerror=null,e.width&&e.height?(this._sourceLoaded(),t&&this.emit("loaded",this)):t&&this.emit("error",this))}},o.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},o.prototype.destroy=function(){this.imageUrl?(delete i.BaseTextureCache[this.imageUrl],delete i.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete i.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},o.prototype.dispose=function(){this.emit("dispose",this),this._glTextures.length=0},o.prototype.updateSourceImage=function(e){this.source.src=e,this.loadSource(this.source)},o.fromImage=function(e,t,n){var r=i.BaseTextureCache[e];if(void 0===t&&0!==e.indexOf("data:")&&(t=!0),!r){var s=new Image;t&&(s.crossOrigin=""),(r=new o(s,n)).imageUrl=e,s.src=e,i.BaseTextureCache[e]=r,r.resolution=i.getResolutionOfUrl(e)}return r},o.fromCanvas=function(e,t){e._pixiId||(e._pixiId="canvas_"+i.uid());var n=i.BaseTextureCache[e._pixiId];return n||(n=new o(e,t),i.BaseTextureCache[e._pixiId]=n),n}},57443:(e,t,n)=>{var i=n(61936),r=n(22699),s=n(97955),o=n(64598),a=n(61549),l=n(74650),u=n(46192),c=new l.Matrix;function d(e,t,n,c,d){if(!e)throw new Error("Unable to create RenderTexture, you must pass a renderer into the constructor.");t=t||100,n=n||100,d=d||u.RESOLUTION;var h=new i;if(h.width=t,h.height=n,h.resolution=d,h.scaleMode=c||u.SCALE_MODES.DEFAULT,h.hasLoaded=!0,r.call(this,h,new l.Rectangle(0,0,t,n)),this.width=t,this.height=n,this.resolution=d,this.render=null,this.renderer=e,this.renderer.type===u.RENDERER_TYPE.WEBGL){var p=this.renderer.gl;this.textureBuffer=new s(p,this.width,this.height,h.scaleMode,this.resolution),this.baseTexture._glTextures[p.id]=this.textureBuffer.texture,this.filterManager=new o(this.renderer),this.filterManager.onContextChange(),this.filterManager.resize(t,n),this.render=this.renderWebGL,this.renderer.currentRenderer.start(),this.renderer.currentRenderTarget.activate()}else this.render=this.renderCanvas,this.textureBuffer=new a(this.width*this.resolution,this.height*this.resolution),this.baseTexture.source=this.textureBuffer.canvas;this.valid=!0,this._updateUvs()}d.prototype=Object.create(r.prototype),d.prototype.constructor=d,e.exports=d,d.prototype.resize=function(e,t,n){e===this.width&&t===this.height||(this.valid=e>0&&t>0,this.width=this._frame.width=this.crop.width=e,this.height=this._frame.height=this.crop.height=t,n&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},d.prototype.clear=function(){this.valid&&(this.renderer.type===u.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},d.prototype.renderWebGL=function(e,t,n,i){if(this.valid){if(i=void 0===i||i,//!updateTransform;
this.textureBuffer.transform=t,this.textureBuffer.activate(),e.worldAlpha=1,i){e.worldTransform.identity(),e.currentBounds=null;var r,s,o=e.children;for(r=0,s=o.length;r<s;++r)o[r].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(e,this.textureBuffer,n),this.renderer.filterManager=a}},d.prototype.renderCanvas=function(e,t,n,i){if(this.valid){i=!!i;var r=c;r.identity(),t&&r.append(t),e.worldTransform=r;var s=e.worldTransform;e.worldAlpha=1;var o,a,l=e.children;for(o=0,a=l.length;o<a;++o)l[o].updateTransform();n&&this.textureBuffer.clear();var u=this.textureBuffer.context,d=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(e,u),this.renderer.resolution=d,e.worldTransform=s}},d.prototype.destroy=function(){r.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},d.prototype.getImage=function(){var e=new Image;return e.src=this.getBase64(),e},d.prototype.getBase64=function(){return this.getCanvas().toDataURL()},d.prototype.getCanvas=function(){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var e=this.renderer.gl,t=this.textureBuffer.size.width,n=this.textureBuffer.size.height,i=new Uint8Array(4*t*n);e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),e.readPixels(0,0,t,n,e.RGBA,e.UNSIGNED_BYTE,i),e.bindFramebuffer(e.FRAMEBUFFER,null);var r=new a(t,n),s=r.context.getImageData(0,0,t,n);return s.data.set(i),r.context.putImageData(s,0,0),r.canvas}return this.textureBuffer.canvas},d.prototype.getPixels=function(){var e,t;if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var n=this.renderer.gl;e=this.textureBuffer.size.width,t=this.textureBuffer.size.height;var i=new Uint8Array(4*e*t);return n.bindFramebuffer(n.FRAMEBUFFER,this.textureBuffer.frameBuffer),n.readPixels(0,0,e,t,n.RGBA,n.UNSIGNED_BYTE,i),n.bindFramebuffer(n.FRAMEBUFFER,null),i}return e=this.textureBuffer.canvas.width,t=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,e,t).data},d.prototype.getPixel=function(e,t){if(this.renderer.type===u.RENDERER_TYPE.WEBGL){var n=this.renderer.gl,i=new Uint8Array(4);return n.bindFramebuffer(n.FRAMEBUFFER,this.textureBuffer.frameBuffer),n.readPixels(e,t,1,1,n.RGBA,n.UNSIGNED_BYTE,i),n.bindFramebuffer(n.FRAMEBUFFER,null),i}return this.textureBuffer.canvas.getContext("2d").getImageData(e,t,1,1).data}},22699:(e,t,n)=>{var i=n(61936),r=n(3367),s=n(21507),o=n(65585),a=n(74650),l=n(70501);function u(e,t,n,i,r){o.call(this),this.noFrame=!1,t||(this.noFrame=!0,t=new a.Rectangle(0,0,1,1)),e instanceof u&&(e=e.baseTexture),this.baseTexture=e,this._frame=t,this.trim=i,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=n||t,this.rotate=!!r,e.hasLoaded?(this.noFrame&&(t=new a.Rectangle(0,0,e.width,e.height),e.on("update",this.onBaseTextureUpdated,this)),this.frame=t):e.once("loaded",this.onBaseTextureLoaded,this)}u.prototype=Object.create(o.prototype),u.prototype.constructor=u,e.exports=u,Object.defineProperties(u.prototype,{frame:{get:function(){return this._frame},set:function(e){if(this._frame=e,this.noFrame=!1,this.width=e.width,this.height=e.height,!this.trim&&!this.rotate&&(e.x+e.width>this.baseTexture.width||e.y+e.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=e&&e.width&&e.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=e,this.valid&&this._updateUvs()}}}),u.prototype.update=function(){this.baseTexture.update()},u.prototype.onBaseTextureLoaded=function(e){this.noFrame?this.frame=new a.Rectangle(0,0,e.width,e.height):this.frame=this._frame,this.emit("update",this)},u.prototype.onBaseTextureUpdated=function(e){this._frame.width=e.width,this._frame.height=e.height,this.emit("update",this)},u.prototype.destroy=function(e){this.baseTexture&&(e&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},u.prototype.clone=function(){return new u(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},u.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},u.fromImage=function(e,t,n){var r=l.TextureCache[e];return r||(r=new u(i.fromImage(e,t,n)),l.TextureCache[e]=r),r},u.fromFrame=function(e){var t=l.TextureCache[e];if(!t)throw new Error('The frameId "'+e+'" does not exist in the texture cache');return t},u.fromCanvas=function(e,t){return new u(i.fromCanvas(e,t))},u.fromVideo=function(e,t){return"string"==typeof e?u.fromVideoUrl(e,t):new u(r.fromVideo(e,t))},u.fromVideoUrl=function(e,t){return new u(r.fromUrl(e,t))},u.addTextureToCache=function(e,t){l.TextureCache[t]=e},u.removeTextureFromCache=function(e){var t=l.TextureCache[e];return delete l.TextureCache[e],delete l.BaseTextureCache[e],t},u.EMPTY=new u(new i)},21507:e=>{function t(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=t,t.prototype.set=function(e,t,n){var i=t.width,r=t.height;n?(this.x0=(e.x+e.height)/i,this.y0=e.y/r,this.x1=(e.x+e.height)/i,this.y1=(e.y+e.width)/r,this.x2=e.x/i,this.y2=(e.y+e.width)/r,this.x3=e.x/i,this.y3=e.y/r):(this.x0=e.x/i,this.y0=e.y/r,this.x1=(e.x+e.width)/i,this.y1=e.y/r,this.x2=(e.x+e.width)/i,this.y2=(e.y+e.height)/r,this.x3=e.x/i,this.y3=(e.y+e.height)/r)}},3367:(e,t,n)=>{var i=n(61936),r=n(70501);function s(e,t){if(!e)throw new Error("No video source element specified.");(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),i.call(this,e,t),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),e.complete||(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function o(e,t){t||(t="video/"+e.substr(e.lastIndexOf(".")+1));var n=document.createElement("source");return n.src=e,n.type=t,n}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},s.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},s.prototype._onPlayStop=function(){this.autoUpdate=!1},s.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},s.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete r.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),i.prototype.destroy.call(this)},s.fromVideo=function(e,t){e._pixiId||(e._pixiId="video_"+r.uid());var n=r.BaseTextureCache[e._pixiId];return n||(n=new s(e,t),r.BaseTextureCache[e._pixiId]=n),n},s.fromUrl=function(e,t){var n=document.createElement("video");if(Array.isArray(e))for(var i=0;i<e.length;++i)n.appendChild(o(e[i].src||e[i],e[i].mime));else n.appendChild(o(e.src||e,e.mime));return n.load(),n.play(),s.fromVideo(n,t)},s.fromUrls=s.fromUrl},17974:(e,t,n)=>{var i=n(46192),r=n(65585),s="tick";function o(){var e=this;this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._emitter.listeners(s,!0)&&(e._requestId=requestAnimationFrame(e._tick)))},this._emitter=new r,this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/i.TARGET_FPMS,this.lastTime=0,this.speed=1,this.started=!1}Object.defineProperties(o.prototype,{FPS:{get:function(){return 1e3/this.elapsedMS}},minFPS:{get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,i.TARGET_FPMS);this._maxElapsedMS=1/t}}}),o.prototype._requestIfNeeded=function(){null===this._requestId&&this._emitter.listeners(s,!0)&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},o.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},o.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},o.prototype.add=function(e,t){return this._emitter.on(s,e,t),this._startIfPossible(),this},o.prototype.addOnce=function(e,t){return this._emitter.once(s,e,t),this._startIfPossible(),this},o.prototype.remove=function(e,t){return this._emitter.off(s,e,t),this._emitter.listeners(s,!0)||this._cancelIfNeeded(),this},o.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},o.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},o.prototype.update=function(e){var t;e=e||performance.now(),(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*i.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=e},e.exports=o},2410:(e,t,n)=>{var i=n(17974),r=new i;r.autoStart=!0,e.exports={shared:r,Ticker:i}},70501:(e,t,n)=>{var i=n(46192),r=e.exports={_uid:0,_saidHello:!1,EventEmitter:n(65585),pluginTarget:n(17987),async:n(44083),uid:function(){return++r._uid},hex2rgb:function(e,t){return(t=t||[])[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},hex2string:function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},rgb2hex:function(e){return(255*e[0]<<16)+(255*e[1]<<8)+255*e[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",t="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",n=new Image;n.src=e+"AP804Oa6"+t;var i=new Image;i.src=e+"/wCKxvRF"+t;var r=document.createElement("canvas");r.width=6,r.height=1;var s=r.getContext("2d");s.globalCompositeOperation="multiply",s.drawImage(n,0,0),s.drawImage(i,2,0);var o=s.getImageData(2,0,1,1).data;return 255===o[0]&&0===o[1]&&0===o[2]},getNextPowerOfTwo:function(e){if(e>0&&!(e&e-1))return e;for(var t=1;t<e;)t<<=1;return t},isPowerOfTwo:function(e,t){return e>0&&!(e&e-1)&&t>0&&!(t&t-1)},getResolutionOfUrl:function(e){var t=i.RETINA_PREFIX.exec(e);return t?parseFloat(t[1]):1},sayHello:function(e){if(!r._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var t=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,t)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+e+" - http://www.pixijs.com/");r._saidHello=!0}},isWebGLSupported:function(){var e={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);return!(!n||!n.getContextAttributes().stencil)}catch(e){return!1}},sign:function(e){return e?e<0?-1:1:0},TextureCache:{},BaseTextureCache:{}}},17987:e=>{e.exports={mixin:function(e){!function(e){e.__plugins={},e.registerPlugin=function(t,n){e.__plugins[t]=n},e.prototype.initPlugins=function(){for(var t in this.plugins=this.plugins||{},e.__plugins)this.plugins[t]=new e.__plugins[t](this)},e.prototype.destroyPlugins=function(){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;this.plugins=null}}(e)}}},49513:(e,t,n)=>{var i=n(44651),r=n(38653),s=n(63323),o=n(38319);i.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},i.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(i,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),i.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),i.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),r.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),r.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),s.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),s.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),s.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),i.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),i.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),i.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),i.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),i}}}),i.Sprite.prototype.setTexture=function(e){this.texture=e,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},s.BitmapText.prototype.setText=function(e){this.text=e,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},i.Text.prototype.setText=function(e){this.text=e,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},i.Text.prototype.setStyle=function(e){this.style=e,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},i.Texture.prototype.setFrame=function(e){this.frame=e,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(o,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),i.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),i.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),i.SpriteMaskFilter}}}),i.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),i.utils.uid()}},23635:(e,t,n)=>{var i=n(44651);function r(e,t){i.Container.call(this),t=t||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==t.tint?t.tint:16777215,align:t.align||"left",name:null,size:0},this.font=t.font,this._text=e,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}r.prototype=Object.create(i.Container.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{tint:{get:function(){return this._font.tint},set:function(e){this._font.tint="number"==typeof e&&e>=0?e:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(e){this._font.align=e||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(e){e&&("string"==typeof e?(e=e.split(" "),this._font.name=1===e.length?e[0]:e.slice(1).join(" "),this._font.size=e.length>=2?parseInt(e[0],10):r.fonts[this._font.name].size):(this._font.name=e.name,this._font.size="number"==typeof e.size?e.size:parseInt(e.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(e){e=e.toString()||" ",this._text!==e&&(this._text=e,this.dirty=!0)}}}),r.prototype.updateText=function(){for(var e=r.fonts[this._font.name],t=new i.Point,n=null,s=[],o=0,a=0,l=[],u=0,c=this._font.size/e.size,d=-1,h=0,p=0;p<this.text.length;p++){var f=this.text.charCodeAt(p);if(d=/(\s)/.test(this.text.charAt(p))?p:d,/(?:\r\n|\r|\n)/.test(this.text.charAt(p)))l.push(o),a=Math.max(a,o),u++,t.x=0,t.y+=e.lineHeight,n=null;else if(-1!==d&&this.maxWidth>0&&t.x*c>this.maxWidth)s.splice(d,p-d),p=d,d=-1,l.push(o),a=Math.max(a,o),u++,t.x=0,t.y+=e.lineHeight,n=null;else{var m=e.chars[f];m&&(n&&m.kerning[n]&&(t.x+=m.kerning[n]),s.push({texture:m.texture,line:u,charCode:f,position:new i.Point(t.x+m.xOffset,t.y+m.yOffset)}),o=t.x+(m.texture.width+m.xOffset),t.x+=m.xAdvance,h=Math.max(h,m.yOffset+m.texture.height),n=f)}}l.push(o),a=Math.max(a,o);var g=[];for(p=0;p<=u;p++){var _=0;"right"===this._font.align?_=a-l[p]:"center"===this._font.align&&(_=(a-l[p])/2),g.push(_)}var y=s.length,v=this.tint;for(p=0;p<y;p++){var b=this._glyphs[p];b?b.texture=s[p].texture:(b=new i.Sprite(s[p].texture),this._glyphs.push(b)),b.position.x=(s[p].position.x+g[s[p].line])*c,b.position.y=s[p].position.y*c,b.scale.x=b.scale.y=c,b.tint=v,b.parent||this.addChild(b)}for(p=y;p<this._glyphs.length;++p)this.removeChild(this._glyphs[p]);this.textWidth=a*c,this.textHeight=(t.y+e.lineHeight)*c,this.maxLineHeight=h*c},r.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},r.prototype.getLocalBounds=function(){return this.validate(),i.Container.prototype.getLocalBounds.call(this)},r.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},r.fonts={}},47901:(e,t,n)=>{var i=n(44651);function r(e){i.Sprite.call(this,e[0]instanceof i.Texture?e[0]:e[0].texture),this._textures=null,this._durations=null,this.textures=e,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this._currentTime=0,this.playing=!1}r.prototype=Object.create(i.Sprite.prototype),r.prototype.constructor=r,e.exports=r,Object.defineProperties(r.prototype,{totalFrames:{get:function(){return this._textures.length}},textures:{get:function(){return this._textures},set:function(e){if(e[0]instanceof i.Texture)this._textures=e,this._durations=null;else{this._textures=[],this._durations=[];for(var t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time)}}},currentFrame:{get:function(){var e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}}}),r.prototype.stop=function(){this.playing&&(this.playing=!1,i.ticker.shared.remove(this.update,this))},r.prototype.play=function(){this.playing||(this.playing=!0,i.ticker.shared.add(this.update,this))},r.prototype.gotoAndStop=function(e){this.stop(),this._currentTime=e,this._texture=this._textures[this.currentFrame]},r.prototype.gotoAndPlay=function(e){this._currentTime=e,this.play()},r.prototype.update=function(e){var t=this.animationSpeed*e;if(null!==this._durations){var n=this._currentTime%1*this._durations[this.currentFrame];for(n+=t/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=n/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},r.prototype.destroy=function(){this.stop(),i.Sprite.prototype.destroy.call(this)},r.fromFrames=function(e){for(var t=[],n=0;n<e.length;++n)t.push(new i.Texture.fromFrame(e[n]));return new r(t)},r.fromImages=function(e){for(var t=[],n=0;n<e.length;++n)t.push(new i.Texture.fromImage(e[n]));return new r(t)}},77377:(e,t,n)=>{var i=n(44651),r=new i.Point,s=n(87809);function o(e,t,n){i.Sprite.call(this,e),this.tileScale=new i.Point(1,1),this.tilePosition=new i.Point(0,0),this._width=t||100,this._height=n||100,this._uvs=new i.TextureUvs,this._canvasPattern=null,this.shader=new i.AbstractFilter(["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","uniform vec4 uFrame;","uniform vec4 uTransform;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vec2 coord = aTextureCoord;"," coord -= uTransform.xy;"," coord /= uTransform.zw;"," vTextureCoord = coord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","uniform vec4 uFrame;","uniform vec2 uPixelSize;","void main(void){"," vec2 coord = mod(vTextureCoord, uFrame.zw);"," coord = clamp(coord, uPixelSize, uFrame.zw - uPixelSize);"," coord += uFrame.xy;"," gl_FragColor = texture2D(uSampler, coord) * vColor ;","}"].join("\n"),{uFrame:{type:"4fv",value:[0,0,1,1]},uTransform:{type:"4fv",value:[0,0,1,1]},uPixelSize:{type:"2fv",value:[1,1]}})}o.prototype=Object.create(i.Sprite.prototype),o.prototype.constructor=o,e.exports=o,Object.defineProperties(o.prototype,{width:{get:function(){return this._width},set:function(e){this._width=e}},height:{get:function(){return this._height},set:function(e){this._height=e}}}),o.prototype._onTextureUpdate=function(){},o.prototype._renderWebGL=function(e){var t=this._texture;if(t&&t._uvs){var n=t._uvs,i=t._frame.width,r=t._frame.height,s=t.baseTexture.width,o=t.baseTexture.height;t._uvs=this._uvs,t._frame.width=this.width,t._frame.height=this.height,this.shader.uniforms.uPixelSize.value[0]=1/s,this.shader.uniforms.uPixelSize.value[1]=1/o,this.shader.uniforms.uFrame.value[0]=n.x0,this.shader.uniforms.uFrame.value[1]=n.y0,this.shader.uniforms.uFrame.value[2]=n.x1-n.x0,this.shader.uniforms.uFrame.value[3]=n.y2-n.y0,this.shader.uniforms.uTransform.value[0]=this.tilePosition.x%(i*this.tileScale.x)/this._width,this.shader.uniforms.uTransform.value[1]=this.tilePosition.y%(r*this.tileScale.y)/this._height,this.shader.uniforms.uTransform.value[2]=s/this._width*this.tileScale.x,this.shader.uniforms.uTransform.value[3]=o/this._height*this.tileScale.y,e.setObjectRenderer(e.plugins.sprite),e.plugins.sprite.render(this),t._uvs=n,t._frame.width=i,t._frame.height=r}},o.prototype._renderCanvas=function(e){var t=this._texture;if(t.baseTexture.hasLoaded){var n=e.context,r=this.worldTransform,o=e.resolution,a=t.baseTexture,l=this.tilePosition.x/this.tileScale.x%t._frame.width,u=this.tilePosition.y/this.tileScale.y%t._frame.height;if(!this._canvasPattern){var c=new i.CanvasBuffer(t._frame.width,t._frame.height);16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=s.getTintedTexture(this,this.tint)),c.context.drawImage(this.tintedTexture,0,0)):c.context.drawImage(a.source,-t._frame.x,-t._frame.y),this._canvasPattern=c.context.createPattern(c.canvas,"repeat")}n.globalAlpha=this.worldAlpha,n.setTransform(r.a*o,r.b*o,r.c*o,r.d*o,r.tx*o,r.ty*o),n.scale(this.tileScale.x,this.tileScale.y),n.translate(l+this.anchor.x*-this._width,u+this.anchor.y*-this._height);var d=e.blendModes[this.blendMode];d!==e.context.globalCompositeOperation&&(n.globalCompositeOperation=d),n.fillStyle=this._canvasPattern,n.fillRect(-l,-u,this._width/this.tileScale.x,this._height/this.tileScale.y)}},o.prototype.getBounds=function(){var e,t,n,i,r=this._width,s=this._height,o=r*(1-this.anchor.x),a=r*-this.anchor.x,l=s*(1-this.anchor.y),u=s*-this.anchor.y,c=this.worldTransform,d=c.a,h=c.b,p=c.c,f=c.d,m=c.tx,g=c.ty,_=d*a+p*u+m,y=f*u+h*a+g,v=d*o+p*u+m,b=f*u+h*o+g,T=d*o+p*l+m,x=f*l+h*o+g,E=d*a+p*l+m,w=f*l+h*a+g;e=E<(e=T<(e=v<(e=_)?v:e)?T:e)?E:e,n=w<(n=x<(n=b<(n=y)?b:n)?x:n)?w:n,t=E>(t=T>(t=v>(t=_)?v:t)?T:t)?E:t,i=w>(i=x>(i=b>(i=y)?b:i)?x:i)?w:i;var I=this._bounds;return I.x=e,I.width=t-e,I.y=n,I.height=i-n,this._currentBounds=I,I},o.prototype.containsPoint=function(e){this.worldTransform.applyInverse(e,r);var t,n=this._width,i=this._height,s=-n*this.anchor.x;return r.x>s&&r.x<s+n&&(t=-i*this.anchor.y,r.y>t&&r.y<t+i)},o.prototype.destroy=function(){i.Sprite.prototype.destroy.call(this),this.tileScale=null,this._tileScaleOffset=null,this.tilePosition=null,this._uvs=null},o.fromFrame=function(e,t,n){var r=i.utils.TextureCache[e];if(!r)throw new Error('The frameId "'+e+'" does not exist in the texture cache '+this);return new o(r,t,n)},o.fromImage=function(e,t,n,r,s){return new o(i.Texture.fromImage(e,r,s),t,n)}},94262:(e,t,n)=>{var i=n(44651),r=i.DisplayObject,s=new i.Matrix;r.prototype._cacheAsBitmap=!1,r.prototype._originalRenderWebGL=null,r.prototype._originalRenderCanvas=null,r.prototype._originalUpdateTransform=null,r.prototype._originalHitTest=null,r.prototype._originalDestroy=null,r.prototype._cachedSprite=null,Object.defineProperties(r.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._originalRenderWebGL=this.renderWebGL,this._originalRenderCanvas=this.renderCanvas,this._originalUpdateTransform=this.updateTransform,this._originalGetBounds=this.getBounds,this._originalDestroy=this.destroy,this._originalContainsPoint=this.containsPoint,this.renderWebGL=this._renderCachedWebGL,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(this._cachedSprite&&this._destroyCachedDisplayObject(),this.renderWebGL=this._originalRenderWebGL,this.renderCanvas=this._originalRenderCanvas,this.getBounds=this._originalGetBounds,this.destroy=this._originalDestroy,this.updateTransform=this._originalUpdateTransform,this.containsPoint=this._originalContainsPoint))}}}),r.prototype._renderCachedWebGL=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cachedSprite.worldAlpha=this.worldAlpha,e.setObjectRenderer(e.plugins.sprite),e.plugins.sprite.render(this._cachedSprite))},r.prototype._initCachedDisplayObject=function(e){if(!this._cachedSprite){e.currentRenderer.flush();var t=this.getLocalBounds().clone();if(this._filters){var n=this._filters[0].padding;t.x-=n,t.y-=n,t.width+=2*n,t.height+=2*n}var r=e.currentRenderTarget,o=e.filterManager.filterStack,a=new i.RenderTexture(e,0|t.width,0|t.height),l=s;l.tx=-t.x,l.ty=-t.y,this.renderWebGL=this._originalRenderWebGL,a.render(this,l,!0,!0),e.setRenderTarget(r),e.filterManager.filterStack=o,this.renderWebGL=this._renderCachedWebGL,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new i.Sprite(a),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},r.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cachedSprite.worldAlpha=this.worldAlpha,this._cachedSprite.renderCanvas(e))},r.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cachedSprite){var t=this.getLocalBounds(),n=e.context,r=new i.RenderTexture(e,0|t.width,0|t.height),o=s;o.tx=-t.x,o.ty=-t.y,this.renderCanvas=this._originalRenderCanvas,r.render(this,o,!0),e.context=n,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new i.Sprite(r),this._cachedSprite.worldTransform=this.worldTransform,this._cachedSprite.anchor.x=-t.x/t.width,this._cachedSprite.anchor.y=-t.y/t.height,this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},r.prototype._getCachedBounds=function(){return this._cachedSprite._currentBounds=null,this._cachedSprite.getBounds()},r.prototype._destroyCachedDisplayObject=function(){this._cachedSprite._texture.destroy(),this._cachedSprite=null},r.prototype._cacheAsBitmapDestroy=function(){this.cacheAsBitmap=!1,this._originalDestroy()}},37231:(e,t,n)=>{var i=n(44651);i.DisplayObject.prototype.name=null,i.Container.prototype.getChildByName=function(e){for(var t=0;t<this.children.length;t++)if(this.children[t].name===e)return this.children[t];return null}},34247:(e,t,n)=>{var i=n(44651);i.DisplayObject.prototype.getGlobalPosition=function(e){return e=e||new i.Point,this.parent?(this.displayObjectUpdateTransform(),e.x=this.worldTransform.tx,e.y=this.worldTransform.ty):(e.x=this.position.x,e.y=this.position.y),e}},63323:(e,t,n)=>{
/**
* @file Main export of the PIXI extras library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
n(94262),n(37231),n(34247),e.exports={MovieClip:n(47901),TilingSprite:n(77377),BitmapText:n(23635)}},64350:(e,t,n)=>{var i=n(44651),r=n(9496);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//ascii.frag","utf8"),{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(e){this.uniforms.pixelSize.value=e}}})},5966:(e,t,n)=>{var i=n(44651),r=n(34356),s=n(63779);function o(){i.AbstractFilter.call(this),this.blurXFilter=new r,this.blurYFilter=new s,this.defaultFilter=new i.AbstractFilter}o.prototype=Object.create(i.AbstractFilter.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.applyFilter=function(e,t,n){var r=e.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(e,t,n),this.blurXFilter.applyFilter(e,t,r),e.blendModeManager.setBlendMode(i.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(e,r,n),e.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),e.filterManager.returnRenderTarget(r)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=this.blurYFilter.blur=e}},blurX:{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e}},blurY:{get:function(){return this.blurYFilter.blur},set:function(e){this.blurYFilter.blur=e}}})},10415:(e,t,n)=>{var i=n(44651),r=n(26786);function s(e,t){i.AbstractFilter.call(this,r.readFileSync("//blurDir.vert","utf8"),r.readFileSync("//blurDir.frag","utf8"),{strength:{type:"1f",value:1},dirX:{type:"1f",value:e||0},dirY:{type:"1f",value:t||0}}),this.defaultFilter=new i.AbstractFilter,this.passes=1,this.dirX=e||0,this.dirY=t||0,this.strength=4}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n,i){var r=this.getShader(e);if(this.uniforms.strength.value=this.strength/4/this.passes*(t.frame.width/t.size.width),1===this.passes)e.filterManager.applyFilter(r,t,n,i);else{var s=e.filterManager.getRenderTarget(!0);e.filterManager.applyFilter(r,t,s,i);for(var o=0;o<this.passes-2;o++)e.filterManager.applyFilter(r,s,s,i);e.filterManager.applyFilter(r,s,n,i),e.filterManager.returnRenderTarget(s)}},Object.defineProperties(s.prototype,{blur:{get:function(){return this.strength},set:function(e){this.padding=.5*e,this.strength=e}},dirX:{get:function(){return this.dirX},set:function(e){this.uniforms.dirX.value=e}},dirY:{get:function(){return this.dirY},set:function(e){this.uniforms.dirY.value=e}}})},16762:(e,t,n)=>{var i=n(44651),r=n(34356),s=n(63779);function o(){i.AbstractFilter.call(this),this.blurXFilter=new r,this.blurYFilter=new s}o.prototype=Object.create(i.AbstractFilter.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.applyFilter=function(e,t,n){var i=e.filterManager.getRenderTarget(!0);this.blurXFilter.applyFilter(e,t,i),this.blurYFilter.applyFilter(e,i,n),e.filterManager.returnRenderTarget(i)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(e){this.padding=.5*Math.abs(e),this.blurXFilter.blur=this.blurYFilter.blur=e}},passes:{get:function(){return this.blurXFilter.passes},set:function(e){this.blurXFilter.passes=this.blurYFilter.passes=e}},blurX:{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e}},blurY:{get:function(){return this.blurYFilter.blur},set:function(e){this.blurYFilter.blur=e}}})},34356:(e,t,n)=>{var i=n(44651),r=n(26786);function s(){i.AbstractFilter.call(this,r.readFileSync("//blurX.vert","utf8"),r.readFileSync("//blur.frag","utf8"),{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n,i){var r=this.getShader(e);if(this.uniforms.strength.value=this.strength/4/this.passes*(t.frame.width/t.size.width),1===this.passes)e.filterManager.applyFilter(r,t,n,i);else{for(var s=e.filterManager.getRenderTarget(!0),o=t,a=s,l=0;l<this.passes-1;l++){e.filterManager.applyFilter(r,o,a,!0);var u=a;a=o,o=u}e.filterManager.applyFilter(r,o,n,i),e.filterManager.returnRenderTarget(s)}},Object.defineProperties(s.prototype,{blur:{get:function(){return this.strength},set:function(e){this.padding=.5*Math.abs(e),this.strength=e}}})},63779:(e,t,n)=>{var i=n(44651),r=n(26786);function s(){i.AbstractFilter.call(this,r.readFileSync("//blurY.vert","utf8"),r.readFileSync("//blur.frag","utf8"),{strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n,i){var r=this.getShader(e);if(this.uniforms.strength.value=Math.abs(this.strength)/4/this.passes*(t.frame.height/t.size.height),1===this.passes)e.filterManager.applyFilter(r,t,n,i);else{for(var s=e.filterManager.getRenderTarget(!0),o=t,a=s,l=0;l<this.passes-1;l++){e.filterManager.applyFilter(r,o,a,!0);var u=a;a=o,o=u}e.filterManager.applyFilter(r,o,n,i),e.filterManager.returnRenderTarget(s)}},Object.defineProperties(s.prototype,{blur:{get:function(){return this.strength},set:function(e){this.padding=.5*Math.abs(e),this.strength=e}}})},81327:(e,t,n)=>{var i=n(44651),r=n(26786);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//smartBlur.frag","utf8"),{delta:{type:"v2",value:{x:.1,y:0}}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s},19375:(e,t,n)=>{var i=n(44651),r=n(48884);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//colorMatrix.frag","utf8"),{m:{type:"1fv",value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype._loadMatrix=function(e,t){var n=e;(t=!!t)&&(this._multiply(n,this.uniforms.m.value,e),n=this._colorMatrix(n)),this.uniforms.m.value=n},s.prototype._multiply=function(e,t,n){return e[0]=t[0]*n[0]+t[1]*n[5]+t[2]*n[10]+t[3]*n[15],e[1]=t[0]*n[1]+t[1]*n[6]+t[2]*n[11]+t[3]*n[16],e[2]=t[0]*n[2]+t[1]*n[7]+t[2]*n[12]+t[3]*n[17],e[3]=t[0]*n[3]+t[1]*n[8]+t[2]*n[13]+t[3]*n[18],e[4]=t[0]*n[4]+t[1]*n[9]+t[2]*n[14]+t[3]*n[19],e[5]=t[5]*n[0]+t[6]*n[5]+t[7]*n[10]+t[8]*n[15],e[6]=t[5]*n[1]+t[6]*n[6]+t[7]*n[11]+t[8]*n[16],e[7]=t[5]*n[2]+t[6]*n[7]+t[7]*n[12]+t[8]*n[17],e[8]=t[5]*n[3]+t[6]*n[8]+t[7]*n[13]+t[8]*n[18],e[9]=t[5]*n[4]+t[6]*n[9]+t[7]*n[14]+t[8]*n[19],e[10]=t[10]*n[0]+t[11]*n[5]+t[12]*n[10]+t[13]*n[15],e[11]=t[10]*n[1]+t[11]*n[6]+t[12]*n[11]+t[13]*n[16],e[12]=t[10]*n[2]+t[11]*n[7]+t[12]*n[12]+t[13]*n[17],e[13]=t[10]*n[3]+t[11]*n[8]+t[12]*n[13]+t[13]*n[18],e[14]=t[10]*n[4]+t[11]*n[9]+t[12]*n[14]+t[13]*n[19],e[15]=t[15]*n[0]+t[16]*n[5]+t[17]*n[10]+t[18]*n[15],e[16]=t[15]*n[1]+t[16]*n[6]+t[17]*n[11]+t[18]*n[16],e[17]=t[15]*n[2]+t[16]*n[7]+t[17]*n[12]+t[18]*n[17],e[18]=t[15]*n[3]+t[16]*n[8]+t[17]*n[13]+t[18]*n[18],e[19]=t[15]*n[4]+t[16]*n[9]+t[17]*n[14]+t[18]*n[19],e},s.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},s.prototype.brightness=function(e,t){var n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},s.prototype.greyscale=function(e,t){var n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},s.prototype.grayscale=s.prototype.greyscale,s.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},s.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var n=Math.cos(e),i=Math.sin(e),r=.213,s=.715,o=.072,a=[r+.787*n+i*-r,s+n*-s+i*-s,o+n*-o+.928*i,0,0,r+n*-r+.143*i,s+n*(1-s)+.14*i,o+n*-o+-.283*i,0,0,r+n*-r+-.787*i,s+n*-s+i*s,o+.928*n+i*o,0,0,0,0,0,1,0];this._loadMatrix(a,t)},s.prototype.contrast=function(e,t){var n=(e||0)+1,i=-128*(n-1),r=[n,0,0,0,i,0,n,0,0,i,0,0,n,0,i,0,0,0,1,0];this._loadMatrix(r,t)},s.prototype.saturate=function(e,t){var n=2*(e||0)/3+1,i=-.5*(n-1),r=[n,i,i,0,0,i,n,i,0,0,i,i,n,0,0,0,0,0,1,0];this._loadMatrix(r,t)},s.prototype.desaturate=function(e){this.saturate(-1)},s.prototype.negative=function(e){this._loadMatrix([0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0],e)},s.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},s.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},s.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},s.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},s.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},s.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},s.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},s.prototype.colorTone=function(e,t,n,i,r){var s=((n=n||16770432)>>16&255)/255,o=(n>>8&255)/255,a=(255&n)/255,l=((i=i||3375104)>>16&255)/255,u=(i>>8&255)/255,c=(255&i)/255,d=[.3,.59,.11,0,0,s,o,a,e=e||.2,0,l,u,c,t=t||.15,0,s-l,o-u,a-c,0,0];this._loadMatrix(d,r)},s.prototype.night=function(e,t){var n=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},s.prototype.predator=function(e,t){var n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,t)},s.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},s.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperties(s.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(e){this.uniforms.m.value=e}}})},53640:(e,t,n)=>{var i=n(44651),r=n(48884);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//colorStep.frag","utf8"),{step:{type:"1f",value:5}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(e){this.uniforms.step.value=e}}})},46982:(e,t,n)=>{var i=n(44651),r=n(98001);function s(e,t,n){i.AbstractFilter.call(this,null,r.readFileSync("//convolution.frag","utf8"),{matrix:{type:"1fv",value:new Float32Array(e)},texelSize:{type:"v2",value:{x:1/t,y:1/n}}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(e){this.uniforms.matrix.value=new Float32Array(e)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(e){this.uniforms.texelSize.value.x=1/e}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(e){this.uniforms.texelSize.value.y=1/e}}})},56280:(e,t,n)=>{var i=n(44651),r=n(71613);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//crosshatch.frag","utf8"))}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s},48286:(e,t,n)=>{var i=n(44651),r=n(15312);function s(e,t){var n=new i.Matrix;e.renderable=!1,i.AbstractFilter.call(this,r.readFileSync("//displacement.vert","utf8"),r.readFileSync("//displacement.frag","utf8"),{mapSampler:{type:"sampler2D",value:e.texture},otherMatrix:{type:"mat3",value:n.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=e,this.maskMatrix=n,null==t&&(t=20),this.scale=new i.Point(t,t)}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n){var i=e.filterManager;i.calculateMappedMatrix(t.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/t.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/t.frame.height);var r=this.getShader(e);i.applyFilter(r,t,n)},Object.defineProperties(s.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(e){this.uniforms.mapSampler.value=e}}})},83466:(e,t,n)=>{var i=n(44651),r=n(89032);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//dotScreen.frag","utf8"),{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(e){this.uniforms.scale.value=e}},angle:{get:function(){return this.uniforms.angle.value},set:function(e){this.uniforms.angle.value=e}}})},5038:(e,t,n)=>{var i=n(44651),r=n(60574);function s(){i.AbstractFilter.call(this,r.readFileSync("//blurYTint.vert","utf8"),r.readFileSync("//blurYTint.frag","utf8"),{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.applyFilter=function(e,t,n,i){var r=this.getShader(e);if(this.uniforms.strength.value=this.strength/4/this.passes*(t.frame.height/t.size.height),1===this.passes)e.filterManager.applyFilter(r,t,n,i);else{for(var s=e.filterManager.getRenderTarget(!0),o=t,a=s,l=0;l<this.passes-1;l++){e.filterManager.applyFilter(r,o,a,i);var u=a;a=o,o=u}e.filterManager.applyFilter(r,o,n,i),e.filterManager.returnRenderTarget(s)}},Object.defineProperties(s.prototype,{blur:{get:function(){return this.strength},set:function(e){this.padding=.5*e,this.strength=e}}})},91726:(e,t,n)=>{var i=n(44651),r=n(34356),s=n(5038);function o(){i.AbstractFilter.call(this),this.blurXFilter=new r,this.blurYTintFilter=new s,this.defaultFilter=new i.AbstractFilter,this.padding=30,this._dirtyPosition=!0,this._angle=45*Math.PI/180,this._distance=10,this.alpha=.75,this.hideObject=!1,this.blendMode=i.BLEND_MODES.MULTIPLY}o.prototype=Object.create(i.AbstractFilter.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.applyFilter=function(e,t,n){var r=e.filterManager.getRenderTarget(!0);this._dirtyPosition&&(this._dirtyPosition=!1,this.blurYTintFilter.uniforms.offset.value[0]=Math.sin(this._angle)*this._distance,this.blurYTintFilter.uniforms.offset.value[1]=Math.cos(this._angle)*this._distance),this.blurXFilter.applyFilter(e,t,r),e.blendModeManager.setBlendMode(this.blendMode),this.blurYTintFilter.applyFilter(e,r,n),e.blendModeManager.setBlendMode(i.BLEND_MODES.NORMAL),this.hideObject||this.defaultFilter.applyFilter(e,t,n),e.filterManager.returnRenderTarget(r)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=this.blurYTintFilter.blur=e}},blurX:{get:function(){return this.blurXFilter.blur},set:function(e){this.blurXFilter.blur=e}},blurY:{get:function(){return this.blurYTintFilter.blur},set:function(e){this.blurYTintFilter.blur=e}},color:{get:function(){return i.utils.rgb2hex(this.blurYTintFilter.uniforms.color.value)},set:function(e){this.blurYTintFilter.uniforms.color.value=i.utils.hex2rgb(e)}},alpha:{get:function(){return this.blurYTintFilter.uniforms.alpha.value},set:function(e){this.blurYTintFilter.uniforms.alpha.value=e}},distance:{get:function(){return this._distance},set:function(e){this._dirtyPosition=!0,this._distance=e}},angle:{get:function(){return this._angle},set:function(e){this._dirtyPosition=!0,this._angle=e}}})},65518:(e,t,n)=>{var i=n(44651),r=n(2672);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//gray.frag","utf8"),{gray:{type:"1f",value:1}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{gray:{get:function(){return this.uniforms.gray.value},set:function(e){this.uniforms.gray.value=e}}})},38319:(e,t,n)=>{
/**
* @file Main export of the PIXI filters library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
e.exports={AsciiFilter:n(64350),BloomFilter:n(5966),BlurFilter:n(16762),BlurXFilter:n(34356),BlurYFilter:n(63779),BlurDirFilter:n(10415),ColorMatrixFilter:n(19375),ColorStepFilter:n(53640),ConvolutionFilter:n(46982),CrossHatchFilter:n(56280),DisplacementFilter:n(48286),DotScreenFilter:n(83466),GrayFilter:n(65518),DropShadowFilter:n(91726),InvertFilter:n(55976),NoiseFilter:n(97898),PixelateFilter:n(240),RGBSplitFilter:n(41952),ShockwaveFilter:n(22942),SepiaFilter:n(43578),SmartBlurFilter:n(81327),TiltShiftFilter:n(66422),TiltShiftXFilter:n(53080),TiltShiftYFilter:n(84407),TwistFilter:n(37326)}},55976:(e,t,n)=>{var i=n(44651),r=n(58215);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//invert.frag","utf8"),{invert:{type:"1f",value:1}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{invert:{get:function(){return this.uniforms.invert.value},set:function(e){this.uniforms.invert.value=e}}})},97898:(e,t,n)=>{var i=n(44651),r=n(1417);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//noise.frag","utf8"),{noise:{type:"1f",value:.5}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{noise:{get:function(){return this.uniforms.noise.value},set:function(e){this.uniforms.noise.value=e}}})},240:(e,t,n)=>{var i=n(44651),r=n(49391);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//pixelate.frag","utf8"),{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"v2",value:{x:10,y:10}}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(e){this.uniforms.pixelSize.value=e}}})},41952:(e,t,n)=>{var i=n(44651),r=n(83220);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//rgbSplit.frag","utf8"),{red:{type:"v2",value:{x:20,y:20}},green:{type:"v2",value:{x:-20,y:20}},blue:{type:"v2",value:{x:20,y:-20}},dimensions:{type:"4fv",value:[0,0,0,0]}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{red:{get:function(){return this.uniforms.red.value},set:function(e){this.uniforms.red.value=e}},green:{get:function(){return this.uniforms.green.value},set:function(e){this.uniforms.green.value=e}},blue:{get:function(){return this.uniforms.blue.value},set:function(e){this.uniforms.blue.value=e}}})},43578:(e,t,n)=>{var i=n(44651),r=n(73985);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//sepia.frag","utf8"),{sepia:{type:"1f",value:1}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{sepia:{get:function(){return this.uniforms.sepia.value},set:function(e){this.uniforms.sepia.value=e}}})},22942:(e,t,n)=>{var i=n(44651),r=n(80032);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//shockwave.frag","utf8"),{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(e){this.uniforms.center.value=e}},params:{get:function(){return this.uniforms.params.value},set:function(e){this.uniforms.params.value=e}},time:{get:function(){return this.uniforms.time.value},set:function(e){this.uniforms.time.value=e}}})},81519:(e,t,n)=>{var i=n(44651),r=n(75650);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//tiltShift.frag","utf8"),{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(s.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(e){this.uniforms.blur.value=e}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(e){this.uniforms.gradientBlur.value=e}},start:{get:function(){return this.uniforms.start.value},set:function(e){this.uniforms.start.value=e,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(e){this.uniforms.end.value=e,this.updateDelta()}}})},66422:(e,t,n)=>{var i=n(44651),r=n(53080),s=n(84407);function o(){i.AbstractFilter.call(this),this.tiltShiftXFilter=new r,this.tiltShiftYFilter=new s}o.prototype=Object.create(i.AbstractFilter.prototype),o.prototype.constructor=o,e.exports=o,o.prototype.applyFilter=function(e,t,n){var i=e.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(e,t,i),this.tiltShiftYFilter.applyFilter(e,i,n),e.filterManager.returnRenderTarget(i)},Object.defineProperties(o.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e}}})},53080:(e,t,n)=>{var i=n(81519);function r(){i.call(this)}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateDelta=function(){var e=this.uniforms.end.value.x-this.uniforms.start.value.x,t=this.uniforms.end.value.y-this.uniforms.start.value.y,n=Math.sqrt(e*e+t*t);this.uniforms.delta.value.x=e/n,this.uniforms.delta.value.y=t/n}},84407:(e,t,n)=>{var i=n(81519);function r(){i.call(this)}r.prototype=Object.create(i.prototype),r.prototype.constructor=r,e.exports=r,r.prototype.updateDelta=function(){var e=this.uniforms.end.value.x-this.uniforms.start.value.x,t=this.uniforms.end.value.y-this.uniforms.start.value.y,n=Math.sqrt(e*e+t*t);this.uniforms.delta.value.x=-t/n,this.uniforms.delta.value.y=e/n}},37326:(e,t,n)=>{var i=n(44651),r=n(56644);function s(){i.AbstractFilter.call(this,null,r.readFileSync("//twist.frag","utf8"),{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}s.prototype=Object.create(i.AbstractFilter.prototype),s.prototype.constructor=s,e.exports=s,Object.defineProperties(s.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(e){this.uniforms.offset.value=e}},radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},angle:{get:function(){return this.uniforms.angle.value},set:function(e){this.uniforms.angle.value=e}}})},66619:(e,t,n)=>{n(30255);var i=e.exports=n(44651);i.extras=n(63323),i.filters=n(38319),i.interaction=n(64816),i.loaders=n(25296),i.mesh=n(38653),i.loader=new i.loaders.Loader,Object.assign(i,n(49513)),n.g.PIXI=i},99440:(e,t,n)=>{var i=n(44651);function r(){this.global=new i.Point,this.target=null,this.originalEvent=null}r.prototype.constructor=r,e.exports=r,r.prototype.getLocalPosition=function(e,t,n){return e.toLocal(n||this.global,t)}},10509:(e,t,n)=>{var i=n(44651),r=n(99440);function s(e,t){t=t||{},this.renderer=e,this.autoPreventDefault=void 0===t.autoPreventDefault||t.autoPreventDefault,this.interactionFrequency=t.interactionFrequency||10,this.mouse=new r,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new i.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}Object.assign(i.DisplayObject.prototype,n(74241)),s.prototype.constructor=s,e.exports=s,s.prototype.setTargetElement=function(e,t){this.removeEvents(),this.interactionDOMElement=e,this.resolution=t||1,this.addEvents()},s.prototype.addEvents=function(){this.interactionDOMElement&&(i.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},s.prototype.removeEvents=function(){this.interactionDOMElement&&(i.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},s.prototype.update=function(e){this._deltaTime+=e,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.interactionDOMElement&&(this.didMove?this.didMove=!1:(this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor))))},s.prototype.dispatchEvent=function(e,t,n){n.stopped||(n.target=e,n.type=t,e.emit(t,n),e[t]&&e[t](n))},s.prototype.mapPositionToPoint=function(e,t,n){var i=this.interactionDOMElement.getBoundingClientRect();e.x=(t-i.left)*(this.interactionDOMElement.width/i.width)/this.resolution,e.y=(n-i.top)*(this.interactionDOMElement.height/i.height)/this.resolution},s.prototype.processInteractive=function(e,t,n,i,r){if(!t||!t.visible)return!1;var s=t.children,o=!1;if(r=r||t.interactive,t.interactiveChildren)for(var a=s.length-1;a>=0;a--)!o&&i?o=this.processInteractive(e,s[a],n,!0,r):this.processInteractive(e,s[a],n,!1,!1);return r&&(i&&(t.hitArea?(t.worldTransform.applyInverse(e,this._tempPoint),o=t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):t.containsPoint&&(o=t.containsPoint(e))),t.interactive&&n(t,o)),o},s.prototype.onMouseDown=function(e){this.mouse.originalEvent=e,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,e.clientX,e.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},s.prototype.processMouseDown=function(e,t){var n=this.mouse.originalEvent,i=2===n.button||3===n.which;t&&(e[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(e,i?"rightdown":"mousedown",this.eventData))},s.prototype.onMouseUp=function(e){this.mouse.originalEvent=e,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,e.clientX,e.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},s.prototype.processMouseUp=function(e,t){var n=this.mouse.originalEvent,i=2===n.button||3===n.which,r=i?"_isRightDown":"_isLeftDown";t?(this.dispatchEvent(e,i?"rightup":"mouseup",this.eventData),e[r]&&(e[r]=!1,this.dispatchEvent(e,i?"rightclick":"click",this.eventData))):e[r]&&(e[r]=!1,this.dispatchEvent(e,i?"rightupoutside":"mouseupoutside",this.eventData))},s.prototype.onMouseMove=function(e){this.mouse.originalEvent=e,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,e.clientX,e.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},s.prototype.processMouseMove=function(e,t){this.dispatchEvent(e,"mousemove",this.eventData),this.processMouseOverOut(e,t)},s.prototype.onMouseOut=function(e){this.mouse.originalEvent=e,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,e.clientX,e.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,e.clientX,e.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},s.prototype.processMouseOverOut=function(e,t){t?(e._over||(e._over=!0,this.dispatchEvent(e,"mouseover",this.eventData)),e.buttonMode&&(this.cursor=e.defaultCursor)):e._over&&(e._over=!1,this.dispatchEvent(e,"mouseout",this.eventData))},s.prototype.onTouchStart=function(e){this.autoPreventDefault&&e.preventDefault();for(var t=e.changedTouches,n=t.length,i=0;i<n;i++){var r=t[i],s=this.getTouchData(r);s.originalEvent=e,this.eventData.data=s,this.eventData.stopped=!1,this.processInteractive(s.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(s)}},s.prototype.processTouchStart=function(e,t){t&&(e._touchDown=!0,this.dispatchEvent(e,"touchstart",this.eventData))},s.prototype.onTouchEnd=function(e){this.autoPreventDefault&&e.preventDefault();for(var t=e.changedTouches,n=t.length,i=0;i<n;i++){var r=t[i],s=this.getTouchData(r);s.originalEvent=e,this.eventData.data=s,this.eventData.stopped=!1,this.processInteractive(s.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(s)}},s.prototype.processTouchEnd=function(e,t){t?(this.dispatchEvent(e,"touchend",this.eventData),e._touchDown&&(e._touchDown=!1,this.dispatchEvent(e,"tap",this.eventData))):e._touchDown&&(e._touchDown=!1,this.dispatchEvent(e,"touchendoutside",this.eventData))},s.prototype.onTouchMove=function(e){this.autoPreventDefault&&e.preventDefault();for(var t=e.changedTouches,n=t.length,i=0;i<n;i++){var r=t[i],s=this.getTouchData(r);s.originalEvent=e,this.eventData.data=s,this.eventData.stopped=!1,this.processInteractive(s.global,this.renderer._lastObjectRendered,this.processTouchMove,!0),this.returnTouchData(s)}},s.prototype.processTouchMove=function(e,t){this.dispatchEvent(e,"touchmove",this.eventData)},s.prototype.getTouchData=function(e){var t=this.interactiveDataPool.pop();return t||(t=new r),t.identifier=e.identifier,this.mapPositionToPoint(t.global,e.clientX,e.clientY),navigator.isCocoonJS&&(t.global.x=t.global.x/this.resolution,t.global.y=t.global.y/this.resolution),e.globalX=t.global.x,e.globalY=t.global.y,t},s.prototype.returnTouchData=function(e){this.interactiveDataPool.push(e)},s.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},i.WebGLRenderer.registerPlugin("interaction",s),i.CanvasRenderer.registerPlugin("interaction",s)},64816:(e,t,n)=>{
/**
* @file Main export of the PIXI interactions library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
e.exports={InteractionData:n(99440),InteractionManager:n(10509),interactiveTarget:n(74241)}},74241:e=>{e.exports={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1}},74095:(e,t,n)=>{var i=n(542).Resource,r=n(44651),s=n(63323),o=n(26944);function a(e,t){var n={},i=e.data.getElementsByTagName("info")[0],o=e.data.getElementsByTagName("common")[0];n.font=i.getAttribute("face"),n.size=parseInt(i.getAttribute("size"),10),n.lineHeight=parseInt(o.getAttribute("lineHeight"),10),n.chars={};for(var a=e.data.getElementsByTagName("char"),l=0;l<a.length;l++){var u=parseInt(a[l].getAttribute("id"),10),c=new r.Rectangle(parseInt(a[l].getAttribute("x"),10)+t.frame.x,parseInt(a[l].getAttribute("y"),10)+t.frame.y,parseInt(a[l].getAttribute("width"),10),parseInt(a[l].getAttribute("height"),10));n.chars[u]={xOffset:parseInt(a[l].getAttribute("xoffset"),10),yOffset:parseInt(a[l].getAttribute("yoffset"),10),xAdvance:parseInt(a[l].getAttribute("xadvance"),10),kerning:{},texture:new r.Texture(t.baseTexture,c)}}var d=e.data.getElementsByTagName("kerning");for(l=0;l<d.length;l++){var h=parseInt(d[l].getAttribute("first"),10),p=parseInt(d[l].getAttribute("second"),10),f=parseInt(d[l].getAttribute("amount"),10);n.chars[p].kerning[h]=f}e.bitmapFont=n,s.BitmapText.fonts[n.font]=n}e.exports=function(){return function(e,t){if(!e.data||!e.isXml)return t();if(0===e.data.getElementsByTagName("page").length||0===e.data.getElementsByTagName("info").length||null===e.data.getElementsByTagName("info")[0].getAttribute("face"))return t();var n=o.dirname(e.url);"."===n&&(n=""),this.baseUrl&&n&&("/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(n+="/"),n=n.replace(this.baseUrl,"")),n&&"/"!==n.charAt(n.length-1)&&(n+="/");var s=n+e.data.getElementsByTagName("page")[0].getAttribute("file");if(r.utils.TextureCache[s])a(e,r.utils.TextureCache[s]),t();else{var l={crossOrigin:e.crossOrigin,loadType:i.LOAD_TYPE.IMAGE};this.add(e.name+"_image",s,l,function(n){a(e,n.texture),t()})}}}},25296:(e,t,n)=>{
/**
* @file Main export of the PIXI loaders library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
e.exports={Loader:n(17397),bitmapFontParser:n(74095),spritesheetParser:n(26695),textureParser:n(13968),Resource:n(542).Resource}},17397:(e,t,n)=>{var i=n(542),r=n(13968),s=n(26695),o=n(74095);function a(e,t){i.call(this,e,t);for(var n=0;n<a._pixiMiddleware.length;++n)this.use(a._pixiMiddleware[n]())}a.prototype=Object.create(i.prototype),a.prototype.constructor=a,e.exports=a,a._pixiMiddleware=[i.middleware.parsing.blob,r,s,o],a.addPixiMiddleware=function(e){a._pixiMiddleware.push(e)};var l=i.Resource;l.setExtensionXhrType("fnt",l.XHR_RESPONSE_TYPE.DOCUMENT)},26695:(e,t,n)=>{var i=n(542).Resource,r=n(26944),s=n(44651);e.exports=function(){return function(e,t){if(!e.data||!e.isJson||!e.data.frames)return t();var n={crossOrigin:e.crossOrigin,loadType:i.LOAD_TYPE.IMAGE},o=r.dirname(e.url.replace(this.baseUrl,"")),a=s.utils.getResolutionOfUrl(e.url);this.add(e.name+"_image",o+"/"+e.data.meta.image,n,function(n){e.textures={};var i=e.data.frames;for(var r in i){var o=i[r].frame;if(o){var l=null,u=null;if(l=i[r].rotated?new s.Rectangle(o.x,o.y,o.h,o.w):new s.Rectangle(o.x,o.y,o.w,o.h),i[r].trimmed&&(u=new s.Rectangle(i[r].spriteSourceSize.x/a,i[r].spriteSourceSize.y/a,i[r].sourceSize.w/a,i[r].sourceSize.h/a)),i[r].rotated){var c=l.width;l.width=l.height,l.height=c}l.x/=a,l.y/=a,l.width/=a,l.height/=a,e.textures[r]=new s.Texture(n.texture.baseTexture,l,l.clone(),u,i[r].rotated),s.utils.TextureCache[r]=e.textures[r]}}t()})}}},13968:(e,t,n)=>{var i=n(44651);e.exports=function(){return function(e,t){if(e.data&&e.isImage){var n=new i.BaseTexture(e.data,null,i.utils.getResolutionOfUrl(e.url));n.imageUrl=e.url,e.texture=new i.Texture(n),i.utils.BaseTextureCache[e.url]=n,i.utils.TextureCache[e.url]=e.texture}t()}}},2876:(e,t,n)=>{var i=n(44651),r=new i.Point,s=new i.Polygon;function o(e,t,n,r,s){i.Container.call(this),this._texture=null,this.uvs=n||new Float32Array([0,1,1,1,1,0,0,1]),this.vertices=t||new Float32Array([0,0,100,0,100,100,0,100]),this.indices=r||new Uint16Array([0,1,2,3]),this.dirty=!0,this.blendMode=i.BLEND_MODES.NORMAL,this.canvasPadding=0,this.drawMode=s||o.DRAW_MODES.TRIANGLE_MESH,this.texture=e}o.prototype=Object.create(i.Container.prototype),o.prototype.constructor=o,e.exports=o,Object.defineProperties(o.prototype,{texture:{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}}),o.prototype._renderWebGL=function(e){e.setObjectRenderer(e.plugins.mesh),e.plugins.mesh.render(this)},o.prototype._renderCanvas=function(e){var t=e.context,n=this.worldTransform;e.roundPixels?t.setTransform(n.a,n.b,n.c,n.d,0|n.tx,0|n.ty):t.setTransform(n.a,n.b,n.c,n.d,n.tx,n.ty),this.drawMode===o.DRAW_MODES.TRIANGLE_MESH?this._renderCanvasTriangleMesh(t):this._renderCanvasTriangles(t)},o.prototype._renderCanvasTriangleMesh=function(e){for(var t=this.vertices,n=this.uvs,i=t.length/2,r=0;r<i-2;r++){var s=2*r;this._renderCanvasDrawTriangle(e,t,n,s,s+2,s+4)}},o.prototype._renderCanvasTriangles=function(e){for(var t=this.vertices,n=this.uvs,i=this.indices,r=i.length,s=0;s<r;s+=3){var o=2*i[s],a=2*i[s+1],l=2*i[s+2];this._renderCanvasDrawTriangle(e,t,n,o,a,l)}},o.prototype._renderCanvasDrawTriangle=function(e,t,n,i,r,s){var o=this._texture.baseTexture.source,a=this._texture.baseTexture.width,l=this._texture.baseTexture.height,u=t[i],c=t[r],d=t[s],h=t[i+1],p=t[r+1],f=t[s+1],m=n[i]*a,g=n[r]*a,_=n[s]*a,y=n[i+1]*l,v=n[r+1]*l,b=n[s+1]*l;if(this.canvasPadding>0){var T=this.canvasPadding/this.worldTransform.a,x=this.canvasPadding/this.worldTransform.d,E=(u+c+d)/3,w=(h+p+f)/3,I=u-E,A=h-w,S=Math.sqrt(I*I+A*A);u=E+I/S*(S+T),h=w+A/S*(S+x),A=p-w,c=E+(I=c-E)/(S=Math.sqrt(I*I+A*A))*(S+T),p=w+A/S*(S+x),A=f-w,d=E+(I=d-E)/(S=Math.sqrt(I*I+A*A))*(S+T),f=w+A/S*(S+x)}e.save(),e.beginPath(),e.moveTo(u,h),e.lineTo(c,p),e.lineTo(d,f),e.closePath(),e.clip();var C=m*v+y*_+g*b-v*_-y*g-m*b,O=u*v+y*d+c*b-v*d-y*c-u*b,M=m*c+u*_+g*d-c*_-u*g-m*d,k=m*v*d+y*c*_+u*g*b-u*v*_-y*g*d-m*c*b,R=h*v+y*f+p*b-v*f-y*p-h*b,N=m*p+h*_+g*f-p*_-h*g-m*f,D=m*v*f+y*p*_+h*g*b-h*v*_-y*g*f-m*p*b;e.transform(O/C,R/C,M/C,N/C,k/C,D/C),e.drawImage(o,0,0),e.restore()},o.prototype.renderMeshFlat=function(e){var t=this.context,n=e.vertices,i=n.length/2;t.beginPath();for(var r=1;r<i-2;r++){var s=2*r,o=n[s],a=n[s+2],l=n[s+4],u=n[s+1],c=n[s+3],d=n[s+5];t.moveTo(o,u),t.lineTo(a,c),t.lineTo(l,d)}t.fillStyle="#FF0000",t.fill(),t.closePath()},o.prototype._onTextureUpdate=function(){this.updateFrame=!0},o.prototype.getBounds=function(e){if(!this._currentBounds){for(var t=e||this.worldTransform,n=t.a,r=t.b,s=t.c,o=t.d,a=t.tx,l=t.ty,u=-1/0,c=-1/0,d=1/0,h=1/0,p=this.vertices,f=0,m=p.length;f<m;f+=2){var g=p[f],_=p[f+1],y=n*g+s*_+a,v=o*_+r*g+l;d=y<d?y:d,h=v<h?v:h,u=y>u?y:u,c=v>c?v:c}if(d===-1/0||c===1/0)return i.Rectangle.EMPTY;var b=this._bounds;b.x=d,b.width=u-d,b.y=h,b.height=c-h,this._currentBounds=b}return this._currentBounds},o.prototype.containsPoint=function(e){if(!this.getBounds().contains(e.x,e.y))return!1;this.worldTransform.applyInverse(e,r);var t,n,i=this.vertices,a=s.points;if(this.drawMode===o.DRAW_MODES.TRIANGLES){var l=this.indices;for(n=this.indices.length,t=0;t<n;t+=3){var u=2*l[t],c=2*l[t+1],d=2*l[t+2];if(a[0]=i[u],a[1]=i[u+1],a[2]=i[c],a[3]=i[c+1],a[4]=i[d],a[5]=i[d+1],s.contains(r.x,r.y))return!0}}else for(n=i.length,t=0;t<n;t+=6)if(a[0]=i[t],a[1]=i[t+1],a[2]=i[t+2],a[3]=i[t+3],a[4]=i[t+4],a[5]=i[t+5],s.contains(r.x,r.y))return!0;return!1},o.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},97005:(e,t,n)=>{var i=n(2876),r=n(44651);function s(e,t){i.call(this,e),this.points=t,this.vertices=new Float32Array(4*t.length),this.uvs=new Float32Array(4*t.length),this.colors=new Float32Array(2*t.length),this.indices=new Uint16Array(2*t.length),this._ready=!0,this.refresh()}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.refresh=function(){var e=this.points;if(!(e.length<1)&&this._texture._uvs){var t=this.uvs,n=this.indices,i=this.colors,s=this._texture._uvs,o=new r.Point(s.x0,s.y0),a=new r.Point(s.x2-s.x0,s.y2-s.y0);t[0]=0+o.x,t[1]=0+o.y,t[2]=0+o.x,t[3]=1*a.y+o.y,i[0]=1,i[1]=1,n[0]=0,n[1]=1;for(var l,u,c=e.length,d=1;d<c;d++)e[d],u=d/(c-1),t[l=4*d]=u*a.x+o.x,t[l+1]=0+o.y,t[l+2]=u*a.x+o.x,t[l+3]=1*a.y+o.y,i[l=2*d]=1,i[l+1]=1,n[l=2*d]=l,n[l+1]=l+1;this.dirty=!0}},s.prototype._onTextureUpdate=function(){i.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},s.prototype.updateTransform=function(){var e=this.points;if(!(e.length<1)){for(var t,n,i,r,s,o=e[0],a=0,l=0,u=this.vertices,c=e.length,d=0;d<c;d++)n=e[d],i=4*d,l=-((t=d<e.length-1?e[d+1]:n).x-o.x),a=t.y-o.y,10*(1-d/(c-1))>1&&1,a/=r=Math.sqrt(a*a+l*l),l/=r,a*=s=this._texture.height/2,l*=s,u[i]=n.x+a,u[i+1]=n.y+l,u[i+2]=n.x-a,u[i+3]=n.y-l,o=n;this.containerUpdateTransform()}}},38653:(e,t,n)=>{
/**
* @file Main export of the PIXI extras library
* @author Mat Groves <mat@goodboydigital.com>
* @copyright 2013-2015 GoodBoyDigital
* @license {@link https://github.com/pixijs/pixi.js/blob/master/LICENSE|MIT License}
*/
e.exports={Mesh:n(2876),Rope:n(97005),MeshRenderer:n(16709),MeshShader:n(42003)}},16709:(e,t,n)=>{var i=n(44651),r=n(2876);function s(e){i.ObjectRenderer.call(this,e),this.indices=new Uint16Array(15e3);for(var t=0,n=0;t<15e3;t+=6,n+=4)this.indices[t+0]=n+0,this.indices[t+1]=n+1,this.indices[t+2]=n+2,this.indices[t+3]=n+0,this.indices[t+4]=n+2,this.indices[t+5]=n+3}s.prototype=Object.create(i.ObjectRenderer.prototype),s.prototype.constructor=s,e.exports=s,i.WebGLRenderer.registerPlugin("mesh",s),s.prototype.onContextChange=function(){},s.prototype.render=function(e){e._vertexBuffer||this._initWebGL(e);var t=this.renderer,n=t.gl,i=e._texture.baseTexture,s=t.shaderManager.plugins.meshShader,o=e.drawMode===r.DRAW_MODES.TRIANGLE_MESH?n.TRIANGLE_STRIP:n.TRIANGLES;t.blendModeManager.setBlendMode(e.blendMode),n.uniformMatrix3fv(s.uniforms.translationMatrix._location,!1,e.worldTransform.toArray(!0)),n.uniformMatrix3fv(s.uniforms.projectionMatrix._location,!1,t.currentRenderTarget.projectionMatrix.toArray(!0)),n.uniform1f(s.uniforms.alpha._location,e.worldAlpha),e.dirty?(e.dirty=!1,n.bindBuffer(n.ARRAY_BUFFER,e._vertexBuffer),n.bufferData(n.ARRAY_BUFFER,e.vertices,n.STATIC_DRAW),n.vertexAttribPointer(s.attributes.aVertexPosition,2,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,e._uvBuffer),n.bufferData(n.ARRAY_BUFFER,e.uvs,n.STATIC_DRAW),n.vertexAttribPointer(s.attributes.aTextureCoord,2,n.FLOAT,!1,0,0),n.activeTexture(n.TEXTURE0),i._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,i._glTextures[n.id]):this.renderer.updateTexture(i),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e._indexBuffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.indices,n.STATIC_DRAW)):(n.bindBuffer(n.ARRAY_BUFFER,e._vertexBuffer),n.bufferSubData(n.ARRAY_BUFFER,0,e.vertices),n.vertexAttribPointer(s.attributes.aVertexPosition,2,n.FLOAT,!1,0,0),n.bindBuffer(n.ARRAY_BUFFER,e._uvBuffer),n.vertexAttribPointer(s.attributes.aTextureCoord,2,n.FLOAT,!1,0,0),n.activeTexture(n.TEXTURE0),i._glTextures[n.id]?n.bindTexture(n.TEXTURE_2D,i._glTextures[n.id]):this.renderer.updateTexture(i),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e._indexBuffer),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.indices)),n.drawElements(o,e.indices.length,n.UNSIGNED_SHORT,0)},s.prototype._initWebGL=function(e){var t=this.renderer.gl;e._vertexBuffer=t.createBuffer(),e._indexBuffer=t.createBuffer(),e._uvBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,e._vertexBuffer),t.bufferData(t.ARRAY_BUFFER,e.vertices,t.DYNAMIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,e._uvBuffer),t.bufferData(t.ARRAY_BUFFER,e.uvs,t.STATIC_DRAW),e.colors&&(e._colorBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,e._colorBuffer),t.bufferData(t.ARRAY_BUFFER,e.colors,t.STATIC_DRAW)),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e._indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.indices,t.STATIC_DRAW)},s.prototype.flush=function(){},s.prototype.start=function(){var e=this.renderer.shaderManager.plugins.meshShader;this.renderer.shaderManager.setShader(e)},s.prototype.destroy=function(){i.ObjectRenderer.prototype.destroy.call(this)}},42003:(e,t,n)=>{var i=n(44651);function r(e){i.Shader.call(this,e,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}r.prototype=Object.create(i.Shader.prototype),r.prototype.constructor=r,e.exports=r,i.ShaderManager.registerPlugin("meshShader",r)},99206:()=>{Math.sign||(Math.sign=function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1})},87537:(e,t,n)=>{Object.assign||(Object.assign=n(45228))},30255:(e,t,n)=>{n(87537),n(34377),n(99206)},34377:(e,t,n)=>{if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!n.g.performance||!n.g.performance.now){var i=Date.now();n.g.performance||(n.g.performance={}),n.g.performance.now=function(){return Date.now()-i}}for(var r=Date.now(),s=["ms","moz","webkit","o"],o=0;o<s.length&&!n.g.requestAnimationFrame;++o)n.g.requestAnimationFrame=n.g[s[o]+"RequestAnimationFrame"],n.g.cancelAnimationFrame=n.g[s[o]+"CancelAnimationFrame"]||n.g[s[o]+"CancelRequestAnimationFrame"];n.g.requestAnimationFrame||(n.g.requestAnimationFrame=function(e){if("function"!=typeof e)throw new TypeError(e+"is not a function");var t=Date.now(),n=16+r-t;return n<0&&(n=0),r=t,setTimeout(function(){r=Date.now(),e(performance.now())},n)}),n.g.cancelAnimationFrame||(n.g.cancelAnimationFrame=function(e){clearTimeout(e)})},95237:(e,t,n)=>{"use strict";function i(){}n.r(t),n.d(t,{Component:()=>L,cloneElement:()=>c,createElement:()=>a,default:()=>B,h:()=>a,options:()=>r,render:()=>P,rerender:()=>f});var r={},s=[],o=[];function a(e,t){var n,a,l,u,c=o;for(u=arguments.length;u-- >2;)s.push(arguments[u]);for(t&&null!=t.children&&(s.length||s.push(t.children),delete t.children);s.length;)if((a=s.pop())&&void 0!==a.pop)for(u=a.length;u--;)s.push(a[u]);else"boolean"==typeof a&&(a=null),(l="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&n?c[c.length-1]+=a:c===o?c=[a]:c.push(a),n=l;var d=new i;return d.nodeName=e,d.children=c,d.attributes=null==t?void 0:t,d.key=null==t?void 0:t.key,void 0!==r.vnode&&r.vnode(d),d}function l(e,t){for(var n in t)e[n]=t[n];return e}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function c(e,t){return a(e.nodeName,l(l({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function p(e){!e._dirty&&(e._dirty=!0)&&1==h.push(e)&&(r.debounceRendering||u)(f)}function f(){var e,t=h;for(h=[];e=t.pop();)e._dirty&&D(e)}function m(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&g(e,t.nodeName):n||e._componentConstructor===t.nodeName}function g(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function _(e){var t=l({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function y(e){var t=e.parentNode;t&&t.removeChild(e)}function v(e,t,n,i,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),i&&i(e);else if("class"!==t||r)if("style"===t){if(i&&"string"!=typeof i&&"string"!=typeof n||(e.style.cssText=i||""),i&&"object"==typeof i){if("string"!=typeof n)for(var s in n)s in i||(e.style[s]="");for(var s in i)e.style[s]="number"==typeof i[s]&&!1===d.test(s)?i[s]+"px":i[s]}}else if("dangerouslySetInnerHTML"===t)i&&(e.innerHTML=i.__html||"");else if("o"==t[0]&&"n"==t[1]){var o=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),i?n||e.addEventListener(t,b,o):e.removeEventListener(t,b,o),(e._listeners||(e._listeners={}))[t]=i}else if("list"!==t&&"type"!==t&&!r&&t in e)!function(e,t,n){try{e[t]=n}catch(e){}}(e,t,null==i?"":i),null!=i&&!1!==i||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink:?/,""));null==i||!1===i?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof i&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),i):e.setAttribute(t,i))}else e.className=i||""}function b(e){return this._listeners[e.type](r.event&&r.event(e)||e)}var T=[],x=0,E=!1,w=!1;function I(){for(var e;e=T.pop();)r.afterMount&&r.afterMount(e),e.componentDidMount&&e.componentDidMount()}function A(e,t,n,i,r,s){x++||(E=null!=r&&void 0!==r.ownerSVGElement,w=null!=e&&!("__preactattr_"in e));var o=S(e,t,n,i,s);return r&&o.parentNode!==r&&r.appendChild(o),--x||(w=!1,s||I()),o}function S(e,t,n,i,r){var s=e,o=E;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(s=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(s,e),C(e,!0))),s.__preactattr_=!0,s;var a,l,u=t.nodeName;if("function"==typeof u)return function(e,t,n,i){var r=e&&e._component,s=r,o=e,a=r&&e._componentConstructor===t.nodeName,l=a,u=_(t);for(;r&&!l&&(r=r._parentComponent);)l=r.constructor===t.nodeName;r&&l&&(!i||r._component)?(N(r,u,3,n,i),e=r.base):(s&&!a&&(F(s),e=o=null),r=k(t.nodeName,u,n),e&&!r.nextBase&&(r.nextBase=e,o=null),N(r,u,1,n,i),e=r.base,o&&e!==o&&(o._component=null,C(o,!1)));return e}(e,t,n,i);if(E="svg"===u||"foreignObject"!==u&&E,u=String(u),(!e||!g(e,u))&&(a=u,(l=E?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,s=l,e)){for(;e.firstChild;)s.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(s,e),C(e,!0)}var c=s.firstChild,d=s.__preactattr_,h=t.children;if(null==d){d=s.__preactattr_={};for(var p=s.attributes,f=p.length;f--;)d[p[f].name]=p[f].value}return!w&&h&&1===h.length&&"string"==typeof h[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=h[0]&&(c.nodeValue=h[0]):(h&&h.length||null!=c)&&function(e,t,n,i,r){var s,o,a,l,u,c=e.childNodes,d=[],h={},p=0,f=0,g=c.length,_=0,v=t?t.length:0;if(0!==g)for(var b=0;b<g;b++){var T=c[b],x=T.__preactattr_;null!=(E=v&&x?T._component?T._component.__key:x.key:null)?(p++,h[E]=T):(x||(void 0!==T.splitText?!r||T.nodeValue.trim():r))&&(d[_++]=T)}if(0!==v)for(b=0;b<v;b++){var E;if(u=null,null!=(E=(l=t[b]).key))p&&void 0!==h[E]&&(u=h[E],h[E]=void 0,p--);else if(!u&&f<_)for(s=f;s<_;s++)if(void 0!==d[s]&&m(o=d[s],l,r)){u=o,d[s]=void 0,s===_-1&&_--,s===f&&f++;break}u=S(u,l,n,i),a=c[b],u&&u!==e&&u!==a&&(null==a?e.appendChild(u):u===a.nextSibling?y(a):e.insertBefore(u,a))}if(p)for(var b in h)void 0!==h[b]&&C(h[b],!1);for(;f<=_;)void 0!==(u=d[_--])&&C(u,!1)}(s,h,n,i,w||null!=d.dangerouslySetInnerHTML),function(e,t,n){var i;for(i in n)t&&null!=t[i]||null==n[i]||v(e,i,n[i],n[i]=void 0,E);for(i in t)"children"===i||"innerHTML"===i||i in n&&t[i]===("value"===i||"checked"===i?e[i]:n[i])||v(e,i,n[i],n[i]=t[i],E)}(s,t.attributes,d),E=o,s}function C(e,t){var n=e._component;n?F(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||y(e),O(e))}function O(e){for(e=e.lastChild;e;){var t=e.previousSibling;C(e,!0),e=t}}var M={};function k(e,t,n){var i,r=M[e.name];if(e.prototype&&e.prototype.render?(i=new e(t,n),L.call(i,t,n)):((i=new L(t,n)).constructor=e,i.render=R),r)for(var s=r.length;s--;)if(r[s].constructor===e){i.nextBase=r[s].nextBase,r.splice(s,1);break}return i}function R(e,t,n){return this.constructor(e,n)}function N(e,t,n,i,s){e._disable||(e._disable=!0,(e.__ref=t.ref)&&delete t.ref,(e.__key=t.key)&&delete t.key,!e.base||s?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,i),i&&i!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=i),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===r.syncComponentUpdates&&e.base?p(e):D(e,1,s)),e.__ref&&e.__ref(e))}function D(e,t,n,i){if(!e._disable){var s,o,a,u=e.props,c=e.state,d=e.context,h=e.prevProps||u,p=e.prevState||c,f=e.prevContext||d,m=e.base,g=e.nextBase,y=m||g,v=e._component,b=!1;if(m&&(e.props=h,e.state=p,e.context=f,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,d)?b=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,d),e.props=u,e.state=c,e.context=d),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!b){s=e.render(u,c,d),e.getChildContext&&(d=l(l({},d),e.getChildContext()));var E,w,S=s&&s.nodeName;if("function"==typeof S){var O=_(s);(o=v)&&o.constructor===S&&O.key==o.__key?N(o,O,1,d,!1):(E=o,e._component=o=k(S,O,d),o.nextBase=o.nextBase||g,o._parentComponent=e,N(o,O,0,d,!1),D(o,1,n,!0)),w=o.base}else a=y,(E=v)&&(a=e._component=null),(y||1===t)&&(a&&(a._component=null),w=A(a,s,d,n||!m,y&&y.parentNode,!0));if(y&&w!==y&&o!==v){var M=y.parentNode;M&&w!==M&&(M.replaceChild(w,y),E||(y._component=null,C(y,!1)))}if(E&&F(E),e.base=w,w&&!i){for(var R=e,L=e;L=L._parentComponent;)(R=L).base=w;w._component=R,w._componentConstructor=R.constructor}}if(!m||n?T.unshift(e):b||(e.componentDidUpdate&&e.componentDidUpdate(h,p,f),r.afterUpdate&&r.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);x||i||I()}}function F(e){r.beforeUnmount&&r.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?F(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.nextBase=t,y(t),function(e){var t=e.constructor.name;(M[t]||(M[t]=[])).push(e)}(e),O(t)),e.__ref&&e.__ref(null)}function L(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{}}function P(e,t,n){return A(n,e,{},!1,t,!1)}l(L.prototype,{setState:function(e,t){var n=this.state;this.prevState||(this.prevState=l({},n)),l(n,"function"==typeof e?e(n,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),p(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),D(this,2)},render:function(){}});const B={h:a,createElement:a,cloneElement:c,Component:L,render:P,rerender:f,options:r}},65606:e=>{var t,n,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,l=[],u=!1,c=-1;function d(){u&&a&&(u=!1,a.length?l=a.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=o(d);u=!0;for(var t=l.length;t;){for(a=l,l=[];++c<t;)a&&a[c].run();c=-1,t=l.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||u||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=f,i.addListener=f,i.once=f,i.off=f,i.removeListener=f,i.removeAllListeners=f,i.emit=f,i.prependListener=f,i.prependOnceListener=f,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},69610:(e,t,n)=>{"use strict";n.d(t,{D:()=>i});var i=function(){function e(e){var t=this;void 0===e&&(e=!1),this.ignoreMultipleSettles=e,this.isSettled=!1,this.promise=new Promise(function(e,n){t.resolveCallback=e,t.rejectCallback=n})}return e.prototype.markAsSettled=function(){var e=this.isSettled;if(e&&!this.ignoreMultipleSettles)throw new Error("PromiseDelegate is already settled!");return this.isSettled=!0,!e},Object.defineProperty(e.prototype,"settled",{get:function(){return this.isSettled},enumerable:!1,configurable:!0}),e.prototype.resolve=function(e){this.markAsSettled()&&this.resolveCallback(e)},e.prototype.reject=function(e){this.markAsSettled()&&this.rejectCallback(e)},e}()},95006:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},s.prototype.listeners=function(e,t){var i=n?n+e:e,r=this._events[i];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var s=0,o=r.length,a=new Array(o);s<o;s++)a[s]=r[s].fn;return a},s.prototype.emit=function(e,t,i,r,s,o){var a=n?n+e:e;if(!this._events[a])return!1;var l,u,c=this._events[a],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,r),!0;case 5:return c.fn.call(c.context,t,i,r,s),!0;case 6:return c.fn.call(c.context,t,i,r,s,o),!0}for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var h,p=c.length;for(u=0;u<p;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),d){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,i);break;case 4:c[u].fn.call(c[u].context,t,i,r);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(e,t,i){var s=new r(t,i||this),o=n?n+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],s]:this._events[o].push(s):(this._events[o]=s,this._eventsCount++),this},s.prototype.once=function(e,t,i){var s=new r(t,i||this,!0),o=n?n+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],s]:this._events[o].push(s):(this._events[o]=s,this._eventsCount++),this},s.prototype.removeListener=function(e,t,r,s){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return 0===--this._eventsCount?this._events=new i:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==t||s&&!a.once||r&&a.context!==r||(0===--this._eventsCount?this._events=new i:delete this._events[o]);else{for(var l=0,u=[],c=a.length;l<c;l++)(a[l].fn!==t||s&&!a[l].once||r&&a[l].context!==r)&&u.push(a[l]);u.length?this._events[o]=1===u.length?u[0]:u:0===--this._eventsCount?this._events=new i:delete this._events[o]}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new i:delete this._events[t])):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prototype.setMaxListeners=function(){return this},s.prefixed=n,s.EventEmitter=s,e.exports=s},93723:(e,t,n)=>{"use strict";var i=n(84678),r=n(40978),s=n(88664),o=n(95006);function a(e,t){o.call(this),t=t||10,this.baseUrl=e||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._buffer=[],this._numToLoad=0,this._queue=r.queue(this._boundLoadResource,t),this.resources={}}a.prototype=Object.create(o.prototype),a.prototype.constructor=a,e.exports=a,a.prototype.add=a.prototype.enqueue=function(e,t,n,i){if(Array.isArray(e)){for(var r=0;r<e.length;++r)this.add(e[r]);return this}if("object"==typeof e&&(i=t||e.callback||e.onComplete,n=e,t=e.url,e=e.name||e.key||e.url),"string"!=typeof t&&(i=n,n=t,t=e),"string"!=typeof t)throw new Error("No url passed to add resource to loader.");if("function"==typeof n&&(i=n,n=null),this.resources[e])throw new Error('Resource with name "'+e+'" already exists.');return t=this._prepareUrl(t),this.resources[e]=new s(e,t,n),"function"==typeof i&&this.resources[e].once("afterMiddleware",i),this._numToLoad++,this._queue.started?(this._queue.push(this.resources[e]),this._progressChunk=(100-this.progress)/(this._queue.length()+this._queue.running())):(this._buffer.push(this.resources[e]),this._progressChunk=100/this._buffer.length),this},a.prototype.before=a.prototype.pre=function(e){return this._beforeMiddleware.push(e),this},a.prototype.after=a.prototype.use=function(e){return this._afterMiddleware.push(e),this},a.prototype.reset=function(){for(var e in this.progress=0,this.loading=!1,this._progressChunk=0,this._buffer.length=0,this._numToLoad=0,this._queue.kill(),this._queue.started=!1,this.resources){var t=this.resources[e];t.off("complete",this._onLoad,this),t.isLoading&&t.abort()}return this.resources={},this},a.prototype.load=function(e){if("function"==typeof e&&this.once("complete",e),this._queue.started)return this;this.emit("start",this),this.loading=!0;for(var t=0;t<this._buffer.length;++t)this._queue.push(this._buffer[t]);return this._buffer.length=0,this},a.prototype._prepareUrl=function(e){var t=i(e,{strictMode:!0});return t.protocol||!t.path||0===t.path.indexOf("//")?e:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==e.charAt(0)?this.baseUrl+"/"+e:this.baseUrl+e},a.prototype._loadResource=function(e,t){var n=this;e._dequeue=t,r.eachSeries(this._beforeMiddleware,function(t,i){t.call(n,e,function(){i(e.isComplete?{}:null)})},function(){e.isComplete?n._onLoad(e):(e.once("complete",n._onLoad,n),e.load())})},a.prototype._onComplete=function(){this.loading=!1,this.emit("complete",this,this.resources)},a.prototype._onLoad=function(e){var t=this;r.eachSeries(this._afterMiddleware,function(n,i){n.call(t,e,i)},function(){e.emit("afterMiddleware",e),t._numToLoad--,t.progress+=t._progressChunk,t.emit("progress",t,e),e.error?t.emit("error",e.error,t,e):t.emit("load",t,e),0===t._numToLoad&&(t.progress=100,t._onComplete())}),e._dequeue()},a.LOAD_TYPE=s.LOAD_TYPE,a.XHR_RESPONSE_TYPE=s.XHR_RESPONSE_TYPE},88664:(e,t,n)=>{"use strict";var i=n(95006),r=n(84678),s=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),o=null;function a(e,t,n){if(i.call(this),n=n||{},"string"!=typeof e||"string"!=typeof t)throw new Error("Both name and url are required for constructing a resource.");this.name=e,this.url=t,this.isDataUrl=0===this.url.indexOf("data:"),this.data=null,this.crossOrigin=!0===n.crossOrigin?"anonymous":n.crossOrigin,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.isJson=!1,this.isXml=!1,this.isImage=!1,this.isAudio=!1,this.isVideo=!1,this.isComplete=!1,this.isLoading=!1,this._dequeue=null,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this._boundXdrOnTimeout=this._xdrOnTimeout.bind(this)}function l(e){return e.toString().replace("object ","")}function u(e,t,n){t&&0===t.indexOf(".")&&(t=t.substring(1)),t&&(e[t]=n)}a.prototype=Object.create(i.prototype),a.prototype.constructor=a,e.exports=a,a.prototype.complete=function(){if(this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null)),this.isComplete)throw new Error("Complete called again for an already completed resource.");this.isComplete=!0,this.isLoading=!1,this.emit("complete",this)},a.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(void 0!==this.data.src)this.data.src="";else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this.complete()}},a.prototype.load=function(e){if(!this.isLoading)if(this.isComplete){if(e){var t=this;setTimeout(function(){e(t)},1)}}else switch(e&&this.once("complete",e),this.isLoading=!0,this.emit("start",this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case a.LOAD_TYPE.IMAGE:this._loadElement("image");break;case a.LOAD_TYPE.AUDIO:this._loadSourceElement("audio");break;case a.LOAD_TYPE.VIDEO:this._loadSourceElement("video");break;case a.LOAD_TYPE.XHR:default:s&&this.crossOrigin?this._loadXdr():this._loadXhr()}},a.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===e&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url);var t="is"+e[0].toUpperCase()+e.substring(1);!1===this[t]&&(this[t]=!0),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1)},a.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===e&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(e),null!==this.data){if(!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=0;t<this.url.length;++t)this.data.appendChild(this._createSource(e,this.url[t]));else this.data.appendChild(this._createSource(e,this.url));this["is"+e[0].toUpperCase()+e.substring(1)]=!0,this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load()}else this.abort("Unsupported element "+e)},a.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),this.xhrType===a.XHR_RESPONSE_TYPE.JSON||this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=a.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},a.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XDomainRequest;e.timeout=5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXdrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){e.send()},0)},a.prototype._createSource=function(e,t,n){n||(n=e+"/"+t.substr(t.lastIndexOf(".")+1));var i=document.createElement("source");return i.src=t,i.type=n,i},a.prototype._onError=function(e){this.abort("Failed to load element using "+e.target.nodeName)},a.prototype._onProgress=function(e){e&&e.lengthComputable&&this.emit("progress",this,e.loaded/e.total)},a.prototype._xhrOnError=function(){var e=this.xhr;this.abort(l(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},a.prototype._xhrOnAbort=function(){this.abort(l(this.xhr)+" Request was aborted by the user.")},a.prototype._xdrOnTimeout=function(){this.abort(l(this.xhr)+" Request timed out.")},a.prototype._xhrOnLoad=function(){var e=this.xhr,t=void 0===e.status?e.status:200;if(200===t||204===t||0===t&&e.responseText.length>0){if(this.xhrType===a.XHR_RESPONSE_TYPE.TEXT)this.data=e.responseText;else if(this.xhrType===a.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e.responseText),this.isJson=!0}catch(e){return void this.abort("Error trying to parse loaded json:",e)}else if(this.xhrType===a.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(e.responseText,"text/xml")}else{var i=document.createElement("div");i.innerHTML=e.responseText,this.data=i}this.isXml=!0}catch(e){return void this.abort("Error trying to parse loaded xml:",e)}else this.data=e.response||e.responseText;this.complete()}else this.abort("["+e.status+"]"+e.statusText+":"+e.responseURL)},a.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";t=t||window.location,o||(o=document.createElement("a")),o.href=e;var n=!(e=r(o.href,{strictMode:!0})).port&&""===t.port||e.port===t.port,i=e.protocol?e.protocol+":":"";return e.host===t.hostname&&n&&i===t.protocol?"":"anonymous"},a.prototype._determineXhrType=function(){return a._xhrTypeMap[this._getExtension()]||a.XHR_RESPONSE_TYPE.TEXT},a.prototype._determineLoadType=function(){return a._loadTypeMap[this._getExtension()]||a.LOAD_TYPE.XHR},a.prototype._getExtension=function(){var e=this.url,t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var i=e.indexOf("?");-1!==i&&(e=e.substring(0,i)),t=e.substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},a.prototype._getMimeFromXhrType=function(e){switch(e){case a.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case a.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case a.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case a.XHR_RESPONSE_TYPE.JSON:return"application/json";case a.XHR_RESPONSE_TYPE.DEFAULT:case a.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},a.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},a.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},a._loadTypeMap={gif:a.LOAD_TYPE.IMAGE,png:a.LOAD_TYPE.IMAGE,bmp:a.LOAD_TYPE.IMAGE,jpg:a.LOAD_TYPE.IMAGE,jpeg:a.LOAD_TYPE.IMAGE,tif:a.LOAD_TYPE.IMAGE,tiff:a.LOAD_TYPE.IMAGE,webp:a.LOAD_TYPE.IMAGE,tga:a.LOAD_TYPE.IMAGE,"svg+xml":a.LOAD_TYPE.IMAGE},a._xhrTypeMap={xhtml:a.XHR_RESPONSE_TYPE.DOCUMENT,html:a.XHR_RESPONSE_TYPE.DOCUMENT,htm:a.XHR_RESPONSE_TYPE.DOCUMENT,xml:a.XHR_RESPONSE_TYPE.DOCUMENT,tmx:a.XHR_RESPONSE_TYPE.DOCUMENT,tsx:a.XHR_RESPONSE_TYPE.DOCUMENT,svg:a.XHR_RESPONSE_TYPE.DOCUMENT,gif:a.XHR_RESPONSE_TYPE.BLOB,png:a.XHR_RESPONSE_TYPE.BLOB,bmp:a.XHR_RESPONSE_TYPE.BLOB,jpg:a.XHR_RESPONSE_TYPE.BLOB,jpeg:a.XHR_RESPONSE_TYPE.BLOB,tif:a.XHR_RESPONSE_TYPE.BLOB,tiff:a.XHR_RESPONSE_TYPE.BLOB,webp:a.XHR_RESPONSE_TYPE.BLOB,tga:a.XHR_RESPONSE_TYPE.BLOB,json:a.XHR_RESPONSE_TYPE.JSON,text:a.XHR_RESPONSE_TYPE.TEXT,txt:a.XHR_RESPONSE_TYPE.TEXT},a.setExtensionLoadType=function(e,t){u(a._loadTypeMap,e,t)},a.setExtensionXhrType=function(e,t){u(a._xhrTypeMap,e,t)}},40978:e=>{"use strict";function t(){}function n(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}}e.exports={eachSeries:function(e,t,n){var i=0,r=e.length;!function s(o){o||i===r?n&&n(o):t(e[i++],s)}()},queue:function(e,i){if(null==i)i=1;else if(0===i)throw new Error("Concurrency must not be zero");var r=0,s={_tasks:[],concurrency:i,saturated:t,unsaturated:t,buffer:i/4,empty:t,drain:t,error:t,started:!1,paused:!1,push:function(e,t){o(e,!1,t)},kill:function(){s.drain=t,s._tasks=[]},unshift:function(e,t){o(e,!0,t)},process:function(){for(;!s.paused&&r<s.concurrency&&s._tasks.length;){var t=s._tasks.shift();0===s._tasks.length&&s.empty(),(r+=1)===s.concurrency&&s.saturated(),e(t.data,n(a(t)))}},length:function(){return s._tasks.length},running:function(){return r},idle:function(){return s._tasks.length+r===0},pause:function(){!0!==s.paused&&(s.paused=!0)},resume:function(){if(!1!==s.paused){s.paused=!1;for(var e=1;e<=s.concurrency;e++)s.process()}}};function o(e,n,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(s.started=!0,null==e&&s.idle())setTimeout(function(){s.drain()},1);else{var r={data:e,callback:"function"==typeof i?i:t};n?s._tasks.unshift(r):s._tasks.push(r),setTimeout(function(){s.process()},1)}}function a(e){return function(){r-=1,e.callback.apply(e,arguments),null!=arguments[0]&&s.error(arguments[0],e.data),r<=s.concurrency-s.buffer&&s.unsaturated(),s.idle()&&s.drain(),s.process()}}return s}}},39350:e=>{"use strict";e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(e){for(var t,n="",i=new Array(4),r=0,s=0;r<e.length;){for(t=new Array(3),s=0;s<t.length;s++)r<e.length?t[s]=255&e.charCodeAt(r++):t[s]=0;switch(i[0]=t[0]>>2,i[1]=(3&t[0])<<4|t[1]>>4,i[2]=(15&t[1])<<2|t[2]>>6,i[3]=63&t[2],r-(e.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(s=0;s<i.length;s++)n+=this._keyStr.charAt(i[s])}return n}}},542:(e,t,n)=>{"use strict";e.exports=n(93723),e.exports.Resource=n(88664),e.exports.middleware={caching:{memory:n(99911)},parsing:{blob:n(62796)}},e.exports.async=n(40978)},99911:e=>{"use strict";var t={};e.exports=function(){return function(e,n){t[e.url]?(e.data=t[e.url],e.complete()):e.once("complete",function(){t[this.url]=this.data}),n()}}},62796:(e,t,n)=>{"use strict";var i=n(88664),r=n(39350),s=window.URL||window.webkitURL;e.exports=function(){return function(e,t){if(e.data){if(e.xhr&&e.xhrType===i.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof e.data){if(0===e.data.type.indexOf("image")){var n=s.createObjectURL(e.data);return e.blob=e.data,e.data=new Image,e.data.src=n,e.isImage=!0,void(e.data.onload=function(){s.revokeObjectURL(n),e.data.onload=null,t()})}}else{var o=e.xhr.getResponseHeader("content-type");if(o&&0===o.indexOf("image"))return e.data=new Image,e.data.src="data:"+o+";base64,"+r.encodeBinary(e.xhr.responseText),e.isImage=!0,void(e.data.onload=function(){e.data.onload=null,t()})}t()}else t()}}},92861:(e,t,n)=>{
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=n(48287),r=i.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=i:(s(i,t),t.Buffer=o),o.prototype=Object.create(r.prototype),s(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},7391:(e,t,n)=>{var i=n(7180),r=n(43181),s=n(43031),o=n(9067),a=n(96833),l=n(43717),u=n(74801);u.alea=i,u.xor128=r,u.xorwow=s,u.xorshift7=o,u.xor4096=a,u.tychei=l,e.exports=u},7180:function(e,t,n){var i;!function(e,r){function s(e){var t=this,n=function(){var e=4022871197,t=function(t){t=String(t);for(var n=0;n<t.length;n++){var i=.02519603282416938*(e+=t.charCodeAt(n));i-=e=i>>>0,e=(i*=e)>>>0,e+=4294967296*(i-=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 a(e,t){var n=new s(e),i=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,i&&("object"==typeof i&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.alea=a}(0,e=n.nmd(e),n.amdD)},43717:function(e,t,n){var i;!function(e,r){function s(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,i=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-i|0,i=i<<24^i>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-i|0,t.d=i<<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 i=0;i<n.length+20;i++)t.b^=0|n.charCodeAt(i),t.next()}function o(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function a(e,t){var n=new s(e),i=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,i&&("object"==typeof i&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.tychei=a}(0,e=n.nmd(e),n.amdD)},43181:function(e,t,n){var i;!function(e,r){function s(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 i=0;i<n.length+64;i++)t.x^=0|n.charCodeAt(i),t.next()}function o(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function a(e,t){var n=new s(e),i=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,i&&("object"==typeof i&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.xor128=a}(0,e=n.nmd(e),n.amdD)},96833:function(e,t,n){var i;!function(e,r){function s(e){var t=this;t.next=function(){var e,n,i=t.w,r=t.X,s=t.i;return t.w=i=i+1640531527|0,n=r[s+34&127],e=r[s=s+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[s]=n^e,t.i=s,n+(i^i>>>16)|0},function(e,t){var n,i,r,s,o,a=[],l=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,l=Math.max(l,t.length)),r=0,s=-32;s<l;++s)t&&(i^=t.charCodeAt((s+32)%t.length)),0===s&&(o=i),i^=i<<10,i^=i>>>15,i^=i<<4,i^=i>>>13,s>=0&&(o=o+1640531527|0,r=0==(n=a[127&s]^=i+o)?r+1:0);for(r>=128&&(a[127&(t&&t.length||0)]=-1),r=127,s=512;s>0;--s)i=a[r+34&127],n=a[r=r+1&127],i^=i<<13,n^=n<<17,i^=i>>>15,n^=n>>>12,a[r]=i^n;e.w=o,e.X=a,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 a(e,t){null==e&&(e=+new Date);var n=new s(e),i=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,i&&(i.X&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.xor4096=a}(0,e=n.nmd(e),n.amdD)},9067:function(e,t,n){var i;!function(e,r){function s(e){var t=this;t.next=function(){var e,n,i=t.x,r=t.i;return e=i[r],n=(e^=e>>>7)^e<<24,n^=(e=i[r+1&7])^e>>>10,n^=(e=i[r+3&7])^e>>>3,n^=(e=i[r+4&7])^e<<7,e=i[r+7&7],n^=(e^=e<<13)^e<<9,i[r]=n,t.i=r+1&7,n},function(e,t){var n,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,n=0;n<t.length;++n)i[7&n]=i[7&n]<<15^t.charCodeAt(n)+i[n+1&7]<<13;for(;i.length<8;)i.push(0);for(n=0;n<8&&0===i[n];++n);for(8==n?i[7]=-1:i[n],e.x=i,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function o(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var n=new s(e),i=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,i&&(i.x&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.xorshift7=a}(0,e=n.nmd(e),n.amdD)},43031:function(e,t,n){var i;!function(e,r){function s(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 i=0;i<n.length+64;i++)t.x^=0|n.charCodeAt(i),i==n.length&&(t.d=t.x<<10^t.x>>>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 a(e,t){var n=new s(e),i=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,i&&("object"==typeof i&&o(i,n),r.state=function(){return o(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(i=function(){return a}.call(t,n,t,r))||(r.exports=i):this.xorwow=a}(0,e=n.nmd(e),n.amdD)},74801:function(e,t,n){var i;!function(r,s,o){var a,l=256,u=o.pow(l,6),c=o.pow(2,52),d=2*c,h=255;function p(e,t,n){var i=[],h=_(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(s)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,y(s)]}}():e,3),i),p=new f(i),v=function(){for(var e=p.g(6),t=u,n=0;e<c;)e=(e+n)*l,t*=l,n=p.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return v.int32=function(){return 0|p.g(4)},v.quick=function(){return p.g(4)/4294967296},v.double=v,_(y(p.S),s),(t.pass||n||function(e,t,n,i){return i&&(i.S&&m(i,p),e.state=function(){return m(p,{})}),n?(o.random=e,t):e})(v,h,"global"in t?t.global:this==o,t.state)}function f(e){var t,n=e.length,i=this,r=0,s=i.i=i.j=0,o=i.S=[];for(n||(e=[n++]);r<l;)o[r]=r++;for(r=0;r<l;r++)o[r]=o[s=h&s+e[r%n]+(t=o[r])],o[s]=t;(i.g=function(e){for(var t,n=0,r=i.i,s=i.j,o=i.S;e--;)t=o[r=h&r+1],n=n*l+o[h&(o[r]=o[s=h&s+t])+(o[s]=t)];return i.i=r,i.j=s,n})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var n,i=[],r=typeof e;if(t&&"object"==r)for(n in e)try{i.push(g(e[n],t-1))}catch(e){}return i.length?i:"string"==r?e:e+"\0"}function _(e,t){for(var n,i=e+"",r=0;r<i.length;)t[h&r]=h&(n^=19*t[h&r])+i.charCodeAt(r++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(_(o.random(),s),e.exports){e.exports=p;try{a=n(41234)}catch(e){}}else void 0===(i=function(){return p}.call(t,n,t,e))||(e.exports=i)}("undefined"!=typeof self?self:this,[],Math)},93904:(e,t,n)=>{"use strict";const i=Symbol("SemVer ANY");class r{static get ANY(){return i}constructor(e,t){if(t=s(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===i?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=i}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===i||e===i)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=r;const s=n(98587),{safeRe:o,t:a}=n(99718),l=n(72111),u=n(57272),c=n(53908),d=n(78311)},78311:(e,t,n)=>{"use strict";const i=/\s+/g;class r{constructor(e,t){if(t=o(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(i," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!_(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,n=s.get(t);if(n)return n;const i=this.options.loose,r=i?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];e=e.replace(r,M(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[d.COMPARATORTRIM],h),l("comparator trim",e),e=e.replace(c[d.TILDETRIM],p),l("tilde trim",e),e=e.replace(c[d.CARETTRIM],f),l("caret trim",e);let o=e.split(" ").map(e=>b(e,this.options)).join(" ").split(/\s+/).map(e=>O(e,this.options));i&&(o=o.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",o);const u=new Map,y=o.map(e=>new a(e,this.options));for(const e of y){if(_(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const v=[...u.values()];return s.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>v(n,t)&&e.set.some(e=>v(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const s=new(n(68794)),o=n(98587),a=n(93904),l=n(57272),u=n(53908),{safeRe:c,t:d,comparatorTrimReplace:h,tildeTrimReplace:p,caretTrimReplace:f}=n(99718),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:g}=n(16874),_=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,v=(e,t)=>{let n=!0;const i=e.slice();let r=i.pop();for(;n&&i.length;)n=i.every(e=>r.intersects(e,t)),r=i.pop();return n},b=(e,t)=>(l("comp",e,t),e=w(e,t),l("caret",e),e=x(e,t),l("tildes",e),e=A(e,t),l("xrange",e),e=C(e,t),l("stars",e),e),T=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{const n=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(n,(t,n,i,r,s)=>{let o;return l("tilde",e,t,n,i,r,s),T(n)?o="":T(i)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:T(r)?o=`>=${n}.${i}.0 <${n}.${+i+1}.0-0`:s?(l("replaceTilde pr",s),o=`>=${n}.${i}.${r}-${s} <${n}.${+i+1}.0-0`):o=`>=${n}.${i}.${r} <${n}.${+i+1}.0-0`,l("tilde return",o),o})},w=(e,t)=>e.trim().split(/\s+/).map(e=>I(e,t)).join(" "),I=(e,t)=>{l("caret",e,t);const n=t.loose?c[d.CARETLOOSE]:c[d.CARET],i=t.includePrerelease?"-0":"";return e.replace(n,(t,n,r,s,o)=>{let a;return l("caret",e,t,n,r,s,o),T(n)?a="":T(r)?a=`>=${n}.0.0${i} <${+n+1}.0.0-0`:T(s)?a="0"===n?`>=${n}.${r}.0${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.0${i} <${+n+1}.0.0-0`:o?(l("replaceCaret pr",o),a="0"===n?"0"===r?`>=${n}.${r}.${s}-${o} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}-${o} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s}-${o} <${+n+1}.0.0-0`):(l("no pr"),a="0"===n?"0"===r?`>=${n}.${r}.${s}${i} <${n}.${r}.${+s+1}-0`:`>=${n}.${r}.${s}${i} <${n}.${+r+1}.0-0`:`>=${n}.${r}.${s} <${+n+1}.0.0-0`),l("caret return",a),a})},A=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>S(e,t)).join(" ")),S=(e,t)=>{e=e.trim();const n=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(n,(n,i,r,s,o,a)=>{l("xRange",e,n,i,r,s,o,a);const u=T(r),c=u||T(s),d=c||T(o),h=d;return"="===i&&h&&(i=""),a=t.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&h?(c&&(s=0),o=0,">"===i?(i=">=",c?(r=+r+1,s=0,o=0):(s=+s+1,o=0)):"<="===i&&(i="<",c?r=+r+1:s=+s+1),"<"===i&&(a="-0"),n=`${i+r}.${s}.${o}${a}`):c?n=`>=${r}.0.0${a} <${+r+1}.0.0-0`:d&&(n=`>=${r}.${s}.0${a} <${r}.${+s+1}.0-0`),l("xRange return",n),n})},C=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),O=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),M=e=>(t,n,i,r,s,o,a,l,u,c,d,h)=>`${n=T(i)?"":T(r)?`>=${i}.0.0${e?"-0":""}`:T(s)?`>=${i}.${r}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=T(u)?"":T(c)?`<${+u+1}.0.0-0`:T(d)?`<${u}.${+c+1}.0-0`:h?`<=${u}.${c}.${d}-${h}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}},53908:(e,t,n)=>{"use strict";const i=n(57272),{MAX_LENGTH:r,MAX_SAFE_INTEGER:s}=n(16874),{safeRe:o,t:a}=n(99718),l=n(98587),{compareIdentifiers:u}=n(61123);class c{constructor(e,t){if(t=l(t),e instanceof c){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>r)throw new TypeError(`version is longer than ${r} characters`);i("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(i("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof c||(e=new c(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const n=this.prerelease[t],r=e.prerelease[t];if(i("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{const n=this.build[t],r=e.build[t];if(i("build compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return u(n,r)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let i=[t,e];!1===n&&(i=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},57414:(e,t,n)=>{"use strict";const i=n(30144);e.exports=(e,t)=>{const n=i(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},72111:(e,t,n)=>{"use strict";const i=n(94641),r=n(13999),s=n(35580),o=n(54089),a=n(7059),l=n(25200);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return i(e,n,u);case"!=":return r(e,n,u);case">":return s(e,n,u);case">=":return o(e,n,u);case"<":return a(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},46170:(e,t,n)=>{"use strict";const i=n(53908),r=n(30144),{safeRe:s,t:o}=n(99718);e.exports=(e,t)=>{if(e instanceof i)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){const i=t.includePrerelease?s[o.COERCERTLFULL]:s[o.COERCERTL];let r;for(;(r=i.exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&r.index+r[0].length===n.index+n[0].length||(n=r),i.lastIndex=r.index+r[1].length+r[2].length;i.lastIndex=-1}else n=e.match(t.includePrerelease?s[o.COERCEFULL]:s[o.COERCE]);if(null===n)return null;const a=n[2],l=n[3]||"0",u=n[4]||"0",c=t.includePrerelease&&n[5]?`-${n[5]}`:"",d=t.includePrerelease&&n[6]?`+${n[6]}`:"";return r(`${a}.${l}.${u}${c}${d}`,t)}},40909:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t,n)=>{const r=new i(e,n),s=new i(t,n);return r.compare(s)||r.compareBuild(s)}},11763:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t)=>i(e,t,!0)},50560:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t,n)=>new i(e,n).compare(new i(t,n))},51832:(e,t,n)=>{"use strict";const i=n(30144);e.exports=(e,t)=>{const n=i(e,null,!0),r=i(t,null,!0),s=n.compare(r);if(0===s)return null;const o=s>0,a=o?n:r,l=o?r:n,u=!!a.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(a))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"}},94641:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>0===i(e,t,n)},35580:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>i(e,t,n)>0},54089:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>i(e,t,n)>=0},93007:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t,n,r,s)=>{"string"==typeof n&&(s=r,r=n,n=void 0);try{return new i(e instanceof i?e.version:e,n).inc(t,r,s).version}catch(e){return null}}},7059:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>i(e,t,n)<0},25200:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>i(e,t,n)<=0},32938:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t)=>new i(e,t).major},46254:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t)=>new i(e,t).minor},13999:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>0!==i(e,t,n)},30144:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t,n=!1)=>{if(e instanceof i)return e;try{return new i(e,t)}catch(e){if(!n)return null;throw e}}},24493:(e,t,n)=>{"use strict";const i=n(53908);e.exports=(e,t)=>new i(e,t).patch},31729:(e,t,n)=>{"use strict";const i=n(30144);e.exports=(e,t)=>{const n=i(e,t);return n&&n.prerelease.length?n.prerelease:null}},9970:(e,t,n)=>{"use strict";const i=n(50560);e.exports=(e,t,n)=>i(t,e,n)},74277:(e,t,n)=>{"use strict";const i=n(40909);e.exports=(e,t)=>e.sort((e,n)=>i(n,e,t))},97638:(e,t,n)=>{"use strict";const i=n(78311);e.exports=(e,t,n)=>{try{t=new i(t,n)}catch(e){return!1}return t.test(e)}},43927:(e,t,n)=>{"use strict";const i=n(40909);e.exports=(e,t)=>e.sort((e,n)=>i(e,n,t))},56953:(e,t,n)=>{"use strict";const i=n(30144);e.exports=(e,t)=>{const n=i(e,t);return n?n.version:null}},99589:(e,t,n)=>{"use strict";const i=n(99718),r=n(16874),s=n(53908),o=n(61123),a=n(30144),l=n(56953),u=n(57414),c=n(93007),d=n(51832),h=n(32938),p=n(46254),f=n(24493),m=n(31729),g=n(50560),_=n(9970),y=n(11763),v=n(40909),b=n(43927),T=n(74277),x=n(35580),E=n(7059),w=n(94641),I=n(13999),A=n(54089),S=n(25200),C=n(72111),O=n(46170),M=n(93904),k=n(78311),R=n(97638),N=n(77631),D=n(19628),F=n(270),L=n(41261),P=n(13874),B=n(97075),$=n(75571),U=n(5342),V=n(76780),z=n(72525),j=n(75032);e.exports={parse:a,valid:l,clean:u,inc:c,diff:d,major:h,minor:p,patch:f,prerelease:m,compare:g,rcompare:_,compareLoose:y,compareBuild:v,sort:b,rsort:T,gt:x,lt:E,eq:w,neq:I,gte:A,lte:S,cmp:C,coerce:O,Comparator:M,Range:k,satisfies:R,toComparators:N,maxSatisfying:D,minSatisfying:F,minVersion:L,validRange:P,outside:B,gtr:$,ltr:U,intersects:V,simplifyRange:z,subset:j,SemVer:s,re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},16874:e=>{"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},57272:e=>{"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},61123:e=>{"use strict";const t=/^[0-9]+$/,n=(e,n)=>{const i=t.test(e),r=t.test(n);return i&&r&&(e=+e,n=+n),e===n?0:i&&!r?-1:r&&!i?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},68794:e=>{"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},98587:e=>{"use strict";const t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},99718:(e,t,n)=>{"use strict";const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:s}=n(16874),o=n(57272),a=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={};let h=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",s],[p,r]],m=(e,t,n)=>{const i=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),r=h++;o(e,r,t),d[e]=r,u[r]=t,c[r]=i,a[r]=new RegExp(t,n?"g":void 0),l[r]=new RegExp(i,n?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${p}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},75571:(e,t,n)=>{"use strict";const i=n(97075);e.exports=(e,t,n)=>i(e,t,">",n)},76780:(e,t,n)=>{"use strict";const i=n(78311);e.exports=(e,t,n)=>(e=new i(e,n),t=new i(t,n),e.intersects(t,n))},5342:(e,t,n)=>{"use strict";const i=n(97075);e.exports=(e,t,n)=>i(e,t,"<",n)},19628:(e,t,n)=>{"use strict";const i=n(53908),r=n(78311);e.exports=(e,t,n)=>{let s=null,o=null,a=null;try{a=new r(t,n)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(s&&-1!==o.compare(e)||(s=e,o=new i(s,n)))}),s}},270:(e,t,n)=>{"use strict";const i=n(53908),r=n(78311);e.exports=(e,t,n)=>{let s=null,o=null,a=null;try{a=new r(t,n)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(s&&1!==o.compare(e)||(s=e,o=new i(s,n)))}),s}},41261:(e,t,n)=>{"use strict";const i=n(53908),r=n(78311),s=n(35580);e.exports=(e,t)=>{e=new r(e,t);let n=new i("0.0.0");if(e.test(n))return n;if(n=new i("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let o=null;r.forEach(e=>{const t=new i(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!s(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||n&&!s(n,o)||(n=o)}return n&&e.test(n)?n:null}},97075:(e,t,n)=>{"use strict";const i=n(53908),r=n(93904),{ANY:s}=r,o=n(78311),a=n(97638),l=n(35580),u=n(7059),c=n(25200),d=n(54089);e.exports=(e,t,n,h)=>{let p,f,m,g,_;switch(e=new i(e,h),t=new o(t,h),n){case">":p=l,f=c,m=u,g=">",_=">=";break;case"<":p=u,f=d,m=l,g="<",_="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let n=0;n<t.set.length;++n){const i=t.set[n];let o=null,a=null;if(i.forEach(e=>{e.semver===s&&(e=new r(">=0.0.0")),o=o||e,a=a||e,p(e.semver,o.semver,h)?o=e:m(e.semver,a.semver,h)&&(a=e)}),o.operator===g||o.operator===_)return!1;if((!a.operator||a.operator===g)&&f(e,a.semver))return!1;if(a.operator===_&&m(e,a.semver))return!1}return!0}},72525:(e,t,n)=>{"use strict";const i=n(97638),r=n(50560);e.exports=(e,t,n)=>{const s=[];let o=null,a=null;const l=e.sort((e,t)=>r(e,t,n));for(const e of l){i(e,t,n)?(a=e,o||(o=e)):(a&&s.push([o,a]),a=null,o=null)}o&&s.push([o,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length<d.length?c:t}},75032:(e,t,n)=>{"use strict";const i=n(78311),r=n(93904),{ANY:s}=r,o=n(97638),a=n(50560),l=[new r(">=0.0.0-0")],u=[new r(">=0.0.0")],c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=n.includePrerelease?l:u}if(1===t.length&&t[0].semver===s){if(n.includePrerelease)return!0;t=u}const i=new Set;let r,c,p,f,m,g,_;for(const t of e)">"===t.operator||">="===t.operator?r=d(r,t,n):"<"===t.operator||"<="===t.operator?c=h(c,t,n):i.add(t.semver);if(i.size>1)return null;if(r&&c){if(p=a(r.semver,c.semver,n),p>0)return null;if(0===p&&(">="!==r.operator||"<="!==c.operator))return null}for(const e of i){if(r&&!o(e,String(r),n))return null;if(c&&!o(e,String(c),n))return null;for(const i of t)if(!o(e,String(i),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,v=!(!r||n.includePrerelease||!r.semver.prerelease.length)&&r.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(_=_||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,r)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(f=d(r,e,n),f===e&&f!==r)return!1}else if(">="===r.operator&&!o(r.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=h(c,e,n),m===e&&m!==c)return!1}else if("<="===c.operator&&!o(c.semver,String(e),n))return!1;if(!e.operator&&(c||r)&&0!==p)return!1}return!(r&&g&&!c&&0!==p)&&(!(c&&_&&!r&&0!==p)&&(!v&&!y))},d=(e,t,n)=>{if(!e)return t;const i=a(e.semver,t.semver,n);return i>0?e:i<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,n)=>{if(!e)return t;const i=a(e.semver,t.semver,n);return i<0?e:i>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new i(e,n),t=new i(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=c(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0}},77631:(e,t,n)=>{"use strict";const i=n(78311);e.exports=(e,t)=>new i(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},13874:(e,t,n)=>{"use strict";const i=n(78311);e.exports=(e,t)=>{try{return new i(e,t).range||"*"}catch(e){return null}}},45780:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DEFAULT_ACTIONS:()=>o_e,default:()=>y_e,guessMode:()=>f_e,vega:()=>i_e,vegaLite:()=>r_e});var i={};n.r(i),n.d(i,{JsonPatchError:()=>N,_areEquals:()=>j,applyOperation:()=>B,applyPatch:()=>$,applyReducer:()=>U,deepClone:()=>D,getValueByPointer:()=>P,validate:()=>z,validator:()=>V});var r={};n.r(r),n.d(r,{compare:()=>Z,generate:()=>q,observe:()=>X,unobserve:()=>W});var s={};n.r(s),n.d(s,{aggregate:()=>Oc,bin:()=>Mc,collect:()=>Rc,compare:()=>Nc,countpattern:()=>Fc,cross:()=>Lc,density:()=>Uc,dotbin:()=>Gc,expression:()=>Hc,extent:()=>Xc,facet:()=>Kc,field:()=>Zc,filter:()=>Jc,flatten:()=>ed,fold:()=>td,formula:()=>nd,generate:()=>id,impute:()=>od,joinaggregate:()=>ad,kde:()=>ld,key:()=>ud,load:()=>dd,lookup:()=>pd,multiextent:()=>fd,multivalues:()=>gd,params:()=>yd,pivot:()=>vd,prefacet:()=>bd,project:()=>Td,proxy:()=>xd,quantile:()=>Ed,relay:()=>wd,sample:()=>Id,sequence:()=>Ad,sieve:()=>Sd,subflow:()=>qc,timeunit:()=>Cd,tupleindex:()=>Md,values:()=>kd,window:()=>Ld});var o={};n.r(o),n.d(o,{interpolate:()=>uy,interpolateArray:()=>ty,interpolateBasis:()=>z_,interpolateBasisClosed:()=>j_,interpolateCubehelix:()=>sb,interpolateCubehelixLong:()=>ob,interpolateDate:()=>iy,interpolateDiscrete:()=>cv,interpolateHcl:()=>Hv,interpolateHclLong:()=>Wv,interpolateHsl:()=>xv,interpolateHslLong:()=>Ev,interpolateHue:()=>dv,interpolateLab:()=>Yv,interpolateNumber:()=>ry,interpolateNumberArray:()=>J_,interpolateObject:()=>sy,interpolateRgb:()=>q_,interpolateRgbBasis:()=>Z_,interpolateRgbBasisClosed:()=>Q_,interpolateRound:()=>cy,interpolateString:()=>ly,interpolateTransformCss:()=>_v,interpolateTransformSvg:()=>yv,interpolateZoom:()=>bv,piecewise:()=>Qy,quantize:()=>ab});var a={};n.r(a),n.d(a,{bound:()=>dA,identifier:()=>fA,mark:()=>mA,overlap:()=>gA,render:()=>EA,viewlayout:()=>GA});var l={};n.r(l),n.d(l,{interpolate:()=>wS,interpolateArray:()=>gS,interpolateBasis:()=>iS,interpolateBasisClosed:()=>rS,interpolateCubehelix:()=>rM,interpolateCubehelixLong:()=>sM,interpolateDate:()=>yS,interpolateDiscrete:()=>$O,interpolateHcl:()=>tM,interpolateHclLong:()=>nM,interpolateHsl:()=>ZO,interpolateHslLong:()=>QO,interpolateHue:()=>UO,interpolateLab:()=>JO,interpolateNumber:()=>vS,interpolateNumberArray:()=>fS,interpolateObject:()=>bS,interpolateRgb:()=>cS,interpolateRgbBasis:()=>hS,interpolateRgbBasisClosed:()=>pS,interpolateRound:()=>IS,interpolateString:()=>ES,interpolateTransformCss:()=>HO,interpolateTransformSvg:()=>WO,interpolateZoom:()=>qO,piecewise:()=>LO,quantize:()=>oM});var u={};n.r(u),n.d(u,{axisticks:()=>bk,datajoin:()=>Tk,encode:()=>Ek,legendentries:()=>wk,linkpath:()=>Ok,pie:()=>Dk,scale:()=>Pk,sortitems:()=>Vk,stack:()=>Hk});var c={};n.r(c),n.d(c,{contour:()=>wF,geojson:()=>SF,geopath:()=>CF,geopoint:()=>OF,geoshape:()=>MF,graticule:()=>kF,heatmap:()=>RF,isocontour:()=>fF,kde2d:()=>TF,projection:()=>DF});var d={};n.r(d),n.d(d,{force:()=>OL});var h={};n.r(h),n.d(h,{nest:()=>OP,pack:()=>FP,partition:()=>PP,stratify:()=>BP,tree:()=>VP,treelinks:()=>zP,treemap:()=>GP});var p={};n.r(p),n.d(p,{label:()=>vG});var f={};n.r(f),n.d(f,{loess:()=>TG,regression:()=>EG});var m={};n.r(m),n.d(m,{voronoi:()=>HG});var g={};n.r(g),n.d(g,{interpolate:()=>YH,interpolateArray:()=>LH,interpolateBasis:()=>EH,interpolateBasisClosed:()=>wH,interpolateCubehelix:()=>jX,interpolateCubehelixLong:()=>YX,interpolateDate:()=>BH,interpolateDiscrete:()=>wX,interpolateHcl:()=>UX,interpolateHclLong:()=>VX,interpolateHsl:()=>LX,interpolateHslLong:()=>PX,interpolateHue:()=>IX,interpolateLab:()=>BX,interpolateNumber:()=>$H,interpolateNumberArray:()=>DH,interpolateObject:()=>UH,interpolateRgb:()=>MH,interpolateRgbBasis:()=>RH,interpolateRgbBasisClosed:()=>NH,interpolateRound:()=>GH,interpolateString:()=>jH,interpolateTransformCss:()=>kX,interpolateTransformSvg:()=>RX,interpolateZoom:()=>DX,piecewise:()=>yX,quantize:()=>GX});var _={};n.r(_),n.d(_,{wordcloud:()=>Zq});var y={};n.r(y),n.d(y,{crossfilter:()=>rK,resolvefilter:()=>sK});var v={};n.r(v),n.d(v,{Bounds:()=>fV,CanvasHandler:()=>Hj,CanvasRenderer:()=>Zj,DATE:()=>uu,DAY:()=>cu,DAYOFYEAR:()=>du,Dataflow:()=>Yo,Debug:()=>Te,Error:()=>ye,EventStream:()=>Oo,Gradient:()=>TU,GroupItem:()=>gV,HOURS:()=>hu,Handler:()=>Sj,Info:()=>be,Item:()=>mV,MILLISECONDS:()=>mu,MINUTES:()=>pu,MONTH:()=>au,Marks:()=>dj,MultiPulse:()=>$o,None:()=>_e,Operator:()=>Ao,Parameters:()=>Eo,Pulse:()=>Fo,QUARTER:()=>ou,RenderType:()=>VY,Renderer:()=>Oj,ResourceLoader:()=>_V,SECONDS:()=>fu,SVGHandler:()=>Jj,SVGRenderer:()=>wY,SVGStringRenderer:()=>BY,Scenegraph:()=>vj,TIME_UNITS:()=>gu,Transform:()=>Ho,View:()=>C2,WEEK:()=>lu,Warn:()=>ve,YEAR:()=>su,accessor:()=>te,accessorFields:()=>ie,accessorName:()=>ne,array:()=>Xe,ascending:()=>Je,bandwidthNRD:()=>la,bin:()=>ua,bootstrapCI:()=>ha,boundClip:()=>qY,boundContext:()=>BV,boundItem:()=>hj,boundMark:()=>fj,boundStroke:()=>bV,changeset:()=>To,clampRange:()=>qe,codegenExpression:()=>e7,compare:()=>Qe,constant:()=>it,cumulativeLogNormal:()=>Sa,cumulativeNormal:()=>Ta,cumulativeUniform:()=>Na,dayofyear:()=>Eu,debounce:()=>rt,defaultLocale:()=>V$,definition:()=>Xo,densityLogNormal:()=>Aa,densityNormal:()=>ba,densityUniform:()=>Ra,domChild:()=>Ej,domClear:()=>wj,domCreate:()=>Tj,domFind:()=>xj,dotbin:()=>pa,error:()=>ae,expressionFunction:()=>l1,extend:()=>st,extent:()=>ot,extentIndex:()=>at,falsy:()=>me,fastmap:()=>dt,field:()=>ue,flush:()=>ht,font:()=>ij,fontFamily:()=>nj,fontSize:()=>Zz,format:()=>dU,formatLocale:()=>N$,formats:()=>hU,hasOwnProperty:()=>ut,id:()=>ce,identity:()=>de,inferType:()=>rU,inferTypes:()=>sU,ingest:()=>mo,inherits:()=>pt,inrange:()=>ft,interpolate:()=>XM,interpolateColors:()=>GM,interpolateRange:()=>YM,intersect:()=>YY,intersectBoxLine:()=>qV,intersectPath:()=>GV,intersectPoint:()=>HV,intersectRule:()=>XV,isArray:()=>Ee,isBoolean:()=>mt,isDate:()=>gt,isFunction:()=>Ke,isIterable:()=>_t,isNumber:()=>yt,isObject:()=>we,isRegExp:()=>vt,isString:()=>bt,isTuple:()=>ho,key:()=>Tt,lerp:()=>xt,lineHeight:()=>Qz,loader:()=>mU,locale:()=>U$,logger:()=>xe,lruCache:()=>wt,markup:()=>_Y,merge:()=>It,mergeConfig:()=>Ae,multiLineOffset:()=>ej,one:()=>pe,pad:()=>St,panLinear:()=>Pe,panLog:()=>Be,panPow:()=>$e,panSymlog:()=>Ue,parse:()=>c8,parseExpression:()=>Z9,parseSelector:()=>f7,pathCurves:()=>EU,pathEqual:()=>QY,pathParse:()=>AU,pathRectangle:()=>KU,pathRender:()=>PU,pathSymbols:()=>VU,pathTrail:()=>ZU,peek:()=>Oe,point:()=>Aj,projection:()=>tF,quantileLogNormal:()=>Ca,quantileNormal:()=>xa,quantileUniform:()=>Da,quantiles:()=>oa,quantizeInterpolator:()=>HM,quarter:()=>He,quartiles:()=>aa,random:()=>ca,randomInteger:()=>ma,randomKDE:()=>wa,randomLCG:()=>fa,randomLogNormal:()=>Oa,randomMixture:()=>Ma,randomNormal:()=>Ea,randomUniform:()=>Fa,read:()=>fU,regressionExp:()=>za,regressionLinear:()=>Ua,regressionLoess:()=>qa,regressionLog:()=>Va,regressionPoly:()=>Ga,regressionPow:()=>ja,regressionQuad:()=>Ya,renderModule:()=>jY,repeat:()=>At,resetDefaultLocale:()=>z$,resetSVGClipId:()=>hV,resetSVGDefIds:()=>JY,responseType:()=>pU,runtimeContext:()=>P1,sampleCurve:()=>Ja,sampleLogNormal:()=>Ia,sampleNormal:()=>va,sampleUniform:()=>ka,scale:()=>DM,sceneEqual:()=>ZY,sceneFromJSON:()=>_j,scenePickVisit:()=>oz,sceneToJSON:()=>gj,sceneVisit:()=>sz,sceneZOrder:()=>rz,scheme:()=>QM,serializeXML:()=>yY,setRandom:()=>da,span:()=>Ct,splitAccessPath:()=>le,stringValue:()=>Ot,textMetrics:()=>Gz,timeBin:()=>pc,timeFloor:()=>$u,timeFormatLocale:()=>B$,timeInterval:()=>Gu,timeOffset:()=>Xu,timeSequence:()=>Zu,timeUnitSpecifier:()=>bu,timeUnits:()=>yu,toBoolean:()=>Mt,toDate:()=>Rt,toNumber:()=>Me,toSet:()=>Dt,toString:()=>Nt,transform:()=>qo,transforms:()=>Wo,truncate:()=>Ft,truthy:()=>fe,tupleid:()=>po,typeParsers:()=>tU,utcFloor:()=>zu,utcInterval:()=>Hu,utcOffset:()=>qu,utcSequence:()=>Qu,utcdayofyear:()=>Ou,utcquarter:()=>We,utcweek:()=>Mu,version:()=>v7,visitArray:()=>Lt,week:()=>wu,writeConfig:()=>Se,zero:()=>he,zoomLinear:()=>ze,zoomLog:()=>je,zoomPow:()=>Ye,zoomSymlog:()=>Ge});var b={};n.r(b),n.d(b,{compile:()=>Bme,extractTransforms:()=>Ume,normalize:()=>Ile,version:()=>Vme});var T={};n.r(T),n.d(T,{carbong10:()=>zge,carbong100:()=>Yge,carbong90:()=>jge,carbonwhite:()=>Vge,dark:()=>Hme,excel:()=>Xme,fivethirtyeight:()=>Jme,ggplot2:()=>tge,googlecharts:()=>xge,latimes:()=>age,powerbi:()=>Fge,quartz:()=>cge,urbaninstitute:()=>yge,version:()=>Gge,vox:()=>hge});
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2022 Joachim Wester
* MIT licensed
*/
var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=Object.prototype.hasOwnProperty;function w(e,t){return E.call(e,t)}function I(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)w(e,r)&&i.push(r);return i}function A(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function S(e){for(var t,n=0,i=e.length;n<i;){if(!((t=e.charCodeAt(n))>=48&&t<=57))return!1;n++}return!0}function C(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function O(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function M(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(M(e[t]))return!0}else if("object"==typeof e)for(var i=I(e),r=i.length,s=0;s<r;s++)if(M(e[i[s]]))return!0;return!1}function k(e,t){var n=[e];for(var i in t){var r="object"==typeof t[i]?JSON.stringify(t[i],null,2):t[i];void 0!==r&&n.push(i+": "+r)}return n.join("\n")}var R=function(e){function t(t,n,i,r,s){var o=this.constructor,a=e.call(this,k(t,{name:n,index:i,operation:r,tree:s}))||this;return a.name=n,a.index=i,a.operation=r,a.tree=s,Object.setPrototypeOf(a,o.prototype),a.message=k(t,{name:n,index:i,operation:r,tree:s}),a}return x(t,e),t}(Error),N=R,D=A,F={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=P(n,this.path);i&&(i=A(i));var r=B(n,{op:"remove",path:this.from}).removed;return B(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=P(n,this.from);return B(n,{op:"add",path:this.path,value:A(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:j(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},L={add:function(e,t,n){return S(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:F.move,copy:F.copy,test:F.test,_get:F._get};function P(e,t){if(""==t)return e;var n={op:"_get",path:t};return B(e,n),n.value}function B(e,t,n,i,r,s){if(void 0===n&&(n=!1),void 0===i&&(i=!0),void 0===r&&(r=!0),void 0===s&&(s=0),n&&("function"==typeof n?n(t,0,e,t.path):V(t,0)),""===t.path){var o={newDocument:e};if("add"===t.op)return o.newDocument=t.value,o;if("replace"===t.op)return o.newDocument=t.value,o.removed=e,o;if("move"===t.op||"copy"===t.op)return o.newDocument=P(e,t.from),"move"===t.op&&(o.removed=e),o;if("test"===t.op){if(o.test=j(e,t.value),!1===o.test)throw new N("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}if("remove"===t.op)return o.removed=e,o.newDocument=null,o;if("_get"===t.op)return t.value=e,o;if(n)throw new N("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}i||(e=A(e));var a=(t.path||"").split("/"),l=e,u=1,c=a.length,d=void 0,h=void 0,p=void 0;for(p="function"==typeof n?n:V;;){if((h=a[u])&&-1!=h.indexOf("~")&&(h=O(h)),r&&("__proto__"==h||"prototype"==h&&u>0&&"constructor"==a[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===d&&(void 0===l[h]?d=a.slice(0,u).join("/"):u==c-1&&(d=t.path),void 0!==d&&p(t,0,e,d)),u++,Array.isArray(l)){if("-"===h)h=l.length;else{if(n&&!S(h))throw new N("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);S(h)&&(h=~~h)}if(u>=c){if(n&&"add"===t.op&&h>l.length)throw new N("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);if(!1===(o=L[t.op].call(t,l,h,e)).test)throw new N("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(u>=c){if(!1===(o=F[t.op].call(t,l,h,e)).test)throw new N("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&u<c&&(!l||"object"!=typeof l))throw new N("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}function $(e,t,n,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),n&&!Array.isArray(t))throw new N("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=A(e));for(var s=new Array(t.length),o=0,a=t.length;o<a;o++)s[o]=B(e,t[o],n,!0,r,o),e=s[o].newDocument;return s.newDocument=e,s}function U(e,t,n){var i=B(e,t);if(!1===i.test)throw new N("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function V(e,t,n,i){if("object"!=typeof e||null===e||Array.isArray(e))throw new N("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(!F[e.op])throw new N("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n);if("string"!=typeof e.path)throw new N("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new N('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new N("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&M(e.value))throw new N("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new N("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==i)throw new N("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var o=z([{op:"_get",path:e.from,value:void 0}],n);if(o&&"OPERATION_PATH_UNRESOLVABLE"===o.name)throw new N("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function z(e,t,n){try{if(!Array.isArray(e))throw new N("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)$(A(t),A(e),n||!0);else{n=n||V;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(e){if(e instanceof N)return e;throw e}}function j(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var n,i,r,s=Array.isArray(e),o=Array.isArray(t);if(s&&o){if((i=e.length)!=t.length)return!1;for(n=i;0!==n--;)if(!j(e[n],t[n]))return!1;return!0}if(s!=o)return!1;var a=Object.keys(e);if((i=a.length)!==Object.keys(t).length)return!1;for(n=i;0!==n--;)if(!t.hasOwnProperty(a[n]))return!1;for(n=i;0!==n--;)if(!j(e[r=a[n]],t[r]))return!1;return!0}return e!=e&&t!=t}
/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017-2021 Joachim Wester
* MIT license
*/
var Y=new WeakMap,G=function(e){this.observers=new Map,this.obj=e},H=function(e,t){this.callback=e,this.observer=t};function W(e,t){t.unobserve()}function X(e,t){var n,i=function(e){return Y.get(e)}(e);if(i){var r=function(e,t){return e.observers.get(t)}(i,t);n=r&&r.observer}else i=new G(e),Y.set(e,i);if(n)return n;if(n={},i.value=A(e),t){n.callback=t,n.next=null;var s=function(){q(n)},o=function(){clearTimeout(n.next),n.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return n.patches=[],n.object=e,n.unobserve=function(){q(n),clearTimeout(n.next),function(e,t){e.observers.delete(t.callback)}(i,n),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},i.observers.set(t,new H(t,n)),n}function q(e,t){void 0===t&&(t=!1);var n=Y.get(e.object);K(n.value,e.object,e.patches,"",t),e.patches.length&&$(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function K(e,t,n,i,r){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var s=I(t),o=I(e),a=!1,l=o.length-1;l>=0;l--){var u=e[d=o[l]];if(!w(t,d)||void 0===t[d]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+C(d),value:A(u)}),n.push({op:"remove",path:i+"/"+C(d)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}),!0);else{var c=t[d];"object"==typeof u&&null!=u&&"object"==typeof c&&null!=c&&Array.isArray(u)===Array.isArray(c)?K(u,c,n,i+"/"+C(d),r):u!==c&&(r&&n.push({op:"test",path:i+"/"+C(d),value:A(u)}),n.push({op:"replace",path:i+"/"+C(d),value:A(c)}))}}if(a||s.length!=o.length)for(l=0;l<s.length;l++){var d;w(e,d=s[l])||void 0===t[d]||n.push({op:"add",path:i+"/"+C(d),value:A(t[d])})}}}function Z(e,t,n){void 0===n&&(n=!1);var i=[];return K(e,t,i,"",n),i}Object.assign({},i,r,{JsonPatchError:R,deepClone:A,escapePathComponent:C,unescapePathComponent:O});var Q=n(48487),J=n.n(Q),ee=n(99589);function te(e,t,n){return e.fields=t||[],e.fname=n,e}function ne(e){return null==e?null:e.fname}function ie(e){return null==e?null:e.fields}function re(e){return 1===e.length?se(e[0]):oe(e)}const se=e=>function(t){return t[e]},oe=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function ae(e){throw Error(e)}function le(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r),l+=e.substring(++r,++r),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||ae("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&ae("Access path missing closing bracket: "+e),o&&ae("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function ue(e,t,n){const i=le(e);return e=1===i.length?i[0]:e,te((n&&n.get||re)(i),[e],t||e)}const ce=ue("id"),de=te(e=>e,[],"identity"),he=te(()=>0,[],"zero"),pe=te(()=>1,[],"one"),fe=te(()=>!0,[],"true"),me=te(()=>!1,[],"false");function ge(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const _e=0,ye=1,ve=2,be=3,Te=4;function xe(e,t){let n=e||_e;return{level(e){return arguments.length?(n=+e,this):n},error(){return n>=ye&&ge(t||"error","ERROR",arguments),this},warn(){return n>=ve&&ge(t||"warn","WARN",arguments),this},info(){return n>=be&&ge(t||"log","INFO",arguments),this},debug(){return n>=Te&&ge(t||"log","DEBUG",arguments),this}}}var Ee=Array.isArray;function we(e){return e===Object(e)}const Ie=e=>"__proto__"!==e;function Ae(...e){return e.reduce((e,t)=>{for(const n in t)if("signals"===n)e.signals=Ce(e.signals,t.signals);else{const i="legend"===n?{layout:1}:"style"===n||null;Se(e,n,t[n],i)}return e},{})}function Se(e,t,n,i){if(!Ie(t))return;let r,s;if(we(n)&&!Ee(n))for(r in s=we(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[r])?Se(s,r,n[r]):Ie(r)&&(s[r]=n[r]);else e[t]=n}function Ce(e,t){if(null==e)return t;const n={},i=[];function r(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(r),e.forEach(r),i}function Oe(e){return e[e.length-1]}function Me(e){return null==e||""===e?null:+e}const ke=e=>t=>e*Math.exp(t),Re=e=>t=>Math.log(e*t),Ne=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),De=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Fe=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Le(e,t,n,i){const r=n(e[0]),s=n(Oe(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function Pe(e,t){return Le(e,t,Me,de)}function Be(e,t){var n=Math.sign(e[0]);return Le(e,t,Re(n),ke(n))}function $e(e,t,n){return Le(e,t,Fe(n),Fe(1/n))}function Ue(e,t,n){return Le(e,t,Ne(n),De(n))}function Ve(e,t,n,i,r){const s=i(e[0]),o=i(Oe(e)),a=null!=t?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function ze(e,t,n){return Ve(e,t,n,Me,de)}function je(e,t,n){const i=Math.sign(e[0]);return Ve(e,t,n,Re(i),ke(i))}function Ye(e,t,n,i){return Ve(e,t,n,Fe(i),Fe(1/i))}function Ge(e,t,n,i){return Ve(e,t,n,Ne(i),De(i))}function He(e){return 1+~~(new Date(e).getMonth()/3)}function We(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Xe(e){return null!=e?Ee(e)?e:[e]:[]}function qe(e,t,n){let i,r=e[0],s=e[1];return s<r&&(i=s,s=r,r=i),i=s-r,i>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-i),r+i]}function Ke(e){return"function"==typeof e}const Ze="descending";function Qe(e,t,n){n=n||{},t=Xe(t)||[];const i=[],r=[],s={},o=n.comparator||et;return Xe(e).forEach((e,o)=>{null!=e&&(i.push(t[o]===Ze?-1:1),r.push(e=Ke(e)?e:ue(e,null,n)),(ie(e)||[]).forEach(e=>s[e]=1))}),0===r.length?null:te(o(r,i),Object.keys(s))}const Je=(e,t)=>(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),et=(e,t)=>1===e.length?tt(e[0],t[0]):nt(e,t,e.length),tt=(e,t)=>function(n,i){return Je(e(n),e(i))*t},nt=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;0===o&&++a<n;)s=e[a],o=Je(s(i),s(r));return o*t[a]});function it(e){return Ke(e)?e:()=>e}function rt(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function st(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function ot(e,t){let n,i,r,s,o=0;if(e&&(n=e.length))if(null==t){for(i=e[o];o<n&&(null==i||i!=i);i=e[++o]);for(r=s=i;o<n;++o)i=e[o],null!=i&&(i<r&&(r=i),i>s&&(s=i))}else{for(i=t(e[o]);o<n&&(null==i||i!=i);i=t(e[++o]));for(r=s=i;o<n;++o)i=t(e[o]),null!=i&&(i<r&&(r=i),i>s&&(s=i))}return[r,s]}function at(e,t){const n=e.length;let i,r,s,o,a,l=-1;if(null==t){for(;++l<n;)if(r=e[l],null!=r&&r>=r){i=s=r;break}if(l===n)return[-1,-1];for(o=a=l;++l<n;)r=e[l],null!=r&&(i>r&&(i=r,o=l),s<r&&(s=r,a=l))}else{for(;++l<n;)if(r=t(e[l],l,e),null!=r&&r>=r){i=s=r;break}if(l===n)return[-1,-1];for(o=a=l;++l<n;)r=t(e[l],l,e),null!=r&&(i>r&&(i=r,o=l),s<r&&(s=r,a=l))}return[o,a]}const lt=Object.prototype.hasOwnProperty;function ut(e,t){return lt.call(e,t)}const ct={};function dt(e){let t,n={};function i(e){return ut(n,e)&&n[e]!==ct}const r={size:0,empty:0,object:n,has:i,get:e=>i(e)?n[e]:void 0,set(e,t){return i(e)||(++r.size,n[e]===ct&&--r.empty),n[e]=t,this},delete(e){return i(e)&&(--r.size,++r.empty,n[e]=ct),this},clear(){r.size=r.empty=0,r.object=n={}},test(e){return arguments.length?(t=e,r):t},clean(){const e={};let i=0;for(const r in n){const s=n[r];s===ct||t&&t(s)||(e[r]=s,++i)}r.size=i,r.empty=0,r.object=n=e}};return e&&Object.keys(e).forEach(t=>{r.set(t,e[t])}),r}function ht(e,t,n,i,r,s){if(!n&&0!==n)return s;const o=+n;let a,l=e[0],u=Oe(e);u<l&&(a=l,l=u,u=a),a=Math.abs(t-l);const c=Math.abs(u-t);return a<c&&a<=o?i:c<=o?r:s}function pt(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),st(i,n)}function ft(e,t,n,i){let r,s=t[0],o=t[t.length-1];return s>o&&(r=s,s=o,o=r),i=void 0===i||i,((n=void 0===n||n)?s<=e:s<e)&&(i?e<=o:e<o)}function mt(e){return"boolean"==typeof e}function gt(e){return"[object Date]"===Object.prototype.toString.call(e)}function _t(e){return e&&Ke(e[Symbol.iterator])}function yt(e){return"number"==typeof e}function vt(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function bt(e){return"string"==typeof e}function Tt(e,t,n){e&&(e=t?Xe(e).map(e=>e.replace(/\\(.)/g,"$1")):Xe(e));const i=e&&e.length,r=n&&n.get||re,s=e=>r(t?[e]:le(e));let o;if(i)if(1===i){const t=s(e[0]);o=function(e){return""+t(e)}}else{const t=e.map(s);o=function(e){let n=""+t[0](e),r=0;for(;++r<i;)n+="|"+t[r](e);return n}}else o=function(){return""};return te(o,e,"key")}function xt(e,t){const n=e[0],i=Oe(e),r=+t;return r?1===r?i:n+r*(i-n):n}const Et=1e4;function wt(e){let t,n,i;e=+e||Et;const r=()=>{t={},n={},i=0},s=(r,s)=>(++i>e&&(n=t,t={},i=1),t[r]=s);return r(),{clear:r,has:e=>ut(t,e)||ut(n,e),get:e=>ut(t,e)?t[e]:ut(n,e)?s(e,n[e]):void 0,set:(e,n)=>ut(t,e)?t[e]=n:s(e,n)}}function It(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,l=0,u=0;for(;a<r&&l<s;++u)o[u]=e(t[a],n[l])>0?n[l++]:t[a++];for(;a<r;++a,++u)o[u]=t[a];for(;l<s;++l,++u)o[u]=n[l];return o}function At(e,t){let n="";for(;--t>=0;)n+=e;return n}function St(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:"left"===i?At(r,o)+s:"center"===i?At(r,~~(o/2))+s+At(r,Math.ceil(o/2)):s+At(r,o)}function Ct(e){return e&&Oe(e)-e[0]||0}function Ot(e){return Ee(e)?"["+e.map(Ot)+"]":we(e)||bt(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function Mt(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}const kt=e=>yt(e)||gt(e)?e:Date.parse(e);function Rt(e,t){return t=t||kt,null==e||""===e?null:t(e)}function Nt(e){return null==e||""===e?null:e+""}function Dt(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function Ft(e,t,n,i){const r=null!=i?i:"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:"left"===n?r+s.slice(o-a):"center"===n?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}function Lt(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const i=t(e[r]);i&&n(i,r,e)}}else e.forEach(n)}function Pt(e,t,n){return e.fields=t||[],e.fname=n,e}function Bt(e){return 1===e.length?$t(e[0]):Ut(e)}const $t=e=>function(t){return t[e]},Ut=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Vt(e){throw Error(e)}function zt(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||Vt("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&Vt("Access path missing closing bracket: "+e),o&&Vt("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function jt(e,t,n){const i=zt(e);return e=1===i.length?i[0]:e,Pt((n&&n.get||Bt)(i),[e],t||e)}const Yt=jt("id"),Gt=Pt(e=>e,[],"identity"),Ht=(Pt(()=>0,[],"zero"),Pt(()=>1,[],"one"),Pt(()=>!0,[],"true"));Pt(()=>!1,[],"false");function Wt(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Xt=0,qt=1,Kt=2,Zt=3,Qt=4;var Jt=Array.isArray;function en(e){return e===Object(e)}function tn(e){return null==e||""===e?null:+e}function nn(e){return null!=e?Jt(e)?e:[e]:[]}function rn(e){return"function"==typeof e}function sn(e){return rn(e)?e:()=>e}function on(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function an(e,t){return Object.hasOwn(e,t)}function ln(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),on(i,n)}function un(e){return"string"==typeof e}function cn(e){return Jt(e)?"["+e.map(cn)+"]":en(e)||un(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}const dn=e=>function(e){return"number"==typeof e}(e)||function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e:Date.parse(e);function hn(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const i=t(e[r]);i&&n(i,r,e)}}else e.forEach(n)}var pn={},fn={};function mn(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'}).join(",")+"}")}function gn(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var i in e)i in t||n.push(t[i]=i)}),n}function _n(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function yn(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function(e){return e<0?"-"+_n(-e,6):e>9999?"+"+_n(e,6):_n(e,4)}(e.getUTCFullYear())+"-"+_n(e.getUTCMonth()+1,2)+"-"+_n(e.getUTCDate(),2)+(r?"T"+_n(t,2)+":"+_n(n,2)+":"+_n(i,2)+"."+_n(r,3)+"Z":i?"T"+_n(t,2)+":"+_n(n,2)+":"+_n(i,2)+"Z":n||t?"T"+_n(t,2)+":"+_n(n,2)+"Z":"")}function vn(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],s=e.length,o=0,a=0,l=s<=0,u=!1;function c(){if(l)return fn;if(u)return u=!1,pn;var t,i,r=o;if(34===e.charCodeAt(r)){for(;o++<s&&34!==e.charCodeAt(o)||34===e.charCodeAt(++o););return(t=o)>=s?l=!0:10===(i=e.charCodeAt(o++))?u=!0:13===i&&(u=!0,10===e.charCodeAt(o)&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o<s;){if(10===(i=e.charCodeAt(t=o++)))u=!0;else if(13===i)u=!0,10===e.charCodeAt(o)&&++o;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,s)}for(10===e.charCodeAt(s-1)&&--s,13===e.charCodeAt(s-1)&&--s;(i=c())!==fn;){for(var d=[];i!==pn&&i!==fn;)d.push(i),i=c();t&&null==(d=t(d,a++))||r.push(d)}return r}function r(t,n){return t.map(function(t){return n.map(function(e){return o(t[e])}).join(e)})}function s(t){return t.map(o).join(e)}function o(e){return null==e?"":e instanceof Date?yn(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,r,s=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?function(e,t){var n=mn(e);return function(i,r){return t(n(i),r,e)}}(e,t):mn(e)});return s.columns=r||[],s},parseRows:i,format:function(t,n){return null==n&&(n=gn(t)),[n.map(o).join(e)].concat(r(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=gn(e)),r(e,t).join("\n")},formatRows:function(e){return e.map(s).join("\n")},formatRow:s,formatValue:o}}function bn(e){return e}function Tn(e,t){return"string"==typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return xn(e,t)})}:xn(e,t)}function xn(e,t){var n=t.id,i=t.bbox,r=null==t.properties?{}:t.properties,s=En(e,t);return null==n&&null==i?{type:"Feature",properties:r,geometry:s}:null==i?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function En(e,t){var n=function(e){if(null==e)return bn;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],o=e.translate[1];return function(e,a){a||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*i+s,c[1]=(n+=e[1])*r+o;l<u;)c[l]=e[l],++l;return c}}(e.transform),i=e.arcs;function r(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],s=0,o=r.length;s<o;++s)t.push(n(r[s],s));e<0&&function(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}(t,o)}function s(e){return n(e)}function o(e){for(var t=[],n=0,i=e.length;n<i;++n)r(e[n],t);return t.length<2&&t.push(t[0]),t}function a(e){for(var t=o(e);t.length<4;)t.push(t[0]);return t}function l(e){return e.map(a)}return function e(t){var n,i=t.type;switch(i){case"GeometryCollection":return{type:i,geometries:t.geometries.map(e)};case"Point":n=s(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(s);break;case"LineString":n=o(t.arcs);break;case"MultiLineString":n=t.arcs.map(o);break;case"Polygon":n=l(t.arcs);break;case"MultiPolygon":n=t.arcs.map(l);break;default:return null}return{type:i,coordinates:n}}(t)}function wn(e,t){var n={},i={},r={},s=[],o=-1;function a(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}return t.forEach(function(n,i){var r,s=e.arcs[n<0?~n:n];s.length<3&&!s[1][0]&&!s[1][1]&&(r=t[++o],t[o]=n,t[i]=r)}),t.forEach(function(t){var n,s,o=function(t){var n,i=e.arcs[t<0?~t:t],r=i[0];e.transform?(n=[0,0],i.forEach(function(e){n[0]+=e[0],n[1]+=e[1]})):n=i[i.length-1];return t<0?[n,r]:[r,n]}(t),a=o[0],l=o[1];if(n=r[a])if(delete r[n.end],n.push(t),n.end=l,s=i[l]){delete i[s.start];var u=s===n?n:n.concat(s);i[u.start=n.start]=r[u.end=s.end]=u}else i[n.start]=r[n.end]=n;else if(n=i[l])if(delete i[n.start],n.unshift(t),n.start=a,s=r[a]){delete r[s.end];var c=s===n?n:s.concat(n);i[c.start=s.start]=r[c.end=n.end]=c}else i[n.start]=r[n.end]=n;else i[(n=[t]).start=a]=r[n.end=l]=n}),a(r,i),a(i,r),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function In(e){return En(e,An.apply(this,arguments))}function An(e,t,n){var i,r,s;if(arguments.length>1)i=function(e,t,n){var i,r=[],s=[];function o(e){var t=e<0?~e:e;(s[t]||(s[t]=[])).push({i:e,g:i})}function a(e){e.forEach(o)}function l(e){e.forEach(a)}function u(e){e.forEach(l)}function c(e){switch(i=e,e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"LineString":a(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":u(e.arcs)}}return c(t),s.forEach(null==n?function(e){r.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&r.push(e[0].i)}),r}(0,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:wn(e,i)}}const Sn=Math.sqrt(50),Cn=Math.sqrt(10),On=Math.sqrt(2);function Mn(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=Sn?10:s>=Cn?5:s>=On?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?Mn(e,t,2*n):[a,l,u]}function kn(e,t,n){return Mn(e=+e,t=+t,n=+n)[2]}var Rn,Nn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Dn(e){if(!(t=Nn.exec(e)))throw new Error("invalid format: "+e);var t;return new Fn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Fn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ln(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Pn(e){return(e=Ln(Math.abs(e)))?e[1]:NaN}function Bn(e,t){var n=Ln(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}Dn.prototype=Fn.prototype,Fn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const $n={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Bn(100*e,t),r:Bn,s:function(e,t){var n=Ln(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Rn=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Ln(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Un(e){return e}var Vn,zn,jn,Yn=Array.prototype.map,Gn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Hn(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?Un:(t=Yn.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,s=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[o=(o+1)%t.length];return s.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Un:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Yn.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=Dn(e)).fill,n=e.align,d=e.sign,h=e.symbol,p=e.zero,f=e.width,m=e.comma,g=e.precision,_=e.trim,y=e.type;"n"===y?(m=!0,y="g"):$n[y]||(void 0===g&&(g=12),_=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var v="$"===h?r:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===h?s:/[%p]/.test(y)?l:"",T=$n[y],x=/[defgprs%]/.test(y);function E(e){var r,s,l,h=v,E=b;if("c"===y)E=T(e)+E,e="";else{var w=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:T(Math.abs(e),g),_&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),w&&0===+e&&"+"!==d&&(w=!1),h=(w?"("===d?d:u:"-"===d||"("===d?"":d)+h,E=("s"===y?Gn[8+Rn/3]:"")+E+(w&&"("===d?")":""),x)for(r=-1,s=e.length;++r<s;)if(48>(l=e.charCodeAt(r))||l>57){E=(46===l?o+e.slice(r+1):e.slice(r))+E,e=e.slice(0,r);break}}m&&!p&&(e=i(e,1/0));var I=h.length+e.length+E.length,A=I<f?new Array(f-I+1).join(t):"";switch(m&&p&&(e=i(A+e,A.length?f-E.length:1/0),A=""),n){case"<":e=h+e+E+A;break;case"=":e=h+A+e+E;break;case"^":e=A.slice(0,I=A.length>>1)+h+e+E+A.slice(I);break;default:e=A+h+e+E}return a(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=d(((e=Dn(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Pn(t)/3))),r=Math.pow(10,-i),s=Gn[8+i/3];return function(e){return n(r*e)+s}}}}!function(e){Vn=Hn(e),zn=Vn.format,jn=Vn.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Wn=new Date,Xn=new Date;function qn(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,s)=>{const o=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return o;let a;do{o.push(a=new Date(+n)),t(n,s),e(n)}while(a<n&&n<i);return o},r.filter=n=>qn(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(r.count=(t,i)=>(Wn.setTime(+t),Xn.setTime(+i),e(Wn),e(Xn),Math.floor(n(Wn,Xn))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const Kn=1e3,Zn=6e4,Qn=36e5,Jn=864e5,ei=6048e5,ti=qn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zn)/Jn,e=>e.getDate()-1),ni=(ti.range,qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jn,e=>e.getUTCDate()-1)),ii=(ni.range,qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Jn,e=>Math.floor(e/Jn)));ii.range;function ri(e){return qn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zn)/ei)}const si=ri(0),oi=ri(1),ai=ri(2),li=ri(3),ui=ri(4),ci=ri(5),di=ri(6);si.range,oi.range,ai.range,li.range,ui.range,ci.range,di.range;function hi(e){return qn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/ei)}const pi=hi(0),fi=hi(1),mi=hi(2),gi=hi(3),_i=hi(4),yi=hi(5),vi=hi(6),bi=(pi.range,fi.range,mi.range,gi.range,_i.range,yi.range,vi.range,qn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()));bi.every=e=>isFinite(e=Math.floor(e))&&e>0?qn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;bi.range;const Ti=qn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ti.every=e=>isFinite(e=Math.floor(e))&&e>0?qn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;Ti.range;const xi=qn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),Ei=(xi.range,qn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth())),wi=(Ei.range,qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kn-e.getMinutes()*Zn)},(e,t)=>{e.setTime(+e+t*Qn)},(e,t)=>(t-e)/Qn,e=>e.getHours())),Ii=(wi.range,qn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Qn)},(e,t)=>(t-e)/Qn,e=>e.getUTCHours())),Ai=(Ii.range,qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Kn)},(e,t)=>{e.setTime(+e+t*Zn)},(e,t)=>(t-e)/Zn,e=>e.getMinutes())),Si=(Ai.range,qn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zn)},(e,t)=>(t-e)/Zn,e=>e.getUTCMinutes())),Ci=(Si.range,qn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Kn)},(e,t)=>(t-e)/Kn,e=>e.getUTCSeconds())),Oi=(Ci.range,qn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e));Oi.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?qn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Oi:null);Oi.range;const Mi="year",ki="quarter",Ri="month",Ni="week",Di="date",Fi="day",Li="dayofyear",Pi="hours",Bi="minutes",$i="seconds",Ui="milliseconds";[Mi,ki,Ri,Ni,Di,Fi,Li,Pi,Bi,$i,Ui].reduce((e,t,n)=>(e[t]=1+n,e),{});new Date;const Vi={[Mi]:bi,[ki]:xi.every(3),[Ri]:xi,[Ni]:si,[Di]:ti,[Fi]:ti,[Li]:ti,[Pi]:wi,[Bi]:Ai,[$i]:Ci,[Ui]:Oi},zi={[Mi]:Ti,[ki]:Ei.every(3),[Ri]:Ei,[Ni]:pi,[Di]:ni,[Fi]:ni,[Li]:ni,[Pi]:Ii,[Bi]:Si,[$i]:Ci,[Ui]:Oi};function ji(e){return Vi[e]}function Yi(e){return zi[e]}const Gi=[Mi,Ri,Di,Pi,Bi,$i,Ui],Hi=Gi.slice(0,-1),Wi=Hi.slice(0,-1),Xi=Wi.slice(0,-1);Xi.slice(0,-1);function qi(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Ki(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Zi(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Qi(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,l=e.shortMonths,u=cr(r),c=dr(r),d=cr(s),h=dr(s),p=cr(o),f=dr(o),m=cr(a),g=dr(a),_=cr(l),y=dr(l),v={a:function(e){return o[e.getDay()]},A:function(e){return s[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:Rr,e:Rr,f:Pr,g:Xr,G:Kr,H:Nr,I:Dr,j:Fr,L:Lr,m:Br,M:$r,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:vs,s:bs,S:Ur,u:Vr,U:zr,V:Yr,w:Gr,W:Hr,x:null,X:null,y:Wr,Y:qr,Z:Zr,"%":ys},b={a:function(e){return o[e.getUTCDay()]},A:function(e){return s[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Qr,e:Qr,f:is,g:fs,G:gs,H:Jr,I:es,j:ts,L:ns,m:rs,M:ss,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:vs,s:bs,S:os,u:as,U:ls,V:cs,w:ds,W:hs,x:null,X:null,y:ps,Y:ms,Z:_s,"%":ys},T={a:function(e,t,n){var i=p.exec(t.slice(n));return i?(e.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=d.exec(t.slice(n));return i?(e.w=h.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=_.exec(t.slice(n));return i?(e.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return w(e,t,n,i)},d:xr,e:xr,f:Cr,g:yr,G:_r,H:wr,I:wr,j:Er,L:Sr,m:Tr,M:Ir,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:br,Q:Mr,s:kr,S:Ar,u:pr,U:fr,V:mr,w:hr,W:gr,x:function(e,t,i){return w(e,n,t,i)},X:function(e,t,n){return w(e,i,t,n)},y:yr,Y:_r,Z:vr,"%":Or};function x(e,t){return function(n){var i,r,s,o=[],a=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===e.charCodeAt(a)&&(o.push(e.slice(l,a)),null!=(r=rr[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(s=t[i])&&(i=s(n,r)),o.push(i),l=a+1);return o.push(e.slice(l,a)),o.join("")}}function E(e,t){return function(n){var i,r,s=Zi(1900,void 0,1);if(w(s,e,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(t&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=Ki(Zi(s.y,0,1))).getUTCDay(),i=r>4||0===r?fi.ceil(i):fi(i),i=ni.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=qi(Zi(s.y,0,1))).getDay(),i=r>4||0===r?oi.ceil(i):oi(i),i=ti.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?Ki(Zi(s.y,0,1)).getUTCDay():qi(Zi(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,Ki(s)):qi(s)}}function w(e,t,n,i){for(var r,s,o=0,a=t.length,l=n.length;o<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(s=T[r in rr?t.charAt(o++):r])||(i=s(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=x(n,v),v.X=x(i,v),v.c=x(t,v),b.x=x(n,b),b.X=x(i,b),b.c=x(t,b),{format:function(e){var t=x(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}var Ji,er,tr,nr,ir,rr={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,or=/^%/,ar=/[\\^$*+?|[\]().{}]/g;function lr(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function ur(e){return e.replace(ar,"\\$&")}function cr(e){return new RegExp("^(?:"+e.map(ur).join("|")+")","i")}function dr(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function hr(e,t,n){var i=sr.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function pr(e,t,n){var i=sr.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function fr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function mr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function gr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function _r(e,t,n){var i=sr.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function yr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function vr(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function br(e,t,n){var i=sr.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Tr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function xr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Er(e,t,n){var i=sr.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function wr(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Ir(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Ar(e,t,n){var i=sr.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Sr(e,t,n){var i=sr.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Cr(e,t,n){var i=sr.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Or(e,t,n){var i=or.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Mr(e,t,n){var i=sr.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function kr(e,t,n){var i=sr.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Rr(e,t){return lr(e.getDate(),t,2)}function Nr(e,t){return lr(e.getHours(),t,2)}function Dr(e,t){return lr(e.getHours()%12||12,t,2)}function Fr(e,t){return lr(1+ti.count(bi(e),e),t,3)}function Lr(e,t){return lr(e.getMilliseconds(),t,3)}function Pr(e,t){return Lr(e,t)+"000"}function Br(e,t){return lr(e.getMonth()+1,t,2)}function $r(e,t){return lr(e.getMinutes(),t,2)}function Ur(e,t){return lr(e.getSeconds(),t,2)}function Vr(e){var t=e.getDay();return 0===t?7:t}function zr(e,t){return lr(si.count(bi(e)-1,e),t,2)}function jr(e){var t=e.getDay();return t>=4||0===t?ui(e):ui.ceil(e)}function Yr(e,t){return e=jr(e),lr(ui.count(bi(e),e)+(4===bi(e).getDay()),t,2)}function Gr(e){return e.getDay()}function Hr(e,t){return lr(oi.count(bi(e)-1,e),t,2)}function Wr(e,t){return lr(e.getFullYear()%100,t,2)}function Xr(e,t){return lr((e=jr(e)).getFullYear()%100,t,2)}function qr(e,t){return lr(e.getFullYear()%1e4,t,4)}function Kr(e,t){var n=e.getDay();return lr((e=n>=4||0===n?ui(e):ui.ceil(e)).getFullYear()%1e4,t,4)}function Zr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lr(t/60|0,"0",2)+lr(t%60,"0",2)}function Qr(e,t){return lr(e.getUTCDate(),t,2)}function Jr(e,t){return lr(e.getUTCHours(),t,2)}function es(e,t){return lr(e.getUTCHours()%12||12,t,2)}function ts(e,t){return lr(1+ni.count(Ti(e),e),t,3)}function ns(e,t){return lr(e.getUTCMilliseconds(),t,3)}function is(e,t){return ns(e,t)+"000"}function rs(e,t){return lr(e.getUTCMonth()+1,t,2)}function ss(e,t){return lr(e.getUTCMinutes(),t,2)}function os(e,t){return lr(e.getUTCSeconds(),t,2)}function as(e){var t=e.getUTCDay();return 0===t?7:t}function ls(e,t){return lr(pi.count(Ti(e)-1,e),t,2)}function us(e){var t=e.getUTCDay();return t>=4||0===t?_i(e):_i.ceil(e)}function cs(e,t){return e=us(e),lr(_i.count(Ti(e),e)+(4===Ti(e).getUTCDay()),t,2)}function ds(e){return e.getUTCDay()}function hs(e,t){return lr(fi.count(Ti(e)-1,e),t,2)}function ps(e,t){return lr(e.getUTCFullYear()%100,t,2)}function fs(e,t){return lr((e=us(e)).getUTCFullYear()%100,t,2)}function ms(e,t){return lr(e.getUTCFullYear()%1e4,t,4)}function gs(e,t){var n=e.getUTCDay();return lr((e=n>=4||0===n?_i(e):_i.ceil(e)).getUTCFullYear()%1e4,t,4)}function _s(){return"+0000"}function ys(){return"%"}function vs(e){return+e}function bs(e){return Math.floor(+e/1e3)}function Ts(e){const t={};return n=>t[n]||(t[n]=e(n))}function xs(e){const t=Ts(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=Dn(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=function(e,t){let n,i=e.lastIndexOf("e");if(i>0)return i;for(i=e.length;--i>t;)if(n=e.charCodeAt(i),n>=48&&n<=57)return i+1}(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if("0"!==i[s]){++s;break}return i.slice(0,s)+o}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,i,r,s){s=Dn(null==s?",f":s);const o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?kn(t,e,n):kn(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,i,r),a=Math.max(Math.abs(e),Math.abs(i));let l;if(null==s.precision)switch(s.type){case"s":return isNaN(l=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Pn(t)/3)))-Pn(Math.abs(e)))}(o,a))||(s.precision=l),n(s,a);case"":case"e":case"g":case"p":case"r":isNaN(l=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pn(t)-Pn(e))+1}(o,a))||(s.precision=l-("e"===s.type));break;case"f":case"%":isNaN(l=function(e){return Math.max(0,-Pn(Math.abs(e)))}(o))||(s.precision=l-2*("%"===s.type))}return t(s)}}}let Es,ws;function Is(){return Es=xs({format:zn,formatPrefix:jn})}function As(e){return xs(Hn(e))}function Ss(e){return arguments.length?Es=As(e):Es}function Cs(e,t,n){en(n=n||{})||Vt(`Invalid time multi-format specifier: ${n}`);const i=t($i),r=t(Bi),s=t(Pi),o=t(Di),a=t(Ni),l=t(Ri),u=t(ki),c=t(Mi),d=e(n[Ui]||".%L"),h=e(n[$i]||":%S"),p=e(n[Bi]||"%I:%M"),f=e(n[Pi]||"%I %p"),m=e(n[Di]||n[Fi]||"%a %d"),g=e(n[Ni]||"%b %d"),_=e(n[Ri]||"%B"),y=e(n[ki]||"%B"),v=e(n[Mi]||"%Y");return e=>(i(e)<e?d:r(e)<e?h:s(e)<e?p:o(e)<e?f:l(e)<e?a(e)<e?m:g:c(e)<e?u(e)<e?_:y:v)(e)}function Os(e){const t=Ts(e.format),n=Ts(e.utcFormat);return{timeFormat:e=>un(e)?t(e):Cs(t,ji,e),utcFormat:e=>un(e)?n(e):Cs(n,Yi,e),timeParse:Ts(e.parse),utcParse:Ts(e.utcParse)}}function Ms(){return ws=Os({format:er,parse:tr,utcFormat:nr,utcParse:ir})}function ks(e){return Os(Qi(e))}function Rs(e){return arguments.length?ws=ks(e):ws}!function(e){Ji=Qi(e),er=Ji.format,tr=Ji.parse,nr=Ji.utcFormat,ir=Ji.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Is(),Ms();const Ns=(e,t)=>on({},e,t);function Ds(e,t){const n=arguments.length;return n&&2!==n&&Vt("defaultLocale expects either zero or two arguments."),n?Ns(Ss(e),Rs(t)):Ns(Ss(),Rs())}const Fs=/^(data:|([A-Za-z]+:)?\/\/)/,Ls=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ps=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Bs="file://";async function $s(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Us(e,t){t=on({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=Ls.test(e.replace(Ps,""));null!=e&&"string"==typeof e&&a||Vt("Sanitize failure, invalid URI: "+cn(e));const l=Fs.test(e);return(o=t.baseURL)&&!l&&(e.startsWith("/")||o.endsWith("/")||(e="/"+e),e=o+e),s=(r=e.startsWith(Bs))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function Vs(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(e,t)=>{e?i(e):n(t)})}):zs}async function zs(){Vt("No file system access.")}function js(e){return e?async function(t,n){const i=on({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?rn(s[r])?s[r]():s.text():Vt(s.status+""+s.statusText)}:Ys}async function Ys(){Vt("No HTTP fetch method available.")}const Gs=e=>null!=e&&e==e,Hs=e=>!(Number.isNaN(+e)||e instanceof Date),Ws={boolean:function(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e},integer:tn,number:tn,date:function(e,t){return t=t||dn,null==e||""===e?null:t(e)},string:function(e){return null==e||""===e?null:e+""},unknown:Gt},Xs=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>Hs(e)&&Number.isInteger(+e),Hs,e=>!Number.isNaN(Date.parse(e))],qs=["boolean","integer","number","date"];function Ks(e,t){return t.reduce((t,n)=>(t[n]=function(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Xs.length,r=Xs.map((e,t)=>t+1);for(let s,o,a=0,l=0;a<n;++a)for(o=t?e[a][t]:e[a],s=0;s<i;++s)if(r[s]&&Gs(o)&&!Xs[s](o)&&(r[s]=0,++l,l===Xs.length))return"string";return qs[r.reduce((e,t)=>0===e?t:e,0)-1]}(e,n),t),{})}function Zs(e){const t=function(t,n){const i={delimiter:e};return Qs(t,n?on(n,i):i)};return t.responseType="text",t}function Qs(e,t){return t.header&&(e=t.header.map(cn).join(t.delimiter)+"\n"+e),vn(t.delimiter).parse(e+"")}function Js(e,t){const n=t&&t.property?jt(t.property):Gt;return!en(e)||(i=e,"function"==typeof Buffer&&rn(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!Jt(e)&&function(e){return e&&rn(e[Symbol.iterator])}(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}Qs.responseType="text",Js.responseType="json";const eo={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function to(e,t){let n,i,r,s;return e=Js(e,t),t&&t.feature?(n=Tn,r=t.feature):t&&t.mesh?(n=In,r=t.mesh,s=eo[t.filter]):Vt("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):Vt("Invalid TopoJSON object: "+r),i&&i.features||[i]}to.responseType="json";const no={dsv:Qs,csv:Zs(","),tsv:Zs("\t"),json:Js,topojson:to};function io(e,t){return arguments.length>1?(no[e]=t,this):an(no,e)?no[e]:null}function ro(e){const t=io(e);return t&&t.responseType||"text"}function so(e,t,n,i){const r=io((t=t||{}).type||"json");return r||Vt("Unknown data format type: "+t.type),e=r(e,t),t.parse&&function(e,t,n,i){if(!e.length)return;const r=Rs();n=n||r.timeParse,i=i||r.utcParse;let s,o,a,l,u,c,d=e.columns||Object.keys(e[0]);"auto"===t&&(t=Ks(e,d));d=Object.keys(t);const h=d.map(e=>{const r=t[e];let s,o;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){s=r.split(/:(.+)?/,2),o=s[1],("'"===o[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1));return("utc"===s[0]?i:n)(o)}if(!Ws[r])throw Error("Illegal format pattern: "+e+":"+r);return Ws[r]});for(a=0,u=e.length,c=d.length;a<u;++a)for(s=e[a],l=0;l<c;++l)o=d[l],s[o]=h[l](s[o])}(e,t.parse,n,i),an(e,"columns")&&delete e.columns,e}const oo=function(e,t){return n=>({options:n||{},sanitize:Us,load:$s,fileAccess:!1,file:Vs(t),http:js(e)})}("undefined"!=typeof fetch&&fetch,null);function ao(e){const t=e||Gt,n=[],i={};return n.add=e=>{const r=t(e);return i[r]||(i[r]=1,n.push(e)),n},n.remove=e=>{const r=t(e);if(i[r]){i[r]=0;const t=n.indexOf(e);t>=0&&n.splice(t,1)}return n},n}async function lo(e,t){try{await t(e)}catch(t){e.error(t)}}const uo=Symbol("vega_id");let co=1;function ho(e){return!(!e||!po(e))}function po(e){return e[uo]}function fo(e,t){return e[uo]=t,e}function mo(e){const t=e===Object(e)?e:{data:e};return po(t)?t:fo(t,co++)}function go(e){return _o(e,mo({}))}function _o(e,t){for(const n in e)t[n]=e[n];return t}function yo(e,t){return fo(t,po(e))}function vo(e,t){return e?t?(n,i)=>e(n,i)||po(t(n))-po(t(i)):(t,n)=>e(t,n)||po(t)-po(n):null}function bo(e){return e&&e.constructor===To}function To(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:To,insert(t){const n=nn(t),i=n.length;for(let t=0;t<i;++t)e.push(n[t]);return this},remove(e){const n=rn(e)?i:t,r=nn(e),s=r.length;for(let e=0;e<s;++e)n.push(r[e]);return this},modify(e,t,i){const s={field:t,value:sn(i)};return rn(e)?(s.filter=e,r.push(s)):(s.tuple=e,n.push(s)),this},encode(e,t){return rn(e)?r.push({filter:e,field:t}):n.push({tuple:e,field:t}),this},clean(e){return s=e,this},reflow(){return o=!0,this},pulse(a,l){const u={},c={};let d,h,p,f,m,g;for(d=0,h=l.length;d<h;++d)u[po(l[d])]=1;for(d=0,h=t.length;d<h;++d)m=t[d],u[po(m)]=-1;for(d=0,h=i.length;d<h;++d)f=i[d],l.forEach(e=>{f(e)&&(u[po(e)]=-1)});for(d=0,h=e.length;d<h;++d)m=e[d],g=po(m),u[g]?u[g]=1:a.add.push(mo(e[d]));for(d=0,h=l.length;d<h;++d)m=l[d],u[po(m)]<0&&a.rem.push(m);function _(e,t,n){n?e[t]=n(e):a.encode=t,o||(c[po(e)]=e)}for(d=0,h=n.length;d<h;++d)p=n[d],m=p.tuple,f=p.field,g=u[po(m)],g>0&&(_(m,f,p.value),a.modifies(f));for(d=0,h=r.length;d<h;++d)p=r[d],f=p.filter,l.forEach(e=>{f(e)&&u[po(e)]>0&&_(e,p.field,p.value)}),a.modifies(p.field);if(o)a.mod=t.length||i.length?l.filter(e=>u[po(e)]>0):l.slice();else for(g in c)a.mod.push(c[g]);return(s||null==s&&(t.length||i.length))&&a.clean(!0),a}}}const xo="_:mod:_";function Eo(){Object.defineProperty(this,xo,{writable:!0,value:{}})}Eo.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[xo];return null!=t&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=Jt(n)?1+n.length:-1),r},modified(e,t){const n=this[xo];if(!arguments.length){for(const e in n)if(n[e])return!0;return!1}if(Jt(e)){for(let t=0;t<e.length;++t)if(n[e[t]])return!0;return!1}return null!=t&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[xo]={},this}};let wo=0;const Io=new Eo;function Ao(e,t,n,i){this.id=++wo,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function So(e){return function(t){const n=this.flags;return 0===arguments.length?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Ao.prototype={targets(){return this._targets||(this._targets=ao(Yt))},set(e){return this.value!==e?(this.value=e,1):0},skip:So(1),modified:So(2),parameters(e,t,n){t=!1!==t;const i=this._argval=this._argval||new Eo,r=this._argops=this._argops||[],s=[];let o,a,l,u;const c=(e,n,o)=>{o instanceof Ao?(o!==this&&(t&&o.targets().add(this),s.push(o)),r.push({op:o,name:e,index:n})):i.set(e,n,o)};for(o in e)if(a=e[o],"pulse"===o)nn(a).forEach(e=>{e instanceof Ao?e!==this&&(e.targets().add(this),s.push(e)):Vt("Pulse parameters must be operator instances.")}),this.source=a;else if(Jt(a))for(i.set(o,-1,Array(l=a.length)),u=0;u<l;++u)c(o,u,a[u]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||Io,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};let Co=0;function Oo(e,t,n){this.id=++Co,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Mo(e,t,n){return new Oo(e,t,n)}Oo.prototype={_filter:Ht,_apply:Gt,targets(){return this._targets||(this._targets=ao(Yt))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let e=0;e<i;++e)n[e].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Mo(e);return this.targets().add(t),t},apply(e){const t=Mo(null,e);return this.targets().add(t),t},merge(){const e=Mo();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Mo();return this.targets().add(Mo(null,null,function(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}(e,e=>{const n=e.dataflow;t.receive(e),n&&n.run&&n.run()}))),t},between(e,t){let n=!1;return e.targets().add(Mo(null,null,()=>n=!0)),t.targets().add(Mo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ht,this._targets=null}};const ko={skip:!0};function Ro(e,t,n,i,r,s){const o=on({},s,ko);let a,l;rn(n)||(n=sn(n)),void 0===i?a=t=>e.touch(n(t)):rn(i)?(l=new Ao(null,i,r,!1),a=t=>{l.evaluate(t);const i=n(t),r=l.value;bo(r)?e.pulse(i,r,s):e.update(i,r,o)}):a=t=>e.update(n(t),i,o),t.apply(a)}function No(e,t,n,i,r,s){if(void 0===i)t.targets().add(n);else{const o=s||{},a=new Ao(null,function(e,t){return t=rn(t)?t:sn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}const Do={};function Fo(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Lo(e,t){const n=[];return hn(e,t,e=>n.push(e)),n}function Po(e,t){const n={};return e.visit(t,e=>{n[po(e)]=1}),e=>n[po(e)]?null:e}function Bo(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}function $o(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const e of n)if(e.stamp===t){if(e.fields){const t=r.fields||(r.fields={});for(const n in e.fields)t[n]=1}e.changed(r.ADD)&&(s|=r.ADD),e.changed(r.REM)&&(s|=r.REM),e.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}function Uo(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}Fo.prototype={StopPropagation:Do,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(e){return new Fo(this.dataflow).init(this,e)},clone(){const e=this.fork(7);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(23)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Fo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,!e.fields||64&t||(n.fields=e.fields),1&t?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),2&t?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),4&t?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),32&t?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||7;return 1&t&&this.add.length||2&t&&this.rem.length||4&t&&this.mod.length},reflow(e){if(e)return this.fork(7).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(4,Po(this,1))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return Jt(e)?e.forEach(e=>t[e]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?Jt(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){const n=this;return 1&e&&(n.addF=Bo(n.addF,t)),2&e&&(n.remF=Bo(n.remF,t)),4&e&&(n.modF=Bo(n.modF,t)),16&e&&(n.srcF=Bo(n.srcF,t)),n},materialize(e){const t=this;return 1&(e=e||7)&&t.addF&&(t.add=Lo(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=Lo(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=Lo(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(16&e)return hn(n.source,n.srcF,i),n;1&e&&hn(n.add,n.addF,i),2&e&&hn(n.rem,n.remF,i),4&e&&hn(n.mod,n.modF,i);const r=n.source;if(8&e&&r){const e=n.add.length+n.mod.length;e===r.length||hn(r,e?Po(n,5):n.srcF,i)}return n}},ln($o,Fo,{fork(e){const t=new Fo(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?Jt(e)?e.some(e=>n[e]):n[e]:0},filter(){Vt("MultiPulse does not support filtering.")},materialize(){Vt("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});const Vo={skip:!1,force:!1};function zo(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),jo(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,function(e,t,n){const i=t,r=e.length,s=e[t];let o,a=1+(t<<1);for(;a<r;)o=a+1,o<r&&n(e[a],e[o])>=0&&(a=o),e[t]=e[a],a=1+((t=a)<<1);e[t]=s,jo(e,i,t,n)}(t,0,e)):i=n,i}}}function jo(e,t,n,i){let r,s;const o=e[n];for(;n>t&&(s=n-1>>1,r=e[s],i(o,r)<0);)e[n]=r,n=s;return e[n]=o}function Yo(){this.logger(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Wt,i=e||Xt;return{level(e){return arguments.length?(i=+e,this):i},error(){return i>=qt&&n(t||"error","ERROR",arguments),this},warn(){return i>=Kt&&n(t||"warn","WARN",arguments),this},info(){return i>=Zt&&n(t||"log","INFO",arguments),this},debug(){return i>=Qt&&n(t||"log","DEBUG",arguments),this}}}()),this.logLevel(qt),this._clock=0,this._rank=0,this._locale=Ds();try{this._loader=oo()}catch(e){}this._touched=ao(Yt),this._input={},this._pulse=null,this._heap=zo((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Go(e){return function(){return this._log[e].apply(this,arguments)}}function Ho(e,t){Ao.call(this,e,null,t)}Yo.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Go("error"),warn:Go("warn"),info:Go("info"),debug:Go("debug"),logLevel:Go("level"),cleanThreshold:1e4,add:function(e,t,n,i){let r,s=1;return e instanceof Ao?r=e:e&&e.prototype instanceof Ao?r=new e:rn(e)?r=new Ao(null,e):(s=0,r=new Ao(e,t)),this.rank(r),s&&(i=n,n=t),n&&this.connect(r,r.parameters(n,i)),this.touch(r),r},connect:function(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank)return void this.rerank(e)},rank:function(e){e.rank=++this._rank},rerank:function(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&Vt("Cycle detected in dataflow graph.")},pulse:function(e,t,n){this.touch(e,n||Vo);const i=new Fo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this},touch:function(e,t){const n=t||Vo;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this},update:function(e,t,n){const i=n||Vo;return(e.set(t)||i.force)&&this.touch(e,i),this},changeset:To,ingest:function(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))},parse:function(e,t){const n=this.locale();return so(e,t,n.timeParse,n.utcParse)},preload:async function(e,t,n){const i=this,r=i._pending||function(e){let t;const n=new Promise(e=>t=e);return n.requests=0,n.done=()=>{0===--n.requests&&(e._pending=null,t(e))},e._pending=n}(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Ht).insert(s.data||[])),r.done(),s},request:async function(e,t){const n=this;let i,r=0;try{i=await n.loader().load(e,{context:"dataflow",response:ro(t&&t.type)});try{i=n.parse(i,t)}catch(t){r=-2,n.warn("Data ingestion failed",e,t)}}catch(t){r=-1,n.warn("Loading failed",e,t)}return{data:i,status:r}},events:function(e,t,n,i){const r=this,s=Mo(n,i),o=function(e){e.dataflow=r;try{s.receive(e)}catch(e){r.error(e)}finally{r.run()}};let a;a="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):nn(e);const l=a.length;for(let e=0;e<l;++e)a[e].addEventListener(t,o);return s},on:function(e,t,n,i,r){return(e instanceof Ao?No:Ro)(this,e,t,n,i,r),this},evaluate:async function(e,t,n){const i=this,r=[];if(i._pulse)return Uo(i);if(i._pending&&await i._pending,t&&await lo(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new Fo(i,s,e),i._touched.forEach(e=>i._enqueue(e,!0)),i._touched=ao(Yt);let o,a,l,u=0;try{for(;i._heap.size()>0;)o=i._heap.pop(),o.rank===o.qrank?(a=o.run(i._getPulse(o,e)),a.then?a=await a:a.async&&(r.push(a.async),a=Do),a!==Do&&o._targets&&o._targets.forEach(e=>i._enqueue(e)),++u):i._enqueue(o,!0)}catch(e){i._heap.clear(),l=e}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${u} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const e=i._postrun.sort((e,t)=>t.priority-e.priority);i._postrun=[];for(let t=0;t<e.length;++t)await lo(i,e[t].callback)}return n&&await lo(i,n),r.length&&Promise.all(r).then(e=>i.runAsync(null,()=>{e.forEach(e=>{try{e(i)}catch(e){i.error(e)}})})),i},run:function(e,t,n){return this._pulse?Uo(this):(this.evaluate(e,t,n),this)},runAsync:async function(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running},runAfter:function(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))},_getPulse:function(e,t){const n=e.source,i=this._clock;return n&&Jt(n)?new $o(this,i,n.map(e=>e.pulse),t):this._input[e.id]||function(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Do&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},ln(Ho,Ao,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(e=>this.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Wo={};function Xo(e){const t=qo(e);return t&&t.Definition||null}function qo(e){return e=e&&e.toLowerCase(),an(Wo,e)?Wo[e]:null}function Ko(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Zo(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n<r||void 0===n&&r>=r)&&(n=r)}return n}function Qo(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let i=-1;for(let r of e)null!=(r=t(r,++i,e))&&(n>r||void 0===n&&r>=r)&&(n=r)}return n}function Jo(e,t,n=0,i=e.length-1,r=Ko){for(;i>n;){if(i-n>600){const s=i-n+1,o=t-n+1,a=Math.log(s),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);Jo(e,t,Math.max(n,Math.floor(t-o*l/s+u)),Math.min(i,Math.floor(t+(s-o)*l/s+u)),r)}const s=e[t];let o=n,a=i;for(ea(e,n,t),r(e[i],s)>0&&ea(e,n,i);o<a;){for(ea(e,o,a),++o,--a;r(e[o],s)<0;)++o;for(;r(e[a],s)>0;)--a}0===r(e[n],s)?ea(e,n,a):(++a,ea(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function ea(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function ta(e){return null===e?NaN:+e}function na(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(i=+i)>=i&&(yield i)}}(e,n)),i=e.length){if((t=+t)<=0||i<2)return Qo(e);if(t>=1)return Zo(e);var i,r=(i-1)*t,s=Math.floor(r),o=Zo(Jo(e,s).subarray(0,s+1));return o+(Qo(e.subarray(s+1))-o)*(r-s)}}function ia(e,t,n=ta){if(i=e.length){if((t=+t)<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e);return o+(+n(e[s+1],s+1,e)-o)*(r-s)}}function ra(e,t){return na(e,.5,t)}function*sa(e,t){if(null==t)for(let t of e)null!=t&&""!==t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let i of e)i=t(i,++n,e),null!=i&&""!==i&&(i=+i)>=i&&(yield i)}}function oa(e,t,n){const i=Float64Array.from(sa(e,n));return i.sort(Ko),t.map(e=>ia(i,e))}function aa(e,t){return oa(e,[.25,.5,.75],t)}function la(e,t){const n=e.length,i=function(e,t){const n=function(e,t){let n,i=0,r=0,s=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(n=t-r,r+=n/++i,s+=n*(t-r));else{let o=-1;for(let a of e)null!=(a=t(a,++o,e))&&(a=+a)>=a&&(n=a-r,r+=n/++i,s+=n*(a-r))}if(i>1)return s/(i-1)}(e,t);return n?Math.sqrt(n):n}(e,t),r=aa(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function ua(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s,o,a,l,u,c,d=e.extent[0],h=e.extent[1];const p=e.span||h-d||Math.abs(d)||1;if(e.step)s=e.step;else if(e.steps){for(l=p/t,u=0,c=e.steps.length;u<c&&e.steps[u]<l;++u);s=e.steps[Math.max(0,u-1)]}else{for(o=Math.ceil(Math.log(t)/i),a=e.minstep||0,s=Math.max(a,Math.pow(n,Math.round(Math.log(p)/i)-o));Math.ceil(p/s)>t;)s*=n;for(u=0,c=r.length;u<c;++u)l=s/r[u],l>=a&&p/l<=t&&(s=l)}l=Math.log(s);const f=l>=0?0:1+~~(-l/i),m=Math.pow(n,-f-1);return(e.nice||void 0===e.nice)&&(l=Math.floor(d/s+m)*s,d=d<l?l-s:l,h=Math.ceil(h/s)*s),{start:d,stop:h===d?d+s:h,step:s}}var ca=Math.random;function da(e){ca=e}function ha(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(sa(e,i)),s=r.length,o=t;let a,l,u,c;for(u=0,c=Array(o);u<o;++u){for(a=0,l=0;l<s;++l)a+=r[~~(ca()*s)];c[u]=a/s}return c.sort(Ko),[na(c,n/2),na(c,1-n/2)]}function pa(e,t,n,i){i=i||(e=>e);const r=e.length,s=new Float64Array(r);let o,a=0,l=1,u=i(e[0]),c=u,d=u+t;for(;l<r;++l){if(o=i(e[l]),o>=d){for(c=(u+c)/2;a<l;++a)s[a]=c;d=o+t,u=o}c=o}for(c=(u+c)/2;a<l;++a)s[a]=c;return n?function(e,t){const n=e.length;let i,r,s=0,o=1;for(;e[s]===e[o];)++o;for(;o<n;){for(i=o+1;e[o]===e[i];)++i;if(e[o]-e[o-1]<t){for(r=o+(s+i-o-o>>1);r<o;)e[r++]=e[o];for(;r>o;)e[r--]=e[s]}s=o,o=i}return e}(s,t+t/4):s}function fa(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function ma(e,t){let n,i,r;null==t&&(t=e,e=0);const s={min(e){return arguments.length?(n=e||0,r=i-n,s):n},max(e){return arguments.length?(i=e||0,r=i-n,s):i},sample:()=>n+Math.floor(r*ca()),pdf:e=>e===Math.floor(e)&&e>=n&&e<i?1/r:0,cdf(e){const t=Math.floor(e);return t<n?0:t>=i?1:(t-n+1)/r},icdf:e=>e>=0&&e<=1?n-1+Math.floor(e*r):NaN};return s.min(e).max(t)}const ga=Math.sqrt(2*Math.PI),_a=Math.SQRT2;let ya=NaN;function va(e,t){e=e||0,t=null==t?1:t;let n,i,r=0,s=0;if(ya==ya)r=ya,ya=NaN;else{do{r=2*ca()-1,s=2*ca()-1,n=r*r+s*s}while(0===n||n>1);i=Math.sqrt(-2*Math.log(n)/n),r*=i,ya=s*i}return e+r*t}function ba(e,t,n){const i=(e-(t||0))/(n=null==n?1:n);return Math.exp(-.5*i*i)/(n*ga)}function Ta(e,t,n){const i=(e-(t=t||0))/(n=null==n?1:n),r=Math.abs(i);let s;if(r>37)s=0;else{const e=Math.exp(-r*r/2);let t;r<7.07106781186547?(t=.0352624965998911*r+.700383064443688,t=t*r+6.37396220353165,t=t*r+33.912866078383,t=t*r+112.079291497871,t=t*r+221.213596169931,t=t*r+220.206867912376,s=e*t,t=.0883883476483184*r+1.75566716318264,t=t*r+16.064177579207,t=t*r+86.7807322029461,t=t*r+296.564248779674,t=t*r+637.333633378831,t=t*r+793.826512519948,t=t*r+440.413735824752,s/=t):(t=r+.65,t=r+4/t,t=r+3/t,t=r+2/t,t=r+1/t,s=e/t/2.506628274631)}return i>0?1-s:s}function xa(e,t,n){return e<0||e>1?NaN:(t||0)+(null==n?1:n)*_a*function(e){let t,n=-Math.log((1-e)*(1+e));n<6.25?(n-=3.125,t=-364441206401782e-35,t=t*n-16850591381820166e-35,t=128584807152564e-32+t*n,t=11157877678025181e-33+t*n,t=t*n-1333171662854621e-31,t=20972767875968562e-33+t*n,t=6637638134358324e-30+t*n,t=t*n-4054566272975207e-29,t=t*n-8151934197605472e-29,t=26335093153082323e-28+t*n,t=t*n-12975133253453532e-27,t=t*n-5415412054294628e-26,t=1.0512122733215323e-9+t*n,t=t*n-4.112633980346984e-9,t=t*n-2.9070369957882005e-8,t=4.2347877827932404e-7+t*n,t=t*n-13654692000834679e-22,t=t*n-13882523362786469e-21,t=.00018673420803405714+t*n,t=t*n-.000740702534166267,t=t*n-.006033670871430149,t=.24015818242558962+t*n,t=1.6536545626831027+t*n):n<16?(n=Math.sqrt(n)-3.25,t=2.2137376921775787e-9,t=9.075656193888539e-8+t*n,t=t*n-2.7517406297064545e-7,t=1.8239629214389228e-8+t*n,t=15027403968909828e-22+t*n,t=t*n-4013867526981546e-21,t=29234449089955446e-22+t*n,t=12475304481671779e-21+t*n,t=t*n-47318229009055734e-21,t=6828485145957318e-20+t*n,t=24031110387097894e-21+t*n,t=t*n-.0003550375203628475,t=.0009532893797373805+t*n,t=t*n-.0016882755560235047,t=.002491442096107851+t*n,t=t*n-.003751208507569241,t=.005370914553590064+t*n,t=1.0052589676941592+t*n,t=3.0838856104922208+t*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,t=-27109920616438573e-27,t=t*n-2.555641816996525e-10,t=1.5076572693500548e-9+t*n,t=t*n-3.789465440126737e-9,t=7.61570120807834e-9+t*n,t=t*n-1.496002662714924e-8,t=2.914795345090108e-8+t*n,t=t*n-6.771199775845234e-8,t=2.2900482228026655e-7+t*n,t=t*n-9.9298272942317e-7,t=4526062597223154e-21+t*n,t=t*n-1968177810553167e-20,t=7599527703001776e-20+t*n,t=t*n-.00021503011930044477,t=t*n-.00013871931833623122,t=1.0103004648645344+t*n,t=4.849906401408584+t*n):t=1/0;return t*e}(2*e-1)}function Ea(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>va(n,i),pdf:e=>ba(e,n,i),cdf:e=>Ta(e,n,i),icdf:e=>xa(e,n,i)};return r.mean(e).stdev(t)}function wa(e,t){const n=Ea();let i=0;const r={data(n){return arguments.length?(e=n,i=n?n.length:0,r.bandwidth(t)):e},bandwidth(n){return arguments.length?(!(t=n)&&e&&(t=la(e)),r):t},sample:()=>e[~~(ca()*i)]+t*n.sample(),pdf(r){let s=0,o=0;for(;o<i;++o)s+=n.pdf((r-e[o])/t);return s/t/i},cdf(r){let s=0,o=0;for(;o<i;++o)s+=n.cdf((r-e[o])/t);return s/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Ia(e,t){return e=e||0,t=null==t?1:t,Math.exp(e+va()*t)}function Aa(e,t,n){if(e<=0)return 0;t=t||0,n=null==n?1:n;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*ga*e)}function Sa(e,t,n){return Ta(Math.log(e),t,n)}function Ca(e,t,n){return Math.exp(xa(e,t,n))}function Oa(e,t){let n,i;const r={mean(e){return arguments.length?(n=e||0,r):n},stdev(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>Ia(n,i),pdf:e=>Aa(e,n,i),cdf:e=>Sa(e,n,i),icdf:e=>Ca(e,n,i)};return r.mean(e).stdev(t)}function Ma(e,t){let n,i=0;const r={weights(e){return arguments.length?(n=function(e){const t=[];let n,r=0;for(n=0;n<i;++n)r+=t[n]=null==e[n]?1:+e[n];for(n=0;n<i;++n)t[n]/=r;return t}(t=e||[]),r):t},distributions(n){return arguments.length?(n?(i=n.length,e=n):(i=0,e=[]),r.weights(t)):e},sample(){const t=ca();let r=e[i-1],s=n[0],o=0;for(;o<i-1;s+=n[++o])if(t<s){r=e[o];break}return r.sample()},pdf(t){let r=0,s=0;for(;s<i;++s)r+=n[s]*e[s].pdf(t);return r},cdf(t){let r=0,s=0;for(;s<i;++s)r+=n[s]*e[s].cdf(t);return r},icdf(){throw Error("Mixture icdf not supported.")}};return r.distributions(e).weights(t)}function ka(e,t){return null==t&&(t=null==e?1:e,e=0),e+(t-e)*ca()}function Ra(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=t&&e<=n?1/(n-t):0}function Na(e,t,n){return null==n&&(n=null==t?1:t,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Da(e,t,n){return null==n&&(n=null==t?1:t,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Fa(e,t){let n,i;const r={min(e){return arguments.length?(n=e||0,r):n},max(e){return arguments.length?(i=null==e?1:e,r):i},sample:()=>ka(n,i),pdf:e=>Ra(e,n,i),cdf:e=>Na(e,n,i),icdf:e=>Da(e,n,i)};return null==t&&(t=null==e?1:e,e=0),r.min(e).max(t)}function La(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Pa(e,t,n,i){e=e.filter(e=>{let i=t(e),r=n(e);return null!=i&&(i=+i)>=i&&null!=r&&(r=+r)>=r}),i&&e.sort((e,n)=>t(e)-t(n));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a,l,u,c=0,d=0,h=0;for(u of e)s[c]=a=+t(u),o[c]=l=+n(u),++c,d+=(a-d)/c,h+=(l-h)/c;for(c=0;c<r;++c)s[c]-=d,o[c]-=h;return[s,o,d,h]}function Ba(e,t,n,i){let r,s,o=-1;for(const a of e)r=t(a),s=n(a),null!=r&&(r=+r)>=r&&null!=s&&(s=+s)>=s&&i(r,s,++o)}function $a(e,t,n,i,r){let s=0,o=0;return Ba(e,t,n,(e,t)=>{const n=t-r(e),a=t-i;s+=n*n,o+=a*a}),1-s/o}function Ua(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ba(e,t,n,(e,t)=>{++a,i+=(e-i)/a,r+=(t-r)/a,s+=(e*t-s)/a,o+=(e*e-o)/a});const l=La(i,r,s,o),u=e=>l[0]+l[1]*e;return{coef:l,predict:u,rSquared:$a(e,t,n,r,u)}}function Va(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ba(e,t,n,(e,t)=>{++a,e=Math.log(e),i+=(e-i)/a,r+=(t-r)/a,s+=(e*t-s)/a,o+=(e*e-o)/a});const l=La(i,r,s,o),u=e=>l[0]+l[1]*Math.log(e);return{coef:l,predict:u,rSquared:$a(e,t,n,r,u)}}function za(e,t,n){const[i,r,s,o]=Pa(e,t,n);let a,l,u,c=0,d=0,h=0,p=0,f=0;Ba(e,t,n,(e,t)=>{a=i[f++],l=Math.log(t),u=a*t,c+=(t*l-c)/f,d+=(u-d)/f,h+=(u*l-h)/f,p+=(a*u-p)/f});const[m,g]=La(d/o,c/o,h/o,p/o),_=e=>Math.exp(m+g*(e-s));return{coef:[Math.exp(m-g*s),g],predict:_,rSquared:$a(e,t,n,o,_)}}function ja(e,t,n){let i=0,r=0,s=0,o=0,a=0,l=0;Ba(e,t,n,(e,t)=>{const n=Math.log(e),u=Math.log(t);++l,i+=(n-i)/l,r+=(u-r)/l,s+=(n*u-s)/l,o+=(n*n-o)/l,a+=(t-a)/l});const u=La(i,r,s,o),c=e=>u[0]*Math.pow(e,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:$a(e,t,n,a,c)}}function Ya(e,t,n){const[i,r,s,o]=Pa(e,t,n),a=i.length;let l,u,c,d,h=0,p=0,f=0,m=0,g=0;for(l=0;l<a;)u=i[l],c=r[l++],d=u*u,h+=(d-h)/l,p+=(d*u-p)/l,f+=(d*d-f)/l,m+=(u*c-m)/l,g+=(d*c-g)/l;const _=f-h*h,y=h*_-p*p,v=(g*h-m*p)/y,b=(m*_-g*p)/y,T=-v*h,x=e=>v*(e-=s)*e+b*e+T+o;return{coef:[T-b*s+v*s*s+o,b-2*v*s,v],predict:x,rSquared:$a(e,t,n,o,x)}}function Ga(e,t,n,i){if(1===i)return Ua(e,t,n);if(2===i)return Ya(e,t,n);const[r,s,o,a]=Pa(e,t,n),l=r.length,u=[],c=[],d=i+1;let h,p,f,m,g;for(h=0;h<d;++h){for(f=0,m=0;f<l;++f)m+=Math.pow(r[f],h)*s[f];for(u.push(m),g=new Float64Array(d),p=0;p<d;++p){for(f=0,m=0;f<l;++f)m+=Math.pow(r[f],h+p);g[p]=m}c.push(g)}c.push(u);const _=function(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}(c),y=e=>{e-=o;let t=a+_[0]+_[1]*e+_[2]*e*e;for(h=3;h<d;++h)t+=_[h]*Math.pow(e,h);return t};return{coef:Ha(d,_,-o,a),predict:y,rSquared:$a(e,t,n,a,y)}}function Ha(e,t,n,i){const r=Array(e);let s,o,a,l;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],l=1,r[s]+=a,o=1;o<=s;++o)l*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*l;return r[0]+=i,r}const Wa=2,Xa=1e-12;function qa(e,t,n,i){const[r,s,o,a]=Pa(e,t,n,!0),l=r.length,u=Math.max(2,~~(i*l)),c=new Float64Array(l),d=new Float64Array(l),h=new Float64Array(l).fill(1);for(let e=-1;++e<=Wa;){const t=[0,u-1];for(let e=0;e<l;++e){const n=r[e],i=t[0],o=t[1],a=n-r[i]>r[o]-n?i:o;let l=0,u=0,p=0,f=0,m=0;const g=1/Math.abs(r[a]-n||1);for(let e=i;e<=o;++e){const t=r[e],i=s[e],o=Ka(Math.abs(n-t)*g)*h[e],a=t*o;l+=o,u+=a,p+=i*o,f+=i*a,m+=t*a}const[_,y]=La(u/l,p/l,f/l,m/l);c[e]=_+y*n,d[e]=Math.abs(s[e]-c[e]),Za(r,e+1,t)}if(e===Wa)break;const n=ra(d);if(Math.abs(n)<Xa)break;for(let e,t,i=0;i<l;++i)e=d[i]/(6*n),h[i]=e>=1?Xa:(t=1-e*e)*t}return function(e,t,n,i){const r=e.length,s=[];let o,a=0,l=0,u=[];for(;a<r;++a)o=e[a]+n,u[0]===o?u[1]+=(t[a]-u[1])/++l:(l=0,u[1]+=i,u=[o,t[a]],s.push(u));return u[1]+=i,s}(r,c,o,a)}function Ka(e){return(e=1-e*e*e)*e*e}function Za(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}const Qa=.5*Math.PI/180;function Ja(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=t=>[t,e(t)],s=t[0],o=t[1],a=o-s,l=a/i,u=[r(s)],c=[];if(n===i){for(let e=1;e<i;++e)u.push(r(s+e/n*a));return u.push(r(o)),u}c.push(r(o));for(let e=n;--e>0;)c.push(r(s+e/n*a));let d=u[0],h=c[c.length-1];const p=1/a,f=function(e,t){let n=e,i=e;const r=t.length;for(let e=0;e<r;++e){const r=t[e][1];r<n&&(n=r),r>i&&(i=r)}return 1/(i-n)}(d[1],c);for(;h;){const e=r((d[0]+h[0])/2);e[0]-d[0]>=l&&el(d,e,h,p,f)>Qa?c.push(e):(d=h,u.push(h),c.pop()),h=c[c.length-1]}return u}function el(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function tl(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),s=new Array(r);++i<r;)s[i]=e+i*n;return s}function nl(e){let t=e,n=e;function i(e,t,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){const s=i+r>>>1;n(e[s],t)<0?i=s+1:r=s}return i}return 1===e.length&&(t=(t,n)=>e(t)-n,n=function(e){return(t,n)=>Ko(e(t),n)}(e)),{left:i,center:function(e,n,r,s){null==r&&(r=0),null==s&&(s=e.length);const o=i(e,n,r,s-1);return o>r&&t(e[o-1],n)>-t(e[o],n)?o-1:o},right:function(e,t,i,r){for(null==i&&(i=0),null==r&&(r=e.length);i<r;){const s=i+r>>>1;n(e[s],t)>0?r=s:i=s+1}return i}}}var il=new Date,rl=new Date;function sl(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=function(t){return e(t=new Date(+t)),t},r.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},r.round=function(e){var t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},r.range=function(n,i,s){var o,a=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return a;do{a.push(o=new Date(+n)),t(n,s),e(n)}while(o<n&&n<i);return a},r.filter=function(n){return sl(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,i){if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})},n&&(r.count=function(t,i){return il.setTime(+t),rl.setTime(+i),e(il),e(rl),Math.floor(n(il,rl))},r.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?function(t){return i(t)%e===0}:function(t){return r.count(0,t)%e===0}):r:null}),r}const ol=1e3,al=6e4,ll=36e5,ul=864e5,cl=6048e5,dl=2592e6,hl=31536e6;var pl=sl(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*al)/ul,e=>e.getDate()-1);const fl=pl;pl.range;function ml(e){return sl(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*al)/cl})}var gl=ml(0),_l=ml(1),yl=ml(2),vl=ml(3),bl=ml(4),Tl=ml(5),xl=ml(6),El=(gl.range,_l.range,yl.range,vl.range,bl.range,Tl.range,xl.range,sl(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/ul},function(e){return e.getUTCDate()-1}));const wl=El;El.range;function Il(e){return sl(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/cl})}var Al=Il(0),Sl=Il(1),Cl=Il(2),Ol=Il(3),Ml=Il(4),kl=Il(5),Rl=Il(6),Nl=(Al.range,Sl.range,Cl.range,Ol.range,Ml.range,kl.range,Rl.range,sl(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}));Nl.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sl(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null};const Dl=Nl;Nl.range;var Fl=sl(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()});const Ll=Fl;Fl.range;var Pl=sl(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol-e.getMinutes()*al)},function(e,t){e.setTime(+e+t*ll)},function(e,t){return(t-e)/ll},function(e){return e.getHours()});const Bl=Pl;Pl.range;var $l=sl(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*ol)},function(e,t){e.setTime(+e+t*al)},function(e,t){return(t-e)/al},function(e){return e.getMinutes()});const Ul=$l;$l.range;var Vl=sl(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*ol)},function(e,t){return(t-e)/ol},function(e){return e.getUTCSeconds()});const zl=Vl;Vl.range;var jl=sl(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});jl.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?sl(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):jl:null};const Yl=jl;jl.range;var Gl=sl(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});Gl.every=function(e){return isFinite(e=Math.floor(e))&&e>0?sl(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null};const Hl=Gl;Gl.range;var Wl=sl(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()});const Xl=Wl;Wl.range;var ql=sl(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*ll)},function(e,t){return(t-e)/ll},function(e){return e.getUTCHours()});const Kl=ql;ql.range;var Zl=sl(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*al)},function(e,t){return(t-e)/al},function(e){return e.getUTCMinutes()});const Ql=Zl;Zl.range;var Jl=Math.sqrt(50),eu=Math.sqrt(10),tu=Math.sqrt(2);function nu(e,t,n){var i,r,s,o,a=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((i=t<e)&&(r=e,e=t,t=r),0===(o=iu(e,t,n))||!isFinite(o))return[];if(o>0){let n=Math.round(e/o),i=Math.round(t/o);for(n*o<e&&++n,i*o>t&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)*o}else{o=-o;let n=Math.round(e*o),i=Math.round(t*o);for(n/o<e&&++n,i/o>t&&--i,s=new Array(r=i-n+1);++a<r;)s[a]=(n+a)/o}return i&&s.reverse(),s}function iu(e,t,n){var i=(t-e)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),s=i/Math.pow(10,r);return r>=0?(s>=Jl?10:s>=eu?5:s>=tu?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(s>=Jl?10:s>=eu?5:s>=tu?2:1)}function ru(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),s=i/r;return s>=Jl?r*=10:s>=eu?r*=5:s>=tu&&(r*=2),t<e?-r:r}const su="year",ou="quarter",au="month",lu="week",uu="date",cu="day",du="dayofyear",hu="hours",pu="minutes",fu="seconds",mu="milliseconds",gu=[su,ou,au,lu,uu,cu,du,hu,pu,fu,mu],_u=gu.reduce((e,t,n)=>(e[t]=1+n,e),{});function yu(e){const t=Xe(e).slice(),n={};t.length||ae("Missing time unit."),t.forEach(e=>{ut(_u,e)?n[e]=1:ae("Invalid time unit: ".concat(e,"."))});return(n[lu]||n[cu]?1:0)+(n[ou]||n[au]||n[uu]?1:0)+(n[du]?1:0)>1&&ae("Incompatible time units: ".concat(e)),t.sort((e,t)=>_u[e]-_u[t]),t}const vu={[su]:"%Y ",[ou]:"Q%q ",[au]:"%b ",[uu]:"%d ",[lu]:"W%U ",[cu]:"%a ",[du]:"%j ",[hu]:"%H:00",[pu]:"00:%M",[fu]:":%S",[mu]:".%L",["".concat(su,"-").concat(au)]:"%Y-%m ",["".concat(su,"-").concat(au,"-").concat(uu)]:"%Y-%m-%d ",["".concat(hu,"-").concat(pu)]:"%H:%M"};function bu(e,t){const n=st({},vu,t),i=yu(e),r=i.length;let s,o,a="",l=0;for(l=0;l<r;)for(s=i.length;s>l;--s)if(o=i.slice(l,s).join("-"),null!=n[o]){a+=n[o],l=s;break}return a.trim()}const Tu=new Date;function xu(e){return Tu.setFullYear(e),Tu.setMonth(0),Tu.setDate(1),Tu.setHours(0,0,0,0),Tu}function Eu(e){return Iu(new Date(e))}function wu(e){return Au(new Date(e))}function Iu(e){return fl.count(xu(e.getFullYear())-1,e)}function Au(e){return gl.count(xu(e.getFullYear())-1,e)}function Su(e){return xu(e).getDay()}function Cu(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function Ou(e){return ku(new Date(e))}function Mu(e){return Ru(new Date(e))}function ku(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return wl.count(t-1,e)}function Ru(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Al.count(t-1,e)}function Nu(e){return Tu.setTime(Date.UTC(e,0,1)),Tu.getUTCDay()}function Du(e,t,n,i,r,s,o){if(0<=e&&e<100){const e=new Date(Date.UTC(-1,t,n,i,r,s,o));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(e,t,n,i,r,s,o))}function Fu(e,t,n,i,r){const s=t||1,o=Oe(e),a=(e,t,r)=>function(e,t,n,i){const r=n<=1?e:i?(t,r)=>i+n*Math.floor((e(t,r)-i)/n):(t,i)=>n*Math.floor(e(t,i)/n);return t?(e,n)=>t(r(e,n),n):r}(n[r=r||e],i[r],e===o&&s,t),l=new Date,u=Dt(e),c=u[su]?a(su):it(2012),d=u[au]?a(au):u[ou]?a(ou):he,h=u[lu]&&u[cu]?a(cu,1,lu+cu):u[lu]?a(lu,1):u[cu]?a(cu,1):u[uu]?a(uu,1):u[du]?a(du,1):pe,p=u[hu]?a(hu):he,f=u[pu]?a(pu):he,m=u[fu]?a(fu):he,g=u[mu]?a(mu):he;return function(e){l.setTime(+e);const t=c(l);return r(t,d(l),h(l,t),p(l),f(l),m(l),g(l))}}function Lu(e,t,n){return t+7*e-(n+6)%7}const Pu={[su]:e=>e.getFullYear(),[ou]:e=>Math.floor(e.getMonth()/3),[au]:e=>e.getMonth(),[uu]:e=>e.getDate(),[hu]:e=>e.getHours(),[pu]:e=>e.getMinutes(),[fu]:e=>e.getSeconds(),[mu]:e=>e.getMilliseconds(),[du]:e=>Iu(e),[lu]:e=>Au(e),[lu+cu]:(e,t)=>Lu(Au(e),e.getDay(),Su(t)),[cu]:(e,t)=>Lu(1,e.getDay(),Su(t))},Bu={[ou]:e=>3*e,[lu]:(e,t)=>Lu(e,0,Su(t))};function $u(e,t){return Fu(e,t||1,Pu,Bu,Cu)}const Uu={[su]:e=>e.getUTCFullYear(),[ou]:e=>Math.floor(e.getUTCMonth()/3),[au]:e=>e.getUTCMonth(),[uu]:e=>e.getUTCDate(),[hu]:e=>e.getUTCHours(),[pu]:e=>e.getUTCMinutes(),[fu]:e=>e.getUTCSeconds(),[mu]:e=>e.getUTCMilliseconds(),[du]:e=>ku(e),[lu]:e=>Ru(e),[cu]:(e,t)=>Lu(1,e.getUTCDay(),Nu(t)),[lu+cu]:(e,t)=>Lu(Ru(e),e.getUTCDay(),Nu(t))},Vu={[ou]:e=>3*e,[lu]:(e,t)=>Lu(e,0,Nu(t))};function zu(e,t){return Fu(e,t||1,Uu,Vu,Du)}const ju={[su]:Dl,[ou]:Ll.every(3),[au]:Ll,[lu]:gl,[uu]:fl,[cu]:fl,[du]:fl,[hu]:Bl,[pu]:Ul,[fu]:zl,[mu]:Yl},Yu={[su]:Hl,[ou]:Xl.every(3),[au]:Xl,[lu]:Al,[uu]:wl,[cu]:wl,[du]:wl,[hu]:Kl,[pu]:Ql,[fu]:zl,[mu]:Yl};function Gu(e){return ju[e]}function Hu(e){return Yu[e]}function Wu(e,t,n){return e?e.offset(t,n):void 0}function Xu(e,t,n){return Wu(Gu(e),t,n)}function qu(e,t,n){return Wu(Hu(e),t,n)}function Ku(e,t,n,i){return e?e.range(t,n,i):void 0}function Zu(e,t,n,i){return Ku(Gu(e),t,n,i)}function Qu(e,t,n,i){return Ku(Hu(e),t,n,i)}const Ju=1e3,ec=6e4,tc=36e5,nc=864e5,ic=2592e6,rc=31536e6,sc=[su,au,uu,hu,pu,fu,mu],oc=sc.slice(0,-1),ac=oc.slice(0,-1),lc=ac.slice(0,-1),uc=lc.slice(0,-1),cc=[su,au],dc=[su],hc=[[oc,1,Ju],[oc,5,5e3],[oc,15,15e3],[oc,30,3e4],[ac,1,ec],[ac,5,3e5],[ac,15,9e5],[ac,30,18e5],[lc,1,tc],[lc,3,108e5],[lc,6,216e5],[lc,12,432e5],[uc,1,nc],[[su,lu],1,6048e5],[cc,1,ic],[cc,3,7776e6],[dc,1,rc]];function pc(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Ct(t))/n;let r,s,o=nl(e=>e[2]).right(hc,i);return o===hc.length?(r=dc,s=ru(t[0]/rc,t[1]/rc,n)):o?(o=hc[i/hc[o-1][2]<hc[o][2]/i?o-1:o],r=o[0],s=o[1]):(r=sc,s=Math.max(ru(t[0],t[1],n),1)),{units:r,step:s}}function fc(e){return e&&e.length?1===e.length?e[0]:(t=e,e=>{const n=t.length;let i=1,r=String(t[0](e));for(;i<n;++i)r+="|"+t[i](e);return r}):function(){return""};var t}function mc(e,t,n){return n||e+(t?"_"+t:"")}const gc=()=>{},_c={init:gc,add:gc,rem:gc,idx:0},yc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||void 0===e.min)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},vc=Object.keys(yc);function bc(e,t){return yc[e](t)}function Tc(e,t){return e.idx-t.idx}function xc(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function Ec(e,t){null!=e&&""!==e?e==e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t))):++this.missing}function wc(e,t){null!=e&&""!==e?e==e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t))):--this.missing}function Ic(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function Ac(e,t){const n=t||de,i=function(e){const t={};e.forEach(e=>t[e.name]=e);const n=e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=yc[e]())})};return e.forEach(n),Object.values(t).sort(Tc)}(e),r=e.slice().sort(Tc);function s(e){this._ops=i,this._out=r,this.cell=e,this.init()}return s.prototype.init=xc,s.prototype.add=Ec,s.prototype.rem=wc,s.prototype.set=Ic,s.prototype.get=n,s.fields=e.map(e=>e.out),s}function Sc(e){this._key=e?ue(e):po,this.reset()}vc.forEach(e=>{yc[e]=function(e,t){return n=>st({name:e,out:n||e},_c,t)}(e,yc[e])});const Cc=Sc.prototype;function Oc(e){Ho.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Cc.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},Cc.add=function(e){this._add.push(e)},Cc.rem=function(e){this._rem.push(e)},Cc.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,l,u;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,l=0;a<i;++a)o[n(u=e[a])]?o[n(u)]=0:s[l++]=u;return this._rem=[],this._add=s},Cc.distinct=function(e){const t=this.values(),n={};let i,r=t.length,s=0;for(;--r>=0;)i=e(t[r])+"",ut(n,i)||(n[i]=1,++s);return s},Cc.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=at(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},Cc.argmin=function(e){return this.extent(e)[0]||{}},Cc.argmax=function(e){return this.extent(e)[1]||{}},Cc.min=function(e){const t=this.extent(e)[0];return null!=t?e(t):void 0},Cc.max=function(e){const t=this.extent(e)[1];return null!=t?e(t):void 0},Cc.quartile=function(e){return this._get===e&&this._q||(this._q=aa(this.values(),e),this._get=e),this._q},Cc.q1=function(e){return this.quartile(e)[0]},Cc.q2=function(e){return this.quartile(e)[1]},Cc.q3=function(e){return this.quartile(e)[2]},Cc.ci=function(e){return this._get===e&&this._ci||(this._ci=ha(this.values(),1e3,.05,e),this._get=e),this._ci},Cc.ci0=function(e){return this.ci(e)[0]},Cc.ci1=function(e){return this.ci(e)[1]},Oc.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:vc},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},pt(Oc,Ho,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):{},t.visit(t.SOURCE,e=>n.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),i.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(e){let t,s,o,a;for(t in e)for(o=e[t].tuple,s=0;s<r;++s)i[s][a=o[n[s]]]=a}s(e._prev),s(t),function s(o,a,l){const u=n[l],c=i[l++];for(const n in c){const i=o?o+"|"+n:n;a[u]=c[n],l<r?s(i,a,l):t[i]||e.cell(i,a)}}("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(e){const n=Xe(ie(e)),r=n.length;let s,o=0;for(;o<r;++o)i[s=n[o]]||(i[s]=1,t.push(s))}this._dims=Xe(e.groupby),this._dnames=this._dims.map(e=>{const t=ne(e);return r(e),n.push(t),t}),this.cellkey=e.key?e.key:fc(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.as||[],l=s.length,u={};let c,d,h,p,f,m;for(l!==o.length&&ae("Unmatched number of fields and aggregate ops."),m=0;m<l;++m)c=s[m],d=o[m],null==c&&"count"!==d&&ae("Null aggregate field specified."),p=ne(c),f=mc(d,p,a[m]),n.push(f),"count"!==d?(h=u[p],h||(r(c),h=u[p]=[],h.field=c,this._measures.push(h)),"count"!==d&&(this._countOnly=!1),h.push(bc(d,f))):this._counts.push(f);return this._measures=this._measures.map(e=>Ac(e,e.field)),{}},cellkey:fc(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const e=this._measures,t=e.length;n.agg=Array(t);for(let i=0;i<t;++i)n.agg[i]=new e[i](n)}return n.store&&(n.data=new Sc),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let t=0;t<r;++t)s[n[t]]=i[t](e);return t?yo(t.tuple,s):mo(s)},clean(){const e=this.value;for(const t in e)0===e[t].num&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let t=0,n=i.length;t<n;++t)i[t].add(i[t].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let t=0,n=i.length;t<n;++t)i[t].rem(i[t].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const n=e.agg;for(let e=0,i=n.length;e<i;++e)n[e].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let l,u,c,d;if(i)for(u in i)l=i[u],r&&!l.num||o.push(l.tuple);for(c=0,d=this._alen;c<d;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,d=this._mlen;c<d;++c)l=n[c],(0===l.num&&r?o:a).push(this.celltuple(l)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});function Mc(e){Ho.call(this,null,e)}function kc(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:e=>s.push(e),remove:e=>o[i(e)]=++a,size:()=>r.length,data:(e,t)=>(a&&(r=r.filter(e=>!o[i(e)]),o={},a=0),t&&e&&r.sort(e),s.length&&(r=e?It(e,r,s.sort(e)):r.concat(s),s=[]),r)}}function Rc(e){Ho.call(this,[],e)}function Nc(e){Ao.call(this,null,Dc,e)}function Dc(e){return this.value&&!e.modified()?this.value:Qe(e.fields,e.orders)}function Fc(e){Ho.call(this,null,e)}function Lc(e){Ho.call(this,null,e)}Mc.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},pt(Mc,Ho,{transform(e,t){const n=!1!==e.interval,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],l=o[1];let u;return u=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(ie(e.field))?t.ADD_MOD:t.ADD,t.visit(u,n?e=>{const t=i(e);e[a]=t,e[l]=null==t?null:r+s*(1+(t-r)/s)}:e=>e[a]=i(e)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=ua(e),i=n.step;let r,s,o=n.start,a=o+Math.ceil((n.stop-o)/i)*i;null!=(r=e.anchor)&&(s=r-(o+i*Math.floor((r-o)/i)),o+=s,a+=s);const l=function(e){let n=Me(t(e));return null==n?null:n<o?-1/0:n>a?1/0:(n=Math.max(o,Math.min(n,a-i)),o+i*Math.floor(1e-14+(n-o)/i))};return l.start=o,l.stop=n.stop,l.step=i,this.value=te(l,ie(t),e.name||"bin_"+ne(t))}}),Rc.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},pt(Rc,Ho,{transform(e,t){const n=t.fork(t.ALL),i=kc(po,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(vo(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),pt(Nc,Ao),Fc.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},pt(Fc,Ho,{transform(e,t){const n=t=>n=>{for(var i,r=function(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(a(n),e.case,s)||[],l=0,u=r.length;l<u;++l)o.test(i=r[l])||t(i)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,l=e.as||["text","count"],u=n(e=>r[e]=1+(r[e]||0)),c=n(e=>r[e]-=1);return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=i[a],u=n[a]||0,!l&&u?(i[a]=l=mo({}),l[r]=a,l[s]=u,o.add.push(l)):0===u?(l&&o.rem.push(l),n[a]=null,i[a]=null):l[s]!==u&&(l[s]=u,o.mod.push(l));return o.modifies(t)}}),Lc.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},pt(Lc,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=function(e,t,n,i){for(var r,s,o=[],a={},l=e.length,u=0;u<l;++u)for(a[t]=s=e[u],r=0;r<l;++r)a[n]=e[r],i(a)&&(o.push(mo(a)),(a={})[t]=s);return o}(a,r,s,e.filter||fe)):n.mod=a,n.source=this.value,n.modifies(i)}});const Pc={kde:wa,mixture:Ma,normal:Ea,lognormal:Oa,uniform:Fa},Bc="function";function $c(e,t){const n=e[Bc];ut(Pc,n)||ae("Unknown distribution function: "+n);const i=Pc[n]();for(const n in e)"field"===n?i.data((e.from||t()).map(e[n])):"distributions"===n?i[n](e[n].map(e=>$c(e,t))):typeof i[n]===Bc&&i[n](e[n]);return i}function Uc(e){Ho.call(this,null,e)}const Vc=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],zc={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Vc},{name:"weights",type:"number",array:!0}]};function jc(e,t){return e?e.map((e,n)=>t[n]||ne(e)):null}function Yc(e,t,n){const i=[],r=e=>e(l);let s,o,a,l,u,c;if(null==t)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)l=e[o],u=t.map(r),c=s[u],c||(s[u]=c=[],c.dims=u,i.push(c)),c.push(n(l));return i}Uc.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Vc.concat(zc)},{name:"as",type:"string",array:!0,default:["value","density"]}]},pt(Uc,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=$c(e.distribution,function(e){return()=>e.materialize(e.SOURCE).source}(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";"pdf"!==o&&"cdf"!==o&&ae("Invalid density method: "+o),e.extent||i.data||ae("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],l=Ja(o,e.extent||ot(i.data()),r,s).map(e=>{const t={};return t[a[0]]=e[0],t[a[1]]=e[1],mo(t)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function Gc(e){Ho.call(this,null,e)}Gc.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Hc(e){Ao.call(this,null,Wc,e),this.modified(!0)}function Wc(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:te(n=>t(n,e),ie(t),ne(t))}function Xc(e){Ho.call(this,[void 0,void 0],e)}function qc(e,t){Ao.call(this,e),this.parent=t,this.count=0}function Kc(e){Ho.call(this,{},e),this._keys=dt();const t=this._targets=[];t.active=0,t.forEach=e=>{for(let n=0,i=t.active;n<i;++n)e(t[n],n,t)}}function Zc(e){Ao.call(this,null,Qc,e)}function Qc(e){return this.value&&!e.modified()?this.value:Ee(e.name)?Xe(e.name).map(e=>ue(e)):ue(e.name,e.as)}function Jc(e){Ho.call(this,dt(),e)}function ed(e){Ho.call(this,[],e)}function td(e){Ho.call(this,[],e)}function nd(e){Ho.call(this,null,e)}function id(e){Ho.call(this,[],e)}pt(Gc,Ho,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,i=Yc(t.source,e.groupby,de),r=e.smooth||!1,s=e.field,o=e.step||((e,t)=>Ct(ot(e,t))/30)(n,s),a=vo((e,t)=>s(e)-s(t)),l=e.as||"bin",u=i.length;let c,d=1/0,h=-1/0,p=0;for(;p<u;++p){const e=i[p].sort(a);c=-1;for(const t of pa(e,o,r,s))t<d&&(d=t),t>h&&(h=t),e[++c][l]=t}return this.value={start:d,stop:h,step:o},t.reflow(!0).modifies(l)}}),pt(Hc,Ao),Xc.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},pt(Xc,Ho,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||null==s)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,e=>{const t=Me(i(e));null!=t&&(t<s&&(s=t),t>o&&(o=t))}),!Number.isFinite(s)||!Number.isFinite(o)){let e=ne(i);e&&(e=` for field "${e}"`),t.dataflow.warn(`Infinite extent${e}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}}),pt(qc,Ao,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),pt(Kc,Ho,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s,o,a=ut(r,e)&&r[e];return a?a.value.stamp<n.stamp&&(a.init(n),this.activate(a)):(o=i||(o=this._group[e])&&o.tuple,s=n.dataflow,a=new qc(n.fork(n.NO_SOURCE),this),s.add(a).connect(t(s,e,o)),r[e]=a,this.activate(a)),a},clean(){const e=this.value;let t=0;for(const n in e)if(0===e[n].count){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const e=this._targets.filter(e=>e&&e.count>0);this.initTargets(e)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&null!=t[r];++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=e=>this.subflow(e,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{const t=po(e),n=s.get(t);void 0!==n&&(s.delete(t),a(n).rem(e))}),t.visit(t.ADD,e=>{const t=i(e);s.set(po(e),t),a(t).add(e)}),o||t.modified(i.fields)?t.visit(t.MOD,e=>{const t=po(e),n=s.get(t),r=i(e);n===r?a(r).mod(e):(s.set(t,r),a(n).rem(e),a(r).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{a(s.get(po(e))).mod(e)}),o&&t.visit(t.REFLOW,e=>{const t=po(e),n=s.get(t),r=i(e);n!==r&&(s.set(t,r),a(n).rem(e),a(r).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}}),pt(Zc,Ao),Jc.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},pt(Jc,Ho,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,l=e.expr;let u=!0;function c(t){const n=po(t),r=l(t,e),c=i.get(n);r&&c?(i.delete(n),s.push(t)):r||c?u&&r&&!c&&a.push(t):(i.set(n,1),o.push(t))}return t.visit(t.REM,e=>{const t=po(e);i.has(t)?i.delete(t):o.push(e)}),t.visit(t.ADD,t=>{l(t,e)?s.push(t):i.set(po(t),1)}),t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}}),ed.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},pt(ed,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=jc(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,e=>{const t=i.map(t=>t(e)),a=t.reduce((e,t)=>Math.max(e,t.length),0);let l,u,c,d=0;for(;d<a;++d){for(u=go(e),l=0;l<o;++l)u[r[l]]=null==(c=t[l][d])?null:c;s&&(u[s]=d),n.add.push(u)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}}),td.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]},pt(td,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(ne),s=e.as||["key","value"],o=s[0],a=s[1],l=i.length;return n.rem=this.value,t.visit(t.SOURCE,e=>{for(let t,s=0;s<l;++s)t=go(e),t[o]=r[s],t[a]=i[s](e),n.add.push(t)}),this.value=n.source=n.add,n.modifies(s)}}),nd.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]},pt(nd,Ho,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,t=>t[i]=n(t,e))}}),pt(id,Ho,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r,s,o,a=this.value,l=e.size-a.length;if(l>0){for(r=[];--l>=0;)r.push(o=mo(i(e))),a.push(o);n.add=n.add.length?n.materialize(n.ADD).add.concat(r):r}else s=a.slice(0,-l),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(s):s,a=a.slice(-l);return n.source=this.value=a,n}});const rd={value:"value",median:ra,mean:function(e,t){let n=0,i=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,i+=t);else{let r=-1;for(let s of e)null!=(s=t(s,++r,e))&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n},min:Qo,max:Zo},sd=[];function od(e){Ho.call(this,[],e)}function ad(e){Oc.call(this,e)}function ld(e){Ho.call(this,null,e)}function ud(e){Ao.call(this,null,cd,e)}function cd(e){return this.value&&!e.modified()?this.value:Tt(e.fields,e.flat)}function dd(e){Ho.call(this,[],e),this._pending=null}function hd(e,t,n){n.forEach(mo);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function pd(e){Ho.call(this,{},e)}function fd(e){Ao.call(this,null,md,e)}function md(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i,r,s=1/0,o=-1/0;for(i=0;i<n;++i)r=t[i],r[0]<s&&(s=r[0]),r[1]>o&&(o=r[1]);return[s,o]}function gd(e){Ao.call(this,null,_d,e)}function _d(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function yd(e){Ho.call(this,null,e)}function vd(e){Oc.call(this,e)}function bd(e){Kc.call(this,e)}function Td(e){Ho.call(this,null,e)}function xd(e){Ho.call(this,null,e)}function Ed(e){Ho.call(this,null,e)}od.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},pt(od,Ho,{transform(e,t){var n,i,r,s,o,a,l,u,c,d,h=t.fork(t.ALL),p=function(e){var t,n=e.method||rd.value;if(null!=rd[n])return n===rd.value?(t=void 0!==e.value?e.value:0,()=>t):rd[n];ae("Unrecognized imputation method: "+n)}(e),f=function(e){const t=e.field;return e=>e?t(e):NaN}(e),m=ne(e.field),g=ne(e.key),_=(e.groupby||[]).map(ne),y=function(e,t,n,i){var r,s,o,a,l,u,c,d,h=e=>e(d),p=[],f=i?i.slice():[],m={},g={};for(f.forEach((e,t)=>m[e]=t+1),a=0,c=e.length;a<c;++a)u=n(d=e[a]),l=m[u]||(m[u]=f.push(u)),(o=g[s=(r=t?t.map(h):sd)+""])||(o=g[s]=[],p.push(o),o.values=r),o[l-1]=d;return p.domain=f,p}(t.source,e.groupby,e.key,e.keyvals),v=[],b=this.value,T=y.domain.length;for(o=0,u=y.length;o<u;++o)for(r=(n=y[o]).values,i=NaN,l=0;l<T;++l)if(null==n[l]){for(s=y.domain[l],d={_impute:!0},a=0,c=r.length;a<c;++a)d[_[a]]=r[a];d[g]=s,d[m]=Number.isNaN(i)?i=p(n,f):i,v.push(mo(d))}return v.length&&(h.add=h.materialize(h.ADD).add.concat(v)),b.length&&(h.rem=h.materialize(h.REM).rem.concat(b)),this.value=v,h}}),ad.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:vc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]},pt(ad,Oc,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,e=>n.add(e))):(r=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{st(e,r[n.cellkey(e)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}}),ld.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]},pt(ld,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Yc(i,e.groupby,e.field),s=(e.groupby||[]).map(ne),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",l=e.as||["value","density"],u=[];let c=e.extent,d=e.steps||e.minsteps||25,h=e.steps||e.maxsteps||200;"pdf"!==a&&"cdf"!==a&&ae("Invalid density method: "+a),"shared"===e.resolve&&(c||(c=ot(i,e.field)),d=h=e.steps||h),r.forEach(t=>{const n=wa(t,o)[a],i=e.counts?t.length:1;Ja(n,c||ot(t),d,h).forEach(e=>{const n={};for(let e=0;e<s.length;++e)n[s[e]]=t.dims[e];n[l[0]]=e[0],n[l[1]]=e[1]*i,u.push(mo(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}}),pt(ud,Ao),pt(dd,Ho,{transform(e,t){const n=t.dataflow;if(this._pending)return hd(this,t,this._pending);if(function(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}(e))return t.StopPropagation;if(e.values)return hd(this,t,n.parse(e.values,e.format));if(e.async){const t=n.request(e.url,e.format).then(e=>(this._pending=Xe(e.data),e=>e.touch(this)));return{async:t}}return n.request(e.url,e.format).then(e=>hd(this,t,Xe(e.data)))}}),pd.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},pt(pd,Ho,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=null==e.default?null:e.default,o=e.modified(),a=n.length;let l,u,c,d=o?t.SOURCE:t.ADD,h=t,p=e.as;return r?(u=r.length,a>1&&!p&&ae('Multi-field lookup requires explicit "as" parameter.'),p&&p.length!==a*u&&ae('The "as" parameter has too few output field names.'),p=p||r.map(ne),l=function(e){for(var t,o,l=0,c=0;l<a;++l)if(null==(o=i.get(n[l](e))))for(t=0;t<u;++t,++c)e[p[c]]=s;else for(t=0;t<u;++t,++c)e[p[c]]=r[t](o)}):(p||ae("Missing output field names."),l=function(e){for(var t,r=0;r<a;++r)t=i.get(n[r](e)),e[p[r]]=null==t?s:t}),o?h=t.reflow(!0):(c=n.some(e=>t.modified(e.fields)),d|=c?t.MOD:0),t.visit(d,l),h.modifies(p)}}),pt(fd,Ao),pt(gd,Ao),pt(yd,Ho,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),vd.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:vc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},pt(vd,Oc,{_transform:Oc.prototype.transform,transform(e,t){return this._transform(function(e,t){const n=e.field,i=e.value,r=("count"===e.op?"__count__":e.op)||"sum",s=ie(n).concat(ie(i)),o=function(e,t,n){const i={},r=[];return n.visit(n.SOURCE,t=>{const n=e(t);i[n]||(i[n]=1,r.push(n))}),r.sort(Je),t?r.slice(0,t):r}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(e=>function(e,t,n,i){return te(i=>t(i)===e?n(i):NaN,i,e+"")}(e,n,i,s)),as:o.map(e=>e+""),modified:e.modified.bind(e)}}(e,t),t)}}),pt(bd,Kc,{transform(e,t){const n=e.subflow,i=e.field,r=e=>this.subflow(po(e),n,t,e);return(e.modified("field")||i&&t.modified(ie(i)))&&ae("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,e=>{const t=r(e);i(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{const t=r(e);i(e).forEach(e=>t.add(mo(e)))}),t.visit(t.REM,e=>{const t=r(e);i(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>r(e).mod(e)),t.visit(t.ADD,e=>r(e).add(e)),t.visit(t.REM,e=>r(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),Td.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},pt(Td,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=jc(e.fields,e.as||[]),s=i?(e,t)=>function(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}(e,t,i,r):_o;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,e=>{const t=po(e);n.rem.push(o[t]),o[t]=null}),t.visit(t.ADD,e=>{const t=s(e,mo({}));o[po(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(s(e,o[po(e)]))}),n}}),pt(xd,Ho,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Ed.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function wd(e){Ho.call(this,null,e)}function Id(e){Ho.call(this,[],e),this.count=0}function Ad(e){Ho.call(this,null,e)}function Sd(e){Ho.call(this,null,e),this.modified(!0)}function Cd(e){Ho.call(this,null,e)}pt(Ed,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=Yc(t.materialize(t.SOURCE).source,e.groupby,e.field),s=(e.groupby||[]).map(ne),o=[],a=e.step||.01,l=e.probs||tl(a/2,1-1e-14,a),u=l.length;return r.forEach(e=>{const t=oa(e,l);for(let n=0;n<u;++n){const r={};for(let t=0;t<s.length;++t)r[s[t]]=e.dims[t];r[i[0]]=l[n],r[i[1]]=t[n],o.push(mo(r))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=o,n}}),pt(wd,Ho,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,e=>{const t=po(e);n.rem.push(i[t]),i[t]=null}),t.visit(t.ADD,e=>{const t=go(e);i[po(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{const t=i[po(e)];for(const i in e)t[i]=e[i],n.modifies(i);n.mod.push(t)})),n}}),Id.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},pt(Id,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((e,t)=>(e[po(t)]=1,e),{});let o=this.value,a=this.count,l=0;function u(e){let t,i;o.length<r?o.push(e):(i=~~((a+1)*ca()),i<o.length&&i>=l&&(t=o[i],s[po(t)]&&n.rem.push(t),o[i]=e)),++a}if(t.rem.length&&(t.visit(t.REM,e=>{const t=po(e);s[t]&&(s[t]=-1,n.rem.push(e)),--a}),o=o.filter(e=>-1!==s[po(e)])),(t.rem.length||i)&&o.length<r&&t.source&&(l=a=o.length,t.visit(t.SOURCE,e=>{s[po(e)]||u(e)}),l=-1),i&&o.length>r){const e=o.length-r;for(let t=0;t<e;++t)s[po(o[t])]=-1,n.rem.push(o[t]);o=o.slice(e)}return t.mod.length&&t.visit(t.MOD,e=>{s[po(e)]&&n.mod.push(e)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=o.filter(e=>!s[po(e)])),this.count=a,this.value=n.source=o,n}}),Ad.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},pt(Ad,Ho,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=tl(e.start,e.stop,e.step||1).map(e=>{const t={};return t[i]=e,mo(t)}),n.add=t.add.concat(this.value),n}}),pt(Sd,Ho,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Od=["unit0","unit1"];function Md(e){Ho.call(this,dt(),e)}function kd(e){Ho.call(this,null,e)}Cd.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:gu,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Od}]},pt(Cd,Ho,{transform(e,t){const n=e.field,i=!1!==e.interval,r="utc"===e.timezone,s=this._floor(e,t),o=(r?Hu:Gu)(s.unit).offset,a=e.as||Od,l=a[0],u=a[1],c=s.step;let d=s.start||1/0,h=s.stop||-1/0,p=t.ADD;return(e.modified()||t.modified(ie(n)))&&(p=(t=t.reflow(!0)).SOURCE,d=1/0,h=-1/0),t.visit(p,e=>{const t=n(e);let r,a;null==t?(e[l]=null,i&&(e[u]=null)):(e[l]=r=a=s(t),i&&(e[u]=a=o(r,c)),r<d&&(d=r),a>h&&(h=a))}),s.start=d,s.stop=h,t.modifies(i?a:l)},_floor(e,t){const n="utc"===e.timezone,{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:pc({extent:e.extent||ot(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=yu(i),o=this.value||{},a=(n?zu:$u)(s,r);return a.unit=Oe(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}}),pt(Md,Ho,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=e=>r.set(i(e),e);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,e=>r.delete(i(e))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}}),pt(kd,Ho,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(vo(e.sort)):t.source).map(e.field))}});const Rd={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=Rd.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){(t=+t)>0||ae("ntile num must be greater than zero.");const n=Rd.cume_dist(),i=n.next;return{init:n.init,next:e=>Math.ceil(t*i(e))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return(t=+t)>0||ae("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return null!=i?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=function(e,t,n){for(let i=t.length;n<i;++n){if(null!=e(t[n]))return n}return-1}(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};const Nd=Object.keys(Rd);function Dd(e){const t=Xe(e.ops),n=Xe(e.fields),i=Xe(e.params),r=Xe(e.as),s=this.outputs=[],o=this.windows=[],a={},l={},u=[],c=[];let d=!0;function h(e){Xe(ie(e)).forEach(e=>a[e]=1)}h(e.sort),t.forEach((e,t)=>{const a=n[t],p=ne(a),f=mc(e,p,r[t]);if(h(a),s.push(f),ut(Rd,e))o.push(function(e,t,n,i){const r=Rd[e](t,n);return{init:r.init||he,update:function(e,t){t[i]=r.next(e)}}}(e,n[t],i[t],f));else{if(null==a&&"count"!==e&&ae("Null aggregate field specified."),"count"===e)return void u.push(f);d=!1;let t=l[p];t||(t=l[p]=[],t.field=a,c.push(t)),t.push(bc(e,f))}}),(u.length||c.length)&&(this.cell=function(e,t,n){e=e.map(e=>Ac(e,e.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new Sc;return i.add=function(e){if(i.num+=1,!n){a&&a.add(e);for(let t=0;t<r;++t)s[t].add(s[t].get(e),e)}},i.rem=function(e){if(i.num-=1,!n){a&&a.rem(e);for(let t=0;t<r;++t)s[t].rem(s[t].get(e),e)}},i.set=function(e){let r,o;for(a&&a.values(),r=0,o=t.length;r<o;++r)e[t[r]]=i.num;if(!n)for(r=0,o=s.length;r<o;++r)s[r].set(e)},i.init=function(){i.num=0,a&&a.reset();for(let e=0;e<r;++e)s[e].init()},i}(c,u,d)),this.inputs=Object.keys(a)}const Fd=Dd.prototype;function Ld(e){Ho.call(this,{},e),this._mlen=0,this._mods=[]}function Pd(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),l=a.length,u=s?nl(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||it(-1)};t.init();for(let e=0;e<l;++e)Bd(c,o,e,l),s&&$d(c,u),t.update(c,a[e])}function Bd(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=null==t[0]?0:Math.max(0,n-Math.abs(t[0])),e.i1=null==t[1]?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function $d(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}function Ud(e,t,n){return e.fields=t||[],e.fname=n,e}function Vd(e){return 1===e.length?zd(e[0]):jd(e)}Fd.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},Fd.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)},Ld.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Nd.concat(vc)},{name:"params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]},pt(Ld,Ho,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=vo(e.sort),r=fc(e.groupby),s=e=>this.group(r(e));let o=this.state;o&&!n||(o=this.state=new Dd(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,e=>s(e).add(e))):(t.visit(t.REM,e=>s(e).remove(e)),t.visit(t.ADD,e=>s(e).add(e)));for(let t=0,n=this._mlen;t<n;++t)Pd(this._mods[t],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=kc(po),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});const zd=e=>function(t){return t[e]},jd=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function Yd(e){throw Error(e)}function Gd(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||Yd("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&Yd("Access path missing closing bracket: "+e),o&&Yd("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function Hd(e,t,n){const i=Gd(e);return e=1===i.length?i[0]:e,Ud((n&&n.get||Vd)(i),[e],t||e)}Hd("id");const Wd=Ud(e=>e,[],"identity"),Xd=(Ud(()=>0,[],"zero"),Ud(()=>1,[],"one"),Ud(()=>!0,[],"true"));Ud(()=>!1,[],"false");var qd=Array.isArray;function Kd(e){return e===Object(e)}function Zd(e){return e[e.length-1]}function Qd(e){return null==e||""===e?null:+e}function Jd(e){return null!=e?qd(e)?e:[e]:[]}function eh(e){return"function"==typeof e}function th(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function nh(e,t){return Object.hasOwn(e,t)}function ih(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),th(i,n)}function rh(e){return"string"==typeof e}function sh(e){return qd(e)?"["+e.map(sh)+"]":Kd(e)||rh(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function oh(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function ah(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function lh(e){this._context=e}function uh(){}function ch(e){this._context=e}function dh(e){this._context=e}function hh(e,t){this._basis=new lh(e),this._beta=t}lh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ah(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ah(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ch.prototype={areaStart:uh,areaEnd:uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ah(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},dh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:ah(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},hh.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i,r=e[0],s=t[0],o=e[n]-r,a=t[n]-s,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(r+i*o),this._beta*t[l]+(1-this._beta)*(s+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const ph=function e(t){function n(e){return 1===t?new lh(e):new hh(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function fh(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function mh(e,t){this._context=e,this._k=(1-t)/6}mh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:fh(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fh(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const gh=function e(t){function n(e){return new mh(e,t)}return n.tension=function(t){return e(+t)},n}(0);function _h(e,t){this._context=e,this._k=(1-t)/6}_h.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fh(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const yh=function e(t){function n(e){return new _h(e,t)}return n.tension=function(t){return e(+t)},n}(0);function vh(e,t){this._context=e,this._k=(1-t)/6}vh.prototype={areaStart:uh,areaEnd:uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fh(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const bh=function e(t){function n(e){return new vh(e,t)}return n.tension=function(t){return e(+t)},n}(0),Th=Math.abs,xh=Math.atan2,Eh=Math.cos,wh=Math.max,Ih=Math.min,Ah=Math.sin,Sh=Math.sqrt,Ch=1e-12,Oh=Math.PI,Mh=Oh/2,kh=2*Oh;function Rh(e){return e>=1?Mh:e<=-1?-Mh:Math.asin(e)}function Nh(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Ch){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ch){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function Dh(e,t){this._context=e,this._alpha=t}Dh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Nh(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Fh=function e(t){function n(e){return t?new Dh(e,t):new mh(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Lh(e,t){this._context=e,this._alpha=t}Lh.prototype={areaStart:uh,areaEnd:uh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Nh(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ph=function e(t){function n(e){return t?new Lh(e,t):new vh(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Bh(e,t){this._context=e,this._alpha=t}Bh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Nh(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $h=function e(t){function n(e){return t?new Bh(e,t):new _h(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Uh(e){this._context=e}function Vh(e){return new Uh(e)}function zh(e){this._context=e}function jh(e){return e<0?-1:1}function Yh(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(jh(s)+jh(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function Gh(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Hh(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function Wh(e){this._context=e}function Xh(e){this._context=new qh(e)}function qh(e){this._context=e}function Kh(e){this._context=e}function Zh(e){var t,n,i=e.length-1,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(r[i-1]=o[i-1]/s[i-1],t=i-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function Qh(e,t){this._context=e,this._t=t}function Jh(e){return function(){return e}}Uh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},zh.prototype={areaStart:uh,areaEnd:uh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},Wh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Hh(this,this._t0,Gh(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Hh(this,Gh(this,n=Yh(this,e,t)),n);break;default:Hh(this,this._t0,n=Yh(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Xh.prototype=Object.create(Wh.prototype)).point=function(e,t){Wh.prototype.point.call(this,t,e)},qh.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}},Kh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=Zh(e),r=Zh(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Qh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const ep=Math.PI,tp=2*ep,np=1e-6,ip=tp-np;function rp(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class sp{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?rp:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rp;const n=10**t;return function(e){this._+=e[0];for(let t=1,i=e.length;t<i;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,i){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,t,n,i,r,s){this._append`C${+e},${+t},${+n},${+i},${this._x1=+r},${this._y1=+s}`}arcTo(e,t,n,i,r){if(e=+e,t=+t,n=+n,i=+i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let s=this._x1,o=this._y1,a=n-e,l=i-t,u=s-e,c=o-t,d=u*u+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>np)if(Math.abs(c*a-l*u)>np&&r){let h=n-s,p=i-o,f=a*a+l*l,m=h*h+p*p,g=Math.sqrt(f),_=Math.sqrt(d),y=r*Math.tan((ep-Math.acos((f+d-m)/(2*g*_)))/2),v=y/_,b=y/g;Math.abs(v-1)>np&&this._append`L${e+v*u},${t+v*c}`,this._append`A${r},${r},0,0,${+(c*h>u*p)},${this._x1=e+b*a},${this._y1=t+b*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,i,r,s){if(e=+e,t=+t,s=!!s,(n=+n)<0)throw new Error(`negative radius: ${n}`);let o=n*Math.cos(i),a=n*Math.sin(i),l=e+o,u=t+a,c=1^s,d=s?i-r:r-i;null===this._x1?this._append`M${l},${u}`:(Math.abs(this._x1-l)>np||Math.abs(this._y1-u)>np)&&this._append`L${l},${u}`,n&&(d<0&&(d=d%tp+tp),d>ip?this._append`A${n},${n},0,1,${c},${e-o},${t-a}A${n},${n},0,1,${c},${this._x1=l},${this._y1=u}`:d>np&&this._append`A${n},${n},0,${+(d>=ep)},${c},${this._x1=e+n*Math.cos(r)},${this._y1=t+n*Math.sin(r)}`)}rect(e,t,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function op(){return new sp}function ap(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new sp(t)}function lp(e){return e.innerRadius}function up(e){return e.outerRadius}function cp(e){return e.startAngle}function dp(e){return e.endAngle}function hp(e){return e&&e.padAngle}function pp(e,t,n,i,r,s,o){var a=e-n,l=t-i,u=(o?s:-s)/Sh(a*a+l*l),c=u*l,d=-u*a,h=e+c,p=t+d,f=n+c,m=i+d,g=(h+f)/2,_=(p+m)/2,y=f-h,v=m-p,b=y*y+v*v,T=r-s,x=h*m-f*p,E=(v<0?-1:1)*Sh(wh(0,T*T*b-x*x)),w=(x*v-y*E)/b,I=(-x*y-v*E)/b,A=(x*v+y*E)/b,S=(-x*y+v*E)/b,C=w-g,O=I-_,M=A-g,k=S-_;return C*C+O*O>M*M+k*k&&(w=A,I=S),{cx:w,cy:I,x01:-c,y01:-d,x11:w*(r/T-1),y11:I*(r/T-1)}}op.prototype=sp.prototype;Array.prototype.slice;function fp(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function mp(e){return e[0]}function gp(e){return e[1]}function _p(e,t){var n=Jh(!0),i=null,r=Vh,s=null,o=ap(a);function a(a){var l,u,c,d=(a=fp(a)).length,h=!1;for(null==i&&(s=r(c=o())),l=0;l<=d;++l)!(l<d&&n(u=a[l],l,a))===h&&((h=!h)?s.lineStart():s.lineEnd()),h&&s.point(+e(u,l,a),+t(u,l,a));if(c)return s=null,c+""||null}return e="function"==typeof e?e:void 0===e?mp:Jh(e),t="function"==typeof t?t:void 0===t?gp:Jh(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:Jh(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:Jh(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:Jh(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(s=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=s=null:s=r(i=e),a):i},a}function yp(e,t,n){var i=null,r=Jh(!0),s=null,o=Vh,a=null,l=ap(u);function u(u){var c,d,h,p,f,m=(u=fp(u)).length,g=!1,_=new Array(m),y=new Array(m);for(null==s&&(a=o(f=l())),c=0;c<=m;++c){if(!(c<m&&r(p=u[c],c,u))===g)if(g=!g)d=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=c-1;h>=d;--h)a.point(_[h],y[h]);a.lineEnd(),a.areaEnd()}g&&(_[c]=+e(p,c,u),y[c]=+t(p,c,u),a.point(i?+i(p,c,u):_[c],n?+n(p,c,u):y[c]))}if(f)return a=null,f+""||null}function c(){return _p().defined(r).curve(o).context(s)}return e="function"==typeof e?e:void 0===e?mp:Jh(+e),t="function"==typeof t?t:Jh(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?gp:Jh(+n),u.x=function(t){return arguments.length?(e="function"==typeof t?t:Jh(+t),i=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:Jh(+t),u):e},u.x1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Jh(+e),u):i},u.y=function(e){return arguments.length?(t="function"==typeof e?e:Jh(+e),n=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:Jh(+e),u):t},u.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:Jh(+e),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(e){return arguments.length?(r="function"==typeof e?e:Jh(!!e),u):r},u.curve=function(e){return arguments.length?(o=e,null!=s&&(a=o(s)),u):o},u.context=function(e){return arguments.length?(null==e?s=a=null:a=o(s=e),u):s},u}Sh(3);const vp={draw(e,t){const n=Sh(t/Oh);e.moveTo(n,0),e.arc(0,0,n,0,kh)}},bp=(Sh(1/3),Ah(Oh/10)/Ah(7*Oh/10));Ah(kh/10),Eh(kh/10),Sh(3),Sh(3),Sh(3),Sh(12);function Tp(e,t){if("undefined"!=typeof document&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const xp=()=>"undefined"!=typeof Image?Image:null;var Ep={},wp={};function Ip(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'}).join(",")+"}")}function Ap(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var i in e)i in t||n.push(t[i]=i)}),n}function Sp(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function Cp(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function(e){return e<0?"-"+Sp(-e,6):e>9999?"+"+Sp(e,6):Sp(e,4)}(e.getUTCFullYear())+"-"+Sp(e.getUTCMonth()+1,2)+"-"+Sp(e.getUTCDate(),2)+(r?"T"+Sp(t,2)+":"+Sp(n,2)+":"+Sp(i,2)+"."+Sp(r,3)+"Z":i?"T"+Sp(t,2)+":"+Sp(n,2)+":"+Sp(i,2)+"Z":n||t?"T"+Sp(t,2)+":"+Sp(n,2)+"Z":"")}function Op(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],s=e.length,o=0,a=0,l=s<=0,u=!1;function c(){if(l)return wp;if(u)return u=!1,Ep;var t,i,r=o;if(34===e.charCodeAt(r)){for(;o++<s&&34!==e.charCodeAt(o)||34===e.charCodeAt(++o););return(t=o)>=s?l=!0:10===(i=e.charCodeAt(o++))?u=!0:13===i&&(u=!0,10===e.charCodeAt(o)&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o<s;){if(10===(i=e.charCodeAt(t=o++)))u=!0;else if(13===i)u=!0,10===e.charCodeAt(o)&&++o;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,s)}for(10===e.charCodeAt(s-1)&&--s,13===e.charCodeAt(s-1)&&--s;(i=c())!==wp;){for(var d=[];i!==Ep&&i!==wp;)d.push(i),i=c();t&&null==(d=t(d,a++))||r.push(d)}return r}function r(t,n){return t.map(function(t){return n.map(function(e){return o(t[e])}).join(e)})}function s(t){return t.map(o).join(e)}function o(e){return null==e?"":e instanceof Date?Cp(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,r,s=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?function(e,t){var n=Ip(e);return function(i,r){return t(n(i),r,e)}}(e,t):Ip(e)});return s.columns=r||[],s},parseRows:i,format:function(t,n){return null==n&&(n=Ap(t)),[n.map(o).join(e)].concat(r(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=Ap(e)),r(e,t).join("\n")},formatRows:function(e){return e.map(s).join("\n")},formatRow:s,formatValue:o}}const Mp=Math.sqrt(50),kp=Math.sqrt(10),Rp=Math.sqrt(2);function Np(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=Mp?10:s>=kp?5:s>=Rp?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?Np(e,t,2*n):[a,l,u]}function Dp(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const i=t<e,[r,s,o]=i?Np(t,e,n):Np(e,t,n);if(!(s>=r))return[];const a=s-r+1,l=new Array(a);if(i)if(o<0)for(let e=0;e<a;++e)l[e]=(s-e)/-o;else for(let e=0;e<a;++e)l[e]=(s-e)*o;else if(o<0)for(let e=0;e<a;++e)l[e]=(r+e)/-o;else for(let e=0;e<a;++e)l[e]=(r+e)*o;return l}function Fp(e,t,n){return Np(e=+e,t=+t,n=+n)[2]}function Lp(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?Fp(t,e,n):Fp(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}var Pp,Bp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $p(e){if(!(t=Bp.exec(e)))throw new Error("invalid format: "+e);var t;return new Up({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Up(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Vp(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function zp(e){return(e=Vp(Math.abs(e)))?e[1]:NaN}function jp(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zp(t)/3)))-zp(Math.abs(e)))}function Yp(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,zp(t)-zp(e))+1}function Gp(e){return Math.max(0,-zp(Math.abs(e)))}function Hp(e,t){var n=Vp(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}$p.prototype=Up.prototype,Up.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Wp={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Hp(100*e,t),r:Hp,s:function(e,t){var n=Vp(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Pp=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Vp(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Xp(e){return e}var qp,Kp,Zp,Qp=Array.prototype.map,Jp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ef(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?Xp:(t=Qp.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,s=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[o=(o+1)%t.length];return s.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Xp:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Qp.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=$p(e)).fill,n=e.align,d=e.sign,h=e.symbol,p=e.zero,f=e.width,m=e.comma,g=e.precision,_=e.trim,y=e.type;"n"===y?(m=!0,y="g"):Wp[y]||(void 0===g&&(g=12),_=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var v="$"===h?r:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===h?s:/[%p]/.test(y)?l:"",T=Wp[y],x=/[defgprs%]/.test(y);function E(e){var r,s,l,h=v,E=b;if("c"===y)E=T(e)+E,e="";else{var w=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:T(Math.abs(e),g),_&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),w&&0===+e&&"+"!==d&&(w=!1),h=(w?"("===d?d:u:"-"===d||"("===d?"":d)+h,E=("s"===y?Jp[8+Pp/3]:"")+E+(w&&"("===d?")":""),x)for(r=-1,s=e.length;++r<s;)if(48>(l=e.charCodeAt(r))||l>57){E=(46===l?o+e.slice(r+1):e.slice(r))+E,e=e.slice(0,r);break}}m&&!p&&(e=i(e,1/0));var I=h.length+e.length+E.length,A=I<f?new Array(f-I+1).join(t):"";switch(m&&p&&(e=i(A+e,A.length?f-E.length:1/0),A=""),n){case"<":e=h+e+E+A;break;case"=":e=h+A+e+E;break;case"^":e=A.slice(0,I=A.length>>1)+h+e+E+A.slice(I);break;default:e=A+h+e+E}return a(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=d(((e=$p(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(zp(t)/3))),r=Math.pow(10,-i),s=Jp[8+i/3];return function(e){return n(r*e)+s}}}}!function(e){qp=ef(e),Kp=qp.format,Zp=qp.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const tf=new Date,nf=new Date;function rf(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,s)=>{const o=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return o;let a;do{o.push(a=new Date(+n)),t(n,s),e(n)}while(a<n&&n<i);return o},r.filter=n=>rf(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(r.count=(t,i)=>(tf.setTime(+t),nf.setTime(+i),e(tf),e(nf),Math.floor(n(tf,nf))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const sf=1e3,of=6e4,af=36e5,lf=864e5,uf=6048e5,cf=2592e6,df=31536e6,hf=rf(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*of)/lf,e=>e.getDate()-1),pf=(hf.range,rf(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/lf,e=>e.getUTCDate()-1)),ff=(pf.range,rf(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/lf,e=>Math.floor(e/lf)));ff.range;function mf(e){return rf(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*of)/uf)}const gf=mf(0),_f=mf(1),yf=mf(2),vf=mf(3),bf=mf(4),Tf=mf(5),xf=mf(6);gf.range,_f.range,yf.range,vf.range,bf.range,Tf.range,xf.range;function Ef(e){return rf(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/uf)}const wf=Ef(0),If=Ef(1),Af=Ef(2),Sf=Ef(3),Cf=Ef(4),Of=Ef(5),Mf=Ef(6),kf=(wf.range,If.range,Af.range,Sf.range,Cf.range,Of.range,Mf.range,rf(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()));kf.every=e=>isFinite(e=Math.floor(e))&&e>0?rf(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;kf.range;const Rf=rf(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Rf.every=e=>isFinite(e=Math.floor(e))&&e>0?rf(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;Rf.range;const Nf=rf(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth()),Df=(Nf.range,rf(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth())),Ff=(Df.range,rf(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sf-e.getMinutes()*of)},(e,t)=>{e.setTime(+e+t*af)},(e,t)=>(t-e)/af,e=>e.getHours())),Lf=(Ff.range,rf(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*af)},(e,t)=>(t-e)/af,e=>e.getUTCHours())),Pf=(Lf.range,rf(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sf)},(e,t)=>{e.setTime(+e+t*of)},(e,t)=>(t-e)/of,e=>e.getMinutes())),Bf=(Pf.range,rf(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*of)},(e,t)=>(t-e)/of,e=>e.getUTCMinutes())),$f=(Bf.range,rf(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sf)},(e,t)=>(t-e)/sf,e=>e.getUTCSeconds())),Uf=($f.range,rf(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e));Uf.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?rf(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Uf:null);Uf.range;const Vf="year",zf="quarter",jf="month",Yf="week",Gf="date",Hf="day",Wf="dayofyear",Xf="hours",qf="minutes",Kf="seconds",Zf="milliseconds";[Vf,zf,jf,Yf,Gf,Hf,Wf,Xf,qf,Kf,Zf].reduce((e,t,n)=>(e[t]=1+n,e),{});new Date;const Qf={[Vf]:kf,[zf]:Nf.every(3),[jf]:Nf,[Yf]:gf,[Gf]:hf,[Hf]:hf,[Wf]:hf,[Xf]:Ff,[qf]:Pf,[Kf]:$f,[Zf]:Uf},Jf={[Vf]:Rf,[zf]:Df.every(3),[jf]:Df,[Yf]:wf,[Gf]:pf,[Hf]:pf,[Wf]:pf,[Xf]:Lf,[qf]:Bf,[Kf]:$f,[Zf]:Uf};function em(e){return Qf[e]}function tm(e){return Jf[e]}const nm=[Vf,jf,Gf,Xf,qf,Kf,Zf],im=nm.slice(0,-1),rm=im.slice(0,-1),sm=rm.slice(0,-1);sm.slice(0,-1);function om(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function am(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function lm(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var um,cm,dm,hm,pm,fm={"-":"",_:" ",0:"0"},mm=/^\s*\d+/,gm=/^%/,_m=/[\\^$*+?|[\]().{}]/g;function ym(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function vm(e){return e.replace(_m,"\\$&")}function bm(e){return new RegExp("^(?:"+e.map(vm).join("|")+")","i")}function Tm(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function xm(e,t,n){var i=mm.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function Em(e,t,n){var i=mm.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Im(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Am(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Sm(e,t,n){var i=mm.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function Cm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Om(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Mm(e,t,n){var i=mm.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function km(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Rm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Nm(e,t,n){var i=mm.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Dm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Fm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Lm(e,t,n){var i=mm.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Pm(e,t,n){var i=mm.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Bm(e,t,n){var i=mm.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function $m(e,t,n){var i=gm.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Um(e,t,n){var i=mm.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Vm(e,t,n){var i=mm.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function zm(e,t){return ym(e.getDate(),t,2)}function jm(e,t){return ym(e.getHours(),t,2)}function Ym(e,t){return ym(e.getHours()%12||12,t,2)}function Gm(e,t){return ym(1+hf.count(kf(e),e),t,3)}function Hm(e,t){return ym(e.getMilliseconds(),t,3)}function Wm(e,t){return Hm(e,t)+"000"}function Xm(e,t){return ym(e.getMonth()+1,t,2)}function qm(e,t){return ym(e.getMinutes(),t,2)}function Km(e,t){return ym(e.getSeconds(),t,2)}function Zm(e){var t=e.getDay();return 0===t?7:t}function Qm(e,t){return ym(gf.count(kf(e)-1,e),t,2)}function Jm(e){var t=e.getDay();return t>=4||0===t?bf(e):bf.ceil(e)}function eg(e,t){return e=Jm(e),ym(bf.count(kf(e),e)+(4===kf(e).getDay()),t,2)}function tg(e){return e.getDay()}function ng(e,t){return ym(_f.count(kf(e)-1,e),t,2)}function ig(e,t){return ym(e.getFullYear()%100,t,2)}function rg(e,t){return ym((e=Jm(e)).getFullYear()%100,t,2)}function sg(e,t){return ym(e.getFullYear()%1e4,t,4)}function og(e,t){var n=e.getDay();return ym((e=n>=4||0===n?bf(e):bf.ceil(e)).getFullYear()%1e4,t,4)}function ag(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ym(t/60|0,"0",2)+ym(t%60,"0",2)}function lg(e,t){return ym(e.getUTCDate(),t,2)}function ug(e,t){return ym(e.getUTCHours(),t,2)}function cg(e,t){return ym(e.getUTCHours()%12||12,t,2)}function dg(e,t){return ym(1+pf.count(Rf(e),e),t,3)}function hg(e,t){return ym(e.getUTCMilliseconds(),t,3)}function pg(e,t){return hg(e,t)+"000"}function fg(e,t){return ym(e.getUTCMonth()+1,t,2)}function mg(e,t){return ym(e.getUTCMinutes(),t,2)}function gg(e,t){return ym(e.getUTCSeconds(),t,2)}function _g(e){var t=e.getUTCDay();return 0===t?7:t}function yg(e,t){return ym(wf.count(Rf(e)-1,e),t,2)}function vg(e){var t=e.getUTCDay();return t>=4||0===t?Cf(e):Cf.ceil(e)}function bg(e,t){return e=vg(e),ym(Cf.count(Rf(e),e)+(4===Rf(e).getUTCDay()),t,2)}function Tg(e){return e.getUTCDay()}function xg(e,t){return ym(If.count(Rf(e)-1,e),t,2)}function Eg(e,t){return ym(e.getUTCFullYear()%100,t,2)}function wg(e,t){return ym((e=vg(e)).getUTCFullYear()%100,t,2)}function Ig(e,t){return ym(e.getUTCFullYear()%1e4,t,4)}function Ag(e,t){var n=e.getUTCDay();return ym((e=n>=4||0===n?Cf(e):Cf.ceil(e)).getUTCFullYear()%1e4,t,4)}function Sg(){return"+0000"}function Cg(){return"%"}function Og(e){return+e}function Mg(e){return Math.floor(+e/1e3)}function kg(e){const t={};return n=>t[n]||(t[n]=e(n))}function Rg(e){const t=kg(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=$p(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=function(e,t){let n,i=e.lastIndexOf("e");if(i>0)return i;for(i=e.length;--i>t;)if(n=e.charCodeAt(i),n>=48&&n<=57)return i+1}(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if("0"!==i[s]){++s;break}return i.slice(0,s)+o}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,i,r,s){s=$p(null==s?",f":s);const o=Lp(e,i,r),a=Math.max(Math.abs(e),Math.abs(i));let l;if(null==s.precision)switch(s.type){case"s":return isNaN(l=jp(o,a))||(s.precision=l),n(s,a);case"":case"e":case"g":case"p":case"r":isNaN(l=Yp(o,a))||(s.precision=l-("e"===s.type));break;case"f":case"%":isNaN(l=Gp(o))||(s.precision=l-2*("%"===s.type))}return t(s)}}}let Ng,Dg;function Fg(){return Ng=Rg({format:Kp,formatPrefix:Zp})}function Lg(e,t,n){Kd(n=n||{})||Yd(`Invalid time multi-format specifier: ${n}`);const i=t(Kf),r=t(qf),s=t(Xf),o=t(Gf),a=t(Yf),l=t(jf),u=t(zf),c=t(Vf),d=e(n[Zf]||".%L"),h=e(n[Kf]||":%S"),p=e(n[qf]||"%I:%M"),f=e(n[Xf]||"%I %p"),m=e(n[Gf]||n[Hf]||"%a %d"),g=e(n[Yf]||"%b %d"),_=e(n[jf]||"%B"),y=e(n[zf]||"%B"),v=e(n[Vf]||"%Y");return e=>(i(e)<e?d:r(e)<e?h:s(e)<e?p:o(e)<e?f:l(e)<e?a(e)<e?m:g:c(e)<e?u(e)<e?_:y:v)(e)}function Pg(e){const t=kg(e.format),n=kg(e.utcFormat);return{timeFormat:e=>rh(e)?t(e):Lg(t,em,e),utcFormat:e=>rh(e)?n(e):Lg(n,tm,e),timeParse:kg(e.parse),utcParse:kg(e.utcParse)}}function Bg(){return Dg=Pg({format:cm,parse:dm,utcFormat:hm,utcParse:pm})}!function(e){um=function(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,l=e.shortMonths,u=bm(r),c=Tm(r),d=bm(s),h=Tm(s),p=bm(o),f=Tm(o),m=bm(a),g=Tm(a),_=bm(l),y=Tm(l),v={a:function(e){return o[e.getDay()]},A:function(e){return s[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:zm,e:zm,f:Wm,g:rg,G:og,H:jm,I:Ym,j:Gm,L:Hm,m:Xm,M:qm,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Og,s:Mg,S:Km,u:Zm,U:Qm,V:eg,w:tg,W:ng,x:null,X:null,y:ig,Y:sg,Z:ag,"%":Cg},b={a:function(e){return o[e.getUTCDay()]},A:function(e){return s[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:lg,e:lg,f:pg,g:wg,G:Ag,H:ug,I:cg,j:dg,L:hg,m:fg,M:mg,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Og,s:Mg,S:gg,u:_g,U:yg,V:bg,w:Tg,W:xg,x:null,X:null,y:Eg,Y:Ig,Z:Sg,"%":Cg},T={a:function(e,t,n){var i=p.exec(t.slice(n));return i?(e.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=d.exec(t.slice(n));return i?(e.w=h.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=_.exec(t.slice(n));return i?(e.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return w(e,t,n,i)},d:Rm,e:Rm,f:Bm,g:Cm,G:Sm,H:Dm,I:Dm,j:Nm,L:Pm,m:km,M:Fm,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:Mm,Q:Um,s:Vm,S:Lm,u:Em,U:wm,V:Im,w:xm,W:Am,x:function(e,t,i){return w(e,n,t,i)},X:function(e,t,n){return w(e,i,t,n)},y:Cm,Y:Sm,Z:Om,"%":$m};function x(e,t){return function(n){var i,r,s,o=[],a=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===e.charCodeAt(a)&&(o.push(e.slice(l,a)),null!=(r=fm[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(s=t[i])&&(i=s(n,r)),o.push(i),l=a+1);return o.push(e.slice(l,a)),o.join("")}}function E(e,t){return function(n){var i,r,s=lm(1900,void 0,1);if(w(s,e,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(t&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=am(lm(s.y,0,1))).getUTCDay(),i=r>4||0===r?If.ceil(i):If(i),i=pf.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=om(lm(s.y,0,1))).getDay(),i=r>4||0===r?_f.ceil(i):_f(i),i=hf.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?am(lm(s.y,0,1)).getUTCDay():om(lm(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,am(s)):om(s)}}function w(e,t,n,i){for(var r,s,o=0,a=t.length,l=n.length;o<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(s=T[r in fm?t.charAt(o++):r])||(i=s(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=x(n,v),v.X=x(i,v),v.c=x(t,v),b.x=x(n,b),b.X=x(i,b),b.c=x(t,b),{format:function(e){var t=x(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}(e),cm=um.format,dm=um.parse,hm=um.utcFormat,pm=um.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Fg(),Bg();const $g=/^(data:|([A-Za-z]+:)?\/\/)/,Ug=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Vg=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,zg="file://";async function jg(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function Yg(e,t){t=th({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=Ug.test(e.replace(Vg,""));null!=e&&"string"==typeof e&&a||Yd("Sanitize failure, invalid URI: "+sh(e));const l=$g.test(e);return(o=t.baseURL)&&!l&&(e.startsWith("/")||o.endsWith("/")||(e="/"+e),e=o+e),s=(r=e.startsWith(zg))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function Gg(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(e,t)=>{e?i(e):n(t)})}):Hg}async function Hg(){Yd("No file system access.")}function Wg(e){return e?async function(t,n){const i=th({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?eh(s[r])?s[r]():s.text():Yd(s.status+""+s.statusText)}:Xg}async function Xg(){Yd("No HTTP fetch method available.")}function qg(e){const t=function(t,n){const i={delimiter:e};return Kg(t,n?th(n,i):i)};return t.responseType="text",t}function Kg(e,t){return t.header&&(e=t.header.map(sh).join(t.delimiter)+"\n"+e),Op(t.delimiter).parse(e+"")}function Zg(e,t){const n=t&&t.property?Hd(t.property):Wd;return!Kd(e)||(i=e,"function"==typeof Buffer&&eh(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!qd(e)&&function(e){return e&&eh(e[Symbol.iterator])}(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}Kg.responseType="text",Zg.responseType="json";const Qg={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function Jg(e,t){let n,i,r,s;return e=Zg(e,t),t&&t.feature?(n=Tn,r=t.feature):t&&t.mesh?(n=In,r=t.mesh,s=Qg[t.filter]):Yd("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):Yd("Invalid TopoJSON object: "+r),i&&i.features||[i]}Jg.responseType="json";qg(","),qg("\t");const e_=function(e,t){return n=>({options:n||{},sanitize:Yg,load:jg,fileAccess:!1,file:Gg(t),http:Wg(e)})}("undefined"!=typeof fetch&&fetch,null);function t_(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function n_(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function i_(e){let t,n,i;function r(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<0?r=t+1:s=t}while(r<s)}return r}return 2!==e.length?(t=t_,n=(t,n)=>t_(e(t),n),i=(t,n)=>e(t)-n):(t=e===t_||e===n_?e:r_,n=e,i=e),{left:r,center:function(e,t,n=0,s=e.length){const o=r(e,t,n,s-1);return o>n&&i(e[o-1],t)>-i(e[o],t)?o-1:o},right:function(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<=0?r=t+1:s=t}while(r<s)}return r}}}function r_(){return 0}function s_(e){return null===e?NaN:+e}const o_=i_(t_),a_=o_.right,l_=(o_.left,i_(s_).center,a_);function u_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function c_(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function d_(){}var h_=.7,p_=1/h_,f_="\\s*([+-]?\\d+)\\s*",m_="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",g_="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",__=/^#([0-9a-f]{3,8})$/,y_=new RegExp("^rgb\\("+[f_,f_,f_]+"\\)$"),v_=new RegExp("^rgb\\("+[g_,g_,g_]+"\\)$"),b_=new RegExp("^rgba\\("+[f_,f_,f_,m_]+"\\)$"),T_=new RegExp("^rgba\\("+[g_,g_,g_,m_]+"\\)$"),x_=new RegExp("^hsl\\("+[m_,g_,g_]+"\\)$"),E_=new RegExp("^hsla\\("+[m_,g_,g_,m_]+"\\)$"),w_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function I_(){return this.rgb().formatHex()}function A_(){return this.rgb().formatRgb()}function S_(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=__.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?C_(t):3===n?new R_(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?O_(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?O_(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=y_.exec(e))?new R_(t[1],t[2],t[3],1):(t=v_.exec(e))?new R_(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=b_.exec(e))?O_(t[1],t[2],t[3],t[4]):(t=T_.exec(e))?O_(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=x_.exec(e))?L_(t[1],t[2]/100,t[3]/100,1):(t=E_.exec(e))?L_(t[1],t[2]/100,t[3]/100,t[4]):w_.hasOwnProperty(e)?C_(w_[e]):"transparent"===e?new R_(NaN,NaN,NaN,0):null}function C_(e){return new R_(e>>16&255,e>>8&255,255&e,1)}function O_(e,t,n,i){return i<=0&&(e=t=n=NaN),new R_(e,t,n,i)}function M_(e){return e instanceof d_||(e=S_(e)),e?new R_((e=e.rgb()).r,e.g,e.b,e.opacity):new R_}function k_(e,t,n,i){return 1===arguments.length?M_(e):new R_(e,t,n,null==i?1:i)}function R_(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function N_(){return"#"+F_(this.r)+F_(this.g)+F_(this.b)}function D_(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function F_(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function L_(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $_(e,t,n,i)}function P_(e){if(e instanceof $_)return new $_(e.h,e.s,e.l,e.opacity);if(e instanceof d_||(e=S_(e)),!e)return new $_;if(e instanceof $_)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(o=t===s?(n-i)/a+6*(n<i):n===s?(i-t)/a+2:(t-n)/a+4,a/=l<.5?s+r:2-s-r,o*=60):a=l>0&&l<1?0:o,new $_(o,a,l,e.opacity)}function B_(e,t,n,i){return 1===arguments.length?P_(e):new $_(e,t,n,null==i?1:i)}function $_(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function U_(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function V_(e,t,n,i,r){var s=e*e,o=s*e;return((1-3*e+3*s-o)*t+(4-6*s+3*o)*n+(1+3*e+3*s-3*o)*i+o*r)/6}function z_(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i<t-1?e[i+2]:2*s-r;return V_((n-i/t)*t,o,r,s,a)}}function j_(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],s=e[i%t],o=e[(i+1)%t],a=e[(i+2)%t];return V_((n-i/t)*t,r,s,o,a)}}u_(d_,S_,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:I_,formatHex:I_,formatHsl:function(){return P_(this).formatHsl()},formatRgb:A_,toString:A_}),u_(R_,k_,c_(d_,{brighter:function(e){return e=null==e?p_:Math.pow(p_,e),new R_(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?h_:Math.pow(h_,e),new R_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:N_,formatHex:N_,formatRgb:D_,toString:D_})),u_($_,B_,c_(d_,{brighter:function(e){return e=null==e?p_:Math.pow(p_,e),new $_(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?h_:Math.pow(h_,e),new $_(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new R_(U_(e>=240?e-240:e+120,r,i),U_(e,r,i),U_(e<120?e+240:e-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));const Y_=e=>()=>e;function G_(e,t){return function(n){return e+n*t}}function H_(e,t){var n=t-e;return n?G_(e,n>180||n<-180?n-360*Math.round(n/360):n):Y_(isNaN(e)?t:e)}function W_(e){return 1===(e=+e)?X_:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Y_(isNaN(t)?n:t)}}function X_(e,t){var n=t-e;return n?G_(e,n):Y_(isNaN(e)?t:e)}const q_=function e(t){var n=W_(t);function i(e,t){var i=n((e=k_(e)).r,(t=k_(t)).r),r=n(e.g,t.g),s=n(e.b,t.b),o=X_(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=s(t),e.opacity=o(t),e+""}}return i.gamma=e,i}(1);function K_(e){return function(t){var n,i,r=t.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=k_(t[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=e(s),o=e(o),a=e(a),i.opacity=1,function(e){return i.r=s(e),i.g=o(e),i.b=a(e),i+""}}}var Z_=K_(z_),Q_=K_(j_);function J_(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(s){for(n=0;n<i;++n)r[n]=e[n]*(1-s)+t[n]*s;return r}}function ey(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ty(e,t){return(ey(t)?J_:ny)(e,t)}function ny(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,s=new Array(r),o=new Array(i);for(n=0;n<r;++n)s[n]=uy(e[n],t[n]);for(;n<i;++n)o[n]=t[n];return function(e){for(n=0;n<r;++n)o[n]=s[n](e);return o}}function iy(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function ry(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sy(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=uy(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var oy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ay=new RegExp(oy.source,"g");function ly(e,t){var n,i,r,s=oy.lastIndex=ay.lastIndex=0,o=-1,a=[],l=[];for(e+="",t+="";(n=oy.exec(e))&&(i=ay.exec(t));)(r=i.index)>s&&(r=t.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:ry(n,i)})),s=ay.lastIndex;return s<t.length&&(r=t.slice(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function uy(e,t){var n,i=typeof t;return null==t||"boolean"===i?Y_(t):("number"===i?ry:"string"===i?(n=S_(t))?(t=n,q_):ly:t instanceof S_?q_:t instanceof Date?iy:ey(t)?J_:Array.isArray(t)?ny:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?sy:ry)(e,t)}function cy(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function dy(e){return+e}var hy=[0,1];function py(e){return e}function fy(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function my(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r<i?(i=fy(r,i),s=n(o,s)):(i=fy(i,r),s=n(s,o)),function(e){return s(i(e))}}function gy(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)r[o]=fy(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(t){var n=l_(e,t,1,i)-1;return s[n](r[n](t))}}function _y(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function yy(){var e,t,n,i,r,s,o=hy,a=hy,l=uy,u=py;function c(){var e=Math.min(o.length,a.length);return u!==py&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(o[0],o[e-1])),i=e>2?gy:my,r=s=null,d}function d(t){return null==t||isNaN(t=+t)?n:(r||(r=i(o.map(e),a,l)))(e(u(t)))}return d.invert=function(n){return u(t((s||(s=i(a,o.map(e),ry)))(n)))},d.domain=function(e){return arguments.length?(o=Array.from(e,dy),c()):o.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),c()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=cy,c()},d.clamp=function(e){return arguments.length?(u=!!e||py,c()):u!==py},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,i){return e=n,t=i,c()}}function vy(){return yy()(py,py)}function by(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Ty(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function xy(e,t,n,i){var r,s=Lp(e,t,n);switch((i=$p(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=jp(s,o))||(i.precision=r),Zp(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=Yp(s,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=Gp(s))||(i.precision=r-2*("%"===i.type))}return Kp(i)}function Ey(e){var t=e.domain;return e.ticks=function(e){var n=t();return Dp(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return xy(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,s=t(),o=0,a=s.length-1,l=s[o],u=s[a],c=10;for(u<l&&(r=l,l=u,u=r,r=o,o=a,a=r);c-- >0;){if((r=Fp(l,u,n))===i)return s[o]=l,s[a]=u,t(s);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return e},e}function wy(e,t){var n,i=0,r=(e=e.slice()).length-1,s=e[i],o=e[r];return o<s&&(n=i,i=r,r=n,n=s,s=o,o=n),e[i]=t.floor(s),e[r]=t.ceil(o),e}function Iy(e){return Math.log(e)}function Ay(e){return Math.exp(e)}function Sy(e){return-Math.log(-e)}function Cy(e){return-Math.exp(-e)}function Oy(e){return isFinite(e)?+("1e"+e):e<0?0:e}function My(e){return(t,n)=>-e(-t,n)}function ky(e){const t=e(Iy,Ay),n=t.domain;let i,r,s=10;function o(){return i=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(s),r=function(e){return 10===e?Oy:e===Math.E?Math.exp:t=>Math.pow(e,t)}(s),n()[0]<0?(i=My(i),r=My(r),e(Sy,Cy)):e(Iy,Ay),t}return t.base=function(e){return arguments.length?(s=+e,o()):s},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{const t=n();let o=t[0],a=t[t.length-1];const l=a<o;l&&([o,a]=[a,o]);let u,c,d=i(o),h=i(a);const p=null==e?10:+e;let f=[];if(!(s%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),o>0){for(;d<=h;++d)for(u=1;u<s;++u)if(c=d<0?u/r(-d):u*r(d),!(c<o)){if(c>a)break;f.push(c)}}else for(;d<=h;++d)for(u=s-1;u>=1;--u)if(c=d>0?u/r(-d):u*r(d),!(c<o)){if(c>a)break;f.push(c)}2*f.length<p&&(f=Dp(o,a,p))}else f=Dp(d,h,Math.min(h-d,p)).map(r);return l?f.reverse():f},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===s?"s":","),"function"!=typeof n&&(s%1||null!=(n=$p(n)).precision||(n.trim=!0),n=Kp(n)),e===1/0)return n;const o=Math.max(1,s*e/t.ticks().length);return e=>{let t=e/r(Math.round(i(e)));return t*s<s-.5&&(t*=s),t<=o?n(e):""}},t.nice=()=>n(wy(n(),{floor:e=>r(Math.floor(i(e))),ceil:e=>r(Math.ceil(i(e)))})),t}function Ry(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Ny(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Dy(e){return e<0?-e*e:e*e}function Fy(e){var t=e(py,py),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(py,py):.5===n?e(Ny,Dy):e(Ry(n),Ry(1/n)):n},Ey(t)}function Ly(){var e=Fy(yy());return e.copy=function(){return _y(e,Ly()).exponent(e.exponent())},by.apply(e,arguments),e}function Py(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function By(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function $y(e){var t=1,n=e(Py(t),By(t));return n.constant=function(n){return arguments.length?e(Py(t=+n),By(t)):t},Ey(n)}function Uy(e,t,n,i,r,s){const o=[[$f,1,sf],[$f,5,5e3],[$f,15,15e3],[$f,30,3e4],[s,1,of],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,af],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,lf],[i,2,1728e5],[n,1,uf],[t,1,cf],[t,3,7776e6],[e,1,df]];function a(t,n,i){const r=Math.abs(n-t)/i,s=i_(([,,e])=>e).right(o,r);if(s===o.length)return e.every(Lp(t/df,n/df,i));if(0===s)return Uf.every(Math.max(Lp(t,n,i),1));const[a,l]=o[r/o[s-1][2]<o[s][2]/r?s-1:s];return a.every(l)}return[function(e,t,n){const i=t<e;i&&([e,t]=[t,e]);const r=n&&"function"==typeof n.range?n:a(e,t,n),s=r?r.range(e,+t+1):[];return i?s.reverse():s},a]}const[Vy,zy]=Uy(Rf,Df,wf,ff,Lf,Bf),[jy,Yy]=Uy(kf,Nf,gf,hf,Ff,Pf);function Gy(e){return new Date(e)}function Hy(e){return e instanceof Date?+e:+new Date(+e)}function Wy(e,t,n,i,r,s,o,a,l,u){var c=vy(),d=c.invert,h=c.domain,p=u(".%L"),f=u(":%S"),m=u("%I:%M"),g=u("%I %p"),_=u("%a %d"),y=u("%b %d"),v=u("%B"),b=u("%Y");function T(e){return(l(e)<e?p:a(e)<e?f:o(e)<e?m:s(e)<e?g:i(e)<e?r(e)<e?_:y:n(e)<e?v:b)(e)}return c.invert=function(e){return new Date(d(e))},c.domain=function(e){return arguments.length?h(Array.from(e,Hy)):h().map(Gy)},c.ticks=function(t){var n=h();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?T:u(t)},c.nice=function(e){var n=h();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?h(wy(n,e)):c},c.copy=function(){return _y(c,Wy(e,t,n,i,r,s,o,a,l,u))},c}function Xy(){var e,t,n,i,r,s=0,o=1,a=py,l=!1;function u(t){return null==t||isNaN(t=+t)?r:a(0===n?.5:(t=(i(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,i;return arguments.length?([n,i]=t,a=e(n,i),u):[a(0),a(1)]}}return u.domain=function(r){return arguments.length?([s,o]=r,e=i(s=+s),t=i(o=+o),n=e===t?0:1/(t-e),u):[s,o]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(a=e,u):a},u.range=c(uy),u.rangeRound=c(cy),u.unknown=function(e){return arguments.length?(r=e,u):r},function(r){return i=r,e=r(s),t=r(o),n=e===t?0:1/(t-e),u}}function qy(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ky(){var e=Ey(Xy()(py));return e.copy=function(){return qy(e,Ky())},Ty.apply(e,arguments)}function Zy(){var e=Fy(Xy());return e.copy=function(){return qy(e,Zy()).exponent(e.exponent())},Ty.apply(e,arguments)}function Qy(e,t){void 0===t&&(t=e,e=uy);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return s[t](e-t)}}function Jy(){var e,t,n,i,r,s,o,a=0,l=.5,u=1,c=1,d=py,h=!1;function p(e){return isNaN(e=+e)?o:(e=.5+((e=+s(e))-t)*(c*e<c*t?i:r),d(h?Math.max(0,Math.min(1,e)):e))}function f(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,d=Qy(e,[n,i,r]),p):[d(0),d(.5),d(1)]}}return p.domain=function(o){return arguments.length?([a,l,u]=o,e=s(a=+a),t=s(l=+l),n=s(u=+u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p):[a,l,u]},p.clamp=function(e){return arguments.length?(h=!!e,p):h},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=f(uy),p.rangeRound=f(cy),p.unknown=function(e){return arguments.length?(o=e,p):o},function(o){return s=o,e=o(a),t=o(l),n=o(u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p}}function ev(){var e=Fy(Jy());return e.copy=function(){return qy(e,ev()).exponent(e.exponent())},Ty.apply(e,arguments)}function tv(e,t,n=s_){if((i=e.length)&&!isNaN(t=+t)){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e);return o+(+n(e[s+1],s+1,e)-o)*(r-s)}}class nv extends Map{constructor(e,t=av){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(rv(this,e))}has(e){return super.has(rv(this,e))}set(e,t){return super.set(sv(this,e),t)}delete(e){return super.delete(ov(this,e))}}class iv extends Set{constructor(e,t=av){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const t of e)this.add(t)}has(e){return super.has(rv(this,e))}add(e){return super.add(sv(this,e))}delete(e){return super.delete(ov(this,e))}}function rv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function sv({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function ov({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(n),e.delete(i)),n}function av(e){return null!==e&&"object"==typeof e?e.valueOf():e}const lv=Symbol("implicit");function uv(){var e=new nv,t=[],n=[],i=lv;function r(r){let s=e.get(r);if(void 0===s){if(i!==lv)return i;e.set(r,s=t.push(r)-1)}return n[s%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new nv;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return uv(t,n).unknown(i)},by.apply(r,arguments),r}function cv(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function dv(e,t){var n=H_(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var hv,pv=180/Math.PI,fv={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mv(e,t,n,i,r,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),e*i<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*pv,skewX:Math.atan(l)*pv,scaleX:o,scaleY:a}}function gv(e,t,n,i){function r(e){return e.length?e.pop()+" ":""}return function(s,o){var a=[],l=[];return s=e(s),o=e(o),function(e,i,r,s,o,a){if(e!==r||i!==s){var l=o.push("translate(",null,t,null,n);a.push({i:l-4,x:ry(e,r)},{i:l-2,x:ry(i,s)})}else(r||s)&&o.push("translate("+r+t+s+n)}(s.translateX,s.translateY,o.translateX,o.translateY,a,l),function(e,t,n,s){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:ry(e,t)})):t&&n.push(r(n)+"rotate("+t+i)}(s.rotate,o.rotate,a,l),function(e,t,n,s){e!==t?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:ry(e,t)}):t&&n.push(r(n)+"skewX("+t+i)}(s.skewX,o.skewX,a,l),function(e,t,n,i,s,o){if(e!==n||t!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:ry(e,n)},{i:a-2,x:ry(t,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(e){for(var t,n=-1,i=l.length;++n<i;)a[(t=l[n]).i]=t.x(e);return a.join("")}}}var _v=gv(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fv:mv(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),yv=gv(function(e){return null==e?fv:(hv||(hv=document.createElementNS("http://www.w3.org/2000/svg","g")),hv.setAttribute("transform",e),(e=hv.transform.baseVal.consolidate())?mv((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):fv)},", ",")",")");function vv(e){return((e=Math.exp(e))+1/e)/2}const bv=function e(t,n,i){function r(e,r){var s,o,a=e[0],l=e[1],u=e[2],c=r[0],d=r[1],h=r[2],p=c-a,f=d-l,m=p*p+f*f;if(m<1e-12)o=Math.log(h/u)/t,s=function(e){return[a+e*p,l+e*f,u*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),_=(h*h-u*u+i*m)/(2*u*n*g),y=(h*h-u*u-i*m)/(2*h*n*g),v=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(y*y+1)-y);o=(b-v)/t,s=function(e){var i=e*o,r=vv(v),s=u/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+v)-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*p,l+s*f,u*r/vv(t*i+v)]}}return s.duration=1e3*o*t/Math.SQRT2,s}return r.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},r}(Math.SQRT2,2,4);function Tv(e){return function(t,n){var i=e((t=B_(t)).h,(n=B_(n)).h),r=X_(t.s,n.s),s=X_(t.l,n.l),o=X_(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=s(e),t.opacity=o(e),t+""}}}const xv=Tv(H_);var Ev=Tv(X_);const wv=Math.PI/180,Iv=180/Math.PI,Av=.96422,Sv=1,Cv=.82521,Ov=4/29,Mv=6/29,kv=3*Mv*Mv,Rv=.008856451679035631;function Nv(e){if(e instanceof Fv)return new Fv(e.l,e.a,e.b,e.opacity);if(e instanceof zv)return jv(e);e instanceof R_||(e=M_(e));var t,n,i=$v(e.r),r=$v(e.g),s=$v(e.b),o=Lv((.2225045*i+.7168786*r+.0606169*s)/Sv);return i===r&&r===s?t=n=o:(t=Lv((.4360747*i+.3850649*r+.1430804*s)/Av),n=Lv((.0139322*i+.0971045*r+.7141733*s)/Cv)),new Fv(116*o-16,500*(t-o),200*(o-n),e.opacity)}function Dv(e,t,n,i){return 1===arguments.length?Nv(e):new Fv(e,t,n,null==i?1:i)}function Fv(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function Lv(e){return e>Rv?Math.pow(e,1/3):e/kv+Ov}function Pv(e){return e>Mv?e*e*e:kv*(e-Ov)}function Bv(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $v(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Uv(e){if(e instanceof zv)return new zv(e.h,e.c,e.l,e.opacity);if(e instanceof Fv||(e=Nv(e)),0===e.a&&0===e.b)return new zv(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Iv;return new zv(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Vv(e,t,n,i){return 1===arguments.length?Uv(e):new zv(e,t,n,null==i?1:i)}function zv(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function jv(e){if(isNaN(e.h))return new Fv(e.l,0,0,e.opacity);var t=e.h*wv;return new Fv(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Yv(e,t){var n=X_((e=Dv(e)).l,(t=Dv(t)).l),i=X_(e.a,t.a),r=X_(e.b,t.b),s=X_(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=s(t),e+""}}function Gv(e){return function(t,n){var i=e((t=Vv(t)).h,(n=Vv(n)).h),r=X_(t.c,n.c),s=X_(t.l,n.l),o=X_(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=s(e),t.opacity=o(e),t+""}}}u_(Fv,Dv,c_(d_,{brighter:function(e){return new Fv(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Fv(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new R_(Bv(3.1338561*(t=Av*Pv(t))-1.6168667*(e=Sv*Pv(e))-.4906146*(n=Cv*Pv(n))),Bv(-.9787684*t+1.9161415*e+.033454*n),Bv(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),u_(zv,Vv,c_(d_,{brighter:function(e){return new zv(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new zv(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return jv(this).rgb()}}));const Hv=Gv(H_);var Wv=Gv(X_),Xv=-.14861,qv=1.78277,Kv=-.29227,Zv=-.90649,Qv=1.97294,Jv=Qv*Zv,eb=Qv*qv,tb=qv*Kv-Zv*Xv;function nb(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof ib)return new ib(e.h,e.s,e.l,e.opacity);e instanceof R_||(e=M_(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(tb*i+Jv*t-eb*n)/(tb+Jv-eb),s=i-r,o=(Qv*(n-r)-Kv*s)/Zv,a=Math.sqrt(o*o+s*s)/(Qv*r*(1-r)),l=a?Math.atan2(o,s)*Iv-120:NaN;return new ib(l<0?l+360:l,a,r,e.opacity)}(e):new ib(e,t,n,null==i?1:i)}function ib(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function rb(e){return function t(n){function i(t,i){var r=e((t=nb(t)).h,(i=nb(i)).h),s=X_(t.s,i.s),o=X_(t.l,i.l),a=X_(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=s(e),t.l=o(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,i.gamma=t,i}(1)}u_(ib,nb,c_(d_,{brighter:function(e){return e=null==e?p_:Math.pow(p_,e),new ib(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?h_:Math.pow(h_,e),new ib(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*wv,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new R_(255*(t+n*(Xv*i+qv*r)),255*(t+n*(Kv*i+Zv*r)),255*(t+n*(Qv*i)),this.opacity)}}));const sb=rb(H_);var ob=rb(X_);function ab(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}function lb(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}const ub=lb("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),cb=lb("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),db=lb("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),hb=lb("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),pb=lb("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),fb=lb("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),mb=lb("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),gb=lb("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),_b=lb("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),yb=lb("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");const vb="linear",bb="log",Tb="pow",xb="sqrt",Eb="symlog",wb="time",Ib="utc",Ab="sequential",Sb="diverging",Cb="quantile",Ob="quantize",Mb="threshold",kb="continuous",Rb="discrete",Nb="discretizing",Db="interpolating",Fb="temporal";function Lb(){const e=uv().unknown(void 0),t=e.domain,n=e.range;let i,r,s=[0,1],o=!1,a=0,l=0,u=.5;function c(){const e=t().length,c=s[1]<s[0],d=s[1-c],h=function(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}(e,a,l);let p=s[c-0];i=(d-p)/(h||1),o&&(i=Math.floor(i)),p+=(d-p-i*(e-a))*u,r=i*(1-a),o&&(p=Math.round(p),r=Math.round(r));const f=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),s=new Array(r);++i<r;)s[i]=e+i*n;return s}(e).map(e=>p+i*e);return n(c?f.reverse():f)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(s=[+e[0],+e[1]],c()):s.slice()},e.rangeRound=function(e){return s=[+e[0],+e[1]],o=!0,c()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(o=!!e,c()):o},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),a=l,c()):a},e.paddingInner=function(e){return arguments.length?(a=Math.max(0,Math.min(1,e)),c()):a},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const i=s[1]<s[0],o=i?n().reverse():n(),a=o.length-1;let l,u,c,d=+e[0],h=+e[1];return d!=d||h!=h||(h<d&&(c=d,d=h,h=c),h<o[0]||d>s[1-i])?void 0:(l=Math.max(0,a_(o,d)-1),u=d===h?l:a_(o,h)-1,d-o[l]>r+1e-10&&++l,i&&(c=l,l=a-u,u=a-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return Lb().domain(t()).range(s).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function Pb(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Pb(t())},e}var Bb=Array.prototype.map;const $b=Array.prototype.slice;const Ub=new Map,Vb=Symbol("vega_scale");function zb(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){const n=e.range();let i,r,s,o,a=t[0],l=t[1],u=-1;for(l<a&&(r=a,a=l,l=r),s=0,o=n.length;s<o;++s)n[s]>=a&&n[s]<=l&&(u<0&&(u=s),i=s);if(!(u<0))return a=e.invertExtent(n[u]),l=e.invertExtent(n[i]),[void 0===a[0]?a[1]:a[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,function(e){return e[Vb]=!0,e}(n)};return i.metadata=oh(Jd(n)),i}function jb(e,t,n){return arguments.length>1?(Ub.set(e,zb(e,t,n)),this):function(e){return Ub.has(e)}(e)?Ub.get(e):void 0}function Yb(e,t){const n=Ub.get(e);return n&&n.metadata[t]}function Gb(e){return Yb(e,Rb)}jb("identity",function e(t){var n;function i(e){return null==e||isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,dy),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,dy):[0,1],Ey(i)}),jb(vb,function e(){var t=vy();return t.copy=function(){return _y(t,e())},by.apply(t,arguments),Ey(t)},kb),jb(bb,function e(){const t=ky(yy()).domain([1,10]);return t.copy=()=>_y(t,e()).base(t.base()),by.apply(t,arguments),t},[kb,bb]),jb(Tb,Ly,kb),jb(xb,function(){return Ly.apply(null,arguments).exponent(.5)},kb),jb(Eb,function e(){var t=$y(yy());return t.copy=function(){return _y(t,e()).constant(t.constant())},by.apply(t,arguments)},kb),jb(wb,function(){return by.apply(Wy(jy,Yy,kf,Nf,gf,hf,Ff,Pf,$f,cm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},[kb,Fb]),jb(Ib,function(){return by.apply(Wy(Vy,zy,Rf,Df,wf,pf,Lf,Bf,$f,hm).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},[kb,Fb]),jb(Ab,Ky,[kb,Db]),jb(`${Ab}-${vb}`,Ky,[kb,Db]),jb(`${Ab}-${bb}`,function e(){var t=ky(Xy()).domain([1,10]);return t.copy=function(){return qy(t,e()).base(t.base())},Ty.apply(t,arguments)},[kb,Db,bb]),jb(`${Ab}-${Tb}`,Zy,[kb,Db]),jb(`${Ab}-${xb}`,function(){return Zy.apply(null,arguments).exponent(.5)},[kb,Db]),jb(`${Ab}-${Eb}`,function e(){var t=$y(Xy());return t.copy=function(){return qy(t,e()).constant(t.constant())},Ty.apply(t,arguments)},[kb,Db]),jb(`${Sb}-${vb}`,function e(){var t=Ey(Jy()(py));return t.copy=function(){return qy(t,e())},Ty.apply(t,arguments)},[kb,Db]),jb(`${Sb}-${bb}`,function e(){var t=ky(Jy()).domain([.1,1,10]);return t.copy=function(){return qy(t,e()).base(t.base())},Ty.apply(t,arguments)},[kb,Db,bb]),jb(`${Sb}-${Tb}`,ev,[kb,Db]),jb(`${Sb}-${xb}`,function(){return ev.apply(null,arguments).exponent(.5)},[kb,Db]),jb(`${Sb}-${Eb}`,function e(){var t=$y(Jy());return t.copy=function(){return qy(t,e()).constant(t.constant())},Ty.apply(t,arguments)},[kb,Db]),jb(Cb,function e(){var t,n=[],i=[],r=[];function s(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=tv(n,e/t);return o}function o(e){return null==e||isNaN(e=+e)?t:i[l_(r,e)]}return o.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},o.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(t_),s()},o.range=function(e){return arguments.length?(i=Array.from(e),s()):i.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return e().domain(n).range(i).unknown(t)},by.apply(o,arguments)},[Nb,Cb]),jb(Ob,function e(){var t,n=0,i=1,r=1,s=[.5],o=[0,1];function a(e){return null!=e&&e<=e?o[l_(s,e,0,r)]:t}function l(){var e=-1;for(s=new Array(r);++e<r;)s[e]=((e+1)*i-(e-r)*n)/(r+1);return a}return a.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,l()):[n,i]},a.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,l()):o.slice()},a.invertExtent=function(e){var t=o.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,s[0]]:t>=r?[s[r-1],i]:[s[t-1],s[t]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return s.slice()},a.copy=function(){return e().domain([n,i]).range(o).unknown(t)},by.apply(Ey(a),arguments)},Nb),jb(Mb,function e(){var t,n=[.5],i=[0,1],r=1;function s(e){return null!=e&&e<=e?i[l_(n,e,0,r)]:t}return s.domain=function(e){return arguments.length?(n=Array.from(e),r=Math.min(n.length,i.length-1),s):n.slice()},s.range=function(e){return arguments.length?(i=Array.from(e),r=Math.min(n.length,i.length-1),s):i.slice()},s.invertExtent=function(e){var t=i.indexOf(e);return[n[t-1],n[t]]},s.unknown=function(e){return arguments.length?(t=e,s):t},s.copy=function(){return e().domain(n).range(i).unknown(t)},by.apply(s,arguments)},Nb),jb("bin-ordinal",function e(){let t=[],n=[];function i(e){return null==e||e!=e?void 0:n[(l_(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return Bb.call(e,Qd)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=$b.call(e),i):n.slice()},i.tickFormat=function(e,n){return xy(t[0],Zd(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i},[Rb,Nb]),jb("ordinal",uv,Rb),jb("band",Lb,Rb),jb("point",function(){return Pb(Lb().paddingInner(1))},Rb);function Hb(e,t,n){return Qy(function(e,t){const n=o[function(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}(t||"rgb",n),e)}function Wb(e){if(qd(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function Xb(e,t){for(const n in e)Kb(n,t(e[n]))}const qb={};function Kb(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(qb[e]=t,this):qb[e]}Xb({accent:ub,category10:cb,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:db,observable10:hb,paired:pb,pastel1:fb,pastel2:mb,set1:gb,set2:_b,set3:yb,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"},Wb),Xb({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},e=>Hb(Wb(e)));const Zb=e=>qd(e)?e.map(e=>String(e)):String(e),Qb=(e,t)=>e[1]-t[1],Jb=(e,t)=>t[1]-e[1];function eT(e,t){return e.bins?function(e,t,n){let i=e.range(),r=i[0],s=Zd(i),o=Qb;if(r>s&&(i=s,s=r,r=i,o=Jb),r=Math.floor(r),s=Math.ceil(s),t=t.map(t=>[t,e(t)]).filter(e=>r<=e[1]&&e[1]<=s).sort(o).map(e=>e[0]),n>0&&t.length>1){const e=[t[0],Zd(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function tT(e,t,n,i,r,s){const o=t.type;let a=Zb;if(o===wb||r===wb)a=e.timeFormat(i);else if(o===Ib||r===Ib)a=e.utcFormat(i);else if(function(e){return Yb(e,bb)}(o)){const r=e.formatFloat(i);if(s||t.bins)a=r;else{const e=nT(t,n,!1);a=t=>e(t)?r(t):""}}else if(t.tickFormat){const r=t.domain();a=e.formatSpan(r[0],r[r.length-1],n,i)}else i&&(a=e.format(i));return a}function nT(e,t,n){const i=eT(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=e=>{let t=e/Math.pow(r,Math.round(Math.log(e)/s));return t*r<r-.5&&(t*=r),t<=o};return n?i.filter(a):a}const iT={[Cb]:"quantiles",[Ob]:"thresholds",[Mb]:"domain"},rT={[Cb]:"quantiles",[Ob]:"domain"};function sT(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=Zd(e),t}(e.bins):e.type===bb?nT(e,t,!0):iT[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[iT[e.type]]()):eT(e,t)}function oT(e,t,n,i,r,s,o){const a=rT[t.type]&&s!==wb&&s!==Ib?function(e,t,n){const i=t[rT[t.type]](),r=i.length;let s,o=r>1?i[1]-i[0]:i[0];for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,30,n)}(e,t,r):tT(e,t,n,r,s,o);return"symbol"===i&&(e=>iT[e.type]||e.bins)(t)?aT(a):"discrete"===i?uT(a):cT(a)}const aT=e=>(t,n,i)=>{const r=lT(i[n+1],lT(i.max,1/0)),s=dT(t,e),o=dT(r,e);return s&&o?s+" "+o:o?"< "+o:"≥ "+s},lT=(e,t)=>null!=e?e:t,uT=e=>(t,n)=>n?e(t):null,cT=e=>t=>e(t),dT=(e,t)=>Number.isFinite(e)?t(e):null;function hT(e,t,n,i){const r=i||t.type;return rh(n)&&function(e){return Yb(e,Fb)}(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==wb?n||r!==Ib?oT(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function pT(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=hT(e,t,n.format,n.formatType);if(function(e){return Yb(e,Nb)}(t.type)){const e=sT(t).slice(1).map(r),n=e.length;return`${n} boundar${1===n?"y":"ies"}: ${e.join(", ")}`}if(Gb(t.type)){const e=t.domain(),n=e.length;return`${n} value${1===n?"":"s"}: ${n>i?e.slice(0,i-2).map(r).join(", ")+", ending with "+e.slice(-1).map(r):e.map(r).join(", ")}`}{const e=t.domain();return`values from ${r(e[0])} to ${r(Zd(e))}`}}let fT=0;const mT="p_";function gT(e){return e&&e.gradient}function _T(e,t,n){const i=e.gradient;let r=e.id,s="radial"===i?mT:"";return r||(r=e.id="gradient_"+fT++,"radial"===i?(e.x1=yT(e.x1,.5),e.y1=yT(e.y1,.5),e.r1=yT(e.r1,0),e.x2=yT(e.x2,.5),e.y2=yT(e.y2,.5),e.r2=yT(e.r2,.5),s=mT):(e.x1=yT(e.x1,0),e.y1=yT(e.y1,0),e.x2=yT(e.x2,1),e.y2=yT(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function yT(e,t){return null!=e?e:t}const vT={basis:{curve:function(e){return new lh(e)}},"basis-closed":{curve:function(e){return new ch(e)}},"basis-open":{curve:function(e){return new dh(e)}},bundle:{curve:ph,tension:"beta",value:.85},cardinal:{curve:gh,tension:"tension",value:0},"cardinal-open":{curve:yh,tension:"tension",value:0},"cardinal-closed":{curve:bh,tension:"tension",value:0},"catmull-rom":{curve:Fh,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Ph,tension:"alpha",value:.5},"catmull-rom-open":{curve:$h,tension:"alpha",value:.5},linear:{curve:Vh},"linear-closed":{curve:function(e){return new zh(e)}},monotone:{horizontal:function(e){return new Xh(e)},vertical:function(e){return new Wh(e)}},natural:{curve:function(e){return new Kh(e)}},step:{curve:function(e){return new Qh(e,.5)}},"step-after":{curve:function(e){return new Qh(e,1)}},"step-before":{curve:function(e){return new Qh(e,0)}}};function bT(e,t,n){var i=nh(vT,e)&&vT[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const TT={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},xT=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,ET=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,wT=/^((\s+,?\s*)|(,\s*))/,IT=/^[01]/;function AT(e){const t=[];return(e.match(xT)||[]).forEach(e=>{let n=e[0];const i=n.toLowerCase(),r=TT[i],s=function(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const t="a"!==e||3!==s&&4!==s?ET:IT,o=n.slice(r).match(t);if(null===o)throw Error("Invalid SVG path, incorrect parameter type");r+=o[0].length,i.push(+o[0]);const a=n.slice(r).match(wT);null!==a&&(r+=a[0].length)}return i}(i,r,e.slice(1).trim()),o=s.length;if(o<r||o&&o%r!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([n,...s.slice(0,r)]),o!==r){"m"===i&&(n="M"===n?"L":"l");for(let e=r;e<o;e+=r)t.push([n,...s.slice(e,e+r)])}}),t}const ST=Math.PI/180,CT=Math.PI/2,OT=2*Math.PI,MT=Math.sqrt(3)/2;var kT={},RT={},NT=[].join;function DT(e){const t=NT.call(e);if(RT[t])return RT[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7];const c=u*o,d=-l*a,h=l*o,p=u*a,f=Math.cos(r),m=Math.sin(r),g=Math.cos(s),_=Math.sin(s),y=.5*(s-r),v=Math.sin(.5*y),b=8/3*v*v/Math.sin(y),T=n+f-b*m,x=i+m+b*f,E=n+g,w=i+_,I=E+b*_,A=w-b*g;return RT[t]=[c*T+d*x,h*T+p*x,c*I+d*A,h*I+p*A,c*E+d*w,h*E+p*w]}const FT=["l",0,0,0,0,0,0,0];function LT(e,t,n){const i=FT[0]=e[0];if("a"===i||"A"===i)FT[1]=t*e[1],FT[2]=n*e[2],FT[3]=e[3],FT[4]=e[4],FT[5]=e[5],FT[6]=t*e[6],FT[7]=n*e[7];else if("h"===i||"H"===i)FT[1]=t*e[1];else if("v"===i||"V"===i)FT[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)FT[r]=(r%2==1?t:n)*e[r];return FT}function PT(e,t,n,i,r,s){var o,a,l,u,c,d=null,h=0,p=0,f=0,m=0,g=0,_=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==s&&(s=r),e.beginPath&&e.beginPath();for(var y=0,v=t.length;y<v;++y){switch(o=t[y],1===r&&1===s||(o=LT(o,r,s)),o[0]){case"l":h+=o[1],p+=o[2],e.lineTo(h+n,p+i);break;case"L":h=o[1],p=o[2],e.lineTo(h+n,p+i);break;case"h":h+=o[1],e.lineTo(h+n,p+i);break;case"H":h=o[1],e.lineTo(h+n,p+i);break;case"v":p+=o[1],e.lineTo(h+n,p+i);break;case"V":p=o[1],e.lineTo(h+n,p+i);break;case"m":g=h+=o[1],_=p+=o[2],e.moveTo(h+n,p+i);break;case"M":g=h=o[1],_=p=o[2],e.moveTo(h+n,p+i);break;case"c":a=h+o[5],l=p+o[6],f=h+o[3],m=p+o[4],e.bezierCurveTo(h+o[1]+n,p+o[2]+i,f+n,m+i,a+n,l+i),h=a,p=l;break;case"C":h=o[5],p=o[6],f=o[3],m=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,f+n,m+i,h+n,p+i);break;case"s":a=h+o[3],l=p+o[4],f=2*h-f,m=2*p-m,e.bezierCurveTo(f+n,m+i,h+o[1]+n,p+o[2]+i,a+n,l+i),f=h+o[1],m=p+o[2],h=a,p=l;break;case"S":a=o[3],l=o[4],f=2*h-f,m=2*p-m,e.bezierCurveTo(f+n,m+i,o[1]+n,o[2]+i,a+n,l+i),h=a,p=l,f=o[1],m=o[2];break;case"q":a=h+o[3],l=p+o[4],f=h+o[1],m=p+o[2],e.quadraticCurveTo(f+n,m+i,a+n,l+i),h=a,p=l;break;case"Q":a=o[3],l=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,a+n,l+i),h=a,p=l,f=o[1],m=o[2];break;case"t":a=h+o[1],l=p+o[2],null===d[0].match(/[QqTt]/)?(f=h,m=p):"t"===d[0]?(f=2*h-u,m=2*p-c):"q"===d[0]&&(f=2*h-f,m=2*p-m),u=f,c=m,e.quadraticCurveTo(f+n,m+i,a+n,l+i),p=l,f=(h=a)+o[1],m=p+o[2];break;case"T":a=o[1],l=o[2],f=2*h-f,m=2*p-m,e.quadraticCurveTo(f+n,m+i,a+n,l+i),h=a,p=l;break;case"a":BT(e,h+n,p+i,[o[1],o[2],o[3],o[4],o[5],o[6]+h+n,o[7]+p+i]),h+=o[6],p+=o[7];break;case"A":BT(e,h+n,p+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),h=o[6],p=o[7];break;case"z":case"Z":h=g,p=_,e.closePath()}d=o}}function BT(e,t,n,i){const r=function(e,t,n,i,r,s,o,a,l){const u=NT.call(arguments);if(kT[u])return kT[u];const c=o*ST,d=Math.sin(c),h=Math.cos(c),p=h*(a-e)*.5+d*(l-t)*.5,f=h*(l-t)*.5-d*(a-e)*.5;let m=p*p/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);const g=h/n,_=d/n,y=-d/i,v=h/i,b=g*a+_*l,T=y*a+v*l,x=g*e+_*t,E=y*e+v*t;let w=1/((x-b)*(x-b)+(E-T)*(E-T))-.25;w<0&&(w=0);let I=Math.sqrt(w);s==r&&(I=-I);const A=.5*(b+x)-I*(E-T),S=.5*(T+E)+I*(x-b),C=Math.atan2(T-S,b-A);let O=Math.atan2(E-S,x-A)-C;O<0&&1===s?O+=OT:O>0&&0===s&&(O-=OT);const M=Math.ceil(Math.abs(O/(CT+.001))),k=[];for(let e=0;e<M;++e){const t=C+e*O/M,r=C+(e+1)*O/M;k[e]=[A,S,t,r,n,i,d,h]}return kT[u]=k}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let t=0;t<r.length;++t){const n=DT(r[t]);e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}const $T=.5773502691896257,UT={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,OT)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n,r=i-n*$T,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n,r=i-n*$T;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MT*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function VT(e){return nh(UT,e)?UT[e]:function(e){if(!nh(zT,e)){const t=AT(e);zT[e]={draw:function(e,n){PT(e,t,0,0,Math.sqrt(n)/2)}}}return zT[e]}(e)}var zT={};const jT=.448084975506;function YT(e){return e.x}function GT(e){return e.y}function HT(e){return e.width}function WT(e){return e.height}function XT(e){return"function"==typeof e?e:()=>+e}function qT(e,t,n){return Math.max(t,Math.min(e,n))}function KT(e,t){return null!=e?e:t}const ZT=e=>e.x||0,QT=e=>e.y||0,JT=e=>!(!1===e.defined),ex=function(){var e=lp,t=up,n=Jh(0),i=null,r=cp,s=dp,o=hp,a=null,l=ap(u);function u(){var u,c,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-Mh,f=s.apply(this,arguments)-Mh,m=Th(f-p),g=f>p;if(a||(a=u=l()),h<d&&(c=h,h=d,d=c),h>Ch)if(m>kh-Ch)a.moveTo(h*Eh(p),h*Ah(p)),a.arc(0,0,h,p,f,!g),d>Ch&&(a.moveTo(d*Eh(f),d*Ah(f)),a.arc(0,0,d,f,p,g));else{var _,y,v=p,b=f,T=p,x=f,E=m,w=m,I=o.apply(this,arguments)/2,A=I>Ch&&(i?+i.apply(this,arguments):Sh(d*d+h*h)),S=Ih(Th(h-d)/2,+n.apply(this,arguments)),C=S,O=S;if(A>Ch){var M=Rh(A/d*Ah(I)),k=Rh(A/h*Ah(I));(E-=2*M)>Ch?(T+=M*=g?1:-1,x-=M):(E=0,T=x=(p+f)/2),(w-=2*k)>Ch?(v+=k*=g?1:-1,b-=k):(w=0,v=b=(p+f)/2)}var R=h*Eh(v),N=h*Ah(v),D=d*Eh(x),F=d*Ah(x);if(S>Ch){var L,P=h*Eh(b),B=h*Ah(b),$=d*Eh(T),U=d*Ah(T);if(m<Oh)if(L=function(e,t,n,i,r,s,o,a){var l=n-e,u=i-t,c=o-r,d=a-s,h=d*l-c*u;if(!(h*h<Ch))return[e+(h=(c*(t-s)-d*(e-r))/h)*l,t+h*u]}(R,N,$,U,P,B,D,F)){var V=R-L[0],z=N-L[1],j=P-L[0],Y=B-L[1],G=1/Ah(function(e){return e>1?0:e<-1?Oh:Math.acos(e)}((V*j+z*Y)/(Sh(V*V+z*z)*Sh(j*j+Y*Y)))/2),H=Sh(L[0]*L[0]+L[1]*L[1]);C=Ih(S,(d-H)/(G-1)),O=Ih(S,(h-H)/(G+1))}else C=O=0}w>Ch?O>Ch?(_=pp($,U,R,N,h,O,g),y=pp(P,B,D,F,h,O,g),a.moveTo(_.cx+_.x01,_.cy+_.y01),O<S?a.arc(_.cx,_.cy,O,xh(_.y01,_.x01),xh(y.y01,y.x01),!g):(a.arc(_.cx,_.cy,O,xh(_.y01,_.x01),xh(_.y11,_.x11),!g),a.arc(0,0,h,xh(_.cy+_.y11,_.cx+_.x11),xh(y.cy+y.y11,y.cx+y.x11),!g),a.arc(y.cx,y.cy,O,xh(y.y11,y.x11),xh(y.y01,y.x01),!g))):(a.moveTo(R,N),a.arc(0,0,h,v,b,!g)):a.moveTo(R,N),d>Ch&&E>Ch?C>Ch?(_=pp(D,F,P,B,d,-C,g),y=pp(R,N,$,U,d,-C,g),a.lineTo(_.cx+_.x01,_.cy+_.y01),C<S?a.arc(_.cx,_.cy,C,xh(_.y01,_.x01),xh(y.y01,y.x01),!g):(a.arc(_.cx,_.cy,C,xh(_.y01,_.x01),xh(_.y11,_.x11),!g),a.arc(0,0,d,xh(_.cy+_.y11,_.cx+_.x11),xh(y.cy+y.y11,y.cx+y.x11),g),a.arc(y.cx,y.cy,C,xh(y.y11,y.x11),xh(y.y01,y.x01),!g))):a.arc(0,0,d,x,T,g):a.lineTo(D,F)}else a.moveTo(0,0);if(a.closePath(),u)return a=null,u+""||null}return u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Oh/2;return[Eh(i)*n,Ah(i)*n]},u.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Jh(+t),u):e},u.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Jh(+e),u):t},u.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Jh(+e),u):n},u.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:Jh(+e),u):i},u.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Jh(+e),u):r},u.endAngle=function(e){return arguments.length?(s="function"==typeof e?e:Jh(+e),u):s},u.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Jh(+e),u):o},u.context=function(e){return arguments.length?(a=null==e?null:e,u):a},u}().startAngle(e=>e.startAngle||0).endAngle(e=>e.endAngle||0).padAngle(e=>e.padAngle||0).innerRadius(e=>e.innerRadius||0).outerRadius(e=>e.outerRadius||0).cornerRadius(e=>e.cornerRadius||0),tx=yp().x(ZT).y1(QT).y0(e=>(e.y||0)+(e.height||0)).defined(JT),nx=yp().y(QT).x1(ZT).x0(e=>(e.x||0)+(e.width||0)).defined(JT),ix=_p().x(ZT).y(QT).defined(JT),rx=function(){var e=YT,t=GT,n=HT,i=WT,r=XT(0),s=r,o=r,a=r,l=null;function u(u,c,d){var h,p=null!=c?c:+e.call(this,u),f=null!=d?d:+t.call(this,u),m=+n.call(this,u),g=+i.call(this,u),_=Math.min(m,g)/2,y=qT(+r.call(this,u),0,_),v=qT(+s.call(this,u),0,_),b=qT(+o.call(this,u),0,_),T=qT(+a.call(this,u),0,_);if(l||(l=h=op()),y<=0&&v<=0&&b<=0&&T<=0)l.rect(p,f,m,g);else{var x=p+m,E=f+g;l.moveTo(p+y,f),l.lineTo(x-v,f),l.bezierCurveTo(x-jT*v,f,x,f+jT*v,x,f+v),l.lineTo(x,E-T),l.bezierCurveTo(x,E-jT*T,x-jT*T,E,x-T,E),l.lineTo(p+b,E),l.bezierCurveTo(p+jT*b,E,p,E-jT*b,p,E-b),l.lineTo(p,f+y),l.bezierCurveTo(p,f+jT*y,p+jT*y,f,p+y,f),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(t){return arguments.length?(e=XT(t),u):e},u.y=function(e){return arguments.length?(t=XT(e),u):t},u.width=function(e){return arguments.length?(n=XT(e),u):n},u.height=function(e){return arguments.length?(i=XT(e),u):i},u.cornerRadius=function(e,t,n,i){return arguments.length?(r=XT(e),s=null!=t?XT(t):r,a=null!=n?XT(n):r,o=null!=i?XT(i):s,u):r},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}().x(ZT).y(QT).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>KT(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>KT(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>KT(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>KT(e.cornerRadiusBottomLeft,e.cornerRadius)||0),sx=function(e,t){let n=null,i=ap(r);function r(){let r;if(n||(n=r=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),r)return n=null,r+""||null}return e="function"==typeof e?e:Jh(e||vp),t="function"==typeof t?t:Jh(void 0===t?64:+t),r.type=function(t){return arguments.length?(e="function"==typeof t?t:Jh(t),r):e},r.size=function(e){return arguments.length?(t="function"==typeof e?e:Jh(+e),r):t},r.context=function(e){return arguments.length?(n=null==e?null:e,r):n},r}().type(e=>VT(e.shape||"circle")).size(e=>KT(e.size,64)),ox=function(){var e,t,n,i,r,s,o,a,l=null;function u(e,t,n){const i=n/2;if(r){var u=o-t,c=e-s;if(u||c){var d=Math.hypot(u,c),h=(u/=d)*a,p=(c/=d)*a,f=Math.atan2(c,u);l.moveTo(s-h,o-p),l.lineTo(e-u*i,t-c*i),l.arc(e,t,i,f-Math.PI,f),l.lineTo(s+h,o+p),l.arc(s,o,a,f,f+Math.PI)}else l.arc(e,t,i,0,OT);l.closePath()}else r=1;s=e,o=t,a=i}function c(s){var o,a,c,d=s.length,h=!1;for(null==l&&(l=c=op()),o=0;o<=d;++o)!(o<d&&i(a=s[o],o,s))===h&&(h=!h)&&(r=0),h&&u(+e(a,o,s),+t(a,o,s),+n(a,o,s));if(c)return l=null,c+""||null}return c.x=function(t){return arguments.length?(e=t,c):e},c.y=function(e){return arguments.length?(t=e,c):t},c.size=function(e){return arguments.length?(n=e,c):n},c.defined=function(e){return arguments.length?(i=e,c):i},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}().x(ZT).y(QT).defined(JT).size(e=>e.size||1);function ax(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function lx(e,t,n,i){return rx.context(e)(t,n,i)}var ux=1;function cx(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+ux++),o=r.clipping[s]||(r.clipping[s]={id:s});return eh(i)?o.path=i(null):ax(n)?o.path=lx(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function dx(e){this.clear(),e&&this.union(e)}function hx(e){this.mark=e,this.bounds=this.bounds||new dx}function px(e){hx.call(this,e),this.items=this.items||[]}dx.prototype={clone(){return new dx(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*o+u,l*i+a*o+c,a*s-l*r+u,l*s+a*r+c,a*s-l*o+u,l*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ih(px,hx);class fx{constructor(e){this._pending=0,this._loader=e||e_()}pending(){return this._pending}sanitizeURL(e){const t=this;return mx(t),t._loader.sanitize(e,{context:"href"}).then(e=>(gx(t),e)).catch(()=>(gx(t),null))}loadImage(e){const t=this,n=xp();return mx(t),t._loader.sanitize(e,{context:"image"}).then(e=>{const i=e.href;if(!i||!n)throw{url:i};const r=new n,s=nh(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=s&&(r.crossOrigin=s),r.onload=()=>gx(t),r.onerror=()=>gx(t),r.src=i,r}).catch(e=>(gx(t),{complete:!1,width:0,height:0,src:e&&e.url||""}))}ready(){const e=this;return new Promise(t=>{!function n(i){e.pending()?setTimeout(()=>{n(!0)},10):t(i)}(!1)})}}function mx(e){e._pending+=1}function gx(e){e._pending-=1}function _x(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const i=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(i+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,i):0))}return e}const yx=OT-1e-8;let vx,bx,Tx,xx,Ex,wx,Ix,Ax;const Sx=(e,t)=>vx.add(e,t),Cx=(e,t)=>Sx(bx=e,Tx=t),Ox=e=>Sx(e,vx.y1),Mx=e=>Sx(vx.x1,e),kx=(e,t)=>Ex*e+Ix*t,Rx=(e,t)=>wx*e+Ax*t,Nx=(e,t)=>Sx(kx(e,t),Rx(e,t)),Dx=(e,t)=>Cx(kx(e,t),Rx(e,t));function Fx(e,t){return vx=e,t?(xx=t*ST,Ex=Ax=Math.cos(xx),wx=Math.sin(xx),Ix=-wx):(Ex=Ax=1,xx=wx=Ix=0),Lx}const Lx={beginPath(){},closePath(){},moveTo:Dx,lineTo:Dx,rect(e,t,n,i){xx?(Nx(e+n,t),Nx(e+n,t+i),Nx(e,t+i),Dx(e,t)):(Sx(e+n,t+i),Cx(e,t))},quadraticCurveTo(e,t,n,i){const r=kx(e,t),s=Rx(e,t),o=kx(n,i),a=Rx(n,i);Px(bx,r,o,Ox),Px(Tx,s,a,Mx),Cx(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=kx(e,t),a=Rx(e,t),l=kx(n,i),u=Rx(n,i),c=kx(r,s),d=Rx(r,s);Bx(bx,o,l,c,Ox),Bx(Tx,a,u,d,Mx),Cx(c,d)},arc(e,t,n,i,r,s){if(i+=xx,r+=xx,bx=n*Math.cos(r)+e,Tx=n*Math.sin(r)+t,Math.abs(r-i)>yx)Sx(e-n,t-n),Sx(e+n,t+n);else{const o=i=>Sx(n*Math.cos(i)+e,n*Math.sin(i)+t);let a,l;if(o(i),o(r),r!==i)if((i%=OT)<0&&(i+=OT),(r%=OT)<0&&(r+=OT),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=OT,a=i-i%CT,l=0;l<4&&a>r;++l,a-=CT)o(a);else for(a=i-i%CT+CT,l=0;l<4&&a<r;++l,a+=CT)o(a)}}};function Px(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function Bx(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let l,u=0,c=0;Math.abs(s)>1e-14?(l=o*o+a*s,l>=0&&(l=Math.sqrt(l),u=(-o+l)/s,c=(-o-l)/s)):u=.5*a/o,0<u&&u<1&&r($x(u,e,t,n,i)),0<c&&c<1&&r($x(c,e,t,n,i))}function $x(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var Ux=(Ux=Tp(1,1))?Ux.getContext("2d"):null;const Vx=new dx;function zx(e){return function(t,n){if(!Ux)return!0;e(Ux,t),Vx.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=Vx;for(let e=r;e<=o;++e)for(let t=i;t<=s;++t)if(Ux.isPointInPath(t,e))return!0;return!1}}function jx(e,t){return t.contains(e.x||0,e.y||0)}function Yx(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(Vx.set(n,i,n+r,i+s))}function Gx(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:l}=e,u=i-t,c=r-n;let d,h,p,f,m=0,g=1;for(f=0;f<4;++f){if(0===f&&(d=-u,h=-(s-t)),1===f&&(d=u,h=a-t),2===f&&(d=-c,h=-(o-n)),3===f&&(d=c,h=l-n),Math.abs(d)<1e-10&&h<0)return!1;if(p=h/d,d<0){if(p>g)return!1;p>m&&(m=p)}else if(d>0){if(p<m)return!1;p<g&&(g=p)}}return!0}function Hx(e,t){e.globalCompositeOperation=t.blend||"source-over"}function Wx(e,t){return null==e?t:e}function Xx(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function qx(e,t,n){return gT(n)?function(e,t,n){const i=n.width(),r=n.height();let s;if("radial"===t.gradient)s=e.createRadialGradient(n.x1+Wx(t.x1,.5)*i,n.y1+Wx(t.y1,.5)*r,Math.max(i,r)*Wx(t.r1,0),n.x1+Wx(t.x2,.5)*i,n.y1+Wx(t.y2,.5)*r,Math.max(i,r)*Wx(t.r2,.5));else{const o=Wx(t.x1,0),a=Wx(t.y1,0),l=Wx(t.x2,1),u=Wx(t.y2,0);if(o!==l&&a!==u&&i!==r){const n=Tp(Math.ceil(i),Math.ceil(r)),s=n.getContext("2d");return s.scale(i,r),s.fillStyle=Xx(s.createLinearGradient(o,a,l,u),t.stops),s.fillRect(0,0,i,r),e.createPattern(n,"no-repeat")}s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+l*i,n.y1+u*r)}return Xx(s,t.stops)}(e,n,t.bounds):n}function Kx(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=qx(e,t,t.fill),!0)}var Zx=[];function Qx(e,t,n){var i=null!=(i=t.strokeWidth)?i:1;return!(i<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=qx(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Zx),e.lineDashOffset=t.strokeDashOffset||0),!0))}function Jx(e,t){return e.zindex-t.zindex||e.index-t.index}function eE(e){if(!e.zdirty)return e.zitems;var t,n,i,r=e.items,s=[];for(n=0,i=r.length;n<i;++n)(t=r[n]).index=n,t.zindex&&s.push(t);return e.zdirty=!1,e.zitems=s.sort(Jx)}function tE(e,t){var n,i,r=e.items;if(!r||!r.length)return;const s=eE(e);if(s&&s.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||t(r[n]);r=s}for(n=0,i=r.length;n<i;++n)t(r[n])}function nE(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const s=eE(e);for(s&&s.length&&(r=s),i=r.length;--i>=0;)if(n=t(r[i]))return n;if(r===s)for(i=(r=e.items).length;--i>=0;)if(!r[i].zindex&&(n=t(r[i])))return n;return null}function iE(e){return function(t,n,i){tE(n,n=>{i&&!i.intersects(n.bounds)||sE(e,t,n,n)})}}function rE(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||sE(e,t,n.items[0],n.items)}}function sE(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(Hx(t,n),n.fill&&Kx(t,n,r)&&t.fill(),n.stroke&&Qx(t,n,r)&&t.stroke()))}function oE(e){return e=e||Xd,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,nE(n,n=>{const a=n.bounds;if((!a||a.contains(s,o))&&a)return e(t,n,i,r,s,o)?n:void 0})}}function aE(e,t){return function(n,i,r,s){var o,a,l=Array.isArray(i)?i[0]:i,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(o=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=a?a:"butt"),!e(n,i)&&(u&&n.isPointInPath(r,s)||c&&n.isPointInStroke(r,s))}}function lE(e){return oE(aE(e))}function uE(e,t){return"translate("+e+","+t+")"}function cE(e){return"rotate("+e+")"}function dE(e){return uE(e.x||0,e.y||0)}function hE(e,t,n){function i(e,n){var i=n.x||0,r=n.y||0,s=n.angle||0;e.translate(i,r),s&&e.rotate(s*=ST),e.beginPath(),t(e,n),s&&e.rotate(-s),e.translate(-i,-r)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return uE(e.x||0,e.y||0)+(e.angle?" "+cE(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(Fx(e,n.angle),n),_x(e,n).translate(n.x||0,n.y||0)},draw:iE(i),pick:lE(i),isect:n||zx(i)}}var pE=hE("arc",function(e,t){return ex.context(e)(t)});function fE(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=aE(i);return{type:e,tag:"path",nested:!0,attr:function(e,n){var i=n.mark.items;i.length&&e("d",t(null,i))},bound:function(e,n){var i=n.items;return 0===i.length?e:(t(Fx(e),i),_x(e,i[0]))},draw:rE(i),pick:function(e,t,n,i,s,o){var a=t.items,l=t.bounds;return!a||!a.length||l&&!l.contains(s,o)?null:(n*=e.pixelRatio,i*=e.pixelRatio,r(e,a,n,i)?a[0]:null)},isect:jx,tip:n}}var mE=fE("area",function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?nx:tx).curve(bT(i,n.orient,n.tension)).context(e)(t)},function(e,t){for(var n,i,r="horizontal"===e[0].orient?t[1]:t[0],s="horizontal"===e[0].orient?"y":"x",o=e.length,a=1/0;--o>=0;)!1!==e[o].defined&&(i=Math.abs(e[o][s]-r))<a&&(a=i,n=e[o]);return n});function gE(e,t){e.beginPath(),ax(t)?lx(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function _E(e){const t=Wx(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function yE(e,t){const n=_E(t);e("d",lx(null,t,n,n))}function vE(e,t,n,i){const r=_E(t);e.beginPath(),lx(e,t,(n||0)+r,(i||0)+r)}const bE=aE(vE),TE=aE(vE,!1),xE=aE(vE,!0);var EE={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",dE(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let t=0;t<i;++t)e.union(n[t].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),_x(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n,i){tE(t,t=>{const r=t.x||0,s=t.y||0,o=t.strokeForeground,a=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&a&&(vE(e,t,r,s),Hx(e,t),t.fill&&Kx(e,t,a)&&e.fill(),t.stroke&&!o&&Qx(e,t,a)&&e.stroke()),e.save(),e.translate(r,s),t.clip&&gE(e,t),n&&n.translate(-r,-s),tE(t,t=>{("group"===t.marktype||null==i||i.includes(t.marktype))&&this.draw(e,t,n,i)}),n&&n.translate(r,s),e.restore(),o&&t.stroke&&a&&(vE(e,t,r,s),Hx(e,t),Qx(e,t,a)&&e.stroke())})},pick:function(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return nE(t,l=>{let u,c,d;const h=l.bounds;if(h&&!h.contains(r,s))return;c=l.x||0,d=l.y||0;const p=c+(l.width||0),f=d+(l.height||0),m=l.clip;if(m&&(r<c||r>p||s<d||s>f))return;if(e.save(),e.translate(c,d),c=r-c,d=s-d,m&&ax(l)&&!xE(e,l,o,a))return e.restore(),null;const g=l.strokeForeground,_=!1!==t.interactive;return _&&g&&l.stroke&&TE(e,l,o,a)?(e.restore(),l):(u=nE(l,e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,d)?this.pick(e,n,i,c,d):null),!u&&_&&(l.fill||!g&&l.stroke)&&bE(e,l,o,a)&&(u=l),e.restore(),u||null)})},isect:Yx,content:function(e,t,n){e("clip-path",t.clip?cx(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),yE(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?yE(e,t):e("d","")}},wE={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function IE(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(t=>{e.image=t,e.image.url=e.url})),n}function AE(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function SE(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function CE(e,t){return"center"===e?t/2:"right"===e?t:0}function OE(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var ME={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=IE(t,n),r=AE(t,i),s=SE(t,i),o=(t.x||0)-CE(t.align,r),a=(t.y||0)-OE(t.baseline,s);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",wE["xmlns:xlink"],"xlink:href"),e("transform",uE(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=AE(t,n),r=SE(t,n),s=(t.x||0)-CE(t.align,i),o=(t.y||0)-OE(t.baseline,r);return e.set(s,o,s+i,o+r)},draw:function(e,t,n){tE(t,t=>{if(n&&!n.intersects(t.bounds))return;const i=IE(t,this);let r=AE(t,i),s=SE(t,i);if(0===r||0===s)return;let o,a,l,u,c=(t.x||0)-CE(t.align,r),d=(t.y||0)-OE(t.baseline,s);!1!==t.aspect&&(a=i.width/i.height,l=t.width/t.height,a==a&&l==l&&a!==l&&(l<a?(u=r/a,d+=(s-u)/2,s=u):(u=s*a,c+=(r-u)/2,r=u))),(i.complete||i.toDataURL)&&(Hx(e,t),e.globalAlpha=null!=(o=t.opacity)?o:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,c,d,r,s))})},pick:oE(),isect:Xd,get:IE,xOffset:CE,yOffset:OE},kE=fE("line",function(e,t){const n=t[0],i=n.interpolate||"linear";return ix.curve(bT(i,n.orient,n.tension)).context(e)(t)},function(e,t){for(var n,i,r=Math.pow(e[0].strokeWidth||1,2),s=e.length;--s>=0;)if(!1!==e[s].defined&&(n=e[s].x-t[0])*n+(i=e[s].y-t[1])*i<r)return e[s];return null});function RE(e,t){var n=t.path;if(null==n)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*ST,l=t.pathCache;l&&l.path===n||((t.pathCache=l=AT(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),PT(e,l,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):PT(e,l,i,r,s,o)}var NE={type:"path",tag:"path",nested:!1,attr:function(e,t){var n=t.scaleX||1,i=t.scaleY||1;1===n&&1===i||e("vector-effect","non-scaling-stroke"),e("transform",function(e){return uE(e.x||0,e.y||0)+(e.angle?" "+cE(e.angle):"")+(e.scaleX||e.scaleY?" "+function(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}(t)),e("d",t.path)},bound:function(e,t){return RE(Fx(e,t.angle),t)?e.set(0,0,0,0):_x(e,t,!0)},draw:iE(RE),pick:lE(RE),isect:zx(RE)};function DE(e,t){e.beginPath(),lx(e,t)}var FE={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",lx(null,t))},bound:function(e,t){var n,i;return _x(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:iE(DE),pick:lE(DE),isect:Yx};function LE(e,t,n){var i,r,s,o;return!(!t.stroke||!Qx(e,t,n))&&(i=t.x||0,r=t.y||0,s=null!=t.x2?t.x2:i,o=null!=t.y2?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0)}var PE={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",dE(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function(e,t){var n,i;return _x(e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i),t)},draw:function(e,t,n){tE(t,t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&LE(e,t,i)&&(Hx(e,t),e.stroke())}})},pick:oE(function(e,t,n,i){return!!e.isPointInStroke&&(LE(e,t,1)&&e.isPointInStroke(n,i))}),isect:function(e,t){const n=e.x||0,i=e.y||0;return Gx(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}},BE=hE("shape",function(e,t){return(t.mark.shape||t.shape).context(e)(t)}),$E=hE("symbol",function(e,t){return sx.context(e)(t)},jx);const UE=function(e){let t,n,i;e=+e||1e4;const r=()=>{t={},n={},i=0},s=(r,s)=>(++i>e&&(n=t,t={},i=1),t[r]=s);return r(),{clear:r,has:e=>nh(t,e)||nh(n,e),get:e=>nh(t,e)?t[e]:nh(n,e)?s(e,n[e]):void 0,set:(e,n)=>nh(t,e)?t[e]=n:s(e,n)}}();var VE={height:WE,measureWidth:GE,estimateWidth:jE,width:jE,canvas:zE};function zE(e){VE.width=e&&Ux?GE:jE}function jE(e,t){return YE(ZE(e,t),WE(e))}function YE(e,t){return~~(.8*e.length*t)}function GE(e,t){return WE(e)<=0||!(t=ZE(e,t))?0:HE(t,JE(e))}function HE(e,t){const n=`(${t}) ${e}`;let i=UE.get(n);return void 0===i&&(Ux.font=t,i=Ux.measureText(e).width,UE.set(n,i)),i}function WE(e){return null!=e.fontSize?+e.fontSize||0:11}function XE(e){return null!=e.lineHeight?e.lineHeight:WE(e)+2}function qE(e){return t=e.lineBreak&&e.text&&!qd(e.text)?e.text.split(e.lineBreak):e.text,qd(t)?t.length>1?t:t[0]:t;var t}function KE(e){const t=qE(e);return(qd(t)?t.length-1:0)*XE(e)}function ZE(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,i=function(e){if(VE.width===GE){const t=JE(e);return e=>HE(e,t)}if(VE.width===jE){const t=WE(e);return e=>YE(e,t)}return t=>VE.width(e,t)}(e);if(i(t)<n)return t;var r,s=e.ellipsis||"…",o="rtl"===e.dir,a=0,l=t.length;if(n-=i(s),o){for(;a<l;)r=a+l>>>1,i(t.slice(r))>n?a=r+1:l=r;return s+t.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(t.slice(0,r))<n?a=r:l=r-1;return t.slice(0,a)+s}(e,n):n}function QE(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function JE(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+WE(e)+"px "+QE(e,t)}function ew(e){var t=e.baseline,n=WE(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*XE(e):"line-bottom"===t?.29*n-.5*XE(e):0)}zE(!0);const tw={left:"start",center:"middle",right:"end"},nw=new dx;function iw(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-CT,n+=r*Math.cos(t),i+=r*Math.sin(t)),nw.x1=n,nw.y1=i,nw}function rw(e,t,n){var i,r=VE.height(t),s=t.align,o=iw(t),a=o.x1,l=o.y1,u=t.dx||0,c=(t.dy||0)+ew(t)-Math.round(.8*r),d=qE(t);if(qd(d)?(r+=XE(t)*(d.length-1),i=d.reduce((e,n)=>Math.max(e,VE.width(t,n)),0)):i=VE.width(t,d),"center"===s?u-=i/2:"right"===s&&(u-=i),e.set(u+=a,c+=l,u+i,c+r),t.angle&&!n)e.rotate(t.angle*ST,a,l);else if(2===n)return e.rotatedPoints(t.angle*ST,a,l);return e}var sw={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+ew(t),s=iw(t),o=s.x1,a=s.y1,l=t.angle||0;e("text-anchor",tw[t.align]||"start"),l?(n=uE(o,a)+" "+cE(l),(i||r)&&(n+=" "+uE(i,r))):n=uE(o+i,a+r),e("transform",n)},bound:rw,draw:function(e,t,n){tE(t,t=>{var i,r,s,o,a,l,u,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=JE(t),e.textAlign=t.align||"left",r=(i=iw(t)).x1,s=i.y1,t.angle&&(e.save(),e.translate(r,s),e.rotate(t.angle*ST),r=s=0),r+=t.dx||0,s+=(t.dy||0)+ew(t),l=qE(t),Hx(e,t),qd(l))for(a=XE(t),o=0;o<l.length;++o)u=ZE(t,l[o]),t.fill&&Kx(e,t,c)&&e.fillText(u,r,s),t.stroke&&Qx(e,t,c)&&e.strokeText(u,r,s),s+=a;else u=ZE(t,l),t.fill&&Kx(e,t,c)&&e.fillText(u,r,s),t.stroke&&Qx(e,t,c)&&e.strokeText(u,r,s);t.angle&&e.restore()}})},pick:oE(function(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=iw(t),a=o.x1,l=o.y1,u=rw(nw,t,1),c=-t.angle*ST,d=Math.cos(c),h=Math.sin(c),p=d*r-h*s+(a-d*a+h*l),f=h*r+d*s+(l-h*a-d*l);return u.contains(p,f)}),isect:function(e,t){const n=rw(nw,e,2);return Gx(t,n[0],n[1],n[2],n[3])||Gx(t,n[0],n[1],n[4],n[5])||Gx(t,n[4],n[5],n[6],n[7])||Gx(t,n[2],n[3],n[6],n[7])}},ow=fE("trail",function(e,t){return ox.context(e)(t)},function(e,t){for(var n,i,r=e.length;--r>=0;)if(!1!==e[r].defined&&(n=e[r].x-t[0])*n+(i=e[r].y-t[1])*i<(n=e[r].size||1)*n)return e[r];return null}),aw={arc:pE,area:mE,group:EE,image:ME,line:kE,path:NE,rect:FE,rule:PE,shape:BE,symbol:$E,text:sw,trail:ow};function lw(e,t,n){return!e&&"undefined"!=typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function uw(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function cw(e,t,n,i){var r,s=e.childNodes[t];return s&&s.tagName.toLowerCase()===n.toLowerCase()||(r=s||null,s=lw(e.ownerDocument,n,i),e.insertBefore(s,r)),s}function dw(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function hw(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function pw(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}class fw{constructor(e,t){this._active=null,this._handlers={},this._loader=e||e_(),this._tooltip=t||mw}initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()}scene(e){return arguments.length?(this._scene=e,this):this._scene}on(){}off(){}_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1}handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n}eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(t=>{const n=new MouseEvent(e.type,e),i=lw(null,"a");for(const e in t)i.setAttribute(e,t[e]);i.dispatchEvent(n)}).catch(()=>{})}handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,i){var r,s,o=e&&e.mark;if(o&&(r=aw[o.marktype]).tip){for((s=pw(t,n))[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=r.tip(o.items,s)}return e}(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}}getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}}function mw(e,t,n,i){e.element().setAttribute("title",i||"")}class gw{constructor(e){this._el=null,this._bgcolor=null,this._loader=new fx(e)}initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)}resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this}dirty(){}render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n}_render(){}renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)}_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then(t=>{t&&e(),n._ready=null})}return i}sanitizeURL(e){return this._load("sanitizeURL",e)}loadImage(e){return this._load("loadImage",e)}}const _w="dragenter",yw="dragleave",vw="dragover",bw="pointerdown",Tw="pointermove",xw="pointerout",Ew="pointerover",ww="mousedown",Iw="mousemove",Aw="mouseout",Sw="mouseover",Cw="click",Ow="mousewheel",Mw="touchstart",kw="touchmove",Rw="touchend",Nw=["keydown","keypress","keyup",_w,yw,vw,bw,"pointerup",Tw,xw,Ew,ww,"mouseup",Iw,Aw,Sw,Cw,"dblclick","wheel",Ow,Mw,kw,Rw],Dw=Tw,Fw=Aw,Lw=Cw;class Pw extends fw{constructor(e,t){super(e,t),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=Nw,this.pointermove=Vw([Tw,Iw],[Ew,Sw],[xw,Aw]),this.dragover=Vw([vw],[_w],[yw]),this.pointerout=zw([xw,Aw]),this.dragleave=zw([yw])}initialize(e,t,n){return this._canvas=e&&uw(e,"canvas"),[Cw,ww,bw,Tw,xw,yw].forEach(e=>$w(this,e)),super.initialize(e,t,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(e){this.fire(Ow,e)}pointerdown(e){this._down=this._active,this.fire(bw,e)}mousedown(e){this._down=this._active,this.fire(ww,e)}click(e){this._down===this._active&&(this.fire(Cw,e),this._down=null)}touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Mw,e,!0)}touchmove(e){this.fire(kw,e,!0)}touchend(e){this.fire(Rw,e,!0),this._touch=null}fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===Lw&&i&&i.href?this.handleHref(t,i,i.href):e!==Dw&&e!==Fw||this.handleTooltip(t,i,e!==Fw),r)for(let e=0,n=r.length;e<n;++e)r[e].handler.call(this._obj,t,i)}on(e,t){const n=this.eventName(e),i=this._handlers;return this._handlerIndex(i[n],e,t)<0&&($w(this,e),(i[n]||(i[n]=[])).push({type:e,handler:t})),this}off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&i.splice(r,1),this}pickEvent(e){const t=pw(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])}pick(e,t,n,i,r){const s=this.context();return aw[e.marktype].pick.call(this,s,e,t,n,i,r)}}const Bw=e=>e===Mw||e===kw||e===Rw?[Mw,kw,Rw]:[e];function $w(e,t){Bw(t).forEach(t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t))}function Uw(e,t,n){t.forEach(t=>e.fire(t,n))}function Vw(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r||(r&&r.exit||Uw(this,n,i),this._active=s,Uw(this,t,i)),Uw(this,e,i)}}function zw(e){return function(t){Uw(this,e,t),this._active=null}}function jw(e,t,n,i,r,s){const o="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,a=e.getContext("2d"),l=o?"undefined"!=typeof window&&window.devicePixelRatio||1:r;e.width=t*l,e.height=n*l;for(const e in s)a[e]=s[e];return o&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1]),e}class Yw extends gw{constructor(e){super(e),this._options={},this._redraw=!1,this._dirty=new dx,this._tempb=new dx}initialize(e,t,n,i,r,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Tp(1,1,this._options.type),e&&this._canvas&&(dw(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(e,t,n,i,r)}resize(e,t,n,i){if(super.resize(e,t,n,i),this._canvas)jw(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||Yd("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)}_render(e,t){const n=this.context(),i=this._origin,r=this._width,s=this._height,o=this._dirty,a=Gw(i,r,s);n.save();const l=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(e,t,n){t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio);return t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(n,a.intersect(o),i);return this.clear(-i[0],-i[1],r,s),this.draw(n,e,l,t),n.restore(),o.clear(),this}draw(e,t,n,i){if("group"!==t.marktype&&null!=i&&!i.includes(t.marktype))return;const r=aw[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),eh(n)?(e.beginPath(),n(e),e.clip()):gE(e,t.group)}(e,t),r.draw.call(this,e,t,n,i),t.clip&&e.restore()}clear(e,t,n,i){const r=this._options,s=this.context();"pdf"===r.type||r.externalContext||s.clearRect(e,t,n,i),null!=this._bgcolor&&(s.fillStyle=this._bgcolor,s.fillRect(e,t,n,i))}}const Gw=(e,t,n)=>(new dx).set(0,0,t,n).translate(-e[0],-e[1]);const Hw=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},Ww="aria-hidden",Xw="aria-label",qw="role",Kw="aria-roledescription",Zw="graphics-object",Qw="graphics-symbol",Jw=(e,t,n)=>({[qw]:e,[Kw]:t,[Xw]:n||void 0}),eI=oh(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),tI={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?oI(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type,l="left"===n||"right"===n?"Y":"X";return`${l}-axis`+(i?` titled '${i}'`:"")+` for a ${Gb(a)?"discrete":a} scale`+` with ${pT(o,s,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?oI(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,l=o.dataflow.locale();return function(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(i)+(n?` titled '${n}'`:"")+` for ${function(e){return e=e.map(e=>e+("fill"===e||"stroke"===e?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Zd(e)}(s)}`+` with ${pT(l,a,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${sI(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${sI(e)}'`}},nI={ariaRole:qw,ariaRoleDescription:Kw,description:Xw};function iI(e,t){const n=!1===t.aria;if(e(Ww,n||void 0),n||null==t.description)for(const t in nI)e(nI[t],void 0);else{const n=t.mark.marktype;e(Xw,t.description),e(qw,t.ariaRole||("group"===n?Zw:Qw)),e(Kw,t.ariaRoleDescription||`${n} mark`)}}function rI(e){return!1===e.aria?{[Ww]:!0}:eI[e.role]?null:tI[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return Jw(t.role||Qw,t.desc,n.description||i(n))}catch(e){return null}}(e,tI[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return Jw(n?Zw:Qw,`${t} mark container`,e.description)}(e)}function sI(e){return Jd(e.text).join(" ")}function oI(e){try{return Jd(Zd(e.items).items[0].text).join(" ")}catch(e){return null}}const aI=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function lI(){let e="",t="",n="";const i=[],r=()=>t=n="",s=(e,n)=>{var i;return null!=n&&(t+=` ${e}="${i=n,aI(i).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")}"`),o},o={open(a){(s=>{t&&(e+=`${t}>${n}`,r()),i.push(s)})(a),t="<"+a;for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];for(const e of u)for(const t in e)s(t,e[t]);return o},close(){const s=i.pop();return e+=t?t+(n?`>${n}</${s}>`:"/>"):`</${s}>`,r(),o},attr:s,text:e=>(n+=aI(e),o),toString:()=>e};return o}const uI=e=>cI(lI(),e)+"";function cI(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let t=0;t<i;++t)e.attr(n[t].name,n[t].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const t of n)3===t.nodeType?e.text(t.nodeValue):cI(e,t)}return e.close()}const dI={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},hI={blend:"mix-blend-mode"},pI={fill:"none","stroke-miterlimit":10},fI="http://www.w3.org/2000/xmlns/",mI=wE.xmlns;class gI extends gw{constructor(e){super(e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=cw(e,0,"svg",mI),this._svg.setAttributeNS(fI,"xmlns",mI),this._svg.setAttributeNS(fI,"xmlns:xlink",wE["xmlns:xlink"]),this._svg.setAttribute("version",wE.version),this._svg.setAttribute("class","marks"),dw(e,1),this._root=cw(this._svg,0,"g",mI),AI(this._root,pI),dw(this._svg,1)),this.background(this._bgcolor),super.initialize(e,t,n,i,r)}background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),super.background(...arguments)}resize(e,t,n,i){return super.resize(e,t,n,i),this._svg&&(AI(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=cw(e,0,"rect",mI),AI(n,{width:this._width,height:this._height,fill:t}));const i=uI(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i}_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),dw(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))}isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,i,r,s,o,a,l;for(o=0,a=e.length;o<a;++o)n=e[o],i=n.mark,i.marktype!==r&&(r=i.marktype,s=aw[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,_I(n,t),i.items.forEach(e=>{e.dirty=t})),i.zdirty||(n.exit?(s.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(s,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=s.nested?i.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(s,n._svg,n):(this._dirtyAll=!1,_I(n,t)),n._update=t)));return!this._dirtyAll}mark(e,t,n,i){if(!this.isDirty(t))return t._svg;const r=this._svg,s=t.marktype,o=aw[s],a=!1===t.interactive?"none":null,l="g"===o.tag,u=bI(t,e,n,"g",r);if("group"!==s&&null!=i&&!i.includes(s))return dw(u,0),t._svg;u.setAttribute("class",hw(t));const c=rI(t);for(const e in c)SI(u,e,c[e]);l||SI(u,"pointer-events",a),SI(u,"clip-path",t.clip?cx(this,t,t.group):null);let d=null,h=0;const p=e=>{const t=this.isDirty(e),n=bI(e,u,d,o.tag,r);t&&(this._update(o,n,e),l&&function(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;tE(n,n=>{r=e.mark(t,n,r,i),++s}),dw(t,1+s)}(this,n,e,i)),d=n,++h};return o.nested?t.items.length&&p(t.items[0]):tE(t,p),dw(u,h),u}_update(e,t,n){TI=t,xI=t.__values__,iI(wI,n),e.attr(wI,n,this);const i=EI[e.type];i&&i.call(this,e,t,n),TI&&this.style(TI,n)}style(e,t){if(null!=t){for(const n in dI){let i="font"===n?QE(t):t[n];if(i===xI[n])continue;const r=dI[n];null==i?e.removeAttribute(r):(gT(i)&&(i=_T(i,this._defs.gradient,CI())),e.setAttribute(r,i+"")),xI[n]=i}for(const n in hI)II(e,hI[n],t[n])}}defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=cw(e,1,"defs",mI)),i=yI(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=cw(e,1,"defs",mI)),i=vI(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):dw(n,i))}_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}}function _I(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function yI(e,t,n){let i,r,s;if("radial"===t.gradient){let i=cw(e,n++,"pattern",mI);AI(i,{id:mT+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=cw(i,0,"rect",mI),AI(i,{width:1,height:1,fill:`url(${CI()}#${t.id})`}),AI(e=cw(e,n++,"radialGradient",mI),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else AI(e=cw(e,n++,"linearGradient",mI),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=cw(e,i,"stop",mI),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return dw(e,i),n}function vI(e,t,n){let i;return(e=cw(e,n,"clipPath",mI)).setAttribute("id",t.id),t.path?(i=cw(e,0,"path",mI),i.setAttribute("d",t.path)):(i=cw(e,0,"rect",mI),AI(i,{x:0,y:0,width:t.width,height:t.height})),dw(e,1),n+1}function bI(e,t,n,i,r){let s,o=e._svg;if(!o&&(s=t.ownerDocument,o=lw(s,i,mI),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===i))){const t=lw(s,"path",mI);o.appendChild(t),t.__data__=e;const n=lw(s,"g",mI);o.appendChild(n),n.__data__=e;const i=lw(s,"path",mI);o.appendChild(i),i.__data__=e,i.__values__={fill:"default"}}return(o.ownerSVGElement!==r||function(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}let TI=null,xI=null;const EI={group(e,t,n){const i=TI=t.childNodes[2];xI=i.__values__,e.foreground(wI,n,this),xI=t.__values__,TI=t.childNodes[1],e.content(wI,n,this);const r=TI=t.childNodes[0];e.background(wI,n,this);const s=!1===n.mark.interactive?"none":null;if(s!==xI.events&&(SI(i,"pointer-events",s),SI(r,"pointer-events",s),xI.events=s),n.strokeForeground&&n.stroke){const e=n.fill;SI(i,"display",null),this.style(r,n),SI(r,"stroke",null),e&&(n.fill=null),xI=i.__values__,this.style(i,n),e&&(n.fill=e),TI=null}else SI(i,"display","none")},image(e,t,n){!1===n.smooth?(II(t,"image-rendering","optimizeSpeed"),II(t,"image-rendering","pixelated")):II(t,"image-rendering",null)},text(e,t,n){const i=qE(n);let r,s,o,a;qd(i)?(s=i.map(e=>ZE(n,e)),r=s.join("\n"),r!==xI.text&&(dw(t,0),o=t.ownerDocument,a=XE(n),s.forEach((e,i)=>{const r=lw(o,"tspan",mI);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",a)),t.appendChild(r)}),xI.text=r)):(s=ZE(n,i),s!==xI.text&&(t.textContent=s,xI.text=s)),SI(t,"font-family",QE(n)),SI(t,"font-size",WE(n)+"px"),SI(t,"font-style",n.fontStyle),SI(t,"font-variant",n.fontVariant),SI(t,"font-weight",n.fontWeight)}};function wI(e,t,n){t!==xI[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(TI,e,t,n):SI(TI,e,t),xI[e]=t)}function II(e,t,n){n!==xI[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),xI[t]=n)}function AI(e,t){for(const n in t)SI(e,n,t[n])}function SI(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function CI(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}const OI={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};class MI extends gw{constructor(e){super(e),this._svgRenderer=new gI(e),this._canvasRenderer=new Yw(e)}initialize(e,t,n,i,r){this._root_el=cw(e,0,"div");const s=cw(this._root_el,0,"div"),o=cw(this._root_el,1,"div");return this._root_el.style.position="relative",OI.debug||(s.style.height="100%",o.style.position="absolute",o.style.top="0",o.style.left="0",o.style.height="100%",o.style.width="100%"),this._svgEl=OI.svgOnTop?o:s,this._canvasEl=OI.svgOnTop?s:o,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,t,n,i,r),this._svgRenderer.initialize(this._svgEl,t,n,i,r),super.initialize(e,t,n,i,r)}dirty(e){return OI.svgMarkTypes.includes(e.mark.marktype)?this._svgRenderer.dirty(e):this._canvasRenderer.dirty(e),this}_render(e,t){const n=(t??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(e=>!OI.svgMarkTypes.includes(e));this._svgRenderer.render(e,OI.svgMarkTypes),this._canvasRenderer.render(e,n)}resize(e,t,n,i){return super.resize(e,t,n,i),this._svgRenderer.resize(e,t,n,i),this._canvasRenderer.resize(e,t,n,i),this}background(e){return OI.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}}const kI="canvas",RI="hybrid",NI="none",DI={};DI[kI]=DI.png={renderer:Yw,headless:Yw,handler:Pw},DI.svg={renderer:gI,headless:class extends gw{constructor(e){super(e),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(e){const t=lI();t.open("svg",th({},wE,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",pI,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this}mark(e,t){const n=aw[t.marktype],i=n.tag,r=[iI,n.attr];e.open("g",{class:hw(t),"clip-path":t.clip?cx(this,t,t.group):null},rI(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null});const s=s=>{const o=this.href(s);if(o&&e.open("a",o),e.open(i,this.attr(t,s,r,"g"!==i?i:null)),"text"===i){const t=qE(s);if(qd(t)){const n={x:0,dy:XE(s)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(ZE(s,t[i])).close()}else e.text(ZE(s,t))}else if("g"===i){const i=s.strokeForeground,r=s.fill,o=s.stroke;i&&o&&(s.stroke=null),e.open("path",this.attr(t,s,n.background,"bgrect")).close(),e.open("g",this.attr(t,s,n.content)),tE(s,t=>this.mark(e,t)),e.close(),i&&o?(r&&(s.fill=null),s.stroke=o,e.open("path",this.attr(t,s,n.foreground,"bgrect")).close(),r&&(s.fill=r)):e.open("path",this.attr(t,s,n.foreground,"bgfore")).close()}e.close(),o&&e.close()};return n.nested?t.items&&t.items.length&&s(t.items[0]):tE(t,s),e.close()}href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e})}return null}attr(e,t,n,i){const r={},s=(e,t,n,i)=>{r[i||e]=t};return Array.isArray(n)?n.forEach(e=>e(s,t,this)):n(s,t,this),i&&function(e,t,n,i,r){let s;if(null==t)return e;"bgrect"===i&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===i&&!1===t.smooth&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]);"text"===i&&(e["font-family"]=QE(t),e["font-size"]=WE(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in dI){let i=t[n];const s=dI[n];("transparent"!==i||"fill"!==s&&"stroke"!==s)&&null!=i&&(gT(i)&&(i=_T(i,r.gradient,"")),e[s]=i)}for(const e in hI){const n=t[e];null!=n&&(s=s||[],s.push(`${hI[e]}: ${n};`))}s&&(e.style=s.join(" "))}(r,t,e,i,this._defs),r}defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const i=t[n],r=i.stops;"radial"===i.gradient?(e.open("pattern",{id:mT+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):e.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let t=0;t<r.length;++t)e.open("stop",{offset:r[t].offset,"stop-color":r[t].color}).close();e.close()}for(const t in n){const i=n[t];e.open("clipPath",{id:t}),i.path?e.open("path",{d:i.path}).close():e.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),e.close()}e.close()}}},handler:class extends fw{constructor(e,t){super(e,t);const n=this;n._hrefHandler=Hw(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=Hw(n,(e,t)=>{n.handleTooltip(e,t,e.type!==Fw)})}initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(Lw,this._hrefHandler),i.removeEventListener(Dw,this._tooltipHandler),i.removeEventListener(Fw,this._tooltipHandler)),this._svg=i=e&&uw(e,"svg"),i&&(i.addEventListener(Lw,this._hrefHandler),i.addEventListener(Dw,this._tooltipHandler),i.addEventListener(Fw,this._tooltipHandler)),super.initialize(e,t,n)}canvas(){return this._svg}on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const r={type:e,handler:t,listener:Hw(this,t)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this}off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}}},DI[RI]={renderer:MI,headless:MI,handler:class extends Pw{constructor(e,t){super(e,t)}initialize(e,t,n){const i=cw(cw(e,0,"div"),OI.svgOnTop?0:1,"div");return super.initialize(i,t,n)}}},DI[NI]={};const FI=new dx;const LI="top",PI="left",BI="right",$I="bottom",UI="start",VI="middle",zI="end",jI="group",YI="axis",GI="title",HI="frame",WI="scope",XI="legend",qI="row-header",KI="row-footer",ZI="row-title",QI="column-header",JI="column-footer",eA="column-title",tA="padding",nA="fit",iA="fit-x",rA="fit-y",sA="none",oA="all",aA="each",lA="flush",uA="column",cA="row";function dA(e){Ho.call(this,null,e)}function hA(e,t,n){return t(e.bounds.clear(),e,n)}ih(dA,Ho,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=aw[r],o=s.bound;let a,l=i.bounds;if(s.nested)i.items.length&&n.dirty(i.items[0]),l=hA(i,o),i.items.forEach(e=>{e.bounds.clear().union(l)});else if(r===jI||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),l.clear(),i.items.forEach(e=>l.union(hA(e,o))),i.role){case YI:case XI:case GI:t.reflow()}else a=t.changed(t.REM),t.visit(t.ADD,e=>{l.union(hA(e,o))}),t.visit(t.MOD,e=>{a=a||l.alignsWith(e.bounds),n.dirty(e),l.union(hA(e,o))}),a&&(l.clear(),i.items.forEach(e=>l.union(e.bounds)));return function(e){const t=e.clip;if(eh(t))t(Fx(FI.clear()));else{if(!t)return;FI.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(FI)}(i),t.modifies("bounds")}});const pA=":vega_identifier:";function fA(e){Ho.call(this,0,e)}function mA(e){Ho.call(this,null,e)}function gA(e){Ho.call(this,null,e)}fA.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ih(fA,Ho,{transform(e,t){const n=(r=t.dataflow)._signals[pA]||(r._signals[pA]=r.add(0)),i=e.as;var r;let s=n.value;return t.visit(t.ADD,e=>e[i]=e[i]||++s),n.set(this.value=s),t}}),ih(mA,Ho,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,function(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===jI?px:hx;return t.visit(t.ADD,e=>i.call(e,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const _A={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((e,i)=>i&&yA(n.bounds,e.bounds,t)?e.opacity=0:(n=e,1))}},yA=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),vA=(e,t)=>{for(var n,i=1,r=e.length,s=e[0].bounds;i<r;s=n,++i)if(yA(s,n=e[i].bounds,t))return!0},bA=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},TA=e=>(e.forEach(e=>e.opacity=1),e),xA=(e,t)=>e.reflow(t.modified()).modifies("opacity");function EA(e){Ho.call(this,null,e)}ih(gA,Ho,{transform(e,t){const n=_A[e.method]||_A.parity,i=e.separation||0;let r,s,o=t.materialize(t.SOURCE).source;if(!o||!o.length)return;if(!e.method)return e.modified("method")&&(TA(o),t=xA(t,e)),t;if(o=o.filter(bA),!o.length)return;if(e.sort&&(o=o.slice().sort(e.sort)),r=TA(o),t=xA(t,e),r.length>=3&&vA(r,i)){do{r=n(r,i)}while(r.length>=3&&vA(r,i));r.length<3&&!Zd(o).opacity&&(r.length>1&&(Zd(r).opacity=0),Zd(o).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=((e,t,n)=>{var i=e.range(),r=new dx;return t===LI||t===$I?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),e=>r.encloses(e.bounds)})(e.boundScale,e.boundOrient,+e.boundTolerance),o.forEach(e=>{s(e)||(e.opacity=0)}));const a=r[0].mark.bounds.clear();return o.forEach(e=>{e.opacity&&a.union(e.bounds)}),t}}),ih(EA,Ho,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){const e=t.source&&t.source[0];e&&(e.mark.zdirty=!0)}}});const wA=new dx;function IA(e,t,n){return e[t]===n?0:(e[t]=n,1)}function AA(e){var t=e.items[0].orient;return t===PI||t===BI}function SA(e,t,n,i){var r,s,o=t.items[0],a=o.datum,l=null!=o.translate?o.translate:.5,u=o.orient,c=function(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(a),d=o.range,h=o.offset,p=o.position,f=o.minExtent,m=o.maxExtent,g=a.title&&o.items[c[2]].items[0],_=o.titlePadding,y=o.bounds,v=g&&KE(g),b=0,T=0;switch(wA.clear().union(y),y.clear(),(r=c[0])>-1&&y.union(o.items[r].bounds),(r=c[1])>-1&&y.union(o.items[r].bounds),u){case LI:b=p||0,T=-h,s=Math.max(f,Math.min(m,-y.y1)),y.add(0,-s).add(d,0),g&&CA(e,g,s,_,v,0,-1,y);break;case PI:b=-h,T=p||0,s=Math.max(f,Math.min(m,-y.x1)),y.add(-s,0).add(0,d),g&&CA(e,g,s,_,v,1,-1,y);break;case BI:b=n+h,T=p||0,s=Math.max(f,Math.min(m,y.x2)),y.add(0,0).add(s,d),g&&CA(e,g,s,_,v,1,1,y);break;case $I:b=p||0,T=i+h,s=Math.max(f,Math.min(m,y.y2)),y.add(0,0).add(d,s),g&&CA(e,g,s,_,0,0,1,y);break;default:b=o.x,T=o.y}return _x(y.translate(b,T),o),IA(o,"x",b+l)|IA(o,"y",T+l)&&(o.bounds=wA,e.dirty(o),o.bounds=y,e.dirty(o)),o.mark.bounds.clear().union(y)}function CA(e,t,n,i,r,s,o,a){const l=t.bounds;if(t.auto){const a=o*(n+r+i);let u=0,c=0;e.dirty(t),s?u=(t.x||0)-(t.x=a):c=(t.y||0)-(t.y=a),t.mark.bounds.clear().union(l.translate(-u,-c)),e.dirty(t)}a.union(l)}const OA=(e,t)=>Math.floor(Math.min(e,t)),MA=(e,t)=>Math.ceil(Math.max(e,t));function kA(e){return(new dx).set(0,0,e.width||0,e.height||0)}function RA(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function NA(e,t,n){const i=Kd(e)?e[t]:e;return null!=i?i:void 0!==n?n:0}function DA(e){return e<0?Math.ceil(-e):0}function FA(e,t,n){var i,r,s,o,a,l,u,c,d,h,p,f=!n.nodirty,m=n.bounds===lA?kA:RA,g=wA.set(0,0,0,0),_=NA(n.align,uA),y=NA(n.align,cA),v=NA(n.padding,uA),b=NA(n.padding,cA),T=n.columns||t.length,x=T<=0?1:Math.ceil(t.length/T),E=t.length,w=Array(E),I=Array(T),A=0,S=Array(E),C=Array(x),O=0,M=Array(E),k=Array(E),R=Array(E);for(r=0;r<T;++r)I[r]=0;for(r=0;r<x;++r)C[r]=0;for(r=0;r<E;++r)l=t[r],a=R[r]=m(l),l.x=l.x||0,M[r]=0,l.y=l.y||0,k[r]=0,s=r%T,o=~~(r/T),A=Math.max(A,u=Math.ceil(a.x2)),O=Math.max(O,c=Math.ceil(a.y2)),I[s]=Math.max(I[s],u),C[o]=Math.max(C[o],c),w[r]=v+DA(a.x1),S[r]=b+DA(a.y1),f&&e.dirty(t[r]);for(r=0;r<E;++r)r%T===0&&(w[r]=0),r<T&&(S[r]=0);if(_===aA)for(s=1;s<T;++s){for(p=0,r=s;r<E;r+=T)p<w[r]&&(p=w[r]);for(r=s;r<E;r+=T)w[r]=p+I[s-1]}else if(_===oA){for(p=0,r=0;r<E;++r)r%T&&p<w[r]&&(p=w[r]);for(r=0;r<E;++r)r%T&&(w[r]=p+A)}else for(_=!1,s=1;s<T;++s)for(r=s;r<E;r+=T)w[r]+=I[s-1];if(y===aA)for(o=1;o<x;++o){for(p=0,i=(r=o*T)+T;r<i;++r)p<S[r]&&(p=S[r]);for(r=o*T;r<i;++r)S[r]=p+C[o-1]}else if(y===oA){for(p=0,r=T;r<E;++r)p<S[r]&&(p=S[r]);for(r=T;r<E;++r)S[r]=p+O}else for(y=!1,o=1;o<x;++o)for(i=(r=o*T)+T;r<i;++r)S[r]+=C[o-1];for(d=0,r=0;r<E;++r)d=w[r]+(r%T?d:0),M[r]+=d-t[r].x;for(s=0;s<T;++s)for(h=0,r=s;r<E;r+=T)h+=S[r],k[r]+=h-t[r].y;if(_&&NA(n.center,uA)&&x>1)for(r=0;r<E;++r)(d=(a=_===oA?A:I[r%T])-R[r].x2-t[r].x-M[r])>0&&(M[r]+=d/2);if(y&&NA(n.center,cA)&&1!==T)for(r=0;r<E;++r)(h=(a=y===oA?O:C[~~(r/T)])-R[r].y2-t[r].y-k[r])>0&&(k[r]+=h/2);for(r=0;r<E;++r)g.union(R[r].translate(M[r],k[r]));switch(d=NA(n.anchor,"x"),h=NA(n.anchor,"y"),NA(n.anchor,uA)){case zI:d-=g.width();break;case VI:d-=g.width()/2}switch(NA(n.anchor,cA)){case zI:h-=g.height();break;case VI:h-=g.height()/2}for(d=Math.round(d),h=Math.round(h),g.clear(),r=0;r<E;++r)t[r].mark.bounds.clear();for(r=0;r<E;++r)(l=t[r]).x+=M[r]+=d,l.y+=k[r]+=h,g.union(l.mark.bounds.union(l.bounds.translate(M[r],k[r]))),f&&e.dirty(l);return g}function LA(e,t,n){var i,r,s,o,a,l,u,c=function(e){var t,n,i=e.items,r=i.length,s=0;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;s<r;++s)if(n=(t=i[s]).items,t.marktype===jI)switch(t.role){case YI:case XI:case GI:break;case qI:o.rowheaders.push(...n);break;case KI:o.rowfooters.push(...n);break;case QI:o.colheaders.push(...n);break;case JI:o.colfooters.push(...n);break;case ZI:o.rowtitle=n[0];break;case eA:o.coltitle=n[0];break;default:o.marks.push(...n)}return o}(t),d=c.marks,h=n.bounds===lA?PA:BA,p=n.offset,f=n.columns||d.length,m=f<=0?1:Math.ceil(d.length/f),g=m*f;const _=FA(e,d,n);_.empty()&&_.set(0,0,0,0),c.rowheaders&&(l=NA(n.headerBand,cA,null),i=$A(e,c.rowheaders,d,f,m,-NA(p,"rowHeader"),OA,0,h,"x1",0,f,1,l)),c.colheaders&&(l=NA(n.headerBand,uA,null),r=$A(e,c.colheaders,d,f,f,-NA(p,"columnHeader"),OA,1,h,"y1",0,1,f,l)),c.rowfooters&&(l=NA(n.footerBand,cA,null),s=$A(e,c.rowfooters,d,f,m,NA(p,"rowFooter"),MA,0,h,"x2",f-1,f,1,l)),c.colfooters&&(l=NA(n.footerBand,uA,null),o=$A(e,c.colfooters,d,f,f,NA(p,"columnFooter"),MA,1,h,"y2",g-f,1,f,l)),c.rowtitle&&(a=NA(n.titleAnchor,cA),u=NA(p,"rowTitle"),u=a===zI?s+u:i-u,l=NA(n.titleBand,cA,.5),UA(e,c.rowtitle,u,0,_,l)),c.coltitle&&(a=NA(n.titleAnchor,uA),u=NA(p,"columnTitle"),u=a===zI?o+u:r-u,l=NA(n.titleBand,uA,.5),UA(e,c.coltitle,u,1,_,l))}function PA(e,t){return"x1"===t?e.x||0:"y1"===t?e.y||0:"x2"===t?(e.x||0)+(e.width||0):"y2"===t?(e.y||0)+(e.height||0):void 0}function BA(e,t){return e.bounds[t]}function $A(e,t,n,i,r,s,o,a,l,u,c,d,h,p){var f,m,g,_,y,v,b,T,x,E=n.length,w=0,I=0;if(!E)return w;for(f=c;f<E;f+=d)n[f]&&(w=o(w,l(n[f],u)));if(!t.length)return w;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),w+=s,m=0,_=t.length;m<_;++m)e.dirty(t[m]),t[m].mark.bounds.clear();for(f=c,m=0,_=t.length;m<_;++m,f+=d){for(y=(v=t[m]).mark.bounds,g=f;g>=0&&null==(b=n[g]);g-=h);a?(T=null==p?b.x:Math.round(b.bounds.x1+p*b.bounds.width()),x=w):(T=w,x=null==p?b.y:Math.round(b.bounds.y1+p*b.bounds.height())),y.union(v.bounds.translate(T-(v.x||0),x-(v.y||0))),v.x=T,v.y=x,e.dirty(v),I=o(I,y[u])}return I}function UA(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function VA(e,t,n,i,r,s,o){const a=function(e,t){const n=e[t]||{};return(t,i)=>null!=n[t]?n[t]:null!=e[t]?e[t]:i}(n,t),l=function(e,t){let n=-1/0;return e.forEach(e=>{null!=e.offset&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}(e,a("offset",0)),u=a("anchor",UI),c=u===zI?1:u===VI?.5:0,d={align:aA,bounds:a("bounds",lA),columns:"vertical"===a("direction")?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case PI:d.anchor={x:Math.floor(i.x1)-l,column:zI,y:c*(o||i.height()+2*i.y1),row:u};break;case BI:d.anchor={x:Math.ceil(i.x2)+l,y:c*(o||i.height()+2*i.y1),row:u};break;case LI:d.anchor={y:Math.floor(r.y1)-l,row:zI,x:c*(s||r.width()+2*r.x1),column:u};break;case $I:d.anchor={y:Math.ceil(r.y2)+l,x:c*(s||r.width()+2*r.x1),column:u};break;case"top-left":d.anchor={x:l,y:l};break;case"top-right":d.anchor={x:s-l,y:l,column:zI};break;case"bottom-left":d.anchor={x:l,y:o-l,row:zI};break;case"bottom-right":d.anchor={x:s-l,y:o-l,column:zI,row:zI}}return d}function zA(e,t){var n,i,r=t.items[0],s=r.datum,o=r.orient,a=r.bounds,l=r.x,u=r.y;return r._bounds?r._bounds.clear().union(a):r._bounds=a.clone(),a.clear(),function(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(t.datum.title){var o=t.items[1].items[0],a=o.anchor,l=t.titlePadding||0,u=i-o.x,c=i-o.y;switch(o.orient){case PI:r+=Math.ceil(o.bounds.width())+l;break;case BI:case $I:break;default:s+=o.bounds.height()+l}switch((r||s)&&YA(e,n,r,s),o.orient){case PI:c+=jA(t,n,o,a,1,1);break;case BI:u+=jA(t,n,o,zI,0,0)+l,c+=jA(t,n,o,a,1,1);break;case $I:u+=jA(t,n,o,a,0,0),c+=jA(t,n,o,zI,-1,0,1)+l;break;default:u+=jA(t,n,o,a,0,0)}(u||c)&&YA(e,o,u,c),(u=Math.round(o.bounds.x1-i))<0&&(YA(e,n,-u,0),YA(e,o,-u,0))}else(r||s)&&YA(e,n,r,s)}(e,r,r.items[0].items[0]),a=function(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(r,a),n=2*r.padding,i=2*r.padding,a.empty()||(n=Math.ceil(a.width()+n),i=Math.ceil(a.height()+i)),"symbol"===s.type&&function(e){const t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}(r.items[0].items[0].items[0].items),o!==sA&&(r.x=l=0,r.y=u=0),r.width=n,r.height=i,_x(a.set(l,u,l+n,u+i),r),r.mark.bounds.clear().union(a),r}function jA(e,t,n,i,r,s,o){const a="symbol"!==e.datum.type,l=n.datum.vgrad,u=(!a||!s&&l||o?t:t.items[0]).bounds[r?"y2":"x2"]-e.padding,c=l&&s?u:0,d=l&&s?0:u,h=r<=0?0:KE(n);return Math.round(i===UI?c:i===zI?d-h:.5*(u-h))}function YA(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function GA(e){Ho.call(this,null,e)}ih(GA,Ho,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(t=>{e.layout&&LA(n,t,e.layout),function(e,t,n){var i,r,s,o,a,l=t.items,u=Math.max(0,t.width||0),c=Math.max(0,t.height||0),d=(new dx).set(0,0,u,c),h=d.clone(),p=d.clone(),f=[];for(o=0,a=l.length;o<a;++o)switch((r=l[o]).role){case YI:(AA(r)?h:p).union(SA(e,r,u,c));break;case GI:i=r;break;case XI:f.push(zA(e,r));break;case HI:case WI:case qI:case KI:case ZI:case QI:case JI:case eA:h.union(r.bounds),p.union(r.bounds);break;default:d.union(r.bounds)}if(f.length){const t={};f.forEach(e=>{(s=e.orient||BI)!==sA&&(t[s]||(t[s]=[])).push(e)});for(const i in t){const r=t[i];FA(e,r,VA(r,i,n.legends,h,p,u,c))}f.forEach(t=>{const i=t.bounds;if(i.equals(t._bounds)||(t.bounds=t._bounds,e.dirty(t),t.bounds=i,e.dirty(t)),!n.autosize||n.autosize.type!==nA&&n.autosize.type!==iA&&n.autosize.type!==rA)d.union(i);else switch(t.orient){case PI:case BI:d.add(i.x1,0).add(i.x2,0);break;case LI:case $I:d.add(0,i.y1).add(0,i.y2)}})}d.union(h).union(p),i&&d.union(function(e,t,n,i,r){var s,o=t.items[0],a=o.frame,l=o.orient,u=o.anchor,c=o.offset,d=o.padding,h=o.items[0].items[0],p=o.items[1]&&o.items[1].items[0],f=l===PI||l===BI?i:n,m=0,g=0,_=0,y=0,v=0;if(a!==jI?l===PI?(m=r.y2,f=r.y1):l===BI?(m=r.y1,f=r.y2):(m=r.x1,f=r.x2):l===PI&&(m=i,f=0),s=u===UI?m:u===zI?f:(m+f)/2,p&&p.text){switch(l){case LI:case $I:v=h.bounds.height()+d;break;case PI:y=h.bounds.width()+d;break;case BI:y=-h.bounds.width()-d}wA.clear().union(p.bounds),wA.translate(y-(p.x||0),v-(p.y||0)),IA(p,"x",y)|IA(p,"y",v)&&(e.dirty(p),p.bounds.clear().union(wA),p.mark.bounds.clear().union(wA),e.dirty(p)),wA.clear().union(p.bounds)}else wA.clear();switch(wA.union(h.bounds),l){case LI:g=s,_=r.y1-wA.height()-c;break;case PI:g=r.x1-wA.width()-c,_=s;break;case BI:g=r.x2+wA.width()+c,_=s;break;case $I:g=s,_=r.y2+c;break;default:g=o.x,_=o.y}return IA(o,"x",g)|IA(o,"y",_)&&(wA.translate(g,_),e.dirty(o),o.bounds.clear().union(wA),t.bounds.clear().union(wA),e.dirty(o)),o.bounds}(e,i,u,c,d));t.clip&&d.set(0,0,t.width||0,t.height||0);!function(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),d=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-l)),p=Math.max(0,Math.ceil(n.y2-c));if(r.contains===tA){const t=e.padding();o-=t.left+t.right,a-=t.top+t.bottom}s===sA?(u=0,d=0,l=o,c=a):s===nA?(l=Math.max(0,o-u-h),c=Math.max(0,a-d-p)):s===iA?(l=Math.max(0,o-u-h),a=c+d+p):s===rA?(o=l+u+h,c=Math.max(0,a-d-p)):"pad"===s&&(o=l+u+h,a=c+d+p);e._resizeView(o,a,l,c,[u,d],r.resize)}(e,t,d,n)}(n,t,e)}),function(e){return e&&"legend-entry"!==e.mark.role}(e.mark.group)?t.reflow():t}});const HA=nl(Ko),WA=HA.right,XA=HA.left,qA=(nl(ta).center,WA);function KA(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function ZA(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const QA=Symbol("implicit");function JA(){var e=new Map,t=[],n=[],i=QA;function r(r){var s=r+"",o=e.get(s);if(!o){if(i!==QA)return i;e.set(s,o=t.push(r))}return n[(o-1)%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Map;for(const i of n){const n=i+"";e.has(n)||e.set(n,t.push(i))}return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return JA(t,n).unknown(i)},KA.apply(r,arguments),r}var eS=n(34410);function tS(e,t,n,i){var r,s=ru(e,t,n);switch((i=(0,eS.formatSpecifier)(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=(0,eS.precisionPrefix)(s,o))||(i.precision=r),(0,eS.formatPrefix)(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=(0,eS.precisionRound)(s,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=(0,eS.precisionFixed)(s))||(i.precision=r-2*("%"===i.type))}return(0,eS.format)(i)}function nS(e,t,n,i,r){var s=e*e,o=s*e;return((1-3*e+3*s-o)*t+(4-6*s+3*o)*n+(1+3*e+3*s-3*o)*i+o*r)/6}function iS(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i<t-1?e[i+2]:2*s-r;return nS((n-i/t)*t,o,r,s,a)}}function rS(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],s=e[i%t],o=e[(i+1)%t],a=e[(i+2)%t];return nS((n-i/t)*t,r,s,o,a)}}const sS=e=>()=>e;function oS(e,t){return function(n){return e+n*t}}function aS(e,t){var n=t-e;return n?oS(e,n>180||n<-180?n-360*Math.round(n/360):n):sS(isNaN(e)?t:e)}function lS(e){return 1===(e=+e)?uS:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):sS(isNaN(t)?n:t)}}function uS(e,t){var n=t-e;return n?oS(e,n):sS(isNaN(e)?t:e)}const cS=function e(t){var n=lS(t);function i(e,t){var i=n((e=k_(e)).r,(t=k_(t)).r),r=n(e.g,t.g),s=n(e.b,t.b),o=uS(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=s(t),e.opacity=o(t),e+""}}return i.gamma=e,i}(1);function dS(e){return function(t){var n,i,r=t.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=k_(t[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=e(s),o=e(o),a=e(a),i.opacity=1,function(e){return i.r=s(e),i.g=o(e),i.b=a(e),i+""}}}var hS=dS(iS),pS=dS(rS);function fS(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(s){for(n=0;n<i;++n)r[n]=e[n]*(1-s)+t[n]*s;return r}}function mS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gS(e,t){return(mS(t)?fS:_S)(e,t)}function _S(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,s=new Array(r),o=new Array(i);for(n=0;n<r;++n)s[n]=wS(e[n],t[n]);for(;n<i;++n)o[n]=t[n];return function(e){for(n=0;n<r;++n)o[n]=s[n](e);return o}}function yS(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function vS(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bS(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=wS(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var TS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xS=new RegExp(TS.source,"g");function ES(e,t){var n,i,r,s=TS.lastIndex=xS.lastIndex=0,o=-1,a=[],l=[];for(e+="",t+="";(n=TS.exec(e))&&(i=xS.exec(t));)(r=i.index)>s&&(r=t.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:vS(n,i)})),s=xS.lastIndex;return s<t.length&&(r=t.slice(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function wS(e,t){var n,i=typeof t;return null==t||"boolean"===i?sS(t):("number"===i?vS:"string"===i?(n=S_(t))?(t=n,cS):ES:t instanceof S_?cS:t instanceof Date?yS:mS(t)?fS:Array.isArray(t)?_S:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?bS:vS)(e,t)}function IS(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function AS(e){return+e}var SS=[0,1];function CS(e){return e}function OS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function MS(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r<i?(i=OS(r,i),s=n(o,s)):(i=OS(i,r),s=n(s,o)),function(e){return s(i(e))}}function kS(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)r[o]=OS(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(t){var n=qA(e,t,1,i)-1;return s[n](r[n](t))}}function RS(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function NS(){var e,t,n,i,r,s,o=SS,a=SS,l=wS,u=CS;function c(){var e=Math.min(o.length,a.length);return u!==CS&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(o[0],o[e-1])),i=e>2?kS:MS,r=s=null,d}function d(t){return null==t||isNaN(t=+t)?n:(r||(r=i(o.map(e),a,l)))(e(u(t)))}return d.invert=function(n){return u(t((s||(s=i(a,o.map(e),vS)))(n)))},d.domain=function(e){return arguments.length?(o=Array.from(e,AS),c()):o.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),c()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=IS,c()},d.clamp=function(e){return arguments.length?(u=!!e||CS,c()):u!==CS},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,i){return e=n,t=i,c()}}function DS(){return NS()(CS,CS)}function FS(e){var t=e.domain;return e.ticks=function(e){var n=t();return nu(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return tS(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,s=t(),o=0,a=s.length-1,l=s[o],u=s[a],c=10;for(u<l&&(r=l,l=u,u=r,r=o,o=a,a=r);c-- >0;){if((r=iu(l,u,n))===i)return s[o]=l,s[a]=u,t(s);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return e},e}function LS(e,t){var n,i=0,r=(e=e.slice()).length-1,s=e[i],o=e[r];return o<s&&(n=i,i=r,r=n,n=s,s=o,o=n),e[i]=t.floor(s),e[r]=t.ceil(o),e}function PS(e){return Math.log(e)}function BS(e){return Math.exp(e)}function $S(e){return-Math.log(-e)}function US(e){return-Math.exp(-e)}function VS(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zS(e){return function(t){return-e(-t)}}function jS(e){var t,n,i=e(PS,BS),r=i.domain,s=10;function o(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(s),n=function(e){return 10===e?VS:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(s),r()[0]<0?(t=zS(t),n=zS(n),e($S,US)):e(PS,BS),i}return i.base=function(e){return arguments.length?(s=+e,o()):s},i.domain=function(e){return arguments.length?(r(e),o()):r()},i.ticks=function(e){var i,o=r(),a=o[0],l=o[o.length-1];(i=l<a)&&(h=a,a=l,l=h);var u,c,d,h=t(a),p=t(l),f=null==e?10:+e,m=[];if(!(s%1)&&p-h<f){if(h=Math.floor(h),p=Math.ceil(p),a>0){for(;h<=p;++h)for(c=1,u=n(h);c<s;++c)if(!((d=u*c)<a)){if(d>l)break;m.push(d)}}else for(;h<=p;++h)for(c=s-1,u=n(h);c>=1;--c)if(!((d=u*c)<a)){if(d>l)break;m.push(d)}2*m.length<f&&(m=nu(a,l,f))}else m=nu(h,p,Math.min(p-h,f)).map(n);return i?m.reverse():m},i.tickFormat=function(e,r){if(null==r&&(r=10===s?".0e":","),"function"!=typeof r&&(r=(0,eS.format)(r)),e===1/0)return r;null==e&&(e=10);var o=Math.max(1,s*e/i.ticks().length);return function(e){var i=e/n(Math.round(t(e)));return i*s<s-.5&&(i*=s),i<=o?r(e):""}},i.nice=function(){return r(LS(r(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},i}function YS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function GS(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function HS(e){return e<0?-e*e:e*e}function WS(e){var t=e(CS,CS),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(CS,CS):.5===n?e(GS,HS):e(YS(n),YS(1/n)):n},FS(t)}function XS(){var e=WS(NS());return e.copy=function(){return RS(e,XS()).exponent(e.exponent())},KA.apply(e,arguments),e}function qS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function KS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ZS(e){var t=1,n=e(qS(t),KS(t));return n.constant=function(n){return arguments.length?e(qS(t=+n),KS(t)):t},FS(n)}function QS(e,t,n,i,r,s){const o=[[zl,1,ol],[zl,5,5e3],[zl,15,15e3],[zl,30,3e4],[s,1,al],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,ll],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,ul],[i,2,1728e5],[n,1,cl],[t,1,dl],[t,3,7776e6],[e,1,hl]];function a(t,n,i){const r=Math.abs(n-t)/i,s=nl(([,,e])=>e).right(o,r);if(s===o.length)return e.every(ru(t/hl,n/hl,i));if(0===s)return Yl.every(Math.max(ru(t,n,i),1));const[a,l]=o[r/o[s-1][2]<o[s][2]/r?s-1:s];return a.every(l)}return[function(e,t,n){const i=t<e;i&&([e,t]=[t,e]);const r=n&&"function"==typeof n.range?n:a(e,t,n),s=r?r.range(e,+t+1):[];return i?s.reverse():s},a]}const[JS,eC]=QS(Hl,Xl,Al,wl,Kl,Ql),[tC,nC]=QS(Dl,Ll,gl,fl,Bl,Ul);function iC(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function rC(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function sC(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function oC(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,l=e.shortMonths,u=yC(r),c=vC(r),d=yC(s),h=vC(s),p=yC(o),f=vC(o),m=yC(a),g=vC(a),_=yC(l),y=vC(l),v={a:function(e){return o[e.getDay()]},A:function(e){return s[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:UC,e:UC,f:GC,g:nO,G:rO,H:VC,I:zC,j:jC,L:YC,m:HC,M:WC,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:SO,s:CO,S:XC,u:qC,U:KC,V:QC,w:JC,W:eO,x:null,X:null,y:tO,Y:iO,Z:sO,"%":AO},b={a:function(e){return o[e.getUTCDay()]},A:function(e){return s[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:oO,e:oO,f:dO,g:xO,G:wO,H:aO,I:lO,j:uO,L:cO,m:hO,M:pO,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:SO,s:CO,S:fO,u:mO,U:gO,V:yO,w:vO,W:bO,x:null,X:null,y:TO,Y:EO,Z:IO,"%":AO},T={a:function(e,t,n){var i=p.exec(t.slice(n));return i?(e.w=f.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=d.exec(t.slice(n));return i?(e.w=h.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=_.exec(t.slice(n));return i?(e.m=y.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return w(e,t,n,i)},d:MC,e:MC,f:LC,g:AC,G:IC,H:RC,I:RC,j:kC,L:FC,m:OC,M:NC,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c.get(i[0].toLowerCase()),n+i[0].length):-1},q:CC,Q:BC,s:$C,S:DC,u:TC,U:xC,V:EC,w:bC,W:wC,x:function(e,t,i){return w(e,n,t,i)},X:function(e,t,n){return w(e,i,t,n)},y:AC,Y:IC,Z:SC,"%":PC};function x(e,t){return function(n){var i,r,s,o=[],a=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++a<u;)37===e.charCodeAt(a)&&(o.push(e.slice(l,a)),null!=(r=hC[i=e.charAt(++a)])?i=e.charAt(++a):r="e"===i?" ":"0",(s=t[i])&&(i=s(n,r)),o.push(i),l=a+1);return o.push(e.slice(l,a)),o.join("")}}function E(e,t){return function(n){var i,r,s=sC(1900,void 0,1);if(w(s,e,n+="",0)!=n.length)return null;if("Q"in s)return new Date(s.Q);if("s"in s)return new Date(1e3*s.s+("L"in s?s.L:0));if(t&&!("Z"in s)&&(s.Z=0),"p"in s&&(s.H=s.H%12+12*s.p),void 0===s.m&&(s.m="q"in s?s.q:0),"V"in s){if(s.V<1||s.V>53)return null;"w"in s||(s.w=1),"Z"in s?(r=(i=rC(sC(s.y,0,1))).getUTCDay(),i=r>4||0===r?Sl.ceil(i):Sl(i),i=wl.offset(i,7*(s.V-1)),s.y=i.getUTCFullYear(),s.m=i.getUTCMonth(),s.d=i.getUTCDate()+(s.w+6)%7):(r=(i=iC(sC(s.y,0,1))).getDay(),i=r>4||0===r?_l.ceil(i):_l(i),i=fl.offset(i,7*(s.V-1)),s.y=i.getFullYear(),s.m=i.getMonth(),s.d=i.getDate()+(s.w+6)%7)}else("W"in s||"U"in s)&&("w"in s||(s.w="u"in s?s.u%7:"W"in s?1:0),r="Z"in s?rC(sC(s.y,0,1)).getUTCDay():iC(sC(s.y,0,1)).getDay(),s.m=0,s.d="W"in s?(s.w+6)%7+7*s.W-(r+5)%7:s.w+7*s.U-(r+6)%7);return"Z"in s?(s.H+=s.Z/100|0,s.M+=s.Z%100,rC(s)):iC(s)}}function w(e,t,n,i){for(var r,s,o=0,a=t.length,l=n.length;o<a;){if(i>=l)return-1;if(37===(r=t.charCodeAt(o++))){if(r=t.charAt(o++),!(s=T[r in hC?t.charAt(o++):r])||(i=s(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=x(n,v),v.X=x(i,v),v.c=x(t,v),b.x=x(n,b),b.X=x(i,b),b.c=x(t,b),{format:function(e){var t=x(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=x(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}var aC,lC,uC,cC,dC,hC={"-":"",_:" ",0:"0"},pC=/^\s*\d+/,fC=/^%/,mC=/[\\^$*+?|[\]().{}]/g;function gC(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function _C(e){return e.replace(mC,"\\$&")}function yC(e){return new RegExp("^(?:"+e.map(_C).join("|")+")","i")}function vC(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function bC(e,t,n){var i=pC.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function TC(e,t,n){var i=pC.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function xC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function EC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function wC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function IC(e,t,n){var i=pC.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function AC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function SC(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function CC(e,t,n){var i=pC.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function OC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function MC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function kC(e,t,n){var i=pC.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function RC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function NC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function DC(e,t,n){var i=pC.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function FC(e,t,n){var i=pC.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function LC(e,t,n){var i=pC.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function PC(e,t,n){var i=fC.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function BC(e,t,n){var i=pC.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function $C(e,t,n){var i=pC.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function UC(e,t){return gC(e.getDate(),t,2)}function VC(e,t){return gC(e.getHours(),t,2)}function zC(e,t){return gC(e.getHours()%12||12,t,2)}function jC(e,t){return gC(1+fl.count(Dl(e),e),t,3)}function YC(e,t){return gC(e.getMilliseconds(),t,3)}function GC(e,t){return YC(e,t)+"000"}function HC(e,t){return gC(e.getMonth()+1,t,2)}function WC(e,t){return gC(e.getMinutes(),t,2)}function XC(e,t){return gC(e.getSeconds(),t,2)}function qC(e){var t=e.getDay();return 0===t?7:t}function KC(e,t){return gC(gl.count(Dl(e)-1,e),t,2)}function ZC(e){var t=e.getDay();return t>=4||0===t?bl(e):bl.ceil(e)}function QC(e,t){return e=ZC(e),gC(bl.count(Dl(e),e)+(4===Dl(e).getDay()),t,2)}function JC(e){return e.getDay()}function eO(e,t){return gC(_l.count(Dl(e)-1,e),t,2)}function tO(e,t){return gC(e.getFullYear()%100,t,2)}function nO(e,t){return gC((e=ZC(e)).getFullYear()%100,t,2)}function iO(e,t){return gC(e.getFullYear()%1e4,t,4)}function rO(e,t){var n=e.getDay();return gC((e=n>=4||0===n?bl(e):bl.ceil(e)).getFullYear()%1e4,t,4)}function sO(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gC(t/60|0,"0",2)+gC(t%60,"0",2)}function oO(e,t){return gC(e.getUTCDate(),t,2)}function aO(e,t){return gC(e.getUTCHours(),t,2)}function lO(e,t){return gC(e.getUTCHours()%12||12,t,2)}function uO(e,t){return gC(1+wl.count(Hl(e),e),t,3)}function cO(e,t){return gC(e.getUTCMilliseconds(),t,3)}function dO(e,t){return cO(e,t)+"000"}function hO(e,t){return gC(e.getUTCMonth()+1,t,2)}function pO(e,t){return gC(e.getUTCMinutes(),t,2)}function fO(e,t){return gC(e.getUTCSeconds(),t,2)}function mO(e){var t=e.getUTCDay();return 0===t?7:t}function gO(e,t){return gC(Al.count(Hl(e)-1,e),t,2)}function _O(e){var t=e.getUTCDay();return t>=4||0===t?Ml(e):Ml.ceil(e)}function yO(e,t){return e=_O(e),gC(Ml.count(Hl(e),e)+(4===Hl(e).getUTCDay()),t,2)}function vO(e){return e.getUTCDay()}function bO(e,t){return gC(Sl.count(Hl(e)-1,e),t,2)}function TO(e,t){return gC(e.getUTCFullYear()%100,t,2)}function xO(e,t){return gC((e=_O(e)).getUTCFullYear()%100,t,2)}function EO(e,t){return gC(e.getUTCFullYear()%1e4,t,4)}function wO(e,t){var n=e.getUTCDay();return gC((e=n>=4||0===n?Ml(e):Ml.ceil(e)).getUTCFullYear()%1e4,t,4)}function IO(){return"+0000"}function AO(){return"%"}function SO(e){return+e}function CO(e){return Math.floor(+e/1e3)}function OO(e){return new Date(e)}function MO(e){return e instanceof Date?+e:+new Date(+e)}function kO(e,t,n,i,r,s,o,a,l,u){var c=DS(),d=c.invert,h=c.domain,p=u(".%L"),f=u(":%S"),m=u("%I:%M"),g=u("%I %p"),_=u("%a %d"),y=u("%b %d"),v=u("%B"),b=u("%Y");function T(e){return(l(e)<e?p:a(e)<e?f:o(e)<e?m:s(e)<e?g:i(e)<e?r(e)<e?_:y:n(e)<e?v:b)(e)}return c.invert=function(e){return new Date(d(e))},c.domain=function(e){return arguments.length?h(Array.from(e,MO)):h().map(OO)},c.ticks=function(t){var n=h();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?T:u(t)},c.nice=function(e){var n=h();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?h(LS(n,e)):c},c.copy=function(){return RS(c,kO(e,t,n,i,r,s,o,a,l,u))},c}function RO(){var e,t,n,i,r,s=0,o=1,a=CS,l=!1;function u(t){return null==t||isNaN(t=+t)?r:a(0===n?.5:(t=(i(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,i;return arguments.length?([n,i]=t,a=e(n,i),u):[a(0),a(1)]}}return u.domain=function(r){return arguments.length?([s,o]=r,e=i(s=+s),t=i(o=+o),n=e===t?0:1/(t-e),u):[s,o]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(a=e,u):a},u.range=c(wS),u.rangeRound=c(IS),u.unknown=function(e){return arguments.length?(r=e,u):r},function(r){return i=r,e=r(s),t=r(o),n=e===t?0:1/(t-e),u}}function NO(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function DO(){var e=FS(RO()(CS));return e.copy=function(){return NO(e,DO())},ZA.apply(e,arguments)}function FO(){var e=WS(RO());return e.copy=function(){return NO(e,FO()).exponent(e.exponent())},ZA.apply(e,arguments)}function LO(e,t){void 0===t&&(t=e,e=wS);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return s[t](e-t)}}function PO(){var e,t,n,i,r,s,o,a=0,l=.5,u=1,c=1,d=CS,h=!1;function p(e){return isNaN(e=+e)?o:(e=.5+((e=+s(e))-t)*(c*e<c*t?i:r),d(h?Math.max(0,Math.min(1,e)):e))}function f(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,d=LO(e,[n,i,r]),p):[d(0),d(.5),d(1)]}}return p.domain=function(o){return arguments.length?([a,l,u]=o,e=s(a=+a),t=s(l=+l),n=s(u=+u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p):[a,l,u]},p.clamp=function(e){return arguments.length?(h=!!e,p):h},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=f(wS),p.rangeRound=f(IS),p.unknown=function(e){return arguments.length?(o=e,p):o},function(o){return s=o,e=o(a),t=o(l),n=o(u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p}}function BO(){var e=WS(PO());return e.copy=function(){return NO(e,BO()).exponent(e.exponent())},ZA.apply(e,arguments)}function $O(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function UO(e,t){var n=aS(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}!function(e){aC=oC(e),lC=aC.format,uC=aC.parse,cC=aC.utcFormat,dC=aC.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var VO,zO=180/Math.PI,jO={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function YO(e,t,n,i,r,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),e*i<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*zO,skewX:Math.atan(l)*zO,scaleX:o,scaleY:a}}function GO(e,t,n,i){function r(e){return e.length?e.pop()+" ":""}return function(s,o){var a=[],l=[];return s=e(s),o=e(o),function(e,i,r,s,o,a){if(e!==r||i!==s){var l=o.push("translate(",null,t,null,n);a.push({i:l-4,x:vS(e,r)},{i:l-2,x:vS(i,s)})}else(r||s)&&o.push("translate("+r+t+s+n)}(s.translateX,s.translateY,o.translateX,o.translateY,a,l),function(e,t,n,s){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:vS(e,t)})):t&&n.push(r(n)+"rotate("+t+i)}(s.rotate,o.rotate,a,l),function(e,t,n,s){e!==t?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:vS(e,t)}):t&&n.push(r(n)+"skewX("+t+i)}(s.skewX,o.skewX,a,l),function(e,t,n,i,s,o){if(e!==n||t!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:vS(e,n)},{i:a-2,x:vS(t,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(e){for(var t,n=-1,i=l.length;++n<i;)a[(t=l[n]).i]=t.x(e);return a.join("")}}}var HO=GO(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?jO:YO(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),WO=GO(function(e){return null==e?jO:(VO||(VO=document.createElementNS("http://www.w3.org/2000/svg","g")),VO.setAttribute("transform",e),(e=VO.transform.baseVal.consolidate())?YO((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):jO)},", ",")",")");function XO(e){return((e=Math.exp(e))+1/e)/2}const qO=function e(t,n,i){function r(e,r){var s,o,a=e[0],l=e[1],u=e[2],c=r[0],d=r[1],h=r[2],p=c-a,f=d-l,m=p*p+f*f;if(m<1e-12)o=Math.log(h/u)/t,s=function(e){return[a+e*p,l+e*f,u*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),_=(h*h-u*u+i*m)/(2*u*n*g),y=(h*h-u*u-i*m)/(2*h*n*g),v=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(y*y+1)-y);o=(b-v)/t,s=function(e){var i=e*o,r=XO(v),s=u/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+v)-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*p,l+s*f,u*r/XO(t*i+v)]}}return s.duration=1e3*o*t/Math.SQRT2,s}return r.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},r}(Math.SQRT2,2,4);function KO(e){return function(t,n){var i=e((t=B_(t)).h,(n=B_(n)).h),r=uS(t.s,n.s),s=uS(t.l,n.l),o=uS(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=s(e),t.opacity=o(e),t+""}}}const ZO=KO(aS);var QO=KO(uS);function JO(e,t){var n=uS((e=Dv(e)).l,(t=Dv(t)).l),i=uS(e.a,t.a),r=uS(e.b,t.b),s=uS(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=s(t),e+""}}function eM(e){return function(t,n){var i=e((t=Vv(t)).h,(n=Vv(n)).h),r=uS(t.c,n.c),s=uS(t.l,n.l),o=uS(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=s(e),t.opacity=o(e),t+""}}}const tM=eM(aS);var nM=eM(uS);function iM(e){return function t(n){function i(t,i){var r=e((t=nb(t)).h,(i=nb(i)).h),s=uS(t.s,i.s),o=uS(t.l,i.l),a=uS(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=s(e),t.l=o(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,i.gamma=t,i}(1)}const rM=iM(aS);var sM=iM(uS);function oM(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}function aM(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}const lM="linear",uM="log",cM="pow",dM="sqrt",hM="symlog",pM="time",fM="utc",mM="sequential",gM="diverging",_M="quantile",yM="quantize",vM="threshold",bM="ordinal",TM="point",xM="band",EM="bin-ordinal",wM="continuous",IM="discrete",AM="discretizing",SM="interpolating",CM="temporal";function OM(){const e=JA().unknown(void 0),t=e.domain,n=e.range;let i,r,s=[0,1],o=!1,a=0,l=0,u=.5;function c(){const e=t().length,c=s[1]<s[0],d=s[1-c],h=aM(e,a,l);let p=s[c-0];i=(d-p)/(h||1),o&&(i=Math.floor(i)),p+=(d-p-i*(e-a))*u,r=i*(1-a),o&&(p=Math.round(p),r=Math.round(r));const f=tl(e).map(e=>p+i*e);return n(c?f.reverse():f)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(s=[+e[0],+e[1]],c()):s.slice()},e.rangeRound=function(e){return s=[+e[0],+e[1]],o=!0,c()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(o=!!e,c()):o},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),a=l,c()):a},e.paddingInner=function(e){return arguments.length?(a=Math.max(0,Math.min(1,e)),c()):a},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const i=s[1]<s[0],o=i?n().reverse():n(),a=o.length-1;let l,u,c,d=+e[0],h=+e[1];return d!=d||h!=h||(h<d&&(c=d,d=h,h=c),h<o[0]||d>s[1-i])?void 0:(l=Math.max(0,WA(o,d)-1),u=d===h?l:WA(o,h)-1,d-o[l]>r+1e-10&&++l,i&&(c=l,l=a-u,u=a-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return OM().domain(t()).range(s).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function MM(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return MM(t())},e}var kM=Array.prototype.map;const RM=Array.prototype.slice;const NM={};function DM(e,t,n){return arguments.length>1?(NM[e]=function(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){const n=e.range();let i,r,s,o,a=t[0],l=t[1],u=-1;for(l<a&&(r=a,a=l,l=r),s=0,o=n.length;s<o;++s)n[s]>=a&&n[s]<=l&&(u<0&&(u=s),i=s);if(!(u<0))return a=e.invertExtent(n[u]),l=e.invertExtent(n[i]),[void 0===a[0]?a[1]:a[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,n};return i.metadata=Dt(Xe(n)),i}(e,t,n),this):FM(e)?NM[e]:void 0}function FM(e){return ut(NM,e)}function LM(e,t){const n=NM[e];return n&&n.metadata[t]}function PM(e){return LM(e,wM)}function BM(e){return LM(e,IM)}function $M(e){return LM(e,AM)}function UM(e){return LM(e,uM)}function VM(e){return LM(e,SM)}function zM(e){return LM(e,_M)}DM("identity",function e(t){var n;function i(e){return null==e||isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,AS),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,AS):[0,1],FS(i)}),DM(lM,function e(){var t=DS();return t.copy=function(){return RS(t,e())},KA.apply(t,arguments),FS(t)},wM),DM(uM,function e(){var t=jS(NS()).domain([1,10]);return t.copy=function(){return RS(t,e()).base(t.base())},KA.apply(t,arguments),t},[wM,uM]),DM(cM,XS,wM),DM(dM,function(){return XS.apply(null,arguments).exponent(.5)},wM),DM(hM,function e(){var t=ZS(NS());return t.copy=function(){return RS(t,e()).constant(t.constant())},KA.apply(t,arguments)},wM),DM(pM,function(){return KA.apply(kO(tC,nC,Dl,Ll,gl,fl,Bl,Ul,zl,lC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},[wM,CM]),DM(fM,function(){return KA.apply(kO(JS,eC,Hl,Xl,Al,wl,Kl,Ql,zl,cC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},[wM,CM]),DM(mM,DO,[wM,SM]),DM("".concat(mM,"-").concat(lM),DO,[wM,SM]),DM("".concat(mM,"-").concat(uM),function e(){var t=jS(RO()).domain([1,10]);return t.copy=function(){return NO(t,e()).base(t.base())},ZA.apply(t,arguments)},[wM,SM,uM]),DM("".concat(mM,"-").concat(cM),FO,[wM,SM]),DM("".concat(mM,"-").concat(dM),function(){return FO.apply(null,arguments).exponent(.5)},[wM,SM]),DM("".concat(mM,"-").concat(hM),function e(){var t=ZS(RO());return t.copy=function(){return NO(t,e()).constant(t.constant())},ZA.apply(t,arguments)},[wM,SM]),DM("".concat(gM,"-").concat(lM),function e(){var t=FS(PO()(CS));return t.copy=function(){return NO(t,e())},ZA.apply(t,arguments)},[wM,SM]),DM("".concat(gM,"-").concat(uM),function e(){var t=jS(PO()).domain([.1,1,10]);return t.copy=function(){return NO(t,e()).base(t.base())},ZA.apply(t,arguments)},[wM,SM,uM]),DM("".concat(gM,"-").concat(cM),BO,[wM,SM]),DM("".concat(gM,"-").concat(dM),function(){return BO.apply(null,arguments).exponent(.5)},[wM,SM]),DM("".concat(gM,"-").concat(hM),function e(){var t=ZS(PO());return t.copy=function(){return NO(t,e()).constant(t.constant())},ZA.apply(t,arguments)},[wM,SM]),DM(_M,function e(){var t,n=[],i=[],r=[];function s(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=ia(n,e/t);return o}function o(e){return null==e||isNaN(e=+e)?t:i[qA(r,e)]}return o.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},o.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(Ko),s()},o.range=function(e){return arguments.length?(i=Array.from(e),s()):i.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return e().domain(n).range(i).unknown(t)},KA.apply(o,arguments)},[AM,_M]),DM(yM,function e(){var t,n=0,i=1,r=1,s=[.5],o=[0,1];function a(e){return null!=e&&e<=e?o[qA(s,e,0,r)]:t}function l(){var e=-1;for(s=new Array(r);++e<r;)s[e]=((e+1)*i-(e-r)*n)/(r+1);return a}return a.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,l()):[n,i]},a.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,l()):o.slice()},a.invertExtent=function(e){var t=o.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,s[0]]:t>=r?[s[r-1],i]:[s[t-1],s[t]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return s.slice()},a.copy=function(){return e().domain([n,i]).range(o).unknown(t)},KA.apply(FS(a),arguments)},AM),DM(vM,function e(){var t,n=[.5],i=[0,1],r=1;function s(e){return null!=e&&e<=e?i[qA(n,e,0,r)]:t}return s.domain=function(e){return arguments.length?(n=Array.from(e),r=Math.min(n.length,i.length-1),s):n.slice()},s.range=function(e){return arguments.length?(i=Array.from(e),r=Math.min(n.length,i.length-1),s):i.slice()},s.invertExtent=function(e){var t=i.indexOf(e);return[n[t-1],n[t]]},s.unknown=function(e){return arguments.length?(t=e,s):t},s.copy=function(){return e().domain(n).range(i).unknown(t)},KA.apply(s,arguments)},AM),DM(EM,function e(){let t=[],n=[];function i(e){return null==e||e!=e?void 0:n[(qA(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return kM.call(e,Me)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=RM.call(e),i):n.slice()},i.tickFormat=function(e,n){return tS(t[0],Oe(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i},[IM,AM]),DM(bM,JA,IM),DM(xM,OM,IM),DM(TM,function(){return MM(OM().paddingInner(1))},IM);const jM=["clamp","base","constant","exponent"];function YM(e,t){const n=t[0],i=Oe(t)-n;return function(t){return e(n+t*i)}}function GM(e,t,n){return LO(XM(t||"rgb",n),e)}function HM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function WM(e,t,n){const i=n-t;let r,s,o;return i&&Number.isFinite(i)?(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=DM(s)().domain([t,n]).range([0,1]),jM.forEach(t=>e[t]?o[t](e[t]()):0),o):it(.5)}function XM(e,t){const n=l[function(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function qM(e){const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function KM(e,t){for(const n in e)QM(n,t(e[n]))}const ZM={};function QM(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(ZM[e]=t,this):ZM[e]}KM({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},qM),KM({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},e=>GM(qM(e)));const JM="symbol",ek=e=>Ee(e)?e.map(e=>String(e)):String(e),tk=(e,t)=>e[1]-t[1],nk=(e,t)=>t[1]-e[1];function ik(e,t,n){let i;return yt(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Ct(e.domain())/n||1)))),we(t)&&(i=t.step,t=t.interval),bt(t)&&(t=e.type===pM?Gu(t):e.type==fM?Hu(t):ae("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function rk(e,t,n){let i=e.range(),r=i[0],s=Oe(i),o=tk;if(r>s&&(i=s,s=r,r=i,o=nk),r=Math.floor(r),s=Math.ceil(s),t=t.map(t=>[t,e(t)]).filter(e=>r<=e[1]&&e[1]<=s).sort(o).map(e=>e[0]),n>0&&t.length>1){const e=[t[0],Oe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((e,t)=>!(t%2));t.length<3&&(t=e)}return t}function sk(e,t){return e.bins?rk(e,e.bins):e.ticks?e.ticks(t):e.domain()}function ok(e,t,n,i,r,s){const o=t.type;let a=ek;if(o===pM||r===pM)a=e.timeFormat(i);else if(o===fM||r===fM)a=e.utcFormat(i);else if(UM(o)){const r=e.formatFloat(i);if(s||t.bins)a=r;else{const e=ak(t,n,!1);a=t=>e(t)?r(t):""}}else if(t.tickFormat){const r=t.domain();a=e.formatSpan(r[0],r[r.length-1],n,i)}else i&&(a=e.format(i));return a}function ak(e,t,n){const i=sk(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=e=>{let t=e/Math.pow(r,Math.round(Math.log(e)/s));return t*r<r-.5&&(t*=r),t<=o};return n?i.filter(a):a}const lk={[_M]:"quantiles",[yM]:"thresholds",[vM]:"domain"},uk={[_M]:"quantiles",[yM]:"domain"};function ck(e,t){return e.bins?function(e){const t=e.slice(0,-1);return t.max=Oe(e),t}(e.bins):e.type===uM?ak(e,t,!0):lk[e.type]?function(e){const t=[-1/0].concat(e);return t.max=1/0,t}(e[lk[e.type]]()):sk(e,t)}function dk(e,t,n,i,r,s,o){const a=uk[t.type]&&s!==pM&&s!==fM?function(e,t,n){const i=t[uk[t.type]](),r=i.length;let s,o=r>1?i[1]-i[0]:i[0];for(s=1;s<r;++s)o=Math.min(o,i[s]-i[s-1]);return e.formatSpan(0,o,30,n)}(e,t,r):ok(e,t,n,r,s,o);return i===JM&&(e=>lk[e.type]||e.bins)(t)?hk(a):"discrete"===i?fk(a):mk(a)}const hk=e=>(t,n,i)=>{const r=pk(i[n+1],pk(i.max,1/0)),s=gk(t,e),o=gk(r,e);return s&&o?s+" "+o:o?"< "+o:"≥ "+s},pk=(e,t)=>null!=e?e:t,fk=e=>(t,n)=>n?e(t):null,mk=e=>t=>e(t),gk=(e,t)=>Number.isFinite(e)?t(e):null;function _k(e,t,n,i){const r=i||t.type;return bt(n)&&function(e){return LM(e,CM)}(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||r!==pM?n||r!==fM?dk(e,t,5,null,n,i,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function yk(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=_k(e,t,n.format,n.formatType);if($M(t.type)){const e=ck(t).slice(1).map(r),n=e.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(e.join(", "))}if(BM(t.type)){const e=t.domain(),n=e.length,s=n>i?e.slice(0,i-2).map(r).join(", ")+", ending with "+e.slice(-1).map(r):e.map(r).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(s)}{const e=t.domain();return"values from ".concat(r(e[0])," to ").concat(r(Oe(e)))}}function vk(e,t){let n=0;if(void 0===t)for(let t of e)(t=+t)&&(n+=t);else{let i=-1;for(let r of e)(r=+t(r,++i,e))&&(n+=r)}return n}function bk(e){Ho.call(this,null,e)}function Tk(e){Ho.call(this,null,e)}function xk(){return mo({})}function Ek(e){Ho.call(this,null,e)}function wk(e){Ho.call(this,[],e)}pt(bk,Ho,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=ik(s,null==e.count?e.values?e.values.length:10:e.count,e.minstep),a=e.format||ok(n,s,o,e.formatSpecifier,e.formatType,!!e.values),l=e.values?rk(s,e.values,o):sk(s,o);return r&&(i.rem=r),r=l.map((e,t)=>mo({index:t/(l.length-1||1),value:e,label:a(e)})),e.extra&&r.length&&r.push(mo({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}}),pt(Tk,Ho,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||xk,s=e.key||po,o=this.value;return Ee(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&ae("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=function(e){const t=dt().test(e=>e.exit);return t.lookup=n=>t.get(e(n)),t}(s)),t.visit(t.ADD,e=>{const t=s(e);let n=o.get(t);n?n.exit?(o.empty--,i.add.push(n)):i.mod.push(n):(n=r(e),o.set(t,n),i.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{const t=s(e),n=o.get(t);n&&(n.datum=e,i.mod.push(n))}),t.visit(t.REM,e=>{const t=s(e),n=o.get(t);e!==n.datum||n.exit||(i.rem.push(n),n.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}}),pt(Ek,Ho,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(Ee(s)){if(!n.changed()&&!s.every(e=>r[e]))return t.StopPropagation;s=s[0],n.encode=null}var o="enter"===s,a=r.update||me,l=r.enter||me,u=r.exit||me,c=(s&&!o?r[s]:a)||me;if(t.changed(t.ADD)&&(t.visit(t.ADD,t=>{l(t,e),a(t,e)}),n.modifies(l.output),n.modifies(a.output),c!==me&&c!==a&&(t.visit(t.ADD,t=>{c(t,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==me&&(t.visit(t.REM,t=>{u(t,e)}),n.modifies(u.output)),o||c!==me){const r=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(r,t=>{const r=l(t,e)||i;(c(t,e)||r)&&n.mod.push(t)}),n.mod.length&&n.modifies(l.output)):t.visit(r,t=>{(c(t,e)||i)&&n.mod.push(t)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}}),pt(wk,Ho,{transform(e,t){if(null!=this.value&&!e.modified())return t.StopPropagation;var n,i,r,s,o,a=t.dataflow.locale(),l=t.fork(t.NO_SOURCE|t.NO_FIELDS),u=this.value,c=e.type||JM,d=e.scale,h=+e.limit,p=ik(d,null==e.count?5:e.count,e.minstep),f=!!e.values||c===JM,m=e.format||dk(a,d,p,c,e.formatSpecifier,e.formatType,f),g=e.values||ck(d,p);return u&&(l.rem=u),c===JM?(h&&g.length>h?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),u=g.slice(0,h-1),o=!0):u=g,Ke(r=e.size)?(e.values||0!==d(u[0])||(u=u.slice(1)),s=u.reduce((t,n)=>Math.max(t,r(n,e)),0)):r=it(s=r||8),u=u.map((t,n)=>mo({index:n,label:m(t,n,u),value:t,offset:s,size:r(t,e)})),o&&(o=g[u.length],u.push(mo({index:u.length,label:"…".concat(g.length-u.length," entries"),value:o,offset:s,size:r(o,e)})))):"gradient"===c?(n=d.domain(),i=WM(d,n[0],Oe(n)),g.length<3&&!e.values&&n[0]!==Oe(n)&&(g=[n[0],Oe(n)]),u=g.map((e,t)=>mo({index:t,label:m(e,t,g),value:e,perc:i(e)}))):(r=g.length-1,i=function(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Oe(t),s=r-i;if(e.type===vM){const e=n?s/n:.1;i-=e,r+=e,s=r-i}return e=>(e-i)/s}(d),u=g.map((e,t)=>mo({index:t,label:m(e,t,g),value:e,perc:t?i(e):0,perc2:t===r?1:i(g[t+1])}))),l.source=u,l.add=u,this.value=u,l}});const Ik=e=>e.source.x,Ak=e=>e.source.y,Sk=e=>e.target.x,Ck=e=>e.target.y;function Ok(e){Ho.call(this,{},e)}Ok.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},pt(Ok,Ho,{transform(e,t){var n=e.sourceX||Ik,i=e.sourceY||Ak,r=e.targetX||Sk,s=e.targetY||Ck,o=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=Nk.get(l+"-"+a)||Nk.get(l);return u||ae("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,e=>{e[o]=u(n(e),i(e),r(e),s(e))}),t.reflow(e.modified()).modifies(o)}});const Mk=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,kk=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.sqrt(r*r+s*s)/2;return"M"+e+","+t+"A"+o+","+o+" "+180*Math.atan2(s,r)/Math.PI+" 0 1 "+n+","+i},Rk=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},Nk=dt({line:Mk,"line-radial":(e,t,n,i)=>Mk(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),arc:kk,"arc-radial":(e,t,n,i)=>kk(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),curve:Rk,"curve-radial":(e,t,n,i)=>Rk(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n);return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:n>e)?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*s+"C"+l*r+","+l*s+" "+l*o+","+l*a+" "+i*o+","+i*a}});function Dk(e){Ho.call(this,null,e)}Dk.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},pt(Dk,Ho,{transform(e,t){var n,i,r,s=e.as||["startAngle","endAngle"],o=s[0],a=s[1],l=e.field||pe,u=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,d=t.source,h=d.map(l),p=h.length,f=u,m=(c-u)/vk(h),g=tl(p);for(e.sort&&g.sort((e,t)=>h[e]-h[t]),n=0;n<p;++n)r=h[g[n]],(i=d[g[n]])[o]=f,i[a]=f+=r*m;return this.value=h,t.reflow(e.modified()).modifies(s)}});function Fk(e){return PM(e)&&e!==mM}const Lk=Dt(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function Pk(e){Ho.call(this,null,e),this.modified(!0)}function Bk(e,t,n){UM(e)&&(Math.abs(t.reduce((e,t)=>e+(t<0?-1:t>0?1:0),0))!==t.length&&n.warn("Log scale domain includes zero: "+Ot(t)));return t}function $k(e,t,n){return Ke(e)&&(t||n)?YM(e,Uk(t||[0,1],n)):e}function Uk(e,t){return t?e.slice().reverse():e}function Vk(e){Ho.call(this,null,e)}pt(Pk,Ho,{transform(e,t){var n=t.dataflow,i=this.value,r=function(e){var t,n=e.type,i="";if(n===mM)return mM+"-"+lM;(function(e){const t=e.type;return PM(t)&&t!==pM&&t!==fM&&(e.scheme||e.range&&e.range.length&&e.range.every(bt))})(e)&&(i=2===(t=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(null!=e.domainMid):0)?mM+"-":3===t?gM+"-":"");return(i+n||lM).toLowerCase()}(e);for(r in i&&r===i.type||(this.value=i=DM(r)()),e)if(!Lk[r]){if("padding"===r&&Fk(i.type))continue;Ke(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return function(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(null!=t.rangeStep)s=function(e,t,n){e!==xM&&e!==TM&&ae("Only band and point scales support rangeStep.");var i=(null!=t.paddingOuter?t.paddingOuter:t.padding)||0,r=e===TM?1:(null!=t.paddingInner?t.paddingInner:t.padding)||0;return[0,t.rangeStep*aM(n,r,i)]}(i,t,n);else if(t.scheme&&(s=function(e,t,n){var i,r=t.schemeExtent;Ee(t.scheme)?i=GM(t.scheme,t.interpolate,t.interpolateGamma):(i=QM(t.scheme.toLowerCase()))||ae("Unrecognized scheme name: ".concat(t.scheme));return n=e===vM?n+1:e===EM?n-1:e===_M||e===yM?+t.schemeCount||5:n,VM(e)?$k(i,r,t.reverse):Ke(i)?HM($k(i,r),n):e===bM?i:i.slice(0,n)}(i,t,n),Ke(s))){if(e.interpolator)return e.interpolator(s);ae("Scale type ".concat(i," does not support interpolating color schemes."))}if(s&&VM(i))return e.interpolator(GM(Uk(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(XM(t.interpolate,t.interpolateGamma)):Ke(e.round)?e.round(r):Ke(e.rangeRound)&&e.interpolate(r?IS:wS);s&&e.range(Uk(s,t.reverse))}(i,e,function(e,t,n){let i=t.bins;if(i&&!Ee(i)){const t=e.domain(),n=t[0],r=Oe(t),s=i.step;let o=null==i.start?n:i.start,a=null==i.stop?r:i.stop;s||ae("Scale bins parameter missing step property."),o<n&&(o=s*Math.ceil(n/s)),a>r&&(a=s*Math.floor(r/s)),i=tl(o,a+s/2,s)}i?e.bins=i:e.bins&&delete e.bins;e.type===EM&&(i?t.domain||t.domainRaw||(e.domain(i),n=i.length):e.bins=e.domain());return n}(i,e,function(e,t,n){const i=function(e,t,n){return t?(e.domain(Bk(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(i>-1)return i;var r,s,o=t.domain,a=e.type,l=t.zero||void 0===t.zero&&function(e){const t=e.type;return!e.bins&&(t===lM||t===cM||t===dM)}(e);if(!o)return 0;Fk(a)&&t.padding&&o[0]!==Oe(o)&&(o=function(e,t,n,i,r,s){var o=Math.abs(Oe(n)-n[0]),a=o/(o-2*i),l=e===uM?je(t,null,a):e===dM?Ye(t,null,a,.5):e===cM?Ye(t,null,a,r||1):e===hM?Ge(t,null,a,s||1):ze(t,null,a);return t=t.slice(),t[0]=l[0],t[t.length-1]=l[1],t}(a,o,t.range,t.padding,t.exponent,t.constant));if((l||null!=t.domainMin||null!=t.domainMax||null!=t.domainMid)&&(r=(o=o.slice()).length-1||1,l&&(o[0]>0&&(o[0]=0),o[r]<0&&(o[r]=0)),null!=t.domainMin&&(o[0]=t.domainMin),null!=t.domainMax&&(o[r]=t.domainMax),null!=t.domainMid)){const e=(s=t.domainMid)>o[r]?r+1:s<o[0]?0:r;e!==r&&n.warn("Scale domainMid exceeds domain min or max.",s),o.splice(e,0,s)}e.domain(Bk(a,o,n)),a===bM&&e.unknown(t.domainImplicit?QA:void 0);t.nice&&e.nice&&e.nice(!0!==t.nice&&ik(e,t.nice)||null);return o.length}(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),pt(Vk,Ho,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(vo(e.sort)),this.modified(n),t}});const zk="zero",jk="center",Yk="normalize",Gk=["y0","y1"];function Hk(e){Ho.call(this,null,e)}function Wk(e,t,n,i,r){for(var s,o=(t-e.sum)/2,a=e.length,l=0;l<a;++l)(s=e[l])[i]=o,s[r]=o+=Math.abs(n(s))}function Xk(e,t,n,i,r){for(var s,o=1/e.sum,a=0,l=e.length,u=0,c=0;u<l;++u)(s=e[u])[i]=a,s[r]=a=o*(c+=Math.abs(n(s)))}function qk(e,t,n,i,r){for(var s,o,a=0,l=0,u=e.length,c=0;c<u;++c)(s=+n(o=e[c]))<0?(o[i]=l,o[r]=l+=s):(o[i]=a,o[r]=a+=s)}Hk.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:zk,values:[zk,jk,Yk]},{name:"as",type:"string",array:!0,length:2,default:Gk}]},pt(Hk,Ho,{transform(e,t){var n,i,r,s,o=e.as||Gk,a=o[0],l=o[1],u=vo(e.sort),c=e.field||pe,d=e.offset===jk?Wk:e.offset===Yk?Xk:qk;for(n=function(e,t,n,i){var r,s,o,a,l,u,c,d,h,p=[],f=e=>e(l);if(null==t)p.push(e.slice());else for(r={},s=0,o=e.length;s<o;++s)l=e[s],(c=r[u=t.map(f)])||(r[u]=c=[],p.push(c)),c.push(l);for(u=0,h=0,a=p.length;u<a;++u){for(s=0,d=0,o=(c=p[u]).length;s<o;++s)d+=Math.abs(i(c[s]));c.sum=d,d>h&&(h=d),n&&c.sort(n)}return p.max=h,p}(t.source,e.groupby,u,c),i=0,r=n.length,s=n.max;i<r;++i)d(n[i],s,c,a,l);return t.reflow(e.modified()).modifies(o)}});const Kk=e=>e;function Zk(e,t){e&&Jk.hasOwnProperty(e.type)&&Jk[e.type](e,t)}var Qk={Feature:function(e,t){Zk(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)Zk(n[i].geometry,t)}},Jk={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){eR(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)eR(n[i],t,0)},Polygon:function(e,t){tR(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)tR(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)Zk(n[i],t)}};function eR(e,t,n){var i,r=-1,s=e.length-n;for(t.lineStart();++r<s;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function tR(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)eR(e[n],t,1);t.polygonEnd()}function nR(e,t){e&&Qk.hasOwnProperty(e.type)?Qk[e.type](e,t):Zk(e,t)}class iR{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let n=0;for(let i=0;i<this._n&&i<32;i++){const r=t[i],s=e+r,o=Math.abs(e)<Math.abs(r)?e-(s-r):r-(s-e);o&&(t[n++]=o),e=s}return t[n]=e,this._n=n+1,this}valueOf(){const e=this._partials;let t,n,i,r=this._n,s=0;if(r>0){for(s=e[--r];r>0&&(t=s,n=e[--r],s=t+n,i=n-(s-t),!i););r>0&&(i<0&&e[r-1]<0||i>0&&e[r-1]>0)&&(n=2*i,t=s+n,n==t-s&&(s=t))}return s}}var rR=1e-6,sR=1e-12,oR=Math.PI,aR=oR/2,lR=oR/4,uR=2*oR,cR=180/oR,dR=oR/180,hR=Math.abs,pR=Math.atan,fR=Math.atan2,mR=Math.cos,gR=Math.ceil,_R=Math.exp,yR=(Math.floor,Math.hypot),vR=Math.log,bR=Math.pow,TR=Math.sin,xR=Math.sign||function(e){return e>0?1:e<0?-1:0},ER=Math.sqrt,wR=Math.tan;function IR(e){return e>1?0:e<-1?oR:Math.acos(e)}function AR(e){return e>1?aR:e<-1?-aR:Math.asin(e)}function SR(){}var CR,OR,MR,kR,RR=new iR,NR=new iR,DR={point:SR,lineStart:SR,lineEnd:SR,polygonStart:function(){DR.lineStart=FR,DR.lineEnd=BR},polygonEnd:function(){DR.lineStart=DR.lineEnd=DR.point=SR,RR.add(hR(NR)),NR=new iR},result:function(){var e=RR/2;return RR=new iR,e}};function FR(){DR.point=LR}function LR(e,t){DR.point=PR,CR=MR=e,OR=kR=t}function PR(e,t){NR.add(kR*e-MR*t),MR=e,kR=t}function BR(){PR(CR,OR)}const $R=DR;var UR=1/0,VR=UR,zR=-UR,jR=zR,YR={point:function(e,t){e<UR&&(UR=e);e>zR&&(zR=e);t<VR&&(VR=t);t>jR&&(jR=t)},lineStart:SR,lineEnd:SR,polygonStart:SR,polygonEnd:SR,result:function(){var e=[[UR,VR],[zR,jR]];return zR=jR=-(VR=UR=1/0),e}};const GR=YR;var HR,WR,XR,qR,KR=0,ZR=0,QR=0,JR=0,eN=0,tN=0,nN=0,iN=0,rN=0,sN={point:oN,lineStart:aN,lineEnd:cN,polygonStart:function(){sN.lineStart=dN,sN.lineEnd=hN},polygonEnd:function(){sN.point=oN,sN.lineStart=aN,sN.lineEnd=cN},result:function(){var e=rN?[nN/rN,iN/rN]:tN?[JR/tN,eN/tN]:QR?[KR/QR,ZR/QR]:[NaN,NaN];return KR=ZR=QR=JR=eN=tN=nN=iN=rN=0,e}};function oN(e,t){KR+=e,ZR+=t,++QR}function aN(){sN.point=lN}function lN(e,t){sN.point=uN,oN(XR=e,qR=t)}function uN(e,t){var n=e-XR,i=t-qR,r=ER(n*n+i*i);JR+=r*(XR+e)/2,eN+=r*(qR+t)/2,tN+=r,oN(XR=e,qR=t)}function cN(){sN.point=oN}function dN(){sN.point=pN}function hN(){fN(HR,WR)}function pN(e,t){sN.point=fN,oN(HR=XR=e,WR=qR=t)}function fN(e,t){var n=e-XR,i=t-qR,r=ER(n*n+i*i);JR+=r*(XR+e)/2,eN+=r*(qR+t)/2,tN+=r,nN+=(r=qR*e-XR*t)*(XR+e),iN+=r*(qR+t),rN+=3*r,oN(XR=e,qR=t)}const mN=sN;function gN(e){this._context=e}gN.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,uR)}},result:SR};var _N,yN,vN,bN,TN,xN=new iR,EN={point:SR,lineStart:function(){EN.point=wN},lineEnd:function(){_N&&IN(yN,vN),EN.point=SR},polygonStart:function(){_N=!0},polygonEnd:function(){_N=null},result:function(){var e=+xN;return xN=new iR,e}};function wN(e,t){EN.point=IN,yN=bN=e,vN=TN=t}function IN(e,t){bN-=e,TN-=t,xN.add(ER(bN*bN+TN*TN)),bN=e,TN=t}const AN=EN;function SN(){this._string=[]}function CN(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function ON(e,t){var n,i,r=4.5;function s(e){return e&&("function"==typeof r&&i.pointRadius(+r.apply(this,arguments)),nR(e,n(i))),i.result()}return s.area=function(e){return nR(e,n($R)),$R.result()},s.measure=function(e){return nR(e,n(AN)),AN.result()},s.bounds=function(e){return nR(e,n(GR)),GR.result()},s.centroid=function(e){return nR(e,n(mN)),mN.result()},s.projection=function(t){return arguments.length?(n=null==t?(e=null,Kk):(e=t).stream,s):e},s.context=function(e){return arguments.length?(i=null==e?(t=null,new SN):new gN(t=e),"function"!=typeof r&&i.pointRadius(r),s):t},s.pointRadius=function(e){return arguments.length?(r="function"==typeof e?e:(i.pointRadius(+e),+e),s):r},s.projection(e).context(t)}function MN(){var e,t=[];return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:SR,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function kN(e,t){return hR(e[0]-t[0])<rR&&hR(e[1]-t[1])<rR}function RN(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function NN(e,t,n,i,r){var s,o,a=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n,i=e[0],o=e[t];if(kN(i,o)){if(!i[2]&&!o[2]){for(r.lineStart(),s=0;s<t;++s)r.point((i=e[s])[0],i[1]);return void r.lineEnd()}o[0]+=2*rR}a.push(n=new RN(i,e,null,!0)),l.push(n.o=new RN(i,null,n,!1)),a.push(n=new RN(o,e,null,!1)),l.push(n.o=new RN(o,null,n,!0))}}),a.length){for(l.sort(t),DN(a),DN(l),s=0,o=l.length;s<o;++s)l[s].e=n=!n;for(var u,c,d=a[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;u=h.z,r.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(s=0,o=u.length;s<o;++s)r.point((c=u[s])[0],c[1]);else i(h.x,h.n.x,1,r);h=h.n}else{if(p)for(u=h.p.z,s=u.length-1;s>=0;--s)r.point((c=u[s])[0],c[1]);else i(h.x,h.p.x,-1,r);h=h.p}u=(h=h.o).z,p=!p}while(!h.v);r.lineEnd()}}}function DN(e){if(t=e.length){for(var t,n,i=0,r=e[0];++i<t;)r.n=n=e[i],n.p=r,r=n;r.n=n=e[0],n.p=r}}function FN(e){return[fR(e[1],e[0]),AR(e[2])]}function LN(e){var t=e[0],n=e[1],i=mR(n);return[i*mR(t),i*TR(t),TR(n)]}function PN(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function BN(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function $N(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function UN(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function VN(e){var t=ER(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function zN(e){return hR(e[0])<=oR?e[0]:xR(e[0])*((hR(e[0])+oR)%uR-oR)}function jN(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function YN(e,t,n,i){return function(r){var s,o,a,l=t(r),u=MN(),c=t(u),d=!1,h={point:p,lineStart:m,lineEnd:g,polygonStart:function(){h.point=_,h.lineStart=y,h.lineEnd=v,o=[],s=[]},polygonEnd:function(){h.point=p,h.lineStart=m,h.lineEnd=g,o=jN(o);var e=function(e,t){var n=zN(t),i=t[1],r=TR(i),s=[TR(n),-mR(n),0],o=0,a=0,l=new iR;1===r?i=aR+rR:-1===r&&(i=-aR-rR);for(var u=0,c=e.length;u<c;++u)if(h=(d=e[u]).length)for(var d,h,p=d[h-1],f=zN(p),m=p[1]/2+lR,g=TR(m),_=mR(m),y=0;y<h;++y,f=b,g=x,_=E,p=v){var v=d[y],b=zN(v),T=v[1]/2+lR,x=TR(T),E=mR(T),w=b-f,I=w>=0?1:-1,A=I*w,S=A>oR,C=g*x;if(l.add(fR(C*I*TR(A),_*E+C*mR(A))),o+=S?w+I*uR:w,S^f>=n^b>=n){var O=BN(LN(p),LN(v));VN(O);var M=BN(s,O);VN(M);var k=(S^w>=0?-1:1)*AR(M[2]);(i>k||i===k&&(O[0]||O[1]))&&(a+=S^w>=0?1:-1)}}return(o<-rR||o<rR&&l<-1e-12)^1&a}(s,i);o.length?(d||(r.polygonStart(),d=!0),NN(o,HN,e,n,r)):e&&(d||(r.polygonStart(),d=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),d&&(r.polygonEnd(),d=!1),o=s=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function p(t,n){e(t,n)&&r.point(t,n)}function f(e,t){l.point(e,t)}function m(){h.point=f,l.lineStart()}function g(){h.point=p,l.lineEnd()}function _(e,t){a.push([e,t]),c.point(e,t)}function y(){c.lineStart(),a=[]}function v(){_(a[0][0],a[0][1]),c.lineEnd();var e,t,n,i,l=c.clean(),h=u.result(),p=h.length;if(a.pop(),s.push(a),a=null,p)if(1&l){if((t=(n=h[0]).length-1)>0){for(d||(r.polygonStart(),d=!0),r.lineStart(),e=0;e<t;++e)r.point((i=n[e])[0],i[1]);r.lineEnd()}}else p>1&&2&l&&h.push(h.pop().concat(h.shift())),o.push(h.filter(GN))}return h}}function GN(e){return e.length>1}function HN(e,t){return((e=e.x)[0]<0?e[1]-aR-rR:aR-e[1])-((t=t.x)[0]<0?t[1]-aR-rR:aR-t[1])}SN.prototype={_radius:4.5,_circle:CN(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=CN(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}};const WN=YN(function(){return!0},function(e){var t,n=NaN,i=NaN,r=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(s,o){var a=s>0?oR:-oR,l=hR(s-n);hR(l-oR)<rR?(e.point(n,i=(i+o)/2>0?aR:-aR),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(a,i),e.point(s,i),t=0):r!==a&&l>=oR&&(hR(n-r)<rR&&(n-=r*rR),hR(s-a)<rR&&(s-=a*rR),i=function(e,t,n,i){var r,s,o=TR(e-n);return hR(o)>rR?pR((TR(t)*(s=mR(i))*TR(n)-TR(i)*(r=mR(t))*TR(e))/(r*s*o)):(t+i)/2}(n,i,s,o),e.point(r,i),e.lineEnd(),e.lineStart(),e.point(a,i),t=0),e.point(n=s,i=o),r=a},lineEnd:function(){e.lineEnd(),n=i=NaN},clean:function(){return 2-t}}},function(e,t,n,i){var r;if(null==e)r=n*aR,i.point(-oR,r),i.point(0,r),i.point(oR,r),i.point(oR,0),i.point(oR,-r),i.point(0,-r),i.point(-oR,-r),i.point(-oR,0),i.point(-oR,r);else if(hR(e[0]-t[0])>rR){var s=e[0]<t[0]?oR:-oR;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])},[-oR,-aR]);function XN(e,t,n,i,r,s){if(n){var o=mR(t),a=TR(t),l=i*n;null==r?(r=t+i*uR,s=t-l/2):(r=qN(o,r),s=qN(o,s),(i>0?r<s:r>s)&&(r+=i*uR));for(var u,c=r;i>0?c>s:c<s;c-=l)u=FN([o,-a*mR(c),-a*TR(c)]),e.point(u[0],u[1])}}function qN(e,t){(t=LN(t))[0]-=e,VN(t);var n=IR(-t[1]);return((-t[2]<0?-n:n)+uR-rR)%uR}var KN=1e9,ZN=-KN;function QN(e,t,n,i){function r(r,s){return e<=r&&r<=n&&t<=s&&s<=i}function s(r,s,a,u){var c=0,d=0;if(null==r||(c=o(r,a))!==(d=o(s,a))||l(r,s)<0^a>0)do{u.point(0===c||3===c?e:n,c>1?i:t)}while((c=(c+a+4)%4)!==d);else u.point(s[0],s[1])}function o(i,r){return hR(i[0]-e)<rR?r>0?0:3:hR(i[0]-n)<rR?r>0?2:1:hR(i[1]-t)<rR?r>0?1:0:r>0?3:2}function a(e,t){return l(e.x,t.x)}function l(e,t){var n=o(e,1),i=o(t,1);return n!==i?n-i:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(o){var l,u,c,d,h,p,f,m,g,_,y,v=o,b=MN(),T={point:x,lineStart:function(){T.point=E,u&&u.push(c=[]);_=!0,g=!1,f=m=NaN},lineEnd:function(){l&&(E(d,h),p&&g&&b.rejoin(),l.push(b.result()));T.point=x,g&&v.lineEnd()},polygonStart:function(){v=b,l=[],u=[],y=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,r=u.length;n<r;++n)for(var s,o,a=u[n],l=1,c=a.length,d=a[0],h=d[0],p=d[1];l<c;++l)s=h,o=p,h=(d=a[l])[0],p=d[1],o<=i?p>i&&(h-s)*(i-o)>(p-o)*(e-s)&&++t:p<=i&&(h-s)*(i-o)<(p-o)*(e-s)&&--t;return t}(),n=y&&t,r=(l=jN(l)).length;(n||r)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),r&&NN(l,a,t,s,o),o.polygonEnd());v=o,l=u=c=null}};function x(e,t){r(e,t)&&v.point(e,t)}function E(s,o){var a=r(s,o);if(u&&c.push([s,o]),_)d=s,h=o,p=a,_=!1,a&&(v.lineStart(),v.point(s,o));else if(a&&g)v.point(s,o);else{var l=[f=Math.max(ZN,Math.min(KN,f)),m=Math.max(ZN,Math.min(KN,m))],b=[s=Math.max(ZN,Math.min(KN,s)),o=Math.max(ZN,Math.min(KN,o))];!function(e,t,n,i,r,s){var o,a=e[0],l=e[1],u=0,c=1,d=t[0]-a,h=t[1]-l;if(o=n-a,d||!(o>0)){if(o/=d,d<0){if(o<u)return;o<c&&(c=o)}else if(d>0){if(o>c)return;o>u&&(u=o)}if(o=r-a,d||!(o<0)){if(o/=d,d<0){if(o>c)return;o>u&&(u=o)}else if(d>0){if(o<u)return;o<c&&(c=o)}if(o=i-l,h||!(o>0)){if(o/=h,h<0){if(o<u)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>u&&(u=o)}if(o=s-l,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>u&&(u=o)}else if(h>0){if(o<u)return;o<c&&(c=o)}return u>0&&(e[0]=a+u*d,e[1]=l+u*h),c<1&&(t[0]=a+c*d,t[1]=l+c*h),!0}}}}}(l,b,e,t,n,i)?a&&(v.lineStart(),v.point(s,o),y=!1):(g||(v.lineStart(),v.point(l[0],l[1])),v.point(b[0],b[1]),a||v.lineEnd(),y=!1)}f=s,m=o,g=a}return T}}function JN(e,t){function n(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,i){return(n=t.invert(n,i))&&e.invert(n[0],n[1])}),n}function eD(e,t){return[hR(e)>oR?e+Math.round(-e/uR)*uR:e,t]}function tD(e,t,n){return(e%=uR)?t||n?JN(iD(e),rD(t,n)):iD(e):t||n?rD(t,n):eD}function nD(e){return function(t,n){return[(t+=e)>oR?t-uR:t<-oR?t+uR:t,n]}}function iD(e){var t=nD(e);return t.invert=nD(-e),t}function rD(e,t){var n=mR(e),i=TR(e),r=mR(t),s=TR(t);function o(e,t){var o=mR(t),a=mR(e)*o,l=TR(e)*o,u=TR(t),c=u*n+a*i;return[fR(l*r-c*s,a*n-u*i),AR(c*r+l*s)]}return o.invert=function(e,t){var o=mR(t),a=mR(e)*o,l=TR(e)*o,u=TR(t),c=u*r-l*s;return[fR(l*r+u*s,a*n+c*i),AR(c*n-a*i)]},o}function sD(e){return function(t){var n=new oD;for(var i in e)n[i]=e[i];return n.stream=t,n}}function oD(){}function aD(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=i&&e.clipExtent(null),nR(n,e.stream(GR)),t(GR.result()),null!=i&&e.clipExtent(i),e}function lD(e,t,n){return aD(e,function(n){var i=t[1][0]-t[0][0],r=t[1][1]-t[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),o=+t[0][0]+(i-s*(n[1][0]+n[0][0]))/2,a=+t[0][1]+(r-s*(n[1][1]+n[0][1]))/2;e.scale(150*s).translate([o,a])},n)}function uD(e,t,n){return lD(e,[[0,0],t],n)}function cD(e,t,n){return aD(e,function(n){var i=+t,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,o=-r*n[0][1];e.scale(150*r).translate([s,o])},n)}function dD(e,t,n){return aD(e,function(n){var i=+t,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],o=(i-r*(n[1][1]+n[0][1]))/2;e.scale(150*r).translate([s,o])},n)}eD.invert=eD,oD.prototype={constructor:oD,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var hD=mR(30*dR);function pD(e,t){return+t?function(e,t){function n(i,r,s,o,a,l,u,c,d,h,p,f,m,g){var _=u-i,y=c-r,v=_*_+y*y;if(v>4*t&&m--){var b=o+h,T=a+p,x=l+f,E=ER(b*b+T*T+x*x),w=AR(x/=E),I=hR(hR(x)-1)<rR||hR(s-d)<rR?(s+d)/2:fR(T,b),A=e(I,w),S=A[0],C=A[1],O=S-i,M=C-r,k=y*O-_*M;(k*k/v>t||hR((_*O+y*M)/v-.5)>.3||o*h+a*p+l*f<hD)&&(n(i,r,s,o,a,l,S,C,I,b/=E,T/=E,x,m,g),g.point(S,C),n(S,C,I,b,T,x,u,c,d,h,p,f,m,g))}}return function(t){var i,r,s,o,a,l,u,c,d,h,p,f,m={point:g,lineStart:_,lineEnd:v,polygonStart:function(){t.polygonStart(),m.lineStart=b},polygonEnd:function(){t.polygonEnd(),m.lineStart=_}};function g(n,i){n=e(n,i),t.point(n[0],n[1])}function _(){c=NaN,m.point=y,t.lineStart()}function y(i,r){var s=LN([i,r]),o=e(i,r);n(c,d,u,h,p,f,c=o[0],d=o[1],u=i,h=s[0],p=s[1],f=s[2],16,t),t.point(c,d)}function v(){m.point=g,t.lineEnd()}function b(){_(),m.point=T,m.lineEnd=x}function T(e,t){y(i=e,t),r=c,s=d,o=h,a=p,l=f,m.point=y}function x(){n(c,d,u,h,p,f,r,s,i,o,a,l,16,t),m.lineEnd=v,v()}return m}}(e,t):function(e){return sD({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var fD=sD({point:function(e,t){this.stream.point(e*dR,t*dR)}});function mD(e,t,n,i,r,s){if(!s)return function(e,t,n,i,r){function s(s,o){return[t+e*(s*=i),n-e*(o*=r)]}return s.invert=function(s,o){return[(s-t)/e*i,(n-o)/e*r]},s}(e,t,n,i,r);var o=mR(s),a=TR(s),l=o*e,u=a*e,c=o/e,d=a/e,h=(a*n-o*t)/e,p=(a*t+o*n)/e;function f(e,s){return[l*(e*=i)-u*(s*=r)+t,n-u*e-l*s]}return f.invert=function(e,t){return[i*(c*e-d*t+h),r*(p-d*e-c*t)]},f}function gD(e){return _D(function(){return e})()}function _D(e){var t,n,i,r,s,o,a,l,u,c,d=150,h=480,p=250,f=0,m=0,g=0,_=0,y=0,v=0,b=1,T=1,x=null,E=WN,w=null,I=Kk,A=.5;function S(e){return l(e[0]*dR,e[1]*dR)}function C(e){return(e=l.invert(e[0],e[1]))&&[e[0]*cR,e[1]*cR]}function O(){var e=mD(d,0,0,b,T,v).apply(null,t(f,m)),i=mD(d,h-e[0],p-e[1],b,T,v);return n=tD(g,_,y),a=JN(t,i),l=JN(n,a),o=pD(a,A),M()}function M(){return u=c=null,S}return S.stream=function(e){return u&&c===e?u:u=fD(function(e){return sD({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}(n)(E(o(I(c=e)))))},S.preclip=function(e){return arguments.length?(E=e,x=void 0,M()):E},S.postclip=function(e){return arguments.length?(I=e,w=i=r=s=null,M()):I},S.clipAngle=function(e){return arguments.length?(E=+e?function(e){var t=mR(e),n=6*dR,i=t>0,r=hR(t)>rR;function s(e,n){return mR(e)*mR(n)>t}function o(e,n,i){var r=[1,0,0],s=BN(LN(e),LN(n)),o=PN(s,s),a=s[0],l=o-a*a;if(!l)return!i&&e;var u=t*o/l,c=-t*a/l,d=BN(r,s),h=UN(r,u);$N(h,UN(s,c));var p=d,f=PN(h,p),m=PN(p,p),g=f*f-m*(PN(h,h)-1);if(!(g<0)){var _=ER(g),y=UN(p,(-f-_)/m);if($N(y,h),y=FN(y),!i)return y;var v,b=e[0],T=n[0],x=e[1],E=n[1];T<b&&(v=b,b=T,T=v);var w=T-b,I=hR(w-oR)<rR;if(!I&&E<x&&(v=x,x=E,E=v),I||w<rR?I?x+E>0^y[1]<(hR(y[0]-b)<rR?x:E):x<=y[1]&&y[1]<=E:w>oR^(b<=y[0]&&y[0]<=T)){var A=UN(p,(-f+_)/m);return $N(A,h),[y,FN(A)]}}}function a(t,n){var r=i?e:oR-e,s=0;return t<-r?s|=1:t>r&&(s|=2),n<-r?s|=4:n>r&&(s|=8),s}return YN(s,function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(d,h){var p,f=[d,h],m=s(d,h),g=i?m?0:a(d,h):m?a(d+(d<0?oR:-oR),h):0;if(!t&&(u=l=m)&&e.lineStart(),m!==l&&(!(p=o(t,f))||kN(t,p)||kN(f,p))&&(f[2]=1),m!==l)c=0,m?(e.lineStart(),p=o(f,t),e.point(p[0],p[1])):(p=o(t,f),e.point(p[0],p[1],2),e.lineEnd()),t=p;else if(r&&t&&i^m){var _;g&n||!(_=o(f,t,!0))||(c=0,i?(e.lineStart(),e.point(_[0][0],_[0][1]),e.point(_[1][0],_[1][1]),e.lineEnd()):(e.point(_[1][0],_[1][1]),e.lineEnd(),e.lineStart(),e.point(_[0][0],_[0][1],3)))}!m||t&&kN(t,f)||e.point(f[0],f[1]),t=f,l=m,n=g},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}},function(t,i,r,s){XN(s,e,n,r,t,i)},i?[0,-e]:[-oR,e-oR])}(x=e*dR):(x=null,WN),M()):x*cR},S.clipExtent=function(e){return arguments.length?(I=null==e?(w=i=r=s=null,Kk):QN(w=+e[0][0],i=+e[0][1],r=+e[1][0],s=+e[1][1]),M()):null==w?null:[[w,i],[r,s]]},S.scale=function(e){return arguments.length?(d=+e,O()):d},S.translate=function(e){return arguments.length?(h=+e[0],p=+e[1],O()):[h,p]},S.center=function(e){return arguments.length?(f=e[0]%360*dR,m=e[1]%360*dR,O()):[f*cR,m*cR]},S.rotate=function(e){return arguments.length?(g=e[0]%360*dR,_=e[1]%360*dR,y=e.length>2?e[2]%360*dR:0,O()):[g*cR,_*cR,y*cR]},S.angle=function(e){return arguments.length?(v=e%360*dR,O()):v*cR},S.reflectX=function(e){return arguments.length?(b=e?-1:1,O()):b<0},S.reflectY=function(e){return arguments.length?(T=e?-1:1,O()):T<0},S.precision=function(e){return arguments.length?(o=pD(a,A=e*e),M()):ER(A)},S.fitExtent=function(e,t){return lD(S,e,t)},S.fitSize=function(e,t){return uD(S,e,t)},S.fitWidth=function(e,t){return cD(S,e,t)},S.fitHeight=function(e,t){return dD(S,e,t)},function(){return t=e.apply(this,arguments),S.invert=t.invert&&C,O()}}function yD(e){var t=0,n=oR/3,i=_D(e),r=i(t,n);return r.parallels=function(e){return arguments.length?i(t=e[0]*dR,n=e[1]*dR):[t*cR,n*cR]},r}function vD(e,t){var n=TR(e),i=(n+TR(t))/2;if(hR(i)<rR)return function(e){var t=mR(e);function n(e,n){return[e*t,TR(n)/t]}return n.invert=function(e,n){return[e/t,AR(n*t)]},n}(e);var r=1+n*(2*i-n),s=ER(r)/i;function o(e,t){var n=ER(r-2*i*TR(t))/i;return[n*TR(e*=i),s-n*mR(e)]}return o.invert=function(e,t){var n=s-t,o=fR(e,hR(n))*xR(n);return n*i<0&&(o-=oR*xR(e)*xR(n)),[o/i,AR((r-(e*e+n*n)*i*i)/(2*i))]},o}function bD(){return yD(vD).scale(155.424).center([0,33.6442])}function TD(){return bD().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function xD(e){return function(t,n){var i=mR(t),r=mR(n),s=e(i*r);return s===1/0?[2,0]:[s*r*TR(t),s*TR(n)]}}function ED(e){return function(t,n){var i=ER(t*t+n*n),r=e(i),s=TR(r),o=mR(r);return[fR(t*s,i*o),AR(i&&n*s/i)]}}var wD=xD(function(e){return ER(2/(1+e))});wD.invert=ED(function(e){return 2*AR(e/2)});var ID=xD(function(e){return(e=IR(e))&&e/TR(e)});function AD(e,t){return[e,vR(wR((aR+t)/2))]}function SD(e){var t,n,i,r=gD(e),s=r.center,o=r.scale,a=r.translate,l=r.clipExtent,u=null;function c(){var s=oR*o(),a=r(function(e){function t(t){return(t=e(t[0]*dR,t[1]*dR))[0]*=cR,t[1]*=cR,t}return e=tD(e[0]*dR,e[1]*dR,e.length>2?e[2]*dR:0),t.invert=function(t){return(t=e.invert(t[0]*dR,t[1]*dR))[0]*=cR,t[1]*=cR,t},t}(r.rotate()).invert([0,0]));return l(null==u?[[a[0]-s,a[1]-s],[a[0]+s,a[1]+s]]:e===AD?[[Math.max(a[0]-s,u),t],[Math.min(a[0]+s,n),i]]:[[u,Math.max(a[1]-s,t)],[n,Math.min(a[1]+s,i)]])}return r.scale=function(e){return arguments.length?(o(e),c()):o()},r.translate=function(e){return arguments.length?(a(e),c()):a()},r.center=function(e){return arguments.length?(s(e),c()):s()},r.clipExtent=function(e){return arguments.length?(null==e?u=t=n=i=null:(u=+e[0][0],t=+e[0][1],n=+e[1][0],i=+e[1][1]),c()):null==u?null:[[u,t],[n,i]]},c()}function CD(e){return wR((aR+e)/2)}function OD(e,t){var n=mR(e),i=e===t?TR(e):vR(n/mR(t))/vR(CD(t)/CD(e)),r=n*bR(CD(e),i)/i;if(!i)return AD;function s(e,t){r>0?t<-aR+rR&&(t=-aR+rR):t>aR-rR&&(t=aR-rR);var n=r/bR(CD(t),i);return[n*TR(i*e),r-n*mR(i*e)]}return s.invert=function(e,t){var n=r-t,s=xR(i)*ER(e*e+n*n),o=fR(e,hR(n))*xR(n);return n*i<0&&(o-=oR*xR(e)*xR(n)),[o/i,2*pR(bR(r/s,1/i))-aR]},s}function MD(e,t){return[e,t]}function kD(e,t){var n=mR(e),i=e===t?TR(e):(n-mR(t))/(t-e),r=n/i+e;if(hR(i)<rR)return MD;function s(e,t){var n=r-t,s=i*e;return[n*TR(s),r-n*mR(s)]}return s.invert=function(e,t){var n=r-t,s=fR(e,hR(n))*xR(n);return n*i<0&&(s-=oR*xR(e)*xR(n)),[s/i,r-xR(i)*ER(e*e+n*n)]},s}ID.invert=ED(function(e){return e}),AD.invert=function(e,t){return[e,2*pR(_R(t))-aR]},MD.invert=MD;var RD=1.340264,ND=-.081106,DD=893e-6,FD=.003796,LD=ER(3)/2;function PD(e,t){var n=AR(LD*TR(t)),i=n*n,r=i*i*i;return[e*mR(n)/(LD*(RD+3*ND*i+r*(7*DD+9*FD*i))),n*(RD+ND*i+r*(DD+FD*i))]}function BD(e,t){var n=mR(t),i=mR(e)*n;return[n*TR(e)/i,TR(t)/i]}function $D(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791)),t*(1.007226+n*(.015085+i*(.028874*n-.044475-.005916*i)))]}function UD(e,t){return[mR(t)*TR(e),TR(t)]}function VD(e,t){var n=mR(t),i=1+mR(e)*n;return[n*TR(e)/i,TR(t)/i]}function zD(e,t){return[vR(wR((aR+t)/2)),-e]}PD.invert=function(e,t){for(var n,i=t,r=i*i,s=r*r*r,o=0;o<12&&(s=(r=(i-=n=(i*(RD+ND*r+s*(DD+FD*r))-t)/(RD+3*ND*r+s*(7*DD+9*FD*r)))*i)*r*r,!(hR(n)<sR));++o);return[LD*e*(RD+3*ND*r+s*(7*DD+9*FD*r))/mR(i),AR(TR(i)/LD)]},BD.invert=ED(pR),$D.invert=function(e,t){var n,i=t,r=25;do{var s=i*i,o=s*s;i-=n=(i*(1.007226+s*(.015085+o*(.028874*s-.044475-.005916*o)))-t)/(1.007226+s*(.045255+o*(.259866*s-.311325-.005916*11*o)))}while(hR(n)>rR&&--r>0);return[e/(.8707+(s=i*i)*(s*(s*s*s*(.003971-.001529*s)-.013791)-.131979)),i]},UD.invert=ED(AR),VD.invert=ED(function(e){return 2*pR(e)}),zD.invert=function(e,t){return[-t,2*pR(_R(e))-aR]};var jD=Math.abs,YD=(Math.atan,Math.atan2,Math.ceil,Math.cos),GD=(Math.exp,Math.floor,Math.log,Math.max,Math.min,Math.pow,Math.round,Math.sign,Math.sin),HD=(Math.tan,Math.PI),WD=HD/2,XD=(Math.SQRT1_2,KD(2));KD(HD);function qD(e){return e>1?WD:e<-1?-WD:Math.asin(e)}function KD(e){return e>0?Math.sqrt(e):0}function ZD(e,t){var n,i=e*GD(t),r=30;do{t-=n=(t+GD(t)-i)/(1+YD(t))}while(jD(n)>1e-6&&--r>0);return t/2}var QD=function(e,t,n){function i(i,r){return[e*i*YD(r=ZD(n,r)),t*GD(r)]}return i.invert=function(i,r){return r=qD(r/t),[i/(e*YD(r)),qD((2*r+GD(2*r))/n)]},i}(XD/WD,XD,HD);const JD=ON(),eF=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function tF(e,t){if(!e||"string"!=typeof e)throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(iF[e]=function(e,t){return function n(){const i=t();return i.type=e,i.path=ON().projection(i),i.copy=i.copy||function(){const e=n();return eF.forEach(t=>{i[t]&&e[t](i[t]())}),e.path.pointRadius(i.path.pointRadius()),e},i}}(e,t),this):iF[e]||null}function nF(e){return e&&e.path||JD}const iF={albers:TD,albersusa:function(){var e,t,n,i,r,s,o=TD(),a=bD().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=bD().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){s=[e,t]}};function c(e){var t=e[0],o=e[1];return s=null,n.point(t,o),s||(i.point(t,o),s)||(r.point(t,o),s)}function d(){return e=t=null,c}return c.invert=function(e){var t=o.scale(),n=o.translate(),i=(e[0]-n[0])/t,r=(e[1]-n[1])/t;return(r>=.12&&r<.234&&i>=-.425&&i<-.214?a:r>=.166&&r<.234&&i>=-.214&&i<-.115?l:o).invert(e)},c.stream=function(n){return e&&t===n?e:(i=[o.stream(t=n),a.stream(n),l.stream(n)],r=i.length,e={point:function(e,t){for(var n=-1;++n<r;)i[n].point(e,t)},sphere:function(){for(var e=-1;++e<r;)i[e].sphere()},lineStart:function(){for(var e=-1;++e<r;)i[e].lineStart()},lineEnd:function(){for(var e=-1;++e<r;)i[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<r;)i[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<r;)i[e].polygonEnd()}});var i,r},c.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),l.precision(e),d()):o.precision()},c.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),l.scale(e),c.translate(o.translate())):o.scale()},c.translate=function(e){if(!arguments.length)return o.translate();var t=o.scale(),s=+e[0],c=+e[1];return n=o.translate(e).clipExtent([[s-.455*t,c-.238*t],[s+.455*t,c+.238*t]]).stream(u),i=a.translate([s-.307*t,c+.201*t]).clipExtent([[s-.425*t+rR,c+.12*t+rR],[s-.214*t-rR,c+.234*t-rR]]).stream(u),r=l.translate([s-.205*t,c+.212*t]).clipExtent([[s-.214*t+rR,c+.166*t+rR],[s-.115*t-rR,c+.234*t-rR]]).stream(u),d()},c.fitExtent=function(e,t){return lD(c,e,t)},c.fitSize=function(e,t){return uD(c,e,t)},c.fitWidth=function(e,t){return cD(c,e,t)},c.fitHeight=function(e,t){return dD(c,e,t)},c.scale(1070)},azimuthalequalarea:function(){return gD(wD).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return gD(ID).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return yD(OD).scale(109.5).parallels([30,30])},conicequalarea:bD,conicequidistant:function(){return yD(kD).scale(131.154).center([0,13.9389])},equalEarth:function(){return gD(PD).scale(177.158)},equirectangular:function(){return gD(MD).scale(152.63)},gnomonic:function(){return gD(BD).scale(144.049).clipAngle(60)},identity:function(){var e,t,n,i,r,s,o,a=1,l=0,u=0,c=1,d=1,h=0,p=null,f=1,m=1,g=sD({point:function(e,t){var n=v([e,t]);this.stream.point(n[0],n[1])}}),_=Kk;function y(){return f=a*c,m=a*d,s=o=null,v}function v(n){var i=n[0]*f,r=n[1]*m;if(h){var s=r*e-i*t;i=i*e+r*t,r=s}return[i+l,r+u]}return v.invert=function(n){var i=n[0]-l,r=n[1]-u;if(h){var s=r*e+i*t;i=i*e-r*t,r=s}return[i/f,r/m]},v.stream=function(e){return s&&o===e?s:s=g(_(o=e))},v.postclip=function(e){return arguments.length?(_=e,p=n=i=r=null,y()):_},v.clipExtent=function(e){return arguments.length?(_=null==e?(p=n=i=r=null,Kk):QN(p=+e[0][0],n=+e[0][1],i=+e[1][0],r=+e[1][1]),y()):null==p?null:[[p,n],[i,r]]},v.scale=function(e){return arguments.length?(a=+e,y()):a},v.translate=function(e){return arguments.length?(l=+e[0],u=+e[1],y()):[l,u]},v.angle=function(n){return arguments.length?(t=TR(h=n%360*dR),e=mR(h),y()):h*cR},v.reflectX=function(e){return arguments.length?(c=e?-1:1,y()):c<0},v.reflectY=function(e){return arguments.length?(d=e?-1:1,y()):d<0},v.fitExtent=function(e,t){return lD(v,e,t)},v.fitSize=function(e,t){return uD(v,e,t)},v.fitWidth=function(e,t){return cD(v,e,t)},v.fitHeight=function(e,t){return dD(v,e,t)},v},mercator:function(){return SD(AD).scale(961/uR)},mollweide:function(){return gD(QD).scale(169.529)},naturalEarth1:function(){return gD($D).scale(175.295)},orthographic:function(){return gD(UD).scale(249.5).clipAngle(90+rR)},stereographic:function(){return gD(VD).scale(250).clipAngle(142)},transversemercator:function(){var e=SD(zD),t=e.center,n=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90]).scale(159.155)}};for(const e in iF)tF(e,iF[e]);function rF(e,t,n){var i=tl(e,t-rR,n).concat(t);return function(e){return i.map(function(t){return[e,t]})}}function sF(e,t,n){var i=tl(e,t-rR,n).concat(t);return function(e){return i.map(function(t){return[t,e]})}}function oF(){var e,t,n,i,r,s,o,a,l,u,c,d,h=10,p=h,f=90,m=360,g=2.5;function _(){return{type:"MultiLineString",coordinates:y()}}function y(){return tl(gR(i/f)*f,n,f).map(c).concat(tl(gR(a/m)*m,o,m).map(d)).concat(tl(gR(t/h)*h,e,h).filter(function(e){return hR(e%f)>rR}).map(l)).concat(tl(gR(s/p)*p,r,p).filter(function(e){return hR(e%m)>rR}).map(u))}return _.lines=function(){return y().map(function(e){return{type:"LineString",coordinates:e}})},_.outline=function(){return{type:"Polygon",coordinates:[c(i).concat(d(o).slice(1),c(n).reverse().slice(1),d(a).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],a=+e[0][1],o=+e[1][1],i>n&&(e=i,i=n,n=e),a>o&&(e=a,a=o,o=e),_.precision(g)):[[i,a],[n,o]]},_.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],s=+n[0][1],r=+n[1][1],t>e&&(n=t,t=e,e=n),s>r&&(n=s,s=r,r=n),_.precision(g)):[[t,s],[e,r]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(f=+e[0],m=+e[1],_):[f,m]},_.stepMinor=function(e){return arguments.length?(h=+e[0],p=+e[1],_):[h,p]},_.precision=function(h){return arguments.length?(g=+h,l=rF(s,r,90),u=sF(t,e,g),c=rF(a,o,90),d=sF(i,n,g),_):g},_.extentMajor([[-180,-90+rR],[180,90-rR]]).extentMinor([[-180,-80-rR],[180,80+rR]])}function aF(){}const lF=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function uF(){var e=1,t=1,n=o;function i(e,t){return t.map(t=>r(e,t))}function r(i,r){var o=[],a=[];return function(n,i,r){var o,a,l,u,c,d,h=new Array,p=new Array;o=a=-1,u=n[0]>=i,lF[u<<1].forEach(f);for(;++o<e-1;)l=u,u=n[o+1]>=i,lF[l|u<<1].forEach(f);lF[u|0].forEach(f);for(;++a<t-1;){for(o=-1,u=n[a*e+e]>=i,c=n[a*e]>=i,lF[u<<1|c<<2].forEach(f);++o<e-1;)l=u,u=n[a*e+e+o+1]>=i,d=c,c=n[a*e+o+1]>=i,lF[l|u<<1|c<<2|d<<3].forEach(f);lF[u|c<<3].forEach(f)}o=-1,c=n[a*e]>=i,lF[c<<2].forEach(f);for(;++o<e-1;)d=c,c=n[a*e+o+1]>=i,lF[c<<2|d<<3].forEach(f);function f(e){var t,n,i=[e[0][0]+o,e[0][1]+a],l=[e[1][0]+o,e[1][1]+a],u=s(i),c=s(l);(t=p[u])?(n=h[c])?(delete p[t.end],delete h[n.start],t===n?(t.ring.push(l),r(t.ring)):h[t.start]=p[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete p[t.end],t.ring.push(l),p[t.end=c]=t):(t=h[c])?(n=p[u])?(delete h[t.start],delete p[n.end],t===n?(t.ring.push(l),r(t.ring)):h[n.start]=p[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete h[t.start],t.ring.unshift(i),h[t.start=u]=t):h[u]=p[c]={start:u,end:c,ring:[i,l]}}lF[c<<3].forEach(f)}(i,r,e=>{n(e,i,r),function(e){var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];for(;++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}(e)>0?o.push([e]):a.push(e)}),a.forEach(e=>{for(var t,n=0,i=o.length;n<i;++n)if(-1!==cF((t=o[n])[0],e))return void t.push(e)}),{type:"MultiPolygon",value:r,coordinates:o}}function s(t){return 2*t[0]+t[1]*(e+1)*4}function o(n,i,r){n.forEach(n=>{var s,o=n[0],a=n[1],l=0|o,u=0|a,c=i[u*e+l];o>0&&o<e&&l===o&&(s=i[u*e+l-1],n[0]=o+(r-s)/(c-s)-.5),a>0&&a<t&&u===a&&(s=i[(u-1)*e+l],n[1]=a+(r-s)/(c-s)-.5)})}return i.contour=r,i.size=function(n){if(!arguments.length)return[e,t];var r=Math.floor(n[0]),s=Math.floor(n[1]);return r>=0&&s>=0||ae("invalid size"),e=r,t=s,i},i.smooth=function(e){return arguments.length?(n=e?o:aF,i):n===o},i}function cF(e,t){for(var n,i=-1,r=t.length;++i<r;)if(n=dF(e,t[i]))return n;return 0}function dF(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var l=e[s],u=l[0],c=l[1],d=e[a],h=d[0],p=d[1];if(hF(l,d,t))return 0;c>i!=p>i&&n<(h-u)*(i-c)/(p-c)+u&&(r=-r)}return r}function hF(e,t,n){var i,r,s,o;return function(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}(e,t,n)&&(r=e[i=+(e[0]===t[0])],s=n[i],o=t[i],r<=s&&s<=o||o<=s&&s<=r)}function pF(e,t,n){return function(i){var r=ot(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,l=t?ru(s,o,e):a/(e+1);return tl(s+l,o,l)}}function fF(e){Ho.call(this,null,e)}function mF(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function l(e){e.forEach(u)}function u(e){a&&e.reverse(),e.forEach(c)}function c(e){e[0]=(e[0]-s)*t+i,e[1]=(e[1]-o)*n+r}return function(e){return e.coordinates.forEach(l),e}}function gF(e,t,n){const i=e>=0?e:la(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function _F(e){return Ke(e)?e:it(+e)}function yF(){var e=e=>e[0],t=e=>e[1],n=pe,i=[-1,-1],r=960,s=500,o=2;function a(a,l){const u=gF(i[0],a,e)>>o,c=gF(i[1],a,t)>>o,d=u?u+2:0,h=c?c+2:0,p=2*d+(r>>o),f=2*h+(s>>o),m=new Float32Array(p*f),g=new Float32Array(p*f);let _=m;a.forEach(i=>{const r=d+(+e(i)>>o),s=h+(+t(i)>>o);r>=0&&r<p&&s>=0&&s<f&&(m[r+s*p]+=+n(i))}),u>0&&c>0?(vF(p,f,m,g,u),bF(p,f,g,m,c),vF(p,f,m,g,u),bF(p,f,g,m,c),vF(p,f,m,g,u),bF(p,f,g,m,c)):u>0?(vF(p,f,m,g,u),vF(p,f,g,m,u),vF(p,f,m,g,u),_=g):c>0&&(bF(p,f,m,g,c),bF(p,f,g,m,c),bF(p,f,m,g,c),_=g);const y=l?Math.pow(2,-2*o):1/vk(_);for(let e=0,t=p*f;e<t;++e)_[e]*=y;return{values:_,scale:1<<o,width:p,height:f,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(t){return arguments.length?(e=_F(t),a):e},a.y=function(e){return arguments.length?(t=_F(e),a):t},a.weight=function(e){return arguments.length?(n=_F(e),a):n},a.size=function(e){if(!arguments.length)return[r,s];var t=+e[0],n=+e[1];return t>=0&&n>=0||ae("invalid size"),r=t,s=n,a},a.cellSize=function(e){return arguments.length?((e=+e)>=1||ae("invalid cell size"),o=Math.floor(Math.log(e)/Math.LN2),a):1<<o},a.bandwidth=function(e){return arguments.length?(1===(e=Xe(e)).length&&(e=[+e[0],+e[0]]),2!==e.length&&ae("invalid bandwidth"),i=e,a):i},a}function vF(e,t,n,i,r){const s=1+(r<<1);for(let o=0;o<t;++o)for(let t=0,a=0;t<e+r;++t)t<e&&(a+=n[t+o*e]),t>=r&&(t>=s&&(a-=n[t-s+o*e]),i[t-r+o*e]=a/Math.min(t+1,e-1+s-t,s))}function bF(e,t,n,i,r){const s=1+(r<<1);for(let o=0;o<e;++o)for(let a=0,l=0;a<t+r;++a)a<t&&(l+=n[o+a*e]),a>=r&&(a>=s&&(l-=n[o+(a-s)*e]),i[o+(a-r)*e]=l/Math.min(a+1,t-1+s-a,s))}function TF(e){Ho.call(this,null,e)}fF.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},pt(fF,Ho,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||de,s=uF().smooth(!1!==e.smooth),o=e.thresholds||function(e,t,n){const i=pF(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?i:i(e.map(e=>Zo(t(e).values)))}(i,r,e),a=null===e.as?null:e.as||"contour",l=[];return i.forEach(t=>{const n=r(t),i=s.size([n.width,n.height])(n.values,Ee(o)?o:o(n.values));!function(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;Ke(r)&&(r=r(n,i));Ke(s)&&(s=s(n,i));if((1===r||null==r)&&!s)return;const o=(yt(r)?r:r[0])||1,a=(yt(r)?r:r[1])||1,l=s&&s[0]||0,u=s&&s[1]||0;e.forEach(mF(t,o,a,l,u))}(i,n,t,e),i.forEach(e=>{l.push(_o(t,mo(null!=a?{[a]:e}:e)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}}),TF.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const xF=["x","y","weight","size","cellSize","bandwidth"];function EF(e,t){return xF.forEach(n=>null!=t[n]?e[n](t[n]):0),e}function wF(e){Ho.call(this,null,e)}pt(TF,Ho,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=function(e,t){var n,i,r,s,o,a,l=[],u=e=>e(s);if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)s=e[i],(a=n[o=t.map(u)])||(n[o]=a=[],a.dims=o,l.push(a)),a.push(s);return l}(t.materialize(t.SOURCE).source,e.groupby),s=(e.groupby||[]).map(ne),o=EF(yF(),e),a=e.as||"grid";return n=r.map(t=>mo(function(e,t){for(let n=0;n<s.length;++n)e[s[n]]=t[n];return e}({[a]:o(t,e.counts)},t.dims))),this.value&&(i.rem=this.value),this.value=i.source=i.add=n,i}}),wF.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]},pt(wF,Ho,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n,i,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),s=uF().smooth(!1!==e.smooth),o=e.values,a=e.thresholds||pF(e.count||10,e.nice,!!o),l=e.size;return o||(o=t.materialize(t.SOURCE).source,i=mF(n=EF(yF(),e)(o,!0),n.scale||1,n.scale||1,0,0),l=[n.width,n.height],o=n.values),a=Ee(a)?a:a(o),o=s.size(l)(o,a),i&&o.forEach(i),this.value&&(r.rem=this.value),this.value=r.source=r.add=(o||[]).map(mo),r}});const IF="Feature",AF="FeatureCollection";function SF(e){Ho.call(this,null,e)}function CF(e){Ho.call(this,null,e)}function OF(e){Ho.call(this,null,e)}function MF(e){Ho.call(this,null,e)}function kF(e){Ho.call(this,[],e),this.generator=oF()}function RF(e){Ho.call(this,null,e)}function NF(e){if(!Ke(e))return!1;const t=Dt(ie(e));return t.$x||t.$y||t.$value||t.$max}function DF(e){Ho.call(this,null,e),this.modified(!0)}function FF(e,t,n){Ke(e[t])&&e[t](n)}function LF(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s,o,a,l,u,c,d,h,p=e._root,f={data:i},m=e._x0,g=e._y0,_=e._x1,y=e._y1;if(!p)return e._root=f,e;for(;p.length;)if((u=t>=(s=(m+_)/2))?m=s:_=s,(c=n>=(o=(g+y)/2))?g=o:y=o,r=p,!(p=p[d=c<<1|u]))return r[d]=f,e;if(a=+e._x.call(null,p.data),l=+e._y.call(null,p.data),t===a&&n===l)return f.next=p,r?r[d]=f:e._root=f,e;do{r=r?r[d]=new Array(4):e._root=new Array(4),(u=t>=(s=(m+_)/2))?m=s:_=s,(c=n>=(o=(g+y)/2))?g=o:y=o}while((d=c<<1|u)==(h=(l>=o)<<1|a>=s));return r[h]=p,r[d]=f,e}function PF(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function BF(e){return e[0]}function $F(e){return e[1]}function UF(e,t,n){var i=new VF(null==t?BF:t,null==n?$F:n,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function VF(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function zF(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}SF.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},pt(SF,Ho,{transform(e,t){var n,i=this._features,r=this._points,s=e.fields,o=s&&s[0],a=s&&s[1],l=e.geojson||!s&&de,u=t.ADD;n=e.modified()||t.changed(t.REM)||t.modified(ie(l))||o&&t.modified(ie(o))||a&&t.modified(ie(a)),this.value&&!n||(u=t.SOURCE,this._features=i=[],this._points=r=[]),l&&t.visit(u,e=>i.push(l(e))),o&&a&&(t.visit(u,e=>{var t=o(e),n=a(e);null!=t&&null!=n&&(t=+t)===t&&(n=+n)===n&&r.push([t,n])}),i=i.concat({type:IF,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:AF,features:i}}}),CF.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},pt(CF,Ho,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||de,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=nF(e.projection),n.materialize().reflow()):o=r===de||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=function(e,t){const n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(i,e.pointRadius);return n.visit(o,e=>e[s]=i(r(e))),i.pointRadius(a),n.modifies(s)}}),OF.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},pt(OF,Ho,{transform(e,t){var n,i=e.projection,r=e.fields[0],s=e.fields[1],o=e.as||["x","y"],a=o[0],l=o[1];function u(e){const t=i([r(e),s(e)]);t?(e[a]=t[0],e[l]=t[1]):(e[a]=void 0,e[l]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(n=t.modified(r.fields)||t.modified(s.fields),t.visit(n?t.ADD_MOD:t.ADD,u)),t.modifies(o)}}),MF.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},pt(MF,Ho,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return i&&!e.modified()||(this.value=i=function(e,t,n){const i=null==n?n=>e(t(n)):i=>{var r=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(r),s};return i.context=t=>(e.context(t),i),i}(nF(e.projection),e.field||ue("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,e=>e[r]=i),n.modifies(r)}}),kF.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},pt(kF,Ho,{transform(e,t){var n,i=this.value,r=this.generator;if(!i.length||e.modified())for(const t in e)Ke(r[t])&&r[t](e[t]);return n=r(),i.length?t.mod.push(yo(i[0],n)):t.add.push(mo(n)),i[0]=n,t}}),RF.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},pt(RF,Ho,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i="shared"===e.resolve,r=e.field||de,s=function(e,t){let n;Ke(e)?(n=n=>e(n,t),n.dep=NF(e)):e?n=it(e):(n=e=>e.$value/e.$max||0,n.dep=!0);return n}(e.opacity,e),o=function(e,t){let n;Ke(e)?(n=n=>k_(e(n,t)),n.dep=NF(e)):n=it(k_(e||"#888"));return n}(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?Zo(n.map(e=>Zo(r(e).values))):0};return n.forEach(e=>{const t=r(e),n=st({},e,l);i||(n.$max=Zo(t.values||[])),e[a]=function(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,l=e.x2||r,u=e.y2||s,c=e.values,d=c?e=>c[e]:he,h=Tp(l-o,u-a),p=h.getContext("2d"),f=p.getImageData(0,0,l-o,u-a),m=f.data;for(let e=a,s=0;e<u;++e){t.$y=e-a;for(let a=o,u=e*r;a<l;++a,s+=4){t.$x=a-o,t.$value=d(a+u);const e=n(t);m[s+0]=e.r,m[s+1]=e.g,m[s+2]=e.b,m[s+3]=~~(255*i(t))}}return p.putImageData(f,0,0),h}(t,n,o.dep?o:it(o(n)),s.dep?s:it(s(n)))}),t.reflow(!0).modifies(a)}}),pt(DF,Ho,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=function(e){const t=tF((e||"mercator").toLowerCase());t||ae("Unrecognized projection type: "+e);return t()}(e.type),eF.forEach(t=>{null!=e[t]&&FF(n,t,e[t])})):eF.forEach(t=>{e.modified(t)&&FF(n,t,e[t])}),null!=e.pointRadius&&n.path.pointRadius(e.pointRadius),e.fit&&function(e,t){const n=function(e){return e=Xe(e),1===e.length?e[0]:{type:AF,features:e.reduce((e,t)=>e.concat(function(e){return e.type===AF?e.features:Xe(e).filter(e=>null!=e).map(e=>e.type===IF?e:{type:IF,geometry:e})}(t)),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});var jF=UF.prototype=VF.prototype;function YF(e){return function(){return e}}function GF(e){return 1e-6*(e()-.5)}function HF(e){return e.x+e.vx}function WF(e){return e.y+e.vy}jF.copy=function(){var e,t,n=new VF(this._x,this._y,this._x0,this._y0,this._x1,this._y1),i=this._root;if(!i)return n;if(!i.length)return n._root=zF(i),n;for(e=[{source:i,target:n._root=new Array(4)}];i=e.pop();)for(var r=0;r<4;++r)(t=i.source[r])&&(t.length?e.push({source:t,target:i.target[r]=new Array(4)}):i.target[r]=zF(t));return n},jF.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return LF(this.cover(t,n),t,n,e)},jF.addAll=function(e){var t,n,i,r,s=e.length,o=new Array(s),a=new Array(s),l=1/0,u=1/0,c=-1/0,d=-1/0;for(n=0;n<s;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(o[n]=i,a[n]=r,i<l&&(l=i),i>c&&(c=i),r<u&&(u=r),r>d&&(d=r));if(l>c||u>d)return this;for(this.cover(l,u).cover(c,d),n=0;n<s;++n)LF(this,o[n],a[n],e[n]);return this},jF.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o,a,l=r-n||1,u=this._root;n>e||e>=r||i>t||t>=s;)switch(a=(t<i)<<1|e<n,(o=new Array(4))[a]=u,u=o,l*=2,a){case 0:r=n+l,s=i+l;break;case 1:n=r-l,s=i+l;break;case 2:r=n+l,i=s-l;break;case 3:n=r-l,i=s-l}this._root&&this._root.length&&(this._root=u)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this},jF.data=function(){var e=[];return this.visit(function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)}),e},jF.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},jF.find=function(e,t,n){var i,r,s,o,a,l,u,c=this._x0,d=this._y0,h=this._x1,p=this._y1,f=[],m=this._root;for(m&&f.push(new PF(m,c,d,h,p)),null==n?n=1/0:(c=e-n,d=t-n,h=e+n,p=t+n,n*=n);l=f.pop();)if(!(!(m=l.node)||(r=l.x0)>h||(s=l.y0)>p||(o=l.x1)<c||(a=l.y1)<d))if(m.length){var g=(r+o)/2,_=(s+a)/2;f.push(new PF(m[3],g,_,o,a),new PF(m[2],r,_,g,a),new PF(m[1],g,s,o,_),new PF(m[0],r,s,g,_)),(u=(t>=_)<<1|e>=g)&&(l=f[f.length-1],f[f.length-1]=f[f.length-1-u],f[f.length-1-u]=l)}else{var y=e-+this._x.call(null,m.data),v=t-+this._y.call(null,m.data),b=y*y+v*v;if(b<n){var T=Math.sqrt(n=b);c=e-T,d=t-T,h=e+T,p=t+T,i=m.data}}return i},jF.remove=function(e){if(isNaN(s=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,n,i,r,s,o,a,l,u,c,d,h,p=this._root,f=this._x0,m=this._y0,g=this._x1,_=this._y1;if(!p)return this;if(p.length)for(;;){if((u=s>=(a=(f+g)/2))?f=a:g=a,(c=o>=(l=(m+_)/2))?m=l:_=l,t=p,!(p=p[d=c<<1|u]))return this;if(!p.length)break;(t[d+1&3]||t[d+2&3]||t[d+3&3])&&(n=t,h=d)}for(;p.data!==e;)if(i=p,!(p=p.next))return this;return(r=p.next)&&delete p.next,i?(r?i.next=r:delete i.next,this):t?(r?t[d]=r:delete t[d],(p=t[0]||t[1]||t[2]||t[3])&&p===(t[3]||t[2]||t[1]||t[0])&&!p.length&&(n?n[h]=p:this._root=p),this):(this._root=r,this)},jF.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},jF.root=function(){return this._root},jF.size=function(){var e=0;return this.visit(function(t){if(!t.length)do{++e}while(t=t.next)}),e},jF.visit=function(e){var t,n,i,r,s,o,a=[],l=this._root;for(l&&a.push(new PF(l,this._x0,this._y0,this._x1,this._y1));t=a.pop();)if(!e(l=t.node,i=t.x0,r=t.y0,s=t.x1,o=t.y1)&&l.length){var u=(i+s)/2,c=(r+o)/2;(n=l[3])&&a.push(new PF(n,u,c,s,o)),(n=l[2])&&a.push(new PF(n,i,c,u,o)),(n=l[1])&&a.push(new PF(n,u,r,s,c)),(n=l[0])&&a.push(new PF(n,i,r,u,c))}return this},jF.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new PF(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var r=t.node;if(r.length){var s,o=t.x0,a=t.y0,l=t.x1,u=t.y1,c=(o+l)/2,d=(a+u)/2;(s=r[0])&&n.push(new PF(s,o,a,c,d)),(s=r[1])&&n.push(new PF(s,c,a,l,d)),(s=r[2])&&n.push(new PF(s,o,d,c,u)),(s=r[3])&&n.push(new PF(s,c,d,l,u))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},jF.x=function(e){return arguments.length?(this._x=e,this):this._x},jF.y=function(e){return arguments.length?(this._y=e,this):this._y};var XF={value:()=>{}};function qF(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new KF(i)}function KF(e){this._=e}function ZF(e,t){for(var n,i=0,r=e.length;i<r;++i)if((n=e[i]).name===t)return n.value}function QF(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=XF,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}KF.prototype=qF.prototype={constructor:KF,on:function(e,t){var n,i=this._,r=function(e,t){return e.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");if(i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}(e+"",i),s=-1,o=r.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++s<o;)if(n=(e=r[s]).type)i[n]=QF(i[n],e.name,t);else if(null==t)for(n in i)i[n]=QF(i[n],e.name,null);return this}for(;++s<o;)if((n=(e=r[s]).type)&&(n=ZF(i[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new KF(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,i,r=new Array(n),s=0;s<n;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=0,n=(i=this._[e]).length;s<n;++s)i[s].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};const JF=qF;var eL,tL,nL=0,iL=0,rL=0,sL=0,oL=0,aL=0,lL="object"==typeof performance&&performance.now?performance:Date,uL="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function cL(){return oL||(uL(dL),oL=lL.now()+aL)}function dL(){oL=0}function hL(){this._call=this._time=this._next=null}function pL(e,t,n){var i=new hL;return i.restart(e,t,n),i}function fL(){oL=(sL=lL.now())+aL,nL=iL=0;try{!function(){cL(),++nL;for(var e,t=eL;t;)(e=oL-t._time)>=0&&t._call.call(null,e),t=t._next;--nL}()}finally{nL=0,function(){var e,t,n=eL,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:eL=t);tL=e,gL(i)}(),oL=0}}function mL(){var e=lL.now(),t=e-sL;t>1e3&&(aL-=t,sL=e)}function gL(e){nL||(iL&&(iL=clearTimeout(iL)),e-oL>24?(e<1/0&&(iL=setTimeout(fL,e-lL.now()-aL)),rL&&(rL=clearInterval(rL))):(rL||(sL=lL.now(),rL=setInterval(mL,1e3)),nL=1,uL(fL)))}hL.prototype=pL.prototype={constructor:hL,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?cL():+n)+(null==t?0:+t),this._next||tL===this||(tL?tL._next=this:eL=this,tL=this),this._call=e,this._time=n,gL()},stop:function(){this._call&&(this._call=null,this._time=1/0,gL())}};const _L=4294967296;function yL(e){return e.x}function vL(e){return e.y}var bL=Math.PI*(3-Math.sqrt(5));function TL(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=pL(d),u=JF("tick","end"),c=function(){let e=1;return()=>(e=(1664525*e+1013904223)%_L)/_L}();function d(){h(),u.call("tick",t),n<i&&(l.stop(),u.call("end",t))}function h(i){var l,u,c=e.length;void 0===i&&(i=1);for(var d=0;d<i;++d)for(n+=(s-n)*r,a.forEach(function(e){e(n)}),l=0;l<c;++l)null==(u=e[l]).fx?u.x+=u.vx*=o:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=o:(u.y=u.fy,u.vy=0);return t}function p(){for(var t,n=0,i=e.length;n<i;++n){if((t=e[n]).index=n,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var r=10*Math.sqrt(.5+n),s=n*bL;t.x=r*Math.cos(s),t.y=r*Math.sin(s)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function f(t){return t.initialize&&t.initialize(e,c),t}return null==e&&(e=[]),p(),t={tick:h,restart:function(){return l.restart(d),t},stop:function(){return l.stop(),t},nodes:function(n){return arguments.length?(e=n,p(),a.forEach(f),t):e},alpha:function(e){return arguments.length?(n=+e,t):n},alphaMin:function(e){return arguments.length?(i=+e,t):i},alphaDecay:function(e){return arguments.length?(r=+e,t):+r},alphaTarget:function(e){return arguments.length?(s=+e,t):s},velocityDecay:function(e){return arguments.length?(o=1-e,t):1-o},randomSource:function(e){return arguments.length?(c=e,a.forEach(f),t):c},force:function(e,n){return arguments.length>1?(null==n?a.delete(e):a.set(e,f(n)),t):a.get(e)},find:function(t,n,i){var r,s,o,a,l,u=0,c=e.length;for(null==i?i=1/0:i*=i,u=0;u<c;++u)(o=(r=t-(a=e[u]).x)*r+(s=n-a.y)*s)<i&&(l=a,i=o);return l},on:function(e,n){return arguments.length>1?(u.on(e,n),t):u.on(e)}}}function xL(e){return e.index}function EL(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}const wL={center:function(e,t){var n,i=1;function r(){var r,s,o=n.length,a=0,l=0;for(r=0;r<o;++r)a+=(s=n[r]).x,l+=s.y;for(a=(a/o-e)*i,l=(l/o-t)*i,r=0;r<o;++r)(s=n[r]).x-=a,s.y-=l}return null==e&&(e=0),null==t&&(t=0),r.initialize=function(e){n=e},r.x=function(t){return arguments.length?(e=+t,r):e},r.y=function(e){return arguments.length?(t=+e,r):t},r.strength=function(e){return arguments.length?(i=+e,r):i},r},collide:function(e){var t,n,i,r=1,s=1;function o(){for(var e,o,l,u,c,d,h,p=t.length,f=0;f<s;++f)for(o=UF(t,HF,WF).visitAfter(a),e=0;e<p;++e)l=t[e],d=n[l.index],h=d*d,u=l.x+l.vx,c=l.y+l.vy,o.visit(m);function m(e,t,n,s,o){var a=e.data,p=e.r,f=d+p;if(!a)return t>u+f||s<u-f||n>c+f||o<c-f;if(a.index>l.index){var m=u-a.x-a.vx,g=c-a.y-a.vy,_=m*m+g*g;_<f*f&&(0===m&&(_+=(m=GF(i))*m),0===g&&(_+=(g=GF(i))*g),_=(f-(_=Math.sqrt(_)))/_*r,l.vx+=(m*=_)*(f=(p*=p)/(h+p)),l.vy+=(g*=_)*f,a.vx-=m*(f=1-f),a.vy-=g*f)}}}function a(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function l(){if(t){var i,r,s=t.length;for(n=new Array(s),i=0;i<s;++i)r=t[i],n[r.index]=+e(r,i,t)}}return"function"!=typeof e&&(e=YF(null==e?1:+e)),o.initialize=function(e,n){t=e,i=n,l()},o.iterations=function(e){return arguments.length?(s=+e,o):s},o.strength=function(e){return arguments.length?(r=+e,o):r},o.radius=function(t){return arguments.length?(e="function"==typeof t?t:YF(+t),l(),o):e},o},nbody:function(){var e,t,n,i,r,s=YF(-30),o=1,a=1/0,l=.81;function u(n){var r,s=e.length,o=UF(e,yL,vL).visitAfter(d);for(i=n,r=0;r<s;++r)t=e[r],o.visit(h)}function c(){if(e){var t,n,i=e.length;for(r=new Array(i),t=0;t<i;++t)n=e[t],r[n.index]=+s(n,t,e)}}function d(e){var t,n,i,s,o,a=0,l=0;if(e.length){for(i=s=o=0;o<4;++o)(t=e[o])&&(n=Math.abs(t.value))&&(a+=t.value,l+=n,i+=n*t.x,s+=n*t.y);e.x=i/l,e.y=s/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{a+=r[t.data.index]}while(t=t.next)}e.value=a}function h(e,s,u,c){if(!e.value)return!0;var d=e.x-t.x,h=e.y-t.y,p=c-s,f=d*d+h*h;if(p*p/l<f)return f<a&&(0===d&&(f+=(d=GF(n))*d),0===h&&(f+=(h=GF(n))*h),f<o&&(f=Math.sqrt(o*f)),t.vx+=d*e.value*i/f,t.vy+=h*e.value*i/f),!0;if(!(e.length||f>=a)){(e.data!==t||e.next)&&(0===d&&(f+=(d=GF(n))*d),0===h&&(f+=(h=GF(n))*h),f<o&&(f=Math.sqrt(o*f)));do{e.data!==t&&(p=r[e.data.index]*i/f,t.vx+=d*p,t.vy+=h*p)}while(e=e.next)}}return u.initialize=function(t,i){e=t,n=i,c()},u.strength=function(e){return arguments.length?(s="function"==typeof e?e:YF(+e),c(),u):s},u.distanceMin=function(e){return arguments.length?(o=e*e,u):Math.sqrt(o)},u.distanceMax=function(e){return arguments.length?(a=e*e,u):Math.sqrt(a)},u.theta=function(e){return arguments.length?(l=e*e,u):Math.sqrt(l)},u},link:function(e){var t,n,i,r,s,o,a=xL,l=function(e){return 1/Math.min(r[e.source.index],r[e.target.index])},u=YF(30),c=1;function d(i){for(var r=0,a=e.length;r<c;++r)for(var l,u,d,h,p,f,m,g=0;g<a;++g)u=(l=e[g]).source,h=(d=l.target).x+d.vx-u.x-u.vx||GF(o),p=d.y+d.vy-u.y-u.vy||GF(o),h*=f=((f=Math.sqrt(h*h+p*p))-n[g])/f*i*t[g],p*=f,d.vx-=h*(m=s[g]),d.vy-=p*m,u.vx+=h*(m=1-m),u.vy+=p*m}function h(){if(i){var o,l,u=i.length,c=e.length,d=new Map(i.map((e,t)=>[a(e,t,i),e]));for(o=0,r=new Array(u);o<c;++o)(l=e[o]).index=o,"object"!=typeof l.source&&(l.source=EL(d,l.source)),"object"!=typeof l.target&&(l.target=EL(d,l.target)),r[l.source.index]=(r[l.source.index]||0)+1,r[l.target.index]=(r[l.target.index]||0)+1;for(o=0,s=new Array(c);o<c;++o)l=e[o],s[o]=r[l.source.index]/(r[l.source.index]+r[l.target.index]);t=new Array(c),p(),n=new Array(c),f()}}function p(){if(i)for(var n=0,r=e.length;n<r;++n)t[n]=+l(e[n],n,e)}function f(){if(i)for(var t=0,r=e.length;t<r;++t)n[t]=+u(e[t],t,e)}return null==e&&(e=[]),d.initialize=function(e,t){i=e,o=t,h()},d.links=function(t){return arguments.length?(e=t,h(),d):e},d.id=function(e){return arguments.length?(a=e,d):a},d.iterations=function(e){return arguments.length?(c=+e,d):c},d.strength=function(e){return arguments.length?(l="function"==typeof e?e:YF(+e),p(),d):l},d.distance=function(e){return arguments.length?(u="function"==typeof e?e:YF(+e),f(),d):u},d},x:function(e){var t,n,i,r=YF(.1);function s(e){for(var r,s=0,o=t.length;s<o;++s)(r=t[s]).vx+=(i[s]-r.x)*n[s]*e}function o(){if(t){var s,o=t.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+e(t[s],s,t))?0:+r(t[s],s,t)}}return"function"!=typeof e&&(e=YF(null==e?0:+e)),s.initialize=function(e){t=e,o()},s.strength=function(e){return arguments.length?(r="function"==typeof e?e:YF(+e),o(),s):r},s.x=function(t){return arguments.length?(e="function"==typeof t?t:YF(+t),o(),s):e},s},y:function(e){var t,n,i,r=YF(.1);function s(e){for(var r,s=0,o=t.length;s<o;++s)(r=t[s]).vy+=(i[s]-r.y)*n[s]*e}function o(){if(t){var s,o=t.length;for(n=new Array(o),i=new Array(o),s=0;s<o;++s)n[s]=isNaN(i[s]=+e(t[s],s,t))?0:+r(t[s],s,t)}}return"function"!=typeof e&&(e=YF(null==e?0:+e)),s.initialize=function(e){t=e,o()},s.strength=function(e){return arguments.length?(r="function"==typeof e?e:YF(+e),o(),s):r},s.y=function(t){return arguments.length?(e="function"==typeof t?t:YF(+t),o(),s):e},s}},IL="forces",AL=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],SL=["static","iterations"],CL=["x","y","vx","vy"];function OL(e){Ho.call(this,null,e)}function ML(e,t,n,i){var r,s,o,a,l=Xe(t.forces);for(r=0,s=AL.length;r<s;++r)(o=AL[r])!==IL&&t.modified(o)&&e[o](t[o]);for(r=0,s=l.length;r<s;++r)a=IL+r,(o=n||t.modified(IL,r)?RL(l[r]):i&&kL(l[r],i)?e.force(a):null)&&e.force(a,o);for(s=e.numForces||0;r<s;++r)e.force(IL+r,null);return e.numForces=l.length,e}function kL(e,t){var n,i;for(n in e)if(Ke(i=e[n])&&t.modified(ie(i)))return 1;return 0}function RL(e){var t,n;for(n in ut(wL,e.force)||ae("Unrecognized force: "+e.force),t=wL[e.force](),e)Ke(t[n])&&NL(t[n],e[n],e);return t}function NL(e,t,n){e(Ke(t)?e=>t(e,n):t)}function DL(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function FL(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=PL)):void 0===t&&(t=LL);for(var n,i,r,s,o,a=new UL(e),l=[a];n=l.pop();)if((r=t(n.data))&&(o=(r=Array.from(r)).length))for(n.children=r,s=o-1;s>=0;--s)l.push(i=r[s]=new UL(r[s])),i.parent=n,i.depth=n.depth+1;return a.eachBefore($L)}function LL(e){return e.children}function PL(e){return Array.isArray(e)?e[1]:null}function BL(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function $L(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function UL(e){this.data=e,this.depth=this.height=0,this.parent=null}function VL(e){for(var t,n,i=0,r=(e=function(e){for(var t,n,i=e.length;i;)n=Math.random()*i--|0,t=e[i],e[i]=e[n],e[n]=t;return e}(Array.from(e))).length,s=[];i<r;)t=e[i],n&&YL(n,t)?++i:(n=HL(s=zL(s,t)),i=0);return n}function zL(e,t){var n,i;if(GL(t,e))return[t];for(n=0;n<e.length;++n)if(jL(t,e[n])&&GL(WL(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(jL(WL(e[n],e[i]),t)&&jL(WL(e[n],t),e[i])&&jL(WL(e[i],t),e[n])&&GL(XL(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function jL(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function YL(e,t){var n=e.r-t.r+1e-9*Math.max(e.r,t.r,1),i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function GL(e,t){for(var n=0;n<t.length;++n)if(!YL(e,t[n]))return!1;return!0}function HL(e){switch(e.length){case 1:return function(e){return{x:e.x,y:e.y,r:e.r}}(e[0]);case 2:return WL(e[0],e[1]);case 3:return XL(e[0],e[1],e[2])}}function WL(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,l=s-n,u=o-i,c=a-r,d=Math.sqrt(l*l+u*u);return{x:(n+s+l/d*c)/2,y:(i+o+u/d*c)/2,r:(d+r+a)/2}}function XL(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,l=t.r,u=n.x,c=n.y,d=n.r,h=i-o,p=i-u,f=r-a,m=r-c,g=l-s,_=d-s,y=i*i+r*r-s*s,v=y-o*o-a*a+l*l,b=y-u*u-c*c+d*d,T=p*f-h*m,x=(f*b-m*v)/(2*T)-i,E=(m*g-f*_)/T,w=(p*v-h*b)/(2*T)-r,I=(h*_-p*g)/T,A=E*E+I*I-1,S=2*(s+x*E+w*I),C=x*x+w*w-s*s,O=-(A?(S+Math.sqrt(S*S-4*A*C))/(2*A):C/S);return{x:i+x+E*O,y:r+w+I*O,r:O}}function qL(e,t,n){var i,r,s,o,a=e.x-t.x,l=e.y-t.y,u=a*a+l*l;u?(r=t.r+n.r,r*=r,o=e.r+n.r,r>(o*=o)?(i=(u+o-r)/(2*u),s=Math.sqrt(Math.max(0,o/u-i*i)),n.x=e.x-i*a-s*l,n.y=e.y-i*l+s*a):(i=(u+r-o)/(2*u),s=Math.sqrt(Math.max(0,r/u-i*i)),n.x=t.x+i*a-s*l,n.y=t.y+i*l+s*a)):(n.x=t.x+n.r,n.y=t.y)}function KL(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function ZL(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function QL(e){this._=e,this.next=null,this.previous=null}function JL(e){if(!(r=(e=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}(e)).length))return 0;var t,n,i,r,s,o,a,l,u,c,d;if((t=e[0]).x=0,t.y=0,!(r>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(r>2))return t.r+n.r;qL(n,t,i=e[2]),t=new QL(t),n=new QL(n),i=new QL(i),t.next=i.previous=n,n.next=t.previous=i,i.next=n.previous=t;e:for(a=3;a<r;++a){qL(t._,n._,i=e[a]),i=new QL(i),l=n.next,u=t.previous,c=n._.r,d=t._.r;do{if(c<=d){if(KL(l._,i._)){n=l,t.next=n,n.previous=t,--a;continue e}c+=l._.r,l=l.next}else{if(KL(u._,i._)){(t=u).next=n,n.previous=t,--a;continue e}d+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=t,i.next=n,t.next=n.previous=n=i,s=ZL(t);(i=i.next)!==n;)(o=ZL(i))<s&&(t=i,s=o);n=t.next}for(t=[n._],i=n;(i=i.next)!==n;)t.push(i._);for(i=VL(t),a=0;a<r;++a)(t=e[a]).x-=i.x,t.y-=i.y;return i.r}function eP(e){if("function"!=typeof e)throw new Error;return e}function tP(){return 0}function nP(e){return function(){return e}}function iP(e){return Math.sqrt(e.value)}function rP(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function sP(e,t){return function(n){if(i=n.children){var i,r,s,o=i.length,a=e(n)*t||0;if(a)for(r=0;r<o;++r)i[r].r+=a;if(s=JL(i),a)for(r=0;r<o;++r)i[r].r-=a;n.r=s+a}}}function oP(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function aP(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function lP(e,t,n,i,r){for(var s,o=e.children,a=-1,l=o.length,u=e.value&&(i-t)/e.value;++a<l;)(s=o[a]).y0=n,s.y1=r,s.x0=t,s.x1=t+=s.value*u}OL.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:CL}]},pt(OL,Ho,{transform(e,t){var n,i,r=this.value,s=t.changed(t.ADD_REM),o=e.modified(AL),a=e.iterations||300;if(r?(s&&(t.modifies("index"),r.nodes(t.source)),(o||t.changed(t.MOD))&&ML(r,e,0,t)):(this.value=r=function(e,t){const n=TL(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),ML(n,t,!0).on("end",()=>s=!0)}(t.source,e),r.on("tick",(n=t.dataflow,i=this,()=>n.touch(i).run())),e.static||(s=!0,r.tick()),t.modifies("index")),o||s||e.modified(SL)||t.changed()&&e.restart)if(r.alpha(Math.max(r.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(r.alphaMin(),1/a)),e.static)for(r.stop();--a>=0;)r.tick();else if(r.stopped()&&r.restart(),!s)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let e,t=this._argops,a=0,l=t.length;a<l;++a)if(e=t[a],e.name===IL&&"link"===e.op._argval.force)for(var i,r=e.op._argops,s=0,o=r.length;s<o;++s)if("links"===r[s].name&&(i=r[s].op.source)){n.pulse(i,n.changeset().reflow());break}return t.reflow(e.modified()).modifies(CL)}}),UL.prototype=FL.prototype={constructor:UL,count:function(){return this.eachAfter(DL)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,s=this,o=[s],a=[],l=-1;s=o.pop();)if(a.push(s),n=s.children)for(i=0,r=n.length;i<r;++i)o.push(n[i]);for(;s=a.pop();)e.call(t,s,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,s=[r],o=-1;r=s.pop();)if(e.call(t,r,++o,this),n=r.children)for(i=n.length-1;i>=0;--i)s.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return FL(this).eachBefore(BL)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,s=[r];do{for(e=s.reverse(),s=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)s.push(t[n])}while(s.length)}};var uP={depth:-1},cP={};function dP(e){return e.id}function hP(e){return e.parentId}function pP(){var e=dP,t=hP;function n(n){var i,r,s,o,a,l,u,c=Array.from(n),d=c.length,h=new Map;for(r=0;r<d;++r)i=c[r],a=c[r]=new UL(i),null!=(l=e(i,r,n))&&(l+="")&&(u=a.id=l,h.set(u,h.has(u)?cP:a)),null!=(l=t(i,r,n))&&(l+="")&&(a.parent=l);for(r=0;r<d;++r)if(l=(a=c[r]).parent){if(!(o=h.get(l)))throw new Error("missing: "+l);if(o===cP)throw new Error("ambiguous: "+l);o.children?o.children.push(a):o.children=[a],a.parent=o}else{if(s)throw new Error("multiple roots");s=a}if(!s)throw new Error("no root");if(s.parent=uP,s.eachBefore(function(e){e.depth=e.parent.depth+1,--d}).eachBefore($L),s.parent=null,d>0)throw new Error("cycle");return s}return n.id=function(t){return arguments.length?(e=eP(t),n):e},n.parentId=function(e){return arguments.length?(t=eP(e),n):t},n}function fP(e,t){return e.parent===t.parent?1:2}function mP(e){var t=e.children;return t?t[0]:e.t}function gP(e){var t=e.children;return t?t[t.length-1]:e.t}function _P(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function yP(e,t,n){return e.a.parent===t.parent?e.a:n}function vP(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function bP(e,t){return e.parent===t.parent?1:2}function TP(e,t){return e+t.x}function xP(e,t){return Math.max(e,t.y)}function EP(e,t,n,i,r){for(var s,o=e.children,a=-1,l=o.length,u=e.value&&(r-n)/e.value;++a<l;)(s=o[a]).x0=t,s.x1=i,s.y0=n,s.y1=n+=s.value*u}vP.prototype=Object.create(UL.prototype);var wP=(1+Math.sqrt(5))/2;function IP(e,t,n,i,r,s){for(var o,a,l,u,c,d,h,p,f,m,g,_=[],y=t.children,v=0,b=0,T=y.length,x=t.value;v<T;){l=r-n,u=s-i;do{c=y[b++].value}while(!c&&b<T);for(d=h=c,g=c*c*(m=Math.max(u/l,l/u)/(x*e)),f=Math.max(h/g,g/d);b<T;++b){if(c+=a=y[b].value,a<d&&(d=a),a>h&&(h=a),g=c*c*m,(p=Math.max(h/g,g/d))>f){c-=a;break}f=p}_.push(o={value:c,dice:l<u,children:y.slice(v,b)}),o.dice?lP(o,n,i,r,x?i+=u*c/x:s):EP(o,n,i,x?n+=l*c/x:r,s),x-=c,v=b}return _}const AP=function e(t){function n(e,n,i,r,s){IP(t,e,n,i,r,s)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(wP),SP=function e(t){function n(e,n,i,r,s){if((o=e._squarify)&&o.ratio===t)for(var o,a,l,u,c,d=-1,h=o.length,p=e.value;++d<h;){for(l=(a=o[d]).children,u=a.value=0,c=l.length;u<c;++u)a.value+=l[u].value;a.dice?lP(a,n,i,r,p?i+=(s-i)*a.value/p:s):EP(a,n,i,p?n+=(r-n)*a.value/p:r,s),p-=a.value}else e._squarify=o=IP(t,e,n,i,r,s),o.ratio=t}return n.ratio=function(t){return e((t=+t)>1?t:1)},n}(wP);function CP(e,t,n){const i={};return e.each(e=>{const r=e.data;n(r)&&(i[t(r)]=e)}),e.lookup=i,e}function OP(e){Ho.call(this,null,e)}OP.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const MP=e=>e.values;function kP(){const e=[],t={entries:e=>i(n(e,0),0),key:n=>(e.push(n),t)};function n(t,i){if(i>=e.length)return t;const r=t.length,s=e[i++],o={},a={};let l,u,c,d=-1;for(;++d<r;)l=s(u=t[d])+"",(c=o[l])?c.push(u):o[l]=[u];for(l in o)a[l]=n(o[l],i);return a}function i(t,n){if(++n>e.length)return t;const r=[];for(const e in t)r.push({key:e,values:i(t[e],n)});return r}return t}function RP(e){Ho.call(this,null,e)}pt(OP,Ho,{transform(e,t){t.source||ae("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(e=>{e.children&&ho(e.data)&&r.rem.push(e.data)}),this.value=s=FL({values:Xe(e.keys).reduce((e,t)=>(e.key(t),e),kP()).entries(r.source)},MP),n&&s.each(e=>{e.children&&(e=mo(e.data),r.add.push(e),r.source.push(e))}),CP(s,po,po)),r.source.root=s,r}});const NP=(e,t)=>e.parent===t.parent?1:2;pt(RP,Ho,{transform(e,t){t.source&&t.source.root||ae(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(vo(e.sort,e=>e.data)),function(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}(n,this.params,e),n.separation&&n.separation(!1!==e.separation?NP:pe);try{this.value=n(r)}catch(e){ae(e)}return r.each(e=>function(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}(e,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});const DP=["x","y","r","depth","children"];function FP(e){RP.call(this,e)}FP.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:DP.length,default:DP}]},pt(FP,RP,{layout:function(){var e=null,t=1,n=1,i=tP;function r(r){return r.x=t/2,r.y=n/2,e?r.eachBefore(rP(e)).eachAfter(sP(i,.5)).eachBefore(oP(1)):r.eachBefore(rP(iP)).eachAfter(sP(tP,1)).eachAfter(sP(i,r.r/Math.min(t,n))).eachBefore(oP(Math.min(t,n)/(2*r.r))),r}return r.radius=function(t){return arguments.length?(e=null==(n=t)?null:eP(n),r):e;var n},r.size=function(e){return arguments.length?(t=+e[0],n=+e[1],r):[t,n]},r.padding=function(e){return arguments.length?(i="function"==typeof e?e:nP(+e),r):i},r},params:["radius","size","padding"],fields:DP});const LP=["x0","y0","x1","y1","depth","children"];function PP(e){RP.call(this,e)}function BP(e){Ho.call(this,null,e)}PP.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:LP.length,default:LP}]},pt(PP,RP,{layout:function(){var e=1,t=1,n=0,i=!1;function r(r){var s=r.height+1;return r.x0=r.y0=n,r.x1=e,r.y1=t/s,r.eachBefore(function(e,t){return function(i){i.children&&lP(i,i.x0,e*(i.depth+1)/t,i.x1,e*(i.depth+2)/t);var r=i.x0,s=i.y0,o=i.x1-n,a=i.y1-n;o<r&&(r=o=(r+o)/2),a<s&&(s=a=(s+a)/2),i.x0=r,i.y0=s,i.x1=o,i.y1=a}}(t,s)),i&&r.eachBefore(aP),r}return r.round=function(e){return arguments.length?(i=!!e,r):i},r.size=function(n){return arguments.length?(e=+n[0],t=+n[1],r):[e,t]},r.padding=function(e){return arguments.length?(n=+e,r):n},r},params:["size","round","padding"],fields:LP}),BP.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]},pt(BP,Ho,{transform(e,t){t.source||ae("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?CP(pP().id(e.key).parentId(e.parentKey)(r.source),e.key,fe):CP(pP()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const $P={tidy:function(){var e=fP,t=1,n=1,i=null;function r(r){var l=function(e){for(var t,n,i,r,s,o=new vP(e,0),a=[o];t=a.pop();)if(i=t._.children)for(t.children=new Array(s=i.length),r=s-1;r>=0;--r)a.push(n=t.children[r]=new vP(i[r],r)),n.parent=t;return(o.parent=new vP(null,0)).children=[o],o}(r);if(l.eachAfter(s),l.parent.m=-l.z,l.eachBefore(o),i)r.eachBefore(a);else{var u=r,c=r,d=r;r.eachBefore(function(e){e.x<u.x&&(u=e),e.x>c.x&&(c=e),e.depth>d.depth&&(d=e)});var h=u===c?1:e(u,c)/2,p=h-u.x,f=t/(c.x+h+p),m=n/(d.depth||1);r.eachBefore(function(e){e.x=(e.x+p)*f,e.y=e.depth*m})}return r}function s(t){var n=t.children,i=t.parent.children,r=t.i?i[t.i-1]:null;if(n){!function(e){for(var t,n=0,i=0,r=e.children,s=r.length;--s>=0;)(t=r[s]).z+=n,t.m+=n,n+=t.s+(i+=t.c)}(t);var s=(n[0].z+n[n.length-1].z)/2;r?(t.z=r.z+e(t._,r._),t.m=t.z-s):t.z=s}else r&&(t.z=r.z+e(t._,r._));t.parent.A=function(t,n,i){if(n){for(var r,s=t,o=t,a=n,l=s.parent.children[0],u=s.m,c=o.m,d=a.m,h=l.m;a=gP(a),s=mP(s),a&&s;)l=mP(l),(o=gP(o)).a=t,(r=a.z+d-s.z-u+e(a._,s._))>0&&(_P(yP(a,t,i),t,r),u+=r,c+=r),d+=a.m,u+=s.m,h+=l.m,c+=o.m;a&&!gP(o)&&(o.t=a,o.m+=d-c),s&&!mP(l)&&(l.t=s,l.m+=u-h,i=t)}return i}(t,r,t.parent.A||i[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function a(e){e.x*=t,e.y=e.depth*n}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r},cluster:function(){var e=bP,t=1,n=1,i=!1;function r(r){var s,o=0;r.eachAfter(function(t){var n=t.children;n?(t.x=function(e){return e.reduce(TP,0)/e.length}(n),t.y=function(e){return 1+e.reduce(xP,0)}(n)):(t.x=s?o+=e(t,s):0,t.y=0,s=t)});var a=function(e){for(var t;t=e.children;)e=t[0];return e}(r),l=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(r),u=a.x-e(a,l)/2,c=l.x+e(l,a)/2;return r.eachAfter(i?function(e){e.x=(e.x-r.x)*t,e.y=(r.y-e.y)*n}:function(e){e.x=(e.x-u)/(c-u)*t,e.y=(1-(r.y?e.y/r.y:1))*n})}return r.separation=function(t){return arguments.length?(e=t,r):e},r.size=function(e){return arguments.length?(i=!1,t=+e[0],n=+e[1],r):i?null:[t,n]},r.nodeSize=function(e){return arguments.length?(i=!0,t=+e[0],n=+e[1],r):i?[t,n]:null},r}},UP=["x","y","depth","children"];function VP(e){RP.call(this,e)}function zP(e){Ho.call(this,[],e)}VP.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:UP.length,default:UP}]},pt(VP,RP,{layout(e){const t=e||"tidy";if(ut($P,t))return $P[t]();ae("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:UP}),zP.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},pt(zP,Ho,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||ae("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,e=>s[po(e)]=1),i.each(e=>{const t=e.data,n=e.parent&&e.parent.data;n&&s[po(t)]&&s[po(n)]&&r.add.push(mo({source:n,target:t}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>s[po(e)]=1),n.forEach(e=>{(s[po(e.source)]||s[po(e.target)])&&r.mod.push(e)})),r}});const jP={binary:function(e,t,n,i,r){var s,o,a=e.children,l=a.length,u=new Array(l+1);for(u[0]=o=s=0;s<l;++s)u[s+1]=o+=a[s].value;!function e(t,n,i,r,s,o,l){if(t>=n-1){var c=a[t];return c.x0=r,c.y0=s,c.x1=o,void(c.y1=l)}var d=u[t],h=i/2+d,p=t+1,f=n-1;for(;p<f;){var m=p+f>>>1;u[m]<h?p=m+1:f=m}h-u[p-1]<u[p]-h&&t+1<p&&--p;var g=u[p]-d,_=i-g;if(o-r>l-s){var y=i?(r*_+o*g)/i:o;e(t,p,g,r,s,y,l),e(p,n,_,y,s,o,l)}else{var v=i?(s*_+l*g)/i:l;e(t,p,g,r,s,o,v),e(p,n,_,r,v,o,l)}}(0,l,e.value,t,n,i,r)},dice:lP,slice:EP,slicedice:function(e,t,n,i,r){(1&e.depth?EP:lP)(e,t,n,i,r)},squarify:AP,resquarify:SP},YP=["x0","y0","x1","y1","depth","children"];function GP(e){RP.call(this,e)}function HP(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function WP(e){this._context=e}function XP(){}function qP(e){this._context=e}function KP(e){this._context=e}function ZP(e,t){this._basis=new WP(e),this._beta=t}GP.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:YP.length,default:YP}]},pt(GP,RP,{layout(){const e=function(){var e=AP,t=!1,n=1,i=1,r=[0],s=tP,o=tP,a=tP,l=tP,u=tP;function c(e){return e.x0=e.y0=0,e.x1=n,e.y1=i,e.eachBefore(d),r=[0],t&&e.eachBefore(aP),e}function d(t){var n=r[t.depth],i=t.x0+n,c=t.y0+n,d=t.x1-n,h=t.y1-n;d<i&&(i=d=(i+d)/2),h<c&&(c=h=(c+h)/2),t.x0=i,t.y0=c,t.x1=d,t.y1=h,t.children&&(n=r[t.depth+1]=s(t)/2,i+=u(t)-n,c+=o(t)-n,(d-=a(t)-n)<i&&(i=d=(i+d)/2),(h-=l(t)-n)<c&&(c=h=(c+h)/2),e(t,i,c,d,h))}return c.round=function(e){return arguments.length?(t=!!e,c):t},c.size=function(e){return arguments.length?(n=+e[0],i=+e[1],c):[n,i]},c.tile=function(t){return arguments.length?(e=eP(t),c):e},c.padding=function(e){return arguments.length?c.paddingInner(e).paddingOuter(e):c.paddingInner()},c.paddingInner=function(e){return arguments.length?(s="function"==typeof e?e:nP(+e),c):s},c.paddingOuter=function(e){return arguments.length?c.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):c.paddingTop()},c.paddingTop=function(e){return arguments.length?(o="function"==typeof e?e:nP(+e),c):o},c.paddingRight=function(e){return arguments.length?(a="function"==typeof e?e:nP(+e),c):a},c.paddingBottom=function(e){return arguments.length?(l="function"==typeof e?e:nP(+e),c):l},c.paddingLeft=function(e){return arguments.length?(u="function"==typeof e?e:nP(+e),c):u},c}();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ut(jP,t)?e.tile(jP[t]):ae("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:YP}),WP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:HP(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:HP(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},qP.prototype={areaStart:XP,areaEnd:XP,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:HP(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},KP.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:HP(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ZP.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i,r=e[0],s=t[0],o=e[n]-r,a=t[n]-s,l=-1;++l<=n;)i=l/n,this._basis.point(this._beta*e[l]+(1-this._beta)*(r+i*o),this._beta*t[l]+(1-this._beta)*(s+i*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const QP=function e(t){function n(e){return 1===t?new WP(e):new ZP(e,t)}return n.beta=function(t){return e(+t)},n}(.85);function JP(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function eB(e,t){this._context=e,this._k=(1-t)/6}eB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:JP(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:JP(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const tB=function e(t){function n(e){return new eB(e,t)}return n.tension=function(t){return e(+t)},n}(0);function nB(e,t){this._context=e,this._k=(1-t)/6}nB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:JP(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const iB=function e(t){function n(e){return new nB(e,t)}return n.tension=function(t){return e(+t)},n}(0);function rB(e,t){this._context=e,this._k=(1-t)/6}rB.prototype={areaStart:XP,areaEnd:XP,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:JP(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const sB=function e(t){function n(e){return new rB(e,t)}return n.tension=function(t){return e(+t)},n}(0);var oB=Math.abs,aB=Math.atan2,lB=Math.cos,uB=Math.max,cB=Math.min,dB=Math.sin,hB=Math.sqrt,pB=1e-12,fB=Math.PI,mB=fB/2,gB=2*fB;function _B(e){return e>=1?mB:e<=-1?-mB:Math.asin(e)}function yB(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>pB){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>pB){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function vB(e,t){this._context=e,this._alpha=t}vB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:yB(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const bB=function e(t){function n(e){return t?new vB(e,t):new eB(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function TB(e,t){this._context=e,this._alpha=t}TB.prototype={areaStart:XP,areaEnd:XP,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:yB(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const xB=function e(t){function n(e){return t?new TB(e,t):new rB(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function EB(e,t){this._context=e,this._alpha=t}EB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:yB(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wB=function e(t){function n(e){return t?new EB(e,t):new nB(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function IB(e){this._context=e}function AB(e){return new IB(e)}function SB(e){this._context=e}function CB(e){return e<0?-1:1}function OB(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(CB(s)+CB(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function MB(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function kB(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function RB(e){this._context=e}function NB(e){this._context=new DB(e)}function DB(e){this._context=e}function FB(e){this._context=e}function LB(e){var t,n,i=e.length-1,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(r[i-1]=o[i-1]/s[i-1],t=i-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function PB(e,t){this._context=e,this._t=t}IB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},SB.prototype={areaStart:XP,areaEnd:XP,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},RB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:kB(this,this._t0,MB(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,kB(this,MB(this,n=OB(this,e,t)),n);break;default:kB(this,this._t0,n=OB(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(NB.prototype=Object.create(RB.prototype)).point=function(e,t){RB.prototype.point.call(this,t,e)},DB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}},FB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=LB(e),r=LB(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},PB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};const BB=Math.PI,$B=2*BB,UB=1e-6,VB=$B-UB;function zB(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function jB(){return new zB}zB.prototype=jB.prototype={constructor:zB,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,s){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var s=this._x1,o=this._y1,a=n-e,l=i-t,u=s-e,c=o-t,d=u*u+c*c;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>UB)if(Math.abs(c*a-l*u)>UB&&r){var h=n-s,p=i-o,f=a*a+l*l,m=h*h+p*p,g=Math.sqrt(f),_=Math.sqrt(d),y=r*Math.tan((BB-Math.acos((f+d-m)/(2*g*_)))/2),v=y/_,b=y/g;Math.abs(v-1)>UB&&(this._+="L"+(e+v*u)+","+(t+v*c)),this._+="A"+r+","+r+",0,0,"+ +(c*h>u*p)+","+(this._x1=e+b*a)+","+(this._y1=t+b*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,s){e=+e,t=+t,s=!!s;var o=(n=+n)*Math.cos(i),a=n*Math.sin(i),l=e+o,u=t+a,c=1^s,d=s?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>UB||Math.abs(this._y1-u)>UB)&&(this._+="L"+l+","+u),n&&(d<0&&(d=d%$B+$B),d>VB?this._+="A"+n+","+n+",0,1,"+c+","+(e-o)+","+(t-a)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):d>UB&&(this._+="A"+n+","+n+",0,"+ +(d>=BB)+","+c+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};const YB=jB;function GB(e){return function(){return e}}function HB(e){return e.innerRadius}function WB(e){return e.outerRadius}function XB(e){return e.startAngle}function qB(e){return e.endAngle}function KB(e){return e&&e.padAngle}function ZB(e,t,n,i,r,s,o){var a=e-n,l=t-i,u=(o?s:-s)/hB(a*a+l*l),c=u*l,d=-u*a,h=e+c,p=t+d,f=n+c,m=i+d,g=(h+f)/2,_=(p+m)/2,y=f-h,v=m-p,b=y*y+v*v,T=r-s,x=h*m-f*p,E=(v<0?-1:1)*hB(uB(0,T*T*b-x*x)),w=(x*v-y*E)/b,I=(-x*y-v*E)/b,A=(x*v+y*E)/b,S=(-x*y+v*E)/b,C=w-g,O=I-_,M=A-g,k=S-_;return C*C+O*O>M*M+k*k&&(w=A,I=S),{cx:w,cy:I,x01:-c,y01:-d,x11:w*(r/T-1),y11:I*(r/T-1)}}Array.prototype.slice;function QB(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function JB(e){return e[0]}function e$(e){return e[1]}function t$(e,t){var n=GB(!0),i=null,r=AB,s=null;function o(o){var a,l,u,c=(o=QB(o)).length,d=!1;for(null==i&&(s=r(u=YB())),a=0;a<=c;++a)!(a<c&&n(l=o[a],a,o))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(l,a,o),+t(l,a,o));if(u)return s=null,u+""||null}return e="function"==typeof e?e:void 0===e?JB:GB(e),t="function"==typeof t?t:void 0===t?e$:GB(t),o.x=function(t){return arguments.length?(e="function"==typeof t?t:GB(+t),o):e},o.y=function(e){return arguments.length?(t="function"==typeof e?e:GB(+e),o):t},o.defined=function(e){return arguments.length?(n="function"==typeof e?e:GB(!!e),o):n},o.curve=function(e){return arguments.length?(r=e,null!=i&&(s=r(i)),o):r},o.context=function(e){return arguments.length?(null==e?i=s=null:s=r(i=e),o):i},o}function n$(e,t,n){var i=null,r=GB(!0),s=null,o=AB,a=null;function l(l){var u,c,d,h,p,f=(l=QB(l)).length,m=!1,g=new Array(f),_=new Array(f);for(null==s&&(a=o(p=YB())),u=0;u<=f;++u){if(!(u<f&&r(h=l[u],u,l))===m)if(m=!m)c=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),d=u-1;d>=c;--d)a.point(g[d],_[d]);a.lineEnd(),a.areaEnd()}m&&(g[u]=+e(h,u,l),_[u]=+t(h,u,l),a.point(i?+i(h,u,l):g[u],n?+n(h,u,l):_[u]))}if(p)return a=null,p+""||null}function u(){return t$().defined(r).curve(o).context(s)}return e="function"==typeof e?e:void 0===e?JB:GB(+e),t="function"==typeof t?t:GB(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?e$:GB(+n),l.x=function(t){return arguments.length?(e="function"==typeof t?t:GB(+t),i=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:GB(+t),l):e},l.x1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:GB(+e),l):i},l.y=function(e){return arguments.length?(t="function"==typeof e?e:GB(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:GB(+e),l):t},l.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:GB(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(i).y(t)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:GB(!!e),l):r},l.curve=function(e){return arguments.length?(o=e,null!=s&&(a=o(s)),l):o},l.context=function(e){return arguments.length?(null==e?s=a=null:a=o(s=e),l):s},l}const i$={draw:function(e,t){var n=Math.sqrt(t/fB);e.moveTo(n,0),e.arc(0,0,n,0,gB)}};Math.sqrt(1/3);var r$=Math.sin(fB/10)/Math.sin(7*fB/10);Math.sin(gB/10),Math.cos(gB/10);Math.sqrt(3);Math.sqrt(3),Math.sqrt(12);var s$={},o$={};function a$(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'}).join(",")+"}")}function l$(e){var t=Object.create(null),n=[];return e.forEach(function(e){for(var i in e)i in t||n.push(t[i]=i)}),n}function u$(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function c$(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":function(e){return e<0?"-"+u$(-e,6):e>9999?"+"+u$(e,6):u$(e,4)}(e.getUTCFullYear())+"-"+u$(e.getUTCMonth()+1,2)+"-"+u$(e.getUTCDate(),2)+(r?"T"+u$(t,2)+":"+u$(n,2)+":"+u$(i,2)+"."+u$(r,3)+"Z":i?"T"+u$(t,2)+":"+u$(n,2)+":"+u$(i,2)+"Z":n||t?"T"+u$(t,2)+":"+u$(n,2)+"Z":"")}function d$(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,r=[],s=e.length,o=0,a=0,l=s<=0,u=!1;function c(){if(l)return o$;if(u)return u=!1,s$;var t,i,r=o;if(34===e.charCodeAt(r)){for(;o++<s&&34!==e.charCodeAt(o)||34===e.charCodeAt(++o););return(t=o)>=s?l=!0:10===(i=e.charCodeAt(o++))?u=!0:13===i&&(u=!0,10===e.charCodeAt(o)&&++o),e.slice(r+1,t-1).replace(/""/g,'"')}for(;o<s;){if(10===(i=e.charCodeAt(t=o++)))u=!0;else if(13===i)u=!0,10===e.charCodeAt(o)&&++o;else if(i!==n)continue;return e.slice(r,t)}return l=!0,e.slice(r,s)}for(10===e.charCodeAt(s-1)&&--s,13===e.charCodeAt(s-1)&&--s;(i=c())!==o$;){for(var d=[];i!==s$&&i!==o$;)d.push(i),i=c();t&&null==(d=t(d,a++))||r.push(d)}return r}function r(t,n){return t.map(function(t){return n.map(function(e){return o(t[e])}).join(e)})}function s(t){return t.map(o).join(e)}function o(e){return null==e?"":e instanceof Date?c$(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,r,s=i(e,function(e,i){if(n)return n(e,i-1);r=e,n=t?function(e,t){var n=a$(e);return function(i,r){return t(n(i),r,e)}}(e,t):a$(e)});return s.columns=r||[],s},parseRows:i,format:function(t,n){return null==n&&(n=l$(t)),[n.map(o).join(e)].concat(r(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=l$(e)),r(e,t).join("\n")},formatRows:function(e){return e.map(s).join("\n")},formatRow:s,formatValue:o}}var h$,p$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function f$(e){if(!(t=p$.exec(e)))throw new Error("invalid format: "+e);var t;return new m$({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function m$(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function g$(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function _$(e){return(e=g$(Math.abs(e)))?e[1]:NaN}function y$(e,t){var n=g$(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}f$.prototype=m$.prototype,m$.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const v$={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>y$(100*e,t),r:y$,s:function(e,t){var n=g$(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(h$=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+g$(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function b$(e){return e}var T$,x$,E$,w$=Array.prototype.map,I$=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A$(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?b$:(t=w$.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,s=[],o=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(e.substring(r-=a,r+a)),!((l+=a+1)>i));)a=t[o=(o+1)%t.length];return s.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?b$:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(w$.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=f$(e)).fill,n=e.align,d=e.sign,h=e.symbol,p=e.zero,f=e.width,m=e.comma,g=e.precision,_=e.trim,y=e.type;"n"===y?(m=!0,y="g"):v$[y]||(void 0===g&&(g=12),_=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var v="$"===h?r:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",b="$"===h?s:/[%p]/.test(y)?l:"",T=v$[y],x=/[defgprs%]/.test(y);function E(e){var r,s,l,h=v,E=b;if("c"===y)E=T(e)+E,e="";else{var w=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:T(Math.abs(e),g),_&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),w&&0===+e&&"+"!==d&&(w=!1),h=(w?"("===d?d:u:"-"===d||"("===d?"":d)+h,E=("s"===y?I$[8+h$/3]:"")+E+(w&&"("===d?")":""),x)for(r=-1,s=e.length;++r<s;)if(48>(l=e.charCodeAt(r))||l>57){E=(46===l?o+e.slice(r+1):e.slice(r))+E,e=e.slice(0,r);break}}m&&!p&&(e=i(e,1/0));var I=h.length+e.length+E.length,A=I<f?new Array(f-I+1).join(t):"";switch(m&&p&&(e=i(A+e,A.length?f-E.length:1/0),A=""),n){case"<":e=h+e+E+A;break;case"=":e=h+A+e+E;break;case"^":e=A.slice(0,I=A.length>>1)+h+e+E+A.slice(I);break;default:e=A+h+e+E}return a(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=d(((e=f$(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(_$(t)/3))),r=Math.pow(10,-i),s=I$[8+i/3];return function(e){return n(r*e)+s}}}}function S$(e){const t={};return n=>t[n]||(t[n]=e(n))}function C$(e){const t=S$(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(e){const n=f$(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return function(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=function(e,t){let n,i=e.lastIndexOf("e");if(i>0)return i;for(i=e.length;--i>t;)if(n=e.charCodeAt(i),n>=48&&n<=57)return i+1}(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if("0"!==i[s]){++s;break}return i.slice(0,s)+o}}(t(n),t(".1f")(1)[1])}return t(n)},formatSpan(e,i,r,s){s=f$(null==s?",f":s);const o=ru(e,i,r),a=Math.max(Math.abs(e),Math.abs(i));let l;if(null==s.precision)switch(s.type){case"s":return isNaN(l=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(_$(t)/3)))-_$(Math.abs(e)))}(o,a))||(s.precision=l),n(s,a);case"":case"e":case"g":case"p":case"r":isNaN(l=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_$(t)-_$(e))+1}(o,a))||(s.precision=l-("e"===s.type));break;case"f":case"%":isNaN(l=function(e){return Math.max(0,-_$(Math.abs(e)))}(o))||(s.precision=l-2*("%"===s.type))}return t(s)}}}let O$,M$;function k$(){return O$=C$({format:x$,formatPrefix:E$})}function R$(e){return C$(A$(e))}function N$(e){return arguments.length?O$=R$(e):O$}function D$(e,t,n){we(n=n||{})||ae("Invalid time multi-format specifier: ".concat(n));const i=t(fu),r=t(pu),s=t(hu),o=t(uu),a=t(lu),l=t(au),u=t(ou),c=t(su),d=e(n[mu]||".%L"),h=e(n[fu]||":%S"),p=e(n[pu]||"%I:%M"),f=e(n[hu]||"%I %p"),m=e(n[uu]||n[cu]||"%a %d"),g=e(n[lu]||"%b %d"),_=e(n[au]||"%B"),y=e(n[ou]||"%B"),v=e(n[su]||"%Y");return e=>(i(e)<e?d:r(e)<e?h:s(e)<e?p:o(e)<e?f:l(e)<e?a(e)<e?m:g:c(e)<e?u(e)<e?_:y:v)(e)}function F$(e){const t=S$(e.format),n=S$(e.utcFormat);return{timeFormat:e=>bt(e)?t(e):D$(t,Gu,e),utcFormat:e=>bt(e)?n(e):D$(n,Hu,e),timeParse:S$(e.parse),utcParse:S$(e.utcParse)}}function L$(){return M$=F$({format:lC,parse:uC,utcFormat:cC,utcParse:dC})}function P$(e){return F$(oC(e))}function B$(e){return arguments.length?M$=P$(e):M$}!function(e){T$=A$(e),x$=T$.format,E$=T$.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]}),k$(),L$();const $$=(e,t)=>st({},e,t);function U$(e,t){const n=e?R$(e):N$(),i=t?P$(t):B$();return $$(n,i)}function V$(e,t){const n=arguments.length;return n&&2!==n&&ae("defaultLocale expects either zero or two arguments."),n?$$(N$(e),B$(t)):$$(N$(),B$())}function z$(){return k$(),L$(),V$()}const j$=/^(data:|([A-Za-z]+:)?\/\/)/,Y$=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,G$=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,H$="file://";async function W$(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function X$(e,t){t=st({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=Y$.test(e.replace(G$,""));null!=e&&"string"==typeof e&&a||ae("Sanitize failure, invalid URI: "+Ot(e));const l=j$.test(e);return(o=t.baseURL)&&!l&&(e.startsWith("/")||o.endsWith("/")||(e="/"+e),e=o+e),s=(r=e.startsWith(H$))||"file"===t.mode||"http"!==t.mode&&!l&&n,r?e=e.slice(7):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),"image"===t.context&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function q$(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(e,t)=>{e?i(e):n(t)})}):K$}async function K$(){ae("No file system access.")}function Z$(e){return e?async function(t,n){const i=st({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?Ke(s[r])?s[r]():s.text():ae(s.status+""+s.statusText)}:Q$}async function Q$(){ae("No HTTP fetch method available.")}const J$=e=>null!=e&&e==e,eU=e=>!(Number.isNaN(+e)||e instanceof Date),tU={boolean:Mt,integer:Me,number:Me,date:Rt,string:Nt,unknown:de},nU=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>eU(e)&&Number.isInteger(+e),eU,e=>!Number.isNaN(Date.parse(e))],iU=["boolean","integer","number","date"];function rU(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=nU.length,r=nU.map((e,t)=>t+1);for(let s,o,a=0,l=0;a<n;++a)for(o=t?e[a][t]:e[a],s=0;s<i;++s)if(r[s]&&J$(o)&&!nU[s](o)&&(r[s]=0,++l,l===nU.length))return"string";return iU[r.reduce((e,t)=>0===e?t:e,0)-1]}function sU(e,t){return t.reduce((t,n)=>(t[n]=rU(e,n),t),{})}function oU(e){const t=function(t,n){const i={delimiter:e};return aU(t,n?st(n,i):i)};return t.responseType="text",t}function aU(e,t){return t.header&&(e=t.header.map(Ot).join(t.delimiter)+"\n"+e),d$(t.delimiter).parse(e+"")}function lU(e,t){const n=t&&t.property?ue(t.property):de;return!we(e)||(i=e,"function"==typeof Buffer&&Ke(Buffer.isBuffer)&&Buffer.isBuffer(i))?n(JSON.parse(e)):function(e,t){!Ee(e)&&_t(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t);var i}aU.responseType="text",lU.responseType="json";const uU={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function cU(e,t){let n,i,r,s;return e=lU(e,t),t&&t.feature?(n=Tn,r=t.feature):t&&t.mesh?(n=In,r=t.mesh,s=uU[t.filter]):ae("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):ae("Invalid TopoJSON object: "+r),i&&i.features||[i]}cU.responseType="json";const dU={dsv:aU,csv:oU(","),tsv:oU("\t"),json:lU,topojson:cU};function hU(e,t){return arguments.length>1?(dU[e]=t,this):ut(dU,e)?dU[e]:null}function pU(e){const t=hU(e);return t&&t.responseType||"text"}function fU(e,t,n,i){const r=hU((t=t||{}).type||"json");return r||ae("Unknown data format type: "+t.type),e=r(e,t),t.parse&&function(e,t,n,i){if(!e.length)return;const r=B$();n=n||r.timeParse,i=i||r.utcParse;let s,o,a,l,u,c,d=e.columns||Object.keys(e[0]);"auto"===t&&(t=sU(e,d));d=Object.keys(t);const h=d.map(e=>{const r=t[e];let s,o;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){s=r.split(/:(.+)?/,2),o=s[1],("'"===o[0]&&"'"===o[o.length-1]||'"'===o[0]&&'"'===o[o.length-1])&&(o=o.slice(1,-1));return("utc"===s[0]?i:n)(o)}if(!tU[r])throw Error("Illegal format pattern: "+e+":"+r);return tU[r]});for(a=0,u=e.length,c=d.length;a<u;++a)for(s=e[a],l=0;l<c;++l)o=d[l],s[o]=h[l](s[o])}(e,t.parse,n,i),ut(e,"columns")&&delete e.columns,e}const mU=function(e,t){return n=>({options:n||{},sanitize:X$,load:W$,fileAccess:!!t,file:q$(t),http:Z$(e)})}("undefined"!=typeof fetch&&fetch,null);let gU=0;const _U="p_";function yU(e){return e&&e.gradient}function vU(e,t,n){const i=e.gradient;let r=e.id,s="radial"===i?_U:"";return r||(r=e.id="gradient_"+gU++,"radial"===i?(e.x1=bU(e.x1,.5),e.y1=bU(e.y1,.5),e.r1=bU(e.r1,0),e.x2=bU(e.x2,.5),e.y2=bU(e.y2,.5),e.r2=bU(e.r2,.5),s=_U):(e.x1=bU(e.x1,0),e.y1=bU(e.y1,0),e.x2=bU(e.x2,1),e.y2=bU(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function bU(e,t){return null!=e?e:t}function TU(e,t){var n,i=[];return n={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:i,stop:function(e,t){return i.push({offset:e,color:t}),n}}}const xU={basis:{curve:function(e){return new WP(e)}},"basis-closed":{curve:function(e){return new qP(e)}},"basis-open":{curve:function(e){return new KP(e)}},bundle:{curve:QP,tension:"beta",value:.85},cardinal:{curve:tB,tension:"tension",value:0},"cardinal-open":{curve:iB,tension:"tension",value:0},"cardinal-closed":{curve:sB,tension:"tension",value:0},"catmull-rom":{curve:bB,tension:"alpha",value:.5},"catmull-rom-closed":{curve:xB,tension:"alpha",value:.5},"catmull-rom-open":{curve:wB,tension:"alpha",value:.5},linear:{curve:AB},"linear-closed":{curve:function(e){return new SB(e)}},monotone:{horizontal:function(e){return new NB(e)},vertical:function(e){return new RB(e)}},natural:{curve:function(e){return new FB(e)}},step:{curve:function(e){return new PB(e,.5)}},"step-after":{curve:function(e){return new PB(e,1)}},"step-before":{curve:function(e){return new PB(e,0)}}};function EU(e,t,n){var i=ut(xU,e)&&xU[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&null!=n&&(r=r[i.tension](n))),r}const wU={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},IU=[/([MLHVCSQTAZmlhvcsqtaz])/g,/###/,/(\.\d+)(\.\d)/g,/(\d)([-+])/g,/\s|,|###/];function AU(e){const t=[];let n,i,r,s,o,a,l,u,c,d;const h=e.slice().replace(IU[0],"###$1").split(IU[1]).slice(1);for(l=0,c=h.length;l<c;++l){for(n=h[l],i=n.slice(1).trim().replace(IU[2],"$1###$2").replace(IU[3],"$1###$2").split(IU[4]),o=n.charAt(0),r=[o],u=0,d=i.length;u<d;++u)(s=+i[u])===s&&r.push(s);if(a=wU[o.toLowerCase()],r.length-1>a){const e=r.length;for(u=1,t.push([o].concat(r.slice(u,u+=a))),o="M"===o?"L":"m"===o?"l":o;u<e;u+=a)t.push([o].concat(r.slice(u,u+a)))}else t.push(r)}return t}const SU=Math.PI/180,CU=Math.PI/2,OU=2*Math.PI,MU=Math.sqrt(3)/2;var kU={},RU={},NU=[].join;function DU(e){const t=NU.call(e);if(RU[t])return RU[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],l=e[6],u=e[7];const c=u*o,d=-l*a,h=l*o,p=u*a,f=Math.cos(r),m=Math.sin(r),g=Math.cos(s),_=Math.sin(s),y=.5*(s-r),v=Math.sin(.5*y),b=8/3*v*v/Math.sin(y),T=n+f-b*m,x=i+m+b*f,E=n+g,w=i+_,I=E+b*_,A=w-b*g;return RU[t]=[c*T+d*x,h*T+p*x,c*I+d*A,h*I+p*A,c*E+d*w,h*E+p*w]}const FU=["l",0,0,0,0,0,0,0];function LU(e,t,n){const i=FU[0]=e[0];if("a"===i||"A"===i)FU[1]=t*e[1],FU[2]=n*e[2],FU[3]=e[3],FU[4]=e[4],FU[5]=e[5],FU[6]=t*e[6],FU[7]=n*e[7];else if("h"===i||"H"===i)FU[1]=t*e[1];else if("v"===i||"V"===i)FU[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)FU[r]=(r%2==1?t:n)*e[r];return FU}function PU(e,t,n,i,r,s){var o,a,l,u,c,d=null,h=0,p=0,f=0,m=0;null==n&&(n=0),null==i&&(i=0),null==r&&(r=1),null==s&&(s=r),e.beginPath&&e.beginPath();for(var g=0,_=t.length;g<_;++g){switch(o=t[g],1===r&&1===s||(o=LU(o,r,s)),o[0]){case"l":h+=o[1],p+=o[2],e.lineTo(h+n,p+i);break;case"L":h=o[1],p=o[2],e.lineTo(h+n,p+i);break;case"h":h+=o[1],e.lineTo(h+n,p+i);break;case"H":h=o[1],e.lineTo(h+n,p+i);break;case"v":p+=o[1],e.lineTo(h+n,p+i);break;case"V":p=o[1],e.lineTo(h+n,p+i);break;case"m":h+=o[1],p+=o[2],e.moveTo(h+n,p+i);break;case"M":h=o[1],p=o[2],e.moveTo(h+n,p+i);break;case"c":a=h+o[5],l=p+o[6],f=h+o[3],m=p+o[4],e.bezierCurveTo(h+o[1]+n,p+o[2]+i,f+n,m+i,a+n,l+i),h=a,p=l;break;case"C":h=o[5],p=o[6],f=o[3],m=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,f+n,m+i,h+n,p+i);break;case"s":a=h+o[3],l=p+o[4],f=2*h-f,m=2*p-m,e.bezierCurveTo(f+n,m+i,h+o[1]+n,p+o[2]+i,a+n,l+i),f=h+o[1],m=p+o[2],h=a,p=l;break;case"S":a=o[3],l=o[4],f=2*h-f,m=2*p-m,e.bezierCurveTo(f+n,m+i,o[1]+n,o[2]+i,a+n,l+i),h=a,p=l,f=o[1],m=o[2];break;case"q":a=h+o[3],l=p+o[4],f=h+o[1],m=p+o[2],e.quadraticCurveTo(f+n,m+i,a+n,l+i),h=a,p=l;break;case"Q":a=o[3],l=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,a+n,l+i),h=a,p=l,f=o[1],m=o[2];break;case"t":a=h+o[1],l=p+o[2],null===d[0].match(/[QqTt]/)?(f=h,m=p):"t"===d[0]?(f=2*h-u,m=2*p-c):"q"===d[0]&&(f=2*h-f,m=2*p-m),u=f,c=m,e.quadraticCurveTo(f+n,m+i,a+n,l+i),p=l,f=(h=a)+o[1],m=p+o[2];break;case"T":a=o[1],l=o[2],f=2*h-f,m=2*p-m,e.quadraticCurveTo(f+n,m+i,a+n,l+i),h=a,p=l;break;case"a":BU(e,h+n,p+i,[o[1],o[2],o[3],o[4],o[5],o[6]+h+n,o[7]+p+i]),h+=o[6],p+=o[7];break;case"A":BU(e,h+n,p+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),h=o[6],p=o[7];break;case"z":case"Z":e.closePath()}d=o}}function BU(e,t,n,i){const r=function(e,t,n,i,r,s,o,a,l){const u=NU.call(arguments);if(kU[u])return kU[u];const c=o*SU,d=Math.sin(c),h=Math.cos(c),p=h*(a-e)*.5+d*(l-t)*.5,f=h*(l-t)*.5-d*(a-e)*.5;let m=p*p/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);m>1&&(m=Math.sqrt(m),n*=m,i*=m);const g=h/n,_=d/n,y=-d/i,v=h/i,b=g*a+_*l,T=y*a+v*l,x=g*e+_*t,E=y*e+v*t;let w=1/((x-b)*(x-b)+(E-T)*(E-T))-.25;w<0&&(w=0);let I=Math.sqrt(w);s==r&&(I=-I);const A=.5*(b+x)-I*(E-T),S=.5*(T+E)+I*(x-b),C=Math.atan2(T-S,b-A);let O=Math.atan2(E-S,x-A)-C;O<0&&1===s?O+=OU:O>0&&0===s&&(O-=OU);const M=Math.ceil(Math.abs(O/(CU+.001))),k=[];for(let e=0;e<M;++e){const t=C+e*O/M,r=C+(e+1)*O/M;k[e]=[A,S,t,r,n,i,d,h]}return kU[u]=k}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let t=0;t<r.length;++t){const n=DU(r[t]);e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}const $U=.5773502691896257,UU={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,OU)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n,r=i-n*$U,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n,r=i-n*$U;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=MU*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function VU(e){return ut(UU,e)?UU[e]:function(e){if(!ut(zU,e)){const t=AU(e);zU[e]={draw:function(e,n){PU(e,t,0,0,Math.sqrt(n)/2)}}}return zU[e]}(e)}var zU={};const jU=.448084975506;function YU(e){return e.x}function GU(e){return e.y}function HU(e){return e.width}function WU(e){return e.height}function XU(e){return"function"==typeof e?e:()=>+e}function qU(e,t,n){return Math.max(t,Math.min(e,n))}function KU(){var e=YU,t=GU,n=HU,i=WU,r=XU(0),s=r,o=r,a=r,l=null;function u(u,c,d){var h,p=null!=c?c:+e.call(this,u),f=null!=d?d:+t.call(this,u),m=+n.call(this,u),g=+i.call(this,u),_=Math.min(m,g)/2,y=qU(+r.call(this,u),0,_),v=qU(+s.call(this,u),0,_),b=qU(+o.call(this,u),0,_),T=qU(+a.call(this,u),0,_);if(l||(l=h=YB()),y<=0&&v<=0&&b<=0&&T<=0)l.rect(p,f,m,g);else{var x=p+m,E=f+g;l.moveTo(p+y,f),l.lineTo(x-v,f),l.bezierCurveTo(x-jU*v,f,x,f+jU*v,x,f+v),l.lineTo(x,E-T),l.bezierCurveTo(x,E-jU*T,x-jU*T,E,x-T,E),l.lineTo(p+b,E),l.bezierCurveTo(p+jU*b,E,p,E-jU*b,p,E-b),l.lineTo(p,f+y),l.bezierCurveTo(p,f+jU*y,p+jU*y,f,p+y,f),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(t){return arguments.length?(e=XU(t),u):e},u.y=function(e){return arguments.length?(t=XU(e),u):t},u.width=function(e){return arguments.length?(n=XU(e),u):n},u.height=function(e){return arguments.length?(i=XU(e),u):i},u.cornerRadius=function(e,t,n,i){return arguments.length?(r=XU(e),s=null!=t?XU(t):r,a=null!=n?XU(n):r,o=null!=i?XU(i):s,u):r},u.context=function(e){return arguments.length?(l=null==e?null:e,u):l},u}function ZU(){var e,t,n,i,r,s,o,a,l=null;function u(e,t,n){const i=n/2;if(r){var u=o-t,c=e-s;if(u||c){var d=Math.sqrt(u*u+c*c),h=(u/=d)*a,p=(c/=d)*a,f=Math.atan2(c,u);l.moveTo(s-h,o-p),l.lineTo(e-u*i,t-c*i),l.arc(e,t,i,f-Math.PI,f),l.lineTo(s+h,o+p),l.arc(s,o,a,f,f+Math.PI)}else l.arc(e,t,i,0,OU);l.closePath()}else r=1;s=e,o=t,a=i}function c(s){var o,a,c,d=s.length,h=!1;for(null==l&&(l=c=YB()),o=0;o<=d;++o)!(o<d&&i(a=s[o],o,s))===h&&(h=!h)&&(r=0),h&&u(+e(a,o,s),+t(a,o,s),+n(a,o,s));if(c)return l=null,c+""||null}return c.x=function(t){return arguments.length?(e=t,c):e},c.y=function(e){return arguments.length?(t=e,c):t},c.size=function(e){return arguments.length?(n=e,c):n},c.defined=function(e){return arguments.length?(i=e,c):i},c.context=function(e){return arguments.length?(l=null==e?null:e,c):l},c}function QU(e,t){return null!=e?e:t}const JU=e=>e.x||0,eV=e=>e.y||0,tV=e=>!(!1===e.defined),nV=function(){var e=HB,t=WB,n=GB(0),i=null,r=XB,s=qB,o=KB,a=null;function l(){var l,u,c=+e.apply(this,arguments),d=+t.apply(this,arguments),h=r.apply(this,arguments)-mB,p=s.apply(this,arguments)-mB,f=oB(p-h),m=p>h;if(a||(a=l=YB()),d<c&&(u=d,d=c,c=u),d>pB)if(f>gB-pB)a.moveTo(d*lB(h),d*dB(h)),a.arc(0,0,d,h,p,!m),c>pB&&(a.moveTo(c*lB(p),c*dB(p)),a.arc(0,0,c,p,h,m));else{var g,_,y=h,v=p,b=h,T=p,x=f,E=f,w=o.apply(this,arguments)/2,I=w>pB&&(i?+i.apply(this,arguments):hB(c*c+d*d)),A=cB(oB(d-c)/2,+n.apply(this,arguments)),S=A,C=A;if(I>pB){var O=_B(I/c*dB(w)),M=_B(I/d*dB(w));(x-=2*O)>pB?(b+=O*=m?1:-1,T-=O):(x=0,b=T=(h+p)/2),(E-=2*M)>pB?(y+=M*=m?1:-1,v-=M):(E=0,y=v=(h+p)/2)}var k=d*lB(y),R=d*dB(y),N=c*lB(T),D=c*dB(T);if(A>pB){var F,L=d*lB(v),P=d*dB(v),B=c*lB(b),$=c*dB(b);if(f<fB&&(F=function(e,t,n,i,r,s,o,a){var l=n-e,u=i-t,c=o-r,d=a-s,h=d*l-c*u;if(!(h*h<pB))return[e+(h=(c*(t-s)-d*(e-r))/h)*l,t+h*u]}(k,R,B,$,L,P,N,D))){var U=k-F[0],V=R-F[1],z=L-F[0],j=P-F[1],Y=1/dB(function(e){return e>1?0:e<-1?fB:Math.acos(e)}((U*z+V*j)/(hB(U*U+V*V)*hB(z*z+j*j)))/2),G=hB(F[0]*F[0]+F[1]*F[1]);S=cB(A,(c-G)/(Y-1)),C=cB(A,(d-G)/(Y+1))}}E>pB?C>pB?(g=ZB(B,$,k,R,d,C,m),_=ZB(L,P,N,D,d,C,m),a.moveTo(g.cx+g.x01,g.cy+g.y01),C<A?a.arc(g.cx,g.cy,C,aB(g.y01,g.x01),aB(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,C,aB(g.y01,g.x01),aB(g.y11,g.x11),!m),a.arc(0,0,d,aB(g.cy+g.y11,g.cx+g.x11),aB(_.cy+_.y11,_.cx+_.x11),!m),a.arc(_.cx,_.cy,C,aB(_.y11,_.x11),aB(_.y01,_.x01),!m))):(a.moveTo(k,R),a.arc(0,0,d,y,v,!m)):a.moveTo(k,R),c>pB&&x>pB?S>pB?(g=ZB(N,D,L,P,c,-S,m),_=ZB(k,R,B,$,c,-S,m),a.lineTo(g.cx+g.x01,g.cy+g.y01),S<A?a.arc(g.cx,g.cy,S,aB(g.y01,g.x01),aB(_.y01,_.x01),!m):(a.arc(g.cx,g.cy,S,aB(g.y01,g.x01),aB(g.y11,g.x11),!m),a.arc(0,0,c,aB(g.cy+g.y11,g.cx+g.x11),aB(_.cy+_.y11,_.cx+_.x11),m),a.arc(_.cx,_.cy,S,aB(_.y11,_.x11),aB(_.y01,_.x01),!m))):a.arc(0,0,c,T,b,m):a.lineTo(N,D)}else a.moveTo(0,0);if(a.closePath(),l)return a=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-fB/2;return[lB(i)*n,dB(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:GB(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:GB(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:GB(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:GB(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:GB(+e),l):r},l.endAngle=function(e){return arguments.length?(s="function"==typeof e?e:GB(+e),l):s},l.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:GB(+e),l):o},l.context=function(e){return arguments.length?(a=null==e?null:e,l):a},l}().startAngle(e=>e.startAngle||0).endAngle(e=>e.endAngle||0).padAngle(e=>e.padAngle||0).innerRadius(e=>e.innerRadius||0).outerRadius(e=>e.outerRadius||0).cornerRadius(e=>e.cornerRadius||0),iV=n$().x(JU).y1(eV).y0(e=>(e.y||0)+(e.height||0)).defined(tV),rV=n$().y(eV).x1(JU).x0(e=>(e.x||0)+(e.width||0)).defined(tV),sV=t$().x(JU).y(eV).defined(tV),oV=KU().x(JU).y(eV).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>QU(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>QU(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>QU(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>QU(e.cornerRadiusBottomLeft,e.cornerRadius)||0),aV=function(e,t){var n=null;function i(){var i;if(n||(n=i=YB()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return e="function"==typeof e?e:GB(e||i$),t="function"==typeof t?t:GB(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:GB(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:GB(+e),i):t},i.context=function(e){return arguments.length?(n=null==e?null:e,i):n},i}().type(e=>VU(e.shape||"circle")).size(e=>QU(e.size,64)),lV=ZU().x(JU).y(eV).defined(tV).size(e=>e.size||1);function uV(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function cV(e,t,n,i){return oV.context(e)(t,n,i)}var dV=1;function hV(){dV=1}function pV(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+dV++),o=r.clipping[s]||(r.clipping[s]={id:s});return Ke(i)?o.path=i(null):uV(n)?o.path=cV(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function fV(e){this.clear(),e&&this.union(e)}function mV(e){this.mark=e,this.bounds=this.bounds||new fV}function gV(e){mV.call(this,e),this.items=this.items||[]}function _V(e){this._pending=0,this._loader=e||mU()}function yV(e){e._pending+=1}function vV(e){e._pending-=1}function bV(e,t,n){if(t.stroke&&0!==t.opacity&&0!==t.strokeOpacity){const i=null!=t.strokeWidth?+t.strokeWidth:1;e.expand(i+(n?function(e,t){return e.strokeJoin&&"miter"!==e.strokeJoin?0:t}(t,i):0))}return e}fV.prototype={clone(){return new fV(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*o+u,l*i+a*o+c,a*s-l*r+u,l*s+a*r+c,a*s-l*o+u,l*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},pt(gV,mV),_V.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return yV(t),t._loader.sanitize(e,{context:"href"}).then(e=>(vV(t),e)).catch(()=>(vV(t),null))},loadImage(e){const t=this,n=xp();return yV(t),t._loader.sanitize(e,{context:"image"}).then(e=>{const i=e.href;if(!i||!n)throw{url:i};const r=new n,s=ut(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=s&&(r.crossOrigin=s),r.onload=()=>vV(t),r.onerror=()=>vV(t),r.src=i,r}).catch(e=>(vV(t),{complete:!1,width:0,height:0,src:e&&e.url||""}))},ready(){const e=this;return new Promise(t=>{!function n(i){e.pending()?setTimeout(()=>{n(!0)},10):t(i)}(!1)})}};const TV=OU-1e-8;let xV,EV,wV,IV,AV,SV,CV,OV;const MV=(e,t)=>xV.add(e,t),kV=(e,t)=>MV(EV=e,wV=t),RV=e=>MV(e,xV.y1),NV=e=>MV(xV.x1,e),DV=(e,t)=>AV*e+CV*t,FV=(e,t)=>SV*e+OV*t,LV=(e,t)=>MV(DV(e,t),FV(e,t)),PV=(e,t)=>kV(DV(e,t),FV(e,t));function BV(e,t){return xV=e,t?(IV=t*SU,AV=OV=Math.cos(IV),SV=Math.sin(IV),CV=-SV):(AV=OV=1,IV=SV=CV=0),$V}const $V={beginPath(){},closePath(){},moveTo:PV,lineTo:PV,rect(e,t,n,i){IV?(LV(e+n,t),LV(e+n,t+i),LV(e,t+i),PV(e,t)):(MV(e+n,t+i),kV(e,t))},quadraticCurveTo(e,t,n,i){const r=DV(e,t),s=FV(e,t),o=DV(n,i),a=FV(n,i);UV(EV,r,o,RV),UV(wV,s,a,NV),kV(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=DV(e,t),a=FV(e,t),l=DV(n,i),u=FV(n,i),c=DV(r,s),d=FV(r,s);VV(EV,o,l,c,RV),VV(wV,a,u,d,NV),kV(c,d)},arc(e,t,n,i,r,s){if(i+=IV,r+=IV,EV=n*Math.cos(r)+e,wV=n*Math.sin(r)+t,Math.abs(r-i)>TV)MV(e-n,t-n),MV(e+n,t+n);else{const o=i=>MV(n*Math.cos(i)+e,n*Math.sin(i)+t);let a,l;if(o(i),o(r),r!==i)if((i%=OU)<0&&(i+=OU),(r%=OU)<0&&(r+=OU),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=OU,a=i-i%CU,l=0;l<4&&a>r;++l,a-=CU)o(a);else for(a=i-i%CU+CU,l=0;l<4&&a<r;++l,a+=CU)o(a)}}};function UV(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function VV(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let l,u=0,c=0;Math.abs(s)>1e-14?(l=o*o+a*s,l>=0&&(l=Math.sqrt(l),u=(-o+l)/s,c=(-o-l)/s)):u=.5*a/o,0<u&&u<1&&r(zV(u,e,t,n,i)),0<c&&c<1&&r(zV(c,e,t,n,i))}function zV(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var jV=(jV=Tp(1,1))?jV.getContext("2d"):null;const YV=new fV;function GV(e){return function(t,n){if(!jV)return!0;e(jV,t),YV.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=YV;for(let e=r;e<=o;++e)for(let t=i;t<=s;++t)if(jV.isPointInPath(t,e))return!0;return!1}}function HV(e,t){return t.contains(e.x||0,e.y||0)}function WV(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(YV.set(n,i,n+r,i+s))}function XV(e,t){const n=e.x||0,i=e.y||0;return qV(t,n,i,null!=e.x2?e.x2:n,null!=e.y2?e.y2:i)}function qV(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:l}=e,u=i-t,c=r-n;let d,h,p,f,m=0,g=1;for(f=0;f<4;++f){if(0===f&&(d=-u,h=-(s-t)),1===f&&(d=u,h=a-t),2===f&&(d=-c,h=-(o-n)),3===f&&(d=c,h=l-n),Math.abs(d)<1e-10&&h<0)return!1;if(p=h/d,d<0){if(p>g)return!1;p>m&&(m=p)}else if(d>0){if(p<m)return!1;p<g&&(g=p)}}return!0}function KV(e,t){e.globalCompositeOperation=t.blend||"source-over"}function ZV(e,t){return null==e?t:e}function QV(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function JV(e,t,n){return yU(n)?function(e,t,n){const i=n.width(),r=n.height();let s;if("radial"===t.gradient)s=e.createRadialGradient(n.x1+ZV(t.x1,.5)*i,n.y1+ZV(t.y1,.5)*r,Math.max(i,r)*ZV(t.r1,0),n.x1+ZV(t.x2,.5)*i,n.y1+ZV(t.y2,.5)*r,Math.max(i,r)*ZV(t.r2,.5));else{const o=ZV(t.x1,0),a=ZV(t.y1,0),l=ZV(t.x2,1),u=ZV(t.y2,0);if(o!==l&&a!==u&&i!==r){const n=Tp(Math.ceil(i),Math.ceil(r)),s=n.getContext("2d");return s.scale(i,r),s.fillStyle=QV(s.createLinearGradient(o,a,l,u),t.stops),s.fillRect(0,0,i,r),e.createPattern(n,"no-repeat")}s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+l*i,n.y1+u*r)}return QV(s,t.stops)}(e,n,t.bounds):n}function ez(e,t,n){return(n*=null==t.fillOpacity?1:t.fillOpacity)>0&&(e.globalAlpha=n,e.fillStyle=JV(e,t,t.fill),!0)}var tz=[];function nz(e,t,n){var i=null!=(i=t.strokeWidth)?i:1;return!(i<=0)&&((n*=null==t.strokeOpacity?1:t.strokeOpacity)>0&&(e.globalAlpha=n,e.strokeStyle=JV(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||tz),e.lineDashOffset=t.strokeDashOffset||0),!0))}function iz(e,t){return e.zindex-t.zindex||e.index-t.index}function rz(e){if(!e.zdirty)return e.zitems;var t,n,i,r=e.items,s=[];for(n=0,i=r.length;n<i;++n)(t=r[n]).index=n,t.zindex&&s.push(t);return e.zdirty=!1,e.zitems=s.sort(iz)}function sz(e,t){var n,i,r=e.items;if(!r||!r.length)return;const s=rz(e);if(s&&s.length){for(n=0,i=r.length;n<i;++n)r[n].zindex||t(r[n]);r=s}for(n=0,i=r.length;n<i;++n)t(r[n])}function oz(e,t){var n,i,r=e.items;if(!r||!r.length)return null;const s=rz(e);for(s&&s.length&&(r=s),i=r.length;--i>=0;)if(n=t(r[i]))return n;if(r===s)for(i=(r=e.items).length;--i>=0;)if(!r[i].zindex&&(n=t(r[i])))return n;return null}function az(e){return function(t,n,i){sz(n,n=>{i&&!i.intersects(n.bounds)||uz(e,t,n,n)})}}function lz(e){return function(t,n,i){!n.items.length||i&&!i.intersects(n.bounds)||uz(e,t,n.items[0],n.items)}}function uz(e,t,n,i){var r=null==n.opacity?1:n.opacity;0!==r&&(e(t,i)||(KV(t,n),n.fill&&ez(t,n,r)&&t.fill(),n.stroke&&nz(t,n,r)&&t.stroke()))}function cz(e){return e=e||fe,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,oz(n,n=>{const a=n.bounds;if((!a||a.contains(s,o))&&a)return e(t,n,i,r,s,o)?n:void 0})}}function dz(e,t){return function(n,i,r,s){var o,a,l=Array.isArray(i)?i[0]:i,u=null==t?l.fill:t,c=l.stroke&&n.isPointInStroke;return c&&(o=l.strokeWidth,a=l.strokeCap,n.lineWidth=null!=o?o:1,n.lineCap=null!=a?a:"butt"),!e(n,i)&&(u&&n.isPointInPath(r,s)||c&&n.isPointInStroke(r,s))}}function hz(e){return cz(dz(e))}function pz(e,t){return"translate("+e+","+t+")"}function fz(e){return"rotate("+e+")"}function mz(e){return pz(e.x||0,e.y||0)}function gz(e,t,n){function i(e,n){var i=n.x||0,r=n.y||0,s=n.angle||0;e.translate(i,r),s&&e.rotate(s*=SU),e.beginPath(),t(e,n),s&&e.rotate(-s),e.translate(-i,-r)}return{type:e,tag:"path",nested:!1,attr:function(e,n){e("transform",function(e){return pz(e.x||0,e.y||0)+(e.angle?" "+fz(e.angle):"")}(n)),e("d",t(null,n))},bound:function(e,n){return t(BV(e,n.angle),n),bV(e,n).translate(n.x||0,n.y||0)},draw:az(i),pick:hz(i),isect:n||GV(i)}}var _z=gz("arc",function(e,t){return nV.context(e)(t)});function yz(e,t,n){function i(e,n){e.beginPath(),t(e,n)}const r=dz(i);return{type:e,tag:"path",nested:!0,attr:function(e,n){var i=n.mark.items;i.length&&e("d",t(null,i))},bound:function(e,n){var i=n.items;return 0===i.length?e:(t(BV(e),i),bV(e,i[0]))},draw:lz(i),pick:function(e,t,n,i,s,o){var a=t.items,l=t.bounds;return!a||!a.length||l&&!l.contains(s,o)?null:(n*=e.pixelRatio,i*=e.pixelRatio,r(e,a,n,i)?a[0]:null)},isect:HV,tip:n}}var vz=yz("area",function(e,t){const n=t[0],i=n.interpolate||"linear";return("horizontal"===n.orient?rV:iV).curve(EU(i,n.orient,n.tension)).context(e)(t)},function(e,t){for(var n,i,r="horizontal"===e[0].orient?t[1]:t[0],s="horizontal"===e[0].orient?"y":"x",o=e.length,a=1/0;--o>=0;)!1!==e[o].defined&&(i=Math.abs(e[o][s]-r))<a&&(a=i,n=e[o]);return n});function bz(e,t){e.beginPath(),uV(t)?cV(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function Tz(e){const t=ZV(e.strokeWidth,1);return null!=e.strokeOffset?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function xz(e,t){const n=Tz(t);e("d",cV(null,t,n,n))}function Ez(e,t,n,i){const r=Tz(t);e.beginPath(),cV(e,t,(n||0)+r,(i||0)+r)}const wz=dz(Ez),Iz=dz(Ez,!1),Az=dz(Ez,!0);var Sz={type:"group",tag:"g",nested:!1,attr:function(e,t){e("transform",mz(t))},bound:function(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let t=0;t<i;++t)e.union(n[t].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),bV(e,t),e.translate(t.x||0,t.y||0)},draw:function(e,t,n){sz(t,t=>{const i=t.x||0,r=t.y||0,s=t.strokeForeground,o=null==t.opacity?1:t.opacity;(t.stroke||t.fill)&&o&&(Ez(e,t,i,r),KV(e,t),t.fill&&ez(e,t,o)&&e.fill(),t.stroke&&!s&&nz(e,t,o)&&e.stroke()),e.save(),e.translate(i,r),t.clip&&bz(e,t),n&&n.translate(-i,-r),sz(t,t=>{this.draw(e,t,n)}),n&&n.translate(i,r),e.restore(),s&&t.stroke&&o&&(Ez(e,t,i,r),KV(e,t),nz(e,t,o)&&e.stroke())})},pick:function(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return oz(t,l=>{let u,c,d;const h=l.bounds;if(h&&!h.contains(r,s))return;c=l.x||0,d=l.y||0;const p=c+(l.width||0),f=d+(l.height||0),m=l.clip;if(m&&(r<c||r>p||s<d||s>f))return;if(e.save(),e.translate(c,d),c=r-c,d=s-d,m&&uV(l)&&!Az(e,l,o,a))return e.restore(),null;const g=l.strokeForeground,_=!1!==t.interactive;return _&&g&&l.stroke&&Iz(e,l,o,a)?(e.restore(),l):(u=oz(l,e=>function(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,c,d)?this.pick(e,n,i,c,d):null),!u&&_&&(l.fill||!g&&l.stroke)&&wz(e,l,o,a)&&(u=l),e.restore(),u||null)})},isect:WV,content:function(e,t,n){e("clip-path",t.clip?pV(n,t,t):null)},background:function(e,t){e("class","background"),e("aria-hidden",!0),xz(e,t)},foreground:function(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?xz(e,t):e("d","")}},Cz={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Oz(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(t=>{e.image=t,e.image.url=e.url})),n}function Mz(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function kz(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function Rz(e,t){return"center"===e?t/2:"right"===e?t:0}function Nz(e,t){return"middle"===e?t/2:"bottom"===e?t:0}var Dz={type:"image",tag:"image",nested:!1,attr:function(e,t,n){const i=Oz(t,n),r=Mz(t,i),s=kz(t,i),o=(t.x||0)-Rz(t.align,r),a=(t.y||0)-Nz(t.baseline,s);e("href",!i.src&&i.toDataURL?i.toDataURL():i.src||"",Cz["xmlns:xlink"],"xlink:href"),e("transform",pz(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function(e,t){const n=t.image,i=Mz(t,n),r=kz(t,n),s=(t.x||0)-Rz(t.align,i),o=(t.y||0)-Nz(t.baseline,r);return e.set(s,o,s+i,o+r)},draw:function(e,t,n){sz(t,t=>{if(n&&!n.intersects(t.bounds))return;const i=Oz(t,this);let r=Mz(t,i),s=kz(t,i);if(0===r||0===s)return;let o,a,l,u,c=(t.x||0)-Rz(t.align,r),d=(t.y||0)-Nz(t.baseline,s);!1!==t.aspect&&(a=i.width/i.height,l=t.width/t.height,a==a&&l==l&&a!==l&&(l<a?(u=r/a,d+=(s-u)/2,s=u):(u=s*a,c+=(r-u)/2,r=u))),(i.complete||i.toDataURL)&&(KV(e,t),e.globalAlpha=null!=(o=t.opacity)?o:1,e.imageSmoothingEnabled=!1!==t.smooth,e.drawImage(i,c,d,r,s))})},pick:cz(),isect:fe,get:Oz,xOffset:Rz,yOffset:Nz},Fz=yz("line",function(e,t){const n=t[0],i=n.interpolate||"linear";return sV.curve(EU(i,n.orient,n.tension)).context(e)(t)},function(e,t){for(var n,i,r=Math.pow(e[0].strokeWidth||1,2),s=e.length;--s>=0;)if(!1!==e[s].defined&&(n=e[s].x-t[0])*n+(i=e[s].y-t[1])*i<r)return e[s];return null});function Lz(e,t){var n=t.path;if(null==n)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*SU,l=t.pathCache;l&&l.path===n||((t.pathCache=l=AU(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),PU(e,l,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):PU(e,l,i,r,s,o)}var Pz={type:"path",tag:"path",nested:!1,attr:function(e,t){var n=t.scaleX||1,i=t.scaleY||1;1===n&&1===i||e("vector-effect","non-scaling-stroke"),e("transform",function(e){return pz(e.x||0,e.y||0)+(e.angle?" "+fz(e.angle):"")+(e.scaleX||e.scaleY?" "+function(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}(t)),e("d",t.path)},bound:function(e,t){return Lz(BV(e,t.angle),t)?e.set(0,0,0,0):bV(e,t,!0)},draw:az(Lz),pick:hz(Lz),isect:GV(Lz)};function Bz(e,t){e.beginPath(),cV(e,t)}var $z={type:"rect",tag:"path",nested:!1,attr:function(e,t){e("d",cV(null,t))},bound:function(e,t){var n,i;return bV(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)},draw:az(Bz),pick:hz(Bz),isect:WV};function Uz(e,t,n){var i,r,s,o;return!(!t.stroke||!nz(e,t,n))&&(i=t.x||0,r=t.y||0,s=null!=t.x2?t.x2:i,o=null!=t.y2?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0)}var Vz={type:"rule",tag:"line",nested:!1,attr:function(e,t){e("transform",mz(t)),e("x2",null!=t.x2?t.x2-(t.x||0):0),e("y2",null!=t.y2?t.y2-(t.y||0):0)},bound:function(e,t){var n,i;return bV(e.set(n=t.x||0,i=t.y||0,null!=t.x2?t.x2:n,null!=t.y2?t.y2:i),t)},draw:function(e,t,n){sz(t,t=>{if(!n||n.intersects(t.bounds)){var i=null==t.opacity?1:t.opacity;i&&Uz(e,t,i)&&(KV(e,t),e.stroke())}})},pick:cz(function(e,t,n,i){return!!e.isPointInStroke&&(Uz(e,t,1)&&e.isPointInStroke(n,i))}),isect:XV},zz=gz("shape",function(e,t){return(t.mark.shape||t.shape).context(e)(t)}),jz=gz("symbol",function(e,t){return aV.context(e)(t)},HV);const Yz=wt();var Gz={height:Zz,measureWidth:qz,estimateWidth:Wz,width:Wz,canvas:Hz};function Hz(e){Gz.width=e&&jV?qz:Wz}function Wz(e,t){return Xz(tj(e,t),Zz(e))}function Xz(e,t){return~~(.8*e.length*t)}function qz(e,t){return Zz(e)<=0||!(t=tj(e,t))?0:Kz(t,ij(e))}function Kz(e,t){const n=`(${t}) ${e}`;let i=Yz.get(n);return void 0===i&&(jV.font=t,i=jV.measureText(e).width,Yz.set(n,i)),i}function Zz(e){return null!=e.fontSize?+e.fontSize||0:11}function Qz(e){return null!=e.lineHeight?e.lineHeight:Zz(e)+2}function Jz(e){return t=e.lineBreak&&e.text&&!Ee(e.text)?e.text.split(e.lineBreak):e.text,Ee(t)?t.length>1?t:t[0]:t;var t}function ej(e){const t=Jz(e);return(Ee(t)?t.length-1:0)*Qz(e)}function tj(e,t){const n=null==t?"":(t+"").trim();return e.limit>0&&n.length?function(e,t){var n=+e.limit,i=function(e){if(Gz.width===qz){const t=ij(e);return e=>Kz(e,t)}{const t=Zz(e);return e=>Xz(e,t)}}(e);if(i(t)<n)return t;var r,s=e.ellipsis||"…",o="rtl"===e.dir,a=0,l=t.length;if(n-=i(s),o){for(;a<l;)r=a+l>>>1,i(t.slice(r))>n?a=r+1:l=r;return s+t.slice(a)}for(;a<l;)r=1+(a+l>>>1),i(t.slice(0,r))<n?a=r:l=r-1;return t.slice(0,a)+s}(e,n):n}function nj(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function ij(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+Zz(e)+"px "+nj(e,t)}function rj(e){var t=e.baseline,n=Zz(e);return Math.round("top"===t?.79*n:"middle"===t?.3*n:"bottom"===t?-.21*n:"line-top"===t?.29*n+.5*Qz(e):"line-bottom"===t?.29*n-.5*Qz(e):0)}Hz(!0);const sj={left:"start",center:"middle",right:"end"},oj=new fV;function aj(e){var t,n=e.x||0,i=e.y||0,r=e.radius||0;return r&&(t=(e.theta||0)-CU,n+=r*Math.cos(t),i+=r*Math.sin(t)),oj.x1=n,oj.y1=i,oj}function lj(e,t,n){var i,r=Gz.height(t),s=t.align,o=aj(t),a=o.x1,l=o.y1,u=t.dx||0,c=(t.dy||0)+rj(t)-Math.round(.8*r),d=Jz(t);if(Ee(d)?(r+=Qz(t)*(d.length-1),i=d.reduce((e,n)=>Math.max(e,Gz.width(t,n)),0)):i=Gz.width(t,d),"center"===s?u-=i/2:"right"===s&&(u-=i),e.set(u+=a,c+=l,u+i,c+r),t.angle&&!n)e.rotate(t.angle*SU,a,l);else if(2===n)return e.rotatedPoints(t.angle*SU,a,l);return e}var uj={type:"text",tag:"text",nested:!1,attr:function(e,t){var n,i=t.dx||0,r=(t.dy||0)+rj(t),s=aj(t),o=s.x1,a=s.y1,l=t.angle||0;e("text-anchor",sj[t.align]||"start"),l?(n=pz(o,a)+" "+fz(l),(i||r)&&(n+=" "+pz(i,r))):n=pz(o+i,a+r),e("transform",n)},bound:lj,draw:function(e,t,n){sz(t,t=>{var i,r,s,o,a,l,u,c=null==t.opacity?1:t.opacity;if(!(n&&!n.intersects(t.bounds)||0===c||t.fontSize<=0||null==t.text||0===t.text.length)){if(e.font=ij(t),e.textAlign=t.align||"left",r=(i=aj(t)).x1,s=i.y1,t.angle&&(e.save(),e.translate(r,s),e.rotate(t.angle*SU),r=s=0),r+=t.dx||0,s+=(t.dy||0)+rj(t),l=Jz(t),KV(e,t),Ee(l))for(a=Qz(t),o=0;o<l.length;++o)u=tj(t,l[o]),t.fill&&ez(e,t,c)&&e.fillText(u,r,s),t.stroke&&nz(e,t,c)&&e.strokeText(u,r,s),s+=a;else u=tj(t,l),t.fill&&ez(e,t,c)&&e.fillText(u,r,s),t.stroke&&nz(e,t,c)&&e.strokeText(u,r,s);t.angle&&e.restore()}})},pick:cz(function(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=aj(t),a=o.x1,l=o.y1,u=lj(oj,t,1),c=-t.angle*SU,d=Math.cos(c),h=Math.sin(c),p=d*r-h*s+(a-d*a+h*l),f=h*r+d*s+(l-h*a-d*l);return u.contains(p,f)}),isect:function(e,t){const n=lj(oj,e,2);return qV(t,n[0],n[1],n[2],n[3])||qV(t,n[0],n[1],n[4],n[5])||qV(t,n[4],n[5],n[6],n[7])||qV(t,n[2],n[3],n[6],n[7])}},cj=yz("trail",function(e,t){return lV.context(e)(t)},function(e,t){for(var n,i,r=e.length;--r>=0;)if(!1!==e[r].defined&&(n=e[r].x-t[0])*n+(i=e[r].y-t[1])*i<(n=e[r].size||1)*n)return e[r];return null}),dj={arc:_z,area:vz,group:Sz,image:Dz,line:Fz,path:Pz,rect:$z,rule:Vz,shape:zz,symbol:jz,text:uj,trail:cj};function hj(e,t,n){var i=dj[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new fV),e,n)}var pj={mark:null};function fj(e,t,n){var i,r,s,o,a=dj[e.marktype],l=a.bound,u=e.items,c=u&&u.length;if(a.nested)return c?s=u[0]:(pj.mark=e,s=pj),o=hj(s,l,n),t=t&&t.union(o)||o;if(t=t||e.bounds&&e.bounds.clear()||new fV,c)for(i=0,r=u.length;i<r;++i)t.union(hj(u[i],l,n));return e.bounds=t}const mj=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function gj(e,t){return JSON.stringify(e,mj,t)}function _j(e){return yj("string"==typeof e?JSON.parse(e):e)}function yj(e){var t,n,i,r=e.marktype,s=e.items;if(s)for(n=0,i=s.length;n<i;++n)t=r?"mark":"group",s[n][t]=e,s[n].zindex&&(s[n][t].zdirty=!0),"group"===(r||t)&&yj(s[n]);return r&&fj(e),e}function vj(e){arguments.length?this.root=_j(e):(this.root=bj({marktype:"group",name:"root",role:"frame"}),this.root.items=[new gV(this.root)])}function bj(e,t){const n={bounds:new fV,clip:!!e.clip,group:t,interactive:!1!==e.interactive,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return null!=e.aria&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Tj(e,t,n){return!e&&"undefined"!=typeof document&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function xj(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function Ej(e,t,n,i){var r,s=e.childNodes[t];return s&&s.tagName.toLowerCase()===n.toLowerCase()||(r=s||null,s=Tj(e.ownerDocument,n,i),e.insertBefore(s,r)),s}function wj(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function Ij(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Aj(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Sj(e,t){this._active=null,this._handlers={},this._loader=e||mU(),this._tooltip=t||Cj}function Cj(e,t,n,i){e.element().setAttribute("title",i||"")}function Oj(e){this._el=null,this._bgcolor=null,this._loader=new _V(e)}vj.prototype={toJSON(e){return gj(this.root,e||0)},mark(e,t,n){const i=bj(e,t=t||this.root.items[0]);return t.items[n]=i,i.zindex&&(i.group.zdirty=!0),i}},Sj.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let i=e?e.length:0;--i>=0;)if(e[i].type===t&&(!n||e[i].handler===n))return i;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const e in t)n.push(...t[e]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(t=>{const n=new MouseEvent(e.type,e),i=Tj(null,"a");for(const e in t)i.setAttribute(e,t[e]);i.dispatchEvent(n)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&null!=t.tooltip){t=function(e,t,n,i){var r,s,o=e&&e.mark;if(o&&(r=dj[o.marktype]).tip){for((s=Aj(t,n))[0]-=i[0],s[1]-=i[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=r.tip(o.items,s)}return e}(t,e,this.canvas(),this._origin);const i=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,i)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),i=this._origin,r=e.bounds,s=r.width(),o=r.height();let a=r.x1+i[0]+n.left,l=r.y1+i[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:s,height:o,left:a,top:l,right:a+s,bottom:l+o}}},Oj.prototype={initialize(e,t,n,i,r){return this._el=e,this.resize(t,n,i,r)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,i){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=i||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,i=n._loader[e](t);if(!n._ready){const e=n._call;n._ready=n._loader.ready().then(t=>{t&&e(),n._ready=null})}return i},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Mj="dragenter",kj="dragleave",Rj="dragover",Nj="mousedown",Dj="mousemove",Fj="mouseout",Lj="mouseover",Pj="click",Bj="mousewheel",$j="touchstart",Uj="touchmove",Vj="touchend",zj=["keydown","keypress","keyup",Mj,kj,Rj,Nj,"mouseup",Dj,Fj,Lj,Pj,"dblclick","wheel",Bj,$j,Uj,Vj],jj=Dj,Yj=Fj,Gj=Pj;function Hj(e,t){Sj.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function Wj(e,t){(e=>e===$j||e===Uj||e===Vj?[$j,Uj,Vj]:[e])(t).forEach(t=>function(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?n=>e[t](n):n=>e.fire(t,n)))}(e,t))}function Xj(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r||(r&&r.exit||this.fire(n,i),this._active=s,this.fire(t,i)),this.fire(e,i)}}function qj(e){return function(t){this.fire(e,t),this._active=null}}pt(Hj,Sj,{initialize(e,t,n){return this._canvas=e&&xj(e,"canvas"),[Pj,Nj,Dj,Fj,kj].forEach(e=>Wj(this,e)),Sj.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:zj,DOMMouseScroll(e){this.fire(Bj,e)},mousemove:Xj(Dj,Lj,Fj),dragover:Xj(Rj,Mj,kj),mouseout:qj(Fj),dragleave:qj(kj),mousedown(e){this._down=this._active,this.fire(Nj,e)},click(e){this._down===this._active&&(this.fire(Pj,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire($j,e,!0)},touchmove(e){this.fire(Uj,e,!0)},touchend(e){this.fire(Vj,e,!0),this._touch=null},fire(e,t,n){const i=n?this._touch:this._active,r=this._handlers[e];if(t.vegaType=e,e===Gj&&i&&i.href?this.handleHref(t,i,i.href):e!==jj&&e!==Yj||this.handleTooltip(t,i,e!==Yj),r)for(let e=0,n=r.length;e<n;++e)r[e].handler.call(this._obj,t,i)},on(e,t){const n=this.eventName(e),i=this._handlers;return this._handlerIndex(i[n],e,t)<0&&(Wj(this,e),(i[n]||(i[n]=[])).push({type:e,handler:t})),this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&i.splice(r,1),this},pickEvent(e){const t=Aj(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,i,r){const s=this.context();return dj[e.marktype].pick.call(this,s,e,t,n,i,r)}});var Kj="undefined"!=typeof window&&window.devicePixelRatio||1;function Zj(e){Oj.call(this,e),this._options={},this._redraw=!1,this._dirty=new fV,this._tempb=new fV}const Qj=Oj.prototype;function Jj(e,t){Sj.call(this,e,t);const n=this;n._hrefHandler=eY(n,(e,t)=>{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=eY(n,(e,t)=>{n.handleTooltip(e,t,e.type!==Yj)})}pt(Zj,Oj,{initialize(e,t,n,i,r,s){return this._options=s||{},this._canvas=this._options.externalContext?null:Tp(1,1,this._options.type),e&&this._canvas&&(wj(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Qj.initialize.call(this,e,t,n,i,r)},resize(e,t,n,i){if(Qj.resize.call(this,e,t,n,i),this._canvas)!function(e,t,n,i,r,s){const o="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,a=e.getContext("2d"),l=o?Kj:r;e.width=t*l,e.height=n*l;for(const e in s)a[e]=s[e];o&&1!==l&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const e=this._options.externalContext;e||ae("CanvasRenderer is missing a valid canvas or context"),e.scale(this._scale,this._scale),e.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,i=this._width,r=this._height,s=this._dirty,o=((e,t,n)=>(new fV).set(0,0,t,n).translate(-e[0],-e[1]))(n,i,r);t.save();const a=this._redraw||s.empty()?(this._redraw=!1,o.expand(1)):function(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,o.intersect(s),n);return this.clear(-n[0],-n[1],i,r),this.draw(t,e,a),t.restore(),s.clear(),this},draw(e,t,n){const i=dj[t.marktype];t.clip&&function(e,t){var n=t.clip;e.save(),Ke(n)?(e.beginPath(),n(e),e.clip()):bz(e,t.group)}(e,t),i.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,i){const r=this._options,s=this.context();"pdf"===r.type||r.externalContext||s.clearRect(e,t,n,i),null!=this._bgcolor&&(s.fillStyle=this._bgcolor,s.fillRect(e,t,n,i))}});const eY=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)};pt(Jj,Sj,{initialize(e,t,n){let i=this._svg;return i&&(i.removeEventListener(Gj,this._hrefHandler),i.removeEventListener(jj,this._tooltipHandler),i.removeEventListener(Yj,this._tooltipHandler)),this._svg=i=e&&xj(e,"svg"),i&&(i.addEventListener(Gj,this._hrefHandler),i.addEventListener(jj,this._tooltipHandler),i.addEventListener(Yj,this._tooltipHandler)),Sj.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),i=this._handlers;if(this._handlerIndex(i[n],e,t)<0){const r={type:e,handler:t,listener:eY(this,t)};(i[n]||(i[n]=[])).push(r),this._svg&&this._svg.addEventListener(n,r.listener)}return this},off(e,t){const n=this.eventName(e),i=this._handlers[n],r=this._handlerIndex(i,e,t);return r>=0&&(this._svg&&this._svg.removeEventListener(n,i[r].listener),i.splice(r,1)),this}});const tY="aria-hidden",nY="aria-label",iY="role",rY="aria-roledescription",sY="graphics-object",oY="graphics-symbol",aY=(e,t,n)=>({[iY]:e,[rY]:t,[nY]:n||void 0}),lY=Dt(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),uY={axis:{desc:"axis",caption:function(e){const t=e.datum,n=e.orient,i=t.title?fY(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type,l="left"===n||"right"===n?"Y":"X";return`${l}-axis`+(i?` titled '${i}'`:"")+` for a ${BM(a)?"discrete":a} scale`+` with ${yk(o,s,e)}`}},legend:{desc:"legend",caption:function(e){const t=e.datum,n=t.title?fY(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,l=o.dataflow.locale();return function(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(i)+(n?` titled '${n}'`:"")+` for ${function(e){return e=e.map(e=>e+("fill"===e||"stroke"===e?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Oe(e)}(s)}`+` with ${yk(l,a,e)}`}},"title-text":{desc:"title",caption:e=>`Title text '${pY(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${pY(e)}'`}},cY={ariaRole:iY,ariaRoleDescription:rY,description:nY};function dY(e,t){const n=!1===t.aria;if(e(tY,n||void 0),n||null==t.description)for(const t in cY)e(cY[t],void 0);else{const n=t.mark.marktype;e(nY,t.description),e(iY,t.ariaRole||("group"===n?sY:oY)),e(rY,t.ariaRoleDescription||`${n} mark`)}}function hY(e){return!1===e.aria?{[tY]:!0}:lY[e.role]?null:uY[e.role]?function(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return aY(t.role||oY,t.desc,n.description||i(n))}catch(e){return null}}(e,uY[e.role]):function(e){const t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return aY(n?sY:oY,`${t} mark container`,e.description)}(e)}function pY(e){return Xe(e.text).join(" ")}function fY(e){try{return Xe(Oe(e.items).items[0].text).join(" ")}catch(e){return null}}const mY=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),gY=e=>mY(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function _Y(){let e="",t="",n="";const i=[],r=()=>t=n="",s=(e,n)=>(null!=n&&(t+=` ${e}="${gY(n)}"`),o),o={open(a,...l){(s=>{t&&(e+=`${t}>${n}`,r()),i.push(s)})(a),t="<"+a;for(const e of l)for(const t in e)s(t,e[t]);return o},close(){const s=i.pop();return e+=t?t+(n?`>${n}</${s}>`:"/>"):`</${s}>`,r(),o},attr:s,text:e=>(n+=mY(e),o),toString:()=>e};return o}const yY=e=>vY(_Y(),e)+"";function vY(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let t=0;t<i;++t)e.attr(n[t].name,n[t].value)}if(t.hasChildNodes()){const n=t.childNodes,i=n.length;for(let t=0;t<i;t++){const i=n[t];3===i.nodeType?e.text(i.nodeValue):vY(e,i)}}return e.close()}const bY={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity",blend:"mix-blend-mode"},TY={fill:"none","stroke-miterlimit":10},xY="http://www.w3.org/2000/xmlns/",EY=Cz.xmlns;function wY(e){Oj.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const IY=Oj.prototype;function AY(e,t){for(;e&&e.dirty!==t;e=e.mark.group){if(e.dirty=t,!e.mark||e.mark.dirty===t)return;e.mark.dirty=t}}function SY(e,t,n){let i,r,s;if("radial"===t.gradient){let i=Ej(e,n++,"pattern",EY);FY(i,{id:_U+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),i=Ej(i,0,"rect",EY),FY(i,{width:1,height:1,fill:`url(${PY()}#${t.id})`}),FY(e=Ej(e,n++,"radialGradient",EY),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else FY(e=Ej(e,n++,"linearGradient",EY),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=Ej(e,i,"stop",EY),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return wj(e,i),n}function CY(e,t,n){let i;return(e=Ej(e,n,"clipPath",EY)).setAttribute("id",t.id),t.path?(i=Ej(e,0,"path",EY),i.setAttribute("d",t.path)):(i=Ej(e,0,"rect",EY),FY(i,{x:0,y:0,width:t.width,height:t.height})),wj(e,1),n+1}function OY(e,t,n,i,r){let s,o=e._svg;if(!o&&(s=t.ownerDocument,o=Tj(s,i,EY),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},"g"===i))){const t=Tj(s,"path",EY);o.appendChild(t),t.__data__=e;const n=Tj(s,"g",EY);o.appendChild(n),n.__data__=e;const i=Tj(s,"path",EY);o.appendChild(i),i.__data__=e,i.__values__={fill:"default"}}return(o.ownerSVGElement!==r||function(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}pt(wY,Oj,{initialize(e,t,n,i,r){return this._defs={},this._clearDefs(),e&&(this._svg=Ej(e,0,"svg",EY),this._svg.setAttributeNS(xY,"xmlns",EY),this._svg.setAttributeNS(xY,"xmlns:xlink",Cz["xmlns:xlink"]),this._svg.setAttribute("version",Cz.version),this._svg.setAttribute("class","marks"),wj(e,1),this._root=Ej(this._svg,0,"g",EY),FY(this._root,TY),wj(this._svg,1)),this.background(this._bgcolor),IY.initialize.call(this,e,t,n,i,r)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),IY.background.apply(this,arguments)},resize(e,t,n,i){return IY.resize.call(this,e,t,n,i),this._svg&&(FY(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=Ej(e,0,"rect",EY),FY(n,{width:this._width,height:this._height,fill:t}));const i=yY(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),i},_render(e){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e),wj(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,i,r,s,o,a,l;for(o=0,a=e.length;o<a;++o)n=e[o],i=n.mark,i.marktype!==r&&(r=i.marktype,s=dj[r]),i.zdirty&&i.dirty!==t&&(this._dirtyAll=!1,AY(n,t),i.items.forEach(e=>{e.dirty=t})),i.zdirty||(n.exit?(s.nested&&i.items.length?(l=i.items[0],l._svg&&this._update(s,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null):(n=s.nested?i.items[0]:n,n._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(s,n._svg,n):(this._dirtyAll=!1,AY(n,t)),n._update=t)));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const i=this._svg,r=dj[t.marktype],s=!1===t.interactive?"none":null,o="g"===r.tag;let a=null,l=0;const u=OY(t,e,n,"g",i);u.setAttribute("class",Ij(t));const c=hY(t);for(const e in c)LY(u,e,c[e]);o||LY(u,"pointer-events",s),LY(u,"clip-path",t.clip?pV(this,t,t.group):null);const d=e=>{const t=this.isDirty(e),n=OY(e,u,a,r.tag,i);t&&(this._update(r,n,e),o&&function(e,t,n){t=t.lastChild.previousSibling;let i,r=0;sz(n,n=>{i=e.mark(t,n,i),++r}),wj(t,1+r)}(this,n,e)),a=n,++l};return r.nested?t.items.length&&d(t.items[0]):sz(t,d),wj(u,l),u},_update(e,t,n){MY=t,kY=t.__values__,dY(NY,n),e.attr(NY,n,this);const i=RY[e.type];i&&i.call(this,e,t,n),MY&&this.style(MY,n)},style(e,t){if(null!=t)for(const n in bY){let i="font"===n?nj(t):t[n];if(i===kY[n])continue;const r=bY[n];null==i?e.removeAttribute(r):(yU(i)&&(i=vU(i,this._defs.gradient,PY())),e.setAttribute(r,i+"")),kY[n]=i}},defs(){const e=this._svg,t=this._defs;let n=t.el,i=0;for(const r in t.gradient)n||(t.el=n=Ej(e,1,"defs",EY)),i=SY(n,t.gradient[r],i);for(const r in t.clipping)n||(t.el=n=Ej(e,1,"defs",EY)),i=CY(n,t.clipping[r],i);n&&(0===i?(e.removeChild(n),t.el=null):wj(n,i))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});let MY=null,kY=null;const RY={group(e,t,n){const i=MY=t.childNodes[2];kY=i.__values__,e.foreground(NY,n,this),kY=t.__values__,MY=t.childNodes[1],e.content(NY,n,this);const r=MY=t.childNodes[0];e.background(NY,n,this);const s=!1===n.mark.interactive?"none":null;if(s!==kY.events&&(LY(i,"pointer-events",s),LY(r,"pointer-events",s),kY.events=s),n.strokeForeground&&n.stroke){const e=n.fill;LY(i,"display",null),this.style(r,n),LY(r,"stroke",null),e&&(n.fill=null),kY=i.__values__,this.style(i,n),e&&(n.fill=e),MY=null}else LY(i,"display","none")},image(e,t,n){!1===n.smooth?(DY(t,"image-rendering","optimizeSpeed"),DY(t,"image-rendering","pixelated")):DY(t,"image-rendering",null)},text(e,t,n){const i=Jz(n);let r,s,o,a;Ee(i)?(s=i.map(e=>tj(n,e)),r=s.join("\n"),r!==kY.text&&(wj(t,0),o=t.ownerDocument,a=Qz(n),s.forEach((e,i)=>{const r=Tj(o,"tspan",EY);r.__data__=n,r.textContent=e,i&&(r.setAttribute("x",0),r.setAttribute("dy",a)),t.appendChild(r)}),kY.text=r)):(s=tj(n,i),s!==kY.text&&(t.textContent=s,kY.text=s)),LY(t,"font-family",nj(n)),LY(t,"font-size",Zz(n)+"px"),LY(t,"font-style",n.fontStyle),LY(t,"font-variant",n.fontVariant),LY(t,"font-weight",n.fontWeight)}};function NY(e,t,n){t!==kY[e]&&(n?function(e,t,n,i){null!=n?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}(MY,e,t,n):LY(MY,e,t),kY[e]=t)}function DY(e,t,n){n!==kY[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),kY[t]=n)}function FY(e,t){for(const n in t)LY(e,n,t[n])}function LY(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function PY(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function BY(e){Oj.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}pt(BY,Oj,{svg(){return this._text},_render(e){const t=_Y();t.open("svg",st({},Cz,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",TY,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=dj[t.marktype],i=n.tag,r=[dY,n.attr];e.open("g",{class:Ij(t),"clip-path":t.clip?pV(this,t,t.group):null},hY(t),{"pointer-events":"g"!==i&&!1===t.interactive?"none":null});const s=s=>{const o=this.href(s);if(o&&e.open("a",o),e.open(i,this.attr(t,s,r,"g"!==i?i:null)),"text"===i){const t=Jz(s);if(Ee(t)){const n={x:0,dy:Qz(s)};for(let i=0;i<t.length;++i)e.open("tspan",i?n:null).text(tj(s,t[i])).close()}else e.text(tj(s,t))}else if("g"===i){const i=s.strokeForeground,r=s.fill,o=s.stroke;i&&o&&(s.stroke=null),e.open("path",this.attr(t,s,n.background,"bgrect")).close(),e.open("g",this.attr(t,s,n.content)),sz(s,t=>this.mark(e,t)),e.close(),i&&o?(r&&(s.fill=null),s.stroke=o,e.open("path",this.attr(t,s,n.foreground,"bgrect")).close(),r&&(s.fill=r)):e.open("path",this.attr(t,s,n.foreground,"bgfore")).close()}e.close(),o&&e.close()};return n.nested?t.items&&t.items.length&&s(t.items[0]):sz(t,s),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e})}return null},attr(e,t,n,i){const r={},s=(e,t,n,i)=>{r[i||e]=t};return Array.isArray(n)?n.forEach(e=>e(s,t,this)):n(s,t,this),i&&function(e,t,n,i,r){if(null==t)return e;"bgrect"===i&&!1===n.interactive&&(e["pointer-events"]="none");if("bgfore"===i&&(!1===n.interactive&&(e["pointer-events"]="none"),e.display="none",null!==t.fill))return e;"image"===i&&!1===t.smooth&&(e.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===i&&(e["font-family"]=nj(t),e["font-size"]=Zz(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const n in bY){let i=t[n];const s=bY[n];("transparent"!==i||"fill"!==s&&"stroke"!==s)&&null!=i&&(yU(i)&&(i=vU(i,r.gradient,"")),e[s]=i)}}(r,t,e,i,this._defs),r},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(t).length+Object.keys(n).length){e.open("defs");for(const n in t){const i=t[n],r=i.stops;"radial"===i.gradient?(e.open("pattern",{id:_U+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),e.close(),e.open("radialGradient",{id:n,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):e.open("linearGradient",{id:n,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let t=0;t<r.length;++t)e.open("stop",{offset:r[t].offset,"stop-color":r[t].color}).close();e.close()}for(const t in n){const i=n[t];e.open("clipPath",{id:t}),i.path?e.open("path",{d:i.path}).close():e.open("rect",{x:0,y:0,width:i.width,height:i.height}).close(),e.close()}e.close()}}});const $Y="canvas",UY="none",VY={Canvas:$Y,PNG:"png",SVG:"svg",None:UY},zY={};function jY(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(zY[e]=t,this):zY[e]}function YY(e,t,n){const i=[],r=(new fV).union(t),s=e.marktype;return s?GY(e,r,n,i):"group"===s?HY(e,r,n,i):ae("Intersect scene must be mark node or group item.")}function GY(e,t,n,i){if(function(e,t,n){return e.bounds&&t.intersects(e.bounds)&&("group"===e.marktype||!1!==e.interactive&&(!n||n(e)))}(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if("group"===s)for(;a<o;++a)HY(r[a],t,n,i);else for(const e=dj[s].isect;a<o;++a){const n=r[a];WY(n,t,e)&&i.push(n)}}return i}function HY(e,t,n,i){n&&n(e.mark)&&WY(e,t,dj.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let e=0;e<s;++e)GY(r[e],t,n,i);t.translate(o,a)}return i}function WY(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}zY[$Y]=zY.png={renderer:Zj,headless:Zj,handler:Hj},zY.svg={renderer:wY,headless:BY,handler:Jj},zY[UY]={};const XY=new fV;function qY(e){const t=e.clip;if(Ke(t))t(BV(XY.clear()));else{if(!t)return;XY.set(0,0,e.group.width,e.group.height)}e.bounds.intersect(XY)}const KY=1e-9;function ZY(e,t,n){return e===t||("path"===n?QY(e,t):e instanceof Date&&t instanceof Date?+e===+t:yt(e)&&yt(t)?Math.abs(e-t)<=KY:e&&t&&(we(e)||we(t))?function(e,t){var n,i,r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(r.sort(),s.sort(),i=r.length-1;i>=0;i--)if(r[i]!=s[i])return!1;for(i=r.length-1;i>=0;i--)if(!ZY(e[n=r[i]],t[n],n))return!1;return typeof e==typeof t}(e,t):e==t)}function QY(e,t){return ZY(AU(e),AU(t))}function JY(){hV(),gU=0}function eG(e,t,n,i){const r=e.width,s=e.height,o=n||i,a=Tp(r,s).getContext("2d");t.forEach(e=>tG(a,e,o));const l=new Uint32Array(a.getImageData(0,0,r,s).data.buffer),u=e.bitmap(),c=o&&e.bitmap();let d,h,p,f,m;for(h=0;h<s;++h)for(d=0;d<r;++d)m=4278190080&l[h*r+d],m&&(p=e(d),f=e(h),i||u.set(p,f),o&&268435456^m&&c.set(p,f));return[u,c]}function tG(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;"group"===i?t.forEach(t=>{t.items.forEach(t=>tG(e,t.items,n))}):dj[i].draw(e,{items:n?t.map(nG):t})}function nG(e){const t=_o(e,{});return t.stroke&&(t.strokeOpacity=1),t.fill&&(t.fillOpacity=.0625,t.stroke="#000",t.strokeOpacity=1,t.strokeWidth=2),t}const iG=31,rG=new Uint32Array(33),sG=new Uint32Array(33);sG[0]=0,rG[0]=~sG[0];for(let e=1;e<=32;++e)sG[e]=sG[e-1]<<1|1,rG[e]=~sG[e];function oG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=e=>~~((e+n)/i);return o.invert=e=>e*i-n,o.bitmap=()=>function(e,t){const n=new Uint32Array(~~((e*t+32)/32));function i(e,t){n[e]|=t}function r(e,t){n[e]&=t}return{array:n,get:(t,i)=>{const r=i*e+t;return n[r>>>5]&1<<(r&iG)},set:(t,n)=>{const r=n*e+t;i(r>>>5,1<<(r&iG))},clear:(t,n)=>{const i=n*e+t;r(i>>>5,~(1<<(i&iG)))},getRange:(t,i,r,s)=>{let o,a,l,u,c=s;for(;c>=i;--c)if(o=c*e+t,a=c*e+r,l=o>>>5,u=a>>>5,l===u){if(n[l]&rG[o&iG]&sG[1+(a&iG)])return!0}else{if(n[l]&rG[o&iG])return!0;if(n[u]&sG[1+(a&iG)])return!0;for(let e=l+1;e<u;++e)if(n[e])return!0}return!1},setRange:(t,n,r,s)=>{let o,a,l,u,c;for(;n<=s;++n)if(o=n*e+t,a=n*e+r,l=o>>>5,u=a>>>5,l===u)i(l,rG[o&iG]&sG[1+(a&iG)]);else for(i(l,rG[o&iG]),i(u,sG[1+(a&iG)]),c=l+1;c<u;++c)i(c,4294967295)},clearRange:(t,n,i,s)=>{let o,a,l,u,c;for(;n<=s;++n)if(o=n*e+t,a=n*e+i,l=o>>>5,u=a>>>5,l===u)r(l,sG[o&iG]|rG[1+(a&iG)]);else for(r(l,sG[o&iG]),r(u,rG[1+(a&iG)]),c=l+1;c<u;++c)r(c,0)},outOfBounds:(n,i,r,s)=>n<0||i<0||s>=t||r>=e}}(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function aG(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function lG(e,t,n,i,r,s,o,a){const l=r*s/(2*i),u=e(t-l),c=e(t+l),d=e(n-(s/=2)),h=e(n+s);return o.outOfBounds(u,d,c,h)||o.getRange(u,d,c,h)||a&&a.getRange(u,d,c,h)}const uG=[-1,-1,1,1],cG=[-1,1,-1,1];const dG=["right","center","left"],hG=["bottom","middle","top"];function pG(e,t,n,i,r,s,o,a,l,u,c,d){return!(r.outOfBounds(e,n,t,i)||(d&&s?s.getRange(e,n,t,i)||!function(e,t,n,i,r){return r[0]<=e&&n<=r[2]&&r[3]<=t&&i<=r[5]}(o,l,a,u,c):r.getRange(e,n,t,i)))}const fG={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},mG={naive:function(e,t,n,i){const r=e.width,s=e.height;return function(e){const t=e.datum.datum.items[i].items,n=t.length,o=e.datum.fontSize,a=Gz.width(e.datum,e.datum.text);let l,u,c,d,h,p,f,m=0;for(let i=0;i<n;++i)l=t[i].x,c=t[i].y,u=void 0===t[i].x2?l:t[i].x2,d=void 0===t[i].y2?c:t[i].y2,h=(l+u)/2,p=(c+d)/2,f=Math.abs(u-l+d-c),f>=m&&(m=f,e.x=h,e.y=p);return h=a/2,p=o/2,l=e.x-h,u=e.x+h,c=e.y-p,d=e.y+p,e.align="center",l<0&&u<=r?e.align="left":0<=l&&r<u&&(e.align="right"),e.baseline="middle",c<0&&d<=s?e.baseline="top":0<=c&&s<d&&(e.baseline="bottom"),!0}},"reduced-search":function(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function l(t,n,i,l,u){const c=e.invert(t),d=e.invert(n);let h,p=i,f=s;if(!aG(c,d,l,u,r,s)&&!lG(e,c,d,u,l,p,o,a)&&!lG(e,c,d,u,l,u,o,null)){for(;f-p>=1;)h=(p+f)/2,lG(e,c,d,u,l,h,o,a)?f=h:p=h;if(p>i)return[c,d,p,!0]}}return function(t){const a=t.datum.datum.items[i].items,u=a.length,c=t.datum.fontSize,d=Gz.width(t.datum,t.datum.text);let h,p,f,m,g,_,y,v,b,T,x,E,w,I,A,S,C,O=n?c:0,M=!1,k=!1,R=0;for(let i=0;i<u;++i){for(h=a[i].x,f=a[i].y,p=void 0===a[i].x2?h:a[i].x2,m=void 0===a[i].y2?f:a[i].y2,h>p&&(C=h,h=p,p=C),f>m&&(C=f,f=m,m=C),b=e(h),x=e(p),T=~~((b+x)/2),E=e(f),I=e(m),w=~~((E+I)/2),y=T;y>=b;--y)for(v=w;v>=E;--v)S=l(y,v,O,d,c),S&&([t.x,t.y,O,M]=S);for(y=T;y<=x;++y)for(v=w;v<=I;++v)S=l(y,v,O,d,c),S&&([t.x,t.y,O,M]=S);M||n||(A=Math.abs(p-h+m-f),g=(h+p)/2,_=(f+m)/2,A>=R&&!aG(g,_,d,c,r,s)&&!lG(e,g,_,c,d,c,o,null)&&(R=A,t.x=g,t.y=_,k=!0))}return!(!M&&!k)&&(g=d/2,_=c/2,o.setRange(e(t.x-g),e(t.y-_),e(t.x+g),e(t.y+_)),t.align="center",t.baseline="middle",!0)}},floodfill:function(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=e.bitmap();return function(t){const u=t.datum.datum.items[i].items,c=u.length,d=t.datum.fontSize,h=Gz.width(t.datum,t.datum.text),p=[];let f,m,g,_,y,v,b,T,x,E,w,I,A=n?d:0,S=!1,C=!1,O=0;for(let i=0;i<c;++i){for(f=u[i].x,g=u[i].y,m=void 0===u[i].x2?f:u[i].x2,_=void 0===u[i].y2?g:u[i].y2,p.push([e((f+m)/2),e((g+_)/2)]);p.length;)if([b,T]=p.pop(),!(o.get(b,T)||a.get(b,T)||l.get(b,T))){l.set(b,T);for(let e=0;e<4;++e)y=b+uG[e],v=T+cG[e],l.outOfBounds(y,v,y,v)||p.push([y,v]);if(y=e.invert(b),v=e.invert(T),x=A,E=s,!aG(y,v,h,d,r,s)&&!lG(e,y,v,d,h,x,o,a)&&!lG(e,y,v,d,h,d,o,null)){for(;E-x>=1;)w=(x+E)/2,lG(e,y,v,d,h,w,o,a)?E=w:x=w;x>A&&(t.x=y,t.y=v,A=x,S=!0)}}S||n||(I=Math.abs(m-f+_-g),y=(f+m)/2,v=(g+_)/2,I>=O&&!aG(y,v,h,d,r,s)&&!lG(e,y,v,d,h,d,o,null)&&(O=I,t.x=y,t.y=v,C=!0))}return!(!S&&!C)&&(y=h/2,v=d/2,o.setRange(e(t.x-y),e(t.y-v),e(t.x+y),e(t.y+v)),t.align="center",t.baseline="middle",!0)}}};function gG(e,t,n,i,r,s,o,a,l,u,c){if(!e.length)return e;const d=Math.max(i.length,r.length),h=function(e,t){const n=new Float64Array(t),i=e.length;for(let t=0;t<i;++t)n[t]=e[t]||0;for(let e=i;e<t;++e)n[e]=n[i-1];return n}(i,d),p=function(e,t){const n=new Int8Array(t),i=e.length;for(let t=0;t<i;++t)n[t]|=fG[e[t]];for(let e=i;e<t;++e)n[e]=n[i-1];return n}(r,d),f=(b=e[0].datum)&&b.mark&&b.mark.marktype,m="group"===f&&e[0].datum.items[l].marktype,g="area"===m,_=function(e,t,n,i){const r=e=>[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>r(e.datum):"line"===t?e=>{const t=e.datum.items[i].items;return r(t.length?t["start"===n?0:t.length-1]:{x:NaN,y:NaN})}:e=>{const t=e.datum.bounds;return[t.x1,(t.x1+t.x2)/2,t.x2,t.y1,(t.y1+t.y2)/2,t.y2]}:r}(f,m,a,l),y=oG(t[0],t[1],u),v=g&&"naive"===c;var b;const T=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:_(e)}));let x;if(!v){n&&T.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;e<p.length&&!t;++e)t=5===p[e]||h[e]<0;f&&(o||g)&&(s=[e.map(e=>e.datum)].concat(s)),x=s.length?eG(y,s,t,g):function(e,t){const n=e.bitmap();return(t||[]).forEach(t=>n.set(e(t.boundary[0]),e(t.boundary[3]))),[n,void 0]}(y,o&&T)}const E=g?mG[c](y,x,o,l):function(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=i.length;return function(t){const u=t.boundary,c=t.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>r||u[3]>s)return!1;let d,h,p,f,m,g,_,y,v,b,T,x,E,w,I,A=0;for(let r=0;r<l;++r){if(d=(3&n[r])-1,h=(n[r]>>>2&3)-1,p=0===d&&0===h||i[r]<0,f=d&&h?Math.SQRT1_2:1,m=i[r]<0?-1:1,g=u[1+d]+i[r]*d*f,T=u[4+h]+m*c*h/2+i[r]*h*f,y=T-c/2,v=T+c/2,x=e(g),w=e(y),I=e(v),!A){if(!pG(x,x,w,I,o,a,g,g,y,v,u,p))continue;A=Gz.width(t.datum,t.datum.text)}if(b=g+m*A*d/2,g=b-A/2,_=b+A/2,x=e(g),E=e(_),pG(x,E,w,I,o,a,g,_,y,v,u,p))return t.x=d?d*m<0?_:g:b,t.y=h?h*m<0?v:y:T,t.align=dG[d*m+1],t.baseline=hG[h*m+1],o.setRange(x,w,E,I),!0}return!1}}(y,x,p,h);return T.forEach(e=>e.opacity=+E(e)),T}const _G=["x","y","opacity","align","baseline"],yG=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function vG(e){Ho.call(this,null,e)}function bG(e,t){var n,i,r,s,o,a,l=[],u=function(e){return e(s)};if(null==t)l.push(e);else for(n={},i=0,r=e.length;i<r;++i)s=e[i],(a=n[o=t.map(u)])||(n[o]=a=[],a.dims=o,l.push(a)),a.push(s);return l}function TG(e){Ho.call(this,null,e)}vG.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:yG},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:_G.length,default:_G}]},pt(vG,Ho,{transform(e,t){const n=e.modified();if(!(n||t.changed(t.ADD_REM)||function(n){const i=e[n];return Ke(i)&&t.modified(i.fields)}("sort")))return;e.size&&2===e.size.length||ae("Size parameter should be specified as a [width, height] array.");const i=e.as||_G;return gG(t.materialize(t.SOURCE).source,e.size,e.sort,Xe(e.offset||1),Xe(e.anchor||yG),e.avoidMarks||[],!1!==e.avoidBaseMark,e.lineAnchor||"end",e.markIndex||0,e.padding||0,e.method||"naive").forEach(e=>{const t=e.datum;t[i[0]]=e.x,t[i[1]]=e.y,t[i[2]]=e.opacity,t[i[3]]=e.align,t[i[4]]=e.baseline}),t.reflow(n).modifies(i)}}),TG.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},pt(TG,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=bG(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(ne),s=r.length,o=e.as||[ne(e.x),ne(e.y)],a=[];i.forEach(t=>{qa(t,e.x,e.y,e.bandwidth||.3).forEach(e=>{const n={};for(let e=0;e<s;++e)n[r[e]]=t.dims[e];n[o[0]]=e[0],n[o[1]]=e[1],a.push(mo(n))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a}return n}});const xG={linear:Ua,log:Va,exp:za,pow:ja,quad:Ya,poly:Ga};function EG(e){Ho.call(this,null,e)}EG.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(xG)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},pt(EG,Ho,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=bG(t.materialize(t.SOURCE).source,e.groupby),r=(e.groupby||[]).map(ne),s=e.method||"linear",o=e.order||3,a=((e,t)=>"poly"===e?t:"quad"===e?2:1)(s,o),l=e.as||[ne(e.x),ne(e.y)],u=xG[s],c=[];let d=e.extent;ut(xG,s)||ae("Invalid regression method: "+s),null!=d&&"log"===s&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(n=>{if(n.length<=a)return void t.dataflow.warn("Skipping regression with more parameters than data points.");const i=u(n,e.x,e.y,o);if(e.params)return void c.push(mo({keys:n.dims,coef:i.coef,rSquared:i.rSquared}));const h=d||ot(n,e.x),p=e=>{const t={};for(let e=0;e<r.length;++e)t[r[e]]=n.dims[e];t[l[0]]=e[0],t[l[1]]=e[1],c.push(mo(t))};"linear"===s?h.forEach(e=>p([e,i.predict(e)])):Ja(i.predict,h,25,200).forEach(p)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});const wG=Math.pow(2,-52),IG=new Uint32Array(512);class AG{static from(e,t=DG,n=FG){const i=e.length,r=new Float64Array(2*i);for(let s=0;s<i;s++){const i=e[s];r[2*s]=t(i),r[2*s+1]=n(i)}return new AG(r)}constructor(e){const t=e.length>>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:r}=this,s=e.length>>1;let o=1/0,a=1/0,l=-1/0,u=-1/0;for(let t=0;t<s;t++){const n=e[2*t],i=e[2*t+1];n<o&&(o=n),i<a&&(a=i),n>l&&(l=n),i>u&&(u=i),this._ids[t]=t}const c=(o+l)/2,d=(a+u)/2;let h,p,f,m=1/0;for(let t=0;t<s;t++){const n=SG(c,d,e[2*t],e[2*t+1]);n<m&&(h=t,m=n)}const g=e[2*h],_=e[2*h+1];m=1/0;for(let t=0;t<s;t++){if(t===h)continue;const n=SG(g,_,e[2*t],e[2*t+1]);n<m&&n>0&&(p=t,m=n)}let y=e[2*p],v=e[2*p+1],b=1/0;for(let t=0;t<s;t++){if(t===h||t===p)continue;const n=kG(g,_,y,v,e[2*t],e[2*t+1]);n<b&&(f=t,b=n)}let T=e[2*f],x=e[2*f+1];if(b===1/0){for(let t=0;t<s;t++)this._dists[t]=e[2*t]-e[0]||e[2*t+1]-e[1];RG(this._ids,this._dists,0,s-1);const t=new Uint32Array(s);let n=0;for(let e=0,i=-1/0;e<s;e++){const r=this._ids[e];this._dists[r]>i&&(t[n++]=r,i=this._dists[r])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(OG(g,_,y,v,T,x)){const e=p,t=y,n=v;p=f,y=T,v=x,f=e,T=t,x=n}const E=function(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,d=l*l+u*u,h=.5/(o*u-a*l),p=e+(u*c-a*d)*h,f=t+(o*d-l*c)*h;return{x:p,y:f}}(g,_,y,v,T,x);this._cx=E.x,this._cy=E.y;for(let t=0;t<s;t++)this._dists[t]=SG(e[2*t],e[2*t+1],E.x,E.y);RG(this._ids,this._dists,0,s-1),this._hullStart=h;let w=3;n[h]=t[f]=p,n[p]=t[h]=f,n[f]=t[p]=h,i[h]=0,i[p]=1,i[f]=2,r.fill(-1),r[this._hashKey(g,_)]=h,r[this._hashKey(y,v)]=p,r[this._hashKey(T,x)]=f,this.trianglesLen=0,this._addTriangle(h,p,f,-1,-1,-1);for(let s,o,a=0;a<this._ids.length;a++){const l=this._ids[a],u=e[2*l],c=e[2*l+1];if(a>0&&Math.abs(u-s)<=wG&&Math.abs(c-o)<=wG)continue;if(s=u,o=c,l===h||l===p||l===f)continue;let d=0;for(let e=0,t=this._hashKey(u,c);e<this._hashSize&&(d=r[(t+e)%this._hashSize],-1===d||d===n[d]);e++);d=t[d];let m,g=d;for(;m=n[g],!OG(u,c,e[2*g],e[2*g+1],e[2*m],e[2*m+1]);)if(g=m,g===d){g=-1;break}if(-1===g)continue;let _=this._addTriangle(g,l,n[g],-1,-1,i[g]);i[l]=this._legalize(_+2),i[g]=_,w++;let y=n[g];for(;m=n[y],OG(u,c,e[2*y],e[2*y+1],e[2*m],e[2*m+1]);)_=this._addTriangle(y,l,m,i[l],-1,i[y]),i[l]=this._legalize(_+2),n[y]=y,w--,y=m;if(g===d)for(;m=t[g],OG(u,c,e[2*m],e[2*m+1],e[2*g],e[2*g+1]);)_=this._addTriangle(m,l,g,-1,i[g],i[m]),this._legalize(_+2),i[m]=_,n[g]=g,w--,g=m;this._hullStart=t[l]=g,n[g]=t[y]=l,n[l]=y,r[this._hashKey(u,c)]=l,r[this._hashKey(e[2*g],e[2*g+1])]=g}this.hull=new Uint32Array(w);for(let e=0,t=this._hullStart;e<w;e++)this.hull[e]=t,t=n[t];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let r=0,s=0;for(;;){const o=n[e],a=e-e%3;if(s=a+(e+2)%3,-1===o){if(0===r)break;e=IG[--r];continue}const l=o-o%3,u=a+(e+1)%3,c=l+(o+2)%3,d=t[s],h=t[e],p=t[u],f=t[c];if(MG(i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*f],i[2*f+1])){t[e]=f,t[o]=d;const i=n[c];if(-1===i){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,i),this._link(o,n[s]),this._link(s,c);const a=l+(o+1)%3;r<IG.length&&(IG[r++]=a)}else{if(0===r)break;e=IG[--r]}}return s}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,r,s){const o=this.trianglesLen;return this._triangles[o]=e,this._triangles[o+1]=t,this._triangles[o+2]=n,this._link(o,i),this._link(o+1,r),this._link(o+2,s),this.trianglesLen+=3,o}}function SG(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function CG(e,t,n,i,r,s){const o=(i-t)*(r-e),a=(n-e)*(s-t);return Math.abs(o-a)>=33306690738754716e-32*Math.abs(o+a)?o-a:0}function OG(e,t,n,i,r,s){return(CG(r,s,e,t,n,i)||CG(e,t,n,i,r,s)||CG(n,i,r,s,e,t))<0}function MG(e,t,n,i,r,s,o,a){const l=e-o,u=t-a,c=n-o,d=i-a,h=r-o,p=s-a,f=c*c+d*d,m=h*h+p*p;return l*(d*m-f*p)-u*(c*m-f*h)+(l*l+u*u)*(c*p-d*h)<0}function kG(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,d=l*l+u*u,h=.5/(o*u-a*l),p=(u*c-a*d)*h,f=(o*d-l*c)*h;return p*p+f*f}function RG(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=e[r],s=t[i];let o=r-1;for(;o>=n&&t[e[o]]>s;)e[o+1]=e[o--];e[o+1]=i}else{let r=n+1,s=i;NG(e,n+i>>1,r),t[e[n]]>t[e[i]]&&NG(e,n,i),t[e[r]]>t[e[i]]&&NG(e,r,i),t[e[n]]>t[e[r]]&&NG(e,n,r);const o=e[r],a=t[o];for(;;){do{r++}while(t[e[r]]<a);do{s--}while(t[e[s]]>a);if(s<r)break;NG(e,r,s)}e[n+1]=e[s],e[s]=o,i-r+1>=s-n?(RG(e,t,r,i),RG(e,t,n,s-1)):(RG(e,t,n,s-1),RG(e,t,r,i))}}function NG(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function DG(e){return e[0]}function FG(e){return e[1]}const LG=1e-6;class PG{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const i=(e=+e)+(n=+n),r=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>LG||Math.abs(this._y1-r)>LG)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(e,t,n,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class BG{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class $G{constructor(e,[t,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(t=+t)&&(r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=i,this.xmin=t,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let t,i,s=0,o=0,a=n.length;s<a;s+=3,o+=2){const a=2*n[s],l=2*n[s+1],u=2*n[s+2],c=e[a],d=e[a+1],h=e[l],p=e[l+1],f=e[u],m=e[u+1],g=h-c,_=p-d,y=f-c,v=m-d,b=g*g+_*_,T=y*y+v*v,x=2*(g*v-_*y);if(x)if(Math.abs(x)<1e-8)t=(c+f)/2,i=(d+m)/2;else{const e=1/x;t=c+(v*b-_*T)*e,i=d+(g*T-y*b)*e}else t=(c+f)/2-1e8*v,i=(d+m)/2+1e8*y;r[o]=t,r[o+1]=i}let s,o,a,l=t[t.length-1],u=4*l,c=e[2*l],d=e[2*l+1];i.fill(0);for(let n=0;n<t.length;++n)l=t[n],s=u,o=c,a=d,u=4*l,c=e[2*l],d=e[2*l+1],i[s+2]=i[u]=a-d,i[s+3]=i[u+1]=c-o}render(e){const t=null==e?e=new PG:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:s,vectors:o}=this;if(r.length<=1)return null;for(let t=0,i=n.length;t<i;++t){const i=n[t];if(i<t)continue;const r=2*Math.floor(t/3),o=2*Math.floor(i/3),a=s[r],l=s[r+1],u=s[o],c=s[o+1];this._renderSegment(a,l,u,c,e)}let a,l=r[r.length-1];for(let t=0;t<r.length;++t){a=l,l=r[t];const n=2*Math.floor(i[l]/3),u=s[n],c=s[n+1],d=4*a,h=this._project(u,c,o[d+2],o[d+3]);h&&this._renderSegment(u,c,h[0],h[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new PG:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new PG:void 0,i=this._clip(e);if(null===i||!i.length)return;t.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let e=2;e<r;e+=2)i[e]===i[e-2]&&i[e+1]===i[e-1]||t.lineTo(i[e],i[e+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new BG;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,i,r){let s;const o=this._regioncode(e,t),a=this._regioncode(n,i);0===o&&0===a?(r.moveTo(e,t),r.lineTo(n,i)):(s=this._clipSegment(e,t,n,i,o,a))&&(r.moveTo(s[0],s[1]),r.lineTo(s[2],s[3]))}contains(e,t,n){return(t=+t)==t&&(n=+n)==n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let i=0,r=t.length;i<r;i+=2)for(let s=0,o=e.length;s<o;s+=2)if(t[i]==e[s]&&t[i+1]==e[s+1]&&t[(i+2)%r]==e[(s+o-2)%o]&&t[(i+3)%r]==e[(s+o-1)%o]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,s=n[e];if(-1===s)return null;const o=[];let a=s;do{const n=Math.floor(a/3);if(o.push(t[2*n],t[2*n+1]),a=a%3==2?a-2:a+1,r[a]!==e)break;a=i[a]}while(a!==s&&-1!==a);return o}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,i=4*e;return n[i]||n[i+1]?this._clipInfinite(e,t,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(e,t)}_clipFinite(e,t){const n=t.length;let i,r,s,o,a,l=null,u=t[n-2],c=t[n-1],d=this._regioncode(u,c);for(let h=0;h<n;h+=2)if(i=u,r=c,u=t[h],c=t[h+1],s=d,d=this._regioncode(u,c),0===s&&0===d)o=a,a=0,l?l.push(u,c):l=[u,c];else{let t,n,h,p,f;if(0===s){if(null===(t=this._clipSegment(i,r,u,c,s,d)))continue;[n,h,p,f]=t}else{if(null===(t=this._clipSegment(u,c,i,r,d,s)))continue;[p,f,n,h]=t,o=a,a=this._edgecode(n,h),o&&a&&this._edge(e,o,a,l,l.length),l?l.push(n,h):l=[n,h]}o=a,a=this._edgecode(p,f),o&&a&&this._edge(e,o,a,l,l.length),l?l.push(p,f):l=[p,f]}if(l)o=a,a=this._edgecode(l[0],l[1]),o&&a&&this._edge(e,o,a,l,l.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return l}_clipSegment(e,t,n,i,r,s){for(;;){if(0===r&&0===s)return[e,t,n,i];if(r&s)return null;let o,a,l=r||s;8&l?(o=e+(n-e)*(this.ymax-t)/(i-t),a=this.ymax):4&l?(o=e+(n-e)*(this.ymin-t)/(i-t),a=this.ymin):2&l?(a=t+(i-t)*(this.xmax-e)/(n-e),o=this.xmax):(a=t+(i-t)*(this.xmin-e)/(n-e),o=this.xmin),r?(e=o,t=a,r=this._regioncode(e,t)):(n=o,i=a,s=this._regioncode(n,i))}}_clipInfinite(e,t,n,i,r,s){let o,a=Array.from(t);if((o=this._project(a[0],a[1],n,i))&&a.unshift(o[0],o[1]),(o=this._project(a[a.length-2],a[a.length-1],r,s))&&a.push(o[0],o[1]),a=this._clipFinite(e,a))for(let t,n=0,i=a.length,r=this._edgecode(a[i-2],a[i-1]);n<i;n+=2)t=r,r=this._edgecode(a[n],a[n+1]),t&&r&&(n=this._edge(e,t,r,a,n),i=a.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(e,t,n,i,r){for(;t!==n;){let n,s;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,s=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,s=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,s=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,s=this.ymin}i[r]===n&&i[r+1]===s||!this.contains(e,n,s)||(i.splice(r,0,n,s),r+=2)}if(i.length>4)for(let e=0;e<i.length;e+=2){const t=(e+2)%i.length,n=(e+4)%i.length;(i[e]===i[t]&&i[t]===i[n]||i[e+1]===i[t+1]&&i[t+1]===i[n+1])&&(i.splice(t,2),e-=2)}return r}_project(e,t,n,i){let r,s,o,a=1/0;if(i<0){if(t<=this.ymin)return null;(r=(this.ymin-t)/i)<a&&(o=this.ymin,s=e+(a=r)*n)}else if(i>0){if(t>=this.ymax)return null;(r=(this.ymax-t)/i)<a&&(o=this.ymax,s=e+(a=r)*n)}if(n>0){if(e>=this.xmax)return null;(r=(this.xmax-e)/n)<a&&(s=this.xmax,o=t+(a=r)*i)}else if(n<0){if(e<=this.xmin)return null;(r=(this.xmin-e)/n)<a&&(s=this.xmin,o=t+(a=r)*i)}return[s,o]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}}const UG=2*Math.PI,VG=Math.pow;function zG(e){return e[0]}function jG(e){return e[1]}function YG(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class GG{static from(e,t=zG,n=jG,i){return new GG("length"in e?function(e,t,n,i){const r=e.length,s=new Float64Array(2*r);for(let o=0;o<r;++o){const r=e[o];s[2*o]=t.call(i,r,o,e),s[2*o+1]=n.call(i,r,o,e)}return s}(e,t,n,i):Float64Array.from(function*(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}(e,t,n,i)))}constructor(e){this._delaunator=new AG(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e<t.length;e+=3){const i=2*t[e],r=2*t[e+1],s=2*t[e+2];if((n[s]-n[i])*(n[r+1]-n[i+1])-(n[r]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},(e,t)=>t).sort((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]);const e=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let e=0,n=t.length/2;e<n;++e){const n=YG(t[2*e],t[2*e+1],r);t[2*e]=n[0],t[2*e+1]=n[1]}this._delaunator=new AG(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let e=0,t=n.length;e<t;++e){const t=r[e%3==2?e-2:e+1];-1!==n[e]&&-1!==s[t]||(s[t]=e)}for(let e=0,t=i.length;e<t;++e)o[i[e]]=e;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],this.triangles[1]=i[1],this.triangles[2]=i[1],s[i[0]]=1,2===i.length&&(s[i[1]]=0))}voronoi(e){return new $G(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:o}=this;if(o){const t=o.indexOf(e);return t>0&&(yield o[t-1]),void(t<o.length-1&&(yield o[t+1]))}const a=t[e];if(-1===a)return;let l=a,u=-1;do{if(yield u=s[l],l=l%3==2?l-2:l+1,s[l]!==e)return;if(l=r[l],-1===l){const t=n[(i[e]+1)%n.length];return void(t!==u&&(yield t))}}while(l!==a)}find(e,t,n=0){if((e=+e)!=e||(t=+t)!=t)return-1;const i=n;let r;for(;(r=this._step(n,e,t))>=0&&r!==n&&r!==i;)n=r;return r}_step(e,t,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:o,triangles:a,points:l}=this;if(-1===i[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=VG(t-l[2*e],2)+VG(n-l[2*e+1],2);const d=i[e];let h=d;do{let i=a[h];const d=VG(t-l[2*i],2)+VG(n-l[2*i+1],2);if(d<c&&(c=d,u=i),h=h%3==2?h-2:h+1,a[h]!==e)break;if(h=o[h],-1===h){if(h=r[(s[e]+1)%r.length],h!==i&&VG(t-l[2*h],2)+VG(n-l[2*h+1],2)<c)return h;break}}while(h!==d);return u}render(e){const t=null==e?e=new PG:void 0,{points:n,halfedges:i,triangles:r}=this;for(let t=0,s=i.length;t<s;++t){const s=i[t];if(s<t)continue;const o=2*r[t],a=2*r[s];e.moveTo(n[o],n[o+1]),e.lineTo(n[a],n[a+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t=2){const n=null==e?e=new PG:void 0,{points:i}=this;for(let n=0,r=i.length;n<r;n+=2){const r=i[n],s=i[n+1];e.moveTo(r+t,s),e.arc(r,s,t,0,UG)}return n&&n.value()}renderHull(e){const t=null==e?e=new PG:void 0,{hull:n,points:i}=this,r=2*n[0],s=n.length;e.moveTo(i[r],i[r+1]);for(let t=1;t<s;++t){const r=2*n[t];e.lineTo(i[r],i[r+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new BG;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new PG:void 0,{points:i,triangles:r}=this,s=2*r[e*=3],o=2*r[e+1],a=2*r[e+2];return t.moveTo(i[s],i[s+1]),t.lineTo(i[o],i[o+1]),t.lineTo(i[a],i[a+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new BG;return this.renderTriangle(e,t),t.value()}}function HG(e){Ho.call(this,null,e)}HG.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const WG=[-1e5,-1e5,1e5,1e5];function XG(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function qG(e,t,n){return e.fields=t||[],e.fname=n,e}function KG(e){return 1===e.length?ZG(e[0]):QG(e)}pt(HG,Ho,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:WG;const s=this.value=GG.from(i,e.x,e.y).voronoi(r);for(let e=0,t=i.length;e<t;++e){const t=s.cellPolygon(e);i[e][n]=t?XG(t):null}return t.reflow(e.modified()).modifies(n)}});const ZG=e=>function(t){return t[e]},QG=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function JG(e){throw Error(e)}function eH(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||JG("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&JG("Access path missing closing bracket: "+e),o&&JG("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function tH(e,t,n){const i=eH(e);return e=1===i.length?i[0]:e,qG((n&&n.get||KG)(i),[e],t||e)}tH("id"),qG(e=>e,[],"identity"),qG(()=>0,[],"zero"),qG(()=>1,[],"one"),qG(()=>!0,[],"true"),qG(()=>!1,[],"false");var nH=Array.isArray;function iH(e){return e[e.length-1]}function rH(e){return null==e||""===e?null:+e}function sH(e){return null!=e?nH(e)?e:[e]:[]}function oH(e){return"function"==typeof e}function aH(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function lH(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function uH(e){let t,n,i;function r(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<0?r=t+1:s=t}while(r<s)}return r}return 2!==e.length?(t=aH,n=(t,n)=>aH(e(t),n),i=(t,n)=>e(t)-n):(t=e===aH||e===lH?e:cH,n=e,i=e),{left:r,center:function(e,t,n=0,s=e.length){const o=r(e,t,n,s-1);return o>n&&i(e[o-1],t)>-i(e[o],t)?o-1:o},right:function(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<=0?r=t+1:s=t}while(r<s)}return r}}}function cH(){return 0}function dH(e){return null===e?NaN:+e}const hH=uH(aH),pH=hH.right,fH=(hH.left,uH(dH).center,pH),mH=Math.sqrt(50),gH=Math.sqrt(10),_H=Math.sqrt(2);function yH(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=mH?10:s>=gH?5:s>=_H?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/u<e&&++a,l/u>t&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*u<e&&++a,l*u>t&&--l),l<a&&.5<=n&&n<2?yH(e,t,2*n):[a,l,u]}function vH(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const i=t<e,[r,s,o]=i?yH(t,e,n):yH(e,t,n);if(!(s>=r))return[];const a=s-r+1,l=new Array(a);if(i)if(o<0)for(let e=0;e<a;++e)l[e]=(s-e)/-o;else for(let e=0;e<a;++e)l[e]=(s-e)*o;else if(o<0)for(let e=0;e<a;++e)l[e]=(r+e)/-o;else for(let e=0;e<a;++e)l[e]=(r+e)*o;return l}function bH(e,t,n){return yH(e=+e,t=+t,n=+n)[2]}function TH(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?bH(t,e,n):bH(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}function xH(e,t,n,i,r){var s=e*e,o=s*e;return((1-3*e+3*s-o)*t+(4-6*s+3*o)*n+(1+3*e+3*s-3*o)*i+o*r)/6}function EH(e){var t=e.length-1;return function(n){var i=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i<t-1?e[i+2]:2*s-r;return xH((n-i/t)*t,o,r,s,a)}}function wH(e){var t=e.length;return function(n){var i=Math.floor(((n%=1)<0?++n:n)*t),r=e[(i+t-1)%t],s=e[i%t],o=e[(i+1)%t],a=e[(i+2)%t];return xH((n-i/t)*t,r,s,o,a)}}const IH=e=>()=>e;function AH(e,t){return function(n){return e+n*t}}function SH(e,t){var n=t-e;return n?AH(e,n>180||n<-180?n-360*Math.round(n/360):n):IH(isNaN(e)?t:e)}function CH(e){return 1===(e=+e)?OH:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):IH(isNaN(t)?n:t)}}function OH(e,t){var n=t-e;return n?AH(e,n):IH(isNaN(e)?t:e)}const MH=function e(t){var n=CH(t);function i(e,t){var i=n((e=k_(e)).r,(t=k_(t)).r),r=n(e.g,t.g),s=n(e.b,t.b),o=OH(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=s(t),e.opacity=o(t),e+""}}return i.gamma=e,i}(1);function kH(e){return function(t){var n,i,r=t.length,s=new Array(r),o=new Array(r),a=new Array(r);for(n=0;n<r;++n)i=k_(t[n]),s[n]=i.r||0,o[n]=i.g||0,a[n]=i.b||0;return s=e(s),o=e(o),a=e(a),i.opacity=1,function(e){return i.r=s(e),i.g=o(e),i.b=a(e),i+""}}}var RH=kH(EH),NH=kH(wH);function DH(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(s){for(n=0;n<i;++n)r[n]=e[n]*(1-s)+t[n]*s;return r}}function FH(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function LH(e,t){return(FH(t)?DH:PH)(e,t)}function PH(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,s=new Array(r),o=new Array(i);for(n=0;n<r;++n)s[n]=YH(e[n],t[n]);for(;n<i;++n)o[n]=t[n];return function(e){for(n=0;n<r;++n)o[n]=s[n](e);return o}}function BH(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function $H(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function UH(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=YH(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var VH=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zH=new RegExp(VH.source,"g");function jH(e,t){var n,i,r,s=VH.lastIndex=zH.lastIndex=0,o=-1,a=[],l=[];for(e+="",t+="";(n=VH.exec(e))&&(i=zH.exec(t));)(r=i.index)>s&&(r=t.slice(s,r),a[o]?a[o]+=r:a[++o]=r),(n=n[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:$H(n,i)})),s=zH.lastIndex;return s<t.length&&(r=t.slice(s),a[o]?a[o]+=r:a[++o]=r),a.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)a[(n=l[i]).i]=n.x(e);return a.join("")})}function YH(e,t){var n,i=typeof t;return null==t||"boolean"===i?IH(t):("number"===i?$H:"string"===i?(n=S_(t))?(t=n,MH):jH:t instanceof S_?MH:t instanceof Date?BH:FH(t)?DH:Array.isArray(t)?PH:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?UH:$H)(e,t)}function GH(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function HH(e){return+e}var WH=[0,1];function XH(e){return e}function qH(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function KH(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r<i?(i=qH(r,i),s=n(o,s)):(i=qH(i,r),s=n(s,o)),function(e){return s(i(e))}}function ZH(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),s=new Array(i),o=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<i;)r[o]=qH(e[o],e[o+1]),s[o]=n(t[o],t[o+1]);return function(t){var n=fH(e,t,1,i)-1;return s[n](r[n](t))}}function QH(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function JH(){var e,t,n,i,r,s,o=WH,a=WH,l=YH,u=XH;function c(){var e=Math.min(o.length,a.length);return u!==XH&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(o[0],o[e-1])),i=e>2?ZH:KH,r=s=null,d}function d(t){return null==t||isNaN(t=+t)?n:(r||(r=i(o.map(e),a,l)))(e(u(t)))}return d.invert=function(n){return u(t((s||(s=i(a,o.map(e),$H)))(n)))},d.domain=function(e){return arguments.length?(o=Array.from(e,HH),c()):o.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),c()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=GH,c()},d.clamp=function(e){return arguments.length?(u=!!e||XH,c()):u!==XH},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,i){return e=n,t=i,c()}}function eW(){return JH()(XH,XH)}function tW(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function nW(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}function iW(e,t,n,i){var r,s=TH(e,t,n);switch((i=(0,eS.formatSpecifier)(null==i?",f":i)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=(0,eS.precisionPrefix)(s,o))||(i.precision=r),(0,eS.formatPrefix)(i,o);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=(0,eS.precisionRound)(s,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=(0,eS.precisionFixed)(s))||(i.precision=r-2*("%"===i.type))}return(0,eS.format)(i)}function rW(e){var t=e.domain;return e.ticks=function(e){var n=t();return vH(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return iW(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,s=t(),o=0,a=s.length-1,l=s[o],u=s[a],c=10;for(u<l&&(r=l,l=u,u=r,r=o,o=a,a=r);c-- >0;){if((r=bH(l,u,n))===i)return s[o]=l,s[a]=u,t(s);if(r>0)l=Math.floor(l/r)*r,u=Math.ceil(u/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,u=Math.floor(u*r)/r}i=r}return e},e}function sW(e,t){var n,i=0,r=(e=e.slice()).length-1,s=e[i],o=e[r];return o<s&&(n=i,i=r,r=n,n=s,s=o,o=n),e[i]=t.floor(s),e[r]=t.ceil(o),e}function oW(e){return Math.log(e)}function aW(e){return Math.exp(e)}function lW(e){return-Math.log(-e)}function uW(e){return-Math.exp(-e)}function cW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function dW(e){return(t,n)=>-e(-t,n)}function hW(e){const t=e(oW,aW),n=t.domain;let i,r,s=10;function o(){return i=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(s),r=function(e){return 10===e?cW:e===Math.E?Math.exp:t=>Math.pow(e,t)}(s),n()[0]<0?(i=dW(i),r=dW(r),e(lW,uW)):e(oW,aW),t}return t.base=function(e){return arguments.length?(s=+e,o()):s},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{const t=n();let o=t[0],a=t[t.length-1];const l=a<o;l&&([o,a]=[a,o]);let u,c,d=i(o),h=i(a);const p=null==e?10:+e;let f=[];if(!(s%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),o>0){for(;d<=h;++d)for(u=1;u<s;++u)if(c=d<0?u/r(-d):u*r(d),!(c<o)){if(c>a)break;f.push(c)}}else for(;d<=h;++d)for(u=s-1;u>=1;--u)if(c=d>0?u/r(-d):u*r(d),!(c<o)){if(c>a)break;f.push(c)}2*f.length<p&&(f=vH(o,a,p))}else f=vH(d,h,Math.min(h-d,p)).map(r);return l?f.reverse():f},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===s?"s":","),"function"!=typeof n&&(s%1||null!=(n=(0,eS.formatSpecifier)(n)).precision||(n.trim=!0),n=(0,eS.format)(n)),e===1/0)return n;const o=Math.max(1,s*e/t.ticks().length);return e=>{let t=e/r(Math.round(i(e)));return t*s<s-.5&&(t*=s),t<=o?n(e):""}},t.nice=()=>n(sW(n(),{floor:e=>r(Math.floor(i(e))),ceil:e=>r(Math.ceil(i(e)))})),t}function pW(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function fW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function mW(e){return e<0?-e*e:e*e}function gW(e){var t=e(XH,XH),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(XH,XH):.5===n?e(fW,mW):e(pW(n),pW(1/n)):n},rW(t)}function _W(){var e=gW(JH());return e.copy=function(){return QH(e,_W()).exponent(e.exponent())},tW.apply(e,arguments),e}function yW(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vW(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function bW(e){var t=1,n=e(yW(t),vW(t));return n.constant=function(n){return arguments.length?e(yW(t=+n),vW(t)):t},rW(n)}const TW=1e3,xW=6e4,EW=36e5,wW=864e5,IW=6048e5,AW=2592e6,SW=31536e6,CW=new Date,OW=new Date;function MW(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,s)=>{const o=[];if(n=r.ceil(n),s=null==s?1:Math.floor(s),!(n<i&&s>0))return o;let a;do{o.push(a=new Date(+n)),t(n,s),e(n)}while(a<n&&n<i);return o},r.filter=n=>MW(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(r.count=(t,i)=>(CW.setTime(+t),OW.setTime(+i),e(CW),e(OW),Math.floor(n(CW,OW))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e===0:t=>r.count(0,t)%e===0):r:null)),r}const kW=MW(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);kW.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?MW(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):kW:null);kW.range;const RW=MW(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*TW)},(e,t)=>(t-e)/TW,e=>e.getUTCSeconds()),NW=(RW.range,MW(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*TW)},(e,t)=>{e.setTime(+e+t*xW)},(e,t)=>(t-e)/xW,e=>e.getMinutes())),DW=(NW.range,MW(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xW)},(e,t)=>(t-e)/xW,e=>e.getUTCMinutes())),FW=(DW.range,MW(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*TW-e.getMinutes()*xW)},(e,t)=>{e.setTime(+e+t*EW)},(e,t)=>(t-e)/EW,e=>e.getHours())),LW=(FW.range,MW(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*EW)},(e,t)=>(t-e)/EW,e=>e.getUTCHours())),PW=(LW.range,MW(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xW)/wW,e=>e.getDate()-1)),BW=(PW.range,MW(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wW,e=>e.getUTCDate()-1)),$W=(BW.range,MW(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/wW,e=>Math.floor(e/wW)));$W.range;function UW(e){return MW(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xW)/IW)}const VW=UW(0),zW=UW(1),jW=UW(2),YW=UW(3),GW=UW(4),HW=UW(5),WW=UW(6);VW.range,zW.range,jW.range,YW.range,GW.range,HW.range,WW.range;function XW(e){return MW(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/IW)}const qW=XW(0),KW=XW(1),ZW=XW(2),QW=XW(3),JW=XW(4),eX=XW(5),tX=XW(6),nX=(qW.range,KW.range,ZW.range,QW.range,JW.range,eX.range,tX.range,MW(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth())),iX=(nX.range,MW(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth())),rX=(iX.range,MW(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()));rX.every=e=>isFinite(e=Math.floor(e))&&e>0?MW(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null;rX.range;const sX=MW(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());sX.every=e=>isFinite(e=Math.floor(e))&&e>0?MW(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null;sX.range;function oX(e,t,n,i,r,s){const o=[[RW,1,TW],[RW,5,5e3],[RW,15,15e3],[RW,30,3e4],[s,1,xW],[s,5,3e5],[s,15,9e5],[s,30,18e5],[r,1,EW],[r,3,108e5],[r,6,216e5],[r,12,432e5],[i,1,wW],[i,2,1728e5],[n,1,IW],[t,1,AW],[t,3,7776e6],[e,1,SW]];function a(t,n,i){const r=Math.abs(n-t)/i,s=uH(([,,e])=>e).right(o,r);if(s===o.length)return e.every(TH(t/SW,n/SW,i));if(0===s)return kW.every(Math.max(TH(t,n,i),1));const[a,l]=o[r/o[s-1][2]<o[s][2]/r?s-1:s];return a.every(l)}return[function(e,t,n){const i=t<e;i&&([e,t]=[t,e]);const r=n&&"function"==typeof n.range?n:a(e,t,n),s=r?r.range(e,+t+1):[];return i?s.reverse():s},a]}const[aX,lX]=oX(sX,iX,qW,$W,LW,DW),[uX,cX]=oX(rX,nX,VW,PW,FW,NW);function dX(e){return new Date(e)}function hX(e){return e instanceof Date?+e:+new Date(+e)}function pX(e,t,n,i,r,s,o,a,l,u){var c=eW(),d=c.invert,h=c.domain,p=u(".%L"),f=u(":%S"),m=u("%I:%M"),g=u("%I %p"),_=u("%a %d"),y=u("%b %d"),v=u("%B"),b=u("%Y");function T(e){return(l(e)<e?p:a(e)<e?f:o(e)<e?m:s(e)<e?g:i(e)<e?r(e)<e?_:y:n(e)<e?v:b)(e)}return c.invert=function(e){return new Date(d(e))},c.domain=function(e){return arguments.length?h(Array.from(e,hX)):h().map(dX)},c.ticks=function(t){var n=h();return e(n[0],n[n.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?T:u(t)},c.nice=function(e){var n=h();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?h(sW(n,e)):c},c.copy=function(){return QH(c,pX(e,t,n,i,r,s,o,a,l,u))},c}function fX(){var e,t,n,i,r,s=0,o=1,a=XH,l=!1;function u(t){return null==t||isNaN(t=+t)?r:a(0===n?.5:(t=(i(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var n,i;return arguments.length?([n,i]=t,a=e(n,i),u):[a(0),a(1)]}}return u.domain=function(r){return arguments.length?([s,o]=r,e=i(s=+s),t=i(o=+o),n=e===t?0:1/(t-e),u):[s,o]},u.clamp=function(e){return arguments.length?(l=!!e,u):l},u.interpolator=function(e){return arguments.length?(a=e,u):a},u.range=c(YH),u.rangeRound=c(GH),u.unknown=function(e){return arguments.length?(r=e,u):r},function(r){return i=r,e=r(s),t=r(o),n=e===t?0:1/(t-e),u}}function mX(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gX(){var e=rW(fX()(XH));return e.copy=function(){return mX(e,gX())},nW.apply(e,arguments)}function _X(){var e=gW(fX());return e.copy=function(){return mX(e,_X()).exponent(e.exponent())},nW.apply(e,arguments)}function yX(e,t){void 0===t&&(t=e,e=YH);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(e){var t=Math.max(0,Math.min(i-1,Math.floor(e*=i)));return s[t](e-t)}}function vX(){var e,t,n,i,r,s,o,a=0,l=.5,u=1,c=1,d=XH,h=!1;function p(e){return isNaN(e=+e)?o:(e=.5+((e=+s(e))-t)*(c*e<c*t?i:r),d(h?Math.max(0,Math.min(1,e)):e))}function f(e){return function(t){var n,i,r;return arguments.length?([n,i,r]=t,d=yX(e,[n,i,r]),p):[d(0),d(.5),d(1)]}}return p.domain=function(o){return arguments.length?([a,l,u]=o,e=s(a=+a),t=s(l=+l),n=s(u=+u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p):[a,l,u]},p.clamp=function(e){return arguments.length?(h=!!e,p):h},p.interpolator=function(e){return arguments.length?(d=e,p):d},p.range=f(YH),p.rangeRound=f(GH),p.unknown=function(e){return arguments.length?(o=e,p):o},function(o){return s=o,e=o(a),t=o(l),n=o(u),i=e===t?0:.5/(t-e),r=t===n?0:.5/(n-t),c=t<e?-1:1,p}}function bX(){var e=gW(vX());return e.copy=function(){return mX(e,bX()).exponent(e.exponent())},nW.apply(e,arguments)}function TX(e,t,n=dH){if((i=e.length)&&!isNaN(t=+t)){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e);return o+(+n(e[s+1],s+1,e)-o)*(r-s)}}const xX=Symbol("implicit");function EX(){var e=new nv,t=[],n=[],i=xX;function r(r){let s=e.get(r);if(void 0===s){if(i!==xX)return i;e.set(r,s=t.push(r)-1)}return n[s%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new nv;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return EX(t,n).unknown(i)},tW.apply(r,arguments),r}function wX(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function IX(e,t){var n=SH(+e,+t);return function(e){var t=n(e);return t-360*Math.floor(t/360)}}var AX,SX=180/Math.PI,CX={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function OX(e,t,n,i,r,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(a=Math.sqrt(n*n+i*i))&&(n/=a,i/=a,l/=a),e*i<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(t,e)*SX,skewX:Math.atan(l)*SX,scaleX:o,scaleY:a}}function MX(e,t,n,i){function r(e){return e.length?e.pop()+" ":""}return function(s,o){var a=[],l=[];return s=e(s),o=e(o),function(e,i,r,s,o,a){if(e!==r||i!==s){var l=o.push("translate(",null,t,null,n);a.push({i:l-4,x:$H(e,r)},{i:l-2,x:$H(i,s)})}else(r||s)&&o.push("translate("+r+t+s+n)}(s.translateX,s.translateY,o.translateX,o.translateY,a,l),function(e,t,n,s){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),s.push({i:n.push(r(n)+"rotate(",null,i)-2,x:$H(e,t)})):t&&n.push(r(n)+"rotate("+t+i)}(s.rotate,o.rotate,a,l),function(e,t,n,s){e!==t?s.push({i:n.push(r(n)+"skewX(",null,i)-2,x:$H(e,t)}):t&&n.push(r(n)+"skewX("+t+i)}(s.skewX,o.skewX,a,l),function(e,t,n,i,s,o){if(e!==n||t!==i){var a=s.push(r(s)+"scale(",null,",",null,")");o.push({i:a-4,x:$H(e,n)},{i:a-2,x:$H(t,i)})}else 1===n&&1===i||s.push(r(s)+"scale("+n+","+i+")")}(s.scaleX,s.scaleY,o.scaleX,o.scaleY,a,l),s=o=null,function(e){for(var t,n=-1,i=l.length;++n<i;)a[(t=l[n]).i]=t.x(e);return a.join("")}}}var kX=MX(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?CX:OX(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),RX=MX(function(e){return null==e?CX:(AX||(AX=document.createElementNS("http://www.w3.org/2000/svg","g")),AX.setAttribute("transform",e),(e=AX.transform.baseVal.consolidate())?OX((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):CX)},", ",")",")");function NX(e){return((e=Math.exp(e))+1/e)/2}const DX=function e(t,n,i){function r(e,r){var s,o,a=e[0],l=e[1],u=e[2],c=r[0],d=r[1],h=r[2],p=c-a,f=d-l,m=p*p+f*f;if(m<1e-12)o=Math.log(h/u)/t,s=function(e){return[a+e*p,l+e*f,u*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),_=(h*h-u*u+i*m)/(2*u*n*g),y=(h*h-u*u-i*m)/(2*h*n*g),v=Math.log(Math.sqrt(_*_+1)-_),b=Math.log(Math.sqrt(y*y+1)-y);o=(b-v)/t,s=function(e){var i=e*o,r=NX(v),s=u/(n*g)*(r*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*i+v)-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[a+s*p,l+s*f,u*r/NX(t*i+v)]}}return s.duration=1e3*o*t/Math.SQRT2,s}return r.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},r}(Math.SQRT2,2,4);function FX(e){return function(t,n){var i=e((t=B_(t)).h,(n=B_(n)).h),r=OH(t.s,n.s),s=OH(t.l,n.l),o=OH(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=r(e),t.l=s(e),t.opacity=o(e),t+""}}}const LX=FX(SH);var PX=FX(OH);function BX(e,t){var n=OH((e=Dv(e)).l,(t=Dv(t)).l),i=OH(e.a,t.a),r=OH(e.b,t.b),s=OH(e.opacity,t.opacity);return function(t){return e.l=n(t),e.a=i(t),e.b=r(t),e.opacity=s(t),e+""}}function $X(e){return function(t,n){var i=e((t=Vv(t)).h,(n=Vv(n)).h),r=OH(t.c,n.c),s=OH(t.l,n.l),o=OH(t.opacity,n.opacity);return function(e){return t.h=i(e),t.c=r(e),t.l=s(e),t.opacity=o(e),t+""}}}const UX=$X(SH);var VX=$X(OH);function zX(e){return function t(n){function i(t,i){var r=e((t=nb(t)).h,(i=nb(i)).h),s=OH(t.s,i.s),o=OH(t.l,i.l),a=OH(t.opacity,i.opacity);return function(e){return t.h=r(e),t.s=s(e),t.l=o(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,i.gamma=t,i}(1)}const jX=zX(SH);var YX=zX(OH);function GX(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const HX="year",WX="quarter",XX="month",qX="week",KX="date",ZX="day",QX="dayofyear",JX="hours",eq="minutes",tq="seconds",nq="milliseconds";[HX,WX,XX,qX,KX,ZX,QX,JX,eq,tq,nq].reduce((e,t,n)=>(e[t]=1+n,e),{});new Date;nX.every(3),iX.every(3);const iq=[HX,XX,KX,JX,eq,tq,nq],rq=iq.slice(0,-1),sq=rq.slice(0,-1),oq=sq.slice(0,-1);oq.slice(0,-1);const aq="linear",lq="log",uq="pow",cq="sqrt",dq="symlog",hq="time",pq="utc",fq="sequential",mq="diverging",gq="quantile",_q="quantize",yq="threshold",vq="continuous",bq="discrete",Tq="discretizing",xq="interpolating",Eq="temporal";function wq(){const e=EX().unknown(void 0),t=e.domain,n=e.range;let i,r,s=[0,1],o=!1,a=0,l=0,u=.5;function c(){const e=t().length,c=s[1]<s[0],d=s[1-c],h=function(e,t,n){const i=e-t+2*n;return e?i>0?i:1:0}(e,a,l);let p=s[c-0];i=(d-p)/(h||1),o&&(i=Math.floor(i)),p+=(d-p-i*(e-a))*u,r=i*(1-a),o&&(p=Math.round(p),r=Math.round(r));const f=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),s=new Array(r);++i<r;)s[i]=e+i*n;return s}(e).map(e=>p+i*e);return n(c?f.reverse():f)}return delete e.unknown,e.domain=function(e){return arguments.length?(t(e),c()):t()},e.range=function(e){return arguments.length?(s=[+e[0],+e[1]],c()):s.slice()},e.rangeRound=function(e){return s=[+e[0],+e[1]],o=!0,c()},e.bandwidth=function(){return r},e.step=function(){return i},e.round=function(e){return arguments.length?(o=!!e,c()):o},e.padding=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),a=l,c()):a},e.paddingInner=function(e){return arguments.length?(a=Math.max(0,Math.min(1,e)),c()):a},e.paddingOuter=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),c()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},e.invertRange=function(e){if(null==e[0]||null==e[1])return;const i=s[1]<s[0],o=i?n().reverse():n(),a=o.length-1;let l,u,c,d=+e[0],h=+e[1];return d!=d||h!=h||(h<d&&(c=d,d=h,h=c),h<o[0]||d>s[1-i])?void 0:(l=Math.max(0,pH(o,d)-1),u=d===h?l:pH(o,h)-1,d-o[l]>r+1e-10&&++l,i&&(c=l,l=a-u,u=a-c),l>u?void 0:t().slice(l,u+1))},e.invert=function(t){const n=e.invertRange([t,t]);return n?n[0]:n},e.copy=function(){return wq().domain(t()).range(s).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function Iq(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return Iq(t())},e}var Aq=Array.prototype.map;const Sq=Array.prototype.slice;const Cq=new Map,Oq=Symbol("vega_scale");function Mq(e,t,n){const i=function(){const n=t();return n.invertRange||(n.invertRange=n.invert?function(e){return function(t){let n,i=t[0],r=t[1];return r<i&&(n=i,i=r,r=n),[e.invert(i),e.invert(r)]}}(n):n.invertExtent?function(e){return function(t){const n=e.range();let i,r,s,o,a=t[0],l=t[1],u=-1;for(l<a&&(r=a,a=l,l=r),s=0,o=n.length;s<o;++s)n[s]>=a&&n[s]<=l&&(u<0&&(u=s),i=s);if(!(u<0))return a=e.invertExtent(n[u]),l=e.invertExtent(n[i]),[void 0===a[0]?a[1]:a[0],void 0===l[1]?l[0]:l[1]]}}(n):void 0),n.type=e,function(e){return e[Oq]=!0,e}(n)};return i.metadata=function(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}(sH(n)),i}function kq(e,t,n){return arguments.length>1?(Cq.set(e,Mq(e,t,n)),this):function(e){return Cq.has(e)}(e)?Cq.get(e):void 0}kq("identity",function e(t){var n;function i(e){return null==e||isNaN(e=+e)?n:e}return i.invert=i,i.domain=i.range=function(e){return arguments.length?(t=Array.from(e,HH),i):t.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return e(t).unknown(n)},t=arguments.length?Array.from(t,HH):[0,1],rW(i)}),kq(aq,function e(){var t=eW();return t.copy=function(){return QH(t,e())},tW.apply(t,arguments),rW(t)},vq),kq(lq,function e(){const t=hW(JH()).domain([1,10]);return t.copy=()=>QH(t,e()).base(t.base()),tW.apply(t,arguments),t},[vq,lq]),kq(uq,_W,vq),kq(cq,function(){return _W.apply(null,arguments).exponent(.5)},vq),kq(dq,function e(){var t=bW(JH());return t.copy=function(){return QH(t,e()).constant(t.constant())},tW.apply(t,arguments)},vq),kq(hq,function(){return tW.apply(pX(uX,cX,rX,nX,VW,PW,FW,NW,RW,lC).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},[vq,Eq]),kq(pq,function(){return tW.apply(pX(aX,lX,sX,iX,qW,BW,LW,DW,RW,cC).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},[vq,Eq]),kq(fq,gX,[vq,xq]),kq(`${fq}-${aq}`,gX,[vq,xq]),kq(`${fq}-${lq}`,function e(){var t=hW(fX()).domain([1,10]);return t.copy=function(){return mX(t,e()).base(t.base())},nW.apply(t,arguments)},[vq,xq,lq]),kq(`${fq}-${uq}`,_X,[vq,xq]),kq(`${fq}-${cq}`,function(){return _X.apply(null,arguments).exponent(.5)},[vq,xq]),kq(`${fq}-${dq}`,function e(){var t=bW(fX());return t.copy=function(){return mX(t,e()).constant(t.constant())},nW.apply(t,arguments)},[vq,xq]),kq(`${mq}-${aq}`,function e(){var t=rW(vX()(XH));return t.copy=function(){return mX(t,e())},nW.apply(t,arguments)},[vq,xq]),kq(`${mq}-${lq}`,function e(){var t=hW(vX()).domain([.1,1,10]);return t.copy=function(){return mX(t,e()).base(t.base())},nW.apply(t,arguments)},[vq,xq,lq]),kq(`${mq}-${uq}`,bX,[vq,xq]),kq(`${mq}-${cq}`,function(){return bX.apply(null,arguments).exponent(.5)},[vq,xq]),kq(`${mq}-${dq}`,function e(){var t=bW(vX());return t.copy=function(){return mX(t,e()).constant(t.constant())},nW.apply(t,arguments)},[vq,xq]),kq(gq,function e(){var t,n=[],i=[],r=[];function s(){var e=0,t=Math.max(1,i.length);for(r=new Array(t-1);++e<t;)r[e-1]=TX(n,e/t);return o}function o(e){return null==e||isNaN(e=+e)?t:i[fH(r,e)]}return o.invertExtent=function(e){var t=i.indexOf(e);return t<0?[NaN,NaN]:[t>0?r[t-1]:n[0],t<r.length?r[t]:n[n.length-1]]},o.domain=function(e){if(!arguments.length)return n.slice();n=[];for(let t of e)null==t||isNaN(t=+t)||n.push(t);return n.sort(aH),s()},o.range=function(e){return arguments.length?(i=Array.from(e),s()):i.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return e().domain(n).range(i).unknown(t)},tW.apply(o,arguments)},[Tq,gq]),kq(_q,function e(){var t,n=0,i=1,r=1,s=[.5],o=[0,1];function a(e){return null!=e&&e<=e?o[fH(s,e,0,r)]:t}function l(){var e=-1;for(s=new Array(r);++e<r;)s[e]=((e+1)*i-(e-r)*n)/(r+1);return a}return a.domain=function(e){return arguments.length?([n,i]=e,n=+n,i=+i,l()):[n,i]},a.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,l()):o.slice()},a.invertExtent=function(e){var t=o.indexOf(e);return t<0?[NaN,NaN]:t<1?[n,s[0]]:t>=r?[s[r-1],i]:[s[t-1],s[t]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return s.slice()},a.copy=function(){return e().domain([n,i]).range(o).unknown(t)},tW.apply(rW(a),arguments)},Tq),kq(yq,function e(){var t,n=[.5],i=[0,1],r=1;function s(e){return null!=e&&e<=e?i[fH(n,e,0,r)]:t}return s.domain=function(e){return arguments.length?(n=Array.from(e),r=Math.min(n.length,i.length-1),s):n.slice()},s.range=function(e){return arguments.length?(i=Array.from(e),r=Math.min(n.length,i.length-1),s):i.slice()},s.invertExtent=function(e){var t=i.indexOf(e);return[n[t-1],n[t]]},s.unknown=function(e){return arguments.length?(t=e,s):t},s.copy=function(){return e().domain(n).range(i).unknown(t)},tW.apply(s,arguments)},Tq),kq("bin-ordinal",function e(){let t=[],n=[];function i(e){return null==e||e!=e?void 0:n[(fH(t,e)-1)%n.length]}return i.domain=function(e){return arguments.length?(t=function(e){return Aq.call(e,rH)}(e),i):t.slice()},i.range=function(e){return arguments.length?(n=Sq.call(e),i):n.slice()},i.tickFormat=function(e,n){return iW(t[0],iH(t),null==e?10:e,n)},i.copy=function(){return e().domain(i.domain()).range(i.range())},i},[bq,Tq]),kq("ordinal",EX,bq),kq("band",wq,bq),kq("point",function(){return Iq(wq().paddingInner(1))},bq);function Rq(e,t,n){return yX(function(e,t){const n=g[function(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}(t||"rgb",n),e)}function Nq(e){if(nH(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(6*i,6*++i);return n}function Dq(e,t){for(const n in e)Lq(n,t(e[n]))}const Fq={};function Lq(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(Fq[e]=t,this):Fq[e]}Dq({accent:ub,category10:cb,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:db,observable10:hb,paired:pb,pastel1:fb,pastel2:mb,set1:gb,set2:_b,set3:yb,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"},Nq),Dq({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},e=>Rq(Nq(e)));var Pq=Math.random;Math.sqrt(2*Math.PI),Math.SQRT2;Math.PI;var Bq=Math.PI/180,$q=64,Uq=2048;function Vq(){var e,t,n,i,r,s,o,a=[256,256],l=Hq,u=[],c=Math.random,d={};function h(e,t,n){for(var i,r,s,o=t.x,u=t.y,d=Math.hypot(a[0],a[1]),h=l(a),p=c()<.5?1:-1,f=-p;(i=h(f+=p))&&(r=~~i[0],s=~~i[1],!(Math.min(Math.abs(r),Math.abs(s))>=d));)if(t.x=o+r,t.y=u+s,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>a[0]||t.y+t.y1>a[1])&&(!n||!jq(t,e,a[0]))&&(!n||Gq(t,n))){for(var m,g=t.sprite,_=t.width>>5,y=a[0]>>5,v=t.x-(_<<4),b=127&v,T=32-b,x=t.y1-t.y0,E=(t.y+t.y0)*y+(v>>5),w=0;w<x;w++){m=0;for(var I=0;I<=_;I++)e[E+I]|=m<<T|(I<_?(m=g[w*_+I])>>>b:0);E+=y}return t.sprite=null,!0}return!1}return d.layout=function(){for(var l=function(e){e.width=e.height=1;var t=Math.sqrt(e.getContext("2d").getImageData(0,0,1,1).data.length>>2);e.width=($q<<5)/t,e.height=Uq/t;var n=e.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:t}}(Tp()),d=function(e){var t=[],n=-1;for(;++n<e;)t[n]=0;return t}((a[0]>>5)*a[1]),p=null,f=u.length,m=-1,g=[],_=u.map(a=>({text:e(a),font:t(a),style:i(a),weight:r(a),rotate:s(a),size:~~(n(a)+1e-14),padding:o(a),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:a})).sort((e,t)=>t.size-e.size);++m<f;){var y=_[m];y.x=a[0]*(c()+.5)>>1,y.y=a[1]*(c()+.5)>>1,zq(l,y,_,m),y.hasText&&h(d,y,p)&&(g.push(y),p?Yq(p,y):p=[{x:y.x+y.x0,y:y.y+y.y0},{x:y.x+y.x1,y:y.y+y.y1}],y.x-=a[0]>>1,y.y-=a[1]>>1)}return g},d.words=function(e){return arguments.length?(u=e,d):u},d.size=function(e){return arguments.length?(a=[+e[0],+e[1]],d):a},d.font=function(e){return arguments.length?(t=Wq(e),d):t},d.fontStyle=function(e){return arguments.length?(i=Wq(e),d):i},d.fontWeight=function(e){return arguments.length?(r=Wq(e),d):r},d.rotate=function(e){return arguments.length?(s=Wq(e),d):s},d.text=function(t){return arguments.length?(e=Wq(t),d):e},d.spiral=function(e){return arguments.length?(l=Xq[e]||e,d):l},d.fontSize=function(e){return arguments.length?(n=Wq(e),d):n},d.padding=function(e){return arguments.length?(o=Wq(e),d):o},d.random=function(e){return arguments.length?(c=e,d):c},d}function zq(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,($q<<5)/s,Uq/s);var o,a,l,u,c,d=0,h=0,p=0,f=n.length;for(--i;++i<f;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,o=r.measureText(t.text+"m").width*s,l=t.size<<1,t.rotate){var m=Math.sin(t.rotate*Bq),g=Math.cos(t.rotate*Bq),_=o*g,y=o*m,v=l*g,b=l*m;o=Math.max(Math.abs(_+b),Math.abs(_-b))+31>>5<<5,l=~~Math.max(Math.abs(y+v),Math.abs(y-v))}else o=o+31>>5<<5;if(l>p&&(p=l),d+o>=$q<<5&&(d=0,h+=p,p=0),h+l>=Uq)break;r.translate((d+(o>>1))/s,(h+(l>>1))/s),t.rotate&&r.rotate(t.rotate*Bq),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=o,t.height=l,t.xoff=d,t.yoff=h,t.x1=o>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,d+=o}for(var T=r.getImageData(0,0,($q<<5)/s,Uq/s).data,x=[];--i>=0;)if((t=n[i]).hasText){for(a=(o=t.width)>>5,l=t.y1-t.y0,u=0;u<l*a;u++)x[u]=0;if(null==(d=t.xoff))return;h=t.yoff;var E=0,w=-1;for(c=0;c<l;c++){for(u=0;u<o;u++){var I=a*c+(u>>5),A=T[(h+c)*($q<<5)+(d+u)<<2]?1<<31-u%32:0;x[I]|=A,E|=A}E?w=c:(t.y0++,l--,c--,h++)}t.y1=t.y0+w,t.sprite=x.slice(0,(t.y1-t.y0)*a)}}}function jq(e,t,n){n>>=5;for(var i,r=e.sprite,s=e.width>>5,o=e.x-(s<<4),a=127&o,l=32-a,u=e.y1-e.y0,c=(e.y+e.y0)*n+(o>>5),d=0;d<u;d++){i=0;for(var h=0;h<=s;h++)if((i<<l|(h<s?(i=r[d*s+h])>>>a:0))&t[c+h])return!0;c+=n}return!1}function Yq(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Gq(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function Hq(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function Wq(e){return"function"==typeof e?e:function(){return e}}var Xq={archimedean:Hq,rectangular:function(e){var t=4*e[0]/e[1],n=0,i=0;return function(e){var r=e<0?-1:1;switch(Math.sqrt(1+4*r*e)-r&3){case 0:n+=t;break;case 1:i+=4;break;case 2:n-=t;break;default:i-=4}return[n,i]}}};const qq=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Kq=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Zq(e){Ho.call(this,Vq(),e)}Zq.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:qq}]},function(e,t,n){const i=e.prototype=Object.create(t.prototype);Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),function(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n]}(i,n)}(Zq,Ho,{transform(e,t){!e.size||e.size[0]&&e.size[1]||JG("Wordcloud size dimensions must be non-zero.");const n=e.modified();if(!(n||t.changed(t.ADD_REM)||Kq.some(function(n){const i=e[n];return oH(i)&&t.modified(i.fields)})))return;const i=t.materialize(t.SOURCE).source,r=this.value,s=e.as||qq;let o,a=e.fontSize||14;if(oH(a)?o=e.fontSizeRange:a=function(e){return oH(e)?e:()=>e}(a),o){const e=a,t=kq("sqrt")().domain(function(e,t){let n,i,r,s,o=0;if(e&&(n=e.length))if(null==t){for(i=e[o];o<n&&(null==i||i!=i);i=e[++o]);for(r=s=i;o<n;++o)i=e[o],null!=i&&(i<r&&(r=i),i>s&&(s=i))}else{for(i=t(e[o]);o<n&&(null==i||i!=i);i=t(e[++o]));for(r=s=i;o<n;++o)i=t(e[o]),null!=i&&(i<r&&(r=i),i>s&&(s=i))}return[r,s]}(i,e)).range(o);a=n=>t(e(n))}i.forEach(e=>{e[s[0]]=NaN,e[s[1]]=NaN,e[s[3]]=0});const l=r.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Pq).layout(),u=r.size(),c=u[0]>>1,d=u[1]>>1,h=l.length;for(let e,t,n=0;n<h;++n)e=l[n],t=e.datum,t[s[0]]=e.x+c,t[s[1]]=e.y+d,t[s[2]]=e.font,t[s[3]]=e.size,t[s[4]]=e.style,t[s[5]]=e.weight,t[s[6]]=e.rotate;return t.reflow(n).modifies(s)}});const Qq=e=>new Uint8Array(e),Jq=e=>new Uint16Array(e),eK=e=>new Uint32Array(e);function tK(e,t,n){const i=(t<257?Qq:t<65537?Jq:eK)(e);return n&&i.set(n),i}function nK(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(e,t){const n=this,r=n.bisect(n.range,e.value),s=e.index,o=r[0],a=r[1],l=s.length;let u;for(u=0;u<o;++u)t[s[u]]|=i;for(u=a;u<l;++u)t[s[u]]|=i;return n}}}function iK(){let e=eK(0),t=[],n=0;return{insert:function(i,r,s){if(!r.length)return[];const o=n,a=r.length,l=eK(a);let u,c,d,h=Array(a);for(d=0;d<a;++d)h[d]=i(r[d]),l[d]=d;if(h=function(e,t){return e.sort.call(t,(t,n)=>{const i=e[t],r=e[n];return i<r?-1:i>r?1:0}),function(e,t){return Array.from(t,t=>e[t])}(e,t)}(h,l),o)u=t,c=e,t=Array(o+a),e=eK(o+a),function(e,t,n,i,r,s,o,a,l){let u,c=0,d=0;for(u=0;c<i&&d<o;++u)t[c]<r[d]?(a[u]=t[c],l[u]=n[c++]):(a[u]=r[d],l[u]=s[d++]+e);for(;c<i;++c,++u)a[u]=t[c],l[u]=n[c];for(;d<o;++d,++u)a[u]=r[d],l[u]=s[d]+e}(s,u,c,o,h,l,a,t,e);else{if(s>0)for(d=0;d<a;++d)l[d]+=s;t=h,e=l}return n=o+a,{index:l,value:h}},remove:function(i,r){const s=n;let o,a,l;for(a=0;!r[e[a]]&&a<s;++a);for(l=a;a<s;++a)r[o=e[a]]||(e[l]=o,t[l]=t[a],++l);n=s-i},bisect:function(e,i){let r;return i?r=i.length:(i=t,r=n),[XA(i,e[0],0,r),WA(i,e[1],0,r)]},reindex:function(t){for(let i=0,r=n;i<r;++i)e[i]=t[e[i]]},index:()=>e,size:()=>n}}function rK(e){Ho.call(this,function(){let e=8,t=[],n=eK(0),i=tK(0,e),r=tK(0,e);return{data:()=>t,seen:()=>n=function(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(n,t.length),add(e){for(let n,i=0,r=t.length,s=e.length;i<s;++i)n=e[i],n._index=r++,t.push(n)},remove(e,n){const s=t.length,o=Array(s-e),a=t;let l,u,c;for(u=0;!n[u]&&u<s;++u)o[u]=t[u],a[u]=u;for(c=u;u<s;++u)l=t[u],n[u]?a[u]=-1:(a[u]=c,i[c]=i[u],r[c]=r[u],o[c]=l,l._index=c++),i[u]=0;return t=o,a},size:()=>t.length,curr:()=>i,prev:()=>r,reset:e=>r[e]=i[e],all:()=>e<257?255:e<65537?65535:4294967295,set(e,t){i[e]|=t},clear(e,t){i[e]&=~t},resize(t,n){(t>i.length||n>e)&&(e=Math.max(n,e),i=tK(t,e,i),r=tK(t,e))}}}(),e),this._indices=null,this._dims=null}function sK(e){Ho.call(this,null,e)}function oK(e,t,n){return e.fields=t||[],e.fname=n,e}function aK(e){return 1===e.length?lK(e[0]):uK(e)}rK.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},pt(rK,Ho,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a,l,u=0;for(;u<o;++u)a=n[u].fname,l=r[a]||(r[a]=iK()),s.push(nK(l,u,i[u]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,l=a.curr(),u=a.prev(),c=a.all(),d=n.rem=n.add,h=n.mod,p=r.length,f={};let m,g,_,y,v,b,T,x,E;if(u.set(l),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(b={},y=t.mod,T=0,x=y.length;T<x;++T)b[y[T]._index]=1;for(T=0;T<p;++T)E=i[T],(!o[T]||e.modified("fields",T)||t.modified(E.fields))&&(_=E.fname,(m=f[_])||(s[_]=g=iK(),f[_]=m=g.insert(E,t.source,0)),o[T]=nK(g,T,r[T]).onAdd(m,l));for(T=0,x=a.data().length;T<x;++T)v[T]||(u[T]!==l[T]?d.push(T):b[T]&&l[T]!==c&&h.push(T));return a.mask=(1<<p)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,l={},u=n.add,c=r.size()+i.length,d=s.length;let h,p,f,m=r.size();r.resize(c,d),r.add(i);const g=r.curr(),_=r.prev(),y=r.all();for(h=0;h<d;++h)p=a[h].fname,f=l[p]||(l[p]=o[p].insert(a[h],i,m)),s[h].onAdd(f,g);for(;m<c;++m)_[m]=y,g[m]!==y&&u.push(m)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,l,u;for(a=0,l=o.length;a<l;++a)u=o[a]._index,r[u]!==s&&n.push(u)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),l={},u=n.rem,c=t.rem;let d,h,p,f;for(d=0,h=c.length;d<h;++d)p=c[d]._index,l[p]=1,o[p]=f=s[p],s[p]=a,f!==a&&u.push(p);for(p in i)i[p].remove(h,l);return this.reindex(t,h,l),l},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const e=r.remove(t,n);for(const t in i)i[t].reindex(e)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a,l,u=0;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(a=l,++u);if(1===u)u=i[a].one,this.incrementOne(i[a],r[a],n.add,n.rem);else for(l=0,u=0;l<o;++l)e.modified("query",l)&&(u|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return u},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),l=e.index(),u=e.bisect(e.range),c=e.bisect(t),d=c[0],h=c[1],p=u[0],f=u[1],m=e.one;let g,_,y;if(d<p)for(g=d,_=Math.min(p,h);g<_;++g)y=l[g],s[y]!==n&&(a[y]=o[y],s[y]=n,i.push(y)),o[y]^=m;else if(d>p)for(g=p,_=Math.min(d,f);g<_;++g)y=l[g],s[y]!==n&&(a[y]=o[y],s[y]=n,i.push(y)),o[y]^=m;if(h>f)for(g=Math.max(d,f),_=h;g<_;++g)y=l[g],s[y]!==n&&(a[y]=o[y],s[y]=n,i.push(y)),o[y]^=m;else if(h<f)for(g=Math.max(p,h),_=f;g<_;++g)y=l[g],s[y]!==n&&(a[y]=o[y],s[y]=n,i.push(y)),o[y]^=m;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value.curr(),s=e.index(),o=e.bisect(e.range),a=e.bisect(t),l=a[0],u=a[1],c=o[0],d=o[1],h=e.one;let p,f,m;if(l<c)for(p=l,f=Math.min(c,u);p<f;++p)m=s[p],r[m]^=h,n.push(m);else if(l>c)for(p=c,f=Math.min(l,d);p<f;++p)m=s[p],r[m]^=h,i.push(m);if(u>d)for(p=Math.max(l,d),f=u;p<f;++p)m=s[p],r[m]^=h,n.push(m);else if(u<d)for(p=Math.max(c,u),f=d;p<f;++p)m=s[p],r[m]^=h,i.push(m);e.range=t.slice()}}),sK.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]},pt(sK,Ho,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(0===(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),l=i.prev(),u=e=>a[e]&n?null:o[e];return s.filter(s.MOD,u),r&r-1?(s.filter(s.ADD,e=>{const t=a[e]&n;return!t&&t^l[e]&n?o[e]:null}),s.filter(s.REM,e=>{const t=a[e]&n;return t&&!(t^t^l[e]&n)?o[e]:null})):(s.filter(s.ADD,u),s.filter(s.REM,e=>(a[e]&n)===r?o[e]:null)),s.filter(s.SOURCE,e=>u(e._index))}});const lK=e=>function(t){return t[e]},uK=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function cK(e){throw Error(e)}function dK(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||cK("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&cK("Access path missing closing bracket: "+e),o&&cK("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function hK(e,t,n){const i=dK(e);return e=1===i.length?i[0]:e,oK((n&&n.get||aK)(i),[e],t||e)}hK("id");const pK=oK(e=>e,[],"identity"),fK=(oK(()=>0,[],"zero"),oK(()=>1,[],"one"),oK(()=>!0,[],"true"));oK(()=>!1,[],"false");var mK=Array.isArray;function gK(e){return e===Object(e)}function _K(e){return e[e.length-1]}function yK(e){return null==e||""===e?null:+e}const vK=e=>t=>e*Math.exp(t),bK=e=>t=>Math.log(e*t),TK=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),xK=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,EK=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function wK(e,t,n,i){const r=n(e[0]),s=n(_K(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function IK(e,t,n,i,r){const s=i(e[0]),o=i(_K(e)),a=null!=t?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function AK(e){return null!=e?mK(e)?e:[e]:[]}function SK(e){return"function"==typeof e}function CK(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function OK(e,t){return Object.hasOwn(e,t)}function MK(e){return"[object Date]"===Object.prototype.toString.call(e)}function kK(e){return"number"==typeof e}function RK(e){return"string"==typeof e}function NK(e,t){let n="";for(;--t>=0;)n+=e;return n}function DK(e){return mK(e)?"["+e.map(DK)+"]":gK(e)||RK(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}const FK=e=>kK(e)||MK(e)?e:Date.parse(e);function LK(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}const PK="Literal",BK="Property",$K="ArrayExpression",UK="BinaryExpression",VK="CallExpression",zK="ConditionalExpression",jK="LogicalExpression",YK="MemberExpression",GK="ObjectExpression",HK="UnaryExpression";function WK(e){this.type=e}var XK,qK,KK,ZK,QK;WK.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case $K:return e.elements;case UK:case jK:return[e.left,e.right];case VK:return[e.callee].concat(e.arguments);case zK:return[e.test,e.consequent,e.alternate];case YK:return[e.object,e.property];case GK:return e.properties;case BK:return[e.key,e.value];case HK:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};var JK=1,eZ=2,tZ=3,nZ=4,iZ=5,rZ=6,sZ=7,oZ=8;(XK={})[JK]="Boolean",XK[eZ]="<end>",XK[tZ]="Identifier",XK[nZ]="Keyword",XK[iZ]="Null",XK[rZ]="Numeric",XK[sZ]="Punctuator",XK[oZ]="String",XK[9]="RegularExpression";var aZ="ArrayExpression",lZ="BinaryExpression",uZ="CallExpression",cZ="ConditionalExpression",dZ="Identifier",hZ="Literal",pZ="LogicalExpression",fZ="MemberExpression",mZ="ObjectExpression",gZ="Property",_Z="UnaryExpression",yZ="Unexpected token %0",vZ="Unexpected number",bZ="Unexpected string",TZ="Unexpected identifier",xZ="Unexpected reserved word",EZ="Unexpected end of input",wZ="Invalid regular expression",IZ="Invalid regular expression: missing /",AZ="Octal literals are not allowed in strict mode.",SZ="Duplicate data property in object literal not allowed in strict mode",CZ="ILLEGAL",OZ="Disabled.",MZ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),kZ=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function RZ(e,t){if(!e)throw new Error("ASSERT: "+t)}function NZ(e){return e>=48&&e<=57}function DZ(e){return"0123456789abcdefABCDEF".includes(e)}function FZ(e){return"01234567".includes(e)}function LZ(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function PZ(e){return 10===e||13===e||8232===e||8233===e}function BZ(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&MZ.test(String.fromCharCode(e))}function $Z(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&kZ.test(String.fromCharCode(e))}const UZ={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function VZ(){for(;KK<ZK;){const e=qK.charCodeAt(KK);if(!LZ(e)&&!PZ(e))break;++KK}}function zZ(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)KK<ZK&&DZ(qK[KK])?(i=qK[KK++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):rQ({},yZ,CZ);return String.fromCharCode(r)}function jZ(){var e,t,n,i;for(t=0,"}"===(e=qK[KK])&&rQ({},yZ,CZ);KK<ZK&&DZ(e=qK[KK++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&rQ({},yZ,CZ),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function YZ(){var e,t;for(e=qK.charCodeAt(KK++),t=String.fromCharCode(e),92===e&&(117!==qK.charCodeAt(KK)&&rQ({},yZ,CZ),++KK,(e=zZ("u"))&&"\\"!==e&&BZ(e.charCodeAt(0))||rQ({},yZ,CZ),t=e);KK<ZK&&$Z(e=qK.charCodeAt(KK));)++KK,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==qK.charCodeAt(KK)&&rQ({},yZ,CZ),++KK,(e=zZ("u"))&&"\\"!==e&&$Z(e.charCodeAt(0))||rQ({},yZ,CZ),t+=e);return t}function GZ(){var e,t;return e=KK,t=92===qK.charCodeAt(KK)?YZ():function(){var e,t;for(e=KK++;KK<ZK;){if(92===(t=qK.charCodeAt(KK)))return KK=e,YZ();if(!$Z(t))break;++KK}return qK.slice(e,KK)}(),{type:1===t.length?tZ:UZ.hasOwnProperty(t)?nZ:"null"===t?iZ:"true"===t||"false"===t?JK:tZ,value:t,start:e,end:KK}}function HZ(){var e,t,n,i,r=KK,s=qK.charCodeAt(KK),o=qK[KK];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++KK,{type:sZ,value:String.fromCharCode(s),start:r,end:KK};default:if(61===(e=qK.charCodeAt(KK+1)))switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return KK+=2,{type:sZ,value:String.fromCharCode(s)+String.fromCharCode(e),start:r,end:KK};case 33:case 61:return KK+=2,61===qK.charCodeAt(KK)&&++KK,{type:sZ,value:qK.slice(r,KK),start:r,end:KK}}}return">>>="===(i=qK.substr(KK,4))?{type:sZ,value:i,start:r,end:KK+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:sZ,value:n,start:r,end:KK+=3}:o===(t=n.substr(0,2))[1]&&"+-<>&|".includes(o)||"=>"===t?{type:sZ,value:t,start:r,end:KK+=2}:("//"===t&&rQ({},yZ,CZ),"<>=!+-*%&|^/".includes(o)?(++KK,{type:sZ,value:o,start:r,end:KK}):void rQ({},yZ,CZ))}function WZ(){var e,t,n;if(RZ(NZ((n=qK[KK]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=KK,e="","."!==n){if(e=qK[KK++],n=qK[KK],"0"===e){if("x"===n||"X"===n)return++KK,function(e){let t="";for(;KK<ZK&&DZ(qK[KK]);)t+=qK[KK++];return 0===t.length&&rQ({},yZ,CZ),BZ(qK.charCodeAt(KK))&&rQ({},yZ,CZ),{type:rZ,value:parseInt("0x"+t,16),start:e,end:KK}}(t);if(FZ(n))return function(e){let t="0"+qK[KK++];for(;KK<ZK&&FZ(qK[KK]);)t+=qK[KK++];return(BZ(qK.charCodeAt(KK))||NZ(qK.charCodeAt(KK)))&&rQ({},yZ,CZ),{type:rZ,value:parseInt(t,8),octal:!0,start:e,end:KK}}(t);n&&NZ(n.charCodeAt(0))&&rQ({},yZ,CZ)}for(;NZ(qK.charCodeAt(KK));)e+=qK[KK++];n=qK[KK]}if("."===n){for(e+=qK[KK++];NZ(qK.charCodeAt(KK));)e+=qK[KK++];n=qK[KK]}if("e"===n||"E"===n)if(e+=qK[KK++],"+"!==(n=qK[KK])&&"-"!==n||(e+=qK[KK++]),NZ(qK.charCodeAt(KK)))for(;NZ(qK.charCodeAt(KK));)e+=qK[KK++];else rQ({},yZ,CZ);return BZ(qK.charCodeAt(KK))&&rQ({},yZ,CZ),{type:rZ,value:parseFloat(e),start:t,end:KK}}function XZ(){var e,t,n,i;return QK=null,VZ(),e=KK,t=function(){var e,t,n,i;for(RZ("/"===(e=qK[KK]),"Regular expression literal must start with a slash"),t=qK[KK++],n=!1,i=!1;KK<ZK;)if(t+=e=qK[KK++],"\\"===e)PZ((e=qK[KK++]).charCodeAt(0))&&rQ({},IZ),t+=e;else if(PZ(e.charCodeAt(0)))rQ({},IZ);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||rQ({},IZ),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";KK<ZK&&$Z((e=qK[KK]).charCodeAt(0));)++KK,"\\"===e&&KK<ZK?rQ({},yZ,CZ):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&rQ({},wZ,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(e,t)=>{if(parseInt(t,16)<=1114111)return"x";rQ({},wZ)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){rQ({},wZ)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:KK}}function qZ(){if(VZ(),KK>=ZK)return{type:eZ,start:KK,end:KK};const e=qK.charCodeAt(KK);return BZ(e)?GZ():40===e||41===e||59===e?HZ():39===e||34===e?function(){var e,t,n,i,r="",s=!1;for(RZ("'"===(e=qK[KK])||'"'===e,"String literal must starts with a quote"),t=KK,++KK;KK<ZK;){if((n=qK[KK++])===e){e="";break}if("\\"===n)if((n=qK[KK++])&&PZ(n.charCodeAt(0)))"\r"===n&&"\n"===qK[KK]&&++KK;else switch(n){case"u":case"x":"{"===qK[KK]?(++KK,r+=jZ()):r+=zZ(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:FZ(n)?(0!==(i="01234567".indexOf(n))&&(s=!0),KK<ZK&&FZ(qK[KK])&&(s=!0,i=8*i+"01234567".indexOf(qK[KK++]),"0123".includes(n)&&KK<ZK&&FZ(qK[KK])&&(i=8*i+"01234567".indexOf(qK[KK++]))),r+=String.fromCharCode(i)):r+=n}else{if(PZ(n.charCodeAt(0)))break;r+=n}}return""!==e&&rQ({},yZ,CZ),{type:oZ,value:r,octal:s,start:t,end:KK}}():46===e?NZ(qK.charCodeAt(KK+1))?WZ():HZ():NZ(e)?WZ():HZ()}function KZ(){const e=QK;return KK=e.end,QK=qZ(),KK=e.end,e}function ZZ(){const e=KK;QK=qZ(),KK=e}function QZ(e,t,n){const i=new WK("||"===e||"&&"===e?pZ:lZ);return i.operator=e,i.left=t,i.right=n,i}function JZ(e,t){const n=new WK(uZ);return n.callee=e,n.arguments=t,n}function eQ(e){const t=new WK(dZ);return t.name=e,t}function tQ(e){const t=new WK(hZ);return t.value=e.value,t.raw=qK.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function nQ(e,t,n){const i=new WK(fZ);return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function iQ(e,t,n){const i=new WK(gZ);return i.key=t,i.value=n,i.kind=e,i}function rQ(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(e,t)=>(RZ(t<i.length,"Message reference must be in range"),i[t]));throw(n=new Error(r)).index=KK,n.description=r,n}function sQ(e){e.type===eZ&&rQ(e,EZ),e.type===rZ&&rQ(e,vZ),e.type===oZ&&rQ(e,bZ),e.type===tZ&&rQ(e,TZ),e.type===nZ&&rQ(e,xZ),rQ(e,yZ,e.value)}function oQ(e){const t=KZ();t.type===sZ&&t.value===e||sQ(t)}function aQ(e){return QK.type===sZ&&QK.value===e}function lQ(e){return QK.type===nZ&&QK.value===e}function uQ(){const e=[];for(KK=QK.start,oQ("[");!aQ("]");)aQ(",")?(KZ(),e.push(null)):(e.push(xQ()),aQ("]")||oQ(","));return KZ(),function(e){const t=new WK(aZ);return t.elements=e,t}(e)}function cQ(){KK=QK.start;const e=KZ();return e.type===oZ||e.type===rZ?(e.octal&&rQ(e,AZ),tQ(e)):eQ(e.value)}function dQ(){var e,t,n;return KK=QK.start,(e=QK).type===tZ?(n=cQ(),oQ(":"),iQ("init",n,xQ())):e.type!==eZ&&e.type!==sZ?(t=cQ(),oQ(":"),iQ("init",t,xQ())):void sQ(e)}function hQ(){var e,t,n=[],i={},r=String;for(KK=QK.start,oQ("{");!aQ("}");)t="$"+((e=dQ()).key.type===dZ?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?rQ({},SZ):i[t]=!0,n.push(e),aQ("}")||oQ(",");return oQ("}"),function(e){const t=new WK(mZ);return t.properties=e,t}(n)}const pQ={if:1};function fQ(){var e,t,n;if(aQ("("))return function(){oQ("(");const e=EQ();return oQ(")"),e}();if(aQ("["))return uQ();if(aQ("{"))return hQ();if(e=QK.type,KK=QK.start,e===tZ||pQ[QK.value])n=eQ(KZ().value);else if(e===oZ||e===rZ)QK.octal&&rQ(QK,AZ),n=tQ(KZ());else{if(e===nZ)throw new Error(OZ);e===JK?((t=KZ()).value="true"===t.value,n=tQ(t)):e===iZ?((t=KZ()).value=null,n=tQ(t)):aQ("/")||aQ("/=")?(n=tQ(XZ()),ZZ()):sQ(KZ())}return n}function mQ(){const e=[];if(oQ("("),!aQ(")"))for(;KK<ZK&&(e.push(xQ()),!aQ(")"));)oQ(",");return oQ(")"),e}function gQ(){KK=QK.start;const e=KZ();return function(e){return e.type===tZ||e.type===nZ||e.type===JK||e.type===iZ}(e)||sQ(e),eQ(e.value)}function _Q(){return oQ("."),gQ()}function yQ(){oQ("[");const e=EQ();return oQ("]"),e}function vQ(){const e=function(){var e;for(e=fQ();;)if(aQ("."))e=nQ(".",e,_Q());else if(aQ("("))e=JZ(e,mQ());else{if(!aQ("["))break;e=nQ("[",e,yQ())}return e}();if(QK.type===sZ&&(aQ("++")||aQ("--")))throw new Error(OZ);return e}function bQ(){var e,t;if(QK.type!==sZ&&QK.type!==nZ)t=vQ();else{if(aQ("++")||aQ("--"))throw new Error(OZ);if(aQ("+")||aQ("-")||aQ("~")||aQ("!"))e=KZ(),t=bQ(),t=function(e,t){const n=new WK(_Z);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(lQ("delete")||lQ("void")||lQ("typeof"))throw new Error(OZ);t=vQ()}}return t}function TQ(e){let t=0;if(e.type!==sZ&&e.type!==nZ)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function xQ(){var e,t;return e=function(){var e,t,n,i,r,s,o,a,l,u;if(e=QK,l=bQ(),0===(r=TQ(i=QK)))return l;for(i.prec=r,KZ(),t=[e,QK],s=[l,i,o=bQ()];(r=TQ(QK))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=QZ(a,l,o),s.push(n);(i=KZ()).prec=r,s.push(i),t.push(QK),n=bQ(),s.push(n)}for(n=s[u=s.length-1],t.pop();u>1;)t.pop(),n=QZ(s[u-1].value,s[u-2],n),u-=2;return n}(),aQ("?")&&(KZ(),t=xQ(),oQ(":"),e=function(e,t,n){const i=new WK(cZ);return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,xQ())),e}function EQ(){const e=xQ();if(aQ(","))throw new Error(OZ);return e}var wQ={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function IQ(e){function t(t,n,i){return r=>function(t,n,i,r){let s=e(n[0]);return i&&(s=i+"("+s+")",0===i.lastIndexOf("new ",0)&&(s="("+s+")")),s+"."+t+(r<0?"":0===r?"()":"("+n.slice(1).map(e).join(",")+")")}(t,r,n,i)}const n="new Date",i="String",r="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&cK("Missing arguments to clamp function."),t.length>3&&cK("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",i,0),lower:t("toLowerCase",i,0),substring:t("substring",i),split:t("split",i),trim:t("trim",i,0),btoa:"btoa",atob:"atob",regexp:r,test:t("test",r),if:function(t){t.length<3&&cK("Missing arguments to if function."),t.length>3&&cK("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}var AQ,SQ,CQ,OQ,MQ,kQ,RQ,NQ,DQ,FQ,LQ,PQ,BQ,$Q,UQ,VQ,zQ=new iR,jQ=new iR,YQ={point:SR,lineStart:SR,lineEnd:SR,polygonStart:function(){zQ=new iR,YQ.lineStart=GQ,YQ.lineEnd=HQ},polygonEnd:function(){var e=+zQ;jQ.add(e<0?uR+e:e),this.lineStart=this.lineEnd=this.point=SR},sphere:function(){jQ.add(uR)}};function GQ(){YQ.point=WQ}function HQ(){XQ(AQ,SQ)}function WQ(e,t){YQ.point=XQ,AQ=e,SQ=t,CQ=e*=dR,OQ=mR(t=(t*=dR)/2+lR),MQ=TR(t)}function XQ(e,t){var n=(e*=dR)-CQ,i=n>=0?1:-1,r=i*n,s=mR(t=(t*=dR)/2+lR),o=TR(t),a=MQ*o,l=OQ*s+a*mR(r),u=a*i*TR(r);zQ.add(fR(u,l)),CQ=e,OQ=s,MQ=o}var qQ,KQ,ZQ,QQ,JQ,eJ,tJ,nJ,iJ,rJ,sJ,oJ,aJ,lJ,uJ,cJ,dJ={point:hJ,lineStart:fJ,lineEnd:mJ,polygonStart:function(){dJ.point=gJ,dJ.lineStart=_J,dJ.lineEnd=yJ,$Q=new iR,YQ.polygonStart()},polygonEnd:function(){YQ.polygonEnd(),dJ.point=hJ,dJ.lineStart=fJ,dJ.lineEnd=mJ,zQ<0?(kQ=-(NQ=180),RQ=-(DQ=90)):$Q>rR?DQ=90:$Q<-rR&&(RQ=-90),VQ[0]=kQ,VQ[1]=NQ},sphere:function(){kQ=-(NQ=180),RQ=-(DQ=90)}};function hJ(e,t){UQ.push(VQ=[kQ=e,NQ=e]),t<RQ&&(RQ=t),t>DQ&&(DQ=t)}function pJ(e,t){var n=LN([e*dR,t*dR]);if(BQ){var i=BN(BQ,n),r=BN([i[1],-i[0],0],i);VN(r),r=FN(r);var s,o=e-FQ,a=o>0?1:-1,l=r[0]*cR*a,u=hR(o)>180;u^(a*FQ<l&&l<a*e)?(s=r[1]*cR)>DQ&&(DQ=s):u^(a*FQ<(l=(l+360)%360-180)&&l<a*e)?(s=-r[1]*cR)<RQ&&(RQ=s):(t<RQ&&(RQ=t),t>DQ&&(DQ=t)),u?e<FQ?vJ(kQ,e)>vJ(kQ,NQ)&&(NQ=e):vJ(e,NQ)>vJ(kQ,NQ)&&(kQ=e):NQ>=kQ?(e<kQ&&(kQ=e),e>NQ&&(NQ=e)):e>FQ?vJ(kQ,e)>vJ(kQ,NQ)&&(NQ=e):vJ(e,NQ)>vJ(kQ,NQ)&&(kQ=e)}else UQ.push(VQ=[kQ=e,NQ=e]);t<RQ&&(RQ=t),t>DQ&&(DQ=t),BQ=n,FQ=e}function fJ(){dJ.point=pJ}function mJ(){VQ[0]=kQ,VQ[1]=NQ,dJ.point=hJ,BQ=null}function gJ(e,t){if(BQ){var n=e-FQ;$Q.add(hR(n)>180?n+(n>0?360:-360):n)}else LQ=e,PQ=t;YQ.point(e,t),pJ(e,t)}function _J(){YQ.lineStart()}function yJ(){gJ(LQ,PQ),YQ.lineEnd(),hR($Q)>rR&&(kQ=-(NQ=180)),VQ[0]=kQ,VQ[1]=NQ,BQ=null}function vJ(e,t){return(t-=e)<0?t+360:t}function bJ(e,t){return e[0]-t[0]}function TJ(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var xJ={sphere:SR,point:EJ,lineStart:IJ,lineEnd:CJ,polygonStart:function(){xJ.lineStart=OJ,xJ.lineEnd=MJ},polygonEnd:function(){xJ.lineStart=IJ,xJ.lineEnd=CJ}};function EJ(e,t){e*=dR;var n=mR(t*=dR);wJ(n*mR(e),n*TR(e),TR(t))}function wJ(e,t,n){++qQ,ZQ+=(e-ZQ)/qQ,QQ+=(t-QQ)/qQ,JQ+=(n-JQ)/qQ}function IJ(){xJ.point=AJ}function AJ(e,t){e*=dR;var n=mR(t*=dR);lJ=n*mR(e),uJ=n*TR(e),cJ=TR(t),xJ.point=SJ,wJ(lJ,uJ,cJ)}function SJ(e,t){e*=dR;var n=mR(t*=dR),i=n*mR(e),r=n*TR(e),s=TR(t),o=fR(ER((o=uJ*s-cJ*r)*o+(o=cJ*i-lJ*s)*o+(o=lJ*r-uJ*i)*o),lJ*i+uJ*r+cJ*s);KQ+=o,eJ+=o*(lJ+(lJ=i)),tJ+=o*(uJ+(uJ=r)),nJ+=o*(cJ+(cJ=s)),wJ(lJ,uJ,cJ)}function CJ(){xJ.point=EJ}function OJ(){xJ.point=kJ}function MJ(){RJ(oJ,aJ),xJ.point=EJ}function kJ(e,t){oJ=e,aJ=t,e*=dR,t*=dR,xJ.point=RJ;var n=mR(t);lJ=n*mR(e),uJ=n*TR(e),cJ=TR(t),wJ(lJ,uJ,cJ)}function RJ(e,t){e*=dR;var n=mR(t*=dR),i=n*mR(e),r=n*TR(e),s=TR(t),o=uJ*s-cJ*r,a=cJ*i-lJ*s,l=lJ*r-uJ*i,u=yR(o,a,l),c=AR(u),d=u&&-c/u;iJ.add(d*o),rJ.add(d*a),sJ.add(d*l),KQ+=c,eJ+=c*(lJ+(lJ=i)),tJ+=c*(uJ+(uJ=r)),nJ+=c*(cJ+(cJ=s)),wJ(lJ,uJ,cJ)}function NJ(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function DJ(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function FJ(){return 0}function LJ(e){return e instanceof iv?e:new iv(e)}function PJ(e,t,n){return e.fields=t||[],e.fname=n,e}function BJ(e){return 1===e.length?$J(e[0]):UJ(e)}const $J=e=>function(t){return t[e]},UJ=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function VJ(e){throw Error(e)}function zJ(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||VJ("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&VJ("Access path missing closing bracket: "+e),o&&VJ("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function jJ(e,t,n){const i=zJ(e);return e=1===i.length?i[0]:e,PJ((n&&n.get||BJ)(i),[e],t||e)}jJ("id"),PJ(e=>e,[],"identity"),PJ(()=>0,[],"zero"),PJ(()=>1,[],"one"),PJ(()=>!0,[],"true"),PJ(()=>!1,[],"false");var YJ=Array.isArray;function GJ(e){return e[e.length-1]}function HJ(e){return null==e||""===e?null:+e}function WJ(e){return null!=e?YJ(e)?e:[e]:[]}function XJ(e){for(let t,n,i=1,r=arguments.length;i<r;++i)for(n in t=arguments[i],t)e[n]=t[n];return e}function qJ(e,t){return Object.hasOwn(e,t)}function KJ(e,t,n,i){let r,s=t[0],o=t[t.length-1];return s>o&&(r=s,s=o,o=r),i=void 0===i||i,((n=void 0===n||n)?s<=e:s<e)&&(i?e<=o:e<o)}function ZJ(e){return"[object Date]"===Object.prototype.toString.call(e)}const QJ="Literal",JJ="Property",e0="ArrayExpression",t0="BinaryExpression",n0="CallExpression",i0="ConditionalExpression",r0="LogicalExpression",s0="MemberExpression",o0="ObjectExpression",a0="UnaryExpression";function l0(e){this.type=e}var u0;l0.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case e0:return e.elements;case t0:case r0:return[e.left,e.right];case n0:return[e.callee].concat(e.arguments);case i0:return[e.test,e.consequent,e.alternate];case s0:return[e.object,e.property];case o0:return e.properties;case JJ:return[e.key,e.value];case a0:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};(u0={})[1]="Boolean",u0[2]="<end>",u0[3]="Identifier",u0[4]="Keyword",u0[5]="Null",u0[6]="Numeric",u0[7]="Punctuator",u0[8]="String",u0[9]="RegularExpression";const c0=Symbol("vega_selection_getter");function d0(e){return e.getter&&e.getter[c0]||(e.getter=jJ(e.field),e.getter[c0]=!0),e.getter}const h0="intersect",p0="union",f0="or",m0="and",g0="_vgsid_",_0=jJ(g0),y0="index:unit";function v0(e,t){for(var n,i,r=t.fields,s=t.values,o=r.length,a=0;a<o;++a)if(ZJ(n=d0(i=r[a])(e))&&(n=HJ(n)),ZJ(s[a])&&(s[a]=HJ(s[a])),YJ(s[a])&&ZJ(s[a][0])&&(s[a]=s[a].map(HJ)),"E"===i.type){if(YJ(s[a])?!s[a].includes(n):n!==s[a])return!1}else if("R"===i.type){if(!KJ(n,s[a]))return!1}else if("R-RE"===i.type){if(!KJ(n,s[a],!0,!1))return!1}else if("R-E"===i.type){if(!KJ(n,s[a],!1,!1))return!1}else if("R-LE"===i.type){if(!KJ(n,s[a],!1,!0))return!1}else if("E-LT"===i.type){if(n>=s[a])return!1}else if("E-LTE"===i.type){if(n>s[a])return!1}else if("E-GT"===i.type){if(n<=s[a])return!1}else if("E-GTE"===i.type){if(n<s[a])return!1}else if("E-VALID"===i.type){if(null===n||isNaN(n))return!1}else if("E-ONE"===i.type&&-1===s[a].indexOf(n))return!1;return!0}const b0=function(e){let t,n,i;function r(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<0?r=t+1:s=t}while(r<s)}return r}return 2!==e.length?(t=NJ,n=(t,n)=>NJ(e(t),n),i=(t,n)=>e(t)-n):(t=e===NJ||e===DJ?e:FJ,n=e,i=e),{left:r,center:function(e,t,n=0,s=e.length){const o=r(e,t,n,s-1);return o>n&&i(e[o-1],t)>-i(e[o],t)?o-1:o},right:function(e,i,r=0,s=e.length){if(r<s){if(0!==t(i,i))return s;do{const t=r+s>>>1;n(e[t],i)<=0?r=t+1:s=t}while(r<s)}return r}}}(_0),T0=b0.left,x0=b0.right;var E0={[`${g0}_union`]:function(...e){const t=new iv;for(const n of e)for(const e of n)t.add(e);return t},[`${g0}_intersect`]:function(e,...t){e=new iv(e),t=t.map(LJ);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e},E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.includes(t[n])||e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(e=>t.includes(e)):t},R_union:function(e,t){var n=HJ(t[0]),i=HJ(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=HJ(t[0]),i=HJ(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};function w0(e,t,n,i){t[0].type!==QJ&&VJ("First argument to selection functions must be a string literal.");const r=t[0].value,s="unit",o="@"+s,a=":"+r;(t.length>=2&&GJ(t).value)!==h0||qJ(i,o)||(i[o]=n.getData(r).indataRef(n,s)),qJ(i,a)||(i[a]=n.getData(r).tuplesRef())}function I0(e){const t=this.context.data[e];return t?t.values.value:[]}const A0=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},S0=A0("format"),C0=A0("timeFormat"),O0=A0("utcFormat"),M0=A0("timeParse"),k0=A0("utcParse"),R0=new Date(2e3,0,1);function N0(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(R0.setYear(2e3),R0.setMonth(e),R0.setDate(t),C0.call(this,R0,n)):""}const D0="$";function F0(e,t,n,i){t[0].type!==PK&&cK("First argument to data functions must be a string literal.");const r=t[0].value,s=":"+r;if(!OK(s,i))try{i[s]=n.getData(r).tuplesRef()}catch(e){}}function L0(e,t,n,i){if(t[0].type===PK)P0(n,i,t[0].value);else for(e in n.scales)P0(n,i,e)}function P0(e,t,n){const i="%"+n;if(!OK(t,i))try{t[i]=e.scaleRef(n)}catch(e){}}function B0(e,t){let n;return SK(e)?e:RK(e)?(n=t.scales[e])&&n.value:void 0}function $0(e,t,n){t.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=L0,n._range=L0,n._scale=L0;const i=t=>"_["+(t.type===PK?DK("%"+t.value):DK("%")+"+"+e(t))+"]";return{_bandwidth:e=>`this.__bandwidth(${i(e[0])})`,_range:e=>`${i(e[0])}.range()`,_scale:t=>`${i(t[0])}(${e(t[1])})`}}function U0(e,t){return function(n,i,r){if(n){const t=B0(n,(r||this).context);return t&&t.path[e](i)}return t(i)}}const V0=U0("area",function(e){return jQ=new iR,nR(e,YQ),2*jQ}),z0=U0("bounds",function(e){var t,n,i,r,s,o,a;if(DQ=NQ=-(kQ=RQ=1/0),UQ=[],nR(e,dJ),n=UQ.length){for(UQ.sort(bJ),t=1,s=[i=UQ[0]];t<n;++t)TJ(i,(r=UQ[t])[0])||TJ(i,r[1])?(vJ(i[0],r[1])>vJ(i[0],i[1])&&(i[1]=r[1]),vJ(r[0],i[1])>vJ(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,t=0,i=s[n=s.length-1];t<=n;i=r,++t)r=s[t],(a=vJ(i[1],r[0]))>o&&(o=a,kQ=r[0],NQ=i[1])}return UQ=VQ=null,kQ===1/0||RQ===1/0?[[NaN,NaN],[NaN,NaN]]:[[kQ,RQ],[NQ,DQ]]}),j0=U0("centroid",function(e){qQ=KQ=ZQ=QQ=JQ=eJ=tJ=nJ=0,iJ=new iR,rJ=new iR,sJ=new iR,nR(e,xJ);var t=+iJ,n=+rJ,i=+sJ,r=yR(t,n,i);return r<sR&&(t=eJ,n=tJ,i=nJ,KQ<rR&&(t=ZQ,n=QQ,i=JQ),(r=yR(t,n,i))<sR)?[NaN,NaN]:[fR(n,t)*cR,AR(i/r)*cR]});function Y0(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(t){e.warn(t)}return n[n.length-1]}function G0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function H0(e){const t=k_(e);return.2126*G0(t.r)+.7152*G0(t.g)+.0722*G0(t.b)}function W0(e,t){return e===t||e!=e&&t!=t||(mK(e)?!(!mK(t)||e.length!==t.length)&&function(e,t){for(let n=0,i=e.length;n<i;++n)if(!W0(e[n],t[n]))return!1;return!0}(e,t):!(!gK(e)||!gK(t))&&X0(e,t))}function X0(e,t){for(const n in e)if(!W0(e[n],t[n]))return!1;return!0}function q0(e){return t=>X0(e,t)}const K0={};function Z0(e){return mK(e)||ArrayBuffer.isView(e)?e:null}function Q0(e){return Z0(e)||(RK(e)?e:null)}const J0=e=>e.data;function e1(e,t){const n=I0.call(t,e);return n.root&&n.root.lookup||{}}const t1=()=>"undefined"!=typeof window&&window||null;const n1={random:()=>ca(),cumulativeNormal:Ta,cumulativeLogNormal:Sa,cumulativeUniform:Na,densityNormal:ba,densityLogNormal:Aa,densityUniform:Ra,quantileNormal:xa,quantileLogNormal:Ca,quantileUniform:Da,sampleNormal:va,sampleLogNormal:Ia,sampleUniform:ka,isArray:mK,isBoolean:function(e){return"boolean"==typeof e},isDate:MK,isDefined:e=>void 0!==e,isNumber:kK,isObject:gK,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},isString:RK,isTuple:ho,isValid:e=>null!=e&&e==e,toBoolean:function(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e},toDate:function(e,t){return t=t||FK,null==e||""===e?null:t(e)},toNumber:yK,toString:function(e){return null==e||""===e?null:e+""},indexof:function(e,...t){return Q0(e).indexOf(...t)},join:function(e,...t){return Z0(e).join(...t)},lastindexof:function(e,...t){return Q0(e).lastIndexOf(...t)},replace:function(e,t,n){return SK(n)&&cK("Function argument passed to replace."),String(e).replace(t,n)},reverse:function(e){return Z0(e).slice().reverse()},slice:function(e,...t){return Q0(e).slice(...t)},flush:function(e,t,n,i,r,s){if(!n&&0!==n)return s;const o=+n;let a,l=e[0],u=_K(e);u<l&&(a=l,l=u,u=a),a=Math.abs(t-l);const c=Math.abs(u-t);return a<c&&a<=o?i:c<=o?r:s},lerp:function(e,t){const n=e[0],i=_K(e),r=+t;return r?1===r?i:n+r*(i-n):n},merge:function(){const e=[].slice.call(arguments);return e.unshift({}),CK(...e)},pad:function(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:"left"===i?NK(r,o)+s:"center"===i?NK(r,~~(o/2))+s+NK(r,Math.ceil(o/2)):s+NK(r,o)},peek:_K,pluck:function(e,t){const n=K0[t]||(K0[t]=hK(t));return mK(e)?e.map(n):n(e)},span:function(e){return e&&_K(e)-e[0]||0},inrange:function(e,t,n,i){let r,s=t[0],o=t[t.length-1];return s>o&&(r=s,s=o,o=r),i=void 0===i||i,((n=void 0===n||n)?s<=e:s<e)&&(i?e<=o:e<o)},truncate:function(e,t,n,i){const r=null!=i?i:"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:"left"===n?r+s.slice(o-a):"center"===n?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r},rgb:k_,lab:Dv,hcl:Vv,hsl:B_,luminance:H0,contrast:function(e,t){const n=H0(e),i=H0(t);return(Math.max(n,i)+.05)/(Math.min(n,i)+.05)},sequence:tl,format:S0,utcFormat:O0,utcParse:k0,utcOffset:qu,utcSequence:Qu,timeFormat:C0,timeParse:M0,timeOffset:Xu,timeSequence:Zu,timeUnitSpecifier:bu,monthFormat:function(e){return N0.call(this,e,1,"%B")},monthAbbrevFormat:function(e){return N0.call(this,e,1,"%b")},dayFormat:function(e){return N0.call(this,0,2+e,"%A")},dayAbbrevFormat:function(e){return N0.call(this,0,2+e,"%a")},quarter:function(e){return 1+~~(new Date(e).getMonth()/3)},utcquarter:function(e){return 1+~~(new Date(e).getUTCMonth()/3)},week:wu,utcweek:Mu,dayofyear:Eu,utcdayofyear:Ou,warn:function(){return Y0(this.context.dataflow,"warn",arguments)},info:function(){return Y0(this.context.dataflow,"info",arguments)},debug:function(){return Y0(this.context.dataflow,"debug",arguments)},extent:function(e,t){let n,i,r,s,o=0;if(e&&(n=e.length))if(null==t){for(i=e[o];o<n&&(null==i||i!=i);i=e[++o]);for(r=s=i;o<n;++o)i=e[o],null!=i&&(i<r&&(r=i),i>s&&(s=i))}else{for(i=t(e[o]);o<n&&(null==i||i!=i);i=t(e[++o]));for(r=s=i;o<n;++o)i=t(e[o]),null!=i&&(i<r&&(r=i),i>s&&(s=i))}return[r,s]},inScope:function(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:function(e,t,n){if(!e)return[];const[i,r]=e,s=(new fV).set(i[0],i[1],r[0],r[1]);return YY(n||this.context.dataflow.scenegraph().root,s,function(e){let t=null;if(e){const n=AK(e.marktype),i=AK(e.markname);t=e=>(!n.length||n.some(t=>e.marktype===t))&&(!i.length||i.some(t=>e.name===t))}return t}(t))},clampRange:function(e,t,n){let i,r=e[0],s=e[1];return s<r&&(i=s,s=r,r=i),i=s-r,i>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-i),r+i]},pinchDistance:function(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.sqrt(n*n+i*i)},pinchAngle:function(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)},screen:function(){const e=t1();return e?e.screen:{}},containerSize:function(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function(){const e=t1();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function(e,t,n){return aM(e||0,t||0,n||0)},setdata:function(e,t){const n=this.context.dataflow,i=this.context.data[e].input;return n.pulse(i,n.changeset().remove(fK).insert(t)),1},pathShape:function(e){let t=null;return function(n){return n?PU(n,t=t||AU(e)):e}},panLinear:function(e,t){return wK(e,t,yK,pK)},panLog:function(e,t){var n=Math.sign(e[0]);return wK(e,t,bK(n),vK(n))},panPow:function(e,t,n){return wK(e,t,EK(n),EK(1/n))},panSymlog:function(e,t,n){return wK(e,t,TK(n),xK(n))},zoomLinear:function(e,t,n){return IK(e,t,n,yK,pK)},zoomLog:function(e,t,n){const i=Math.sign(e[0]);return IK(e,t,n,bK(i),vK(i))},zoomPow:function(e,t,n,i){return IK(e,t,n,EK(i),EK(1/i))},zoomSymlog:function(e,t,n,i){return IK(e,t,n,TK(i),xK(i))},encode:function(e,t,n){if(e){const n=this.context.dataflow,i=e.mark.source;n.pulse(i,n.changeset().encode(e,t))}return void 0!==n?n:e},modify:function(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],l=a.input,u=o.stamp();let c,d,h=a.changes;if(!1===o._trigger||!(l.value.length||t||i))return 0;if((!h||h.stamp<u)&&(a.changes=h=o.changeset(),h.stamp=u,o.runAfter(()=>{a.modified=!0,o.pulse(l,h).run()},!0,1)),n&&(c=!0===n?fK:mK(n)||ho(n)?n:q0(n),h.remove(c)),t&&h.insert(t),i&&(c=q0(i),l.value.some(c)?h.remove(c):h.insert(i)),r)for(d in s)h.modify(r,d,s[d]);return 1}},i1=["view","item","group","xy","x","y"],r1="this.",s1={},o1={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${DK(D0+e)}]`,functions:function(e){const t=IQ(e);i1.forEach(e=>t[e]="event.vega."+e);for(const e in n1)t[e]=r1+e;return CK(t,$0(e,n1,s1)),t},constants:wQ,visitors:s1},a1=function(e){const t=(e=e||{}).allowed?LK(e.allowed):{},n=e.forbidden?LK(e.forbidden):{},i=e.constants||wQ,r=(e.functions||IQ)(d),s=e.globalvar,o=e.fieldvar,a=SK(s)?s:e=>`${s}["${e}"]`;let l={},u={},c=0;function d(e){if(RK(e))return e;const t=h[e.type];return null==t&&cK("Unsupported type: "+e.type),t(e)}const h={Literal:e=>e.raw,Identifier:e=>{const r=e.name;return c>0?r:OK(n,r)?cK("Illegal identifier: "+r):OK(i,r)?i[r]:OK(t,r)?r:(l[r]=1,a(r))},MemberExpression:e=>{const t=!e.computed,n=d(e.object);t&&(c+=1);const i=d(e.property);return n===o&&(u[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(i)]=1),t&&(c-=1),n+(t?"."+i:"["+i+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&cK("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,i=OK(r,t)&&r[t];return i||cK("Unrecognized function: "+t),SK(i)?i(n):i+"("+n.map(d).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(d).join(",")+"]",BinaryExpression:e=>"("+d(e.left)+" "+e.operator+" "+d(e.right)+")",UnaryExpression:e=>"("+e.operator+d(e.argument)+")",ConditionalExpression:e=>"("+d(e.test)+"?"+d(e.consequent)+":"+d(e.alternate)+")",LogicalExpression:e=>"("+d(e.left)+e.operator+d(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(d).join(",")+"}",Property:e=>{c+=1;const t=d(e.key);return c-=1,t+":"+d(e.value)}};function p(e){const t={code:d(e),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},t}return p.functions=r,p.constants=i,p}(o1);function l1(e,t,n){return 1===arguments.length?n1[e]:(n1[e]=t,n&&(s1[e]=n),a1&&(a1.functions[e]=r1+e),this)}function u1(e,t){const n={};let i;try{i=function(e){KK=0,ZK=(qK=e).length,QK=null,ZZ();const t=EQ();if(QK.type!==eZ)throw new Error("Unexpect token after expression.");return t}(e=RK(e)?e:DK(e)+"")}catch(t){cK("Expression parse error: "+e)}i.visit(e=>{if(e.type!==VK)return;const i=e.callee.name,r=o1.visitors[i];r&&r(i,e.arguments,t,n)});const r=a1(i);return r.globals.forEach(e=>{const i=D0+e;!OK(n,i)&&t.getSignal(e)&&(n[i]=t.signalRef(e))}),{$expr:CK({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function c1(e,t,n){return e.fields=t||[],e.fname=n,e}function d1(e){return 1===e.length?h1(e[0]):p1(e)}l1("bandwidth",function(e,t){const n=B0(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0},L0),l1("copy",function(e,t){const n=B0(e,(t||this).context);return n?n.copy():void 0},L0),l1("domain",function(e,t){const n=B0(e,(t||this).context);return n?n.domain():[]},L0),l1("range",function(e,t){const n=B0(e,(t||this).context);return n&&n.range?n.range():[]},L0),l1("invert",function(e,t,n){const i=B0(e,(n||this).context);return i?mK(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0},L0),l1("scale",function(e,t,n){const i=B0(e,(n||this).context);return i?i(t):void 0},L0),l1("gradient",function(e,t,n,i,r){e=B0(e,(r||this).context);const s=TU(t,n);let o=e.domain(),a=o[0],l=_K(o),u=pK;return l-a?u=WM(e,a,l):e=(e.interpolator?DM("sequential")().interpolator(e.interpolator()):DM("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,l=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),l!==_K(o)&&o.push(l)),o.forEach(t=>s.stop(u(t),e(t))),s},L0),l1("geoArea",V0,L0),l1("geoBounds",z0,L0),l1("geoCentroid",j0,L0),l1("geoShape",function(e,t,n){const i=B0(e,(n||this).context);return function(e){return i?i.path.context(e)(t):""}},L0),l1("indata",function(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r?r.count:r},function(e,t,n,i){t[0].type!==PK&&cK("First argument to indata must be a string literal."),t[1].type!==PK&&cK("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o="@"+s;OK(o,i)||(i[o]=n.getData(r).indataRef(n,s))}),l1("data",I0,F0),l1("treePath",function(e,t,n){const i=e1(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(J0):void 0},F0),l1("treeAncestors",function(e,t){const n=e1(e,this)[t];return n?n.ancestors().map(J0):void 0},F0),l1("vlSelectionTest",function(e,t,n){for(var i,r,s,o,a,l=this.context.data[e],u=l?l.values.value:[],c=l?l[y0]&&l[y0].value:void 0,d=n===h0,h=u.length,p=0;p<h;++p)if(i=u[p],c&&d){if(-1===(s=(r=r||{})[o=i.unit]||0))continue;if(a=v0(t,i),r[o]=a?-1:++s,a&&1===c.size)return!0;if(!a&&s===c.get(o).count)return!1}else if(d^(a=v0(t,i)))return a;return h&&d},w0),l1("vlSelectionIdTest",function(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[y0]&&i[y0].value:void 0,o=n===h0,a=_0(t),l=T0(r,a);if(l===r.length)return!1;if(_0(r[l])!==a)return!1;if(s&&o){if(1===s.size)return!0;if(x0(r,a)-l<s.size)return!1}return!0},w0),l1("vlSelectionResolve",function(e,t,n,i){for(var r,s,o,a,l,u,c,d,h,p,f,m,g=this.context.data[e],_=g?g.values.value:[],y={},v={},b={},T=_.length,x=0;x<T;++x)if(a=(r=_[x]).unit,s=r.fields,o=r.values,s&&o){for(f=0,m=s.length;f<m;++f)l=s[f],d=(c=y[l.field]||(y[l.field]={}))[a]||(c[a]=[]),b[l.field]=h=l.type.charAt(0),p=E0[`${h}_union`],c[a]=p(d,WJ(o[f]));n&&(d=v[a]||(v[a]=[])).push(WJ(o).reduce((e,t,n)=>(e[s[n].field]=t,e),{}))}else l=g0,u=_0(r),(d=(c=y[l]||(y[l]={}))[a]||(c[a]=[])).push(u),n&&(d=v[a]||(v[a]=[])).push({[g0]:u});if(t=t||p0,y[g0]?y[g0]=E0[`${g0}_${t}`](...Object.values(y[g0])):Object.keys(y).forEach(e=>{y[e]=Object.keys(y[e]).map(t=>y[e][t]).reduce((n,i)=>void 0===n?i:E0[`${b[e]}_${t}`](n,i))}),_=Object.keys(v),n&&_.length){y[i?"vlPoint":"vlMulti"]=t===p0?{[f0]:_.reduce((e,t)=>(e.push(...v[t]),e),[])}:{[m0]:_.map(e=>({[f0]:v[e]}))}}return y},w0),l1("vlSelectionTuples",function(e,t){return e.map(e=>XJ(t.fields?{values:t.fields.map(t=>d0(t)(e.datum))}:{[g0]:_0(e.datum)},t))});const h1=e=>function(t){return t[e]},p1=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function f1(e){throw Error(e)}function m1(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||f1("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&f1("Access path missing closing bracket: "+e),o&&f1("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function g1(e,t,n){const i=m1(e);return e=1===i.length?i[0]:e,c1((n&&n.get||d1)(i),[e],t||e)}g1("id"),c1(e=>e,[],"identity"),c1(()=>0,[],"zero"),c1(()=>1,[],"one");const _1=c1(()=>!0,[],"true");c1(()=>!1,[],"false");var y1=Array.isArray;function v1(e){return e===Object(e)}function b1(e){return null!=e?y1(e)?e:[e]:[]}function T1(e){return"function"==typeof e}const x1=(e,t)=>(e<t||null==e)&&null!=t?-1:(e>t||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t==t?-1:t!=t&&e==e?1:0),E1=(e,t)=>1===e.length?w1(e[0],t[0]):I1(e,t,e.length),w1=(e,t)=>function(n,i){return x1(e(n),e(i))*t},I1=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;0===o&&++a<n;)s=e[a],o=x1(s(i),s(r));return o*t[a]});function A1(e,t){return Object.hasOwn(e,t)}function S1(e){return y1(e)?"["+e.map(S1)+"]":v1(e)||"string"==typeof e?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function C1(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}const O1=C1(["rule"]),M1=C1(["group","image","rect"]);function k1(e){return(e+"").toLowerCase()}function R1(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}var N1={operator:(e,t)=>R1(e,["_"],t.code),parameter:(e,t)=>R1(e,["datum","_"],t.code),event:(e,t)=>R1(e,["event"],t.code),handler:(e,t)=>R1(e,["_","event"],`var datum=event.item&&event.item.datum;return ${t.code};`),encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const e in i){const t="o["+S1(e)+"]";r+=`$=${i[e].code};if(${t}!==$)${t}=$,m=1;`}return r+=function(e,t){let n="";return O1[t]||(e.x2&&(e.x?(M1[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(M1[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(i,n),r+="return m;",R1(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(S1).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=Function("a","b","var u, v; return "+e.map((e,i)=>{const r=t[i];let s,o;return e.path?(s=`a${e.path}`,o=`b${e.path}`):((n=n||{})["f"+i]=e,s=`this.f${i}(a)`,o=`this.f${i}(b)`),function(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}(s,o,-r,r)}).join("")+"0;");return n?i.bind(n):i}}};function D1(e,t,n){if(!e||!v1(e))return e;for(let i,r=0,s=F1.length;r<s;++r)if(i=F1[r],A1(e,i.key))return i.parse(e,t,n);return e}var F1=[{key:"$ref",parse:function(e,t){return t.get(e.$ref)||f1("Operator not defined: "+e.$ref)}},{key:"$key",parse:function(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=function(e,t,n){e&&(e=t?b1(e).map(e=>e.replace(/\\(.)/g,"$1")):b1(e));const i=e&&e.length,r=n&&n.get||d1,s=e=>r(t?[e]:m1(e));let o;if(i)if(1===i){const t=s(e[0]);o=function(e){return""+t(e)}}else{const t=e.map(s);o=function(e){let n=""+t[0](e),r=0;for(;++r<i;)n+="|"+t[r](e);return n}}else o=function(){return""};return c1(o,e,"key")}(e.$key,e.$flat,t.expr.codegen))}},{key:"$expr",parse:function(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=c1(t.parameterExpression(e.$expr),e.$fields))}},{key:"$field",parse:function(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=g1(e.$field,e.$name,t.expr.codegen))}},{key:"$encode",parse:function(e,t){const n=e.$encode,i={};for(const e in n){const r=n[e];i[e]=c1(t.encodeExpression(r.$expr),r.$fields),i[e].output=r.$output}return i}},{key:"$compare",parse:function(e,t){const n="c:"+e.$compare+"_"+e.$order,i=b1(e.$compare).map(e=>e&&e.$tupleid?po:e);return t.fn[n]||(t.fn[n]=function(e,t,n){n=n||{},t=b1(t)||[];const i=[],r=[],s={},o=n.comparator||E1;return b1(e).forEach((e,o)=>{var a;null!=e&&(i.push("descending"===t[o]?-1:1),r.push(e=T1(e)?e:g1(e,null,n)),(a=e,(null==a?null:a.fields)||[]).forEach(e=>s[e]=1))}),0===r.length?null:c1(o(r,i),Object.keys(s))}(i,e.$order,t.expr.codegen))}},{key:"$context",parse:function(e,t){return t}},{key:"$subflow",parse:function(e,t){const n=e.$subflow;return function(e,i,r){const s=t.fork().parse(n),o=s.get(n.operators[0].id),a=s.signals.parent;return a&&a.set(r),o.detachSubflow=()=>t.detach(s),o}}},{key:"$tupleid",parse:function(){return po}}];const L1={skip:!0};function P1(e,t,n,i){return new B1(e,t,n,i)}function B1(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||N1,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function $1(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}function U1(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}B1.prototype=$1.prototype={fork(){const e=new $1(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(t=>t!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),function(e){return"collect"===k1(e)}(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let r=n.get(e.parent.$ref);r?(i.connect(r,[t]),t.targets().add(r)):(n.unresolved=n.unresolved||[]).push(()=>{r=n.get(e.parent.$ref),i.connect(r,[t]),t.targets().add(r)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const i in e.data){const r=n.data[i]||(n.data[i]={});e.data[i].forEach(e=>r[e]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[k1(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function(e){const t=this;!function(e){return"operator"===k1(e)}(e.type)&&e.type?t.transform(e,e.type):t.operator(e,e.update?t.operatorExpression(e.update):null)},parseOperatorParameters:function(e){const t=this;if(e.params){const n=t.get(e.id);n||f1("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=y1(r)?r.map(e=>D1(e,n,t)):D1(r,n,t)}return t},parseStream:function(e){var t,n=this,i=null!=e.filter?n.eventExpression(e.filter):void 0,r=null!=e.stream?n.get(e.stream):void 0;e.source?r=n.events(e.source,e.type,i):e.merge&&(r=(t=e.merge.map(e=>n.get(e)))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map(e=>n.get(e)),r=r.between(t[0],t[1])),e.filter&&(r=r.filter(i)),null!=e.throttle&&(r=r.throttle(+e.throttle)),null!=e.debounce&&(r=r.debounce(+e.debounce)),null==r&&f1("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),n.stream(e,r)},parseUpdate:function(e){var t,n=this,i=v1(i=e.source)?i.$ref:i,r=n.get(i),s=e.update,o=void 0;r||f1("Source not defined: "+e.source),t=e.target&&e.target.$expr?n.eventExpression(e.target.$expr):n.get(e.target),s&&s.$expr&&(s.$params&&(o=n.parseParameters(s.$params)),s=n.handlerExpression(s.$expr)),n.update(e,r,t,s,o)},getState:function(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(n=>{const r=t.signals[n];e.signals(n,r)&&(i[n]=r.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(n=>{const i=t.data[n];e.data(n,i)&&(r[n]=i.input.value)})}return t.subcontext&&!1!==e.recurse&&(n.subcontext=t.subcontext.map(t=>t.getState(e))),n},setState:function(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(e=>{n.update(t.signals[e],r[e],L1)}),Object.keys(i||{}).forEach(e=>{n.pulse(t.data[e].input,n.changeset().remove(_1).insert(i[e]))}),(e.subcontext||[]).forEach((e,n)=>{const i=t.subcontext[n];i&&i.setState(e)})}};const V1="default";function z1(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function j1(e,t){var n=e._runtime.data;return ut(n,t)||ae("Unrecognized data set: "+t),n[t]}function Y1(e,t){bo(t)||ae("Second argument to changes must be a changeset.");const n=j1(this,e);return n.modified=!0,this.pulse(n.input,t)}function G1(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function H1(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function W1(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function X1(e,t,n){var i,r,s=e._renderer,o=s&&s.canvas();return o&&(r=W1(e),(i=Aj(t.changedTouches?t.changedTouches[0]:t,o))[0]-=r[0],i[1]-=r[1]),t.dataflow=e,t.item=n,t.vega=function(e,t,n){const i=t?"group"===t.mark.marktype?t:t.mark.group:null;function r(e){var n,r=i;if(e)for(n=t;n;n=n.mark.group)if(n.mark.name===e){r=n;break}return r&&r.mark&&r.mark.interactive?r:{}}function s(e){if(!e)return n;bt(e)&&(e=r(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:it(e),item:it(t||{}),group:r,xy:s,x:e=>s(e)[0],y:e=>s(e)[1]}}(e,n,i),t}const q1="view",K1={trap:!1};function Z1(e,t,n,i){e._eventListeners.push({type:n,sources:Xe(t),handler:i})}function Q1(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return!(!1===i||we(i)&&!i[n])||(e.warn(`Blocked ${t} ${n} event listener.`),!1)}function J1(e){return e.item}function e2(e){return e.item.mark.source}function t2(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function n2(e,t,n){const i=document.createElement(e);for(const e in t)i.setAttribute(e,t[e]);return null!=n&&(i.textContent=n),i}function i2(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),Z1(i,t,r,s),e.set=e=>{t.value=e,t.dispatchEvent(function(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(r))}}function r2(e,t,n,i){const r=i.signal(n.signal),s=n2("div",{class:"vega-bind"}),o="radio"===n.input?s:s.appendChild(n2("label"));o.appendChild(n2("span",{class:"vega-bind-name"},n.name||n.signal)),t.appendChild(s);let a=s2;switch(n.input){case"checkbox":a=o2;break;case"select":a=a2;break;case"radio":a=l2;break;case"range":a=u2}a(e,o,n,r)}function s2(e,t,n,i){const r=n2("input");for(const e in n)"signal"!==e&&"element"!==e&&r.setAttribute("input"===e?"type":e,n[e]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=e=>r.value=e}function o2(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=n2("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=e=>s.checked=!!e||null}function a2(e,t,n,i){const r=n2("select",{name:n.signal}),s=n.labels||[];n.options.forEach((e,t)=>{const n={value:e};c2(e,i)&&(n.selected=!0),r.appendChild(n2("option",n,(s[t]||e)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=e=>{for(let t=0,i=n.options.length;t<i;++t)if(c2(n.options[t],e))return void(r.selectedIndex=t)}}function l2(e,t,n,i){const r=n2("span",{class:"vega-bind-radio"}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((t,o)=>{const a={type:"radio",name:n.signal,value:t};c2(t,i)&&(a.checked=!0);const l=n2("input",a);l.addEventListener("change",()=>e.update(t));const u=n2("label",{},(s[o]||t)+"");return u.prepend(l),r.appendChild(u),l}),e.set=t=>{const n=e.elements,i=n.length;for(let e=0;e<i;++e)c2(n[e].value,t)&&(n[e].checked=!0)}}function u2(e,t,n,i){i=void 0!==i?i:(+n.max+ +n.min)/2;const r=null!=n.max?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||ru(s,r,100),a=n2("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const l=n2("span",{},+i);t.appendChild(a),t.appendChild(l);const u=()=>{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",u),a.addEventListener("change",u),e.elements=[a],e.set=e=>{a.value=e,l.textContent=e}}function c2(e,t){return e===t||e+""==t+""}function d2(e,t,n,i,r,s){return(t=t||new i(e.loader())).initialize(n,G1(e),H1(e),W1(e),r,s).background(e.background())}function h2(e,t){return t?function(){try{t.apply(this,arguments)}catch(t){e.error(t)}}:null}function p2(e,t,n){if("string"==typeof t){if("undefined"==typeof document)return e.error("DOM document instance not found."),null;if(!(t=document.querySelector(t)))return e.error("Signal bind element not found: "+t),null}if(t&&n)try{t.innerHTML=""}catch(n){t=null,e.error(n)}return t}const f2=e=>+e||0;function m2(e){return we(e)?{top:f2(e.top),bottom:f2(e.bottom),left:f2(e.left),right:f2(e.right)}:(e=>({top:e,bottom:e,left:e,right:e}))(f2(e))}async function g2(e,t,n,i){const r=jY(t),s=r&&r.headless;return s||ae("Unrecognized renderer type: "+t),await e.runAsync(),d2(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}var _2="width",y2="height",v2="padding",b2={skip:!0};function T2(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===v2?i.left+i.right:0)}function x2(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===v2?i.top+i.bottom:0)}function E2(e,t){return t.modified&&Ee(t.input.value)&&e.indexOf("_:vega:_")}function w2(e,t){return!("parent"===e||t instanceof Wo.proxy)}function I2(e,t,n,i){const r=e.element();r&&r.setAttribute("title",function(e){return null==e?"":Ee(e)?A2(e):we(e)&&!gt(e)?(t=e,Object.keys(t).map(e=>{const n=t[e];return e+": "+(Ee(n)?A2(n):S2(n))}).join("\n")):e+"";var t}(i))}function A2(e){return"["+e.map(S2).join(", ")+"]"}function S2(e){return Ee(e)?"[…]":we(e)&&!gt(e)?"{…}":e}function C2(e,t){const n=this;if(t=t||{},Yo.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),null!=t.logLevel&&n.logLevel(t.logLevel),t.locale||e.locale){const i=st({},e.locale,t.locale);n.locale(U$(i.number,i.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||VY.Canvas,n._scenegraph=new vj;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||I2,n._redraw=!0,n._handler=(new Hj).scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(e){const t=st({defaults:{}},e),n=(e,t)=>{t.forEach(t=>{Ee(e[t])&&(e[t]=Dt(e[t]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=function(e,t,n){return P1(e,Wo,n1,n).parse(t)}(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(e=>({state:null,param:st({},e)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=T2(n,n._width),n._viewHeight=x2(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(e){var t=e._signals,n=t[_2],i=t[y2],r=t[v2];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,t=>{e._width=t.size,e._viewWidth=T2(e,t.size),s()},{size:n}),e._resizeHeight=e.add(null,t=>{e._height=t.size,e._viewHeight=x2(e,t.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}(n),function(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}(n),function(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:V1,item:null}));e.on(e.events("view","mousemove"),t,(e,n)=>{const i=t.value,r=i?bt(i)?i:i.user:V1,s=n.item&&n.item.cursor||null;return i&&r===i.user&&s==i.item?i:{user:r,item:s}}),e.add(null,function(t){let n=t.cursor,i=this.value;return bt(n)||(i=n.item,n=n.user),z1(e,n&&n!==V1?n:i||n),i},{cursor:t})}(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind)}function O2(e,t){return ut(e._signals,t)?e._signals[t]:ae("Unrecognized signal name: "+Ot(t))}function M2(e,t){const n=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return n.length?n[0]:null}function k2(e,t,n,i){let r=M2(n,i);return r||(r=h2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function R2(e,t,n){const i=M2(t,n);return i&&t._targets.remove(i),e}pt(C2,Yo,{async evaluate(e,t,n){if(await Yo.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(e){var t=W1(e),n=G1(e),i=H1(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(t=>{try{t(n,i)}catch(t){e.error(t)}})}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&lo(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=null!=e?e+"":null;return t!==this._desc&&U1(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=O2(this,e);return 1===arguments.length?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",m2(e)):m2(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(jY(e)||ae("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Yo.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(O2(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(_2,n,b2),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(y2,i,b2),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),o._origin[0]===r[0]&&o._origin[1]===r[1]||(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(e=>e.resize())},!1,1)},addEventListener(e,t,n){let i=t;return n&&!1===n.trap||(i=h2(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n,i,r=this._handler.handlers(e),s=r.length;--s>=0;)if(i=r[s].type,n=r[s].handler,e===i&&(t===n||t===n.raw)){this._handler.off(i,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return k2(this,e,O2(this,e),t)},removeSignalListener(e,t){return R2(this,O2(this,e),t)},addDataListener(e,t){return k2(this,e,j1(this,e).values,t)},removeDataListener(e,t){return R2(this,j1(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=z1(this,null);this._globalCursor=!!e,t&&z1(this,t)}return this}return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function(e,t){this._timers.push(function(e,t,n){var i=new hL,r=t;return null==t?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(e,t,n){t=+t,n=null==n?cL():+n,i._restart(function s(o){o+=r,i._restart(s,r+=t,n),e(o)},t,n)},i.restart(e,t,n),i)}(function(t){e({timestamp:Date.now(),elapsed:t})},t))},events:function(e,t,n){var i,r=this,s=new Oo(n),o=function(n,i){r.runAsync(null,()=>{e===q1&&function(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[t]:r?!r[t]:e.preventDefault()))}(r,t)&&n.preventDefault(),s.receive(X1(r,n,i))})};if("timer"===e)Q1(r,"timer",t)&&r.timer(o,t);else if(e===q1)Q1(r,"view",t)&&r.addEventListener(t,o,K1);else if("window"===e?Q1(r,"window",t)&&"undefined"!=typeof window&&(i=[window]):"undefined"!=typeof document&&Q1(r,"selector",t)&&(i=document.querySelectorAll(e)),i){for(var a=0,l=i.length;a<l;++a)i[a].addEventListener(t,o);Z1(r,i,t,o)}else r.warn("Can not resolve event source: "+e);return s},finalize:function(){var e,t,n,i=this._tooltip,r=this._timers,s=this._eventListeners;for(e=r.length;--e>=0;)r[e].stop();for(e=s.length;--e>=0;)for(t=(n=s[e]).sources.length;--t>=0;)n.sources[t].removeEventListener(n.type,n.handler);return i&&i.call(this,this._handler,null,null,null),this},hover:function(e,t){return t=[t||"update",(e=[e||"hover"])[0]],this.on(this.events("view","mouseover",J1),e2,t2(e)),this.on(this.events("view","mouseout",J1),e2,t2(t)),this},data:function(e,t){return arguments.length<2?j1(this,e).values.value:Y1.call(this,e,To().remove(fe).insert(t))},change:Y1,insert:function(e,t){return Y1.call(this,e,To().insert(t))},remove:function(e,t){return Y1.call(this,e,To().remove(t))},scale:function(e){var t=this._runtime.scales;return ut(t,e)||ae("Unrecognized scale or projection: "+e),t[e].value},initialize:function(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=jY(i);e=n._el=e?p2(n,e,!0):null,function(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),U1(t,e.description()))}(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Hj,a=e?s.renderer:s.headless;return n._renderer=a?d2(n,n._renderer,e,a):null,n._handler=function(e,t,n,i){const r=new i(e.loader(),h2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,W1(e),e);return t&&t.handlers().forEach(e=>{r.on(e.type,e.handler)}),r}(n,n._handler,e,o),n._redraw=!0,e&&"none"!==r&&(t=t?n._elBind=p2(n,t,!0):e.appendChild(n2("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==r&&(e.element=p2(n,e.param.element,!!e.param.input))}),n._bind.forEach(e=>{!function(e,t,n){if(!t)return;const i=n.param;let r=n.state;r||(r=n.state={elements:null,active:!1,set:null,update:t=>{t!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,t)})}},i.debounce&&(r.update=rt(i.debounce,r.update))),(null==i.input&&i.element?i2:r2)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0)}(n,e.element||t,e)})),n},toImageURL:async function(e,t){e!==VY.Canvas&&e!==VY.SVG&&e!==VY.PNG&&ae("Unrecognized image type: "+e);const n=await g2(this,e,t);return e===VY.SVG?function(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function(e,t){return(await g2(this,VY.Canvas,e,t)).canvas()},toSVG:async function(e){return(await g2(this,VY.SVG,e)).svg()},getState:function(e){return this._runtime.getState(e||{data:E2,signals:w2,recurse:!0})},setState:function(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},e=>{e._trigger=!0}),this}});const N2="view",D2="[",F2="]",L2="{",P2="}",B2=":",$2=",",U2="@",V2=">",z2=/[[\]{}]/,j2={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let Y2,G2;function H2(e,t,n,i,r){const s=e.length;let o,a=0;for(;t<s;++t){if(o=e[t],!a&&o===n)return t;r&&r.indexOf(o)>=0?--a:i&&i.indexOf(o)>=0&&++a}return t}function W2(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=H2(e,r,$2,D2+L2,F2+P2),t.push(e.substring(i,r).trim()),i=++r;if(0===t.length)throw"Empty event selector: "+e;return t}function X2(e){return"["===e[0]?function(e){const t=e.length;let n,i=1;if(i=H2(e,i,F2,D2,F2),i===t)throw"Empty between selector: "+e;if(n=W2(e.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+e;if(e=e.slice(i+1).trim(),e[0]!==V2)throw"Expected '>' after between selector: "+e;n=n.map(X2);const r=X2(e.slice(1).trim());if(r.between)return{between:n,stream:r};r.between=n;return r}(e):function(e){const t={source:Y2},n=[];let i,r,s=[0,0],o=0,a=0,l=e.length,u=0;if(e[l-1]===P2){if(u=e.lastIndexOf(L2),!(u>=0))throw"Unmatched right brace: "+e;try{s=function(e){const t=e.split($2);if(!e.length||t.length>2)throw e;return t.map(t=>{const n=+t;if(n!=n)throw e;return n})}(e.substring(u+1,l-1))}catch(t){throw"Invalid throttle specification: "+e}l=(e=e.slice(0,u).trim()).length,u=0}if(!l)throw e;e[0]===U2&&(o=++u);i=H2(e,u,B2),i<l&&(n.push(e.substring(a,i).trim()),a=u=++i);if(u=H2(e,u,D2),u===l)n.push(e.substring(a,l).trim());else if(n.push(e.substring(a,u).trim()),r=[],a=++u,a===l)throw"Unmatched left bracket: "+e;for(;u<l;){if(u=H2(e,u,F2),u===l)throw"Unmatched left bracket: "+e;if(r.push(e.substring(a,u).trim()),u<l-1&&e[++u]!==D2)throw"Expected left bracket: "+e;a=++u}if(!(l=n.length)||z2.test(n[l-1]))throw"Invalid event selector: "+e;l>1?(t.type=n[1],o?t.markname=n[0].slice(1):!function(e){return G2[e]}(n[0])?t.source=n[0]:t.marktype=n[0]):t.type=n[0];"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=r&&(t.filter=r);s[0]&&(t.throttle=s[0]);s[1]&&(t.debounce=s[1]);return t}(e)}function q2(e){return we(e)?e:{type:e||"pad"}}const K2=e=>+e||0,Z2=e=>({top:e,bottom:e,left:e,right:e});function Q2(e){return we(e)?e.signal?e:{top:K2(e.top),bottom:K2(e.bottom),left:K2(e.left),right:K2(e.right)}:Z2(K2(e))}const J2=e=>we(e)&&!Ee(e)?st({},e):{value:e};function e3(e,t,n,i){if(null!=n){return we(n)&&!Ee(n)||Ee(n)&&n.length&&we(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1}return 0}function t3(e,t,n){for(const n in t)e3(e,n,t[n]);for(const t in n)e3(e,t,n[t],"update")}function n3(e,t,n){for(const i in t)n&&ut(n,i)||(e[i]=st(e[i]||{},t[i]));return e}function i3(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const r3="mark",s3="frame",o3="scope",a3="axis",l3="axis-domain",u3="axis-grid",c3="axis-label",d3="axis-tick",h3="axis-title",p3="legend",f3="legend-band",m3="legend-entry",g3="legend-gradient",_3="legend-label",y3="legend-symbol",v3="legend-title",b3="title",T3="title-text",x3="title-subtitle";function E3(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const w3=e=>bt(e)?Ot(e):e.signal?`(${e.signal})`:C3(e);function I3(e){if(null!=e.gradient)return function(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:Ot(e));for(;t.length&&null==Oe(t);)t.pop();return t.unshift(w3(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function(e){return e.c?A3("hcl",e.h,e.c,e.l):e.h||e.s?A3("hsl",e.h,e.s,e.l):e.l||e.a?A3("lab",e.l,e.a,e.b):e.r||e.g||e.b?A3("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?C3(e.field):void 0!==e.value?Ot(e.value):void 0;return null!=e.scale&&(t=function(e,t){const n=w3(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1===+e.band?"":"*"+S3(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t)),void 0===t&&(t=null),null!=e.exponent&&(t=`pow(${t},${S3(e.exponent)})`),null!=e.mult&&(t+=`*${S3(e.mult)}`),null!=e.offset&&(t+=`+${S3(e.offset)}`),e.round&&(t=`round(${t})`),t}const A3=(e,t,n,i)=>`(${e}(${[t,n,i].map(I3).join(",")})+'')`;function S3(e){return we(e)?"("+I3(e)+")":e}function C3(e){return O3(we(e)?e:{datum:e})}function O3(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):ae("Invalid field reference: "+Ot(e));return e.signal||(i=bt(i)?le(i).map(Ot).join("]["):O3(i)),t+"["+i+"]"}function M3(e,t,n,i,r,s){const o={};(s=s||{}).encoders={$encode:o},e=function(e,t,n,i,r){const s={},o={};let a,l,u,c;for(l in l="lineBreak","text"!==t||null==r[l]||i3(l,e)||E3(s,l,r[l]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===s3?r.group:n===r3?st({},r.mark,r[t]):null,c)u=i3(l,e)||("fill"===l||"stroke"===l)&&(i3("fill",e)||i3("stroke",e)),u||E3(s,l,c[l]);for(l in Xe(i).forEach(t=>{const n=r.style&&r.style[t];for(const t in n)i3(t,e)||E3(s,t,n[t])}),e=st({},e),s)c=s[l],c.signal?(a=a||{})[l]=c:o[l]=c;return e.enter=st(o,e.enter),a&&(e.update=st(a,e.update)),e}(e,t,n,i,r.config);for(const n in e)o[n]=k3(e[n],t,s,r);return s}function k3(e,t,n,i){const r={},s={};for(const t in e)null!=e[t]&&(r[t]=N3(R3(e[t]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function R3(e){return Ee(e)?function(e){let t="";return e.forEach(e=>{const n=I3(e);t+=e.test?`(${e.test})?${n}:`:n}),":"===Oe(t)&&(t+="null"),t}(e):I3(e)}function N3(e,t,n,i){const r=u1(e,t);return r.$fields.forEach(e=>i[e]=1),st(n,r.$params),r.$expr}const D3="outer",F3=["value","update","init","react","bind"];function L3(e,t){ae(e+' for "outer" push: '+Ot(t))}function P3(e,t){const n=e.name;if(e.push===D3)t.signals[n]||L3("No prior signal definition",n),F3.forEach(t=>{void 0!==e[t]&&L3("Invalid property ",t)});else{const i=t.addSignal(n,e.value);!1===e.react&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function B3(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function $3(e,t,n,i){return new B3(e,t,n,i)}function U3(e,t){return $3("operator",e,t)}function V3(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function z3(e,t){return t?{$field:e,$name:t}:{$field:e}}const j3=z3("key");function Y3(e,t){return{$compare:e,$order:t}}function G3(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const H3="scope",W3="view";function X3(e){return e&&e.signal}function q3(e){if(X3(e))return!0;if(we(e))for(const t in e)if(q3(e[t]))return!0;return!1}function K3(e,t){return null!=e?e:t}function Z3(e){return e&&e.signal||e}const Q3="timer";function J3(e,t){return(e.merge?e4:e.stream?t4:e.type?n4:ae("Invalid stream specification: "+Ot(e)))(e,t)}function e4(e,t){const n=e.merge.map(e=>J3(e,t)),i=i4({merge:n},e,t);return t.addStream(i).id}function t4(e,t){const n=i4({stream:J3(e.stream,t)},e,t);return t.addStream(n).id}function n4(e,t){let n;e.type===Q3?(n=t.event(Q3,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function(e){return e===H3?W3:e||W3}(e.source),e.type);const i=i4({stream:n},e,t);return 1===Object.keys(i).length?n:t.addStream(i).id}function i4(e,t,n){let i=t.between;return i&&(2!==i.length&&ae('Stream "between" parameter must have 2 entries: '+Ot(t)),e.between=[J3(i[0],n),J3(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(function(e,t,n){const i="event.item";return i+(e&&"*"!==e?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===H3&&i.push("inScope(event.item)"),i.length&&(e.filter=u1("("+i.join(")&&(")+")",n).$expr),null!=(i=t.throttle)&&(e.throttle=+i),null!=(i=t.debounce)&&(e.debounce=+i),t.consume&&(e.consume=!0),e}const r4={code:"_.$value",ast:{type:"Identifier",value:"value"}};function s4(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||ae("Signal update missing events specification."),bt(s)&&(s=function(e,t,n){return Y2=t||N2,G2=n||j2,W2(e.trim()).map(X2)}(s,t.isSubscope()?H3:W3)),s=Xe(s).filter(e=>e.signal||e.scale?(a.push(e),0):1),a.length>1&&(a=[o4(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),null!=i&&(o&&ae("Signal encode and update are mutually exclusive."),o="encode(item(),"+Ot(i)+")"),r.update=bt(o)?u1(o,t):null!=o.expr?u1(o.expr,t):null!=o.value?o.value:null!=o.signal?{$expr:r4,$params:{$value:t.signalRef(o.signal)}}:ae("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(e=>t.addUpdate(st(function(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):J3(e,t)}}(e,t),r)))}function o4(e){return{signal:"["+e.map(e=>e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}const a4=e=>(t,n,i)=>$3(e,n,t||void 0,i),l4=a4("aggregate"),u4=a4("axisticks"),c4=a4("bound"),d4=a4("collect"),h4=a4("compare"),p4=a4("datajoin"),f4=a4("encode"),m4=a4("expression"),g4=a4("facet"),_4=a4("field"),y4=a4("key"),v4=a4("legendentries"),b4=a4("load"),T4=a4("mark"),x4=a4("multiextent"),E4=a4("multivalues"),w4=a4("overlap"),I4=a4("params"),A4=a4("prefacet"),S4=a4("projection"),C4=a4("proxy"),O4=a4("relay"),M4=a4("render"),k4=a4("scale"),R4=a4("sieve"),N4=a4("sortitems"),D4=a4("viewlayout"),F4=a4("values");let L4=0;const P4={min:"min",max:"max",count:"sum"};function B4(e,t){const n=t.getScale(e.name).params;let i;for(i in n.domain=z4(e.domain,e,t),null!=e.range&&(n.range=K4(e,t,n)),null!=e.interpolate&&function(e,t){t.interpolate=$4(e.type||e),null!=e.gamma&&(t.interpolateGamma=$4(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function(e){return we(e)?{interval:$4(e.interval),step:$4(e.step)}:$4(e)}(e.nice)),null!=e.bins&&(n.bins=function(e,t){return e.signal||Ee(e)?U4(e,t):t.objectProperty(e)}(e.bins,t)),e)ut(n,i)||"name"===i||(n[i]=$4(e[i],t))}function $4(e,t){return we(e)?e.signal?t.signalRef(e.signal):ae("Unsupported object: "+Ot(e)):e}function U4(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>$4(e,t))}function V4(e){ae("Can not find data set: "+Ot(e))}function z4(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Ee(e)?j4:e.fields?G4:Y4)(e,t,n);null==t.domainMin&&null==t.domainMax||ae("No scale domain defined for domainMin/domainMax to override.")}function j4(e,t,n){return e.map(e=>$4(e,n))}function Y4(e,t,n){const i=n.getData(e.data);return i||V4(e.data),BM(t.type)?i.valuesRef(n,e.field,W4(e.sort,!1)):zM(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function G4(e,t,n){const i=e.data,r=e.fields.reduce((e,t)=>(t=bt(t)?{data:i,field:t}:Ee(t)||t.signal?function(e,t){const n="_:vega:_"+L4++,i=d4({});if(Ee(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+Ot(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,R4({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(BM(t.type)?H4:zM(t.type)?X4:q4)(e,n,r)}function H4(e,t,n){const i=W4(e.sort,!0);let r,s;const o=n.map(e=>{const n=t.getData(e.data);return n||V4(e.data),n.countsRef(t,e.field,i)}),a={groupby:j3,pulse:o};i&&(r=i.op||"count",s=i.field?G3(r,i.field):"count",a.ops=[P4[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(l4(a));const l=t.add(d4({pulse:V3(r)}));return s=t.add(F4({field:j3,sort:t.sortRef(i),pulse:V3(l)})),V3(s)}function W4(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!P4[e.op]&&ae("Multiple domain scales can not be sorted using "+e.op):ae("No field provided for sort aggregate op: "+e.op):we(e)?e.field="key":e={field:"key"}),e}function X4(e,t,n){const i=n.map(e=>{const n=t.getData(e.data);return n||V4(e.data),n.domainRef(t,e.field)});return V3(t.add(E4({values:i})))}function q4(e,t,n){const i=n.map(e=>{const n=t.getData(e.data);return n||V4(e.data),n.extentRef(t,e.field)});return V3(t.add(x4({extents:i})))}function K4(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(bt(r)){if(i&&ut(i,r))return K4(e=st({},e,{range:i[r]}),t,n);"width"===r?r=[0,{signal:"width"}]:"height"===r?r=BM(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:ae("Unrecognized scale range value: "+Ot(r))}else{if(r.scheme)return n.scheme=Ee(r.scheme)?U4(r.scheme,t):$4(r.scheme,t),r.extent&&(n.schemeExtent=U4(r.extent,t)),void(r.count&&(n.schemeCount=$4(r.count,t)));if(r.step)return void(n.rangeStep=$4(r.step,t));if(BM(e.type)&&!Ee(r))return z4(r,e,t);Ee(r)||ae("Unsupported range type: "+Ot(r))}return r.map(e=>(Ee(e)?U4:$4)(e,t))}function Z4(e,t,n){return Ee(e)?e.map(e=>Z4(e,t,n)):we(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:ae("Unsupported parameter object: "+Ot(e)):e}const Q4="top",J4="left",e5="right",t5="bottom",n5="center",i5="vertical",r5="start",s5="end",o5="index",a5="label",l5="offset",u5="perc",c5="perc2",d5="value",h5="guide-label",p5="guide-title",f5="group-title",m5="group-subtitle",g5="symbol",_5="gradient",y5="discrete",v5="size",b5=[v5,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],T5={name:1,style:1,interactive:1},x5={value:0},E5={value:1},w5="group",I5="rect",A5="rule",S5="symbol",C5="text";function O5(e){return e.type=w5,e.interactive=e.interactive||!1,e}function M5(e,t){const n=(n,i)=>K3(e[n],K3(t[n],i));return n.isVertical=n=>i5===K3(e.direction,t.direction||(n?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>K3(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>K3(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>K3(e.columns,K3(t.columns,+n.isVertical(!0))),n}function k5(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function R5(e,t,n){return`item.anchor === '${r5}' ? ${e} : item.anchor === '${s5}' ? ${t} : ${n}`}const N5=R5(Ot(J4),Ot(e5),Ot(n5));function D5(e,t){return t?e?we(e)?Object.assign({},e,{offset:D5(e.offset,t)}):{value:e,offset:t}:t:e}function F5(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=n3(e.encode,t,T5)):e.interactive=!1,e}function L5(e,t,n,i){const r=M5(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let l,u,c,d,h;s?(u=[0,1],c=[0,0],d=o,h=a):(u=[0,0],c=[1,0],d=a,h=o);const p={enter:l={opacity:x5,x:x5,y:x5,width:J2(d),height:J2(h)},update:st({},l,{opacity:E5,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:x5}};return t3(p,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),F5({type:I5,role:g3,encode:p},i)}function P5(e,t,n,i,r){const s=M5(e,n),o=s.isVertical(),a=s.gradientThickness(),l=s.gradientLength();let u,c,d,h,p="";o?(u="y",d="y2",c="x",h="width",p="1-"):(u="x",d="x2",c="y",h="height");const f={opacity:x5,fill:{scale:t,field:d5}};f[u]={signal:p+"datum."+u5,mult:l},f[c]=x5,f[d]={signal:p+"datum."+c5,mult:l},f[h]=J2(a);const m={enter:f,update:st({},f,{opacity:E5}),exit:{opacity:x5}};return t3(m,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),F5({type:I5,role:f3,key:d5,from:r,encode:m},i)}const B5=`datum.${u5}<=0?"${J4}":datum.${u5}>=1?"${e5}":"${n5}"`,$5=`datum.${u5}<=0?"${t5}":datum.${u5}>=1?"${Q4}":"middle"`;function U5(e,t,n,i){const r=M5(e,t),s=r.isVertical(),o=J2(r.gradientThickness()),a=r.gradientLength();let l,u,c,d,h=r("labelOverlap"),p="";const f={enter:l={opacity:x5},update:u={opacity:E5,text:{field:a5}},exit:{opacity:x5}};return t3(f,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:K3(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=u.baseline={signal:$5},c="y",d="x",p="1-"):(l.align=u.align={signal:B5},l.baseline={value:"top"},c="x",d="y"),l[c]=u[c]={signal:p+"datum."+u5,mult:a},l[d]=u[d]=o,o.offset=K3(e.labelOffset,t.gradientLabelOffset)||0,h=h?{separation:r("labelSeparation"),method:h,order:"datum."+o5}:void 0,F5({type:C5,role:_3,style:h5,key:d5,from:i,encode:f,overlap:h},n)}function V5(e,t,n,i,r){const s=M5(e,t),o=n.entries,a=!(!o||!o.interactive),l=o?o.name:void 0,u=s("clipHeight"),c=s("symbolOffset"),d={data:"value"},h=`(${r}) ? datum.${l5} : datum.${v5}`,p=u?J2(u):{field:v5},f=`datum.${o5}`,m=`max(1, ${r})`;let g,_,y,v,b;p.mult=.5,g={enter:_={opacity:x5,x:{signal:h,mult:.5,offset:c},y:p},update:y={opacity:E5,x:_.x,y:_.y},exit:{opacity:x5}};let T=null,x=null;e.fill||(T=t.symbolBaseFillColor,x=t.symbolBaseStrokeColor),t3(g,{fill:s("symbolFillColor",T),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",x),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),b5.forEach(t=>{e[t]&&(y[t]=_[t]={scale:e[t],field:d5})});const E=F5({type:S5,role:y3,key:d5,from:d,clip:!!u||void 0,encode:g},n.symbols),w=J2(c);w.offset=s("labelOffset"),g={enter:_={opacity:x5,x:{signal:h,offset:w},y:p},update:y={opacity:E5,text:{field:a5},x:_.x,y:_.y},exit:{opacity:x5}},t3(g,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const I=F5({type:C5,role:_3,style:h5,key:d5,from:d,encode:g},n.labels);return g={enter:{noBound:{value:!u},width:x5,height:u?J2(u):x5,opacity:x5},exit:{opacity:x5},update:y={opacity:E5,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${m})`,y.row.signal=`${f}%${v}`,y.column.signal=`floor(${f} / ${v})`,b={field:["row",f]}):(y.row.signal=`floor(${f} / ${m})`,y.column.signal=`${f} % ${m}`,b={field:f}),y.column.signal=`(${r})?${y.column.signal}:${f}`,O5({role:o3,from:i={facet:{data:i,name:"value",groupby:o5}},encode:n3(g,o,T5),marks:[E,I],name:l,interactive:a,sort:b})}const z5='item.orient === "left"',j5='item.orient === "right"',Y5=`(${z5} || ${j5})`,G5=`datum.vgrad && ${Y5}`,H5=R5('"top"','"bottom"','"middle"'),W5=`datum.vgrad && ${j5} ? (${R5('"right"','"left"','"center"')}) : (${Y5} && !(datum.vgrad && ${z5})) ? "left" : ${N5}`,X5=`item._anchor || (${Y5} ? "middle" : "start")`,q5=`${G5} ? (${z5} ? -90 : 90) : 0`,K5=`${Y5} ? (datum.vgrad ? (${j5} ? "bottom" : "top") : ${H5}) : "top"`;function Z5(e,t){let n;return we(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+Q5(e.path)+")":e.sphere&&(n="geoShape("+Q5(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function Q5(e){return we(e)&&e.signal?e.signal:Ot(e)}function J5(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===w5?o3:t||r3:t}function e6(e){return{marktype:e.type,name:e.name||void 0,role:e.role||J5(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function t6(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}function n6(e,t){const n=Xo(e.type);n||ae("Unrecognized transform type: "+Ot(e.type));const i=$3(n.type.toLowerCase(),null,i6(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function i6(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const r=e.params[s];i[r.name]=r6(r,t,n)}return i}function r6(e,t,n){const i=e.type,r=t[e.name];return"index"===i?function(e,t,n){bt(t.from)||ae('Lookup "from" parameter must be a string literal.');return n.getData(t.from).lookupRef(n,t.key)}(0,t,n):void 0!==r?"param"===i?function(e,t,n){const i=t[e.name];return e.array?(Ee(i)||ae("Expected an array of sub-parameters. Instead: "+Ot(i)),i.map(t=>o6(e,t,n))):o6(e,i,n)}(e,t,n):"projection"===i?n.projectionRef(t[e.name]):e.array&&!X3(r)?r.map(t=>s6(e,t,n)):s6(e,r,n):void(e.required&&ae("Missing required "+Ot(t.type)+" parameter: "+Ot(e.name)))}function s6(e,t,n){const i=e.type;if(X3(t))return c6(i)?ae("Expression references can not be signals."):d6(i)?n.fieldRef(t):h6(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||d6(i);return r&&a6(t)?n.exprRef(t.expr,t.as):r&&l6(t)?z3(t.field,t.as):c6(i)?u1(t,n):u6(i)?V3(n.getData(t).values):d6(i)?z3(t):h6(i)?n.compareRef(t):t}}function o6(e,t,n){const i=e.params.length;let r;for(let n=0;n<i;++n){r=e.params[n];for(const e in r.key)if(r.key[e]!==t[e]){r=null;break}if(r)break}r||ae("Unsupported parameter: "+Ot(t));const s=st(i6(r,t,n),r.key);return V3(n.add(I4(s)))}const a6=e=>e&&e.expr,l6=e=>e&&e.field,u6=e=>"data"===e,c6=e=>"expr"===e,d6=e=>"field"===e,h6=e=>"compare"===e;function p6(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:V3(t.getData(e.data).output)}function f6(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}function m6(e){return bt(e)?e:null}function g6(e,t,n){const i=G3(n.op,n.field);let r;if(t.ops){for(let e=0,n=t.as.length;e<n;++e)if(t.as[e]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function _6(e,t,n,i,r,s,o){const a=t[n]||(t[n]={}),l=function(e){return we(e)?("descending"===e.order?"-":"+")+G3(e.op,e.field):""}(s);let u,c,d=m6(r);if(null!=d&&(e=t.scope,d+=l?"|"+l:"",u=a[d]),!u){const n=s?{field:j3,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:V3(t.output)};l&&(n.sort=e.sortRef(s)),c=e.add($3(i,void 0,n)),o&&(t.index[r]=c),u=V3(c),null!=d&&(a[d]=u)}return u}function y6(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,o=e.modify,a=e.values,l=t.add(U3()),u=u1("if("+e.trigger+',modify("'+n+'",'+[r,i,s,o,a].map(e=>null==e?"null":e).join(",")+"),0)",t);l.update=u.$expr,l.params=u.$params}function v6(e,t){const n=J5(e),i=e.type===w5,r=e.from&&e.from.facet,s=e.overlap;let o,a,l,u,c,d,h,p=e.layout||n===o3||n===s3;const f=n===r3||p||r,m=function(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||ae("Only group marks can be faceted."),null!=i.field?o=a=p6(i,n):(e.data?a=V3(n.getData(e.data).aggregate):(s=n6(st({type:"aggregate",groupby:Xe(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=p6(i,n),o=a=V3(n.add(s))),r=n.keyRef(i.groupby,!0))):o=V3(n.add(d4(null,[{}]))),o||(o=p6(e,n)),{key:r,pulse:o,parent:a}}(e.from,i,t);a=t.add(p4({key:m.key||(e.key?z3(e.key):void 0),pulse:m.pulse,clean:!i}));const g=V3(a);a=l=t.add(d4({pulse:g})),a=t.add(T4({markdef:e6(e),interactive:t6(e.interactive,t),clip:Z5(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:V3(a)}));const _=V3(a);a=u=t.add(f4(M3(e.encode,e.type,n,e.style,t,{mod:!1,pulse:_}))),a.params.parent=t.encode(),e.transform&&e.transform.forEach(e=>{const n=n6(e,t),i=n.metadata;(i.generates||i.changes)&&ae("Mark transforms should not generate new data."),i.nomod||(u.params.mod=!0),n.params.pulse=V3(a),t.add(a=n)}),e.sort&&(a=t.add(N4({sort:t.compareRef(e.sort),pulse:V3(a)})));const y=V3(a);(r||p)&&(p=t.add(D4({layout:t.objectProperty(e.layout),legends:t.legends,mark:_,pulse:y})),d=V3(p));const v=t.add(c4({mark:_,pulse:d||y}));h=V3(v),i&&(f&&(o=t.operators,o.pop(),p&&o.pop()),t.pushState(y,d||h,g),r?function(e,t,n){const i=e.from.facet,r=i.name,s=p6(i,t);let o;i.name||ae("Facet must have a name: "+Ot(i)),i.data||ae("Facet must reference a data set: "+Ot(i)),i.field?o=t.add(A4({field:t.fieldRef(i.field),pulse:s})):i.groupby?o=t.add(g4({key:t.keyRef(i.groupby),group:V3(t.proxy(n.parent)),pulse:s})):ae("Facet must specify groupby or field: "+Ot(i));const a=t.fork(),l=a.add(d4()),u=a.add(R4({pulse:V3(l)}));a.addData(r,new f6(a,l,l,u)),a.addSignal("parent",null),o.params.subflow={$subflow:a.parse(e).toRuntime()}}(e,t,m):f?function(e,t,n){const i=t.add(A4({pulse:n.pulse})),r=t.fork();r.add(R4()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}(e,t,m):t.parse(e),t.popState(),f&&(p&&o.push(p),o.push(v))),s&&(h=function(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:X3(s)?n.signalRef(s.signal):s,method:X3(i)?n.signalRef(i.signal):i,pulse:t};e.order&&(o.sort=n.compareRef({field:e.order}));if(r){const e=r.tolerance;o.boundTolerance=X3(e)?n.signalRef(e.signal):+e,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return V3(n.add(w4(o)))}(s,h,t));const b=t.add(M4({pulse:h})),T=t.add(R4({pulse:V3(b)},void 0,t.parent()));null!=e.name&&(c=e.name,t.addData(c,new f6(t,l,b,T)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&ae("Marks only support modify triggers."),y6(e,t,c)}))}function b6(e,t){const n=t.config.legend,i=e.encode||{},r=M5(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,l=s.style,u={};let c,d,h,p=0;b5.forEach(t=>e[t]?(u[t]=e[t],p=p||e[t]):0),p||ae("Missing valid scale for legend.");const f=function(e,t){let n=e.type||g5;e.type||1!==function(e){return b5.reduce((t,n)=>t+(e[n]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=PM(t)?_5:$M(t)?y5:g5);return n!==_5?n:$M(t)?y5:_5}(e,t.scaleType(p)),m={title:null!=e.title,scales:u,type:f,vgrad:"symbol"!==f&&r.isVertical()},g=V3(t.add(d4(null,[m]))),_=V3(t.add(v4(d={type:f,scale:t.scaleRef(p),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return f===_5?(h=[L5(e,p,n,i.gradient),U5(e,n,i.labels,_)],d.count=d.count||t.signalRef(`max(2,2*floor((${Z3(r.gradientLength())})/100))`)):f===y5?h=[P5(e,p,n,i.gradient,_),U5(e,n,i.labels,_)]:(c=function(e,t){const n=M5(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(e,n),h=[V5(e,n,i,_,Z3(c.columns))],d.size=function(e,t,n){const i=Z3(x6("size",e,n)),r=Z3(x6("strokeWidth",e,n)),s=Z3(function(e,t,n){return k5("fontSize",e)||function(e,t,n){const i=t.config.style[n];return i&&i[e]}("fontSize",t,n)}(n[1].encode,t,h5));return u1(`max(ceil(sqrt(${i})+${r}),${s})`,t)}(e,t,h[0].marks)),h=[O5({role:m3,from:g,encode:{enter:{x:{value:0},y:{value:0}}},marks:h,layout:c,interactive:a})],m.title&&h.push(function(e,t,n,i){const r=M5(e,t),s={enter:{opacity:x5},update:{opacity:E5,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:x5}};return t3(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:X5},angle:{signal:q5},align:{signal:W5},baseline:{signal:K5},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),F5({type:C5,role:v3,style:p5,from:i,encode:s},n)}(e,n,i.title,g)),v6(O5({role:p3,from:g,encode:n3(T6(r,e,n),s,T5),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:l}),t)}function T6(e,t,n){const i={enter:{},update:{}};return t3(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function x6(e,t,n){return t[e]?`scale("${t[e]}",datum)`:k5(e,n[0].encode)}f6.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&"load"===s.type&&(s=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=V3(t[a-1]),e.add(t[a]),"aggregate"===t[a].type&&(o=t[a]);return new f6(e,s,r,i,o)},f6.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=m6(t);let o,a,l;return null!=s&&(e=i.scope,o=r[s]),o?n&&n.field&&g6(e,o.agg.params,n):(l={groupby:e.fieldRef(t,"key"),pulse:V3(i.output)},n&&n.field&&g6(e,l,n),a=e.add(l4(l)),o=e.add(d4({pulse:V3(a)})),o={agg:a,ref:V3(o)},null!=s&&(r[s]=o)),o.ref},tuplesRef(){return V3(this.values)},extentRef(e,t){return _6(e,this,"extent","extent",t,!1)},domainRef(e,t){return _6(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return _6(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return _6(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return _6(e,this,"indata","tupleindex",t,!0,!0)}};const E6=`item.orient==="${J4}"?-90:item.orient==="${e5}"?90:0`;function w6(e,t){const n=M5(e=bt(e)?{text:e}:e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,l=[],u=V3(t.add(d4(null,[{}])));return l.push(function(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return t3(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),F5({type:C5,role:T3,style:f5,from:i,encode:o},n)}(e,n,function(e){const t=e.encode;return t&&t.title||st({name:e.name,interactive:e.interactive,style:e.style},t)}(e),u)),e.subtitle&&l.push(function(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return t3(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),F5({type:C5,role:x3,style:m5,from:i,encode:o},n)}(e,n,i.subtitle,u)),v6(O5({role:b3,from:u,encode:I6(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function I6(e,t){const n={enter:{},update:{}};return t3(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:N5},angle:{signal:E6},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),n3(n,t,T5)}function A6(e,t){const n=[];e.transform&&e.transform.forEach(e=>{n.push(n6(e,t))}),e.on&&e.on.forEach(n=>{y6(n,t,e.name)}),t.addDataPipeline(e.name,function(e,t,n){const i=[];let r,s,o,a,l,u=null,c=!1,d=!1;e.values?X3(e.values)||q3(e.format)?(i.push(C6(t,e)),i.push(u=S6())):i.push(u=S6({$ingest:e.values,$format:e.format})):e.url?q3(e.url)||q3(e.format)?(i.push(C6(t,e)),i.push(u=S6())):i.push(u=S6({$request:e.url,$format:e.format})):e.source&&(u=r=Xe(e.source).map(e=>V3(t.getData(e).output)),i.push(null));for(s=0,o=n.length;s<o;++s)a=n[s],l=a.metadata,u||l.source||i.push(u=S6()),i.push(a),l.generates&&(d=!0),l.modifies&&!d&&(c=!0),l.source?u=a:l.changes&&(u=null);r&&(o=r.length-1,i[0]=O4({derive:c,pulse:o?r:r[0]}),(c||o)&&i.splice(1,0,S6()));u||i.push(S6());return i.push(R4({})),i}(e,t,n))}function S6(e){const t=d4({},e);return t.metadata={source:!0},t}function C6(e,t){return b4({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const O6=e=>e===t5||e===Q4,M6=(e,t,n)=>X3(e)?P6(e.signal,t,n):e===J4||e===Q4?t:n,k6=(e,t,n)=>X3(e)?F6(e.signal,t,n):O6(e)?t:n,R6=(e,t,n)=>X3(e)?L6(e.signal,t,n):O6(e)?n:t,N6=(e,t,n)=>X3(e)?B6(e.signal,t,n):e===Q4?{value:t}:{value:n},D6=(e,t,n)=>X3(e)?$6(e.signal,t,n):e===e5?{value:t}:{value:n},F6=(e,t,n)=>U6(`${e} === '${Q4}' || ${e} === '${t5}'`,t,n),L6=(e,t,n)=>U6(`${e} !== '${Q4}' && ${e} !== '${t5}'`,t,n),P6=(e,t,n)=>z6(`${e} === '${J4}' || ${e} === '${Q4}'`,t,n),B6=(e,t,n)=>z6(`${e} === '${Q4}'`,t,n),$6=(e,t,n)=>z6(`${e} === '${e5}'`,t,n),U6=(e,t,n)=>(t=null!=t?J2(t):t,n=null!=n?J2(n):n,V6(t)&&V6(n)?{signal:`${e} ? (${t=t?t.signal||Ot(t.value):null}) : (${n=n?n.signal||Ot(n.value):null})`}:[st({test:e},t)].concat(n||[])),V6=e=>null==e||1===Object.keys(e).length,z6=(e,t,n)=>({signal:`${e} ? (${Y6(t)}) : (${Y6(n)})`}),j6=(e,t,n,i,r)=>({signal:(null!=i?`${e} === '${J4}' ? (${Y6(i)}) : `:"")+(null!=n?`${e} === '${t5}' ? (${Y6(n)}) : `:"")+(null!=r?`${e} === '${e5}' ? (${Y6(r)}) : `:"")+(null!=t?`${e} === '${Q4}' ? (${Y6(t)}) : `:"")+"(null)"}),Y6=e=>X3(e)?e.signal:null==e?null:Ot(e),G6=(e,t)=>0===t?0:X3(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},H6=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function W6(e,t,n,i){let r;if(t&&ut(t,e))return t[e];if(ut(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[p5][r]}if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[h5][r]}return null}function X6(e){const t={};for(const n of e)if(n)for(const e in n)t[e]=1;return Object.keys(t)}function q6(e,t){return{scale:e.scale,range:t}}function K6(e,t,n,i,r){const s=M5(e,t),o=e.orient,a=e.gridScale,l=M6(o,1,-1),u=function(e,t){if(1===t);else if(we(e)){let n=e=st({},e);for(;null!=n.mult;){if(!we(n.mult))return n.mult=X3(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n=n.mult=st({},n.mult)}n.mult=t}else e=X3(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);return e}(e.offset,l);let c,d,h;const p={enter:c={opacity:x5},update:h={opacity:E5},exit:d={opacity:x5}};t3(p,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const f={scale:e.scale,field:d5,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},m=k6(o,{signal:"height"},{signal:"width"}),g=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},_=a?{scale:a,range:1,mult:l,offset:u}:st(m,{mult:l,offset:u});return c.x=h.x=k6(o,f,g),c.y=h.y=R6(o,f,g),c.x2=h.x2=R6(o,_),c.y2=h.y2=k6(o,_),d.x=k6(o,f),d.y=R6(o,f),F5({type:A5,role:u3,key:d5,from:i,encode:p},n)}function Z6(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Q6(e,t,n,i){const r=M5(e,t),s=e.orient,o=M6(s,-1,1);let a,l;const u={enter:a={opacity:x5,anchor:J2(r("titleAnchor",null)),align:{signal:N5}},update:l=st({},a,{opacity:E5,text:J2(e.title)}),exit:{opacity:x5}},c={signal:`lerp(range("${e.scale}"), ${R5(0,1,.5)})`};return l.x=k6(s,c),l.y=R6(s,c),a.angle=k6(s,x5,G6(o,90)),a.baseline=k6(s,N6(s,t5,Q4),{value:t5}),l.angle=a.angle,l.baseline=a.baseline,t3(u,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),function(e,t,n,i){const r=(e,t)=>null!=e?(n.update[t]=H6(J2(e),n.update[t]),!1):!i3(t,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?J2(o):k6(t,J2(o),J2(s))}(r,s,u,n),u.update.align=H6(u.update.align,a.align),u.update.angle=H6(u.update.angle,a.angle),u.update.baseline=H6(u.update.baseline,a.baseline),F5({type:C5,role:h3,style:p5,from:i,encode:u},n)}function J6(e,t){const n=function(e,t){var n,i,r,s=t.config,o=s.style,a=s.axis,l="band"===t.scaleType(e.scale)&&s.axisBand,u=e.orient;if(X3(u)){const e=X6([s.axisX,s.axisY]),t=X6([s.axisTop,s.axisBottom,s.axisLeft,s.axisRight]);for(r of(n={},e))n[r]=k6(u,W6(r,s.axisX,a,o),W6(r,s.axisY,a,o));for(r of(i={},t))i[r]=j6(u.signal,W6(r,s.axisTop,a,o),W6(r,s.axisBottom,a,o),W6(r,s.axisLeft,a,o),W6(r,s.axisRight,a,o))}else n=u===Q4||u===t5?s.axisX:s.axisY,i=s["axis"+u[0].toUpperCase()+u.slice(1)];return n||i||l?st({},a,n,i,l):a}(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,l=M5(e,n),u=function(e){const t=e("tickBand");let n,i,r=e("tickOffset");return t?t.signal?(n={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},we(r)||(r={signal:`(${t.signal}) === 'extent' ? 0 : ${r}`})):"extent"===t?(n=1,i=!0,r=0):(n=.5,i=!1):(n=e("bandPosition"),i=e("tickExtra")),{extra:i,band:n,offset:r}}(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:null!=e.title},d=V3(t.add(d4({},[c]))),h=V3(t.add(u4({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),p=[];let f;return c.grid&&p.push(K6(e,n,i.grid,h,u)),c.ticks&&(f=l("tickSize"),p.push(function(e,t,n,i,r,s){const o=M5(e,t),a=e.orient,l=M6(a,-1,1);let u,c,d;const h={enter:u={opacity:x5},update:d={opacity:E5},exit:c={opacity:x5}};t3(h,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const p=J2(r);p.mult=l;const f={scale:e.scale,field:d5,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return d.y=u.y=k6(a,x5,f),d.y2=u.y2=k6(a,p),c.x=k6(a,f),d.x=u.x=R6(a,x5,f),d.x2=u.x2=R6(a,p),c.y=R6(a,f),F5({type:A5,role:d3,key:d5,from:i,encode:h},n)}(e,n,i.ticks,h,f,u))),c.labels&&(f=c.ticks?f:0,p.push(function(e,t,n,i,r,s){const o=M5(e,t),a=e.orient,l=e.scale,u=M6(a,-1,1),c=Z3(o("labelFlush")),d=Z3(o("labelFlushOffset")),h=o("labelAlign"),p=o("labelBaseline");let f,m=0===c||!!c;const g=J2(r);g.mult=u,g.offset=J2(o("labelPadding")||0),g.offset.mult=u;const _={scale:l,field:d5,band:.5,offset:D5(s.offset,o("labelOffset"))},y=k6(a,m?Z6(l,c,'"left"','"right"','"center"'):{value:"center"},D6(a,"left","right")),v=k6(a,N6(a,"bottom","top"),m?Z6(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),b=Z6(l,c,`-(${d})`,d,0);m=m&&d;const T={opacity:x5,x:k6(a,_,g),y:R6(a,_,g)},x={enter:T,update:f={opacity:E5,text:{field:a5},x:T.x,y:T.y,align:y,baseline:v},exit:{opacity:x5,x:T.x,y:T.y}};t3(x,{dx:!h&&m?k6(a,b):null,dy:!p&&m?R6(a,b):null}),t3(x,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:h,baseline:p});const E=o("labelBound");let w=o("labelOverlap");return w=w||E?{separation:o("labelSeparation"),method:w,order:"datum.index",bound:E?{scale:l,orient:a,tolerance:E}:null}:void 0,f.align!==y&&(f.align=H6(f.align,y)),f.baseline!==v&&(f.baseline=H6(f.baseline,v)),F5({type:C5,role:c3,style:h5,key:d5,from:i,encode:x,overlap:w},n)}(e,n,i.labels,h,f,u))),c.domain&&p.push(function(e,t,n,i){const r=M5(e,t),s=e.orient;let o,a;const l={enter:o={opacity:x5},update:a={opacity:E5},exit:{opacity:x5}};t3(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=q6(e,0),c=q6(e,1);return o.x=a.x=k6(s,u,x5),o.x2=a.x2=k6(s,c),o.y=a.y=R6(s,u,x5),o.y2=a.y2=R6(s,c),F5({type:A5,role:l3,from:i,encode:l},n)}(e,n,i.domain,d)),c.title&&p.push(Q6(e,n,i.title,d)),v6(O5({role:a3,from:d,encode:n3(e8(l,e),r,T5),marks:p,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:s,interactive:o,style:a}),t)}function e8(e,t){const n={enter:{},update:{}};return t3(n,{orient:e("orient"),offset:e("offset")||0,position:K3(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function t8(e,t,n){const i=Xe(e.signals),r=Xe(e.scales);return n||i.forEach(e=>P3(e,t)),Xe(e.projections).forEach(e=>function(e,t){const n=t.config.projection||{},i={};for(const n in e)"name"!==n&&(i[n]=Z4(e[n],n,t));for(const e in n)null==i[e]&&(i[e]=Z4(n[e],e,t));t.addProjection(e.name,i)}(e,t)),r.forEach(e=>function(e,t){const n=e.type||"linear";FM(n)||ae("Unrecognized scale type: "+Ot(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),Xe(e.data).forEach(e=>A6(e,t)),r.forEach(e=>B4(e,t)),(n||i).forEach(e=>function(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?ae("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=u1(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(e=>s4(e,t,n.id))}(e,t)),Xe(e.axes).forEach(e=>J6(e,t)),Xe(e.marks).forEach(e=>v6(e,t)),Xe(e.legends).forEach(e=>b6(e,t)),e.title&&w6(e.title,t),t.parseLambdas(),t}const n8=e=>n3({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function i8(e,t){const n=t.config,i=V3(t.root=t.add(U3())),r=function(e,t){const n=n=>K3(e[n],t[n]),i=[r8("background",n("background")),r8("autosize",q2(n("autosize"))),r8("padding",Q2(n("padding"))),r8("width",n("width")||0),r8("height",n("height")||0)],r=i.reduce((e,t)=>(e[t.name]=t,e),{}),s={};return Xe(e.signals).forEach(e=>{ut(r,e.name)?e=st(r[e.name],e):i.push(e),s[e.name]=e}),Xe(t.signals).forEach(e=>{ut(s,e.name)||ut(r,e.name)||i.push(e)}),i}(e,n);r.forEach(e=>P3(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(d4()),o=t.add(f4(M3(n8(e.encode),w5,s3,e.style,t,{pulse:V3(s)}))),a=t.add(D4({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:V3(o)}));t.operators.pop(),t.pushState(V3(o),V3(a),null),t8(e,t,r),t.operators.push(a);let l=t.add(c4({mark:i,pulse:V3(a)}));return l=t.add(M4({pulse:V3(l)})),l=t.add(R4({pulse:V3(l)})),t.addData("root",new f6(t,s,s,l)),t}function r8(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function s8(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function o8(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function a8(e){return(Ee(e)?l8:u8)(e)}function l8(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const t=e[i];n+=(i>0?",":"")+(we(t)?t.signal||a8(t):Ot(t))}return n+"]"}function u8(e){let t,n,i="{",r=0;for(t in e)n=e[t],i+=(++r>1?",":"")+Ot(t)+":"+(we(n)?n.signal||a8(n):Ot(n));return i+"}"}function c8(e,t,n){return we(e)||ae("Input Vega specification must be an object."),t=Ae(function(){const e="sans-serif",t="#4c78a8",n="#000",i="#888",r="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:t},area:{fill:t},image:null,line:{stroke:t,strokeWidth:2},path:{stroke:t},rect:{fill:t},rule:{stroke:n},shape:{stroke:t},symbol:{fill:t,size:64},text:{fill:n,font:e,fontSize:11},trail:{fill:t,size:2},style:{"guide-label":{fill:n,font:e,fontSize:10},"guide-title":{fill:n,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:r}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:i,grid:!1,gridWidth:1,gridColor:r,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:i,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:r,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:i,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),t,e.config),i8(e,new s8(t,n)).toRuntime()}s8.prototype=o8.prototype={parse(e){return t8(e,this)},fork(){return new o8(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof B3?V3(e):e;return this.add(C4({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(e,t,n){let i,r;e&&(i=e.data||(e.data={}),r=i[t]||(i[t]=[]),r.push(n))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(V3(this.add(R4({pulse:e})))),this._parent.push(t),this._lookup.push(n?V3(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Oe(this._parent)},encode(){return Oe(this._encode)},lookup(){return Oe(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(bt(e))return z3(e,t);e.signal||ae("Unsupported field reference: "+Ot(e));const n=e.signal;let i=this.field[n];if(!i){const e={name:this.signalRef(n)};t&&(e.as=t),this.field[n]=i=V3(this.add(_4(e)))}return i},compareRef(e){let t=!1;const n=e=>X3(e)?(t=!0,this.signalRef(e.signal)):function(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,i=Xe(e.field).map(n),r=Xe(e.order).map(n);return t?V3(this.add(h4({fields:i,orders:r}))):Y3(i,r)},keyRef(e,t){let n=!1;const i=this.signals;return e=Xe(e).map(e=>X3(e)?(n=!0,V3(i[e.signal])):e),n?V3(this.add(y4({fields:e,flat:t}))):function(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;const t=G3(e.op,e.field),n=e.order||"ascending";return n.signal?V3(this.add(h4({fields:t,orders:this.signalRef(n.signal)}))):Y3(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return ut(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&ae("Duplicate signal name: "+Ot(e));const n=t instanceof B3?t:this.add(U3(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||ae("Unrecognized signal name: "+Ot(e)),this.signals[e]},signalRef(e){return this.signals[e]?V3(this.signals[e]):(ut(this.lambdas,e)||(this.lambdas[e]=this.add(U3(null))),V3(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const n=e[t],i=u1(n,this),r=this.lambdas[n];r.params=i.$params,r.update=i.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return e&&we(e)?this.signalRef(e.signal||a8(e)):e},exprRef(e,t){const n={expr:u1(e,this)};return t&&(n.expr.$name=t),V3(this.add(m4(n)))},addBinding(e,t){this.bindings||ae("Nested signals do not support binding: "+Ot(e)),this.bindings.push(st({signal:e},t))},addScaleProj(e,t){ut(this.scales,e)&&ae("Duplicate scale or projection name: "+Ot(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,k4(t))},addProjection(e,t){this.addScaleProj(e,S4(t))},getScale(e){return this.scales[e]||ae("Unrecognized scale name: "+Ot(e)),this.scales[e]},scaleRef(e){return V3(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return ut(this.data,e)&&ae("Duplicate data set name: "+Ot(e)),this.data[e]=t},getData(e){return this.data[e]||ae("Undefined data set name: "+Ot(e)),this.data[e]},addDataPipeline(e,t){return ut(this.data,e)&&ae("Duplicate data set name: "+Ot(e)),this.addData(e,f6.fromEntries(this,t))}};const d8="Property",h8="ArrayExpression",p8="BinaryExpression",f8="CallExpression",m8="ConditionalExpression",g8="LogicalExpression",_8="MemberExpression",y8="ObjectExpression",v8="UnaryExpression";function b8(e){this.type=e}var T8,x8,E8,w8,I8;b8.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case h8:return e.elements;case p8:case g8:return[e.left,e.right];case f8:return[e.callee].concat(e.arguments);case m8:return[e.test,e.consequent,e.alternate];case _8:return[e.object,e.property];case y8:return e.properties;case d8:return[e.key,e.value];case v8:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};var A8=1,S8=2,C8=3,O8=4,M8=5,k8=6,R8=7,N8=8;(T8={})[A8]="Boolean",T8[S8]="<end>",T8[C8]="Identifier",T8[O8]="Keyword",T8[M8]="Null",T8[k8]="Numeric",T8[R8]="Punctuator",T8[N8]="String",T8[9]="RegularExpression";var D8="ArrayExpression",F8="BinaryExpression",L8="CallExpression",P8="ConditionalExpression",B8="Identifier",$8="Literal",U8="LogicalExpression",V8="MemberExpression",z8="ObjectExpression",j8="Property",Y8="UnaryExpression",G8="Unexpected token %0",H8="Unexpected number",W8="Unexpected string",X8="Unexpected identifier",q8="Unexpected reserved word",K8="Unexpected end of input",Z8="Invalid regular expression",Q8="Invalid regular expression: missing /",J8="Octal literals are not allowed in strict mode.",e9="Duplicate data property in object literal not allowed in strict mode",t9="ILLEGAL",n9="Disabled.",i9=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),r9=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function s9(e,t){if(!e)throw new Error("ASSERT: "+t)}function o9(e){return e>=48&&e<=57}function a9(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function l9(e){return"01234567".indexOf(e)>=0}function u9(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function c9(e){return 10===e||13===e||8232===e||8233===e}function d9(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&i9.test(String.fromCharCode(e))}function h9(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&r9.test(String.fromCharCode(e))}const p9={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function f9(){for(;E8<w8;){const e=x8.charCodeAt(E8);if(!u9(e)&&!c9(e))break;++E8}}function m9(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)E8<w8&&a9(x8[E8])?(i=x8[E8++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):k9({},G8,t9);return String.fromCharCode(r)}function g9(){var e,t,n,i;for(t=0,"}"===(e=x8[E8])&&k9({},G8,t9);E8<w8&&a9(e=x8[E8++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&k9({},G8,t9),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function _9(){var e,t;for(e=x8.charCodeAt(E8++),t=String.fromCharCode(e),92===e&&(117!==x8.charCodeAt(E8)&&k9({},G8,t9),++E8,(e=m9("u"))&&"\\"!==e&&d9(e.charCodeAt(0))||k9({},G8,t9),t=e);E8<w8&&h9(e=x8.charCodeAt(E8));)++E8,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==x8.charCodeAt(E8)&&k9({},G8,t9),++E8,(e=m9("u"))&&"\\"!==e&&h9(e.charCodeAt(0))||k9({},G8,t9),t+=e);return t}function y9(){var e,t;return e=E8,t=92===x8.charCodeAt(E8)?_9():function(){var e,t;for(e=E8++;E8<w8;){if(92===(t=x8.charCodeAt(E8)))return E8=e,_9();if(!h9(t))break;++E8}return x8.slice(e,E8)}(),{type:1===t.length?C8:p9.hasOwnProperty(t)?O8:"null"===t?M8:"true"===t||"false"===t?A8:C8,value:t,start:e,end:E8}}function v9(){var e,t,n,i,r=E8,s=x8.charCodeAt(E8),o=x8[E8];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++E8,{type:R8,value:String.fromCharCode(s),start:r,end:E8};default:if(61===(e=x8.charCodeAt(E8+1)))switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return E8+=2,{type:R8,value:String.fromCharCode(s)+String.fromCharCode(e),start:r,end:E8};case 33:case 61:return E8+=2,61===x8.charCodeAt(E8)&&++E8,{type:R8,value:x8.slice(r,E8),start:r,end:E8}}}return">>>="===(i=x8.substr(E8,4))?{type:R8,value:i,start:r,end:E8+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:R8,value:n,start:r,end:E8+=3}:o===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(o)>=0||"=>"===t?{type:R8,value:t,start:r,end:E8+=2}:("//"===t&&k9({},G8,t9),"<>=!+-*%&|^/".indexOf(o)>=0?(++E8,{type:R8,value:o,start:r,end:E8}):void k9({},G8,t9))}function b9(){var e,t,n;if(s9(o9((n=x8[E8]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=E8,e="","."!==n){if(e=x8[E8++],n=x8[E8],"0"===e){if("x"===n||"X"===n)return++E8,function(e){let t="";for(;E8<w8&&a9(x8[E8]);)t+=x8[E8++];return 0===t.length&&k9({},G8,t9),d9(x8.charCodeAt(E8))&&k9({},G8,t9),{type:k8,value:parseInt("0x"+t,16),start:e,end:E8}}(t);if(l9(n))return function(e){let t="0"+x8[E8++];for(;E8<w8&&l9(x8[E8]);)t+=x8[E8++];return(d9(x8.charCodeAt(E8))||o9(x8.charCodeAt(E8)))&&k9({},G8,t9),{type:k8,value:parseInt(t,8),octal:!0,start:e,end:E8}}(t);n&&o9(n.charCodeAt(0))&&k9({},G8,t9)}for(;o9(x8.charCodeAt(E8));)e+=x8[E8++];n=x8[E8]}if("."===n){for(e+=x8[E8++];o9(x8.charCodeAt(E8));)e+=x8[E8++];n=x8[E8]}if("e"===n||"E"===n)if(e+=x8[E8++],"+"!==(n=x8[E8])&&"-"!==n||(e+=x8[E8++]),o9(x8.charCodeAt(E8)))for(;o9(x8.charCodeAt(E8));)e+=x8[E8++];else k9({},G8,t9);return d9(x8.charCodeAt(E8))&&k9({},G8,t9),{type:k8,value:parseFloat(e),start:t,end:E8}}function T9(){var e,t,n,i;return I8=null,f9(),e=E8,t=function(){var e,t,n,i;for(s9("/"===(e=x8[E8]),"Regular expression literal must start with a slash"),t=x8[E8++],n=!1,i=!1;E8<w8;)if(t+=e=x8[E8++],"\\"===e)c9((e=x8[E8++]).charCodeAt(0))&&k9({},Q8),t+=e;else if(c9(e.charCodeAt(0)))k9({},Q8);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||k9({},Q8),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";E8<w8&&h9((e=x8[E8]).charCodeAt(0));)++E8,"\\"===e&&E8<w8?k9({},G8,t9):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&k9({},Z8,n),{value:n,literal:t}}(),i=function(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(e,t)=>{if(parseInt(t,16)<=1114111)return"x";k9({},Z8)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){k9({},Z8)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:E8}}function x9(){if(f9(),E8>=w8)return{type:S8,start:E8,end:E8};const e=x8.charCodeAt(E8);return d9(e)?y9():40===e||41===e||59===e?v9():39===e||34===e?function(){var e,t,n,i,r="",s=!1;for(s9("'"===(e=x8[E8])||'"'===e,"String literal must starts with a quote"),t=E8,++E8;E8<w8;){if((n=x8[E8++])===e){e="";break}if("\\"===n)if((n=x8[E8++])&&c9(n.charCodeAt(0)))"\r"===n&&"\n"===x8[E8]&&++E8;else switch(n){case"u":case"x":"{"===x8[E8]?(++E8,r+=g9()):r+=m9(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:l9(n)?(0!==(i="01234567".indexOf(n))&&(s=!0),E8<w8&&l9(x8[E8])&&(s=!0,i=8*i+"01234567".indexOf(x8[E8++]),"0123".indexOf(n)>=0&&E8<w8&&l9(x8[E8])&&(i=8*i+"01234567".indexOf(x8[E8++]))),r+=String.fromCharCode(i)):r+=n}else{if(c9(n.charCodeAt(0)))break;r+=n}}return""!==e&&k9({},G8,t9),{type:N8,value:r,octal:s,start:t,end:E8}}():46===e?o9(x8.charCodeAt(E8+1))?b9():v9():o9(e)?b9():v9()}function E9(){const e=I8;return E8=e.end,I8=x9(),E8=e.end,e}function w9(){const e=E8;I8=x9(),E8=e}function I9(e,t,n){const i=new b8("||"===e||"&&"===e?U8:F8);return i.operator=e,i.left=t,i.right=n,i}function A9(e,t){const n=new b8(L8);return n.callee=e,n.arguments=t,n}function S9(e){const t=new b8(B8);return t.name=e,t}function C9(e){const t=new b8($8);return t.value=e.value,t.raw=x8.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function O9(e,t,n){const i=new b8(V8);return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function M9(e,t,n){const i=new b8(j8);return i.key=t,i.value=n,i.kind=e,i}function k9(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(e,t)=>(s9(t<i.length,"Message reference must be in range"),i[t]));throw(n=new Error(r)).index=E8,n.description=r,n}function R9(e){e.type===S8&&k9(e,K8),e.type===k8&&k9(e,H8),e.type===N8&&k9(e,W8),e.type===C8&&k9(e,X8),e.type===O8&&k9(e,q8),k9(e,G8,e.value)}function N9(e){const t=E9();t.type===R8&&t.value===e||R9(t)}function D9(e){return I8.type===R8&&I8.value===e}function F9(e){return I8.type===O8&&I8.value===e}function L9(){const e=[];for(E8=I8.start,N9("[");!D9("]");)D9(",")?(E9(),e.push(null)):(e.push(q9()),D9("]")||N9(","));return E9(),function(e){const t=new b8(D8);return t.elements=e,t}(e)}function P9(){E8=I8.start;const e=E9();return e.type===N8||e.type===k8?(e.octal&&k9(e,J8),C9(e)):S9(e.value)}function B9(){var e,t,n;return E8=I8.start,(e=I8).type===C8?(n=P9(),N9(":"),M9("init",n,q9())):e.type!==S8&&e.type!==R8?(t=P9(),N9(":"),M9("init",t,q9())):void R9(e)}function $9(){var e,t,n=[],i={},r=String;for(E8=I8.start,N9("{");!D9("}");)t="$"+((e=B9()).key.type===B8?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?k9({},e9):i[t]=!0,n.push(e),D9("}")||N9(",");return N9("}"),function(e){const t=new b8(z8);return t.properties=e,t}(n)}const U9={if:1};function V9(){var e,t,n;if(D9("("))return function(){N9("(");const e=K9();return N9(")"),e}();if(D9("["))return L9();if(D9("{"))return $9();if(e=I8.type,E8=I8.start,e===C8||U9[I8.value])n=S9(E9().value);else if(e===N8||e===k8)I8.octal&&k9(I8,J8),n=C9(E9());else{if(e===O8)throw new Error(n9);e===A8?((t=E9()).value="true"===t.value,n=C9(t)):e===M8?((t=E9()).value=null,n=C9(t)):D9("/")||D9("/=")?(n=C9(T9()),w9()):R9(E9())}return n}function z9(){const e=[];if(N9("("),!D9(")"))for(;E8<w8&&(e.push(q9()),!D9(")"));)N9(",");return N9(")"),e}function j9(){E8=I8.start;const e=E9();return function(e){return e.type===C8||e.type===O8||e.type===A8||e.type===M8}(e)||R9(e),S9(e.value)}function Y9(){return N9("."),j9()}function G9(){N9("[");const e=K9();return N9("]"),e}function H9(){const e=function(){var e;for(e=V9();;)if(D9("."))e=O9(".",e,Y9());else if(D9("("))e=A9(e,z9());else{if(!D9("["))break;e=O9("[",e,G9())}return e}();if(I8.type===R8&&(D9("++")||D9("--")))throw new Error(n9);return e}function W9(){var e,t;if(I8.type!==R8&&I8.type!==O8)t=H9();else{if(D9("++")||D9("--"))throw new Error(n9);if(D9("+")||D9("-")||D9("~")||D9("!"))e=E9(),t=W9(),t=function(e,t){const n=new b8(Y8);return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(F9("delete")||F9("void")||F9("typeof"))throw new Error(n9);t=H9()}}return t}function X9(e){let t=0;if(e.type!==R8&&e.type!==O8)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function q9(){var e,t;return e=function(){var e,t,n,i,r,s,o,a,l,u;if(e=I8,l=W9(),0===(r=X9(i=I8)))return l;for(i.prec=r,E9(),t=[e,I8],s=[l,i,o=W9()];(r=X9(I8))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=I9(a,l,o),s.push(n);(i=E9()).prec=r,s.push(i),t.push(I8),n=W9(),s.push(n)}for(n=s[u=s.length-1],t.pop();u>1;)t.pop(),n=I9(s[u-1].value,s[u-2],n),u-=2;return n}(),D9("?")&&(E9(),t=q9(),N9(":"),e=function(e,t,n){const i=new b8(P8);return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,q9())),e}function K9(){const e=q9();if(D9(","))throw new Error(n9);return e}function Z9(e){E8=0,w8=(x8=e).length,I8=null,w9();const t=K9();if(I8.type!==S8)throw new Error("Unexpect token after expression.");return t}var Q9={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function J9(e){function t(t,n,i){return r=>function(t,n,i,r){let s=e(n[0]);return i&&(s=i+"("+s+")",0===i.lastIndexOf("new ",0)&&(s="("+s+")")),s+"."+t+(r<0?"":0===r?"()":"("+n.slice(1).map(e).join(",")+")")}(t,r,n,i)}const n="new Date",i="String",r="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(t){t.length<3&&ae("Missing arguments to clamp function."),t.length>3&&ae("Too many arguments to clamp function.");const n=t.map(e);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:t("getDate",n,0),day:t("getDay",n,0),year:t("getFullYear",n,0),month:t("getMonth",n,0),hours:t("getHours",n,0),minutes:t("getMinutes",n,0),seconds:t("getSeconds",n,0),milliseconds:t("getMilliseconds",n,0),time:t("getTime",n,0),timezoneoffset:t("getTimezoneOffset",n,0),utcdate:t("getUTCDate",n,0),utcday:t("getUTCDay",n,0),utcyear:t("getUTCFullYear",n,0),utcmonth:t("getUTCMonth",n,0),utchours:t("getUTCHours",n,0),utcminutes:t("getUTCMinutes",n,0),utcseconds:t("getUTCSeconds",n,0),utcmilliseconds:t("getUTCMilliseconds",n,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",i,0),lower:t("toLowerCase",i,0),substring:t("substring",i),split:t("split",i),trim:t("trim",i,0),regexp:r,test:t("test",r),if:function(t){t.length<3&&ae("Missing arguments to if function."),t.length>3&&ae("Too many arguments to if function.");const n=t.map(e);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function e7(e){const t=(e=e||{}).allowed?Dt(e.allowed):{},n=e.forbidden?Dt(e.forbidden):{},i=e.constants||Q9,r=(e.functions||J9)(d),s=e.globalvar,o=e.fieldvar,a=Ke(s)?s:e=>"".concat(s,'["').concat(e,'"]');let l={},u={},c=0;function d(e){if(bt(e))return e;const t=h[e.type];return null==t&&ae("Unsupported type: "+e.type),t(e)}const h={Literal:e=>e.raw,Identifier:e=>{const r=e.name;return c>0?r:ut(n,r)?ae("Illegal identifier: "+r):ut(i,r)?i[r]:ut(t,r)?r:(l[r]=1,a(r))},MemberExpression:e=>{const t=!e.computed,n=d(e.object);t&&(c+=1);const i=d(e.property);return n===o&&(u[function(e){const t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(i)]=1),t&&(c-=1),n+(t?"."+i:"["+i+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&ae("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,i=ut(r,t)&&r[t];return i||ae("Unrecognized function: "+t),Ke(i)?i(n):i+"("+n.map(d).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(d).join(",")+"]",BinaryExpression:e=>"("+d(e.left)+" "+e.operator+" "+d(e.right)+")",UnaryExpression:e=>"("+e.operator+d(e.argument)+")",ConditionalExpression:e=>"("+d(e.test)+"?"+d(e.consequent)+":"+d(e.alternate)+")",LogicalExpression:e=>"("+d(e.left)+e.operator+d(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(d).join(",")+"}",Property:e=>{c+=1;const t=d(e.key);return c-=1,t+":"+d(e.value)}};function p(e){const t={code:d(e),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},t}return p.functions=r,p.constants=i,p}const t7="view",n7="[",i7="]",r7="{",s7="}",o7=":",a7=",",l7="@",u7=">",c7=/[[\]{}]/,d7={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let h7,p7;function f7(e,t,n){return h7=t||t7,p7=n||d7,g7(e.trim()).map(_7)}function m7(e,t,n,i,r){const s=e.length;let o,a=0;for(;t<s;++t){if(o=e[t],!a&&o===n)return t;r&&r.indexOf(o)>=0?--a:i&&i.indexOf(o)>=0&&++a}return t}function g7(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=m7(e,r,a7,n7+r7,i7+s7),t.push(e.substring(i,r).trim()),i=++r;if(0===t.length)throw"Empty event selector: "+e;return t}function _7(e){return"["===e[0]?function(e){const t=e.length;let n,i=1;if(i=m7(e,i,i7,n7,i7),i===t)throw"Empty between selector: "+e;if(n=g7(e.substring(1,i)),2!==n.length)throw"Between selector must have two elements: "+e;if(e=e.slice(i+1).trim(),e[0]!==u7)throw"Expected '>' after between selector: "+e;n=n.map(_7);const r=_7(e.slice(1).trim());if(r.between)return{between:n,stream:r};r.between=n;return r}(e):function(e){const t={source:h7},n=[];let i,r,s=[0,0],o=0,a=0,l=e.length,u=0;if(e[l-1]===s7){if(u=e.lastIndexOf(r7),!(u>=0))throw"Unmatched right brace: "+e;try{s=function(e){const t=e.split(a7);if(!e.length||t.length>2)throw e;return t.map(t=>{const n=+t;if(n!=n)throw e;return n})}(e.substring(u+1,l-1))}catch(t){throw"Invalid throttle specification: "+e}l=(e=e.slice(0,u).trim()).length,u=0}if(!l)throw e;e[0]===l7&&(o=++u);i=m7(e,u,o7),i<l&&(n.push(e.substring(a,i).trim()),a=u=++i);if(u=m7(e,u,n7),u===l)n.push(e.substring(a,l).trim());else if(n.push(e.substring(a,u).trim()),r=[],a=++u,a===l)throw"Unmatched left bracket: "+e;for(;u<l;){if(u=m7(e,u,i7),u===l)throw"Unmatched left bracket: "+e;if(r.push(e.substring(a,u).trim()),u<l-1&&e[++u]!==n7)throw"Expected left bracket: "+e;a=++u}if(!(l=n.length)||c7.test(n[l-1]))throw"Invalid event selector: "+e;l>1?(t.type=n[1],o?t.markname=n[0].slice(1):!function(e){return p7[e]}(n[0])?t.source=n[0]:t.marktype=n[0]):t.type=n[0];"!"===t.type.slice(-1)&&(t.consume=!0,t.type=t.type.slice(0,-1));null!=r&&(t.filter=r);s[0]&&(t.throttle=s[0]);s[1]&&(t.debounce=s[1]);return t}(e)}var y7="5.20.0";st(Wo,s,a,u,c,d,p,h,f,m,_,y);const v7=y7;function b7(e,t,n){return e.fields=t||[],e.fname=n,e}function T7(e){return 1===e.length?x7(e[0]):E7(e)}const x7=e=>function(t){return t[e]},E7=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function w7(e){throw Error(e)}function I7(e){var t,n,i,r=[],s=null,o=0,a=e.length,l="";function u(){r.push(l+e.substring(t,n)),l="",t=n+1}for(e+="",t=n=0;n<a;++n)if("\\"===(i=e[n]))l+=e.substring(t,n),l+=e.substring(++n,++n),t=n;else if(i===s)u(),s=null,o=-1;else{if(s)continue;t===o&&'"'===i||t===o&&"'"===i?(t=n+1,s=i):"."!==i||o?"["===i?(n>t&&u(),o=t=n+1):"]"===i&&(o||w7("Access path missing open bracket: "+e),o>0&&u(),o=0,t=n+1):n>t?u():t=n+1}return o&&w7("Access path missing closing bracket: "+e),s&&w7("Access path missing closing quote: "+e),n>t&&(n++,u()),r}var A7=[],S7=(function(e,t,n){const i=I7(e);e=1===i.length?i[0]:e,b7((n&&n.get||T7)(i),[e],t||e)}("id"),b7(function(e){return e},A7,"identity"));b7(function(){return 0},A7,"zero"),b7(function(){return 1},A7,"one"),b7(function(){return!0},A7,"true"),b7(function(){return!1},A7,"false");function C7(e,t,n){var i=[t].concat([].slice.call(n));console[e].apply(console,i)}const O7=Array.isArray;function M7(e){return e===Object(e)}const k7=e=>"__proto__"!==e;function R7(...e){return e.reduce((e,t)=>{for(var n in t)if("signals"===n)e.signals=D7(e.signals,t.signals);else{var i="legend"===n?{layout:1}:"style"===n||null;N7(e,n,t[n],i)}return e},{})}function N7(e,t,n,i){var r,s;if(k7(t))if(M7(n)&&!O7(n))for(r in s=M7(e[t])?e[t]:e[t]={},n)i&&(!0===i||i[r])?N7(s,r,n[r]):k7(r)&&(s[r]=n[r]);else e[t]=n}function D7(e,t){if(null==e)return t;const n={},i=[];function r(e){n[e.name]||(n[e.name]=1,i.push(e))}return t.forEach(r),e.forEach(r),i}function F7(e){return null!=e?O7(e)?e:[e]:[]}const L7=Object.prototype.hasOwnProperty;function P7(e,t){return L7.call(e,t)}function B7(e){return"boolean"==typeof e}function $7(e){return"number"==typeof e}function U7(e){return"string"==typeof e}function V7(e){return O7(e)?"["+e.map(V7)+"]":M7(e)||U7(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function z7(e){for(var t={},n=0,i=e.length;n<i;++n)t[e[n]]=!0;return t}function j7(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}Object.create;Object.create;Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n},[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var Y7=n(1779),G7=n.n(Y7),H7=n(32017),W7=n.n(H7),X7=n(72492),q7=n.n(X7);function K7(e){return!!e.or}function Z7(e){return!!e.and}function Q7(e){return!!e.not}function J7(e,t){if(Q7(e))J7(e.not,t);else if(Z7(e))for(const n of e.and)J7(n,t);else if(K7(e))for(const n of e.or)J7(n,t);else t(e)}function eee(e,t){return Q7(e)?{not:eee(e.not,t)}:Z7(e)?{and:e.and.map(e=>eee(e,t))}:K7(e)?{or:e.or.map(e=>eee(e,t))}:t(e)}const tee=W7(),nee=G7();function iee(e,t){const n={};for(const i of t)P7(e,i)&&(n[i]=e[i]);return n}function ree(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>q7()(e)).join(",")})`};const see=q7();function oee(e){if($7(e))return e;const t=U7(e)?e:q7()(e);if(t.length<250)return t;let n=0;for(let e=0;e<t.length;e++){n=(n<<5)-n+t.charCodeAt(e),n&=n}return n}function aee(e){return!1===e||null===e}function lee(e,t){return e.indexOf(t)>-1}function uee(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function cee(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function dee(e,t){for(const n of _ee(t))N7(e,n,t[n],!0)}function hee(e,t){const n=[],i={};let r;for(const s of e)r=t(s),r in i||(i[r]=1,n.push(s));return n}function pee(e,t){for(const n of e)if(t.has(n))return!0;return!1}function fee(e){const t=new Set;for(const n of e){const e=I7(n).map((e,t)=>0===t?e:`[${e}]`),i=e.map((t,n)=>e.slice(0,n+1).join(""));for(const e of i)t.add(e)}return t}function mee(e,t){return void 0===e||void 0===t||pee(fee(e),fee(t))}function gee(e){return 0===_ee(e).length}const _ee=Object.keys,yee=Object.values;function vee(e){const t=[];for(const n in e)P7(e,n)&&t.push({key:n,value:e[n]});return t}function bee(e){return!0===e||!1===e}function Tee(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function xee(e,t){return Q7(e)?"!("+xee(e.not,t)+")":Z7(e)?"("+e.and.map(e=>xee(e,t)).join(") && (")+")":K7(e)?"("+e.or.map(e=>xee(e,t)).join(") || (")+")":t(e)}function Eee(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&Eee(e[n],t)&&delete e[n],gee(e)}function wee(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Iee(e,t="datum"){const n=I7(e),i=[];for(let e=1;e<=n.length;e++){const r=`[${n.slice(0,e).map(V7).join("][")}]`;i.push(`${t}${r}`)}return i.join(" && ")}function Aee(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function See(e){return`${I7(e).map(Aee).join("\\.")}`}function Cee(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Oee(e){return`${I7(e).join(".")}`}function Mee(e){return e?I7(e).length:0}function kee(...e){for(const t of e)if(void 0!==t)return t}let Ree=42;function Nee(e){if(void 0!==e)return(e%360+360)%360}function Dee(e){return!!$7(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Fee={domainColor:{part:"domain",vgProp:"stroke"},labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDash"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDash"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"},titleColor:{part:"title",vgProp:"fill"},title:null};function Lee(e){return e&&e.condition}const Pee=["domain","grid","labels","ticks","title"],Bee={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},$ee={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Uee=Object.assign(Object.assign({},$ee),{style:1,labelExpr:1,encoding:1});function Vee(e){return!!Uee[e]}_ee(Uee);const zee={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},jee=zee.arc,Yee=zee.area,Gee=zee.bar,Hee=zee.image,Wee=zee.line,Xee=zee.point,qee=zee.rect,Kee=zee.rule,Zee=zee.text,Qee=zee.tick,Jee=zee.trail,ete=zee.circle,tte=zee.square,nte=zee.geoshape;function ite(e){return lee(["line","area","trail"],e)}function rte(e){return lee(["rect","bar","image","arc"],e)}const ste=_ee(zee);function ote(e){return e.type}z7(ste);const ate=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],lte=_ee({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBand:1,timeUnitBandPosition:1}),ute={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},cte={binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},dte={binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5};function hte(e){return"mark"in e}class pte{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!hte(e)&&function(e){return ote(e)?e.type:e}(e.mark)===this.name}}const fte={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},mte={count:1,min:1,max:1};function gte(e){return!!e&&!!e.argmin}function _te(e){return!!e&&!!e.argmax}_ee(fte);function yte(e){return U7(e)&&!!fte[e]}const vte=["count","valid","missing","distinct"];function bte(e){return U7(e)&&lee(vte,e)}const Tte=["count","sum","distinct","valid","missing"],xte=z7(["mean","average","median","q1","q3","min","max"]),Ete="row",wte="column",Ite="facet",Ate="x",Ste="y",Cte="x2",Ote="y2",Mte="radius",kte="radius2",Rte="theta",Nte="theta2",Dte="latitude",Fte="longitude",Lte="latitude2",Pte="longitude2",Bte="color",$te="fill",Ute="stroke",Vte="shape",zte="size",jte="angle",Yte="opacity",Gte="fillOpacity",Hte="strokeOpacity",Wte="strokeWidth",Xte="strokeDash",qte="text",Kte="order",Zte="detail",Qte="key",Jte="tooltip",ene="href",tne="url",nne="description",ine={theta:1,theta2:1,radius:1,radius2:1};function rne(e){return e in ine}const sne={longitude:1,longitude2:1,latitude:1,latitude2:1};const one=_ee(sne),ane=Object.assign(Object.assign(Object.assign(Object.assign({},{x:1,y:1,x2:1,y2:1}),ine),sne),{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1});function lne(e){return e===Bte||e===$te||e===Ute}const une={row:1,column:1,facet:1},cne=_ee(une),dne=Object.assign(Object.assign({},ane),une),hne=_ee(dne),{order:pne,detail:fne,tooltip:mne}=dne,gne=j7(dne,["order","detail","tooltip"]),{row:_ne,column:yne,facet:vne}=gne,bne=j7(gne,["row","column","facet"]);_ee(gne),_ee(bne);function Tne(e){return!!bne[e]}function xne(e){return!!dne[e]}const Ene=[Cte,Ote,Lte,Pte,Nte,kte];function wne(e){return Ine(e)!==e}function Ine(e){switch(e){case Cte:return Ate;case Ote:return Ste;case Lte:return Dte;case Pte:return Fte;case Nte:return Rte;case kte:return Mte}return e}function Ane(e){if(rne(e))switch(e){case Rte:return"startAngle";case Nte:return"endAngle";case Mte:return"outerRadius";case kte:return"innerRadius"}return e}function Sne(e){switch(e){case Ate:return Cte;case Ste:return Ote;case Dte:return Lte;case Fte:return Pte;case Rte:return Nte;case Mte:return kte}}function Cne(e){switch(e){case Ate:case Cte:return"width";case Ste:case Ote:return"height"}}_ee(ane);const{x:One,y:Mne,x2:kne,y2:Rne,latitude:Nne,longitude:Dne,latitude2:Fne,longitude2:Lne,theta:Pne,theta2:Bne,radius:$ne,radius2:Une}=ane,Vne=j7(ane,["x","y","x2","y2","latitude","longitude","latitude2","longitude2","theta","theta2","radius","radius2"]),zne=_ee(Vne),jne={x:1,y:1},Yne=_ee(jne);function Gne(e){return e in jne}const Hne={theta:1,radius:1},Wne=_ee(Hne);function Xne(e){return"width"===e?Ate:Ste}const{text:qne,tooltip:Kne,href:Zne,url:Qne,description:Jne,detail:eie,key:tie,order:nie}=Vne,iie=j7(Vne,["text","tooltip","href","url","description","detail","key","order"]),rie=_ee(iie);const sie=Object.assign(Object.assign(Object.assign({},jne),Hne),iie),oie=_ee(sie);function aie(e){return!!sie[e]}function lie(e,t){return function(e){switch(e){case Bte:case $te:case Ute:case nne:case Zte:case Qte:case Jte:case ene:case Kte:case Yte:case Gte:case Hte:case Wte:case Ite:case Ete:case wte:return uie;case Ate:case Ste:case Dte:case Fte:return die;case Cte:case Ote:case Lte:case Pte:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case zte:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Xte:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case Vte:return{point:"always",geoshape:"always"};case qte:return{text:"always"};case jte:return{point:"always",square:"always",text:"always"};case tne:return{image:"always"};case Rte:case Mte:return{text:"always",arc:"always"};case Nte:case kte:return{arc:"always"}}}(e)[t]}const uie={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:cie}=uie,die=j7(uie,["geoshape"]);function hie(e){switch(e){case Ate:case Ste:case Rte:case Mte:case zte:case jte:case Wte:case Yte:case Gte:case Hte:case Cte:case Ote:case Nte:case kte:return;case Ite:case Ete:case wte:case Vte:case Xte:case qte:case Jte:case ene:case tne:case nne:return"discrete";case Bte:case $te:case Ute:return"flexible";case Dte:case Fte:case Lte:case Pte:case Zte:case Qte:case Kte:return}}function pie(e){return B7(e)&&(e=koe(e,void 0)),"bin"+_ee(e).map(t=>_ie(e[t])?Tee(`_${t}_${Object.entries(e[t])}`):Tee(`_${t}_${e[t]}`)).join("")}function fie(e){return!0===e||gie(e)&&!e.binned}function mie(e){return"binned"===e||gie(e)&&!0===e.binned}function gie(e){return M7(e)}function _ie(e){return null==e?void 0:e.selection}function yie(e){switch(e){case Ete:case wte:case zte:case Bte:case $te:case Ute:case Wte:case Yte:case Gte:case Hte:case Vte:return 6;case Xte:return 4;default:return 10}}function vie(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const bie='Autosize "fit" only works for single views and layered views.';function Tie(e){return`${"width"==e?"Width":"Height"} "container" only works for single views and layered views.`}function xie(e){return`${"width"==e?"Width":"Height"} "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function Eie(e){return e?`Dropping "fit-${e}" because spec has discrete ${Cne(e)}.`:'Dropping "fit" because spec has discrete size.'}function wie(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Iie(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Aie(e){return`Selection not supported for ${e} yet.`}function Sie(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}function Cie(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function Oie(e){return`Ignoring an invalid transform: ${see(e)}.`}function Mie(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function kie(e){return`Invalid field type "${e}".`}function Rie(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Nie(e,t){return`Dropping ${see(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function Die(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function Fie(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Lie(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${"ordinal"===t?"order":"magnitude"}.`}function Pie(e){return`Using unaggregated domain with raw field has no effect (${see(e)}).`}function Bie(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function $ie(e){return`Unaggregated domain is currently unsupported for log scale (${see(e)}).`}function Uie(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function Vie(e){return`The step for "${e}" is dropped because the ${"width"===e?"x":"y"} is continuous.`}const zie="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function jie(e,t){return`Invalid ${e}: ${see(t)}.`}function Yie(e){return`1D error band does not support ${e}.`}function Gie(e){return`Channel ${e} is required for "binned" bin.`}const Hie=function(e,t){var n=e||0;return{level:function(e){return arguments.length?(n=+e,this):n},error:function(){return n>=1&&C7(t||"error","ERROR",arguments),this},warn:function(){return n>=2&&C7(t||"warn","WARN",arguments),this},info:function(){return n>=3&&C7(t||"log","INFO",arguments),this},debug:function(){return n>=4&&C7(t||"log","DEBUG",arguments),this}}}(2);let Wie=Hie;function Xie(){return Wie=Hie,Wie}function qie(...e){Wie.warn(...e)}function Kie(e){if(e&&M7(e))for(const t of rre)if(t in e)return!0;return!1}const Zie=["january","february","march","april","may","june","july","august","september","october","november","december"],Qie=Zie.map(e=>e.substr(0,3)),Jie=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],ere=Jie.map(e=>e.substr(0,3));function tre(e,t){const n=[];if(t&&void 0!==e.day&&_ee(e).length>1&&(qie(function(e){return`Dropping day from datetime ${see(e)} as day cannot be combined with other units.`}(e)),delete(e=nee(e)).day),void 0!==e.year?n.push(e.year):n.push(2012),void 0!==e.month){const i=t?function(e){if(Dee(e)&&(e=+e),$7(e))return e-1;{const t=e.toLowerCase(),n=Zie.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=Qie.indexOf(i);if(-1!==r)return r;throw new Error(jie("month",e))}}(e.month):e.month;n.push(i)}else if(void 0!==e.quarter){const i=t?function(e){if(Dee(e)&&(e=+e),$7(e))return e>4&&qie(jie("quarter",e)),e-1;throw new Error(jie("quarter",e))}(e.quarter):e.quarter;n.push($7(i)?3*i:i+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){const i=t?function(e){if(Dee(e)&&(e=+e),$7(e))return e%7;{const t=e.toLowerCase(),n=Jie.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),r=ere.indexOf(i);if(-1!==r)return r;throw new Error(jie("day",e))}}(e.day):e.day;n.push($7(i)?i+1:i+"+1")}else n.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const i=e[t];n.push(void 0===i?0:i)}return n}function nre(e){const t=tre(e,!0).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}const ire={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},rre=_ee(ire);function sre(e){return e.startsWith("utc")}const ore={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function are(e){const t=[];for(const n of rre)lre(e,n)&&t.push(n);return t}function lre(e,t){const n=e.indexOf(t);return!(n<0)&&(!(n>0&&"seconds"===t&&"i"===e.charAt(n-1))&&(!(e.length>n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(n>0&&"year"===t&&"f"===e.charAt(n-1))))}function ure(e,t,{end:n}={end:!1}){const i=Iee(t),r=sre(e)?"utc":"";function s(e){return"quarter"===e?`(${r}quarter(${i})-1)`:`${r}${e}(${i})`}let o;const a={};for(const t of rre)lre(e,t)&&(a[t]=s(t),o=t);return n&&(a[o]+="+1"),function(e){const t=tre(e,!1).join(", ");return e.utc?`utc(${t})`:`datetime(${t})`}(a)}function cre(e){if(!e)return;const t=are(e);return`timeUnitSpecifier(${q7()(t)}, ${q7()(ore)})`}function dre(e){if(!e)return;let t;return U7(e)?t={unit:e}:M7(e)&&(t=Object.assign(Object.assign({},e),e.unit?{unit:e.unit}:{})),sre(t.unit)&&(t.utc=!0,t.unit=t.unit.substr(3)),t}function hre(e){return e&&!!e.signal}function pre(e){return!!e.step}function fre(e){return!O7(e)&&("field"in e&&"data"in e)}const mre=_ee({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1}),gre={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},_re=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function yre(e){return e&&!!e.field&&void 0!==e.equal}function vre(e){return e&&!!e.field&&void 0!==e.lt}function bre(e){return e&&!!e.field&&void 0!==e.lte}function Tre(e){return e&&!!e.field&&void 0!==e.gt}function xre(e){return e&&!!e.field&&void 0!==e.gte}function Ere(e){if(e&&e.field){if(O7(e.range)&&2===e.range.length)return!0;if(hre(e.range))return!0}return!1}function wre(e){return e&&!!e.field&&(O7(e.oneOf)||O7(e.in))}function Ire(e){return wre(e)||yre(e)||Ere(e)||vre(e)||Tre(e)||bre(e)||xre(e)}function Are(e,t){return Doe(e,{timeUnit:t,wrapTime:!0})}function Sre(e,t=!0){var n;const{field:i}=e,r=null===(n=dre(e.timeUnit))||void 0===n?void 0:n.unit,s=r?"time("+ure(r,i)+")":goe(e,{expr:"datum"});if(yre(e))return s+"==="+Are(e.equal,r);if(vre(e)){return`${s}<${Are(e.lt,r)}`}if(Tre(e)){return`${s}>${Are(e.gt,r)}`}if(bre(e)){return`${s}<=${Are(e.lte,r)}`}if(xre(e)){return`${s}>=${Are(e.gte,r)}`}if(wre(e))return`indexof([${function(e,t){return e.map(e=>Are(e,t))}(e.oneOf,r).join(",")}], ${s}) !== -1`;if(function(e){return e&&!!e.field&&void 0!==e.valid}(e))return Cre(s,e.valid);if(Ere(e)){const{range:n}=e,i=hre(n)?{signal:`${n.signal}[0]`}:n[0],o=hre(n)?{signal:`${n.signal}[1]`}:n[1];if(null!==i&&null!==o&&t)return"inrange("+s+", ["+Are(i,r)+", "+Are(o,r)+"])";const a=[];return null!==i&&a.push(`${s} >= ${Are(i,r)}`),null!==o&&a.push(`${s} <= ${Are(o,r)}`),a.length>0?a.join(" && "):"true"}throw new Error(`Invalid field predicate: ${JSON.stringify(e)}`)}function Cre(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Ore(e){var t;return Ire(e)&&e.timeUnit?Object.assign(Object.assign({},e),{timeUnit:null===(t=dre(e.timeUnit))||void 0===t?void 0:t.unit}):e}const Mre={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};const kre=Mre.quantitative,Rre=Mre.ordinal,Nre=Mre.temporal,Dre=Mre.nominal,Fre=Mre.geojson,Lre=_ee(Mre);const Pre="linear",Bre="log",$re="pow",Ure="sqrt",Vre="symlog",zre="time",jre="utc",Yre="quantile",Gre="quantize",Hre="threshold",Wre="point",Xre="band",qre={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},Kre=_ee(qre);function Zre(e,t){const n=qre[e],i=qre[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const Qre={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function Jre(e){return Qre[e]}const ese=["linear","log","pow","sqrt","symlog","time","utc"],tse=z7(ese),nse=z7(["linear","log","pow","sqrt","symlog"]);const ise=z7(["quantile","quantize","threshold"]),rse=z7(ese.concat(["quantile","quantize","threshold","sequential","identity"])),sse=z7(["ordinal","bin-ordinal","point","band"]);function ose(e){return e in sse}function ase(e){return e in rse}function lse(e){return e in tse}function use(e){return e in ise}function cse(e){return null==e?void 0:e.selection}const dse={type:1,domain:1,domainMid:1,align:1,range:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:hse,domain:pse,range:fse,scheme:mse}=(_ee(dse),dse),gse=j7(dse,["type","domain","range","scheme"]),_se=_ee(gse);!function(){var e;const t={};for(const n of hne)for(const i of Lre)for(const r of Kre){const s=xse(n,i);Tse(n,r)&&bse(r,i)&&(t[s]=null!==(e=t[s])&&void 0!==e?e:[],t[s].push(r))}}();function yse(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!lee(["point","band","identity"],e);case"bins":return!lee(["point","band","identity","ordinal"],e);case"round":return lse(e)||"band"===e||"point"===e;case"padding":return lse(e)||lee(["point","band"],e);case"paddingOuter":case"align":return lee(["point","band"],e);case"paddingInner":return"band"===e;case"domainMid":case"clamp":return lse(e);case"nice":return lse(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return ase(e)&&!lee(["log","time","utc","threshold","quantile"],e)}}function vse(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return lne(e)?void 0:`Cannot use the scale property "${e}" with non-color channel.`;case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"reverse":case"round":case"clamp":case"zero":return}}function bse(e,t){return lee([Rre,Dre],t)?void 0===e||ose(e):t===Nre?lee([zre,jre,void 0],e):t!==kre||lee([Bre,$re,Ure,Vre,Yre,Gre,Hre,Pre,void 0],e)}function Tse(e,t){if(!aie(e))return!1;switch(e){case Ate:case Ste:case Rte:case Mte:return lse(t)||lee(["band","point"],t);case zte:case Wte:case Yte:case Gte:case Hte:case jte:return lse(t)||use(t)||lee(["band","point","ordinal"],t);case Bte:case $te:case Ute:return"band"!==t;case Xte:return"ordinal"===t||use(t);case Vte:return"ordinal"===t}}function xse(e,t){return e+"_"+t}function Ese(e){const{channel:t,channelDef:n,markDef:i,scale:r,config:s}=e,o=Ose(e);return roe(n)&&!bte(n.aggregate)&&r&&lse(r.get("type"))&&!1===r.get("zero")?wse({fieldDef:n,channel:t,markDef:i,ref:o,config:s}):o}function wse({fieldDef:e,channel:t,markDef:n,ref:i,config:r}){if(ite(n.type))return i;return null===joe("invalid",n,r)?i:[Ise(e,t),i]}function Ise(e,t){const n=Ase(e,!0),i="y"===Ine(t)?{field:{group:"height"}}:{value:0};return Object.assign({test:n},i)}function Ase(e,t=!0){return Cre(U7(e)?e:goe(e,{expr:"datum"}),!t)}function Sse(e,t,n,i){const r={};if(t&&(r.scale=t),ooe(e)){const{datum:t}=e;Kie(t)?r.signal=nre(t):hre(t)?r.signal=t.signal:r.value=t}else r.field=goe(e,n);if(i){const{offset:e,band:t}=i;e&&(r.offset=e),t&&(r.band=t)}return r}function Cse({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,band:s=.5}){const o=0<s&&s<1?"datum":void 0,a=goe(t,{expr:o,suffix:r}),l=void 0!==n?goe(n,{expr:o}):goe(t,{suffix:"end",expr:o}),u={};if(0===s||1===s){u.scale=e;const t=0===s?a:l;u.field=t}else{const t=`${s} * ${a} + ${1-s} * ${l}`;u.signal=`scale("${e}", ${t})`}return i&&(u.offset=i),u}function Ose({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:l,defaultRef:u,band:c}){var d;if(t){if(uoe(t)){if(coe(t)){c=null!=c?c:Jse({channel:e,fieldDef:t,fieldDef2:n,markDef:i,stack:a,config:r,isMidPoint:!0});const{bin:o,timeUnit:u,type:d}=t;if(fie(o)||c&&u&&d===Nre)return a&&a.impute?Sse(t,s,{binSuffix:"mid"},{offset:l}):c?Cse({scaleName:s,fieldOrDatumDef:t,band:c,offset:l}):Sse(t,s,Loe(t,e)?{binSuffix:"range"}:{},{offset:l});if(mie(o)){if(roe(n))return Cse({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,band:c,offset:l});qie(Gie(e===Ate?Cte:Ote))}}const u=null==o?void 0:o.get("type");return Sse(t,s,ose(u)?{binSuffix:"range"}:{},{offset:l,band:"band"===u?null!==(d=null!=c?c:t.band)&&void 0!==d?d:.5:void 0})}if(doe(t)){const n=t.value,i=l?{offset:l}:{};return Object.assign(Object.assign({},Mse(e,n)),i)}}return"function"==typeof u&&(u=u()),u?Object.assign(Object.assign({},u),l?{offset:l}:{}):u}function Mse(e,t){return lee(["x","x2"],e)&&"width"===t?{field:{group:"width"}}:lee(["y","y2"],e)&&"height"===t?{field:{group:"height"}}:$oe(t)}function kse(e){return e&&"number"!==e&&"time"!==e}function Rse(e,t,n){return`${e}(${t}${n?`, ${JSON.stringify(n)}`:""})`}function Nse({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var o,a;if(kse(n))return Fse({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const l=Dse(e,i,r);if(Noe(e)){const n=function(e,t,n,i,r){return!t||n?`${r?"utc":"time"}Format(${e}, '${n=U7(n)?n:i}')`:function(e,t,n){if(!e)return;const i=cre(e);return`${n||sre(e)?"utc":"time"}Format(${t}, ${i})`}(t,e,r)}(l,roe(e)?null===(o=dre(e.timeUnit))||void 0===o?void 0:o.unit:void 0,t,s.timeFormat,hoe(e)&&(null===(a=e.scale)||void 0===a?void 0:a.type)===jre);return n?{signal:n}:void 0}if(t=Bse(soe(e),t,s),roe(e)&&fie(e.bin)){return{signal:Vse(l,goe(e,{expr:i,binSuffix:"end"}),t,n,s)}}return t||"quantitative"===soe(e)?{signal:`${$se(l,t)}`}:{signal:`isValid(${l}) ? ${l} : ""+${l}`}}function Dse(e,t,n){return roe(e)?n?`${goe(e,{expr:t,suffix:"end"})}-${goe(e,{expr:t,suffix:"start"})}`:goe(e,{expr:t}):function(e){const{datum:t}=e;return Kie(t)?nre(t):`${JSON.stringify(t)}`}(e)}function Fse({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}){if(o=null!=o?o:Dse(e,i,r),roe(e)&&fie(e.bin)){return{signal:Vse(o,goe(e,{expr:i,binSuffix:"end"}),t,n,s)}}return{signal:Rse(n,o,t)}}function Lse(e,t,n,i,r,s){var o;if(!kse(i)){if(Noe(e)){return function(e,t,n,i){if(e)return e;if(t)return{signal:cre(t)};return i?void 0:n.timeFormat}(n,roe(e)?null===(o=dre(e.timeUnit))||void 0===o?void 0:o.unit:void 0,r,s)}return Bse(t,n,r)}}function Pse(e,t,n){return e&&(hre(e)||"number"===e||"time"===e)?e:Noe(t)&&"time"!==n&&"utc"!==n?"time":void 0}function Bse(e,t,n){return U7(t)?t:e===kre?n.numberFormat:void 0}function $se(e,t){return`format(${e}, "${t||""}")`}function Use(e,t,n,i){var r;return kse(n)?Rse(n,e,t):$se(e,null!==(r=U7(t)?t:void 0)&&void 0!==r?r:i.numberFormat)}function Vse(e,t,n,i,r){const s=Use(e,n,i,r),o=Use(t,n,i,r);return`${Cre(e,!1)} ? "null" : ${s} + " " + ${o}`}const zse="min",jse={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function Yse(e){return e in jse}function Gse(e){return!!e&&!!e.encoding}function Hse(e){return!(!e||"count"!==e.op&&!e.field)}function Wse(e){return!!e&&O7(e)}function Xse(e){return"row"in e||"column"in e}function qse(e){return!!e&&"header"in e}function Kse(e){return"facet"in e}function Zse(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return Object.assign(Object.assign(Object.assign(Object.assign({},n?{timeUnit:n}:{}),i?{bin:i}:{}),r?{aggregate:r}:{}),{field:t})}function Qse(e){return coe(e)&&"sort"in e}function Jse({channel:e,fieldDef:t,fieldDef2:n,markDef:i,stack:r,config:s,isMidPoint:o}){if(uoe(t)&&void 0!==t.band)return t.band;if(roe(t)){const{timeUnit:e,bin:r}=t;if(e&&!n)return o?Yoe("timeUnitBandPosition",i,s):rte(i.type)?Yoe("timeUnitBand",i,s):0;if(fie(r))return rte(i.type)&&!o?1:.5}return(null==r?void 0:r.fieldChannel)===e&&o?.5:void 0}function eoe(e,t,n,i,r,s){return!!(fie(t.bin)||t.timeUnit&&coe(t)&&"temporal"===t.type)&&!!Jse({channel:e,fieldDef:t,fieldDef2:n,stack:i,markDef:r,config:s})}function toe(e){return!!e&&"condition"in e}function noe(e){const t=e&&e.condition;return!!t&&!O7(t)&&roe(t)}function ioe(e){const t=e&&e.condition;return!!t&&!O7(t)&&uoe(t)}function roe(e){return!(!e||!e.field&&"count"!==e.aggregate)}function soe(e){return e&&e.type}function ooe(e){return!!e&&"datum"in e}function aoe(e){return coe(e)&&yoe(e)||loe(e)}function loe(e){return ooe(e)&&$7(e.datum)}function uoe(e){return roe(e)||ooe(e)}function coe(e){return!!e&&("field"in e&&"type"in e||"count"===e.aggregate)}function doe(e){return e&&"value"in e&&"value"in e}function hoe(e){return!!e&&("scale"in e||"sort"in e)}function poe(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function foe(e){return!!e&&"legend"in e}function moe(e){return!!e&&("format"in e||"formatType"in e)}function goe(e,t={}){var n,i,r;let s=e.field;const o=t.prefix;let a=t.suffix,l="";if(function(e){return"count"===e.aggregate}(e))s=function(e){return 0===e.indexOf("__")}(u="count")?u:`__${u}`;else{let o;if(!t.nofn)if(function(e){return"op"in e}(e))o=e.op;else{const{bin:u,aggregate:c,timeUnit:d}=e;fie(u)?(o=pie(u),a=(null!==(n=t.binSuffix)&&void 0!==n?n:"")+(null!==(i=t.suffix)&&void 0!==i?i:"")):c?_te(c)?(l=`["${s}"]`,s=`argmax_${c.argmax}`):gte(c)?(l=`["${s}"]`,s=`argmin_${c.argmin}`):o=String(c):d&&(o=function(e){const t=dre(e),{utc:n}=t,i=j7(t,["utc"]);return i.unit?(n?"utc":"")+_ee(i).map(e=>Tee(`${"unit"===e?"":`_${e}_`}${i[e]}`)).join(""):(n?"utc":"")+"timeunit"+_ee(i).map(e=>Tee(`_${e}_${i[e]}`)).join("")}(d),a=(!lee(["range","mid"],t.binSuffix)&&t.binSuffix||"")+(null!==(r=t.suffix)&&void 0!==r?r:""))}o&&(s=s?`${o}_${s}`:o)}var u;return a&&(s=`${s}_${a}`),o&&(s=`${o}_${s}`),t.forAs?Oee(s):t.expr?function(e,t="datum"){return`${t}[${V7(I7(e).join("."))}]`}(s,t.expr)+l:See(s)+l}function _oe(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return roe(e)&&!!e.bin;case"temporal":return!1}throw new Error(kie(e.type))}function yoe(e){return!_oe(e)}const voe=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(_te(t))return`${r} for argmax(${t.argmax})`;if(gte(t))return`${r} for argmin(${t.argmin})`;const s=dre(i),o=t||(null==s?void 0:s.unit)||(null==s?void 0:s.maxbins)&&"timeunit"||fie(n)&&"bin";return o?o.toUpperCase()+"("+r+")":r}(e);default:return function(e,t){var n;const{field:i,bin:r,timeUnit:s,aggregate:o}=e;if("count"===o)return t.countTitle;if(fie(r))return`${i} (binned)`;if(s){const e=null===(n=dre(s))||void 0===n?void 0:n.unit;if(e)return`${i} (${are(e).join("-")})`}else if(o)return _te(o)?`${i} for max ${o.argmax}`:gte(o)?`${i} for min ${o.argmin}`:`${wee(o)} of ${i}`;return i}(e,t)}};let boe=voe;function Toe(e){boe=e}function xoe(e,t,{allowDisabling:n,includeDefault:i=!0}){var r,s;const o=(null!==(r=Eoe(e))&&void 0!==r?r:{}).title;if(!roe(e))return o;const a=e,l=i?woe(a,t):void 0;return n?kee(o,a.title,l):null!==(s=null!=o?o:a.title)&&void 0!==s?s:l}function Eoe(e){return poe(e)&&e.axis?e.axis:foe(e)&&e.legend?e.legend:qse(e)&&e.header?e.header:void 0}function woe(e,t){return boe(e,t)}function Ioe(e){var t;if(moe(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{const n=null!==(t=Eoe(e))&&void 0!==t?t:{},{format:i,formatType:r}=n;return{format:i,formatType:r}}}function Aoe(e){return roe(e)?e:noe(e)?e.condition:void 0}function Soe(e){return uoe(e)?e:ioe(e)?e.condition:void 0}function Coe(e,t,n){if(U7(e)||$7(e)||B7(e)){return qie(function(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${see(n)}}.`}(t,U7(e)?"string":$7(e)?"number":"boolean",e)),{value:e}}return uoe(e)?Ooe(e,t,n):ioe(e)?Object.assign(Object.assign({},e),{condition:Ooe(e.condition,t,n)}):e}function Ooe(e,t,n){if(moe(e)){const{format:i,formatType:r}=e,s=j7(e,["format","formatType"]);if(kse(r)&&!n.customFormatTypes)return qie(Mie(t)),Ooe(s,t,n)}else{const i=poe(e)?"axis":foe(e)?"legend":qse(e)?"header":null;if(i&&e[i]){const r=e[i],{format:s,formatType:o}=r,a=j7(r,["format","formatType"]);if(kse(o)&&!n.customFormatTypes)return qie(Mie(t)),Ooe(Object.assign(Object.assign({},e),{[i]:a}),t,n)}}return roe(e)?Moe(e,t):function(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=$7(n)?"quantitative":U7(n)?"nominal":Kie(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function Moe(e,t){const{aggregate:n,timeUnit:i,bin:r,field:s}=e,o=Object.assign({},e);if(!n||yte(n)||_te(n)||gte(n)||(qie(function(e){return`Invalid aggregation operator "${e}".`}(n)),delete o.aggregate),i&&(o.timeUnit=dre(i)),s&&(o.field=`${s}`),fie(r)&&(o.bin=koe(r,t)),mie(r)&&!Gne(t)&&qie(`Channel ${t} should not be used with "binned" bin.`),coe(o)){const{type:e}=o,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case kre:return"quantitative";case"t":case Nre:return"temporal";case"o":case Rre:return"ordinal";case"n":case Dre:return"nominal";case Fre:return"geojson"}}(e);e!==t&&(o.type=t),"quantitative"!==e&&bte(n)&&(qie(function(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}(e,n)),o.type="quantitative")}else if(!wne(t)){const e=function(e,t){if(e.timeUnit)return"temporal";if(fie(e.bin))return"quantitative";switch(hie(t)){case"continuous":default:return"quantitative";case"discrete":case"flexible":return"nominal"}}(o,t);qie(function(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}(t,e)),o.type=e}if(coe(o)){const{compatible:e,warning:n}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Ete:case wte:case Ite:return yoe(e)?{compatible:!1,warning:Fie(t)}:Roe;case Ate:case Ste:case Bte:case $te:case Ute:case qte:case Zte:case Qte:case Jte:case ene:case tne:case jte:case Rte:case Mte:case nne:return Roe;case Fte:case Pte:case Dte:case Lte:return n!==kre?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Roe;case Yte:case Gte:case Hte:case Wte:case zte:case Nte:case kte:case Cte:case Ote:return"nominal"!==n||e.sort?Roe:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case Xte:return lee(["ordinal","nominal"],e.type)?Roe:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case Vte:return lee(["ordinal","nominal","geojson"],e.type)?Roe:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case Kte:return"nominal"!==e.type||"sort"in e?Roe:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(o,t);e||qie(n)}if(Qse(o)&&U7(o.sort)){const{sort:e}=o;if(Yse(e))return Object.assign(Object.assign({},o),{sort:{encoding:e}});const t=e.substr(1);if("-"===e.charAt(0)&&Yse(t))return Object.assign(Object.assign({},o),{sort:{encoding:t,order:"descending"}})}if(qse(o)){const{header:e}=o,{orient:t}=e,n=j7(e,["orient"]);if(t)return Object.assign(Object.assign({},o),{header:Object.assign(Object.assign({},n),{labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t})})}return o}function koe(e,t){return B7(e)?{maxbins:yie(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:yie(t)})}const Roe={compatible:!0};function Noe(e){const{formatType:t}=Ioe(e);return"time"===t||!t&&function(e){return e&&("temporal"===e.type||roe(e)&&!!e.timeUnit)}(e)}function Doe(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var s;const o=t&&(null===(s=dre(t))||void 0===s?void 0:s.unit);let a,l=o||"temporal"===n;return hre(e)?a=e.signal:Kie(e)?(l=!0,a=nre(e)):(U7(e)||$7(e))&&l&&(a=`datetime(${JSON.stringify(e)})`,function(e){return!!ire[e]}(o)&&($7(e)&&e<1e4||U7(e)&&isNaN(Date.parse(e)))&&(a=nre({[o]:e}))),a?i&&l?`time(${a})`:a:r?void 0:JSON.stringify(e)}function Foe(e,t){const{type:n}=e;return t.map(t=>{const i=Doe(t,{timeUnit:roe(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t})}function Loe(e,t){return fie(e.bin)?aie(t)&&lee(["ordinal","nominal"],e.type):(console.warn("Only call this method for binned field defs."),!1)}function Poe(e){const{anchor:t,frame:n,offset:i,orient:r,color:s,subtitleColor:o,subtitleFont:a,subtitleFontSize:l,subtitleFontStyle:u,subtitleFontWeight:c,subtitleLineHeight:d,subtitlePadding:h}=e,p=j7(e,["anchor","frame","offset","orient","color","subtitleColor","subtitleFont","subtitleFontSize","subtitleFontStyle","subtitleFontWeight","subtitleLineHeight","subtitlePadding"]),f=Object.assign(Object.assign({},p),s?{fill:s}:{}),m=Object.assign(Object.assign(Object.assign(Object.assign({},t?{anchor:t}:{}),n?{frame:n}:{}),i?{offset:i}:{}),r?{orient:r}:{}),g=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o?{subtitleColor:o}:{}),a?{subtitleFont:a}:{}),l?{subtitleFontSize:l}:{}),u?{subtitleFontStyle:u}:{}),c?{subtitleFontWeight:c}:{}),d?{subtitleLineHeight:d}:{}),h?{subtitlePadding:h}:{});return{titleMarkConfig:f,subtitleMarkConfig:iee(f,["align","baseline","dx","dy","limit"]),nonMark:m,subtitle:g}}function Boe(e){return U7(e)||O7(e)&&U7(e[0])}function $oe(e){return hre(e)?e:void 0!==e?{value:e}:void 0}function Uoe(e){return hre(e)?e.signal:V7(e.value)}function Voe(e){return hre(e)?e.signal:null==e?null:V7(e)}function zoe(e){var t;return[].concat(e.type,null!==(t=e.style)&&void 0!==t?t:[])}function joe(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&void 0!==t[r]?t[r]:void 0!==t[e]?t[e]:!s||r&&r!==e?Yoe(e,t,n,i):void 0}function Yoe(e,t,n,{vgChannel:i}={}){return kee(i?Goe(e,t,n.style):void 0,Goe(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Goe(e,t,n){return Hoe(e,zoe(t),n)}function Hoe(e,t,n){let i;t=F7(t);for(const r of t){const t=n[r];t&&void 0!==t[e]&&(i=t[e])}return i}function Woe(e,t){return F7(e).reduce((e,n)=>{var i;return e.field.push(goe(n,t)),e.order.push(null!==(i=n.sort)&&void 0!==i?i:"ascending"),e},{field:[],order:[]})}function Xoe(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(tee(t,e))return;n.push(e)}),n}function qoe(e,t){return tee(e,t)||!t?e:e?[...F7(e),...F7(t)].join(", "):t}function Koe(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((Boe(n)||hre(n))&&(Boe(i)||hre(i)))return{explicit:e.explicit,value:qoe(n,i)};if(Boe(n)||hre(n))return{explicit:e.explicit,value:n};if(Boe(i)||hre(i))return{explicit:e.explicit,value:i};if(!(Boe(n)||hre(n)||Boe(i)||hre(i)))return{explicit:e.explicit,value:Xoe(n,i)};throw new Error("It should never reach here")}function Zoe(e,t){const n=e&&e[t];return!!n&&(O7(n)?uee(n,e=>!!e.field):roe(n)||noe(n))}function Qoe(e){return uee(hne,t=>{if(Zoe(e,t)){const n=e[t];if(O7(n))return uee(n,e=>!!e.aggregate);{const e=Aoe(n);return e&&!!e.aggregate}}return!1})}function Joe(e,t){const n=[],i=[],r=[],s=[],o={};return nae(e,(a,l)=>{if(roe(a)){const{field:u,aggregate:c,bin:d,timeUnit:h}=a,p=j7(a,["field","aggregate","bin","timeUnit"]);if(c||h||d){const e=Eoe(a),f=e&&e.title;let m=goe(a,{forAs:!0});const g=Object.assign(Object.assign(Object.assign({},f?[]:{title:xoe(a,t,{allowDisabling:!0})}),p),{field:m});if(c){let e;if(_te(c)?(e="argmax",m=goe({op:"argmax",field:c.argmax},{forAs:!0}),g.field=`${m}.${u}`):gte(c)?(e="argmin",m=goe({op:"argmin",field:c.argmin},{forAs:!0}),g.field=`${m}.${u}`):"boxplot"!==c&&"errorbar"!==c&&"errorband"!==c&&(e=c),e){const t={op:e,as:m};u&&(t.field=u),s.push(t)}}else if(n.push(m),coe(a)&&fie(d)){if(i.push({bin:d,field:u,as:m}),n.push(goe(a,{binSuffix:"end"})),Loe(a,l)&&n.push(goe(a,{binSuffix:"range"})),Gne(l)){const e={field:m+"_end"};o[l+"2"]=e}g.bin="binned",wne(l)||(g.type=kre)}else if(h){r.push({timeUnit:h,field:u,as:m});const e=coe(a)&&a.type!==Nre&&"time";e&&(l===qte||l===Jte?g.formatType=e:!function(e){return!!Vne[e]}(l)?Gne(l)&&(g.axis=Object.assign({formatType:e},g.axis)):g.legend=Object.assign({formatType:e},g.legend))}o[l]=g}else n.push(u),o[l]=e[l]}else o[l]=e[l]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function eae(e,t,n){const i=t.type;return _ee(e).reduce((r,s)=>{if(!xne(s))return qie(function(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}(s)),r;const o=e[s];if("angle"!==s||"arc"!==i||e.theta||(qie("Arc marks uses theta channel rather than angle, replacing angle with theta."),s=Rte),!function(e,t,n){const i=lie(t,n);if(!i)return!1;if("binned"===i){const n=e[t===Cte?Ate:Ste];return!!(roe(n)&&roe(e[t])&&mie(n.bin))}return!0}(e,s,i))return qie(Die(s,i)),r;if(s===zte&&"line"===i){const t=Aoe(e[s]);if(null==t?void 0:t.aggregate)return qie("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead."),r}if(s===Bte&&(t.filled?"fill"in e:"stroke"in e))return qie(Rie("encoding",{fill:"fill"in e,stroke:"stroke"in e})),r;if(s===Zte||s===Kte&&!O7(o)&&!doe(o)||s===Jte&&O7(o))o&&(r[s]=F7(o).reduce((e,t)=>(roe(t)?e.push(Moe(t,s)):qie(Nie(t,s)),e),[]));else{if(s===Jte&&null===o)r[s]=null;else if(!(roe(o)||ooe(o)||doe(o)||toe(o)||hre(o)))return qie(Nie(o,s)),r;r[s]=Coe(o,s,n)}return r},{})}function tae(e){const t=[];for(const n of _ee(e))if(Zoe(e,n)){const i=F7(e[n]);for(const e of i)roe(e)?t.push(e):noe(e)&&t.push(e.condition)}return t}function nae(e,t,n){if(e)for(const i of _ee(e)){const r=e[i];if(O7(r))for(const e of r)t.call(n,e,i);else t.call(n,r,i)}}function iae(e,t,n,i){return e?_ee(e).reduce((n,r)=>{const s=e[r];return O7(s)?s.reduce((e,n)=>t.call(i,e,n,r),n):t.call(i,n,s,r)},n):n}function rae(e,t){return _ee(t).reduce((n,i)=>{switch(i){case Ate:case Ste:case ene:case nne:case tne:case Cte:case Ote:case Rte:case Nte:case Mte:case kte:case Dte:case Fte:case Lte:case Pte:case qte:case Vte:case jte:case Jte:return n;case Kte:if("line"===e||"trail"===e)return n;case Zte:case Qte:{const e=t[i];if(O7(e)||roe(e))for(const t of F7(e))t.aggregate||n.push(goe(t,{}));return n}case zte:if("trail"===e)return n;case Bte:case $te:case Ute:case Yte:case Gte:case Hte:case Xte:case Wte:{const e=Aoe(t[i]);return e&&!e.aggregate&&n.push(goe(e,{})),n}}},[])}function sae(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};return{tooltip:[...e.map(({fieldPrefix:e,titlePrefix:n})=>{const r=i?` of ${t.field}`:"";return{field:e+t.field,type:t.type,title:hre(n)?{signal:n+`"${escape(r)}"`}:n+r}}),...tae(n)]}}function oae(e){const{axis:t,title:n,field:i}=e;return t&&void 0!==t.title?void 0:kee(n,i)}function aae(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c,aria:d,extraEncoding:h={}})=>{const p=oae(n);return lae(e,a,r,d,{mark:l,encoding:Object.assign(Object.assign(Object.assign({[t]:Object.assign(Object.assign(Object.assign({field:u+"_"+n.field,type:n.type},void 0!==p?{title:p}:{}),void 0!==s?{scale:s}:{}),void 0!==o?{axis:o}:{})},U7(c)?{[t+"2"]:{field:c+"_"+n.field}}:{}),i),h)})}}function lae(e,t,n,i,r){const{clip:s,color:o,opacity:a}=e,l=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),s?{clip:s}:{}),o?{color:o}:{}),a?{opacity:a}:{}),ote(r.mark)?r.mark:{type:r.mark}),{style:`${l}-${t}`}),B7(e[t])?{}:e[t]),!1===i?{aria:i}:{})})]:[]}function uae(e,t,n){const{encoding:i}=e,r="vertical"===t?"y":"x",s=i[r],o=i[r+"2"],a=i[r+"Error"],l=i[r+"Error2"];return{continuousAxisChannelDef:cae(s,n),continuousAxisChannelDef2:cae(o,n),continuousAxisChannelDefError:cae(a,n),continuousAxisChannelDefError2:cae(l,n),continuousAxis:r}}function cae(e,t){if(e&&e.aggregate){const{aggregate:n}=e,i=j7(e,["aggregate"]);return n!==t&&qie(function(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}(n,t)),i}return e}function dae(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(aoe(r)){if(aoe(s)){const e=roe(r)&&r.aggregate,i=roe(s)&&s.aggregate;if(e||i!==t){if(i||e!==t){if(e===t&&i===t)throw new Error("Both x and y cannot have aggregate");return ote(n)&&n.orient?n.orient:"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(aoe(s))return"vertical";throw new Error("Need a valid continuous axis for "+t+"s")}const hae="boxplot",pae=new pte(hae,mae);function fae(e){return $7(e)?"tukey":e}function mae(e,{config:t}){var n,i;const{mark:r,encoding:s,selection:o,projection:a}=e,l=j7(e,["mark","encoding","selection","projection"]),u=ote(r)?r:{type:r};o&&qie(Aie("boxplot"));const c=null!==(n=u.extent)&&void 0!==n?n:t.boxplot.extent,d=joe("size",u,t),h=fae(c),{transform:p,continuousAxisChannelDef:f,continuousAxis:m,groupby:g,aggregate:_,encodingWithoutContinuousAxis:y,ticksOrient:v,boxOrient:b,customTooltipWithoutAggregatedField:T}=function(e,t,n){const i=dae(e,hae),{continuousAxisChannelDef:r,continuousAxis:s}=uae(e,i,hae),o=r.field,a=fae(t),l=[...gae(o),{op:"median",field:o,as:"mid_box_"+o},{op:"min",field:o,as:("min-max"===a?"lower_whisker_":"min_")+o},{op:"max",field:o,as:("min-max"===a?"upper_whisker_":"max_")+o}],u="min-max"===a||"tukey"===a?[]:[{calculate:`datum["upper_box_${o}"] - datum["lower_box_${o}"]`,as:"iqr_"+o},{calculate:`min(datum["upper_box_${o}"] + datum["iqr_${o}"] * ${t}, datum["max_${o}"])`,as:"upper_whisker_"+o},{calculate:`max(datum["lower_box_${o}"] - datum["iqr_${o}"] * ${t}, datum["min_${o}"])`,as:"lower_whisker_"+o}],c=e.encoding,d=s,h=(c[d],j7(c,["symbol"==typeof d?d:d+""])),{customTooltipWithoutAggregatedField:p,filteredEncoding:f}=function(e){const{tooltip:t}=e,n=j7(e,["tooltip"]);if(!t)return{filteredEncoding:e};let i,r;if(O7(t)){for(const e of t)e.aggregate?(i||(i=[]),i.push(e)):(r||(r=[]),r.push(e));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return O7(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}(h),{bins:m,timeUnits:g,aggregate:_,groupby:y,encoding:v}=Joe(f,n),b="vertical"===i?"horizontal":"vertical",T=i,x=[...m,...g,{aggregate:[..._,...l],groupby:y},...u];return{transform:x,groupby:y,aggregate:_,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:b,boxOrient:T,customTooltipWithoutAggregatedField:p}}(e,c,t),{color:x,size:E}=y,w=j7(y,["color","size"]),I=e=>aae(u,m,f,e,t.boxplot),A=I(w),S=I(y),C=I(Object.assign(Object.assign({},w),E?{size:E}:{})),O=sae([{fieldPrefix:"min-max"===h?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===h?"lower_whisker_":"min_",titlePrefix:"Min"}],f,y),M={type:"tick",color:"black",opacity:1,orient:v,invalid:null},k="min-max"===h?O:sae([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],f,y),R=[...A({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",aria:!1,extraEncoding:k}),...A({partName:"rule",mark:{type:"rule",invalid:null},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",aria:!1,extraEncoding:k}),...A({partName:"ticks",mark:M,positionPrefix:"lower_whisker",aria:!1,extraEncoding:k}),...A({partName:"ticks",mark:M,positionPrefix:"upper_whisker",aria:!1,extraEncoding:k})],N=[..."tukey"!==h?R:[],...S({partName:"box",mark:Object.assign(Object.assign({type:"bar"},d?{size:d}:{}),{orient:b,invalid:null}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",aria:!1,extraEncoding:O}),...C({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},M7(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),d?{size:d}:{}),{orient:v,ariaRoleDescription:"box"}),positionPrefix:"mid_box",extraEncoding:O})];let D;if("min-max"!==h){const e=`datum["lower_box_${f.field}"]`,n=`datum["upper_box_${f.field}"]`,i=`(${n} - ${e})`,r=`${e} - ${c} * ${i}`,s=`${n} + ${c} * ${i}`,o=`datum["${f.field}"]`,a={joinaggregate:gae(f.field),groupby:g};let l;"tukey"===h&&(l={transform:[{filter:`(${r} <= ${o}) && (${o} <= ${s})`},{aggregate:[{op:"min",field:f.field,as:"lower_whisker_"+f.field},{op:"max",field:f.field,as:"upper_whisker_"+f.field},{op:"min",field:"lower_box_"+f.field,as:"lower_box_"+f.field},{op:"max",field:"upper_box_"+f.field,as:"upper_box_"+f.field},..._],groupby:g}],layer:R});const{tooltip:d}=w,p=j7(w,["tooltip"]),{scale:y,axis:v}=f,b=oae(f),x=lae(u,"outliers",t.boxplot,!0,{transform:[{filter:`(${o} < ${r}) || (${o} > ${s})`}],mark:"point",encoding:Object.assign(Object.assign({[m]:Object.assign(Object.assign(Object.assign({field:f.field,type:f.type},void 0!==b?{title:b}:{}),void 0!==y?{scale:y}:{}),void 0!==v?{axis:v}:{})},p),T?{tooltip:T}:{})})[0];x&&l?D={transform:[a],layer:[x,l]}:x?(D=x,D.transform.unshift(a)):l&&(D=l,D.transform.unshift(a))}return D?Object.assign(Object.assign({},l),{layer:[D,{transform:p,layer:N}]}):Object.assign(Object.assign({},l),{transform:(null!==(i=l.transform)&&void 0!==i?i:[]).concat(p),layer:N})}function gae(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}const _ae="errorbar",yae=new pte(_ae,vae);function vae(e,{config:t}){const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:l,tooltipEncoding:u}=Tae(e,_ae,t),c=aae(a,r,i,s,t.errorbar),d={type:"tick",orient:o},h=[...c({partName:"ticks",mark:d,positionPrefix:"lower",aria:!1,extraEncoding:u}),...c({partName:"ticks",mark:d,positionPrefix:"upper",aria:!1,extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar"},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return Object.assign(Object.assign(Object.assign({},l),{transform:n}),h.length>1?{layer:h}:Object.assign({},h[0]))}function bae(e,t){const{encoding:n}=e;if(function(e){return(uoe(e.x)||uoe(e.y))&&!uoe(e.x2)&&!uoe(e.y2)&&!uoe(e.xError)&&!uoe(e.xError2)&&!uoe(e.yError)&&!uoe(e.yError2)}(n))return{orient:dae(e,t),inputType:"raw"};const i=function(e){return uoe(e.x2)||uoe(e.y2)}(n),r=function(e){return uoe(e.xError)||uoe(e.xError2)||uoe(e.yError)||uoe(e.yError2)}(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const e=n.x2,i=n.y2;if(uoe(e)&&uoe(i))throw new Error(`${t} cannot have both x2 and y2`);if(uoe(e)){if(aoe(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}if(uoe(i)){if(aoe(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,r=n.yError,a=n.yError2;if(uoe(i)&&!uoe(e))throw new Error(`${t} cannot have xError2 without xError`);if(uoe(a)&&!uoe(r))throw new Error(`${t} cannot have yError2 without yError`);if(uoe(e)&&uoe(r))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(uoe(e)){if(aoe(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(uoe(r)){if(aoe(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Tae(e,t,n){var i;const{mark:r,encoding:s,selection:o,projection:a}=e,l=j7(e,["mark","encoding","selection","projection"]),u=ote(r)?r:{type:r};o&&qie(Aie(t));const{orient:c,inputType:d}=bae(e,t),{continuousAxisChannelDef:h,continuousAxisChannelDef2:p,continuousAxisChannelDefError:f,continuousAxisChannelDefError2:m,continuousAxis:g}=uae(e,c,t),{errorBarSpecificAggregate:_,postAggregateCalculates:y,tooltipSummary:v,tooltipTitleWithFieldName:b}=function(e,t,n,i,r,s,o,a){let l=[],u=[];const c=t.field;let d,h=!1;if("raw"===s){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":a.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&qie(function(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}(t,n,o)),"stderr"===n||"stdev"===n)l=[{op:n,field:c,as:"extent_"+c},{op:t,field:c,as:"center_"+c}],u=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:"upper_"+c},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:"lower_"+c}],d=[{fieldPrefix:"center_",titlePrefix:wee(t)},{fieldPrefix:"upper_",titlePrefix:xae(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:xae(t,n,"-")}],h=!0;else{let t,i,r;e.center&&e.extent&&qie(function(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`}(e.extent,o)),"ci"===n?(t="mean",i="ci0",r="ci1"):(t="median",i="q1",r="q3"),l=[{op:i,field:c,as:"lower_"+c},{op:r,field:c,as:"upper_"+c},{op:t,field:c,as:"center_"+c}],d=[{fieldPrefix:"upper_",titlePrefix:xoe({field:c,aggregate:r,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:xoe({field:c,aggregate:i,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:xoe({field:c,aggregate:t,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&qie(function(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}(e.center,e.extent)),"aggregated-upper-lower"===s?(d=[],u=[{calculate:`datum["${n.field}"]`,as:"upper_"+c},{calculate:`datum["${c}"]`,as:"lower_"+c}]):"aggregated-error"===s&&(d=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:"upper_"+c}],r?u.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:"lower_"+c}):u.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:"lower_"+c}));for(const e of u)d.push({fieldPrefix:e.as.substring(0,6),titlePrefix:Cee(Cee(e.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:d,tooltipTitleWithFieldName:h}}(u,h,p,f,m,d,t,n),T=s,x=g,E=(T[x],"x"===g?"x2":"y2"),w=(T[E],"x"===g?"xError":"yError"),I=(T[w],"x"===g?"xError2":"yError2"),A=(T[I],j7(T,["symbol"==typeof x?x:x+"","symbol"==typeof E?E:E+"","symbol"==typeof w?w:w+"","symbol"==typeof I?I:I+""])),{bins:S,timeUnits:C,aggregate:O,groupby:M,encoding:k}=Joe(A,n),R=[...O,..._],N="raw"!==d?[]:M,D=sae(v,h,k,b);return{transform:[...null!==(i=l.transform)&&void 0!==i?i:[],...S,...C,...0===R.length?[]:[{aggregate:R,groupby:N}],...y],groupby:N,continuousAxisChannelDef:h,continuousAxis:g,encodingWithoutContinuousAxis:k,ticksOrient:"vertical"===c?"horizontal":"vertical",markDef:u,outerSpec:l,tooltipEncoding:D}}function xae(e,t,n){return wee(e)+" "+n+" "+t}const Eae="errorband",wae=new pte(Eae,Iae);function Iae(e,{config:t}){const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:l}=Tae(e,Eae,t),u=o,c=aae(u,r,i,s,t.errorband),d=void 0!==e.encoding.x&&void 0!==e.encoding.y;let h={type:d?"area":"rect"},p={type:d?"line":"rule"};const f=Object.assign(Object.assign({},u.interpolate?{interpolate:u.interpolate}:{}),u.tension&&u.interpolate?{tension:u.tension}:{});return d?(h=Object.assign(Object.assign(Object.assign({},h),f),{ariaRoleDescription:"errorband"}),p=Object.assign(Object.assign({},p),f)):u.interpolate?qie(Yie("interpolate")):u.tension&&qie(Yie("tension")),Object.assign(Object.assign({},a),{transform:n,layer:[...c({partName:"band",mark:h,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:p,positionPrefix:"lower",aria:!1,extraEncoding:l}),...c({partName:"borders",mark:p,positionPrefix:"upper",aria:!1,extraEncoding:l})]})}const Aae={};function Sae(e,t,n){const i=new pte(e,t);Aae[e]={normalizer:i,parts:n}}Sae(hae,mae,["box","median","outliers","rule","ticks"]),Sae(_ae,vae,["ticks","rule"]),Sae(Eae,Iae,["band","borders"]);const Cae=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],Oae=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Mae={fillColor:{part:"legend",vgProp:"fill"},gradientStrokeColor:{part:"gradient",vgProp:"stroke"},labelColor:{part:"labels",vgProp:"fill"},strokeColor:{part:"legend",vgProp:"stroke"},symbolFillColor:{part:"symbols",vgProp:"fill"},symbolStrokeColor:{part:"symbols",vgProp:"stroke"},titleColor:{part:"title",vgProp:"fill"}},kae={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Rae=(_ee(kae),"_vgsid_"),Nae={single:{on:"click",fields:[Rae],resolve:"global",empty:"all",clear:"dblclick"},multi:{on:"click",fields:[Rae],toggle:"event.shiftKey",resolve:"global",empty:"all",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Dae(e){return!(!e||"legend"!==e&&!e.legend)}function Fae(e){return Dae(e)&&M7(e)}function Lae(e){return"concat"in e}function Pae(e){return"vconcat"in e}function Bae(e){return"hconcat"in e}function $ae(e){return M7(e)&&void 0!==e.step}function Uae(e){return e.view||e.width||e.height}const Vae=_ee({align:1,bounds:1,center:1,columns:1,spacing:1});function zae(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e["width"===t?"continuousWidth":"continuousHeight"]}function jae(e,t){const n=Yae(e,t);return $ae(n)?n.step:Gae}function Yae(e,t){var n;return kee(null!==(n=e[t])&&void 0!==n?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const Gae=20;const Hae={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Gae},mark:{color:"#4c78a8",invalid:"filter",timeUnitBand:1},arc:{},area:{},bar:cte,circle:{},geoshape:{},image:{},line:{},point:{},rect:dte,rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Nae,style:{},title:{},facet:{spacing:20},concat:{spacing:20}},Wae=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Xae={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},qae={blue:Wae[0],orange:Wae[1],red:Wae[2],teal:Wae[3],green:Wae[4],yellow:Wae[5],purple:Wae[6],pink:Wae[7],brown:Wae[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Kae(e={}){const{color:t,font:n,fontSize:i}=e,r=j7(e,["color","font","fontSize"]);return R7({},Hae,n?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(n):{},t?function(e={}){return{signals:[{name:"color",value:M7(e)?Object.assign(Object.assign({},qae),e):qae}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(t):{},i?function(e){return{signals:[{name:"fontSize",value:M7(e)?Object.assign(Object.assign({},Xae),e):Xae}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(i):{},r||{})}const Zae=["view",...ste],Qae=["color","fontSize","background","padding","facet","concat","numberFormat","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],Jae=Object.assign({view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"]},{area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]});function ele(e){e=nee(e);for(const t of Qae)delete e[t];if(e.axis)for(const t in e.axis)Lee(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Cae)delete e.legend[t];if(e.mark){for(const t of lte)delete e.mark[t];e.mark.tooltip&&M7(e.mark.tooltip)&&delete e.mark.tooltip}for(const t of Zae){for(const n of lte)delete e[t][n];const n=Jae[t];if(n)for(const i of n)delete e[t][i];tle(e,t)}for(const t of _ee(Aae))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=Poe(e.title);gee(t)||(e.style["group-title"]=Object.assign(Object.assign({},e.style["group-title"]),t));gee(n)||(e.style["group-subtitle"]=Object.assign(Object.assign({},e.style["group-subtitle"]),n));gee(i)?delete e.title:e.title=i}(e);for(const t in e)M7(e[t])&&gee(e[t])&&delete e[t];return gee(e)?void 0:e}function tle(e,t,n,i){const r=i?e[t][i]:e[t];"view"===t&&(n="cell");const s=Object.assign(Object.assign({},r),e.style[null!=n?n:t]);gee(s)||(e.style[null!=n?n:t]=s),i||delete e[t]}function nle(e){return"layer"in e}class ile{map(e,t){return Kse(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):Bae(e)?this.mapHConcat(e,t):Pae(e)?this.mapVConcat(e,t):Lae(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(nle(e))return this.mapLayer(e,t);if(hte(e))return this.mapUnit(e,t);throw new Error(vie(e))}mapLayer(e,t){return Object.assign(Object.assign({},e),{layer:e.layer.map(e=>this.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const{concat:n}=e,i=j7(e,["concat"]);return Object.assign(Object.assign({},i),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const rle={zero:1,center:1,normalize:1};const sle=new Set([jee,Gee,Yee,Kee,Xee,ete,tte,Wee,Zee,Qee]),ole=new Set([Gee,Yee,jee]);function ale(e,t){var n,i;const r="x"===t?"y":"radius",s=e[t],o=e[r];if(roe(s)&&roe(o))if("quantitative"===soe(s)&&"quantitative"===soe(o)){if(s.stack)return t;if(o.stack)return r;const e=roe(s)&&!!s.aggregate;if(e!==(roe(o)&&!!o.aggregate))return e?t:r;{const e=null===(n=s.scale)||void 0===n?void 0:n.type,a=null===(i=o.scale)||void 0===i?void 0:i.type;if(e&&"linear"!==e)return r;if(a&&"linear"!==a)return t}}else{if("quantitative"===soe(s))return t;if("quantitative"===soe(o))return r}else{if("quantitative"===soe(s))return t;if("quantitative"===soe(o))return r}}function lle(e,t,n={}){const i=ote(e)?e.type:e;if(!sle.has(i))return null;const r=ale(t,"x")||ale(t,"theta");if(!r)return null;const s=t[r],o=roe(s)?goe(s,{}):void 0;let a=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(r),l=t[a],u=roe(l)?goe(l,{}):void 0;u===o&&(u=void 0,l=void 0,a=void 0);const c=zne.reduce((e,n)=>{if("tooltip"!==n&&Zoe(t,n)){const i=t[n];for(const t of F7(i)){const i=Aoe(t);if(i.aggregate)continue;const r=goe(i,{});r&&r===u||e.push({channel:n,fieldDef:i})}}return e},[]);let d;if(void 0!==s.stack?d=B7(s.stack)?s.stack?"zero":null:s.stack:c.length>0&&ole.has(i)&&(d="zero"),!d||!function(e){return e in rle}(d))return null;if(Qoe(t)&&0===c.length)return null;if(s.scale&&s.scale.type&&s.scale.type!==Pre){if(n.disallowNonLinearStack)return null;qie(function(e){return`Cannot stack non-linear scale (${e}).`}(s.scale.type))}return uoe(t[Sne(r)])?(void 0!==s.stack&&qie(`Cannot stack "${h=r}" if there is already "${h}2".`),null):(roe(s)&&s.aggregate&&!lee(Tte,s.aggregate)&&qie(`Stacking is applied even though the aggregate function is non-summative ("${s.aggregate}").`),{groupbyChannel:l?a:void 0,groupbyField:u,fieldChannel:r,impute:null!==s.impute&&ite(i),stackBy:c,offset:d});var h}function ule(e){const{point:t,line:n}=e,i=j7(e,["point","line"]);return _ee(i).length>1?i:i.type}function cle(e){for(const t of["line","area","rule","trail"])e[t]&&(e=Object.assign(Object.assign({},e),{[t]:ree(e[t],["point","line"])}));return e}function dle(e,t={},n){return"transparent"===e.point?{opacity:0}:e.point?M7(e.point)?e.point:{}:void 0!==e.point?null:t.point||n.shape?M7(t.point)?t.point:{}:void 0}function hle(e,t={}){return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class ple{constructor(){this.name="path-overlay"}hasMatchingType(e,t){if(hte(e)){const{mark:n,encoding:i}=e,r=ote(n)?n:{type:n};switch(r.type){case"line":case"rule":case"trail":return!!dle(r,t[r.type],i);case"area":return!!dle(r,t[r.type],i)||!!hle(r,t[r.type])}}return!1}run(e,t,n){const{config:i}=t,{selection:r,projection:s,encoding:o,mark:a}=e,l=j7(e,["selection","projection","encoding","mark"]),u=ote(a)?a:{type:a},c=dle(u,i[u.type],o),d="area"===u.type&&hle(u,i[u.type]),h=[Object.assign(Object.assign({},r?{selection:r}:{}),{mark:ule(Object.assign(Object.assign({},"area"===u.type&&void 0===u.opacity&&void 0===u.fillOpacity?{opacity:.7}:{}),u)),encoding:ree(o,["shape"])})],p=lle(u,o);let f=o;if(p){const{fieldChannel:e,offset:t}=p;f=Object.assign(Object.assign({},o),{[e]:Object.assign(Object.assign({},o[e]),t?{stack:t}:{})})}return d&&h.push(Object.assign(Object.assign({},s?{projection:s}:{}),{mark:Object.assign(Object.assign({type:"line"},iee(u,["clip","interpolate","tension","tooltip"])),d),encoding:f})),c&&h.push(Object.assign(Object.assign({},s?{projection:s}:{}),{mark:Object.assign(Object.assign({type:"point",opacity:1,filled:!0},iee(u,["clip","tooltip"])),c),encoding:f})),n(Object.assign(Object.assign({},l),{layer:h}),Object.assign(Object.assign({},t),{config:cle(i)}))}}class fle{constructor(){this.name="RangeStep"}hasMatchingType(e){var t;if(hte(e)&&e.encoding)for(const n of Yne){const i=e.encoding[n];if(i&&uoe(i)&&(null===(t=null==i?void 0:i.scale)||void 0===t?void 0:t.rangeStep))return!0}return!1}run(e){var t;const n={};let i=Object.assign({},e.encoding);for(const e of Yne){const r=Cne(e),s=i[e];if(s&&uoe(s)&&(null===(t=null==s?void 0:s.scale)||void 0===t?void 0:t.rangeStep)){const{scale:t}=s,o=j7(s,["scale"]),a=t,{rangeStep:l}=a,u=j7(a,["rangeStep"]);n[r]={step:t.rangeStep},qie('Scale\'s "rangeStep" is deprecated and will be removed in Vega-Lite 5.0. Please use "width"/"height": {"step": ...} instead. See https://vega.github.io/vega-lite/docs/size.html.'),i=Object.assign(Object.assign({},i),{[e]:Object.assign(Object.assign({},o),gee(u)?{}:{scale:u})})}}return Object.assign(Object.assign(Object.assign({},n),e),{encoding:i})}}function mle(e,t){return t?Xse(e)?Tle(e,t):yle(e,t):e}function gle(e,t){return t?Tle(e,t):e}function _le(e,t,n){const i=t[e];return function(e){return e&&!U7(e)&&"repeat"in e}(i)?i.repeat in n?Object.assign(Object.assign({},t),{[e]:n[i.repeat]}):void qie(function(e){return`Unknown repeated value "${e}".`}(i.repeat)):t}function yle(e,t){if(void 0!==(e=_le("field",e,t))){if(null===e)return null;if(Qse(e)&&Hse(e.sort)){const n=_le("field",e.sort,t);e=Object.assign(Object.assign({},e),n?{sort:n}:{})}return e}}function vle(e,t){if(roe(e))return yle(e,t);{const n=_le("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function ble(e,t){if(!uoe(e)){if(ioe(e)){const n=vle(e.condition,t);if(n)return Object.assign(Object.assign({},e),{condition:n});{const{condition:t}=e;return j7(e,["condition"])}}return e}{const n=vle(e,t);if(n)return n;if(toe(e))return{condition:e.condition}}}function Tle(e,t){const n={};for(const i in e)if(P7(e,i)){const r=e[i];if(O7(r))n[i]=r.map(e=>ble(e,t)).filter(e=>e);else{const e=ble(r,t);void 0!==e&&(n[i]=e)}}return n}class xle{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if(hte(e)){const{encoding:t,mark:n}=e;if("line"===n)for(const e of Ene){const n=t[Ine(e)];if(t[e]&&(roe(n)&&!mie(n.bin)||ooe(n)))return!0}}return!1}run(e,t,n){const{encoding:i}=e;var r,s;return qie((r=!!i.x2,s=!!i.y2,`Line mark is for continuous lines and thus cannot be used with ${r&&s?"x2 and y2":r?"x2":"y2"}. We will use the rule mark (line segments) instead.`)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}function Ele(e){const{parentEncoding:t,encoding:n}=e;if(t&&n){const e=_ee(t).reduce((e,t)=>(n[t]&&e.push(t),e),[]);e.length>0&&qie(`Layer's shared ${(i=e).join(",")} channel ${1===i.length?"is":"are"} overriden.`)}var i;const r=Object.assign(Object.assign({},null!=t?t:{}),null!=n?n:{});return gee(r)?void 0:r}function wle(e){const{parentProjection:t,projection:n}=e;return t&&n&&qie(function(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${see(t)} is overridden by a child projection ${see(n)}.`}({parentProjection:t,projection:n})),null!=n?n:t}function Ile(e,t){void 0===t&&(t=Kae(e.config));const n=function(e,t={}){return Ale.map(e,{config:t})}(e,t),{width:i,height:r}=e,s=function(e,t,n){let{width:i,height:r}=t;const s=hte(e)||nle(e),o={};s?"container"==i&&"container"==r?(o.type="fit",o.contains="padding"):"container"==i?(o.type="fit-x",o.contains="padding"):"container"==r&&(o.type="fit-y",o.contains="padding"):("container"==i&&(qie(Tie("width")),i=void 0),"container"==r&&(qie(Tie("height")),r=void 0));const a=Object.assign(Object.assign(Object.assign({type:"pad"},o),n?Sle(n.autosize):{}),Sle(e.autosize));"fit"!==a.type||s||(qie(bie),a.type="pad");"container"==i&&"fit"!=a.type&&"fit-x"!=a.type&&qie(xie("width"));"container"==r&&"fit"!=a.type&&"fit-y"!=a.type&&qie(xie("height"));if(tee(a,{type:"pad"}))return;return a}(n,{width:i,height:r,autosize:e.autosize},t);return Object.assign(Object.assign({},n),s?{autosize:s}:{})}const Ale=new class extends ile{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[pae,yae,wae,new ple,new xle,new fle]}map(e,t){if(hte(e)){const n=Zoe(e.encoding,Ete),i=Zoe(e.encoding,wte),r=Zoe(e.encoding,Ite);if(n||i||r)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,r=Object.assign(Object.assign({},e),{encoding:gle(e.encoding,t.repeater)});if(n||i)return this.mapUnitWithParentEncodingOrProjection(r,t);const s=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(r,t.config))return e.run(r,t,s);return r}mapRepeat(e,t){return function(e){return!O7(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,t):this.mapNonLayerRepeat(e,t)}mapLayerRepeat(e,t){const{repeat:n,spec:i}=e,r=j7(e,["repeat","spec"]),{row:s,column:o,layer:a}=n,{repeater:l={},repeaterPrefix:u=""}=t;return s||o?this.mapRepeat(Object.assign(Object.assign({},e),{repeat:Object.assign(Object.assign({},s?{row:s}:{}),o?{column:o}:{}),spec:{repeat:{layer:a},spec:i}}),t):Object.assign(Object.assign({},r),{layer:a.map(e=>{const n=Object.assign(Object.assign({},l),{layer:e}),r=(i.name||"")+u+`child__layer_${Tee(e)}`,s=this.mapLayerOrUnit(i,Object.assign(Object.assign({},t),{repeater:n,repeaterPrefix:r}));return s.name=r,s})})}mapNonLayerRepeat(e,t){var n;const{repeat:i,spec:r,data:s}=e,o=j7(e,["repeat","spec","data"]);!O7(i)&&e.columns&&(e=ree(e,["columns"]),qie(Sie("repeat")));const a=[],{repeater:l={},repeaterPrefix:u=""}=t,c=!O7(i)&&i.row||[l?l.row:null],d=!O7(i)&&i.column||[l?l.column:null],h=O7(i)&&i||[l?l.repeat:null];for(const e of h)for(const n of c)for(const s of d){const o={repeat:e,row:n,column:s,layer:l.layer},c=(r.name||"")+u+"child__"+(O7(i)?`${Tee(e)}`:(i.row?`row_${Tee(n)}`:"")+(i.column?`column_${Tee(s)}`:"")),d=this.map(r,Object.assign(Object.assign({},t),{repeater:o,repeaterPrefix:c}));d.name=c,a.push(ree(d,["data"]))}const p=O7(i)?e.columns:i.column?i.column.length:1;return Object.assign(Object.assign({data:null!==(n=r.data)&&void 0!==n?n:s,align:"all"},o),{columns:p,concat:a})}mapFacet(e,t){const{facet:n}=e;return Xse(n)&&e.columns&&(e=ree(e,["columns"]),qie(Sie("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:r,parentProjection:s,config:o}=t,a=wle({parentProjection:s,projection:i}),l=Ele({parentEncoding:r,encoding:gle(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),a?{projection:a}:{}),l?{encoding:l}:{}),{config:o})}mapFacetedUnit(e,t){const n=e.encoding,{row:i,column:r,facet:s}=n,o=j7(n,["row","column","facet"]),{mark:a,width:l,projection:u,height:c,view:d,selection:h,encoding:p}=e,f=j7(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:m,layout:g}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},t),_=gle(o,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},f),g),{facet:m,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l?{width:l}:{}),c?{height:c}:{}),d?{view:d}:{}),u?{projection:u}:{}),{mark:a,encoding:_}),h?{selection:h}:{})}),t)}getFacetMappingAndLayout(e,t){var n;const{row:i,column:r,facet:s}=e;if(i||r){s&&qie(`Facet encoding dropped as ${(o=[...i?[Ete]:[],...r?[wte]:[]]).join(" and ")} ${o.length>1?"are":"is"} also specified.`);const t={},a={};for(const i of[Ete,wte]){const r=e[i];if(r){const{align:e,center:s,spacing:o,columns:l}=r,u=j7(r,["align","center","spacing","columns"]);t[i]=u;for(const e of["align","center","spacing"])void 0!==r[e]&&(a[e]=null!==(n=a[e])&&void 0!==n?n:{},a[e][i]=r[e])}}return{facetMapping:t,layout:a}}{const{align:e,center:n,spacing:i,columns:r}=s;return{facetMapping:mle(j7(s,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},e?{align:e}:{}),n?{center:n}:{}),i?{spacing:i}:{}),r?{columns:r}:{})}}var o}mapLayer(e,t){var{parentEncoding:n,parentProjection:i}=t,r=j7(t,["parentEncoding","parentProjection"]);const{encoding:s,projection:o}=e,a=j7(e,["encoding","projection"]),l=Object.assign(Object.assign({},r),{parentEncoding:Ele({parentEncoding:n,encoding:s}),parentProjection:wle({parentProjection:i,projection:o})});return super.mapLayer(a,l)}};function Sle(e){return U7(e)?{type:e}:null!=e?e:{}}const Cle=["background","padding"];function Ole(e){return Cle.reduce((t,n)=>(e&&void 0!==e[n]&&(t[n]=e[n]),t),{})}class Mle{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new Mle(nee(this.explicit),nee(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return kee(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of _ee(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function kle(e){return{explicit:!0,value:e}}function Rle(e){return{explicit:!1,value:e}}function Nle(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:Dle(t,n,i,r)}}function Dle(e,t,n,i){return e.explicit&&t.explicit&&qie(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${see(n)} and ${see(i)}). Using ${see(n)}.`}(n,i,e.value,t.value)),e}function Fle(e,t,n,i,r=Dle){return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:tee(e.value,t.value)?e:r(e,t,n,i)}class Lle extends Mle{constructor(e={},t={},n=!1){super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function Ple(e){return"url"in e}function Ble(e){return"values"in e}function $le(e){return"name"in e&&!Ple(e)&&!Ble(e)&&!Ule(e)}function Ule(e){return e&&(Vle(e)||zle(e)||jle(e))}function Vle(e){return"sequence"in e}function zle(e){return"sphere"in e}function jle(e){return"graticule"in e}const Yle="main",Gle="raw";function Hle(e){return"filter"in e}function Wle(e){return"lookup"in e}function Xle(e){return"pivot"in e}function qle(e){return"density"in e}function Kle(e){return"quantile"in e}function Zle(e){return"regression"in e}function Qle(e){return"loess"in e}function Jle(e){return"sample"in e}function eue(e){return"window"in e}function tue(e){return"joinaggregate"in e}function nue(e){return"flatten"in e}function iue(e){return"calculate"in e}function rue(e){return"bin"in e}function sue(e){return"impute"in e}function oue(e){return"timeUnit"in e}function aue(e){return"aggregate"in e}function lue(e){return"stack"in e}function uue(e){return"fold"in e}function cue(e,t,n,i){const r=toe(t)&&t.condition,s=i(t);if(r){const t=F7(r).map(t=>{const n=i(t),r=function(e){return e.selection}(t)?nhe(e,t.selection):rhe(e,t.test);return Object.assign({test:r},n)});return{[n]:[...t,...void 0!==s?[s]:[]]}}return void 0!==s?{[n]:s}:{}}function due(e,t="text"){const n=e.encoding[t];return cue(e,n,t,t=>hue(t,e.config))}function hue(e,t,n="datum"){if(e){if(doe(e))return $oe(e.value);if(uoe(e)){const{format:i,formatType:r}=Ioe(e);return Nse({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function pue(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(O7(o))return{tooltip:mue({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return cue(e,o,"tooltip",e=>{const o=hue(e,r,a);if(o)return o;if(null===e)return;let l=joe("tooltip",i,r);return!0===l&&(l={content:"encoding"}),U7(l)?{value:l}:M7(l)?"encoding"===l.content?mue(n,s,r,t):{signal:a}:void 0})}}function fue(e,t,n,{reactiveGeom:i}={}){const r={},s=i?"datum.datum":"datum",o=[];function a(i,a){const l=Ine(a),u=coe(i)?i:Object.assign(Object.assign({},i),{type:e[l].type}),c=F7(xoe(u,n,{allowDisabling:!1})).join(", ");let d;if(Gne(a)){const i="x"===a?"x2":"y2",o=Aoe(e[i]);if(mie(u.bin)&&o){const e=goe(u,{expr:s}),t=goe(o,{expr:s}),{format:a,formatType:l}=Ioe(u);d=Vse(e,t,a,l,n),r[i]=!0}else if(t&&t.fieldChannel===a&&"normalize"===t.offset){const{format:e,formatType:t}=Ioe(u);d=Nse({fieldOrDatumDef:u,format:e,formatType:t,expr:s,config:n,normalizeStack:!0}).signal}}d=null!=d?d:hue(u,n,s).signal,o.push({channel:a,key:c,value:d})}nae(e,(e,t)=>{roe(e)?a(e,t):noe(e)&&a(e.condition,t)});const l={};for(const{channel:e,key:t,value:n}of o)r[e]||l[t]||(l[V7(t)]=n);return l}function mue(e,t,n,{reactiveGeom:i}={}){const r=vee(fue(e,t,n,{reactiveGeom:i})).map(({key:e,value:t})=>`${e}: ${t}`);return r.length>0?{signal:`{${r.join(", ")}}`}:void 0}function gue(e){const{markDef:t,config:n}=e,i=joe("aria",t,n);return!1===i?{}:Object.assign(Object.assign(Object.assign({},i?{aria:i}:{}),function(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const r=joe("ariaRoleDescription",n,i);if(null!=r)return{ariaRoleDescription:{value:r}};return t in gre?{}:{ariaRoleDescription:{value:t}}}(e)),function(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return cue(e,s,"description",t=>hue(t,e.config));const o=joe("description",n,i);if(null!=o)return{description:$oe(o)};if(!1===i.aria)return{};const a=fue(t,r,i);if(gee(a))return;return{description:{signal:vee(a).map(({key:e,value:t})=>`${e} + ": " + (${t})`).join(' + "; " + ')}}}(e))}function _ue(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:l}=n;void 0===a&&(l=null!=l?l:joe(e,i,s,{vgChannel:o,ignoreVgConfig:!0}),void 0!==l&&(a=$oe(l)));const u=r[e];return cue(t,u,null!=o?o:e,n=>Ose({channel:e,channelDef:n,markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function yue(e,t={filled:void 0}){var n,i,r,s;const{markDef:o,encoding:a,config:l}=e,{type:u}=o,c=null!==(n=t.filled)&&void 0!==n?n:joe("filled",o,l),d=lee(["bar","point","circle","square","geoshape"],u)?"transparent":void 0,h=null!==(r=null!==(i=joe(!0===c?"color":void 0,o,l,{vgChannel:"fill"}))&&void 0!==i?i:l.mark[!0===c&&"color"])&&void 0!==r?r:d,p=null!==(s=joe(!1===c?"color":void 0,o,l,{vgChannel:"stroke"}))&&void 0!==s?s:l.mark[!1===c&&"color"],f=c?"fill":"stroke",m=Object.assign(Object.assign({},h?{fill:$oe(h)}:{}),p?{stroke:$oe(p)}:{});return o.color&&(c?o.fill:o.stroke)&&qie(Rie("property",{fill:"fill"in o,stroke:"stroke"in o})),Object.assign(Object.assign(Object.assign(Object.assign({},m),_ue("color",e,{vgChannel:f,defaultValue:c?h:p})),_ue("fill",e,{defaultValue:a.fill?h:void 0})),_ue("stroke",e,{defaultValue:a.stroke?p:void 0}))}function vue(e,t){const n=function(e){switch(e){case Ate:return"xOffset";case Ste:return"yOffset";case Cte:return"x2Offset";case Ote:return"y2Offset";case Rte:return"thetaOffset";case Mte:return"radiusOffset";case Nte:return"theta2Offset";case kte:return"radius2Offset"}}(e),i=t[n];if(i)return i}function bue(e,t,{defaultPos:n,vgChannel:i,isMidPoint:r}){const{encoding:s,markDef:o,config:a,stack:l}=t,u=s[e],c=s[Sne(e)],d=t.scaleName(e),h=t.getScaleComponent(e),p=vue(e,o),f=Tue({model:t,defaultPos:n,channel:e,scaleName:d,scale:h}),m=!u&&Gne(e)&&(s.latitude||s.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,isMidPoint:i,scaleName:r,stack:s,offset:o,markDef:a,config:l}=e;if(uoe(n)&&s&&t===s.fieldChannel){if(roe(n)){const e=Jse({channel:t,fieldDef:n,isMidPoint:i,markDef:a,stack:s,config:l});if(void 0!==e)return Cse({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",band:e,offset:o})}return Sse(n,r,{suffix:"end"},{offset:o})}return Ese(e)}({channel:e,channelDef:u,channel2Def:c,markDef:o,config:a,isMidPoint:r,scaleName:d,scale:h,stack:l,offset:p,defaultRef:f});return m?{[i||e]:m}:void 0}function Tue({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=Ine(n),l=Ane(n),u=joe(n,s,o,{vgChannel:l});if(void 0!==u)return Mse(n,u);switch(t){case"zeroOrMin":case"zeroOrMax":if(i){const e=r.get("type");if(lee([Bre,zre,jre],e));else if(r.domainDefinitelyIncludesZero())return{scale:i,value:0}}if("zeroOrMin"===t)return"y"===a?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":{const t=e[Cne(n)];return Object.assign(Object.assign({},t),{mult:.5})}}}}const xue={left:"x",center:"xc",right:"x2"},Eue={top:"y",middle:"yc",bottom:"y2"};function wue(e,t,n,i="middle"){if("radius"===e||"theta"===e)return Ane(e);const r=joe("x"===e?"align":"baseline",t,n);return"x"===e?xue[r||("top"===i?"left":"center")]:Eue[r||i]}function Iue(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?Aue(e,t,{defaultPos:n,defaultPos2:i}):bue(e,t,{defaultPos:n})}function Aue(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=Sne(e),a=Cne(e),l=function(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,l=Ine(n),u=Cne(n),c=Ane(n),d=i[l],h=e.scaleName(l),p=e.getScaleComponent(l),f=vue(n in i||n in s?n:l,e.markDef);if(!d&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude))return{[c]:{field:e.getName(n)}};const m=function({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:l,defaultRef:u}){if(uoe(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0))return Sse(t,s,{suffix:"start"},{offset:l});return Ese({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:l,defaultRef:u})}({channel:n,channelDef:d,channel2Def:i[n],markDef:s,config:a,scaleName:h,scale:p,stack:o,offset:f,defaultRef:void 0});if(void 0!==m)return{[c]:m};return Sue(n,s)||Sue(n,{[n]:Goe(n,s,a.style),[u]:Goe(u,s,a.style)})||Sue(n,a[r])||Sue(n,a.mark)||{[c]:Tue({model:e,defaultPos:t,channel:n,scaleName:h,scale:p})()}}(t,i,o),u=l[a]?wue(e,r,s):Ane(e);return Object.assign(Object.assign({},bue(e,t,{defaultPos:n,vgChannel:u})),l)}function Sue(e,t){const n=Cne(e),i=Ane(e);return void 0!==t[i]?{[i]:Mse(e,t[i])}:void 0!==t[e]?{[i]:Mse(e,t[e])}:t[n]?{[n]:Mse(e,t[n])}:void 0}function Cue(e,t,n){var i,r,s,o;const{config:a,encoding:l,markDef:u,stack:c}=e,d=Sne(t),h=Cne(t),p=l[t],f=l[d],m=e.getScaleComponent(t),g=m?m.get("type"):void 0,_=e.scaleName(t),y=u.orient,v=null!==(r=null!==(i=l[h])&&void 0!==i?i:l.size)&&void 0!==r?r:joe("size",u,a,{vgChannel:h}),b="bar"===n&&("x"===t?"vertical"===y:"horizontal"===y);if(roe(p)&&(fie(p.bin)||mie(p.bin)||p.timeUnit&&!f)&&!v&&!ose(g)){const n=Jse({channel:t,fieldDef:p,stack:c,markDef:u,config:a}),i=null===(s=e.component.axes[t])||void 0===s?void 0:s[0];return function({fieldDef:e,fieldDef2:t,channel:n,band:i,scaleName:r,markDef:s,spacing:o=0,axisTranslate:a,reverse:l,config:u}){const c=Sne(n),d=Ane(n),h=Ane(c),p=vue(n,s);if(fie(e.bin)||e.timeUnit)return{[h]:kue({channel:n,fieldDef:e,scaleName:r,markDef:s,band:(1-i)/2,offset:Mue(c,o,l,a,p),config:u}),[d]:kue({channel:n,fieldDef:e,scaleName:r,markDef:s,band:1-(1-i)/2,offset:Mue(n,o,l,a,p),config:u})};if(mie(e.bin)){const i=Sse(e,r,{},{offset:Mue(c,o,l,a,p)});if(roe(t))return{[h]:i,[d]:Sse(t,r,{},{offset:Mue(n,o,l,a,p)})};if(gie(e.bin)&&e.bin.step)return{[h]:i,[d]:{signal:`scale("${r}", ${goe(e,{expr:"datum"})} + ${e.bin.step})`,offset:Mue(n,o,l,a,p)}}}return void qie(Gie(c))}({fieldDef:p,fieldDef2:f,channel:t,markDef:u,scaleName:_,band:n,axisTranslate:null!==(o=null==i?void 0:i.get("translate"))&&void 0!==o?o:.5,spacing:Gne(t)?joe("binSpacing",u,a):void 0,reverse:m.get("reverse"),config:a})}return(uoe(p)&&ose(g)||b)&&!f?function(e,t,n,i){var r;const{markDef:s,encoding:o,config:a,stack:l}=i,u=s.orient,c=i.scaleName(n),d=i.getScaleComponent(n),h=Cne(n),p=Sne(n),f="horizontal"===u&&"y"===n||"vertical"===u&&"x"===n,m=joe(f?"size":h,s,a,{vgChannel:h});let g;(o.size||void 0!==m)&&(f?g=_ue("size",i,{vgChannel:h,defaultValue:m}):qie(function(e){return`Cannot apply size to non-oriented mark "${e}".`}(s.type)));const _=null!==(r=uoe(t)?Jse({channel:n,fieldDef:t,markDef:s,stack:l,config:a}):void 0)&&void 0!==r?r:1;g=g||{[h]:Oue(e,h,c,d,a,_)};const y="band"!==(null==d?void 0:d.get("type"))||!("band"in g[h]),v=wue(n,s,a,y?"middle":"top"),b=vue(n,s),T=Ese({channel:n,channelDef:t,markDef:s,config:a,scaleName:c,scale:d,stack:l,offset:b,defaultRef:Tue({model:i,defaultPos:"mid",channel:n,scaleName:c,scale:d}),band:y?.5:(1-_)/2});if(h)return Object.assign({[v]:T},g);{const e=Ane(p),t=g[h],n=b?Object.assign(Object.assign({},t),{offset:b}):t;return{[v]:T,[e]:O7(T)?[T[0],Object.assign(Object.assign({},T[1]),{offset:n})]:Object.assign(Object.assign({},T),{offset:n})}}}(n,p,t,e):Aue(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Oue(e,t,n,i,r,s){if(i){const t=i.get("type");if("point"===t||"band"===t){if(void 0!==r[e].discreteBandSize)return{value:r[e].discreteBandSize};if(t===Wre){const e=i.get("range");return pre(e)&&$7(e.step)?{value:e.step-2}:{value:Gae-2}}return{scale:n,band:s}}return{value:r[e].continuousBandSize}}const o=jae(r.view,t),a=kee(r[e].discreteBandSize,o-2);return void 0!==a?{value:a}:void 0}function Mue(e,t,n,i,r){if(rne(e))return 0;const s="x"===e||"y2"===e?-t/2:t/2;if(hre(n)){const e=Voe(r);return{signal:`${n.signal} ? ${i-s}${e?"-"+e:""} : ${i+s}${e?"+"+e:""}`}}if(hre(r)){const e=i+(n?-s:s);return{signal:`${e||""}${n?" - ":e?" + ":""}${r.signal}`}}return r=r||0,i+(n?-r-s:+r+s)}function kue({channel:e,fieldDef:t,scaleName:n,markDef:i,band:r,offset:s,config:o}){return wse({fieldDef:t,channel:e,markDef:i,ref:Cse({scaleName:n,fieldOrDatumDef:t,band:r,offset:s}),config:o})}const Rue=new Set(["aria"]);function Nue(e,t){const{fill:n,stroke:i}="include"===t.color?yue(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function(e,t){return mre.reduce((n,i)=>(Rue.has(i)||void 0===e[i]||"ignore"===t[i]||(n[i]=$oe(e[i])),n),{})}(e.markDef,t)),Due(e,"fill",n)),Due(e,"stroke",i)),_ue("opacity",e)),_ue("fillOpacity",e)),_ue("strokeOpacity",e)),_ue("strokeWidth",e)),_ue("strokeDash",e)),pue(e)),due(e,"href")),gue(e))}function Due(e,t,n){const{config:i,mark:r,markDef:s}=e;if("hide"===joe("invalid",s,i)&&n&&!ite(r)){const i=function(e,{invalid:t=!1,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),s=e.vgField(n,{expr:"datum"});s&&ase(r)&&(t[s]=!0)}return t},{}),r=_ee(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Ase(e,t)).join(` ${e} `)}return}(e,{invalid:!0,channels:oie});if(i)return{[t]:[{test:i,value:null},...F7(n)]}}return n?{[t]:n}:{}}function Fue(e){const{config:t,markDef:n}=e;if(joe("invalid",n,t)){const t=function(e,{invalid:t=!1,channels:n}){const i=n.reduce((t,n)=>{const i=e.getScaleComponent(n);if(i){const r=i.get("type"),s=e.vgField(n,{expr:"datum"});s&&ase(r)&&(t[s]=!0)}return t},{}),r=_ee(i);if(r.length>0){const e=t?"||":"&&";return r.map(e=>Ase(e,t)).join(` ${e} `)}return}(e,{channels:Yne});if(t)return{defined:{signal:t}}}return{}}function Lue(e,t){if(void 0!==t)return{[e]:$oe(t)}}const Pue="voronoi",Bue={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Pue)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(ite(s))return qie(`The "nearest" transform is not supported for ${s} marks.`),n;const o={name:e.getName(Pue),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},pue(e,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((t,n)=>{var i;const r=null!==(i=t.name)&&void 0!==i?i:"";r===e.component.mark[0].name?a=n:r.indexOf(Pue)>=0&&(l=!0)}),l||n.splice(a+1,0,o),n}},$ue=Bue;class Uue{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.indexOf(e)>-1?console.warn("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this),e.parent.removeChild(e),this.parent=t,e.parent=this}}class Vue extends Uue{constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const e=new this.constructor;return e.debugName="clone_"+this.debugName,e._source=this._source,e._name="clone_"+this._name,e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash=`Output ${function(e){const t=++Ree;return e?String(e)+t:t}()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class zue extends Uue{constructor(e,t){super(e),this.formula=t}clone(){return new zue(null,nee(this.formula))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{const{field:r,timeUnit:s}=n,o=Ffe(t)?t.encoding[Sne(i)]:void 0,a=Ffe(t)&&eoe(i,n,o,t.stack,t.markDef,t.config);if(s){const t=goe(n,{forAs:!0});e[oee({as:t,field:r,timeUnit:s})]=Object.assign({as:t,field:r,timeUnit:s},a?{band:!0}:{})}return e},{});return gee(n)?null:new zue(e,n)}static makeFromTransform(e,t){const n=Object.assign({},t),{timeUnit:i}=n,r=j7(n,["timeUnit"]),s=dre(i),o=Object.assign(Object.assign({},r),{timeUnit:s});return new zue(e,{[oee(o)]:o})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(yee(this.formula).map(e=>e.as))}dependentFields(){return new Set(yee(this.formula).map(e=>e.field))}hash(){return`TimeUnit ${oee(this.formula)}`}assemble(){const e=[];for(const t of yee(this.formula)){const{field:n,as:i,timeUnit:r}=t,s=dre(r),{unit:o,utc:a}=s,l=j7(s,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:See(n),type:"timeunit"},o?{units:are(o)}:{}),a?{timezone:"utc"}:{}),l),{as:[i,`${i}_end`]}))}return e}}const jue="_tuple_fields";class Yue{constructor(...e){this.items=e,this.hasChannel={},this.hasField={}}}const Gue={has:()=>!0,parse:(e,t,n)=>{var i,r,s;const o=t.name,a=null!==(i=t.project)&&void 0!==i?i:t.project=new Yue,l={},u={},c=new Set,d=(e,t)=>{const n="visual"===t?e.channel:e.field;let i=Tee(`${o}_${n}`);for(let e=1;c.has(i);e++)i=Tee(`${o}_${n}_${e}`);return c.add(i),{[t]:i}};if(!n.fields&&!n.encodings){const t=e.config.selection[n.type];if(n.init)for(const e of F7(n.init))for(const i of _ee(e))Tne(i)?(n.encodings||(n.encodings=[])).push(i):"interval"===n.type?(qie('Interval selections should be initialized using "x" and/or "y" keys.'),n.encodings=t.encodings):(n.fields||(n.fields=[])).push(i);else n.encodings=t.encodings,n.fields=t.fields}for(const e of null!==(r=n.fields)&&void 0!==r?r:[]){const t={type:"E",field:e};t.signals=Object.assign({},d(t,"data")),a.items.push(t),a.hasField[e]=t}for(const i of null!==(s=n.encodings)&&void 0!==s?s:[]){const n=e.fieldDef(i);if(n){let r=n.field;if(n.aggregate){qie(Iie(i,n.aggregate));continue}if(!r){qie(wie(i));continue}if(n.timeUnit){r=e.vgField(i);const t={timeUnit:n.timeUnit,as:r,field:n.field};u[oee(t)]=t}if(!l[r]){let s="E";if("interval"===t.type){ase(e.getScaleComponent(i).get("type"))&&(s="R")}else n.bin&&(s="R-RE");const o={field:r,channel:i,type:s};o.signals=Object.assign(Object.assign({},d(o,"data")),d(o,"visual")),a.items.push(l[r]=o),a.hasField[r]=a.hasChannel[i]=l[r]}}else qie(wie(i))}if(n.init){const e=e=>a.items.map(t=>void 0!==e[t.channel]?e[t.channel]:e[t.field]);if("interval"===n.type)t.init=e(n.init);else{const i=F7(n.init);t.init=i.map(e)}}gee(u)||(a.timeUnit=new zue(null,u))},signals:(e,t,n)=>{const i=t.name+jue,r=n.filter(e=>e.name===i);return r.length>0?n:n.concat({name:i,value:t.project.items.map(e=>{const{signals:t,hasLegend:n}=e,i=j7(e,["signals","hasLegend"]);return i.field=See(i.field),i})})}},Hue={has:e=>"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!Dae(e.bind),parse:(e,t,n,i)=>{i.on||delete t.events,i.clear||delete t.clear},topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=$ue.has(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((e,r)=>{var l,u;const c=Tee(`${i}_${e.field}`),d=n.filter(e=>e.name===c);d.length||n.unshift(Object.assign(Object.assign({name:c},o?{init:hce(o[r])}:{value:null}),{on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${V7(e.field)}] : null`}]:[],bind:null!==(u=null!==(l=s[e.field])&&void 0!==l?l:s[e.channel])&&void 0!==u?u:s}))}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.filter(e=>e.name===i+Ece)[0],o=i+jue,a=r.items.map(e=>Tee(`${i}_${e.field}`)),l=a.map(e=>`${e} !== null`).join(" && ");return a.length&&(s.update=`${l} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},Wue=Hue,Xue="_toggle",que={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Xue,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Ece,i=t.name+Xue;return`${i} ? null : ${n}, `+("global"===t.resolve?`${i} ? null : true, `:`${i} ? null : {unit: ${Cce(e)}}, `)+`${i} ? ${n} : null`}},Kue={has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=U7(n.clear)?f7(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(Wue.has(t))for(const e of t.project.items){const i=n.findIndex(n=>n.name===Tee(`${t.name}_${e.field}`));-1!==i&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex(t=>t.name===e.signals.visual);if(i(t,"[0, 0]"),-1===t){i(n.findIndex(t=>t.name===e.signals.data),"null")}}else{let e=n.findIndex(e=>e.name===t.name+Ece);i(e,"null"),que.has(t)&&(e=n.findIndex(e=>e.name===t.name+Xue),i(e,"false"))}return n}},Zue={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!aie(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(!s||!ase(o)){qie("Scale bindings are currently only supported for scales with unbinned, continuous domains.");continue}const a={selection:t.name,field:i.field};s.set("selectionExtent",a,!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(e=>0===n.filter(t=>t.name===e.signals.data).length);if(!e.parent||ece(e)||0===i.length)return n;const r=n.filter(e=>e.name===t.name)[0];let s=r.update;if(s.indexOf(Ice)>=0)r.update=`{${i.map(e=>`${V7(e.field)}: ${e.signals.data}`).join(", ")}}`;else{for(const e of i){const t=`${V7(e.field)}: ${e.signals.data}`;s.indexOf(t)<0&&(s=`${s.substring(0,s.length-1)}, ${t}}`)}r.update=s}return n.concat(i.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!ece(e))for(const e of t.scales){const t=n.filter(t=>t.name===e.signals.data)[0];t.push="outer",delete t.value,delete t.update}return n}},Que=Zue;function Jue(e,t){return`domain(${V7(e.scaleName(t))})`}function ece(e){var t;return e.parent&&Bfe(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:ece(e.parent.parent))}const tce={has:e=>{const t="global"===e.resolve&&e.bind&&Dae(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==Rae;return t&&!n&&qie("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,t,n,i)=>{var r;if(i.on||delete t.events,i.clear||delete t.clear,i.on||i.clear){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const n of t.events)n.filter=F7(null!==(r=n.filter)&&void 0!==r?r:[]),n.filter.indexOf(e)<0&&n.filter.push(e)}const s=Fae(t.bind)?t.bind.legend:"click",o=U7(s)?f7(s,"view"):F7(s);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Fae(t.bind)&&t.bind.legend,s=e=>t=>{const n=nee(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const o=`${Tee(e.field)}_legend`,a=`${i}_${o}`,l=n.filter(e=>e.name===a);if(0===l.length){const e=r.merge.map(s(`${o}_symbols`)).concat(r.merge.map(s(`${o}_labels`))).concat(r.merge.map(s(`${o}_entries`)));n.unshift(Object.assign(Object.assign({name:a},t.init?{}:{value:null}),{on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${a}`,force:!0}]}))}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(e=>e.name===i+Ece),o=i+jue,a=r.items.filter(e=>e.hasLegend).map(e=>Tee(`${i}_${Tee(e.field)}_legend`)),l=`${a.map(e=>`${e} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(e=>({signal:e})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const u=n.find(e=>e.name===i+Xue),c=Fae(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push(Object.assign(Object.assign({},u.on[0]),{events:c})):u.on[0].events=c),n}};const nce="_translate_anchor",ice="_translate_delta",rce={has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Que.has(t),s=i+nce,{x:o,y:a}=t.project.hasChannel;let l=f7(t.translate,"scope");return r||(l=l.map(e=>(e.between[0].markname=i+mce,e))),n.push({name:s,value:{},on:[{events:l.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==o?", extent_x: "+(r?Jue(e,Ate):`slice(${o.signals.visual})`):"")+(void 0!==a?", extent_y: "+(r?Jue(e,Ste):`slice(${a.signals.visual})`):"")+"}"}]},{name:i+ice,value:{},on:[{events:l,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),void 0!==o&&sce(e,t,o,"width",n),void 0!==a&&sce(e,t,a,"height",n),n}};function sce(e,t,n,i,r){var s;const o=t.name,a=o+nce,l=o+ice,u=n.channel,c=Que.has(t),d=r.filter(e=>e.name===n.signals[c?"data":"visual"])[0],h=e.getSizeSignalRef(i).signal,p=e.getScaleComponent(u),f=p.get("type"),m=`${a}.extent_${u}`,g=`${c?"log"===f?"panLog":"pow"===f?"panPow":"panLinear":"panLinear"}(${m}, ${`${c&&u===Ate?"-":""}${l}.${u} / `+(c?`${h}`:`span(${m})`)}`+(c&&"pow"===f?`, ${null!==(s=p.get("exponent"))&&void 0!==s?s:1}`:"")+")";d.on.push({events:{signal:l},update:c?g:`clampRange(${g}, 0, ${h})`})}const oce="_zoom_anchor",ace="_zoom_delta",lce={has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Que.has(t),s=i+ace,{x:o,y:a}=t.project.hasChannel,l=V7(e.scaleName(Ate)),u=V7(e.scaleName(Ste));let c=f7(t.zoom,"scope");return r||(c=c.map(e=>(e.markname=i+mce,e))),n.push({name:i+oce,on:[{events:c,update:r?"{"+[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(e=>!!e).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==o&&uce(e,t,o,"width",n),void 0!==a&&uce(e,t,a,"height",n),n}};function uce(e,t,n,i,r){var s;const o=t.name,a=n.channel,l=Que.has(t),u=r.filter(e=>e.name===n.signals[l?"data":"visual"])[0],c=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(a),h=d.get("type"),p=l?Jue(e,a):u.name,f=o+ace,m=`${l?"log"===h?"zoomLog":"pow"===h?"zoomPow":"zoomLinear":"zoomLinear"}(${p}, ${`${o}${oce}.${a}`}, ${f}`+(l&&"pow"===h?`, ${null!==(s=d.get("exponent"))&&void 0!==s?s:1}`:"")+")";u.on.push({events:{signal:f},update:l?m:`clampRange(${m}, 0, ${c})`})}const cce=[Gue,que,Que,tce,rce,lce,Wue,$ue,Kue];function dce(e,t){for(const n of cce)n.has(e)&&t(n)}function hce(e,t=!0,n=S7){if(O7(e)){const i=e.map(e=>hce(e,t,n));return t?`[${i.join(", ")}]`:i}return Kie(e)?n(t?nre(e):function(e){const t=tre(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):t?n(JSON.stringify(e)):e}function pce(e,t){return Sce(e,(n,i)=>{t=i.marks?i.marks(e,n,t):t,dce(n,i=>{i.marks&&(t=i.marks(e,n,t))})}),t}function fce(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}const mce="_brush",gce="_scale_trigger",_ce={signals:(e,t)=>{const n=t.name,i=n+jue,r=Que.has(t),s=[],o=[],a=[];if(t.translate&&!r){const e=`!event.item || event.item.mark.name !== ${V7(n+mce)}`;yce(t,(t,n)=>{var i;const r=F7(null!==(i=n.between[0].filter)&&void 0!==i?i:n.between[0].filter=[]);return r.indexOf(e)<0&&r.push(e),t})}t.project.items.forEach((n,i)=>{const r=n.channel;if(r!==Ate&&r!==Ste)return void qie("Interval selections only support x and y encoding channels.");const l=t.init?t.init[i]:null,u=function(e,t,n,i){const r=n.channel,s=n.signals.visual,o=n.signals.data,a=Que.has(t),l=V7(e.scaleName(r)),u=e.getScaleComponent(r),c=u?u.get("type"):void 0,d=e=>`scale(${l}, ${e})`,h=e.getSizeSignalRef(r===Ate?"width":"height").signal,p=`${r}(unit)`,f=yce(t,(e,t)=>[...e,{events:t.between[0],update:`[${p}, ${p}]`},{events:t,update:`[${s}[0], clamp(${p}, 0, ${h})]`}]);return f.push({events:{signal:t.name+gce},update:ase(c)?`[${d(`${o}[0]`)}, ${d(`${o}[1]`)}]`:"[0, 0]"}),a?[{name:o,on:[]}]:[Object.assign(Object.assign({name:s},i?{init:hce(i,!0,d)}:{value:[]}),{on:f}),Object.assign(Object.assign({name:o},i?{init:hce(i)}:{}),{on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${l}, ${s})`}]})]}(e,t,n,l),c=n.signals.data,d=n.signals.visual,h=V7(e.scaleName(r)),p=ase(e.getScaleComponent(r).get("type"))?"+":"";s.push(...u),o.push(c),a.push({scaleName:e.scaleName(r),expr:`(!isArray(${c}) || (${p}invert(${h}, ${d})[0] === ${p}${c}[0] && ${p}invert(${h}, ${d})[1] === ${p}${c}[1]))`})}),r||s.push({name:n+gce,value:{},on:[{events:a.map(e=>({scale:e.scaleName})),update:a.map(e=>e.expr).join(" && ")+` ? ${n+gce} : {}`}]});const l=t.init,u=`unit: ${Cce(e)}, fields: ${i}, values`;return s.concat(Object.assign(Object.assign({name:n+Ece},l?{init:`{${u}: ${hce(l)}}`}:{}),{on:[{events:[{signal:o.join(" || ")}],update:o.join(" && ")+` ? {${u}: [${o}]} : null`}]}))},modifyExpr:(e,t)=>t.name+Ece+", "+("global"===t.resolve?"true":`{unit: ${Cce(e)}}`),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r&&r.signals.visual,a=s&&s.signals.visual,l=`data(${V7(t.name+xce)})`;if(Que.has(t))return n;const u={x:void 0!==r?{signal:`${o}[0]`}:{value:0},y:void 0!==s?{signal:`${a}[0]`}:{value:0},x2:void 0!==r?{signal:`${o}[1]`}:{field:{group:"width"}},y2:void 0!==s?{signal:`${a}[1]`}:{field:{group:"height"}}};if("global"===t.resolve)for(const t of _ee(u))u[t]=[Object.assign({test:`${l}.length && ${l}[0].unit === ${Cce(e)}`},u[t]),{value:0}];const c=t.mark,{fill:d,fillOpacity:h,cursor:p}=c,f=j7(c,["fill","fillOpacity","cursor"]),m=_ee(f).reduce((e,t)=>(e[t]=[{test:[void 0!==r&&`${o}[0] !== ${o}[1]`,void 0!==s&&`${a}[0] !== ${a}[1]`].filter(e=>e).join(" && "),value:f[t]},{value:null}],e),{});return[{name:i+mce+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:d},fillOpacity:{value:h}},update:u}},...n,{name:i+mce,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},p?{cursor:{value:p}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},u),m)}}]}};function yce(e,t){return e.events.reduce((e,n)=>n.between?t(e,n):(qie(`${n} is not an ordered event stream for interval selections.`),e),[])}function vce(e,t){const n=t.name,i=n+jue,r=t.project,s="(item().isVoronoi ? datum.datum : datum)",o=r.items.map(t=>{const n=e.fieldDef(t.channel);return n&&n.bin?`[${s}[${V7(e.vgField(t.channel,{}))}], ${s}[${V7(e.vgField(t.channel,{binSuffix:"end"}))}]]`:`${s}[${V7(t.field)}]`}).join(", "),a=`unit: ${Cce(e)}, fields: ${i}, values`,l=t.events;return[{name:n+Ece,on:l?[{events:l,update:`datum && item().mark.marktype !== 'group' ? {${a}: [${o}]} : null`,force:!0}]:[]}]}const bce={signals:vce,modifyExpr:(e,t)=>t.name+Ece+", "+("global"===t.resolve?"null":`{unit: ${Cce(e)}}`)},Tce={signals:vce,modifyExpr:(e,t)=>t.name+Ece+", "+("global"===t.resolve?"true":`{unit: ${Cce(e)}}`)},xce="_store",Ece="_tuple",wce="_modify",Ice="vlSelectionResolve",Ace={single:Tce,multi:bce,interval:_ce};function Sce(e,t){const n=e.component.selection;if(n)for(const e of yee(n)){if(!0===t(e,Ace[e.type]))break}}function Cce(e,{escape:t}={escape:!0}){let n=t?V7(e.name):e.name;const i=function(e){let t=e.parent;for(;t&&!Lfe(t);)t=t.parent;return t}(e);if(i){const{facet:e}=i;for(const t of cne)e[t]&&(n+=` + '__facet_${t}_' + (facet[${V7(i.vgField(t))}])`)}return n}function Oce(e){let t=!1;return Sce(e,e=>{t=t||e.project.items.some(e=>e.field===Rae)}),t}const Mce="Property",kce="ArrayExpression",Rce="BinaryExpression",Nce="CallExpression",Dce="ConditionalExpression",Fce="LogicalExpression",Lce="MemberExpression",Pce="ObjectExpression",Bce="UnaryExpression";function $ce(e){this.type=e}var Uce,Vce,zce,jce,Yce;$ce.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=function(e){switch(e.type){case kce:return e.elements;case Rce:case Fce:return[e.left,e.right];case Nce:return[e.callee].concat(e.arguments);case Dce:return[e.test,e.consequent,e.alternate];case Lce:return[e.object,e.property];case Pce:return e.properties;case Mce:return[e.key,e.value];case Bce:return[e.argument];default:return[]}}(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};(Uce={})[1]="Boolean",Uce[2]="<end>",Uce[3]="Identifier",Uce[4]="Keyword",Uce[5]="Null",Uce[6]="Numeric",Uce[7]="Punctuator",Uce[8]="String",Uce[9]="RegularExpression";var Gce="Identifier",Hce="Unexpected token %0",Wce="Invalid regular expression",Xce="Invalid regular expression: missing /",qce="Octal literals are not allowed in strict mode.",Kce="ILLEGAL",Zce="Disabled.",Qce=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Jce=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ede(e,t){if(!e)throw new Error("ASSERT: "+t)}function tde(e){return e>=48&&e<=57}function nde(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function ide(e){return"01234567".indexOf(e)>=0}function rde(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function sde(e){return 10===e||13===e||8232===e||8233===e}function ode(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&Qce.test(String.fromCharCode(e))}function ade(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&Jce.test(String.fromCharCode(e))}var lde={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function ude(){for(var e;zce<jce&&(rde(e=Vce.charCodeAt(zce))||sde(e));)++zce}function cde(e){var t,n,i,r=0;for(n="u"===e?4:2,t=0;t<n;++t)zce<jce&&nde(Vce[zce])?(i=Vce[zce++],r=16*r+"0123456789abcdef".indexOf(i.toLowerCase())):Ade({},Hce,Kce);return String.fromCharCode(r)}function dde(){var e,t,n,i;for(t=0,"}"===(e=Vce[zce])&&Ade({},Hce,Kce);zce<jce&&nde(e=Vce[zce++]);)t=16*t+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||"}"!==e)&&Ade({},Hce,Kce),t<=65535?String.fromCharCode(t):(n=55296+(t-65536>>10),i=56320+(t-65536&1023),String.fromCharCode(n,i))}function hde(){var e,t;for(e=Vce.charCodeAt(zce++),t=String.fromCharCode(e),92===e&&(117!==Vce.charCodeAt(zce)&&Ade({},Hce,Kce),++zce,(e=cde("u"))&&"\\"!==e&&ode(e.charCodeAt(0))||Ade({},Hce,Kce),t=e);zce<jce&&ade(e=Vce.charCodeAt(zce));)++zce,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==Vce.charCodeAt(zce)&&Ade({},Hce,Kce),++zce,(e=cde("u"))&&"\\"!==e&&ade(e.charCodeAt(0))||Ade({},Hce,Kce),t+=e);return t}function pde(){var e,t;return e=zce,t=92===Vce.charCodeAt(zce)?hde():function(){var e,t;for(e=zce++;zce<jce;){if(92===(t=Vce.charCodeAt(zce)))return zce=e,hde();if(!ade(t))break;++zce}return Vce.slice(e,zce)}(),{type:1===t.length?3:lde.hasOwnProperty(t)?4:"null"===t?5:"true"===t||"false"===t?1:3,value:t,start:e,end:zce}}function fde(){var e,t,n,i,r=zce,s=Vce.charCodeAt(zce),o=Vce[zce];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++zce,{type:7,value:String.fromCharCode(s),start:r,end:zce};default:if(61===(e=Vce.charCodeAt(zce+1)))switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return zce+=2,{type:7,value:String.fromCharCode(s)+String.fromCharCode(e),start:r,end:zce};case 33:case 61:return zce+=2,61===Vce.charCodeAt(zce)&&++zce,{type:7,value:Vce.slice(r,zce),start:r,end:zce}}}return">>>="===(i=Vce.substr(zce,4))?{type:7,value:i,start:r,end:zce+=4}:">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:r,end:zce+=3}:o===(t=n.substr(0,2))[1]&&"+-<>&|".indexOf(o)>=0||"=>"===t?{type:7,value:t,start:r,end:zce+=2}:"<>=!+-*%&|^/".indexOf(o)>=0?{type:7,value:o,start:r,end:++zce}:void Ade({},Hce,Kce)}function mde(){var e,t,n;if(ede(tde((n=Vce[zce]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=zce,e="","."!==n){if(e=Vce[zce++],n=Vce[zce],"0"===e){if("x"===n||"X"===n)return++zce,function(e){for(var t="";zce<jce&&nde(Vce[zce]);)t+=Vce[zce++];return 0===t.length&&Ade({},Hce,Kce),ode(Vce.charCodeAt(zce))&&Ade({},Hce,Kce),{type:6,value:parseInt("0x"+t,16),start:e,end:zce}}(t);if(ide(n))return function(e){for(var t="0"+Vce[zce++];zce<jce&&ide(Vce[zce]);)t+=Vce[zce++];return(ode(Vce.charCodeAt(zce))||tde(Vce.charCodeAt(zce)))&&Ade({},Hce,Kce),{type:6,value:parseInt(t,8),octal:!0,start:e,end:zce}}(t);n&&tde(n.charCodeAt(0))&&Ade({},Hce,Kce)}for(;tde(Vce.charCodeAt(zce));)e+=Vce[zce++];n=Vce[zce]}if("."===n){for(e+=Vce[zce++];tde(Vce.charCodeAt(zce));)e+=Vce[zce++];n=Vce[zce]}if("e"===n||"E"===n)if(e+=Vce[zce++],"+"!==(n=Vce[zce])&&"-"!==n||(e+=Vce[zce++]),tde(Vce.charCodeAt(zce)))for(;tde(Vce.charCodeAt(zce));)e+=Vce[zce++];else Ade({},Hce,Kce);return ode(Vce.charCodeAt(zce))&&Ade({},Hce,Kce),{type:6,value:parseFloat(e),start:t,end:zce}}function gde(){var e,t,n,i;return Yce=null,ude(),e=zce,t=function(){var e,t,n,i;for(ede("/"===(e=Vce[zce]),"Regular expression literal must start with a slash"),t=Vce[zce++],n=!1,i=!1;zce<jce;)if(t+=e=Vce[zce++],"\\"===e)sde((e=Vce[zce++]).charCodeAt(0))&&Ade({},Xce),t+=e;else if(sde(e.charCodeAt(0)))Ade({},Xce);else if(n)"]"===e&&(n=!1);else{if("/"===e){i=!0;break}"["===e&&(n=!0)}return i||Ade({},Xce),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,n;for(t="",n="";zce<jce&&ade((e=Vce[zce]).charCodeAt(0));)++zce,"\\"===e&&zce<jce?Ade({},Hce,Kce):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ade({},Wce,n),{value:n,literal:t}}(),i=function(e,t){var n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t){if(parseInt(t,16)<=1114111)return"x";Ade({},Wce)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){Ade({},Wce)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:zce}}function _de(){var e;return ude(),zce>=jce?{type:2,start:zce,end:zce}:ode(e=Vce.charCodeAt(zce))?pde():40===e||41===e||59===e?fde():39===e||34===e?function(){var e,t,n,i,r="",s=!1;for(ede("'"===(e=Vce[zce])||'"'===e,"String literal must starts with a quote"),t=zce,++zce;zce<jce;){if((n=Vce[zce++])===e){e="";break}if("\\"===n)if((n=Vce[zce++])&&sde(n.charCodeAt(0)))"\r"===n&&"\n"===Vce[zce]&&++zce;else switch(n){case"u":case"x":"{"===Vce[zce]?(++zce,r+=dde()):r+=cde(n);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:ide(n)?(0!==(i="01234567".indexOf(n))&&(s=!0),zce<jce&&ide(Vce[zce])&&(s=!0,i=8*i+"01234567".indexOf(Vce[zce++]),"0123".indexOf(n)>=0&&zce<jce&&ide(Vce[zce])&&(i=8*i+"01234567".indexOf(Vce[zce++]))),r+=String.fromCharCode(i)):r+=n}else{if(sde(n.charCodeAt(0)))break;r+=n}}return""!==e&&Ade({},Hce,Kce),{type:8,value:r,octal:s,start:t,end:zce}}():46===e?tde(Vce.charCodeAt(zce+1))?mde():fde():tde(e)?mde():fde()}function yde(){var e;return zce=(e=Yce).end,Yce=_de(),zce=e.end,e}function vde(){var e;e=zce,Yce=_de(),zce=e}function bde(e,t,n){var i=new $ce("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return i.operator=e,i.left=t,i.right=n,i}function Tde(e,t){var n=new $ce("CallExpression");return n.callee=e,n.arguments=t,n}function xde(e){var t=new $ce(Gce);return t.name=e,t}function Ede(e){var t=new $ce("Literal");return t.value=e.value,t.raw=Vce.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function wde(e,t,n){var i=new $ce("MemberExpression");return i.computed="["===e,i.object=t,i.property=n,i.computed||(n.member=!0),i}function Ide(e,t,n){var i=new $ce("Property");return i.key=t,i.value=n,i.kind=e,i}function Ade(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,function(e,t){return ede(t<i.length,"Message reference must be in range"),i[t]});throw(n=new Error(r)).index=zce,n.description=r,n}function Sde(e){2===e.type&&Ade(e,"Unexpected end of input"),6===e.type&&Ade(e,"Unexpected number"),8===e.type&&Ade(e,"Unexpected string"),3===e.type&&Ade(e,"Unexpected identifier"),4===e.type&&Ade(e,"Unexpected reserved word"),Ade(e,Hce,e.value)}function Cde(e){var t=yde();7===t.type&&t.value===e||Sde(t)}function Ode(e){return 7===Yce.type&&Yce.value===e}function Mde(e){return 4===Yce.type&&Yce.value===e}function kde(){var e=[];for(zce=Yce.start,Cde("[");!Ode("]");)Ode(",")?(yde(),e.push(null)):(e.push(jde()),Ode("]")||Cde(","));return yde(),function(e){var t=new $ce("ArrayExpression");return t.elements=e,t}(e)}function Rde(){var e;return zce=Yce.start,8===(e=yde()).type||6===e.type?(e.octal&&Ade(e,qce),Ede(e)):xde(e.value)}function Nde(){var e,t,n;return zce=Yce.start,3===(e=Yce).type?(n=Rde(),Cde(":"),Ide("init",n,jde())):2!==e.type&&7!==e.type?(t=Rde(),Cde(":"),Ide("init",t,jde())):void Sde(e)}function Dde(){var e,t,n=[],i={},r=String;for(zce=Yce.start,Cde("{");!Ode("}");)t="$"+((e=Nde()).key.type===Gce?e.key.name:r(e.key.value)),Object.prototype.hasOwnProperty.call(i,t)?Ade({},"Duplicate data property in object literal not allowed in strict mode"):i[t]=!0,n.push(e),Ode("}")||Cde(",");return Cde("}"),function(e){var t=new $ce("ObjectExpression");return t.properties=e,t}(n)}var Fde={if:1};function Lde(){var e,t,n;if(Ode("("))return function(){var e;return Cde("("),e=Yde(),Cde(")"),e}();if(Ode("["))return kde();if(Ode("{"))return Dde();if(e=Yce.type,zce=Yce.start,3===e||Fde[Yce.value])n=xde(yde().value);else if(8===e||6===e)Yce.octal&&Ade(Yce,qce),n=Ede(yde());else{if(4===e)throw new Error(Zce);1===e?((t=yde()).value="true"===t.value,n=Ede(t)):5===e?((t=yde()).value=null,n=Ede(t)):Ode("/")||Ode("/=")?(n=Ede(gde()),vde()):Sde(yde())}return n}function Pde(){var e=[];if(Cde("("),!Ode(")"))for(;zce<jce&&(e.push(jde()),!Ode(")"));)Cde(",");return Cde(")"),e}function Bde(){return Cde("."),zce=Yce.start,function(e){return 3===e.type||4===e.type||1===e.type||5===e.type}(e=yde())||Sde(e),xde(e.value);var e}function $de(){var e;return Cde("["),e=Yde(),Cde("]"),e}function Ude(){var e=function(){var e;for(e=Lde();;)if(Ode("."))e=wde(".",e,Bde());else if(Ode("("))e=Tde(e,Pde());else{if(!Ode("["))break;e=wde("[",e,$de())}return e}();if(7===Yce.type&&(Ode("++")||Ode("--")))throw new Error(Zce);return e}function Vde(){var e,t;if(7!==Yce.type&&4!==Yce.type)t=Ude();else{if(Ode("++")||Ode("--"))throw new Error(Zce);if(Ode("+")||Ode("-")||Ode("~")||Ode("!"))e=yde(),t=Vde(),t=function(e,t){var n=new $ce("UnaryExpression");return n.operator=e,n.argument=t,n.prefix=!0,n}(e.value,t);else{if(Mde("delete")||Mde("void")||Mde("typeof"))throw new Error(Zce);t=Ude()}}return t}function zde(e){var t=0;if(7!==e.type&&4!==e.type)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function jde(){var e,t;return e=function(){var e,t,n,i,r,s,o,a,l,u;if(e=Yce,l=Vde(),0===(r=zde(i=Yce)))return l;for(i.prec=r,yde(),t=[e,Yce],s=[l,i,o=Vde()];(r=zde(Yce))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=bde(a,l,o),s.push(n);(i=yde()).prec=r,s.push(i),t.push(Yce),n=Vde(),s.push(n)}for(n=s[u=s.length-1],t.pop();u>1;)t.pop(),n=bde(s[u-1].value,s[u-2],n),u-=2;return n}(),Ode("?")&&(yde(),t=jde(),Cde(":"),e=function(e,t,n){var i=new $ce("ConditionalExpression");return i.test=e,i.consequent=t,i.alternate=n,i}(e,t,jde())),e}function Yde(){var e=jde();if(Ode(","))throw new Error(Zce);return e}function Gde(e,t,n){return e.fields=t||[],e.fname=n,e}function Hde(e){return 1===e.length?Wde(e[0]):Xde(e)}const Wde=e=>function(t){return t[e]},Xde=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function qde(e){throw Error(e)}function Kde(e){const t=[],n=e.length;let i,r,s,o=null,a=0,l="";function u(){t.push(l+e.substring(i,r)),l="",i=r+1}for(e+="",i=r=0;r<n;++r)if(s=e[r],"\\"===s)l+=e.substring(i,r++),i=r;else if(s===o)u(),o=null,a=-1;else{if(o)continue;i===a&&'"'===s||i===a&&"'"===s?(i=r+1,o=s):"."!==s||a?"["===s?(r>i&&u(),a=i=r+1):"]"===s&&(a||qde("Access path missing open bracket: "+e),a>0&&u(),a=0,i=r+1):r>i?u():i=r+1}return a&&qde("Access path missing closing bracket: "+e),o&&qde("Access path missing closing quote: "+e),r>i&&(r++,u()),t}function Zde(e,t,n){const i=Kde(e);return e=1===i.length?i[0]:e,Gde((n&&n.get||Hde)(i),[e],t||e)}Zde("id"),Gde(e=>e,[],"identity"),Gde(()=>0,[],"zero"),Gde(()=>1,[],"one"),Gde(()=>!0,[],"true"),Gde(()=>!1,[],"false");Array.isArray;function Qde(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...Qde(e.object)),t.push(...Qde(e.property))),t)}function Jde(e){return"MemberExpression"===e.object.type?Jde(e.object):"datum"===e.object.name}function ehe(e){const t=function(e){zce=0,jce=(Vce=e).length,Yce=null,vde();var t=Yde();if(2!==Yce.type)throw new Error("Unexpect token after expression.");return t}(e),n=new Set;return t.visit(e=>{"MemberExpression"===e.type&&Jde(e)&&n.add(Qde(e).slice(1).join("."))}),n}class the extends Uue{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=rhe(this.model,this.filter,this),this._dependentFields=ehe(this.expr)}clone(){return new the(null,this.model,nee(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function nhe(e,t,n,i="datum"){const r=[];const s=xee(t,function(t){const s=Tee(t),o=e.getSelectionComponent(s,t),a=V7(s+xce);if(o.project.timeUnit){const t=null!=n?n:e.component.data.raw,i=o.project.timeUnit.clone();t.parent?i.insertAsParentOf(t):t.parent=i}return"none"!==o.empty&&r.push(a),`vlSelectionTest(${a}, ${i}`+("global"===o.resolve?")":`, ${V7(o.resolve)})`)});return(r.length?"!("+r.map(e=>`length(data(${e}))`).join(" || ")+") || ":"")+`(${s})`}function ihe(e,t){const n=t.encoding;let i=t.field;if(n||i){if(n&&!i){const r=e.project.items.filter(e=>e.channel===n);!r.length||r.length>1?(i=e.project.items[0].field,qie((r.length?"Multiple ":"No ")+`matching ${V7(n)} encoding found for selection ${V7(t.selection)}. `+`Using "field": ${V7(i)}.`)):i=r[0].field}}else i=e.project.items[0].field,e.project.items.length>1&&qie(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${V7(i)}.`);return`${e.name}[${V7(i)}]`}function rhe(e,t,n){return xee(t,t=>U7(t)?t:function(e){return null==e?void 0:e.selection}(t)?nhe(e,t.selection,n):Sre(t))}function she(e,t,n,i){var r,s,o;e.encode=null!==(r=e.encode)&&void 0!==r?r:{},e.encode[t]=null!==(s=e.encode[t])&&void 0!==s?s:{},e.encode[t].update=null!==(o=e.encode[t].update)&&void 0!==o?o:{},e.encode[t].update[n]=i}function ohe(e,t,n,i={header:!1}){var r,s;const o=e.combine(),{disable:a,orient:l,scale:u,labelExpr:c,title:d,zindex:h}=o,p=j7(o,["disable","orient","scale","labelExpr","title","zindex"]);if(!a){for(const e in p){const n=Bee[e],i=p[e];if(n&&n!==t&&"both"!==n)delete p[e];else if(Lee(i)){const{condition:t}=i,n=j7(i,["condition"]),r=F7(t),s=Fee[e];if(s){const{vgProp:t,part:i}=s,o=[...r.map(e=>{const{test:t}=e,n=j7(e,["test"]);return Object.assign({test:rhe(null,t)},n)}),n];she(p,i,t,o),delete p[e]}else if(null===s){const t={signal:r.map(e=>{const{test:t}=e,n=j7(e,["test"]);return`${rhe(null,t)} ? ${Uoe(n)} : `}).join("")+Uoe(n)};p[e]=t}}else if(hre(i)){const t=Fee[e];if(t){const{vgProp:n,part:r}=t;she(p,r,n,i),delete p[e]}}}if("grid"===t){if(!p.grid)return;if(p.encode){const{grid:e}=p.encode;p.encode=Object.assign({},e?{grid:e}:{}),gee(p.encode)&&delete p.encode}return Object.assign(Object.assign({scale:u,orient:l},p),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:kee(h,0)})}{if(!i.header&&e.mainExtracted)return;if(void 0!==c){let e=c;(null===(s=null===(r=p.encode)||void 0===r?void 0:r.labels)||void 0===s?void 0:s.update)&&hre(p.encode.labels.update.text)&&(e=Cee(c,"datum.label",p.encode.labels.update.text.signal)),she(p,"labels","text",{signal:e})}if(null===p.labelAlign&&delete p.labelAlign,p.encode){for(const t of Pee)e.hasAxisPart(t)||delete p.encode[t];gee(p.encode)&&delete p.encode}const t=function(e,t){if(e)return O7(e)&&!Boe(e)?e.map(e=>woe(e,t)).join(", "):e}(d,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:u,orient:l,grid:!1},t?{title:t}:{}),p),!1===n.aria?{aria:!1}:{}),{zindex:kee(h,0)})}}}function ahe(e){const{axes:t}=e.component,n=[];for(const i of Yne)if(t[i])for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const t="x"===i?"height":"width",r=e.getSizeSignalRef(t).signal;t!==r&&n.push({name:t,update:r})}return n}const lhe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},uhe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},che=_ee(lhe),dhe=_ee(uhe);function hhe(e,t,n,i){return Object.assign.apply(null,[{},...e.map(e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",r=t["x"===n?"axisBottom":"axisLeft"]||{},s=t["x"===n?"axisTop":"axisRight"]||{},o=new Set([..._ee(r),..._ee(s)]),a={};for(const t of o.values())a[t]={signal:`${i.signal} === "${e}" ? ${Voe(r[t])} : ${Voe(s[t])}`};return a}return t[e]})])}function phe(e,t,n,i){const r="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function(e){return e in nse}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],s="x"===e?"axisX":"axisY",o=hre(n)?"axisOrient":"axis"+wee(n),a=[...r,...r.map(e=>s+e.substr(4))],l=["axis",o,s];return{vlOnlyAxisConfig:hhe(a,i,e,n),vgAxisConfig:hhe(l,i,e,n),axisConfigStyle:fhe([...l,...a],i)}}function fhe(e,t){var n;const i=[{}];for(const r of e){let e=null===(n=t[r])||void 0===n?void 0:n.style;if(e){e=F7(e);for(const n of e)i.push(t.style[n])}}return Object.assign.apply(null,i)}function mhe(e,t,n,i={}){var r;const s=Hoe(e,n,t.style);if(void 0!==s)return{configFrom:"style",configValue:s};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null===(r=i[t])||void 0===r?void 0:r[e]))return{configFrom:t,configValue:i[t][e]};return{}}const ghe={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{const{format:i,formatType:r}=n;return Lse(e,e.type,i,r,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return Pse(i,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{var i;return(!roe(e)||!mie(e.bin))&&(null!==(i=t.grid)&&void 0!==i?i:function(e,t){return!ose(e)&&roe(t)&&!fie(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||vhe(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||yhe(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{var i;return null!==(i=e.labelFlush)&&void 0!==i?i:function(e,t){if("x"===t&&lee(["quantitative","temporal"],e))return!0;return}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{var i;return null!==(i=e.labelOverlap)&&void 0!==i?i:function(e,t){if("nominal"!==e)return"log"!==t||"greedy";return}(t.type,n)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{var s;const o="x"===e?"width":"y"===e?"height":void 0,a=o?t.getSizeSignalRef(o):void 0;return null!==(s=n.tickCount)&&void 0!==s?s:function({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!ose(t)&&"log"!==t){if(roe(e)){if(fie(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&lee(["month","hours","day","quarter"],null===(r=dre(e.timeUnit))||void 0===r?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}return}({fieldOrDatumDef:i,scaleType:r,size:a,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;const i=bhe(t,n);if(void 0!==i)return i;const r=t.typedFieldDef(n),s="x"===n?"x2":"y2",o=t.fieldDef(s);return Xoe(r?[Zse(r)]:[],roe(o)?[Zse(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function(e,t){const n=e.values;if(O7(n))return Foe(t,n);if(hre(n))return n;return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{var i;return null!==(i=e.zindex)&&void 0!==i?i:function(e,t){if("rect"===e&&_oe(t))return 1;return 0}(n,t)}};function _he(e){return`(((${e.signal} % 360) + 360) % 360)`}function yhe(e,t,n,i){if(void 0!==e){if("x"===n){if(hre(e)){const n=_he(e);return{signal:`(45 < ${n} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :(${n} <= 45 || 315 <= ${n}) === ${hre(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(hre(t)){const n=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${n} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==("top"===t)?"bottom":"top"}if(hre(e)){const n=_he(e);return{signal:`${n} <= 45 || 315 <= ${n} || (135 <= ${n} && ${n} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${n} && ${n} <= 135) === ${hre(t)?`(${t.signal} === "left")`:"left"===t} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(hre(t)){const n=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${n} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==("left"===t)?"top":"bottom"}}function vhe(e,t,n){if(void 0===e)return;const i="x"===n,r=i?0:90,s=i?"bottom":"left";if(hre(e)){const n=_he(e);return{signal:`(${r?"("+n+" + 90)":n} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${n} && ${n} < ${180+r}) === ${hre(t)?`(${t.signal} === "${s}")`:t===s} ? "left" : "right"`}}if((e+r)%180==0)return i?null:"center";if(hre(t)){const n=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${n} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function bhe(e,t){const n="x"===t?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;return s&&o?qoe(s,o):s||(o||(void 0!==s?s:void 0!==o?o:void 0))}class The extends Uue{constructor(e,t){super(e),this.transform=t,this._dependentFields=ehe(this.transform.calculate)}clone(){return new The(null,nee(this.transform))}static parseAllForSortIndex(e,t){return t.forEachFieldDef((t,n)=>{if(hoe(t)&&Wse(t.sort)){const{field:i,timeUnit:r}=t,s=t.sort,o=s.map((e,t)=>`${Sre({field:i,timeUnit:r,equal:e})} ? ${t} : `).join("")+s.length;e=new The(e,{calculate:o,as:xhe(t,n,{forAs:!0})})}}),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${oee(this.transform)}`}}function xhe(e,t,n){return goe(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function Ehe(e,t){return lee(["top","bottom"],t)?"column":lee(["left","right"],t)||"row"===e?"row":"column"}function whe(e,t,n,i){const r="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return kee(((null==t?void 0:t.header)||{})[e],r[e],n.header[e])}function Ihe(e,t,n,i){const r={};for(const s of e){const e=whe(s,t,n,i);void 0!==e&&(r[s]=e)}return r}const Ahe=["row","column"],She=["header","footer"];function Che(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=Ihe(["titleAnchor","titleAngle","titleOrient"],r,i,t),l=Ehe(t,a),u=Nee(o);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),Mhe(u,l)),Ohe(l,u,s)),Phe(i,r,t,che,lhe))}}function Ohe(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=vhe(t,"row"===e?"left":"top","row"===e?"y":"x");return i?{align:i}:{}}function Mhe(e,t){const n=yhe(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function khe(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of She)if(n[r])for(const s of n[r]){const o=Dhe(e,t,r,n,s);null!=o&&i.push(o)}return i}function Rhe(e,t){var n;const{sort:i}=e;return Hse(i)?{field:goe(i,{expr:"datum"}),order:null!==(n=i.order)&&void 0!==n?n:"ascending"}:O7(i)?{field:xhe(e,t,{expr:"datum"}),order:"ascending"}:{field:goe(e,{expr:"datum"}),order:null!=i?i:"ascending"}}function Nhe(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:l}=Ihe(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e,n,t),u=Nse({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=Ehe(t,a);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:l?Cee(Cee(l,"datum.label",u),"datum.value",goe(e,{expr:"parent"})):u}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),Mhe(s,c)),Ohe(c,s,o)),Phe(n,e,t,dhe,uhe))}function Dhe(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:e}=Ihe(["labelOrient"],o,a,t);("row"===t&&!lee(["top","bottom"],e)||"column"===t&&!lee(["left","right"],e))&&(s=Nhe(o,t,a))}const l=Lfe(e)&&!Xse(e.facet),u=r.axes,c=(null==u?void 0:u.length)>0;if(s||c){const a="row"===t?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`},i.facetFieldDef?{from:{data:e.getName(t+"_domain")},sort:Rhe(o,t)}:{}),c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{}),s?{title:s}:{}),r.sizeSignal?{encode:{update:{[a]:r.sizeSignal}}}:{}),c?{axes:u}:{})}}return null}const Fhe={column:{start:0,end:1},row:{start:1,end:0}};function Lhe(e,t){return Fhe[t][e]}function Phe(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const i=whe(o,t,e,n);void 0!==i&&(s[r[o]]=i)}return s}function Bhe(e){return[...$he(e,"width"),...$he(e,"height"),...$he(e,"childWidth"),...$he(e,"childHeight")]}function $he(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const r=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),s=t.get("range");if(ose(i)&&pre(s)){const i=e.scaleName(n);if(Lfe(e.parent)){if("independent"===e.parent.component.resolve.scale[n])return[Uhe(i,s)]}return[Uhe(i,s),{name:r,update:Vhe(i,t,`domain('${i}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=r.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=`isFinite(${n}) ? ${n} : ${zae(e.config.view,t?"width":"height")}`;return[{name:r,init:i,on:[{update:i,events:"window:resize"}]}]}return[{name:r,value:i}]}function Uhe(e,t){return{name:e+"_step",value:t.step}}function Vhe(e,t,n){const i=t.get("type"),r=t.get("padding"),s=kee(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o="band"===i?void 0!==o?o:r:1,`bandspace(${n}, ${o}, ${s}) * ${e}_step`}function zhe(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function jhe(e,t){return _ee(e).reduce((n,i)=>{const r=e[i];return Object.assign(Object.assign({},n),cue(t,r,i,e=>hre(e)?e:{value:e.value}))},{})}function Yhe(e,t){if(Bfe(t)||Lfe(t))return"shared";if(Pfe(t))return Gne(e)?"independent":"shared";throw new Error("invalid model type for resolve")}function Ghe(e,t){const n=e.scale[t],i=Gne(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&qie(function(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}(t)),"independent"):e[i][t]||"shared"}const Hhe=Object.assign(Object.assign({},kae),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1}),Whe=_ee(Hhe);class Xhe extends Mle{}const qhe={symbols:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){var o,a,l,u,c;if("symbol"!==s)return;const{markDef:d,encoding:h,config:p,mark:f}=n,m=d.filled&&"trail"!==f;let g=Object.assign(Object.assign({},function(e,t,n){for(const i of n){const n=Yoe(i,t.markDef,t.config);void 0!==n&&(e[i]=$oe(n))}return e}({},n,ate)),yue(n,{filled:m}));const _=null!==(o=Khe(h.opacity))&&void 0!==o?o:d.opacity;if(g.fill)if("fill"===i||m&&i===Bte)delete g.fill;else if(g.fill.field)r.get("symbolFillColor")?delete g.fill:(g.fill=$oe(null!==(a=p.legend.symbolBaseFillColor)&&void 0!==a?a:"black"),g.fillOpacity=$oe(null!=_?_:1));else if(O7(g.fill)){const e=null!==(c=null!==(u=Zhe(null!==(l=h.fill)&&void 0!==l?l:h.color))&&void 0!==u?u:d.fill)&&void 0!==c?c:m&&d.color;e&&(g.fill=$oe(e))}if(g.stroke)if("stroke"===i||!m&&i===Bte)delete g.stroke;else if(g.stroke.field)delete g.stroke;else if(O7(g.stroke)){const e=kee(Zhe(h.stroke||h.color),d.stroke,m?d.color:void 0);e&&(g.stroke={value:e})}if(i!==Yte){const e=roe(t)&&Jhe(n,r,t);e?g.opacity=[Object.assign({test:e},$oe(null!=_?_:1)),$oe(p.legend.unselectedOpacity)]:_&&(g.opacity=$oe(_))}return g=Object.assign(Object.assign({},g),e),gee(g)?void 0:g},gradient:function(e,{model:t,legendType:n}){if("gradient"!==n)return;let i={};const r=Khe(t.encoding.opacity)||t.markDef.opacity;r&&(i.opacity=$oe(r));return i=Object.assign(Object.assign({},i),e),gee(i)?void 0:i},labels:function(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=roe(t)?Jhe(n,r,t):void 0,l=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=s,d=kse(c)?Fse({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:o}):void 0,h=Object.assign(Object.assign(Object.assign({},l?{opacity:l}:{}),d?{text:d}:{}),e);return gee(h)?void 0:h},entries:function(e,{legendCmpt:t}){const n=t.get("selections");return(null==n?void 0:n.length)?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function Khe(e){return Qhe(e,(e,t)=>Math.max(e,t.value))}function Zhe(e){return Qhe(e,(e,t)=>kee(e,t.value))}function Qhe(e,t){return function(e){const t=e&&e.condition;return!!t&&(O7(t)||doe(t))}(e)?F7(e.condition).reduce(t,e.value):doe(e)?e.value:void 0}function Jhe(e,t,n){const i=t.get("selections");if(!(null==i?void 0:i.length))return;const r=V7(n.field);return i.map(e=>`(!length(data(${V7(Tee(e)+xce)})) || (${e}[${r}] && indexof(${e}[${r}], datum.value) >= 0))`).join(" || ")}const epe={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return Lse(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return Pse(i,t,n)},gradientLength:e=>{var t,n;const{legend:i,legendConfig:r}=e;return null!==(n=null!==(t=i.gradientLength)&&void 0!==t?t:r.gradientLength)&&void 0!==n?n:function({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(lse(r))return"horizontal"===n?"top"===i||"bottom"===i?ipe(t,"width",o,s):o:ipe(t,"height",l,a);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{var i,r;return null!==(r=null!==(i=e.labelOverlap)&&void 0!==i?i:t.labelOverlap)&&void 0!==r?r:function(e){if(lee(["quantile","threshold","log"],e))return"greedy";return}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>{var r;return null!==(r=e.symbolType)&&void 0!==r?r:function(e,t,n,i){var r;if("shape"!==t){const e=null!==(r=Zhe(n))&&void 0!==r?r:i;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,i.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>xoe(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(lne(n)&&lse(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function(e,t){const n=e.values;if(O7(n))return Foe(t,n);if(hre(n))return n;return}(t,e)};function tpe(e){const{legend:t}=e;return kee(t.type,function({channel:e,timeUnit:t,scaleType:n}){if(lne(e)){if(lee(["quarter","month","day"],t))return"symbol";if(lse(n))return"gradient"}return"symbol"}(e))}function npe({legendConfig:e,legendType:t,orient:n,legend:i}){var r,s;return null!==(s=null!==(r=i.direction)&&void 0!==r?r:e[t?"gradientDirection":"symbolDirection"])&&void 0!==s?s:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function ipe(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function rpe(e){const t=Ffe(e)?function(e){const{encoding:t}=e,n={};for(const i of[Bte,...Oae]){const r=Soe(t[i]);r&&e.getScaleComponent(i)&&(i===Vte&&roe(r)&&r.type===Fre||(n[i]=ope(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){rpe(i);for(const r of _ee(i.component.legends))n.legend[r]=Ghe(e.component.resolve,r),"shared"===n.legend[r]&&(t[r]=ape(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of _ee(t))for(const t of e.children)t.component.legends[i]&&"shared"===n.legend[i]&&delete t.component.legends[i];return t}(e);return e.component.legends=t,t}function spe(e,t,n,i){switch(t){case"disable":return void 0!==n;case"values":return!!(null==n?void 0:n.values);case"title":if("title"===t&&e===(null==i?void 0:i.title))return!0}return e===(n||{})[t]}function ope(e,t){var n,i,r;let s=e.legend(t);const{markDef:o,encoding:a,config:l}=e,u=l.legend,c=new Xhe({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var i;const r=null===(i=e.fieldDef(t))||void 0===i?void 0:i.field;Sce(e,e=>{var i,s;const o=null!==(i=e.project.hasField[r])&&void 0!==i?i:e.project.hasChannel[t];if(o&&tce.has(e)){const t=null!==(s=n.get("selections"))&&void 0!==s?s:[];t.push(e.name),n.set("selections",t,!1),o.hasLegend=!0}})}(e,t,c);const d=void 0!==s?!s:u.disable;if(c.set("disable",d,void 0!==s),d)return c;s=s||{};const h=e.getScaleComponent(t).get("type"),p=Soe(a[t]),f=roe(p)?null===(n=dre(p.timeUnit))||void 0===n?void 0:n.unit:void 0,m=s.orient||l.legend.orient||"right",g=tpe({legend:s,channel:t,timeUnit:f,scaleType:h}),_={legend:s,channel:t,model:e,markDef:o,encoding:a,fieldOrDatumDef:p,legendConfig:u,config:l,scaleType:h,orient:m,legendType:g,direction:npe({legend:s,legendType:g,orient:m,legendConfig:u})};for(const n of Whe){const i=n in epe?epe[n](_):s[n];if(void 0!==i){const r=spe(i,n,s,e.fieldDef(t));(r||void 0===l.legend[n])&&c.set(n,i,r)}}const y=null!==(i=null==s?void 0:s.encoding)&&void 0!==i?i:{},v=c.get("selections"),b={},T={fieldOrDatumDef:p,model:e,channel:t,legendCmpt:c,legendType:g};for(const t of["labels","legend","title","symbols","gradient","entries"]){const n=jhe(null!==(r=y[t])&&void 0!==r?r:{},e),i=t in qhe?qhe[t](n,T):n;void 0===i||gee(i)||(b[t]=Object.assign(Object.assign(Object.assign({},(null==v?void 0:v.length)&&roe(p)?{name:`${Tee(p.field)}_legend_${t}`}:{}),(null==v?void 0:v.length)?{interactive:!!v}:{}),{update:i}))}return gee(b)||c.set("encode",b,!!(null==s?void 0:s.encoding)),c}function ape(e,t){var n,i,r,s;if(!e)return t.clone();const o=e.getWithExplicit("orient"),a=t.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;let l=!1;for(const n of Whe){const i=Fle(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",(e,t)=>{switch(n){case"symbolType":return lpe(e,t);case"title":return Koe(e,t);case"type":return l=!0,Rle("symbol")}return Dle(e,t,n,"legend")});e.setWithExplicit(n,i)}return l&&((null===(i=null===(n=e.implicit)||void 0===n?void 0:n.encode)||void 0===i?void 0:i.gradient)&&Eee(e.implicit,["encode","gradient"]),(null===(s=null===(r=e.explicit)||void 0===r?void 0:r.encode)||void 0===s?void 0:s.gradient)&&Eee(e.explicit,["encode","gradient"])),e}function lpe(e,t){return"circle"===t.value?t:e}function upe(e,t,n,i){var r,s,o;e.encode=null!==(r=e.encode)&&void 0!==r?r:{},e.encode[t]=null!==(s=e.encode[t])&&void 0!==s?s:{},e.encode[t].update=null!==(o=e.encode[t].update)&&void 0!==o?o:{},e.encode[t].update[n]=i}function cpe(e){const t=e.component.legends,n={};for(const i of _ee(t)){const r=e.getScaleComponent(i),s=see(r.get("domains"));if(n[s])for(const e of n[s]){ape(e,t[i])||n[s].push(t[i])}else n[s]=[t[i].clone()]}const i=yee(n).flat().map(t=>function(e,t){var n,i,r;const s=e.combine(),{disable:o,labelExpr:a,selections:l}=s,u=j7(s,["disable","labelExpr","selections"]);if(o)return;!1===t.aria&&null==u.aria&&(u.aria=!1);if(null===(n=u.encode)||void 0===n?void 0:n.symbols){const e=u.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||u.stroke||(e.stroke={value:"transparent"});for(const t of Oae)u[t]&&delete e[t]}u.title||delete u.title;if(void 0!==a){let e=a;(null===(r=null===(i=u.encode)||void 0===i?void 0:i.labels)||void 0===r?void 0:r.update)&&hre(u.encode.labels.update.text)&&(e=Cee(a,"datum.label",u.encode.labels.update.text.signal)),upe(u,"labels","text",{signal:e})}for(const e in u){const t=u[e];if(hre(t)){const n=Mae[e];if(n){const{vgProp:i,part:r}=n;upe(u,r,i,t),delete u[e]}}}return u}(t,e.config)).filter(e=>void 0!==e);return i}function dpe(e){return Bfe(e)||Pfe(e)?function(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),hpe(e))}(e):hpe(e)}function hpe(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(e=>e.signal).join(", ")}]`},s=t.data.reduce((t,n)=>{const i=hre(n)?n.signal:`data('${e.lookupDataSource(n)}')`;return lee(t,i)||t.push(i),t},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]}},n)]}return[Object.assign(Object.assign({name:i},{translate:{signal:"[width / 2, height / 2]"}}),n)]}const ppe=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class fpe extends Mle{constructor(e,t,n,i){super(Object.assign({},t),{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function mpe(e){e.component.projection=Ffe(e)?function(e){var t;if(e.hasProjection){const n=e.specifiedProjection,i=!(n&&(null!=n.scale||null!=n.translate)),r=i?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,s=i?function(e){const t=[],{encoding:n}=e;for(const i of[[Fte,Dte],[Pte,Lte]])(Soe(n[i[0]])||Soe(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});e.channelHasField(Vte)&&e.typedFieldDef(Vte).type===Fre&&t.push({signal:e.getName(`geojson_${t.length}`)});0===t.length&&t.push(e.requestDataName(Yle));return t}(e):void 0;return new fpe(e.projectionName(!0),Object.assign(Object.assign({},null!==(t=e.config.projection)&&void 0!==t?t:{}),null!=n?n:{}),r,s)}return}(e):function(e){if(0===e.children.length)return;let t;for(const t of e.children)mpe(t);const n=cee(e.children,e=>{const n=e.component.projection;if(n){if(t){const e=function(e,t){const n=cee(ppe,n=>!P7(e.explicit,n)&&!P7(t.explicit,n)||!(!P7(e.explicit,n)||!P7(t.explicit,n)||see(e.get(n))!==see(t.get(n)))),i=see(e.size)===see(t.size);if(i){if(n)return e;if(see(e.explicit)===see({}))return t;if(see(t.explicit)===see({}))return e}return null}(t,n);return e&&(t=e),!!e}return t=n,!0}return!0});if(t&&n){const n=e.projectionName(!0),i=new fpe(n,t.specifiedProjection,t.size,nee(t.data));for(const t of e.children){const e=t.component.projection;e&&(e.isFit&&i.data.push(...t.component.projection.data),t.renameProjection(e.get("name"),n),e.merged=!0)}return i}return}(e)}function gpe(e,t){return`${pie(e)}_${t}`}function _pe(e,t,n){var i;const r=gpe(null!==(i=koe(n,void 0))&&void 0!==i?i:{},t);return e.getName(`${r}_bins`)}function ype(e,t,n){let i,r;i=function(e){return"as"in e}(e)?U7(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:[goe(e,{forAs:!0}),goe(e,{binSuffix:"end",forAs:!0})];const s=Object.assign({},koe(t,void 0)),o=gpe(s,e.field),{signal:a,extentSignal:l}=function(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}(n,o);if(_ie(s.extent)){const e=s.extent,t=e.selection;r=ihe(n.getSelectionComponent(Tee(t),t),e),delete s.extent}return{key:o,binComponent:Object.assign(Object.assign(Object.assign({bin:s,field:e.field,as:[i]},a?{signal:a}:{}),l?{extentSignal:l}:{}),r?{span:r}:{})}}class vpe extends Uue{constructor(e,t){super(e),this.bins=t}clone(){return new vpe(null,nee(this.bins))}static makeFromEncoding(e,t){const n=t.reduceFieldDef((e,n,i)=>{if(coe(n)&&fie(n.bin)){const{key:r,binComponent:s}=ype(n,n.bin,t);e[r]=Object.assign(Object.assign(Object.assign({},s),e[r]),function(e,t,n,i){var r,s;if(Loe(t,n)){const o=Ffe(e)&&null!==(s=null!==(r=e.axis(n))&&void 0!==r?r:e.legend(n))&&void 0!==s?s:{},a=goe(t,{expr:"datum"}),l=goe(t,{expr:"datum",binSuffix:"end"});return{formulaAs:goe(t,{binSuffix:"range",forAs:!0}),formula:Vse(a,l,o.format,o.formatType,i)}}return{}}(t,n,i,t.config))}return e},{});return gee(n)?null:new vpe(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:r}=ype(t,t.bin,n);return new vpe(e,{[i]:r})}merge(e,t){for(const n of _ee(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=hee([...this.bins[n].as,...e.bins[n].as],oee)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(yee(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(yee(this.bins).map(e=>e.field))}hash(){return`Bin ${oee(this.bins)}`}assemble(){return yee(this.bins).flatMap(e=>{const t=[],[n,...i]=e.as,r=e.bin,{extent:s}=r,o=j7(r,["extent"]),a=Object.assign(Object.assign(Object.assign({type:"bin",field:See(e.field),as:n,signal:e.signal},_ie(s)?{extent:null}:{extent:s}),e.span?{span:{signal:`span(${e.span})`}}:{}),o);!s&&e.extentSignal&&(t.push({type:"extent",field:See(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const e of i)for(let i=0;i<2;i++)t.push({type:"formula",expr:goe({field:n[i]},{expr:"datum"}),as:e[i]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}class bpe extends Uue{constructor(e){let t;if(super(null),Ule(e=null!=e?e:{name:"source"})||(t=e.format?Object.assign({},ree(e.format,["parse"])):{}),Ble(e))this._data={values:e.values};else if(Ple(e)){if(this._data={url:e.url},!t.type){let n=/(?:\.([^.]+))?$/.exec(e.url)[1];lee(["json","csv","tsv","dsv","topojson"],n)||(n="json"),t.type=n}}else zle(e)?this._data={values:[{type:"Sphere"}]}:($le(e)||Ule(e))&&(this._data={});this._generator=Ule(e),e.name&&(this._name=e.name),t&&!gee(t)&&(this._data.format=t)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}function Tpe(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return console.error("Dataflow graph is inconsistent.",t,e),!1;if(!Tpe(t.children))return!1}return!0}class xpe extends Uue{constructor(e,t){super(e),this.params=t}clone(){return new xpe(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${oee(this.params)}`}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class Epe extends Uue{constructor(e,t){super(e),this.params=t}clone(){return new Epe(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return`Hash ${oee(this.params)}`}assemble(){return Object.assign({type:"sequence"},this.params)}}function wpe(e){return e instanceof bpe||e instanceof xpe||e instanceof Epe}class Ipe{constructor(){this._mutated=!1}setMutated(){this._mutated=!0}get mutatedFlag(){return this._mutated}}class Ape extends Ipe{constructor(){super(),this._continue=!1}setContinue(){this._continue=!0}get continueFlag(){return this._continue}get flags(){return{continueFlag:this.continueFlag,mutatedFlag:this.mutatedFlag}}set flags({continueFlag:e,mutatedFlag:t}){e&&this.setContinue(),t&&this.setMutated()}reset(){}optimizeNextFromLeaves(e){if(wpe(e))return!1;const t=e.parent,{continueFlag:n}=this.run(e);return n&&this.optimizeNextFromLeaves(t),this.mutatedFlag}}class Spe extends Ipe{}function Cpe(e,t,n,i){const r=Ffe(i)?i.encoding[Sne(t)]:void 0;if(coe(n)&&Ffe(i)&&eoe(t,n,r,i.stack,i.markDef,i.config))e.add(goe(n,{})),e.add(goe(n,{suffix:"end"})),n.bin&&Loe(n,t)&&e.add(goe(n,{binSuffix:"range"}));else if(function(e){return e in sne}(t)){const n=function(e){switch(e){case Dte:return"y";case Lte:return"y2";case Fte:return"x";case Pte:return"x2"}}(t);e.add(i.getName(n))}else e.add(goe(n));return e}class Ope extends Uue{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new Ope(null,new Set(this.dimensions),nee(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef(e=>{e.aggregate&&(n=!0)});const i={},r=new Set;return n?(t.forEachFieldDef((e,n)=>{var s,o,a,l;const{aggregate:u,field:c}=e;if(u)if("count"===u)i["*"]=null!==(s=i["*"])&&void 0!==s?s:{},i["*"].count=new Set([goe(e,{forAs:!0})]);else{if(gte(u)||_te(u)){const e=gte(u)?"argmin":"argmax",t=u[e];i[t]=null!==(o=i[t])&&void 0!==o?o:{},i[t][e]=new Set([goe({op:e,field:t},{forAs:!0})])}else i[c]=null!==(a=i[c])&&void 0!==a?a:{},i[c][u]=new Set([goe(e,{forAs:!0})]);aie(n)&&"unaggregated"===t.scaleDomain(n)&&(i[c]=null!==(l=i[c])&&void 0!==l?l:{},i[c].min=new Set([goe({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([goe({field:c,aggregate:"max"},{forAs:!0})]))}else Cpe(r,n,e,t)}),r.size+_ee(i).length===0?null:new Ope(e,r,i)):null}static makeFromTransform(e,t){var n,i,r;const s=new Set,o={};for(const e of t.aggregate){const{op:t,field:r,as:s}=e;t&&("count"===t?(o["*"]=null!==(n=o["*"])&&void 0!==n?n:{},o["*"].count=new Set([s||goe(e,{forAs:!0})])):(o[r]=null!==(i=o[r])&&void 0!==i?i:{},o[r][t]=new Set([s||goe(e,{forAs:!0})])))}for(const e of null!==(r=t.groupby)&&void 0!==r?r:[])s.add(e);return s.size+_ee(o).length===0?null:new Ope(e,s,o)}merge(e){return function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(this.dimensions,e.dimensions)?(function(e,t){var n;for(const i of _ee(t)){const r=t[i];for(const t of _ee(r))i in e?e[i][t]=new Set([...null!==(n=e[i][t])&&void 0!==n?n:[],...r[t]]):e[i]={[t]:r[t]}}}(this.measures,e.measures),!0):(function(...e){Wie.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,..._ee(this.measures)])}producedFields(){const e=new Set;for(const t of _ee(this.measures))for(const n of _ee(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add(`${n}_${t}`):i.forEach(e.add,e)}return e}hash(){return`Aggregate ${oee({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const e=[],t=[],n=[];for(const i of _ee(this.measures))for(const r of _ee(this.measures[i]))for(const s of this.measures[i][r])n.push(s),e.push(r),t.push("*"===i?null:See(i));return{type:"aggregate",groupby:[...this.dimensions].map(See),ops:e,fields:t,as:n}}}class Mpe extends Uue{constructor(e,t,n,i){super(e),this.model=t,this.name=n,this.data=i;for(const e of cne){const n=t.facet[e];if(n){const{bin:i,sort:r}=n;this[e]=Object.assign({name:t.getName(`${e}_domain`),fields:[goe(n),...fie(i)?[goe(n,{binSuffix:"end"})]:[]]},Hse(r)?{sortField:r}:O7(r)?{sortIndexField:xhe(n,e)}:{})}}this.childModel=t.child}hash(){let e="Facet";for(const t of cne)this[t]&&(e+=` ${t.charAt(0)}:${oee(this[t])}`);return e}get fields(){var e;const t=[];for(const n of cne)(null===(e=this[n])||void 0===e?void 0:e.fields)&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of cne)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of Yne){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),r=n.get("range");if(ose(i)&&pre(r)){const n=ffe(mfe(this.childModel,t));n?e[t]=n:qie(`Unknown field for ${t}. Cannot calculate view size.`)}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x"}[e],r=[],s=[],o=[];n&&n[i]&&(t?(r.push(`distinct_${n[i]}`),s.push("max")):(r.push(n[i]),s.push("distinct")),o.push(`distinct_${n[i]}`));const{sortField:a,sortIndexField:l}=this[e];if(a){const{op:e=zse,field:t}=a;r.push(t),s.push(e),o.push(goe(a,{forAs:!0}))}else l&&(r.push(l),s.push("max"),o.push(l));return{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},r.length?{fields:r,ops:s,as:o}:{})]}}assembleFacetHeaderData(e){var t,n;const{columns:i}=this.model.layout,{layoutHeaders:r}=this.model.component,s=[],o={};for(const e of Ahe){for(const i of She){const s=null!==(t=r[e]&&r[e][i])&&void 0!==t?t:[];for(const t of s)if((null===(n=t.axes)||void 0===n?void 0:n.length)>0){o[e]=!0;break}}if(o[e]){const t=`length(data("${this.facet.name}"))`,n="row"===e?i?{signal:`ceil(${t} / ${i})`}:1:i?{signal:`min(${t}, ${i})`}:{signal:t};s.push({name:`${this.facet.name}_${e}`,transform:[{type:"sequence",start:0,stop:n}]})}}const{row:a,column:l}=o;return(a||l)&&s.unshift(this.assembleRowColumnHeaderData("facet",null,e)),s}assemble(){var e,t;const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep(),{column:s,row:o,facet:a}=this;if(s&&o&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const s=[].concat(null!==(e=r.x)&&void 0!==e?e:[],null!==(t=r.y)&&void 0!==t?t:[]),o=s.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:s,ops:o}]})}for(const e of[wte,Ete])this[e]&&n.push(this.assembleRowColumnHeaderData(e,i,r));if(a){const e=this.assembleFacetHeaderData(r);e&&n.push(...e)}return n}}function kpe(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function Rpe(e){const t={};return J7(e.filter,e=>{var n;if(Ire(e)){let i=null;yre(e)?i=e.equal:Ere(e)?i=e.range[0]:wre(e)&&(i=(null!==(n=e.oneOf)&&void 0!==n?n:e.in)[0]),i&&(Kie(i)?t[e.field]="date":$7(i)?t[e.field]="number":U7(i)&&(t[e.field]="string")),e.timeUnit&&(t[e.field]="date")}}),t}function Npe(e){const t={};function n(e){var n;Noe(e)?t[e.field]="date":"quantitative"===e.type&&(U7(n=e.aggregate)&&lee(["min","max"],n))?t[e.field]="number":Mee(e.field)>1?e.field in t||(t[e.field]="flatten"):hoe(e)&&Hse(e.sort)&&Mee(e.sort.field)>1&&(e.sort.field in t||(t[e.sort.field]="flatten"))}if((Ffe(e)||Lfe(e))&&e.forEachFieldDef((t,i)=>{if(coe(t))n(t);else{const r=Ine(i),s=e.fieldDef(r);n(Object.assign(Object.assign({},t),{type:s.type}))}}),Ffe(e)){const{mark:n,markDef:i,encoding:r}=e;if(ite(n)&&!e.encoding.order){const e=r["horizontal"===i.orient?"y":"x"];roe(e)&&"quantitative"===e.type&&!(e.field in t)&&(t[e.field]="number")}}return t}class Dpe extends Uue{constructor(e,t){super(e),this._parse=t}clone(){return new Dpe(null,nee(this._parse))}hash(){return`Parse ${oee(this._parse)}`}static makeExplicit(e,t,n){let i={};const r=t.data;return!Ule(r)&&r&&r.format&&r.format.parse&&(i=r.format.parse),this.makeWithAncestors(e,i,{},n)}static makeWithAncestors(e,t,n,i){for(const e of _ee(n)){const t=i.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:qie(Cie(e,n[e],t.value)))}for(const e of _ee(t)){const n=i.get(e);void 0!==n&&(n===t[e]?delete t[e]:qie(Cie(e,t[e],n)))}const r=new Mle(t,n);i.copyAll(r);const s={};for(const e of _ee(r.combine())){const t=r.get(e);null!==t&&(s[e]=t)}return 0===_ee(s).length||i.parseNothing?null:new Dpe(e,s)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const t of _ee(this._parse)){const n=this._parse[t];1===Mee(t)&&(e[t]=n)}return e}producedFields(){return new Set(_ee(this._parse))}dependentFields(){return new Set(_ee(this._parse))}assembleTransforms(e=!1){return _ee(this._parse).filter(t=>!e||Mee(t)>1).map(e=>{const t=function(e,t){const n=Iee(e);if("number"===t)return`toNumber(${n})`;if("boolean"===t)return`toBoolean(${n})`;if("string"===t)return`toString(${n})`;if("date"===t)return`toDate(${n})`;if("flatten"===t)return n;if(0===t.indexOf("date:"))return`timeParse(${n},'${kpe(t.slice(5,t.length))}')`;if(0===t.indexOf("utc:"))return`utcParse(${n},'${kpe(t.slice(4,t.length))}')`;return qie(`Unrecognized parse "${t}".`),null}(e,this._parse[e]);if(!t)return null;return{type:"formula",expr:t,as:Oee(e)}}).filter(e=>null!==e)}}class Fpe extends Uue{clone(){return new Fpe(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([Rae])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Rae}}}class Lpe extends Uue{constructor(e,t){super(e),this.transform=t}clone(){return new Lpe(null,nee(this.transform))}addDimensions(e){this.transform.groupby=hee(this.transform.groupby.concat(e),e=>e)}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:goe(e)}hash(){return`JoinAggregateTransform ${oee(this.transform)}`}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);const i=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==i?{groupby:i}:{})}}class Ppe extends Uue{constructor(e,t){super(e),this._stack=t}clone(){return new Ppe(null,nee(this._stack))}static makeFromTransform(e,t){const{stack:n,groupby:i,as:r,offset:s="zero"}=t,o=[],a=[];if(void 0!==t.sort)for(const e of t.sort)o.push(e.field),a.push(kee(e.order,"ascending"));const l={field:o,order:a};let u;return u=function(e){return O7(e)&&e.every(e=>U7(e))&&e.length>1}(r)?r:U7(r)?[r,r+"_end"]:[t.stack+"_start",t.stack+"_end"],new Ppe(e,{stackField:n,groupby:i,offset:s,sort:l,facetby:[],as:u})}static makeFromEncoding(e,t){const n=t.stack,{encoding:i}=t;if(!n)return null;const{groupbyChannel:r,fieldChannel:s,offset:o,impute:a}=n;let l;if(r){l=Aoe(i[r])}const u=function(e){return e.stack.stackBy.reduce((e,t)=>{const n=goe(t.fieldDef);return n&&e.push(n),e},[])}(t),c=t.encoding.order;let d;return d=O7(c)||roe(c)?Woe(c):u.reduce((e,t)=>(e.field.push(t),e.order.push("y"===s?"descending":"ascending"),e),{field:[],order:[]}),new Ppe(e,{dimensionFieldDef:l,stackField:t.vgField(s),facetby:[],stackby:u,sort:d,offset:o,impute:a,as:[t.vgField(s,{suffix:"start",forAs:!0}),t.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${oee(this._stack)}`}getGroupbyFields(){const{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[goe(e,{binSuffix:"mid"})]:[goe(e,{}),goe(e,{binSuffix:"end"})]:[goe(e)]:null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDef:n,stackField:i,stackby:r,sort:s,offset:o,impute:a,as:l}=this._stack;if(a&&n){const{band:s=.5,bin:o}=n;o&&e.push({type:"formula",expr:`${s}*`+goe(n,{expr:"datum"})+`+${1-s}*`+goe(n,{expr:"datum",binSuffix:"end"}),as:goe(n,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[...r,...t],key:goe(n,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:s,as:l,offset:o}),e}}class Bpe extends Uue{constructor(e,t){super(e),this.transform=t}clone(){return new Bpe(null,nee(this.transform))}addDimensions(e){this.transform.groupby=hee(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach(e=>n.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:goe(e)}hash(){return`WindowTransform ${oee(this.transform)}`}assemble(){var e;const t=[],n=[],i=[],r=[];for(const e of this.transform.window)n.push(e.op),i.push(this.getDefaultName(e)),r.push(void 0===e.param?null:e.param),t.push(void 0===e.field?null:e.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&null===s[0]&&null===s[1]&&n.every(e=>yte(e)))return Object.assign({type:"joinaggregate",as:i,ops:n,fields:t},void 0!==o?{groupby:o}:{});const a=[],l=[];if(void 0!==this.transform.sort)for(const t of this.transform.sort)a.push(t.field),l.push(null!==(e=t.order)&&void 0!==e?e:"ascending");const u={field:a,order:l},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:r,as:i,ops:n,fields:t,sort:u},void 0!==c?{ignorePeers:c}:{}),void 0!==o?{groupby:o}:{}),void 0!==s?{frame:s}:{})}}class $pe extends Ape{run(e){const t=e.parent;if(e instanceof Dpe){if(wpe(t))return this.flags;if(t.numChildren()>1)return this.setContinue(),this.flags;if(t instanceof Dpe)this.setMutated(),t.merge(e);else{if(mee(t.producedFields(),e.dependentFields()))return this.setContinue(),this.flags;this.setMutated(),e.swapWithParent()}}return this.setContinue(),this.flags}}class Upe extends Spe{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map(e=>e.hash()),n={};for(let i=0;i<t.length;i++)void 0===n[t[i]]?n[t[i]]=[e.children[i]]:n[t[i]].push(e.children[i]);for(const t of _ee(n))n[t].length>1&&(this.setMutated(),this.mergeNodes(e,n[t]));for(const t of e.children)this.run(t);return this.mutatedFlag}}class Vpe extends Ape{run(e){return e instanceof Vue||e.numChildren()>0||e instanceof Mpe||(this.setMutated(),e.remove()),this.flags}}class zpe extends Ape{constructor(){super(...arguments),this.fields=new Set,this.prev=null}run(e){if(this.setContinue(),e instanceof zue){const t=e.producedFields();pee(t,this.fields)?(this.setMutated(),this.prev.remove()):this.fields=new Set([...this.fields,...t]),this.prev=e}return this.flags}reset(){this.fields.clear()}}class jpe extends Ape{run(e){this.setContinue();const t=e.parent.children.filter(e=>e instanceof zue),n=t.pop();for(const e of t)this.setMutated(),n.merge(e);return this.flags}}function Ype(e){if(e instanceof Mpe)if(1!==e.numChildren()||e.children[0]instanceof Vue){const n=e.model.component.data.main;Gpe(n);const i=(t=e,function e(n){if(!(n instanceof Mpe)){const i=n.clone();if(i instanceof Vue){const e=Qpe+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof Ope||i instanceof Ppe||i instanceof Bpe||i instanceof Lpe)&&i.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=i;return[i]}return n.children.flatMap(e)}),r=e.children.map(i).flat();for(const e of r)e.parent=n}else{const t=e.children[0];(t instanceof Ope||t instanceof Ppe||t instanceof Bpe||t instanceof Lpe)&&t.addDimensions(e.fields),t.swapWithParent(),Ype(e)}else e.children.map(Ype);var t}function Gpe(e){if(e instanceof Vue&&e.type===Yle&&1===e.numChildren()){const t=e.children[0];t instanceof Mpe||(t.swapWithParent(),Gpe(e))}}class Hpe extends Spe{constructor(){super()}run(e){e instanceof Vue&&!e.isRequired()&&(this.setMutated(),e.remove());for(const t of e.children)this.run(t);return this.mutatedFlag}}class Wpe extends Spe{constructor(e){super(),this.requiresSelectionId=e&&Oce(e)}run(e){e instanceof Fpe&&(this.requiresSelectionId&&(wpe(e.parent)||e.parent instanceof Ope||e.parent instanceof Dpe)||(this.setMutated(),e.remove()));for(const t of e.children)this.run(t);return this.mutatedFlag}}class Xpe extends Ape{run(e){const t=e.parent,n=[...t.children],i=t.children.filter(e=>e instanceof Dpe);if(t.numChildren()>1&&i.length>=1){const e={},r=new Set;for(const t of i){const n=t.parse;for(const t of _ee(n))t in e?e[t]!==n[t]&&r.add(t):e[t]=n[t]}for(const t of r)delete e[t];if(!gee(e)){this.setMutated();const i=new Dpe(t,e);for(const r of n){if(r instanceof Dpe)for(const t of _ee(e))delete r.parse[t];t.removeChild(r),r.parent=i,r instanceof Dpe&&0===_ee(r.parse).length&&r.remove()}}}return this.setContinue(),this.flags}}class qpe extends Ape{run(e){const t=e.parent,n=t.children.filter(e=>e instanceof Ope),i={};for(const e of n){const t=oee(e.groupBy);t in i||(i[t]=[]),i[t].push(e)}for(const e of _ee(i)){const n=i[e];if(n.length>1){const e=n.pop();for(const i of n)e.merge(i)&&(t.removeChild(i),i.parent=e,i.remove(),this.setMutated())}}return this.setContinue(),this.flags}}class Kpe extends Ape{constructor(e){super(),this.model=e}run(e){const t=e.parent,n=!(wpe(t)||t instanceof the||t instanceof Dpe||t instanceof Fpe),i=[],r=[];for(const e of t.children)e instanceof vpe&&(n&&!mee(t.producedFields(),e.dependentFields())?i.push(e):r.push(e));if(i.length>0){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated(),t instanceof vpe?t.merge(e,this.model.renameSignal.bind(this.model)):e.swapWithParent()}if(r.length>1){const e=r.pop();for(const t of r)e.merge(t,this.model.renameSignal.bind(this.model));this.setMutated()}return this.setContinue(),this.flags}}class Zpe extends Ape{run(e){const t=e.parent,n=[...t.children];if(!uee(n,e=>e instanceof Vue)||t.numChildren()<=1)return this.setContinue(),this.flags;const i=[];let r;for(const e of n)if(e instanceof Vue){let n=e;for(;1===n.numChildren();){const e=n.children[0];if(!(e instanceof Vue))break;n=e}i.push(...n.children),r?(t.removeChild(e),e.parent=r.parent,r.parent.removeChild(r),r.parent=n,this.setMutated()):r=n}else i.push(e);if(i.length){this.setMutated();for(const e of i)e.parent.removeChild(e),e.parent=r}return this.setContinue(),this.flags}}const Qpe="scale_",Jpe=5;function efe(e){const t=[];function n(e){if(0===e.numChildren())t.push(e);else for(const t of e.children)n(t)}for(const t of e)n(t);return t}function tfe(e){return e}function nfe(e,t){return t.map(t=>{if(e instanceof Ape){const n=e.optimizeNextFromLeaves(t);return e.reset(),n}return e.run(t)}).some(tfe)}function ife(e,t){let n=e.sources;const i=new Set;return i.add(nfe(new Hpe,n)),i.add(nfe(new Wpe(t),n)),n=n.filter(e=>e.numChildren()>0),i.add(nfe(new Vpe,efe(n))),n=n.filter(e=>e.numChildren()>0),i.add(nfe(new $pe,efe(n))),i.add(nfe(new Kpe(t),efe(n))),i.add(nfe(new zpe,efe(n))),i.add(nfe(new Xpe,efe(n))),i.add(nfe(new qpe,efe(n))),i.add(nfe(new jpe,efe(n))),i.add(nfe(new Upe,n)),i.add(nfe(new Zpe,efe(n))),e.sources=n,i.has(!0)}class rfe{constructor(e){Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new rfe(()=>e(t))}}function sfe(e){Ffe(e)?function(e){const t=e.component.scales;for(const n of _ee(t)){const i=ofe(e,n);if(t[n].setWithExplicit("domains",i),cfe(e,n),e.component.data.isFaceted){let t=e;for(;!Lfe(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)fre(e)&&(e.data=Qpe+e.data.replace(Qpe,""))}}}(e):function(e){for(const t of e.children)sfe(t);const t=e.component.scales;for(const n of _ee(t)){let i,r=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Fle(i,e.getWithExplicit("domains"),"domains","scale",hfe);const t=e.get("selectionExtent");r&&t&&r.selection!==t.selection&&qie("The same selection must be used to override scale domains in a layered view."),r=t}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}(e)}function ofe(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=dfe(t,n);if(!e)return void qie(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=dfe(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]=Object.assign(Object.assign({},e.specifiedScales[t]),{domain:r})),"x"===t&&Soe(i.x2)?Soe(i.x)?Fle(lfe(n,r,e,"x"),lfe(n,r,e,"x2"),"domain","scale",hfe):lfe(n,r,e,"x2"):"y"===t&&Soe(i.y2)?Soe(i.y)?Fle(lfe(n,r,e,"y"),lfe(n,r,e,"y2"),"domain","scale",hfe):lfe(n,r,e,"y2"):lfe(n,r,e,t)}function afe(e,t,n){var i;const r=null===(i=dre(n))||void 0===i?void 0:i.unit;return"temporal"===t||r?function(e,t,n){return e.map(e=>({signal:`{data: ${Doe(e,{timeUnit:n,type:t})}}`}))}(e,t,r):[e]}function lfe(e,t,n,i){const{encoding:r}=n,s=Soe(r[i]),{type:o}=s,a=s.timeUnit;if(function(e){return e&&e.unionWith}(t)){const r=lfe(e,void 0,n,i),s=afe(t.unionWith,o,a);return kle([...r.value,...s])}if(hre(t))return kle([t]);if(t&&"unaggregated"!==t&&!cse(t))return kle(afe(t,o,a));const l=n.stack;if(l&&i===l.fieldChannel){if("normalize"===l.offset)return Rle([[0,1]]);const e=n.requestDataName(Yle);return Rle([{data:e,field:n.vgField(i,{suffix:"start"})},{data:e,field:n.vgField(i,{suffix:"end"})}])}const u=aie(i)&&roe(s)?function(e,t,n){if(!ose(n))return;const i=e.fieldDef(t),r=i.sort;if(Wse(r))return{op:"min",field:xhe(i,t),order:"ascending"};const{stack:s}=e,o=s?[...s.groupbyField?[s.groupbyField]:[],...s.stackBy.map(e=>e.fieldDef.field)]:void 0;if(Hse(r)){return ufe(r,s&&!lee(o,r.field))}if(Gse(r)){const{encoding:t,order:n}=r,i=e.fieldDef(t),{aggregate:a,field:l}=i,u=s&&!lee(o,l);if(gte(a)||_te(a))return ufe({field:goe(i),order:n},u);if(yte(a)||!a)return ufe({op:a,field:l,order:n},u)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(lee(["ascending",void 0],r))return!0}return}(n,i,e):void 0;if(ooe(s)){return Rle(afe([s.datum],o,a))}const c=s;if("unaggregated"===t){const e=n.requestDataName(Yle),{field:t}=s;return Rle([{data:e,field:goe({field:t,aggregate:"min"})},{data:e,field:goe({field:t,aggregate:"max"})}])}if(fie(c.bin)){if(ose(e))return Rle("bin-ordinal"===e?[]:[{data:bee(u)?n.requestDataName(Yle):n.requestDataName(Gle),field:n.vgField(i,Loe(c,i)?{binSuffix:"range"}:{}),sort:!0!==u&&M7(u)?u:{field:n.vgField(i,{}),op:"min"}}]);{const{bin:e}=c;if(fie(e)){const t=_pe(n,c.field,e);return Rle([new rfe(()=>{const e=n.getSignalName(t);return`[${e}.start, ${e}.stop]`})])}return Rle([{data:n.requestDataName(Yle),field:n.vgField(i,{})}])}}if(c.timeUnit&&lee(["time","utc"],e)&&eoe(i,c,Ffe(n)?n.encoding[Sne(i)]:void 0,n.stack,n.markDef,n.config)){const e=n.requestDataName(Yle);return Rle([{data:e,field:n.vgField(i)},{data:e,field:n.vgField(i,{suffix:"end"})}])}return Rle(u?[{data:bee(u)?n.requestDataName(Yle):n.requestDataName(Gle),field:n.vgField(i),sort:u}]:[{data:n.requestDataName(Yle),field:n.vgField(i)}])}function ufe(e,t){const{op:n,field:i,order:r}=e;return Object.assign(Object.assign({op:null!=n?n:t?"sum":zse},i?{field:See(i)}:{}),r?{order:r}:{})}function cfe(e,t){var n;const i=e.component.scales[t],r=e.specifiedScales[t].domain,s=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,o=cse(r)&&r,a=gie(s)&&_ie(s.extent)&&s.extent;(o||a)&&i.set("selectionExtent",null!=o?o:a,!0)}function dfe(e,t){const{aggregate:n,type:i}=e;return n?U7(n)&&!xte[n]?{valid:!1,reason:Bie(n)}:"quantitative"===i&&"log"===t?{valid:!1,reason:$ie(e)}:{valid:!0}:{valid:!1,reason:Pie(e)}}function hfe(e,t,n,i){return e.explicit&&t.explicit&&qie(function(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${see(n)} and ${see(i)}). Using the union of the two domains.`}(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function pfe(e){const t=hee(e.map(e=>{if(fre(e)){const{sort:t}=e;return j7(e,["sort"])}return e}),oee),n=hee(e.map(e=>{if(fre(e)){const t=e.sort;return void 0===t||bee(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),oee);if(0===t.length)return;if(1===t.length){const t=e[0];if(fre(t)&&n.length>0){let e=n[0];if(n.length>1)qie(zie),e=!0;else if(M7(e)&&"field"in e){const n=e.field;t.field===n&&(e=!e.order||{order:e.order})}return Object.assign(Object.assign({},t),{sort:e})}return t}const i=hee(n.map(e=>bee(e)||!("op"in e)||e.op in mte?e:(qie(function(e){return`Dropping sort property ${see(e)} as unioned domains only support boolean or op "count", "min", and "max".`}(e)),!0)),oee);let r;1===i.length?r=i[0]:i.length>1&&(qie(zie),r=!0);const s=hee(e.map(e=>fre(e)?e.data:null),e=>e);if(1===s.length&&null!==s[0]){return Object.assign({data:s[0],fields:t.map(e=>e.field)},r?{sort:r}:{})}return Object.assign({fields:t},r?{sort:r}:{})}function ffe(e){if(fre(e)&&U7(e.field))return e.field;if(function(e){return!O7(e)&&"fields"in e&&!("data"in e)}(e)){let t;for(const n of e.fields)if(fre(n)&&U7(n.field))if(t){if(t!==n.field)return qie("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),t}else t=n.field;return qie("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),t}if(function(e){return!O7(e)&&"fields"in e&&"data"in e}(e)){qie("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const t=e.fields[0];return U7(t)?t:void 0}}function mfe(e,t){const n=e.component.scales[t].get("domains").map(t=>(fre(t)&&(t.data=e.lookupDataSource(t.data)),t));return pfe(n)}function gfe(e){return Bfe(e)||Pfe(e)?e.children.reduce((e,t)=>e.concat(gfe(t)),_fe(e)):_fe(e)}function _fe(e){return _ee(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:l,range:u,reverse:c}=r,d=j7(r,["name","type","selectionExtent","domains","range","reverse"]),h=function(e,t,n){if(Gne(n)&&pre(e))return{step:{signal:t+"_step"}};return e}(r.range,s,n);let p;a&&(p=function(e,t){const n=t.selection;return{signal:ihe(e.getSelectionComponent(n,Tee(n)),t)}}(e,a));const f=mfe(e,n);return t.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:s,type:o},f?{domain:f}:{}),p?{domainRaw:p}:{}),{range:h}),void 0!==c?{reverse:c}:{}),d)),t},[])}class yfe extends Mle{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||uee(this.get("domains"),e=>O7(e)&&2===e.length&&e[0]<=0&&e[1]>=0)}}const vfe=["range","scheme"];function bfe(e){return"x"===e?"width":"y"===e?"height":void 0}function Tfe(e,t){const n=e.fieldDef(t);if(n&&n.bin&&fie(n.bin)){const i=_pe(e,n.field,n.bin),r=bfe(t),s=e.getName(r);return new rfe(()=>{const t=e.getSignalName(i),n=`(${t}.stop - ${t}.start) / ${t}.step`;return`${e.getSignalName(s)} / (${n})`})}}function xfe(e,t){const n=t.specifiedScales[e],{size:i}=t,r=t.getScaleComponent(e).get("type");for(const i of vfe)if(void 0!==n[i]){const s=yse(r,i),o=vse(e,i);if(s)if(o)qie(o);else switch(i){case"range":return O7(n.range)&&Gne(e)?kle(n.range.map(e=>{if("width"===e||"height"===e){const n=t.getName(e),i=t.getSignalName.bind(t);return rfe.fromName(i,n)}return e})):kle(n.range);case"scheme":return kle(Efe(n[i]))}else qie(Uie(r,i,e))}if(e===Ate||e===Ste){const t=e===Ate?"width":"height",n=i[t];if($ae(n)){if(ose(r))return kle({step:n.step});qie(Vie(t))}}return Rle(function(e,t){const{size:n,config:i,mark:r,encoding:s}=t,o=t.getSignalName.bind(t),{type:a}=Soe(s[e]),l=t.getScaleComponent(e),u=l.get("type"),{domain:c,domainMid:d}=t.specifiedScales[e];switch(e){case Ate:case Ste:{if(lee(["point","band"],u))if(e!==Ate||n.width){if(e===Ste&&!n.height){const e=Yae(i.view,"height");if($ae(e))return e}}else{const e=Yae(i.view,"width");if($ae(e))return e}const r=bfe(e),s=t.getName(r);return e===Ste&&ase(u)?[rfe.fromName(o,s),0]:[0,rfe.fromName(o,s)]}case zte:{const s=wfe(r,t.component.scales[e].get("zero"),i),o=function(e,t,n,i){const r={x:Tfe(n,"x"),y:Tfe(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==i.scale.maxBandSize)return i.scale.maxBandSize;const e=Afe(t,r,i.view);return $7(e)?e-1:new rfe(()=>`${e.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const e=Afe(t,r,i.view);return $7(e)?Math.pow(Ife*e,2):new rfe(()=>`pow(${Ife} * ${e.signal}, 2)`)}}throw new Error(Die("size",e))}(r,n,t,i);return use(u)?function(e,t,n){const i=()=>{const i=Voe(t),r=Voe(e),s=`(${i} - ${r}) / (${n} - 1)`;return`sequence(${r}, ${i} + ${s}, ${s})`};return hre(t)?new rfe(i):{signal:i()}}(s,o,function(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&O7(n)?n.length+1:(qie(function(e){return`Domain for ${e} is required for threshold scale.`}(i)),3)}}(u,i,c,e)):[s,o]}case Rte:return[0,2*Math.PI];case jte:return[0,360];case Mte:return[0,new rfe(()=>`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`)];case Wte:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Xte:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case Vte:return"symbol";case Bte:case $te:case Ute:return"ordinal"===u?"nominal"===a?"category":"ordinal":void 0!==d?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case Yte:case Gte:case Hte:return[i.scale.minOpacity,i.scale.maxOpacity]}throw new Error(`Scale range undefined for channel ${e}`)}(e,t))}function Efe(e){return function(e){return!U7(e)&&!!e.name}(e)?Object.assign({scheme:e.name},ree(e,["name"])):{scheme:e}}function wfe(e,t,n){if(t)return hre(t)?{signal:`${t.signal} ? 0 : ${wfe(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(Die("size",e))}const Ife=.95;function Afe(e,t,n){const i=$ae(e.width)?e.width.step:jae(n,"width"),r=$ae(e.height)?e.height.step:jae(n,"height");return t.x||t.y?new rfe(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function Sfe(e,t){Ffe(e)?function(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of _ee(n)){const l=o[a],u=n[a],c=e.getScaleComponent(a),d=Soe(r[a]),h=l[t],p=c.get("type"),f=c.get("padding"),m=c.get("paddingInner"),g=yse(p,t),_=vse(a,t);if(void 0!==h&&(g?_&&qie(_):qie(Uie(p,t,a))),g&&void 0===_)if(void 0!==h)u.copyKeyFromObject(t,l);else{const n=t in Cfe?Cfe[t]({model:e,channel:a,fieldOrDatumDef:d,scaleType:p,scalePadding:f,scalePaddingInner:m,domain:l.domain,markDef:s,config:i}):i.scale[t];void 0!==n&&u.set(t,n,!1)}}}(e,t):Mfe(e,t)}const Cfe={bins:({model:e,fieldOrDatumDef:t})=>roe(t)?function(e,t){const n=t.bin;if(fie(n)){const i=_pe(e,t.field,n);return new rfe(()=>e.getSignalName(i))}if(mie(n)&&gie(n)&&void 0!==n.step)return{step:n.step};return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function(e,t){if(lee([Bte,$te,Ute],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function(e,t,n){var i;if((null===(i=Aoe(n))||void 0===i?void 0:i.bin)||lee([zre,jre],e))return;return t in jne||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>function(e,t,n,i,r,s){if(e in jne){if(lse(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:o}=r;if("bar"===t&&(!roe(i)||!i.bin&&!i.timeUnit)&&("vertical"===o&&"x"===e||"horizontal"===o&&"y"===e))return s.continuousBandSize}if(t===Wre)return n.pointPadding}return}(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:i})=>function(e,t,n,i){if(void 0!==e)return;if(t in jne){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r}=i;return kee(e,"bar"===n?t:r)}return}(e,t,n.type,i.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:i,scalePaddingInner:r,config:s})=>function(e,t,n,i,r,s){if(void 0!==e)return;if(t in jne&&n===Xre){const{bandPaddingOuter:e}=s;return kee(e,hre(r)?{signal:`${r.signal}/2`}:r/2)}return}(e,t,n,i.type,r,s.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>function(e,t,n,i){if("x"===n&&void 0!==i.xReverse)return ase(e)&&"descending"===t?hre(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(ase(e)&&"descending"===t)return!0;return}(t,roe(e)?e.sort:void 0,n,i.scale),zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r})=>function(e,t,n,i,r){if(n&&"unaggregated"!==n&&ase(r)){if(O7(n)){const e=n[0],t=n[n.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!use(r))return!0;if((!roe(t)||!t.bin)&&lee([...Yne,...Wne],e)){const{orient:t,type:n}=i;return!lee(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(e,t,n,i,r)};function Ofe(e){Ffe(e)?function(e){const t=e.component.scales;for(const n of oie){const i=t[n];if(!i)continue;const r=xfe(n,e);i.setWithExplicit("range",r)}}(e):Mfe(e,"range")}function Mfe(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?Ofe(n):Sfe(n,t);for(const i of _ee(n)){let r;for(const n of e.children){const e=n.component.scales[i];if(e){r=Fle(r,e.getWithExplicit(t),t,"scale",Nle((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))}}n[i].setWithExplicit(t,r)}}function kfe(e,t,n,i){const r=function(e,t,n){var i;switch(t.type){case"nominal":case"ordinal":if(lne(e)||"discrete"===hie(e))return"shape"===e&&"ordinal"===t.type&&qie(Lie(e,"ordinal")),"ordinal";if(e in jne){if(lee(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in Hne)return"band";return void 0!==t.band||poe(t)&&(null===(i=t.axis)||void 0===i?void 0:i.tickBand)?"band":"point";case"temporal":return lne(e)?"time":"discrete"===hie(e)?(qie(Lie(e,"temporal")),"ordinal"):roe(t)&&t.timeUnit&&dre(t.timeUnit).utc?"utc":"time";case"quantitative":return lne(e)?roe(t)&&fie(t.bin)?"bin-ordinal":"linear":"discrete"===hie(e)?(qie(Lie(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(kie(t.type))}(t,n,i),{type:s}=e;return aie(t)?void 0!==s?Tse(t,s)?roe(n)&&!bse(s,n.type)?(qie(function(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}(s,r)),r):s:(qie(function(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}(t,s,r)),r):r:null}function Rfe(e){Ffe(e)?e.component.scales=function(e){const{encoding:t,mark:n}=e;return oie.reduce((i,r)=>{const s=Soe(t[r]);if(s&&n===nte&&r===Vte&&s.type===Fre)return i;let o=s&&s.scale;if(s&&null!==o&&!1!==o){o=null!=o?o:{};const t=kfe(o,r,s,n);i[r]=new yfe(e.scaleName(r+"",!0),{value:t,explicit:o.type===t})}return i},{})}(e):e.component.scales=function(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const n of e.children){Rfe(n);for(const s of _ee(n.component.scales))if(r.scale[s]=null!==(t=r.scale[s])&&void 0!==t?t:Yhe(s,e),"shared"===r.scale[s]){const e=i[s],t=n.component.scales[s].getWithExplicit("type");e?Zre(e.value,t.value)?i[s]=Fle(e,t,"type","scale",Nfe):(r.scale[s]="independent",delete i[s]):i[s]=t}}for(const t of _ee(i)){const r=e.scaleName(t,!0),s=i[t];n[t]=new yfe(r,s);for(const n of e.children){const e=n.component.scales[t];e&&(n.renameScale(e.get("name"),r),e.merged=!0)}}return n}(e)}const Nfe=Nle((e,t)=>Jre(e)-Jre(t));class Dfe{constructor(){this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function Ffe(e){return"unit"===(null==e?void 0:e.type)}function Lfe(e){return"facet"===(null==e?void 0:e.type)}function Pfe(e){return"concat"===(null==e?void 0:e.type)}function Bfe(e){return"layer"===(null==e?void 0:e.type)}class $fe{constructor(e,t,n,i,r,s,o){var a,l;this.type=t,this.parent=n,this.config=r,this.view=o,this.children=[],this.correctDataNames=e=>(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=r,this.name=null!==(a=e.name)&&void 0!==a?a:i,this.title=Boe(e.title)?{text:e.title}:e.title,this.scaleNameMap=n?n.scaleNameMap:new Dfe,this.projectionNameMap=n?n.projectionNameMap:new Dfe,this.signalNameMap=n?n.signalNameMap:new Dfe,this.data=e.data,this.description=e.description,this.transforms=function(e){return e.map(e=>Hle(e)?{filter:eee(e.filter,Ore)}:e)}(null!==(l=e.transform)&&void 0!==l?l:[]),this.layout="layer"===t||"unit"===t?{}:function(e,t,n){var i,r;const s=n[t],o={},{spacing:a,columns:l}=s;void 0!==a&&(o.spacing=a),void 0!==l&&(Kse(e)&&!Xse(e.facet)||Lae(e))&&(o.columns=l),Pae(e)&&(o.columns=1);for(const t of Vae)if(void 0!==e[t])if("spacing"===t){const n=e[t];o[t]=$7(n)?n:{row:null!==(i=n.row)&&void 0!==i?i:a,column:null!==(r=n.column)&&void 0!==r?r:a}}else o[t]=e[t];return o}(e,t,r),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:Kse(e)||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new Mle,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},s?nee(s):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e,{ignoreRange:t}={}){Rfe(e),sfe(e);for(const t of _se)Sfe(e,t);t||Ofe(e)}(this)}parseProjection(){mpe(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){rpe(this)}assembleGroupStyle(){var e,t;if("unit"===this.type||"layer"===this.type)return null!==(t=null===(e=this.view)||void 0===e?void 0:e.style)&&void 0!==t?t:"cell"}assembleEncodeFromView(e){const{style:t}=e,n=j7(e,["style"]),i={};for(const e of _ee(n)){const t=n[e];void 0!==t&&(i[e]=$oe(t))}return i}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=$oe(this.description)),"unit"!==this.type&&"layer"!==this.type)?gee(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!=t?t:{})}assembleLayout(){if(!this.layout)return;const e=this.layout,{spacing:t}=e,n=j7(e,["spacing"]),{component:i,config:r}=this,s=function(e,t){const n={};for(const i of cne){const r=e[i];if(null==r?void 0:r.facetFieldDef){const{titleAnchor:e,titleOrient:s}=Ihe(["titleAnchor","titleOrient"],r.facetFieldDef,t,i),o=Ehe(i,s),a=Lhe(e,o);void 0!==a&&(n[o]=a)}}return gee(n)?void 0:n}(i.layoutHeaders,r);return Object.assign(Object.assign(Object.assign({padding:t},this.assembleDefaultLayout()),n),s?{titleBand:s}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of cne)e[n].title&&t.push(Che(this,n));for(const e of Ahe)t=t.concat(khe(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(e=>ohe(e,"grid",t)),...i.map(e=>ohe(e,"grid",t)),...n.map(e=>ohe(e,"main",t)),...i.map(e=>ohe(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return cpe(this)}assembleProjections(){return dpe(this)}assembleTitle(){var e,t,n;const i=null!==(e=this.title)&&void 0!==e?e:{},{encoding:r}=i,s=j7(i,["encoding"]),o=Object.assign(Object.assign(Object.assign({},Poe(this.config.title).nonMark),s),r?{encode:{update:r}}:{});if(o.text)return lee(["unit","layer"],this.type)?lee(["middle",void 0],o.anchor)&&(o.frame=null!==(t=o.frame)&&void 0!==t?t:"group"):o.anchor=null!==(n=o.anchor)&&void 0!==n?n:"start",gee(o)?void 0:o}assembleGroup(e=[]){const t={};(e=e.concat(this.assembleSignals())).length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Lfe(this.parent)?gfe(this):[];i.length>0&&(t.scales=i);const r=this.assembleAxes();r.length>0&&(t.axes=r);const s=this.assembleLegends();return s.length>0&&(t.legends=s),t}getName(e){return Tee((this.name?this.name+"_":"")+e)}requestDataName(e){var t;const n=this.getName(e),i=this.component.data.outputNodeRefCounts;return i[n]=(null!==(t=i[n])&&void 0!==t?t:0)+1,n}getSizeSignalRef(e){if(Lfe(this.parent)){const t=Xne(zhe(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(ose(e)&&pre(i)){const e=n.get("name"),i=ffe(mfe(this,t));if(i){return{signal:Vhe(e,n,goe({aggregate:"distinct",field:i},{expr:"datum"}))}}return qie(`Unknown field for ${t}. Cannot calculate view size.`),null}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):xne(e)&&aie(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(`Cannot find a selection named "${t}".`);return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some(e=>e.hasOrientSignalRef()))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some(e=>e.hasOrientSignalRef()))}}class Ufe extends $fe{vgField(e,t={}){const n=this.fieldDef(e);if(n)return goe(n,t)}reduceFieldDef(e,t){return iae(this.getMapping(),(t,n,i)=>{const r=Aoe(n);return r?e(t,r,i):t},t)}forEachFieldDef(e,t){nae(this.getMapping(),(t,n)=>{const i=Aoe(t);i&&e(i,n)},t)}}class Vfe extends Uue{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=nee(t);const s=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=s[0])&&void 0!==i?i:"value",null!==(r=s[1])&&void 0!==r?r:"density"]}clone(){return new Vfe(null,nee(this.transform))}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${oee(this.transform)}`}assemble(){const e=this.transform,{density:t}=e,n=j7(e,["density"]);return Object.assign({type:"kde",field:t},n)}}class zfe extends Uue{constructor(e,t){super(e),this.filter=t}clone(){return new zfe(null,Object.assign({},this.filter))}static make(e,t){const{config:n,mark:i,markDef:r}=t;if("filter"!==joe("invalid",r,n))return null;const s=t.reduceFieldDef((e,n,r)=>{const s=aie(r)&&t.getScaleComponent(r);if(s){ase(s.get("type"))&&"count"!==n.aggregate&&!ite(i)&&(e[n.field]=n)}return e},{});return _ee(s).length?new zfe(e,s):null}dependentFields(){return new Set(_ee(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${oee(this.filter)}`}assemble(){const e=_ee(this.filter).reduce((e,t)=>{const n=this.filter[t],i=goe(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push(`(isDate(${i}) || (isValid(${i}) && isFinite(+${i})))`):"quantitative"===n.type&&(e.push(`isValid(${i})`),e.push(`isFinite(+${i})`))),e},[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class jfe extends Uue{constructor(e,t){super(e),this.transform=t,this.transform=nee(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map((e,t)=>{var n;return null!==(n=i[t])&&void 0!==n?n:e})}clone(){return new jfe(this.parent,nee(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${oee(this.transform)}`}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class Yfe extends Uue{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=nee(t);const s=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=s[0])&&void 0!==i?i:"key",null!==(r=s[1])&&void 0!==r?r:"value"]}clone(){return new Yfe(null,nee(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${oee(this.transform)}`}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class Gfe extends Uue{constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}clone(){return new Gfe(null,nee(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[[Fte,Dte],[Pte,Lte]]){const r=i.map(e=>{const n=Soe(t.encoding[e]);return roe(n)?n.field:ooe(n)?{expr:`${n.datum}`}:doe(n)?{expr:`${n.value}`}:void 0});(r[0]||r[1])&&(e=new Gfe(e,r,null,t.getName("geojson_"+n++)))}if(t.channelHasField(Vte)){const i=t.typedFieldDef(Vte);i.type===Fre&&(e=new Gfe(e,null,i.field,t.getName("geojson_"+n++)))}return e}dependentFields(){var e;const t=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(U7);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${oee(this.fields)}`}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class Hfe extends Uue{constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}clone(){return new Hfe(null,this.projection,nee(this.fields),nee(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[Fte,Dte],[Pte,Lte]]){const i=n.map(e=>{const n=Soe(t.encoding[e]);return roe(n)?n.field:ooe(n)?{expr:`${n.datum}`}:doe(n)?{expr:`${n.value}`}:void 0}),r=n[0]===Pte?"2":"";(i[0]||i[1])&&(e=new Hfe(e,t.projectionName(),i,[t.getName("x"+r),t.getName("y"+r)]))}return e}dependentFields(){return new Set(this.fields.filter(U7))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${oee(this.fields)} ${oee(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Wfe extends Uue{constructor(e,t){super(e),this.transform=t}clone(){return new Wfe(null,nee(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e;return{signal:`sequence(${[t,n,...i?[i]:[]].join(",")})`}}static makeFromTransform(e,t){return new Wfe(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,r=n.y;if(roe(i)&&roe(r)){const s=i.impute?i:r.impute?r:void 0;if(void 0===s)return;const o=i.impute?r:r.impute?i:void 0,{method:a,value:l,frame:u,keyvals:c}=s.impute,d=rae(t.mark,n);return new Wfe(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:s.field,key:o.field},a?{method:a}:{}),void 0!==l?{value:l}:{}),u?{frame:u}:{}),void 0!==c?{keyvals:c}:{}),d.length?{groupby:d}:{}))}return null}hash(){return`Impute ${oee(this.transform)}`}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:r,value:s,frame:o=[null,null]}=this.transform,a=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:(l=n,void 0!==(null==l?void 0:l.stop)?this.processSequence(n):n)}:{}),{method:"value"}),r?{groupby:r}:{}),{value:i&&"value"!==i?null:s});var l;if(i&&"value"!==i){return[a,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[i],fields:[e],frame:o,ignorePeers:!1},r?{groupby:r}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.${e}`,as:e}]}return[a]}}class Xfe extends Uue{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=nee(t);const s=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=s[0])&&void 0!==i?i:t.on,null!==(r=s[1])&&void 0!==r?r:t.loess]}clone(){return new Xfe(null,nee(this.transform))}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${oee(this.transform)}`}assemble(){const e=this.transform,{loess:t,on:n}=e,i=j7(e,["loess","on"]);return Object.assign({type:"loess",x:n,y:t},i)}}class qfe extends Uue{constructor(e,t,n){super(e),this.transform=t,this.secondary=n}clone(){return new qfe(null,nee(this.transform),this.secondary)}static make(e,t,n,i){const r=t.component.data.sources,{from:s}=n;let o=null;if(function(e){return"data"in e}(s)){let e=dme(s.data,r);e||(e=new bpe(s.data),r.push(e));const n=t.getName(`lookup_${i}`);o=new Vue(e,n,"lookup",t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=o}else if(function(e){return"selection"in e}(s)){const e=s.selection;if(n=Object.assign({as:e},n),o=t.getSelectionComponent(Tee(e),e).materialized,!o)throw new Error(`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`)}return new qfe(e,n,o.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?F7(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${oee({transform:this.transform,secondary:this.secondary})}`}assemble(){let e;if(this.transform.from.fields)e=Object.assign({values:this.transform.from.fields},this.transform.as?{as:F7(this.transform.as)}:{});else{let t=this.transform.as;U7(t)||(qie('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),t="_lookup"),e={as:[t]}}return Object.assign(Object.assign({type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup]},e),this.transform.default?{default:this.transform.default}:{})}}class Kfe extends Uue{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=nee(t);const s=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=s[0])&&void 0!==i?i:"prob",null!==(r=s[1])&&void 0!==r?r:"value"]}clone(){return new Kfe(null,nee(this.transform))}dependentFields(){var e;return new Set([this.transform.quantile,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${oee(this.transform)}`}assemble(){const e=this.transform,{quantile:t}=e,n=j7(e,["quantile"]);return Object.assign({type:"quantile",field:t},n)}}class Zfe extends Uue{constructor(e,t){var n,i,r;super(e),this.transform=t,this.transform=nee(t);const s=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=s[0])&&void 0!==i?i:t.on,null!==(r=s[1])&&void 0!==r?r:t.regression]}clone(){return new Zfe(null,nee(this.transform))}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${oee(this.transform)}`}assemble(){const e=this.transform,{regression:t,on:n}=e,i=j7(e,["regression","on"]);return Object.assign({type:"regression",x:n,y:t},i)}}class Qfe extends Uue{constructor(e,t){super(e),this.transform=t}clone(){return new Qfe(null,nee(this.transform))}addDimensions(e){var t;this.transform.groupby=hee((null!==(t=this.transform.groupby)&&void 0!==t?t:[]).concat(e),e=>e)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return`PivotTransform ${oee(this.transform)}`}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:r}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==i?{limit:i}:{}),void 0!==r?{op:r}:{}),void 0!==n?{groupby:n}:{})}}class Jfe extends Uue{constructor(e,t){super(e),this.transform=t}clone(){return new Jfe(null,nee(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${oee(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function eme(e){let t=0;return function n(i,r){var s;if(i instanceof bpe&&!i.isGenerator&&!Ple(i.data)){e.push(r);r={name:null,source:r.name,transform:[]}}if(i instanceof Dpe&&(i.parent instanceof bpe&&!r.source?(r.format=Object.assign(Object.assign({},null!==(s=r.format)&&void 0!==s?s:{}),{parse:i.assembleFormatParse()}),r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Mpe){r.name||(r.name="data_"+t++),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source;for(const t of i.assemble())e.push(t)}else{if((i instanceof xpe||i instanceof Epe||i instanceof zfe||i instanceof the||i instanceof The||i instanceof Hfe||i instanceof Gfe||i instanceof Ope||i instanceof qfe||i instanceof Bpe||i instanceof Lpe||i instanceof Yfe||i instanceof jfe||i instanceof Vfe||i instanceof Xfe||i instanceof Kfe||i instanceof Zfe||i instanceof Fpe||i instanceof Jfe||i instanceof Qfe)&&r.transform.push(i.assemble()),(i instanceof vpe||i instanceof zue||i instanceof Wfe||i instanceof Ppe)&&r.transform.push(...i.assemble()),i instanceof Vue)if(r.source&&0===r.transform.length)i.setSource(r.source);else if(i.parent instanceof Vue)i.setSource(r.name);else if(r.name||(r.name="data_"+t++),i.setSource(r.name),1===i.numChildren()){e.push(r);r={name:null,source:r.name,transform:[]}}switch(i.numChildren()){case 0:i instanceof Vue&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name="data_"+t++);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const e of i.children){n(e,{name:null,source:s,transform:[]})}break}}}}}function tme(e){return"top"===e||"left"===e||hre(e)?"header":"footer"}function nme(e,t){var n;const{facet:i,config:r,child:s,component:o}=e;if(e.channelHasField(t)){const a=i[t],l=whe("title",null,r,t);let u=xoe(a,r,{allowDisabling:!0,includeDefault:void 0===l||!!l});s.component.layoutHeaders[t].title&&(u=O7(u)?u.join(", "):u,u+=" / "+s.component.layoutHeaders[t].title,s.component.layoutHeaders[t].title=null);const c=whe("labelOrient",a,r,t),d=kee((null!==(n=a.header)&&void 0!==n?n:{}).labels,r.header.labels,!0),h=lee(["bottom","right"],c)?"footer":"header";o.layoutHeaders[t]={title:u,facetFieldDef:a,[h]:"facet"===t?[]:[ime(e,t,d)]}}}function ime(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function rme(e,t){var n;const{child:i}=e;if(i.component.axes[t]){const{layoutHeaders:r,resolve:s}=e.component;if(s.axis[t]=Ghe(s,t),"shared"===s.axis[t]){const s="x"===t?"column":"row",o=r[s];for(const r of i.component.axes[t]){const t=tme(r.get("orient"));o[t]=null!==(n=o[t])&&void 0!==n?n:[ime(e,s,!1)];const i=ohe(r,"main",e.config,{header:!0});i&&o[t][0].axes.push(i),r.mainExtracted=!0}}}}function sme(e){ome(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";ame(e,t),ame(e,n)}function ome(e){for(const t of e.children)t.parseLayoutSize()}function ame(e,t){const n=zhe(t),i=Xne(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const t of e.children){const e=t.component.layoutSize.getWithExplicit(n),s=r.scale[i];if("independent"===s&&"step"===e.value){o=void 0;break}if(o){if("independent"===s&&o.value!==e.value){o=void 0;break}o=Fle(o,e,n,"")}else o=e}if(o){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function lme(e,t){const n="width"===t?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const e=r.get("type"),n=r.get("range");if(ose(e)){const e=Yae(i.view,t);return pre(n)||$ae(e)?"step":e}return zae(i.view,t)}if(e.hasProjection||"arc"===e.mark)return zae(i.view,t);{const e=Yae(i.view,t);return $ae(e)?e.step:e}}function ume(e,t,n){return goe(t,Object.assign({suffix:`by_${goe(e)}`},null!=n?n:{}))}class cme extends Ufe{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),this.child=Pme(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet,i)}initFacet(e,t){return Xse(e)?iae(e,(e,n,i)=>lee([Ete,wte],i)?void 0===n.field?(qie(Nie(n,i)),e):(e[i]=Coe(n,i,t),e):(qie(Die(i,"facet")),e),{}):{facet:Coe(e,"facet",t)}}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=pme(this),this.child.parseData()}parseLayoutSize(){ome(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of cne)nme(e,t);rme(e,"x"),rme(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){var e,t,n;const i={};for(const r of cne)for(const s of She){const o=this.component.layoutHeaders[r],a=o[s],{facetFieldDef:l}=o;if(l){const t=whe("titleOrient",l,this.config,r);if(lee(["right","bottom"],t)){const n=Ehe(r,t);i.titleAnchor=null!==(e=i.titleAnchor)&&void 0!==e?e:{},i.titleAnchor[n]="end"}}if(null==a?void 0:a[0]){const e="row"===r?"height":"width",a="header"===s?"headerBand":"footerBand";"facet"===r||this.child.component.layoutSize.get(e)||(i[a]=null!==(t=i[a])&&void 0!==t?t:{},i[a][r]=.5),o.title&&(i.offset=null!==(n=i.offset)&&void 0!==n?n:{},i.offset["row"===r?"rowTitle":"columnTitle"]=10)}}return i}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),Object.assign(Object.assign(Object.assign({},this.getHeaderLayoutMixins()),n?{columns:n}:{}),{bounds:"full",align:i})}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof cme)){return{signal:`length(data('${this.getName("column_domain")}'))`}}}assembleGroup(e){return this.parent&&this.parent instanceof cme?Object.assign(Object.assign({},this.channelHasField("column")?{encode:{update:{columns:{field:goe(this.facet.column,{prefix:"distinct"})}}}}:{}),super.assembleGroup(e)):super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof cme){if(this.child.channelHasField("column")){const i=goe(this.child.facet.column);e.push(i),t.push("distinct"),n.push(`distinct_${i}`)}}else for(const i of Yne){const r=this.child.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(ose(s)&&pre(o)){const r=ffe(mfe(this.child,i));r?(e.push(r),t.push("distinct"),n.push(`distinct_${r}`)):qie(`Unknown field for ${i}. Cannot calculate view size.`)}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:t}=this.component.data.facetRoot,{row:n,column:i}=this.facet,{fields:r,ops:s,as:o}=this.getCardinalityAggregateForChild(),a=[];for(const e of cne){const t=this.facet[e];if(t){a.push(goe(t));const{bin:l,sort:u}=t;if(fie(l)&&a.push(goe(t,{binSuffix:"end"})),Hse(u)){const{field:e,op:a=zse}=u,l=ume(t,u);n&&i?(r.push(l),s.push("max"),o.push(l)):(r.push(e),s.push(a),o.push(l))}else if(O7(u)){const n=xhe(t,e);r.push(n),s.push("max"),o.push(n)}}}const l=!!n&&!!i;return Object.assign({name:e,data:t,groupby:a},l||r.length>0?{aggregate:Object.assign(Object.assign({},l?{cross:l}:{}),r.length?{fields:r,ops:s,as:o}:{})}:{})}facetSortFields(e){const{facet:t}=this,n=t[e];return n?Hse(n.sort)?[ume(n,n.sort,{expr:"datum"})]:O7(n.sort)?[xhe(n,e,{expr:"datum"})]:[goe(n,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:t}=this,n=t[e];if(n){const{sort:e}=n;return[(Hse(e)?e.order:!O7(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return Nhe(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const i of Ahe)if(e[i]){const r=whe("labelOrient",e[i],t,i);if(lee(n[i],r))return Nhe(e[i],i,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=eme(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),r=e.assembleGroupStyle(),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:this.getName("cell"),type:"group"},i?{title:i}:{}),r?{style:r}:{}),{from:{facet:this.assembleFacet()},sort:{field:cne.map(e=>this.facetSortFields(e)).flat(),order:cne.map(e=>this.facetSortOrder(e)).flat()}}),t.length>0?{data:t}:{}),n?{encode:{update:n}}:{}),e.assembleGroup(function(e,t){if(e.component.selection&&_ee(e.component.selection).length){const n=V7(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:f7("mousemove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return fce(t)}(this,[])));return[s]}getMapping(){return this.facet}}function dme(e,t){var n,i,r,s,o,a,l,u,c,d;for(const h of t){const t=h.data;if((!e.name||!h.hasName()||e.name===h.dataName)&&!((null===(n=e.format)||void 0===n?void 0:n.mesh)&&(null===(i=t.format)||void 0===i?void 0:i.feature)||((null===(r=e.format)||void 0===r?void 0:r.feature)||(null===(s=t.format)||void 0===s?void 0:s.feature))&&(null===(o=e.format)||void 0===o?void 0:o.feature)!==(null===(a=t.format)||void 0===a?void 0:a.feature)||((null===(l=e.format)||void 0===l?void 0:l.mesh)||(null===(u=t.format)||void 0===u?void 0:u.mesh))&&(null===(c=e.format)||void 0===c?void 0:c.mesh)!==(null===(d=t.format)||void 0===d?void 0:d.mesh)))if(Ble(e)&&Ble(t)){if(tee(e.values,t.values))return h}else if(Ple(e)&&Ple(t)){if(e.url===t.url)return h}else if($le(e)&&e.name===h.dataName)return h}return null}function hme(e,t){if(e.data||!e.parent){if(null===e.data){const e=new bpe({values:[]});return t.push(e),e}const n=dme(e.data,t);if(n)return Ule(e.data)||(n.data.format=function(e,...t){for(const n of t)dee(e,null!=n?n:{});return e}({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new bpe(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function pme(e){var t,n,i,r,s,o,a,l,u,c;let d=hme(e,e.component.data.sources);const{outputNodes:h,outputNodeRefCounts:p}=e.component.data,f=e.parent?e.parent.component.data.ancestorParse.clone():new Lle,m=e.data;Ule(m)?(Vle(m)?d=new Epe(d,m.sequence):jle(m)&&(d=new xpe(d,m.graticule)),f.parseNothing=!0):null===(null===(t=null==m?void 0:m.format)||void 0===t?void 0:t.parse)&&(f.parseNothing=!0),d=null!==(n=Dpe.makeExplicit(d,e,f))&&void 0!==n?n:d,d=new Fpe(d);const g=e.parent&&Bfe(e.parent);(Ffe(e)||Lfe(e))&&g&&(d=null!==(i=vpe.makeFromEncoding(d,e))&&void 0!==i?i:d),e.transforms.length>0&&(d=function(e,t,n){var i,r;let s=0;for(const o of t.transforms){let a,l;if(iue(o))l=e=new The(e,o),a="derived";else if(Hle(o)){const r=Rpe(o);l=e=null!==(i=Dpe.makeWithAncestors(e,{},r,n))&&void 0!==i?i:e,e=new the(e,t,o.filter)}else if(rue(o))l=e=vpe.makeFromTransform(e,o,t),a="number";else if(oue(o))a="date",void 0===n.getWithExplicit(o.field).value&&(e=new Dpe(e,{[o.field]:a}),n.set(o.field,a,!1)),l=e=zue.makeFromTransform(e,o);else if(aue(o))l=e=Ope.makeFromTransform(e,o),a="number",Oce(t)&&(e=new Fpe(e));else if(Wle(o))l=e=qfe.make(e,t,o,s++),a="derived";else if(eue(o))l=e=new Bpe(e,o),a="number";else if(tue(o))l=e=new Lpe(e,o),a="number";else if(lue(o))l=e=Ppe.makeFromTransform(e,o),a="derived";else if(uue(o))l=e=new Yfe(e,o),a="derived";else if(nue(o))l=e=new jfe(e,o),a="derived";else if(Xle(o))l=e=new Qfe(e,o),a="derived";else if(Jle(o))e=new Jfe(e,o);else if(sue(o))l=e=Wfe.makeFromTransform(e,o),a="derived";else if(qle(o))l=e=new Vfe(e,o),a="derived";else if(Kle(o))l=e=new Kfe(e,o),a="derived";else if(Zle(o))l=e=new Zfe(e,o),a="derived";else{if(!Qle(o)){qie(Oie(o));continue}l=e=new Xfe(e,o),a="derived"}if(l&&void 0!==a)for(const e of null!==(r=l.producedFields())&&void 0!==r?r:[])n.set(e,a,!1)}return e}(d,e,f));const _=function(e){const t={};if(Ffe(e)&&e.component.selection)for(const n of _ee(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&Mee(e.field)>1&&(t[e.field]="flatten")}return t}(e),y=Npe(e);d=null!==(r=Dpe.makeWithAncestors(d,{},Object.assign(Object.assign({},_),y),f))&&void 0!==r?r:d,Ffe(e)&&(d=Gfe.parseAll(d,e),d=Hfe.parseAll(d,e)),(Ffe(e)||Lfe(e))&&(g||(d=null!==(s=vpe.makeFromEncoding(d,e))&&void 0!==s?s:d),d=null!==(o=zue.makeFromEncoding(d,e))&&void 0!==o?o:d,d=The.parseAllForSortIndex(d,e));const v=e.getName(Gle),b=new Vue(d,v,Gle,p);if(h[v]=b,d=b,Ffe(e)){const t=Ope.makeFromEncoding(d,e);t&&(d=t,Oce(e)&&(d=new Fpe(d))),d=null!==(a=Wfe.makeFromEncoding(d,e))&&void 0!==a?a:d,d=null!==(l=Ppe.makeFromEncoding(d,e))&&void 0!==l?l:d}Ffe(e)&&(d=null!==(u=zfe.make(d,e))&&void 0!==u?u:d);const T=e.getName(Yle),x=new Vue(d,T,Yle,p);h[T]=x,d=x,Ffe(e)&&function(e,t){Sce(e,n=>{const i=n.name,r=e.getName(`lookup_${i}`);e.component.data.outputNodes[r]=n.materialized=new Vue(new the(t,e,{selection:i}),r,"lookup",e.component.data.outputNodeRefCounts)})}(e,x);let E=null;if(Lfe(e)){const t=e.getName("facet");d=null!==(c=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const r of[n,i])if(Hse(r.sort)){const{field:n,op:i=zse}=r.sort;e=t=new Lpe(e,{joinaggregate:[{op:i,field:n,as:ume(r,r.sort,{forAs:!0})}],groupby:[goe(r)]})}return t}return null}(d,e.facet))&&void 0!==c?c:d,E=new Mpe(d,e,t,x.getSource()),h[t]=E}return Object.assign(Object.assign({},e.component.data),{outputNodes:h,outputNodeRefCounts:p,raw:b,main:x,facetRoot:E,ancestorParse:f})}class fme extends $fe{constructor(e,t,n,i){var r,s,o,a;super(e,"concat",t,n,i,e.resolve),"shared"!==(null===(s=null===(r=e.resolve)||void 0===r?void 0:r.axis)||void 0===s?void 0:s.x)&&"shared"!==(null===(a=null===(o=e.resolve)||void 0===o?void 0:o.axis)||void 0===a?void 0:a.y)||qie("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map((e,t)=>Pme(e,this,this.getName("concat_"+t),void 0,i))}parseData(){this.component.data=pme(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of _ee(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return Pae(e)?e.vconcat:Bae(e)?e.hconcat:e.concat}parseLayoutSize(){sme(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=Bhe(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),i?{encode:{update:i}}:{}),e.assembleGroup())})}assembleDefaultLayout(){const e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}const mme=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},$ee),{labelExpr:1,encode:1}),gme=_ee(mme);class _me extends Mle{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new _me(nee(this.explicit),nee(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!(!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return hre(this.explicit.orient)}}const yme={bottom:"top",top:"bottom",left:"right",right:"left"};function vme(e,t){if(!e)return t.map(e=>e.clone());{if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const n=e[i],r=t[i];if(!!n!=!!r)return;if(n&&r){const t=n.getWithExplicit("orient"),s=r.getWithExplicit("orient");if(t.explicit&&s.explicit&&t.value!==s.value)return;e[i]=bme(n,r)}}}return e}function bme(e,t){for(const n of gme){const i=Fle(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(e,t)=>{switch(n){case"title":return Koe(e,t);case"gridScale":return{explicit:e.explicit,value:kee(e.value,t.value)}}return Dle(e,t,n,"axis")});e.setWithExplicit(n,i)}return e}function Tme(e,t,n,i,r){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(hre(n.labelAngle)?n.labelAngle:Nee(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===bhe(i,r))return!0}return e===n[t]}const xme=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Eme(e,t){var n,i,r;let s=t.axis(e);const o=new _me,a=Soe(t.encoding[e]),{mark:l,config:u}=t,c=(null==s?void 0:s.orient)||(null===(n=u["x"===e?"axisX":"axisY"])||void 0===n?void 0:n.orient)||(null===(i=u.axis)||void 0===i?void 0:i.orient)||function(e){return"x"===e?"bottom":"left"}(e),d=t.getScaleComponent(e).get("type"),h=phe(e,d,c,t.config),p=void 0!==s?!s:mhe("disable",u,null==s?void 0:s.style,h).configValue;if(o.set("disable",p,void 0!==s),p)return o;s=s||{};const f=function(e,t,n,i,r){const s=null==t?void 0:t.labelAngle;if(void 0!==s)return hre(s)?s:Nee(s);{const{configValue:s}=mhe("labelAngle",e.config,null==t?void 0:t.style,r);return void 0!==s?Nee(s):n===Ate&&lee([Dre,Rre],i.type)?270:void 0}}(t,s,e,a,h),m={fieldOrDatumDef:a,axis:s,channel:e,model:t,scaleType:d,orient:c,labelAngle:f,mark:l,config:u};for(const n of gme){const i=n in ghe?ghe[n](m):Vee(n)?s[n]:void 0,r=void 0!==i,a=Tme(i,n,s,t,e);if(r&&a)o.set(n,i,a);else{const{configValue:e,configFrom:l}=Vee(n)&&"values"!==n?mhe(n,t.config,s.style,h):{},u=void 0!==e;r&&!u?o.set(n,i,a):("vgAxisConfig"!==l||xme.has(n)&&u||Lee(e)||hre(e))&&o.set(n,e,!1)}}const g=null!==(r=s.encoding)&&void 0!==r?r:{},_=Pee.reduce((n,i)=>{var r;if(!o.hasAxisPart(i))return n;const s=jhe(null!==(r=g[i])&&void 0!==r?r:{},t),a="labels"===i?function(e,t,n){var i;const{encoding:r,config:s}=e,o=null!==(i=Soe(r[t]))&&void 0!==i?i:Soe(r[Sne(t)]),a=e.axis(t)||{},{format:l,formatType:u}=a;return kse(u)?Object.assign({text:Fse({fieldOrDatumDef:o,field:"datum.value",format:l,formatType:u,config:s})},n):n}(t,e,s):s;return void 0===a||gee(a)||(n[i]={update:a}),n},{});return gee(_)||o.set("encode",_,!!s.encoding||void 0!==s.labelAngle),o}function wme(e,t,n,{graticule:i}){const r=ote(e)?Object.assign({},e):{type:e},s=joe("orient",r,n);if(r.orient=function(e,t,n){switch(e){case Xee:case ete:case tte:case Zee:case qee:case Hee:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case Gee:if(roe(i)&&(mie(i.bin)||roe(r)&&r.aggregate&&!i.aggregate))return"vertical";if(roe(r)&&(mie(r.bin)||roe(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s&&(roe(i)&&i.type===kre&&!fie(i.bin)||loe(i)))return"horizontal";if(!o&&(roe(r)&&r.type===kre&&!fie(r.bin)||loe(r)))return"vertical"}case Kee:if(s&&(!roe(i)||!mie(i.bin))&&o&&(!roe(r)||!mie(r.bin)))return;case Yee:if(o)return roe(r)&&mie(r.bin)?"horizontal":"vertical";if(s)return roe(i)&&mie(i.bin)?"vertical":"horizontal";if(e===Kee){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Wee:case Qee:{const t=aoe(i),s=aoe(r);if(t&&!s)return"tick"!==e?"horizontal":"vertical";if(!t&&s)return"tick"!==e?"vertical":"horizontal";if(t&&s){const t=i,s=r,o=t.type===Nre,a=s.type===Nre;return o&&!a?"tick"!==e?"vertical":"horizontal":!o&&a?"tick"!==e?"horizontal":"vertical":!t.aggregate&&s.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!s.aggregate?"tick"!==e?"horizontal":"vertical":n||"vertical"}return n||void 0}}return"vertical"}(r.type,t,s),void 0!==s&&s!==r.orient&&qie(`Specified orient "${r.orient}" overridden with "${s}".`),"bar"===r.type&&r.orient){const e=joe("cornerRadiusEnd",r,n);if(void 0!==e){const n="horizontal"===r.orient&&t.x2||"vertical"===r.orient&&t.y2?["cornerRadius"]:ute[r.orient];for(const t of n)r[t]=e;void 0!==r.cornerRadiusEnd&&delete r.cornerRadiusEnd}}void 0===joe("opacity",r,n)&&(r.opacity=function(e,t){if(lee([Xee,Qee,ete,tte],e)&&!Qoe(t))return.7;return}(r.type,t));void 0===r.filled&&(r.filled=!i&&function(e,t){const n=Yoe("filled",e,t),i=e.type;return kee(n,i!==Xee&&i!==Wee&&i!==Kee)}(r,n));return void 0===joe("cursor",r,n)&&(r.cursor=function(e,t,n){if(t.href||e.href||joe("href",e,n))return"pointer";return e.cursor}(r,t,n)),r}function Ime(e,t){const{config:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),bue("x",e,{defaultPos:"mid"})),bue("y",e,{defaultPos:"mid"})),_ue("size",e)),_ue("angle",e)),function(e,t,n){if(n)return{shape:{value:n}};return _ue("shape",e)}(e,0,t))}const Ame={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Iue("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n})),Iue("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n})),_ue("size",e,{vgChannel:"strokeWidth"})):{}}},Sme={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),bue("x",e,{defaultPos:"mid"})),bue("y",e,{defaultPos:"mid"})),due(e)),_ue("size",e,{vgChannel:"fontSize"})),_ue("angle",e)),Lue("align",function(e,t,n){const i=joe("align",e,n);if(void 0===i)return"center";return}(e.markDef,0,t))),Lue("baseline",function(e,t,n){const i=joe("baseline",e,n);if(void 0===i)return"middle";return}(e.markDef,0,t))),bue("radius",e,{defaultPos:null,isMidPoint:!0})),bue("theta",e,{defaultPos:null,isMidPoint:!0}))}};const Cme={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r="horizontal"===i?"width":"height",s="horizontal"===i?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),bue("x",e,{defaultPos:"mid",vgChannel:"xc"})),bue("y",e,{defaultPos:"mid",vgChannel:"yc"})),_ue("size",e,{defaultValue:Ome(e),vgChannel:r})),{[s]:$oe(joe("thickness",n,t))})}};function Ome(e){var t;const{config:n,markDef:i}=e,{orient:r}=i,s="horizontal"===r?"width":"height",o=e.getScaleComponent("horizontal"===r?"x":"y"),a=null!==(t=joe("size",i,n,{vgChannel:s}))&&void 0!==t?t:n.tick.bandSize;if(void 0!==a)return a;{const e=o?o.get("range"):void 0;if(e&&pre(e)&&$7(e.step))return 3*e.step/4;return 3*jae(n.view,s)/4}}const Mme={arc:{vgMark:"arc",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),bue("x",e,{defaultPos:"mid"})),bue("y",e,{defaultPos:"mid"})),Cue(e,"radius","arc")),Cue(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),Iue("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),Iue("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),Fue(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Cue(e,"x","bar")),Cue(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>Ime(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},n&&roe(n)&&n.type===Fre?{field:goe(n,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),Cue(e,"x","image")),Cue(e,"y","image")),due(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),bue("x",e,{defaultPos:"mid"})),bue("y",e,{defaultPos:"mid"})),_ue("size",e,{vgChannel:"strokeWidth"})),Fue(e))},point:{vgMark:"symbol",encodeEntry:e=>Ime(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),Cue(e,"x","rect")),Cue(e,"y","rect"))},rule:Ame,square:{vgMark:"symbol",encodeEntry:e=>Ime(e,"square")},text:Sme,tick:Cme,trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Nue(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),bue("x",e,{defaultPos:"mid"})),bue("y",e,{defaultPos:"mid"})),_ue("size",e)),Fue(e))}};function kme(e){return lee([Wee,Yee,Jee],e.mark)?function(e){const t=rae(e.mark,e.encoding),n=Dme(e,{fromPrefix:t.length>0?Rme:""});return t.length>0?[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Rme+e.requestDataName(Yle),data:e.requestDataName(Yle),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:n}]:n}(e):lee([Gee],e.mark)?function(e){const t=_re.some(t=>joe(t,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t){const[t]=Dme(e,{fromPrefix:Nme}),n=e.scaleName(e.stack.fieldChannel),i=(t={})=>e.vgField(e.stack.fieldChannel,t),r=(e,t)=>`${e}(${[i({prefix:"min",suffix:"start",expr:t}),i({prefix:"max",suffix:"start",expr:t}),i({prefix:"min",suffix:"end",expr:t}),i({prefix:"max",suffix:"end",expr:t})].map(e=>`scale('${n}',${e})`).join(",")})`;let s,o;"x"===e.stack.fieldChannel?(s=Object.assign(Object.assign({},iee(t.encode.update,["y","yc","y2","height",..._re])),{x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}}),o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update=Object.assign(Object.assign({},ree(t.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(s=Object.assign(Object.assign({},iee(t.encode.update,["x","xc","x2","width"])),{y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}}),o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update=Object.assign(Object.assign({},ree(t.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const n of _re){const i=Yoe(n,e.markDef,e.config);t.encode.update[n]?(s[n]=t.encode.update[n],delete t.encode.update[n]):i&&(s[n]=$oe(i)),i&&(t.encode.update[n]={value:0})}const a=e.fieldDef(e.stack.groupbyChannel),l=goe(a)?[goe(a)]:[];((null==a?void 0:a.bin)||(null==a?void 0:a.timeUnit))&&l.push(goe(a,{binSuffix:"end"}));return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((n,i)=>{if(t.encode.update[i])return Object.assign(Object.assign({},n),{[i]:t.encode.update[i]});{const t=Yoe(i,e.markDef,e.config);return void 0!==t?Object.assign(Object.assign({},n),{[i]:$oe(t)}):n}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Yle),name:Nme+e.requestDataName(Yle),groupby:l,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}return Dme(e)}(e):Dme(e)}const Rme="faceted_path_";const Nme="stack_group_";function Dme(e,t={fromPrefix:""}){const{mark:n,markDef:i,config:r}=e,s=kee(i.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),o=zoe(i),a=e.encoding.key,l=function(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!O7(o)&&doe(o)&&aee(o.value)||!o&&aee(joe("order",r,s)))){if((O7(o)||roe(o))&&!n)return Woe(o,{expr:"datum"});if(ite(i)){const n="horizontal"===r.orient?"y":"x",i=t[n];if(roe(i)){const t=i.sort;return O7(t)?{field:goe(i,{prefix:n,suffix:"sort_index",expr:"datum"})}:Hse(t)?{field:goe({aggregate:Qoe(e.encoding)?t.op:void 0,field:t.field},{expr:"datum"})}:Gse(t)?{field:goe(e.fieldDef(t.encoding),{expr:"datum"}),order:t.order}:null===t?void 0:{field:goe(i,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}}return}}}(e),u=function(e){if(!e.component.selection)return null;const t=_ee(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=_ee(i.component.selection).length,i=i.parent;return n?{interactive:t>0}:null}(e),c=joe("aria",i,r),d=Mme[n].postEncodingTransform?Mme[n].postEncodingTransform(e):null;return[Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:e.getName("marks"),type:Mme[n].vgMark},s?{clip:!0}:{}),o?{style:o}:{}),a?{key:a.field}:{}),l?{sort:l}:{}),u||{}),!1===c?{aria:c}:{}),{from:{data:t.fromPrefix+e.requestDataName(Yle)},encode:{update:Mme[n].encodeEntry(e)}}),d?{transform:d}:{})]}class Fme extends Ufe{constructor(e,t,n,i={},r){var s,o;super(e,"unit",t,n,r,void 0,Uae(e)?e.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection={},this.children=[];const a=ote(e.mark)?e.mark.type:e.mark;this.markDef=wme(e.mark,null!==(s=e.encoding)&&void 0!==s?s:{},r,{graticule:e.data&&jle(e.data)});const l=this.encoding=eae(null!==(o=e.encoding)&&void 0!==o?o:{},this.markDef,r);this.size=function({encoding:e,size:t}){for(const n of Yne){const i=Cne(n);$ae(t[i])&&aoe(e[n])&&(delete t[i],qie(Vie(i)))}return t}({encoding:l,size:Uae(e)?Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{}):i}),this.stack=lle(a,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegend(l),this.specifiedProjection=e.projection,this.selection=e.selection}get hasProjection(){const{encoding:e}=this,t=this.mark===nte,n=e&&one.some(t=>uoe(e[t]));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return oie.reduce((e,n)=>{var i;const r=Soe(t[n]);return r&&(e[n]=null!==(i=r.scale)&&void 0!==i?i:{}),e},{})}initAxes(e){return Yne.reduce((t,n)=>{const i=e[n];if(uoe(i)||n===Ate&&uoe(e.x2)||n===Ste&&uoe(e.y2)){const e=uoe(i)?i.axis:void 0;t[n]=e?Object.assign({},e):e}return t},{})}initLegend(e){return rie.reduce((t,n)=>{const i=Soe(e[n]);if(i&&function(e){switch(e){case Bte:case $te:case Ute:case zte:case Vte:case Yte:case Wte:case Xte:return!0;case Gte:case Hte:case jte:return!1}}(n)){const e=i.legend;t[n]=e?Object.assign({},e):e}return t},{})}parseData(){this.component.data=pme(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of Yne){const r=Cne(i);if(t[r]){const e=t[r];n.layoutSize.set(r,$ae(e)?"step":e,!0)}else{const t=lme(e,r);n.layoutSize.set(r,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,t){var n;const i={},r=e.config.selection;for(const s of _ee(null!=t?t:{})){const o=nee(t[s]),a=r[o.type],{fields:l,encodings:u}=a,c=j7(a,["fields","encodings"]);for(const e in c)"encodings"===e&&o.fields||"fields"===e&&o.encodings||("mark"===e&&(o[e]=Object.assign(Object.assign({},c[e]),o[e])),void 0!==o[e]&&!0!==o[e]||(o[e]=null!==(n=c[e])&&void 0!==n?n:o[e]));const d=Tee(s),h=i[d]=Object.assign(Object.assign({},o),{name:d,events:U7(o.on)?f7(o.on,"scope"):nee(o.on)});dce(h,n=>{n.has(h)&&n.parse&&n.parse(e,h,o,t[s])})}return i}(this,this.selection)}parseMarkGroup(){this.component.mark=kme(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,Yne.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[Eme(n,e)]),t),{}))}assembleSelectionTopLevelSignals(e){return function(e,t){let n=!1;if(Sce(e,(i,r)=>{const s=i.name,o=V7(s+xce),a=t.filter(e=>e.name===s);if(0===a.length){const e="global"===i.resolve?"union":i.resolve,n="multi"===i.type?", true)":")";t.push({name:i.name,update:`${Ice}(${o}, ${V7(e)}${n}`})}n=!0,r.topLevelSignals&&(t=r.topLevelSignals(e,i,t)),dce(i,n=>{n.topLevelSignals&&(t=n.topLevelSignals(e,i,t))})}),n){const e=t.filter(e=>"unit"===e.name);0===e.length&&t.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]})}return fce(t)}(this,e)}assembleSignals(){return[...ahe(this),...(e=this,t=[],Sce(e,(n,i)=>{const r=n.name;let s=i.modifyExpr(e,n);t.push(...i.signals(e,n)),dce(n,i=>{i.signals&&(t=i.signals(e,n,t)),i.modifyExpr&&(s=i.modifyExpr(e,n,s))}),t.push({name:r+wce,on:[{events:{signal:n.name+Ece},update:`modify(${V7(n.name+xce)}, ${s})`}]})}),fce(t))];var e,t}assembleSelectionData(e){return function(e,t){const n=[...t];return Sce(e,t=>{const i={name:t.name+xce};if(t.init){const n=t.project.items.map(e=>{const{signals:t}=e;return j7(e,["signals"])}),r=t.init.map(e=>hce(e,!1));i.values="interval"===t.type?[{unit:Cce(e,{escape:!1}),fields:n,values:r}]:r.map(t=>({unit:Cce(e,{escape:!1}),fields:n,values:t}))}n.filter(e=>e.name===t.name+xce).length||n.push(i)}),n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Bhe(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&Bfe(this.parent)||(t=pce(this,t)),t.map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return Zoe(this.encoding,e)}fieldDef(e){return Aoe(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return coe(t)?t:null}}class Lme extends $fe{constructor(e,t,n,i,r){super(e,"layer",t,n,r,e.resolve,e.view);const s=Object.assign(Object.assign(Object.assign({},i),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if(nle(e))return new Lme(e,this,this.getName("layer_"+t),s,r);if(hte(e))return new Fme(e,this,this.getName("layer_"+t),s,r);throw new Error(vie(e))})}parseData(){this.component.data=pme(this);for(const e of this.children)e.parseData()}parseLayoutSize(){var e;ome(e=this),ame(e,"width"),ame(e,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of _ee(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){var t;const{axes:n,resolve:i}=e.component,r={top:0,bottom:0,right:0,left:0};for(const t of e.children){t.parseAxesAndHeaders();for(const r of _ee(t.component.axes))i.axis[r]=Ghe(e.component.resolve,r),"shared"===i.axis[r]&&(n[r]=vme(n[r],t.component.axes[r]),n[r]||(i.axis[r]="independent",delete n[r]))}for(const s of Yne){for(const o of e.children)if(o.component.axes[s]){if("independent"===i.axis[s]){n[s]=(null!==(t=n[s])&&void 0!==t?t:[]).concat(o.component.axes[s]);for(const e of o.component.axes[s]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!hre(t)){if(r[t]>0&&!n){const n=yme[t];r[t]>r[n]&&e.set("orient",n,!1)}r[t]++}}}delete o.component.axes[s]}if("independent"===i.axis[s]&&n[s]&&n[s].length>1)for(const e of n[s])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),ahe(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),Bhe(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Ffe(n)&&(t=pce(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),cpe(this))}}function Pme(e,t,n,i,r){if(Kse(e))return new cme(e,t,n,r);if(nle(e))return new Lme(e,t,n,i,r);if(hte(e))return new Fme(e,t,n,i,r);if(function(e){return Pae(e)||Bae(e)||Lae(e)}(e))return new fme(e,t,n,r);throw new Error(vie(e))}function Bme(e,t={}){var n;t.logger&&(n=t.logger,Wie=n),t.fieldTitle&&Toe(t.fieldTitle);try{const n=Kae(R7(t.config,e.config)),i=Ile(e,n),r=Pme(i,null,"",void 0,n);r.parse(),function(e,t){Tpe(e.sources);let n=0,i=0;for(let i=0;i<Jpe&&ife(e,t);i++)n++;e.sources.map(Ype);for(let n=0;n<Jpe&&ife(e,t);n++)i++;Tpe(e.sources),Math.max(n,i)===Jpe&&qie(`Maximum optimization runs(${Jpe}) reached.`)}(r.component.data,r);const s=function(e,t,n={},i){const r=e.config?ele(e.config):void 0,s=[].concat(e.assembleSelectionData([]),function(e,t){var n,i;const r=[],s=eme(r);let o=0;for(const t of e.sources){t.hasName()||(t.dataName="source_"+o++);const e=t.assemble();s(t,e)}for(const e of r)0===e.transform.length&&delete e.transform;let a=0;for(const[e,t]of r.entries())0!==(null!==(n=t.transform)&&void 0!==n?n:[]).length||t.source||r.splice(a++,0,r.splice(e,1)[0]);for(const t of r)for(const n of null!==(i=t.transform)&&void 0!==i?i:[])"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource());for(const e of r)e.name in t&&(e.values=t[e.name]);return r}(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),u=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();return c=c.filter(e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)),Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),t),a?{title:a}:{}),l?{style:l}:{}),u?{encode:{update:u}}:{}),{data:s}),o.length>0?{projections:o}:{}),e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([])])),r?{config:r}:{}),i?{usermeta:i}:{})}(r,function(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");void 0===t?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):U7(t)&&(t={type:t});if(r&&s&&(o=t.type,"fit"===o||"fit-x"===o||"fit-y"===o))if("step"===r&&"step"===s)qie(Eie()),t.type="pad";else if("step"===r||"step"===s){const e="step"===r?"width":"height";qie(Eie(Xne(e)));const n="width"===e?"height":"width";t.type=function(e){return e?`fit-${Xne(e)}`:"fit"}(n)}var o;return Object.assign(Object.assign(Object.assign({},1===_ee(t).length&&t.type?"pad"===t.type?{}:{autosize:t.type}:{autosize:t}),Ole(n)),Ole(e))}(e,i.autosize,n,r),e.datasets,e.usermeta);return{spec:s,normalized:i}}finally{t.logger&&Xie(),t.fieldTitle&&Toe(voe)}}const $me=new class extends ile{mapUnit(e,{config:t}){if(e.encoding){const{encoding:n,transform:i}=e,{bins:r,timeUnits:s,aggregate:o,groupby:a,encoding:l}=Joe(n,t),u=[...i||[],...r,...s,...0===o.length?[]:[{aggregate:o,groupby:a}]];return Object.assign(Object.assign(Object.assign({},e),u.length>0?{transform:u}:{}),{encoding:l})}return e}};function Ume(e,t){return $me.map(e,{config:t})}const Vme="4.13.1";const zme=function(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}};var jme="2.15.0";const Yme="#fff",Gme="#888",Hme={background:"#333",view:{stroke:Gme},title:{color:Yme,subtitleColor:Yme},style:{"guide-label":{fill:Yme},"guide-title":{fill:Yme}},axis:{domainColor:Yme,gridColor:Gme,tickColor:Yme}},Wme="#4572a7",Xme={background:"#fff",arc:{fill:Wme},area:{fill:Wme},line:{stroke:Wme,strokeWidth:2},path:{stroke:Wme},rect:{fill:Wme},shape:{stroke:Wme},symbol:{fill:Wme,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},qme="#30a2da",Kme="#cbcbcb",Zme="#f0f0f0",Qme="#333",Jme={arc:{fill:qme},area:{fill:qme},axis:{domainColor:Kme,grid:!0,gridColor:Kme,gridWidth:1,labelColor:"#999",labelFontSize:10,titleColor:"#333",tickColor:Kme,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Zme,group:{fill:Zme},legend:{labelColor:Qme,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Qme,titleFontSize:14,titlePadding:10},line:{stroke:qme,strokeWidth:2},path:{stroke:qme,strokeWidth:.5},rect:{fill:qme},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:qme},bar:{binSpacing:2,fill:qme,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ege="#000",tge={group:{fill:"#e5e5e5"},arc:{fill:ege},area:{fill:ege},line:{stroke:ege},path:{stroke:ege},rect:{fill:ege},shape:{stroke:ege},symbol:{fill:ege,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},nge="Benton Gothic, sans-serif",ige="#82c6df",rge="Benton Gothic Bold, sans-serif",sge="normal",oge={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},age={background:"#ffffff",title:{anchor:"start",color:"#000000",font:rge,fontSize:22,fontWeight:"normal"},arc:{fill:ige},area:{fill:ige},line:{stroke:ige,strokeWidth:2},path:{stroke:ige},rect:{fill:ige},shape:{stroke:ige},symbol:{fill:ige,size:30},axis:{labelFont:nge,labelFontSize:11.5,labelFontWeight:"normal",titleFont:rge,titleFontSize:13,titleFontWeight:sge},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:nge,labelFontSize:11.5,symbolType:"square",titleFont:rge,titleFontSize:13,titleFontWeight:sge},range:{category:oge["category-6"],diverging:oge["fireandice-6"],heatmap:oge["fire-7"],ordinal:oge["fire-7"],ramp:oge["fire-7"]}},lge="#ab5787",uge="#979797",cge={background:"#f9f9f9",arc:{fill:lge},area:{fill:lge},line:{stroke:lge},path:{stroke:lge},rect:{fill:lge},shape:{stroke:lge},symbol:{fill:lge,size:30},axis:{domainColor:uge,domainWidth:.5,gridWidth:.2,labelColor:uge,tickColor:uge,tickWidth:.2,titleColor:uge},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},dge="#3e5c69",hge={background:"#fff",arc:{fill:dge},area:{fill:dge},line:{stroke:dge},path:{stroke:dge},rect:{fill:dge},shape:{stroke:dge},symbol:{fill:dge},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},pge="#1696d2",fge="#000000",mge="Lato",gge="Lato",_ge={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},yge={background:"#FFFFFF",title:{anchor:"start",fontSize:18,font:mge},axisX:{domain:!0,domainColor:fge,domainWidth:1,grid:!1,labelFontSize:12,labelFont:gge,labelAngle:0,tickColor:fge,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:mge},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:"#DEDDDD",gridWidth:1,labelFontSize:12,labelFont:gge,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:mge,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:gge,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:mge,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:_ge["six-groups-cat-1"],diverging:_ge["diverging-colors"],heatmap:_ge["diverging-colors"],ordinal:_ge["six-groups-seq"],ramp:_ge["shades-blue"]},area:{fill:pge},rect:{fill:pge},line:{color:pge,stroke:pge,strokeWidth:5},trail:{color:pge,stroke:pge,strokeWidth:0,size:1},path:{stroke:pge,strokeWidth:.5},point:{filled:!0},text:{font:"Lato",color:pge,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:pge,stroke:null}},arc:{fill:pge},shape:{stroke:pge},symbol:{fill:pge,size:30}},vge="#3366CC",bge="#ccc",Tge="Arial, sans-serif",xge={arc:{fill:vge},area:{fill:vge},path:{stroke:vge},rect:{fill:vge},shape:{stroke:vge},symbol:{stroke:vge},circle:{fill:vge},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Tge,fontSize:12},"guide-title":{font:Tge,fontSize:12},"group-title":{font:Tge,fontSize:12}},title:{font:Tge,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:bge,tickColor:bge,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Ege=e=>e*(1/3+1),wge=Ege(9),Ige=Ege(10),Age=Ege(12),Sge="Segoe UI",Cge="wf_standard-font, helvetica, arial, sans-serif",Oge="#252423",Mge="#605E5C",kge="transparent",Rge="#118DFF",Nge="#DEEFFF",Dge=[Nge,Rge],Fge={view:{stroke:kge},background:kge,font:Sge,header:{titleFont:Cge,titleFontSize:Age,titleColor:Oge,labelFont:Sge,labelFontSize:Ige,labelColor:Mge},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Mge,labelFontSize:wge,titleFont:Cge,titleColor:Oge,titleFontSize:Age,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:"#C8C6C4",gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Rge},line:{stroke:Rge,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Sge,fontSize:wge,fill:Mge},arc:{fill:Rge},area:{fill:Rge,line:!0,opacity:.6},path:{stroke:Rge},rect:{fill:Rge},point:{fill:Rge,filled:!0,size:75},shape:{stroke:Rge},symbol:{fill:Rge,strokeWidth:1.5,size:50},legend:{titleFont:Sge,titleFontWeight:"bold",titleColor:Mge,labelFont:Sge,labelFontSize:Ige,labelColor:Mge,symbolType:"circle",symbolSize:75},range:{category:[Rge,"#12239E","#E66C37","#6B007B","#E044A7","#744EC2","#D9B300","#D64550"],diverging:Dge,heatmap:Dge,ordinal:[Nge,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",Rge]}},Lge='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Pge={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Bge=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],$ge=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Uge({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=Pge.gridBg[e],r=Pge.textPrimary[e],s=Pge.textSecondary[e],o="dark"===n?Bge:$ge,a="dark"===n?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:Lge,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:'IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',labelFontWeight:400,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:Pge.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:Lge,fill:s,fontWeight:400},"guide-title":{font:Lge,fill:s,fontWeight:400}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Vge=Uge({theme:"white",background:"#ffffff"}),zge=Uge({theme:"g10",background:"#f4f4f4"}),jge=Uge({theme:"g90",background:"#262626"}),Yge=Uge({theme:"g100",background:"#161616"}),Gge=jme;var Hge="#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black; }\n #vg-tooltip-element.visible {\n visibility: visible; }\n #vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px; }\n #vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px; }\n #vg-tooltip-element table {\n border-spacing: 0; }\n #vg-tooltip-element table tr {\n border: none; }\n #vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px; }\n #vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px; }\n #vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left; }\n #vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white; }\n #vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf; }\n";const Wge="vg-tooltip-element",Xge={offsetX:10,offsetY:10,id:Wge,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")},maxDepth:2};function qge(e,t,n){if(Ee(e))return`[${e.map(e=>t(bt(e)?e:Kge(e,n))).join(", ")}]`;if(we(e)){let i="";const r=e,{title:s,image:o}=r,a=
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(r,["title","image"]);s&&(i+=`<h2>${t(s)}</h2>`),o&&(i+=`<img src="${t(o)}">`);const l=Object.keys(a);if(l.length>0){i+="<table>";for(const e of l){let r=a[e];void 0!==r&&(we(r)&&(r=Kge(r,n)),i+=`<tr><td class="key">${t(e)}:</td><td class="value">${t(r)}</td></tr>`)}i+="</table>"}return i||"{}"}return t(e)}function Kge(e,t){return JSON.stringify(e,function(e){const t=[];return function(n,i){if("object"!=typeof i||null===i)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}(t))}class Zge{constructor(e){this.options=Object.assign(Object.assign({},Xge),e);const t=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId),e.innerHTML=function(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return Hge.toString().replace(Wge,e)}(t);const n=document.head;n.childNodes.length>0?n.insertBefore(e,n.childNodes[0]):n.appendChild(e)}}tooltipHandler(e,t,n,i){this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),document.body.appendChild(this.el));if((null!=document.fullscreenElement?document.fullscreenElement:document.body).appendChild(this.el),null==i||""===i)return void this.el.classList.remove("visible",`${this.options.theme}-theme`);this.el.innerHTML=qge(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:r,y:s}=function(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let s=e.clientY+i;return s+t.height>window.innerHeight&&(s=+e.clientY-i-t.height),{x:r,y:s}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.setAttribute("style",`top: ${s}px; left: ${r}px`)}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function Qge(e,t,n,i){return new(n||(n=Promise))(function(r,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?r(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(o,a)}l((i=i.apply(e,t||[])).next())})}var Jge,e_e='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box; }\n .vega-embed.has-actions {\n padding-right: 38px; }\n .vega-embed details:not([open]) > :not(summary) {\n display: none !important; }\n .vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px; }\n .vega-embed summary::-webkit-details-marker {\n display: none; }\n .vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset; }\n .vega-embed summary svg {\n width: 14px;\n height: 14px; }\n .vega-embed details[open] summary {\n opacity: 0.7; }\n .vega-embed:hover summary,\n .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease; }\n .vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left; }\n .vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none; }\n .vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black; }\n .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute; }\n .vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9; }\n .vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff; }\n .vega-embed .chart-wrapper {\n width: 100%;\n height: 100%; }\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px; }\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6); }\n to {\n opacity: 1;\n transform: scale(1); } }\n';function t_e(e,...t){for(const n of t)n_e(e,n);return e}function n_e(e,t){for(const n of Object.keys(t))Se(e,n,t[n],!0)}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e});const i_e=v;let r_e=b;const s_e="undefined"!=typeof window?window:void 0;void 0===r_e&&(null===(Jge=null==s_e?void 0:s_e.vl)||void 0===Jge?void 0:Jge.compile)&&(r_e=s_e.vl);const o_e={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},a_e={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},l_e={vega:"Vega","vega-lite":"Vega-Lite"},u_e={vega:i_e.version,"vega-lite":r_e?r_e.version:"not available"},c_e={vega:e=>e,"vega-lite":(e,t)=>r_e.compile(e,{config:t}).spec},d_e='\n<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">\n <circle r="2" cy="8" cx="2"></circle>\n <circle r="2" cy="8" cx="8"></circle>\n <circle r="2" cy="8" cx="14"></circle>\n</svg>',h_e="chart-wrapper";function p_e(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,o=window.open("");o.document.write(r+e+s),o.document.title=`${l_e[i]} JSON Source`}function f_e(e,t){var n;if(e.$schema){const i=zme(e.$schema);t&&t!==i.library&&console.warn(`The given visualization spec is written in ${l_e[i.library]}, but mode argument sets ${null!==(n=l_e[t])&&void 0!==n?n:t}.`);const r=i.library;return(0,ee.satisfies)(u_e[r],`^${i.version.slice(1)}`)||console.warn(`The input spec uses ${l_e[r]} ${i.version}, but the current version of ${l_e[r]} is v${u_e[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":null!=t?t:"vega"}function m_e(e){return(t=e)&&"load"in t?e:i_e.loader(e);var t}function g_e(e){var t;return null!==(t=e.usermeta&&e.usermeta.embedOptions)&&void 0!==t?t:{}}function __e(e,t){var n;return Qge(this,void 0,void 0,function*(){const i=bt(e.config)?JSON.parse(yield t.load(e.config)):null!==(n=e.config)&&void 0!==n?n:{},r=bt(e.patch)?JSON.parse(yield t.load(e.patch)):e.patch;return Object.assign(Object.assign(Object.assign({},e),r?{patch:r}:{}),i?{config:i}:{})})}const y_e=function(e,t,n={}){var i,r,s;return Qge(this,void 0,void 0,function*(){let o,a;bt(t)?(a=m_e(n.loader),o=JSON.parse(yield a.load(t))):o=t;const l=g_e(o).loader;a&&!l||(a=m_e(null!==(i=n.loader)&&void 0!==i?i:l));const u=yield __e(g_e(o),a),c=yield __e(n,a),d=Object.assign(Object.assign({},t_e(c,u)),{config:Ae(null!==(r=c.config)&&void 0!==r?r:{},null!==(s=u.config)&&void 0!==s?s:{})});return yield function(e,t,n={},i){var r,s,o,a,l,u;return Qge(this,void 0,void 0,function*(){const c=n.theme?Ae(T[n.theme],null!==(r=n.config)&&void 0!==r?r:{}):n.config,d=mt(n.actions)?n.actions:t_e({},o_e,null!==(s=n.actions)&&void 0!==s?s:{}),h=Object.assign(Object.assign({},a_e),n.i18n),p=null!==(o=n.renderer)&&void 0!==o?o:"canvas",f=null!==(a=n.logLevel)&&void 0!==a?a:i_e.Warn,m=null!==(l=n.downloadFileName)&&void 0!==l?l:"visualization",g="string"==typeof e?document.querySelector(e):e;if(!g)throw new Error(`${e} does not exist`);if(!1!==n.defaultStyle){const e="vega-embed-style",{root:t,rootContainer:i}=function(e){var t;const n=e.getRootNode?e.getRootNode():document;return n instanceof ShadowRoot?{root:n,rootContainer:n}:{root:document,rootContainer:null!==(t=document.head)&&void 0!==t?t:document.body}}(g);if(!t.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerText=void 0===n.defaultStyle||!0===n.defaultStyle?e_e.toString():n.defaultStyle,i.appendChild(t)}}const _=f_e(t,n.mode);let y=c_e[_](t,c);if("vega-lite"===_&&y.$schema){const e=zme(y.$schema);(0,ee.satisfies)(u_e.vega,`^${e.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${e.version}, but current version is v${u_e.vega}.`)}g.classList.add("vega-embed"),d&&g.classList.add("has-actions"),g.innerHTML="";let v=g;if(d){const e=document.createElement("div");e.classList.add(h_e),g.appendChild(e),v=e}const b=n.patch;b&&(y=b instanceof Function?b(y):$(y,b,!0,!1).newDocument),n.formatLocale&&i_e.formatLocale(n.formatLocale),n.timeFormatLocale&&i_e.timeFormatLocale(n.timeFormatLocale);const{ast:x}=n,E=i_e.parse(y,"vega-lite"===_?{}:c,{ast:x}),w=new(n.viewClass||i_e.View)(E,Object.assign({loader:i,logLevel:f,renderer:p},x?{expr:i_e.expressionInterpreter}:{}));if(!1!==n.tooltip){let e;e=function(e){return"function"==typeof e}(n.tooltip)?n.tooltip:new Zge(!0===n.tooltip?{}:n.tooltip).call,w.tooltip(e)}let I,{hover:A}=n;if(void 0===A&&(A="vega"===_),A){const{hoverSet:e,updateSet:t}="boolean"==typeof A?{}:A;w.hover(e,t)}if(n&&(null!=n.width&&w.width(n.width),null!=n.height&&w.height(n.height),null!=n.padding&&w.padding(n.padding)),yield w.initialize(v,n.bind).runAsync(),!1!==d){let e=g;if(!1!==n.defaultStyle){const t=document.createElement("details");t.title=h.CLICK_TO_VIEW_ACTIONS,g.append(t),e=t;const n=document.createElement("summary");n.innerHTML=d_e,t.append(n),I=e=>{t.contains(e.target)||t.removeAttribute("open")},document.addEventListener("click",I)}const i=document.createElement("div");if(e.append(i),i.classList.add("vega-actions"),!0===d||!1!==d.export)for(const e of["svg","png"])if(!0===d||!0===d.export||d.export[e]){const t=h[`${e.toUpperCase()}_ACTION`],r=document.createElement("a");r.text=t,r.href="#",r.target="_blank",r.download=`${m}.${e}`,r.addEventListener("mousedown",function(t){return Qge(this,void 0,void 0,function*(){t.preventDefault();const i=yield w.toImageURL(e,n.scaleFactor);this.href=i})}),i.append(r)}if(!0===d||!1!==d.source){const e=document.createElement("a");e.text=h.SOURCE_ACTION,e.href="#",e.addEventListener("click",function(e){var i,r;p_e(J()(t),null!==(i=n.sourceHeader)&&void 0!==i?i:"",null!==(r=n.sourceFooter)&&void 0!==r?r:"",_),e.preventDefault()}),i.append(e)}if("vega-lite"===_&&(!0===d||!1!==d.compiled)){const e=document.createElement("a");e.text=h.COMPILED_ACTION,e.href="#",e.addEventListener("click",function(e){var t,i;p_e(J()(y),null!==(t=n.sourceHeader)&&void 0!==t?t:"",null!==(i=n.sourceFooter)&&void 0!==i?i:"","vega"),e.preventDefault()}),i.append(e)}if(!0===d||!1!==d.editor){const e=null!==(u=n.editorUrl)&&void 0!==u?u:"https://vega.github.io/editor/",r=document.createElement("a");r.text=h.EDITOR_ACTION,r.href="#",r.addEventListener("click",function(n){!function(e,t,n){const i=e.open(t),{origin:r}=new URL(t);let s=40;e.addEventListener("message",function t(n){n.source===i&&(s=0,e.removeEventListener("message",t,!1))},!1),setTimeout(function e(){s<=0||(i.postMessage(n,r),setTimeout(e,250),s-=1)},250)}(window,e,{config:c,mode:_,renderer:p,spec:J()(t)}),n.preventDefault()}),i.append(r)}}function S(){I&&document.removeEventListener("click",I),w.finalize()}return{view:w,spec:t,vgSpec:y,finalize:S}})}(e,o,d,a)})}},66262:(e,t)=>{"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n}},26944:e=>{"use strict";e.exports=path},85817:()=>{},18590:()=>{},4530:()=>{},8108:()=>{},80551:()=>{},67425:()=>{},9496:()=>{},26786:()=>{},48884:()=>{},98001:()=>{},71613:()=>{},15312:()=>{},89032:()=>{},60574:()=>{},2672:()=>{},58215:()=>{},1417:()=>{},49391:()=>{},83220:()=>{},73985:()=>{},80032:()=>{},75650:()=>{},56644:()=>{},41234:()=>{},48487:e=>{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function(e,n){var i,r,s;return n=n||{},i=JSON.stringify([1],void 0,void 0===n.indent?2:n.indent).slice(2,-3),r=""===i?1/0:void 0===n.maxLength?80:n.maxLength,s=n.replacer,function e(n,o,a){var l,u,c,d,h,p,f,m,g,_,y,v;if(n&&"function"==typeof n.toJSON&&(n=n.toJSON()),void 0===(y=JSON.stringify(n,s)))return y;if(f=r-o.length-a,y.length<=f&&(g=y.replace(t,function(e,t){return t||e+" "})).length<=f)return g;if(null!=s&&(n=JSON.parse(y),s=void 0),"object"==typeof n&&null!==n){if(m=o+i,c=[],u=0,Array.isArray(n))for(_="[",l="]",f=n.length;u<f;u++)c.push(e(n[u],m,u===f-1?0:1)||"null");else for(_="{",l="}",f=(p=Object.keys(n)).length;u<f;u++)d=p[u],h=JSON.stringify(d)+": ",void 0!==(v=e(n[d],m,h.length+(u===f-1?0:1)))&&c.push(h+v);if(c.length>0)return[_,i+c.join(",\n"+m),l].join("\n"+o)}return y}(e,"",0)}},21045:e=>{"use strict";e.exports={rE:"3.0.8"}}},__webpack_module_cache__={},leafPrototypes,getProto,inProgress,dataWebpackPrefix;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__.m=__webpack_modules__,__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},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var n=Object.create(null);__webpack_require__.r(n);var i={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&t&&e;"object"==typeof r&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,__webpack_require__.d(n,i),n},__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__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce((t,n)=>(__webpack_require__.f[n](e,t),t),[])),__webpack_require__.u=e=>e+".bundle."+{38:"56383ce7",97:"b0fed7fa",195:"9941f7ca",211:"45847679",317:"a52389ac",837:"3c99d169",950:"b01fc844",960:"d893bd17",974:"66119c82"}[e]+".js",__webpack_require__.miniCssF=e=>"styles/"+e+".45554be0.css",__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),inProgress={},dataWebpackPrefix="@mixly/python-pyodide:",__webpack_require__.l=(e,t,n,i)=>{if(inProgress[e])inProgress[e].push(t);else{var r,s;if(void 0!==n)for(var o=document.getElementsByTagName("script"),a=0;a<o.length;a++){var l=o[a];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==dataWebpackPrefix+n){r=l;break}}r||(s=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,__webpack_require__.nc&&r.setAttribute("nonce",__webpack_require__.nc),r.setAttribute("data-webpack",dataWebpackPrefix+n),r.src=e),inProgress[e]=[t];var u=(t,n)=>{r.onerror=r.onload=null,clearTimeout(c);var i=inProgress[e];if(delete inProgress[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach(e=>e(n)),t)return t(n)},c=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),s&&document.head.appendChild(r)}},__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),(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var t=__webpack_require__.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{if("undefined"!=typeof document){var e=e=>new Promise((t,n)=>{var i=__webpack_require__.miniCssF(e),r=__webpack_require__.p+i;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),i=0;i<n.length;i++){var r=(o=n[i]).getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(r===e||r===t))return o}var s=document.getElementsByTagName("style");for(i=0;i<s.length;i++){var o;if((r=(o=s[i]).getAttribute("data-href"))===e||r===t)return o}})(i,r))return t();((e,t,n,i,r)=>{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",__webpack_require__.nc&&(s.nonce=__webpack_require__.nc),s.onerror=s.onload=n=>{if(s.onerror=s.onload=null,"load"===n.type)i();else{var o=n&&n.type,a=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+o+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=o,l.request=a,s.parentNode&&s.parentNode.removeChild(s),r(l)}},s.href=t,n?n.parentNode.insertBefore(s,n.nextSibling):document.head.appendChild(s)})(e,r,null,t,n)}),t={792:0};__webpack_require__.f.miniCss=(n,i)=>{t[n]?i.push(t[n]):0!==t[n]&&{317:1}[n]&&i.push(t[n]=e(n).then(()=>{t[n]=0},e=>{throw delete t[n],e}))}}})(),(()=>{var e={792:0};__webpack_require__.f.j=(t,n)=>{var i=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var r=new Promise((n,r)=>i=e[t]=[n,r]);n.push(i[2]=r);var s=__webpack_require__.p+__webpack_require__.u(t),o=new Error;__webpack_require__.l(s,n=>{if(__webpack_require__.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var r=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+s+")",o.name="ChunkLoadError",o.type=r,o.request=s,i[1](o)}},"chunk-"+t,t)}};var t=(t,n)=>{var i,r,[s,o,a]=n,l=0;if(s.some(t=>0!==e[t])){for(i in o)__webpack_require__.o(o,i)&&(__webpack_require__.m[i]=o[i]);if(a)a(__webpack_require__)}for(t&&t(n);l<s.length;l++)r=s[l],__webpack_require__.o(e,r)&&e[r]&&e[r][0](),e[r]=0},n=self.webpackChunk_mixly_python_pyodide=self.webpackChunk_mixly_python_pyodide||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var __webpack_exports__={};(()=>{"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{controls_type:()=>Qe,controls_typeLists:()=>Je,lists_zip:()=>et,lists_zip_container:()=>tt,lists_zip_item:()=>nt,unpack_iterable_object:()=>it,variables_change:()=>Ke,variables_get:()=>Xe,variables_global:()=>Ze,variables_set:()=>qe});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{base_setup:()=>ot,controls_delay:()=>at,controls_end_program:()=>lt,controls_except:()=>Tt,controls_finally:()=>xt,controls_flow_statements:()=>ft,controls_for:()=>mt,controls_forEach:()=>dt,controls_for_range:()=>gt,controls_if:()=>ut,controls_if_else:()=>vt,controls_if_elseif:()=>yt,controls_if_if:()=>_t,controls_lambda:()=>wt,controls_main:()=>st,controls_pass:()=>It,controls_range:()=>ct,controls_repeat_ext:()=>Et,controls_thread:()=>At,controls_try:()=>bt,controls_try_finally:()=>pt,controls_whileUntil:()=>ht,datetime_fromtimestamp:()=>Rt,do_while:()=>St,garbage_collection:()=>Ct,gene_unique_identifier:()=>Nt,get_mem_alloc:()=>Ot,get_mem_free:()=>Mt,get_unique_identifier:()=>kt});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base_map:()=>en,generate_cartesian_product:()=>nn,math_arithmetic:()=>Bt,math_bit:()=>Ut,math_constant:()=>Lt,math_constant_mp:()=>Pt,math_constrain:()=>Wt,math_dec:()=>zt,math_degree_to_radian:()=>sn,math_indexer_number:()=>qt,math_map:()=>Xt,math_max_min:()=>Yt,math_number:()=>Ft,math_number_base_conversion:()=>Gt,math_radian_to_degree:()=>rn,math_random:()=>Ht,math_random_seed:()=>Kt,math_round:()=>Zt,math_selfcalcu:()=>$t,math_to_int:()=>jt,math_trig:()=>Vt,text_to_number:()=>Qt,text_to_number_skulpt:()=>Jt,turn_to_int:()=>tn});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{ascii_to_char:()=>hn,char_to_ascii:()=>pn,number_to_text:()=>fn,os_system:()=>$n,text:()=>an,text_bytes:()=>un,text_capital:()=>En,text_center:()=>wn,text_char:()=>cn,text_char_at:()=>_n,text_char_at2:()=>gn,text_char_at3:()=>Fn,text_compareTo:()=>Dn,text_compare_to:()=>xn,text_create_with_container:()=>kn,text_create_with_item:()=>Rn,text_encode:()=>Pn,text_equals_starts_ends:()=>Tn,text_eval:()=>Bn,text_find:()=>In,text_format:()=>Mn,text_format_noreturn:()=>Ln,text_join:()=>dn,text_join_seq:()=>An,text_length:()=>mn,text_random_char:()=>yn,text_replace:()=>Sn,text_split:()=>Cn,text_strip:()=>On,text_substring:()=>bn,text_substring2:()=>vn,text_substring3:()=>Nn,text_textarea:()=>ln});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{ENUMERATE:()=>Ti,content_in_lists:()=>Ei,enumerate:()=>xi,list_many_input:()=>li,list_tolist:()=>hi,list_tolist2:()=>bi,list_trig:()=>si,lists_2d_get_col_row_data:()=>Yn,lists_2d_get_data_with_col_row:()=>jn,lists_append_extend:()=>Kn,lists_change_to:()=>ai,lists_change_to_general:()=>ci,lists_clear:()=>ti,lists_create_with:()=>Gn,lists_create_with2:()=>pi,lists_create_with_container:()=>Wn,lists_create_with_item:()=>Xn,lists_create_with_noreturn:()=>ui,lists_create_with_text:()=>Hn,lists_create_with_text2:()=>fi,lists_del_general:()=>di,lists_find:()=>ri,lists_getIndex3:()=>mi,lists_getSublist3:()=>gi,lists_get_index:()=>Vn,lists_get_random_item:()=>Zn,lists_get_random_sublist:()=>Qn,lists_get_sublist:()=>zn,lists_insert_value:()=>Jn,lists_insert_value2:()=>yi,lists_pop:()=>ii,lists_remove_at:()=>ni,lists_remove_at2:()=>vi,lists_reverse:()=>ei,lists_setIndex3:()=>_i,lists_set_index:()=>qn,lists_sort:()=>oi});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{dicts_add_change_del:()=>$i,dicts_add_or_change:()=>ki,dicts_clear:()=>Di,dicts_create_with:()=>Ii,dicts_create_with_container:()=>Ai,dicts_create_with_item:()=>Si,dicts_create_with_noreturn:()=>zi,dicts_deldict:()=>Bi,dicts_delete:()=>Ri,dicts_get:()=>Oi,dicts_get_default:()=>Mi,dicts_items:()=>Fi,dicts_keys:()=>Ci,dicts_length:()=>Pi,dicts_pop:()=>Ui,dicts_setdefault:()=>Vi,dicts_to_json:()=>Yi,dicts_to_json2:()=>Wi,dicts_to_to:()=>Hi,dicts_todict:()=>ji,dicts_update:()=>Ni,dicts_values:()=>Li,json_to_dicts:()=>Gi});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{logic_boolean:()=>Ji,logic_compare:()=>qi,logic_compare_continous:()=>Ki,logic_is:()=>ir,logic_is_in:()=>nr,logic_negate:()=>Qi,logic_null:()=>er,logic_operation:()=>Zi,logic_tobool:()=>rr,logic_true_or_false:()=>tr});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{sdcard_mount:()=>Sr,sdcard_use_spi_init:()=>Ar,storage_can_write_ornot:()=>pr,storage_change_dir:()=>wr,storage_close_file:()=>mr,storage_delete_file:()=>_r,storage_file_seek:()=>br,storage_file_tell:()=>vr,storage_file_write:()=>ur,storage_fileopen:()=>or,storage_fileopen_new:()=>ar,storage_fileopen_new_encoding:()=>lr,storage_get_a_line:()=>hr,storage_get_contents:()=>dr,storage_get_contents_without_para:()=>cr,storage_get_current_dir:()=>Tr,storage_get_file_size:()=>yr,storage_get_filename:()=>fr,storage_is_file:()=>Ir,storage_list_all_files:()=>gr,storage_make_dir:()=>xr,storage_open_file_with_os:()=>sr,storage_rename:()=>Er});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{procedures_callnoreturn:()=>Rr,procedures_callreturn:()=>Nr,procedures_defnoreturn:()=>Cr,procedures_defreturn:()=>Or,procedures_ifreturn:()=>Dr,procedures_mutatorarg:()=>kr,procedures_mutatorcontainer:()=>Mr,procedures_return:()=>Fr});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{tuple_change_to:()=>Wr,tuple_create_llm_params:()=>ns,tuple_create_with:()=>Pr,tuple_create_with_container:()=>Br,tuple_create_with_item:()=>$r,tuple_create_with_noreturn:()=>Zr,tuple_create_with_text2:()=>Ur,tuple_create_with_text_return:()=>Vr,tuple_del:()=>Yr,tuple_find:()=>Xr,tuple_getIndex:()=>zr,tuple_getSublist:()=>Kr,tuple_get_random_item:()=>Jr,tuple_get_sublist:()=>Qr,tuple_input:()=>ts,tuple_join:()=>Gr,tuple_length:()=>jr,tuple_max:()=>Hr,tuple_totuple:()=>es,tuple_trig:()=>qr});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{set_add_discard:()=>hs,set_clear:()=>us,set_create_with:()=>rs,set_create_with_container:()=>ss,set_create_with_item:()=>os,set_create_with_text_return:()=>ms,set_length:()=>as,set_operate:()=>cs,set_operate_update:()=>ds,set_pop:()=>ls,set_sub:()=>ps,set_toset:()=>gs,set_update:()=>fs});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{html_content:()=>Ts,html_content_more:()=>xs,html_document:()=>ys,html_form:()=>ws,html_head_body:()=>bs,html_style:()=>Es,html_style_color:()=>As,html_style_content:()=>Is,html_text:()=>Ss,html_title:()=>vs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{attribute_access:()=>Vs,function_call:()=>Bs,function_call_container:()=>$s,function_call_item:()=>Us,raw_block:()=>Ms,raw_empty:()=>Rs,raw_expression:()=>ks,raw_table:()=>Os,text_comment:()=>Ns,text_print_multiple:()=>Fs,text_print_multiple_container:()=>Ls,text_print_multiple_item:()=>Ps,type_check:()=>Ds});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{controls_type:()=>Hs,controls_typeLists:()=>Ws,lists_zip:()=>Xs,unpack_iterable_object:()=>qs,variables_change:()=>Ys,variables_get:()=>zs,variables_global:()=>Gs,variables_set:()=>js});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{Panic_with_status_code:()=>so,base_setup:()=>Zs,controls_delay:()=>ro,controls_flow_statements:()=>io,controls_for:()=>eo,controls_forEach:()=>co,controls_for_range:()=>to,controls_if:()=>Qs,controls_interrupts:()=>lo,controls_lambda:()=>po,controls_main:()=>Ks,controls_millis:()=>oo,controls_nointerrupts:()=>uo,controls_pass:()=>mo,controls_range:()=>ho,controls_repeat:()=>Eo,controls_repeat_ext:()=>yo,controls_thread:()=>go,controls_try_finally:()=>Js,controls_whileUntil:()=>no,datetime_fromtimestamp:()=>wo,do_while:()=>_o,garbage_collection:()=>vo,gene_unique_identifier:()=>Io,get_mem_alloc:()=>bo,get_mem_free:()=>To,get_unique_identifier:()=>xo,reset:()=>ao,time_sleep:()=>fo});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{base_map:()=>Ho,generate_cartesian_product:()=>Xo,math_arithmetic:()=>Mo,math_bit:()=>Oo,math_constant:()=>So,math_constant_mp:()=>Co,math_constrain:()=>$o,math_dec:()=>Do,math_degree_to_radian:()=>Ko,math_indexer_number:()=>zo,math_map:()=>Bo,math_max_min:()=>Lo,math_number:()=>Ao,math_number_base_conversion:()=>Uo,math_radian_to_degree:()=>qo,math_random:()=>Po,math_random_seed:()=>Vo,math_round:()=>jo,math_selfcalcu:()=>ko,math_single:()=>Ro,math_to_int:()=>Fo,math_trig:()=>No,text_to_number:()=>Yo,text_to_number_skulpt:()=>Go,turn_to_int:()=>Wo});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{ascii_to_char:()=>na,char_to_ascii:()=>ia,number_to_text:()=>ra,os_system:()=>Sa,text:()=>Zo,text_bytes:()=>Jo,text_capital:()=>pa,text_center:()=>fa,text_char:()=>ea,text_char_at:()=>aa,text_char_at2:()=>oa,text_char_at3:()=>wa,text_compareTo:()=>Ea,text_compare_to:()=>ca,text_encode:()=>Ia,text_equals_starts_ends:()=>ua,text_eval:()=>Aa,text_find:()=>ma,text_format:()=>ba,text_format_noreturn:()=>Ta,text_join:()=>ta,text_join_seq:()=>ga,text_length:()=>sa,text_random_char:()=>la,text_replace:()=>_a,text_split:()=>ya,text_strip:()=>va,text_substring:()=>ha,text_substring2:()=>da,text_substring3:()=>xa,text_textarea:()=>Qo});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{content_in_lists:()=>al,enumerate:()=>ol,list_many_input:()=>Wa,list_tolist:()=>rl,list_tolist2:()=>sl,list_trig:()=>Ya,lists_2d_get_col_row_data:()=>Ma,lists_2d_get_data_with_col_row:()=>Oa,lists_append_extend:()=>Fa,lists_change_to:()=>Ha,lists_change_to_general:()=>qa,lists_clear:()=>Ua,lists_create_with:()=>ka,lists_create_with2:()=>Za,lists_create_with_noreturn:()=>Xa,lists_create_with_text:()=>Ra,lists_create_with_text2:()=>Qa,lists_del_general:()=>Ka,lists_find:()=>Va,lists_getIndex3:()=>Ja,lists_getSublist3:()=>el,lists_get_index:()=>Na,lists_get_random_item:()=>La,lists_get_random_sublist:()=>Pa,lists_get_sublist:()=>Ca,lists_insert_value:()=>Ba,lists_insert_value2:()=>nl,lists_pop:()=>ja,lists_remove_at:()=>za,lists_remove_at2:()=>il,lists_reverse:()=>$a,lists_setIndex3:()=>tl,lists_set_index:()=>Da,lists_sort:()=>Ga});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{dicts_add_change_del:()=>bl,dicts_add_or_change:()=>hl,dicts_clear:()=>ml,dicts_create_with:()=>ll,dicts_create_with_noreturn:()=>El,dicts_deldict:()=>vl,dicts_delete:()=>pl,dicts_get:()=>cl,dicts_get_default:()=>dl,dicts_items:()=>gl,dicts_keys:()=>ul,dicts_length:()=>yl,dicts_pop:()=>Tl,dicts_setdefault:()=>xl,dicts_to_json:()=>Il,dicts_to_json2:()=>Cl,dicts_to_to:()=>Sl,dicts_todict:()=>wl,dicts_update:()=>fl,dicts_values:()=>_l,json_to_dicts:()=>Al});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{logic_boolean:()=>Nl,logic_compare:()=>Ol,logic_compare_continous:()=>Ml,logic_is:()=>Pl,logic_is_in:()=>Ll,logic_negate:()=>Rl,logic_null:()=>Dl,logic_operation:()=>kl,logic_tobool:()=>Bl,logic_true_or_false:()=>Fl});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{sdcard_mount:()=>au,sdcard_use_spi_init:()=>ou,storage_can_write_ornot:()=>Wl,storage_change_dir:()=>tu,storage_close_file:()=>ql,storage_delete_file:()=>Zl,storage_file_seek:()=>eu,storage_file_tell:()=>Jl,storage_file_write:()=>jl,storage_fileopen:()=>Ul,storage_fileopen_new:()=>Vl,storage_fileopen_new_encoding:()=>zl,storage_get_a_line:()=>Hl,storage_get_contents:()=>Gl,storage_get_contents_without_para:()=>Yl,storage_get_current_dir:()=>nu,storage_get_file_size:()=>Ql,storage_get_filename:()=>Xl,storage_is_file:()=>su,storage_list_all_files:()=>Kl,storage_make_dir:()=>iu,storage_open_file_with_os:()=>$l,storage_rename:()=>ru});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{procedures_callnoreturn:()=>du,procedures_callreturn:()=>cu,procedures_defnoreturn:()=>uu,procedures_defreturn:()=>lu,procedures_ifreturn:()=>hu,procedures_return:()=>pu});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{tuple_change_to:()=>xu,tuple_create_llm_params:()=>ku,tuple_create_with:()=>fu,tuple_create_with_noreturn:()=>Au,tuple_create_with_text2:()=>mu,tuple_create_with_text_return:()=>gu,tuple_del:()=>vu,tuple_find:()=>Eu,tuple_getIndex:()=>_u,tuple_getSublist:()=>Iu,tuple_get_random_item:()=>Cu,tuple_get_sublist:()=>Su,tuple_input:()=>Mu,tuple_join:()=>bu,tuple_length:()=>yu,tuple_max:()=>Tu,tuple_totuple:()=>Ou,tuple_trig:()=>wu});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{set_add_discard:()=>Bu,set_clear:()=>Fu,set_create_with:()=>Ru,set_create_with_text_return:()=>Vu,set_length:()=>Nu,set_operate:()=>Lu,set_operate_update:()=>Pu,set_pop:()=>Du,set_sub:()=>$u,set_toset:()=>zu,set_update:()=>Uu});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{html_content:()=>Hu,html_content_more:()=>Wu,html_document:()=>ju,html_form:()=>qu,html_head_body:()=>Gu,html_style:()=>Xu,html_style_content:()=>Ku,html_text:()=>Zu,html_title:()=>Yu});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{attribute_access:()=>rc,function_call:()=>ic,raw_block:()=>Qu,raw_empty:()=>ec,raw_expression:()=>Ju,raw_table:()=>tc,type_check:()=>nc});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{AI_ChooseAndGet:()=>uc,AI_Face_match:()=>mc,AI_ImageClassify:()=>pc,AI_ImageClassify_Func:()=>fc,AI_Nlp:()=>yc,AI_Nlp_Func:()=>bc,AI_Nlp_Func_sim:()=>Tc,AI_Nlp_Sim:()=>vc,AI_Nlp_Topic:()=>xc,AI_Nlp_newsSummary:()=>Ec,AI_Ocr:()=>gc,AI_Ocr_Func:()=>_c,AI_Speech_asr:()=>hc,AI_Speech_synthesis:()=>dc,AI_audio:()=>wc,AI_client:()=>cc,AI_photo:()=>Ic,AI_result:()=>Ac});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{algorithm_add_path:()=>Nc,algorithm_add_school:()=>Oc,algorithm_all_books:()=>qc,algorithm_all_books_sequence:()=>Kc,algorithm_book_scale:()=>ld,algorithm_check_feet:()=>vd,algorithm_chick_calculate:()=>yd,algorithm_color_seclet:()=>Pd,algorithm_current_school:()=>$c,algorithm_del_path:()=>Dc,algorithm_delete_book:()=>rd,algorithm_delete_books:()=>sd,algorithm_delete_books2:()=>od,algorithm_divide_books:()=>nd,algorithm_find_path:()=>Mc,algorithm_first_book:()=>Zc,algorithm_fz_calc:()=>Ed,algorithm_fz_calc_first_min:()=>wd,algorithm_fz_compare:()=>Id,algorithm_fz_move:()=>Sd,algorithm_fz_set_min:()=>Ad,algorithm_get_book_num:()=>hd,algorithm_get_current_location:()=>Fd,algorithm_get_half_books:()=>id,algorithm_hxdb_add:()=>Rd,algorithm_hxdb_init_soldier:()=>Od,algorithm_hxdb_last_line:()=>kd,algorithm_hxdb_result:()=>Nd,algorithm_hxdb_stand_in_line:()=>Md,algorithm_init_fzsf:()=>xd,algorithm_init_hxdb:()=>Cd,algorithm_init_jttl:()=>md,algorithm_move_recent:()=>jc,algorithm_new_path:()=>kc,algorithm_next_book:()=>ed,algorithm_no_left:()=>Lc,algorithm_no_path:()=>Uc,algorithm_no_ring2:()=>Qc,algorithm_not_home:()=>Yc,algorithm_not_school:()=>Gc,algorithm_number_add:()=>cd,algorithm_number_zero:()=>ud,algorithm_prepare:()=>Cc,algorithm_prepare2:()=>Bc,algorithm_prepare_2_1:()=>Vc,algorithm_prepare_2_2:()=>zc,algorithm_print_book2:()=>ad,algorithm_print_divide:()=>fd,algorithm_print_jttl_answer:()=>bd,algorithm_print_number:()=>dd,algorithm_print_path:()=>Pc,algorithm_print_path2:()=>Hc,algorithm_print_sequence:()=>pd,algorithm_rabbit_add:()=>Td,algorithm_rabbit_number_in_range:()=>_d,algorithm_rabbit_zero:()=>gd,algorithm_return_path:()=>Fc,algorithm_set_path:()=>Rc,algorithm_two_left:()=>td,algorithm_void_path:()=>Ld,algorithm_yes_ring2:()=>Jc,hanoi_init:()=>Wc,hanoi_init_offline:()=>Dd,hanoi_move:()=>Xc});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{requests_attribute:()=>zd,requests_get:()=>Ud,requests_get_old:()=>$d,requests_method:()=>jd,requests_post:()=>Vd});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{cv_destroy_all:()=>qd,cv_face_classifier:()=>Qd,cv_face_detect:()=>Jd,cv_face_detect_all:()=>eh,cv_line_rect:()=>Kd,cv_read_image:()=>Gd,cv_show_image:()=>Hd,cv_text:()=>Zd,cv_waitkey:()=>Xd,cv_write_image:()=>Wd});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{array_create:()=>_h,array_toarray:()=>kh,dataframe_aggregate_func:()=>Ap,dataframe_create:()=>rh,dataframe_create_from_index:()=>oh,dataframe_create_from_one_index:()=>sh,dataframe_fillna:()=>hp,dataframe_get:()=>Ch,dataframe_groupby:()=>Ip,dataframe_head_tail:()=>Ep,dataframe_info:()=>pp,dataframe_median:()=>dp,dataframe_select:()=>wp,dataframe_sort_values:()=>xp,matrix_multiplication:()=>up,matrix_transpose:()=>lp,numpy_argmin_template_match:()=>ep,numpy_astype:()=>Zh,numpy_c_:()=>op,numpy_dot:()=>_p,numpy_linalg_det:()=>ap,numpy_linalg_inv:()=>cp,numpy_max:()=>mp,numpy_mean:()=>tp,numpy_mean_digit:()=>Jh,numpy_min:()=>fp,numpy_ones:()=>sp,numpy_random_random:()=>bp,numpy_reshape:()=>Kh,numpy_shape:()=>qh,numpy_size:()=>gp,numpy_square:()=>yp,numpy_std:()=>np,numpy_sum:()=>vp,numpy_trig:()=>Ih,pandas_drop_columns:()=>rp,pandas_dropna:()=>ip,pandas_readcsv:()=>Sh,pl_axes:()=>ph,pl_bar:()=>Th,pl_hist:()=>Eh,pl_label:()=>gh,pl_legend:()=>fh,pl_pie:()=>xh,pl_plot:()=>dh,pl_plot_bar:()=>yh,pl_plot_easy:()=>ch,pl_plot_scatter:()=>vh,pl_plot_xy:()=>bh,pl_savefig:()=>Oh,pl_show:()=>hh,pl_subplot:()=>Ah,pl_text:()=>Mh,pl_ticks:()=>wh,pl_title:()=>mh,plot_axes:()=>Fh,plot_bar:()=>zh,plot_cla:()=>Sp,plot_hist:()=>Yh,plot_label:()=>Bh,plot_legend:()=>Lh,plot_pie:()=>jh,plot_plot:()=>Nh,plot_plot_bar:()=>$h,plot_plot_easy:()=>Rh,plot_plot_scatter:()=>Uh,plot_plot_xy:()=>Vh,plot_savefig:()=>Wh,plot_show:()=>Dh,plot_subplot:()=>Hh,plot_text:()=>Xh,plot_ticks:()=>Gh,plot_title:()=>Ph,py_sum:()=>Tp,pylab_imshow:()=>Qh,series_create:()=>nh,series_create_from_index:()=>ih,series_create_from_text:()=>ah,series_get_num:()=>uh,series_index_value:()=>lh});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{ds_add_node_by_attr:()=>Lp,ds_add_node_by_name:()=>Fp,ds_create_linkedlist:()=>Op,ds_create_linkedlist_container:()=>Mp,ds_create_linkedlist_item:()=>kp,ds_create_node:()=>Rp,ds_del_node_by_attr:()=>Bp,ds_del_node_by_name:()=>Pp,ds_get_node_attr:()=>Np,ds_reverse_linkedlist:()=>$p,ds_set_node_attr:()=>Dp});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{factory_block:()=>Kp,factory_block_return:()=>Zp,factory_block_return_with_textarea:()=>Jp,factory_block_with_textarea:()=>Qp,factory_callMethod_noreturn:()=>Xp,factory_callMethod_return:()=>qp,factory_create_with_container:()=>Yp,factory_create_with_item:()=>Gp,factory_declare:()=>Wp,factory_from_import:()=>Vp,factory_function_noreturn:()=>jp,factory_function_return:()=>Hp,factory_import:()=>zp});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{hardware_arduino_analog_read:()=>af,hardware_arduino_analog_write:()=>of,hardware_arduino_digital_read:()=>sf,hardware_arduino_digital_write:()=>rf,hardware_arduino_start:()=>tf,inout_highlow:()=>nf});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{inout_input:()=>lf,inout_print:()=>uf,inout_print_container:()=>mf,inout_print_end:()=>df,inout_print_inline:()=>cf,inout_print_item:()=>gf,inout_print_many:()=>ff,inout_type_input:()=>hf,pyinout_type_input:()=>pf});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Vf,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Uf,IOT_EMQX_PING:()=>Bf,IOT_FORMATTING:()=>Lf,IOT_FORMAT_STRING:()=>Pf,IOT_MIXIO_NTP:()=>$f,IOT_MIXIO_PUBLISH:()=>Sf,IOT_MIXIO_PUBLISHEX:()=>Cf,IOT_MIXIO_SUBSCRIBE:()=>Of,IOT_MIXIO_UNSUBSCRIBE:()=>Mf,iot_checkonenet:()=>Zf,iot_client_onboard:()=>Yf,iot_create_with_item:()=>If,iot_http_client:()=>Gf,iot_http_data:()=>Hf,iot_mixio_check:()=>Nf,iot_mixio_connect:()=>Af,iot_mixio_connect_only:()=>Rf,iot_mixio_disconnect:()=>kf,iot_mixio_format_msg:()=>Ff,iot_mixio_format_topic:()=>Df,iot_mixly_key:()=>jf,iot_mixly_key_py:()=>zf,iot_mqtt_client:()=>Wf,iot_mqtt_data:()=>Xf,iot_onenet_check:()=>bf,iot_onenet_connect:()=>yf,iot_onenet_disconnect:()=>vf,iot_onenet_publish:()=>xf,iot_onenet_publish_dict:()=>Tf,iot_onenetconnect:()=>qf,iot_onenetdisconnect:()=>Kf,iot_publish:()=>Qf,iot_publish_container:()=>Ef,iot_publish_item:()=>wf});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{pins_analog_read:()=>im,pins_analog_write:()=>nm,pins_digital_read:()=>tm,pins_digital_write:()=>em});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{serial_close:()=>am,serial_open:()=>rm,serial_read_b:()=>om,serial_write:()=>sm});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{sklearn_DecisionTreeClassifier_Regressor:()=>ym,sklearn_GaussianNB:()=>Tm,sklearn_KMeans:()=>wm,sklearn_KMeans_fit:()=>Im,sklearn_KNeighborsClassifier_Regressor:()=>bm,sklearn_LinearRegression:()=>gm,sklearn_RandomForestClassifier_Regressor:()=>vm,sklearn_Ridge:()=>_m,sklearn_cluster_centers_labels_inertia:()=>Rm,sklearn_coef_intercept:()=>km,sklearn_data_target:()=>pm,sklearn_fit:()=>Am,sklearn_fit_no_target:()=>Sm,sklearn_load:()=>hm,sklearn_make_blobs:()=>dm,sklearn_make_classification:()=>um,sklearn_make_regression:()=>cm,sklearn_pca:()=>xm,sklearn_pca_fit_transform:()=>Em,sklearn_predict:()=>Cm,sklearn_save_load_model:()=>Nm,sklearn_score:()=>Om,sklearn_score_no_target:()=>Mm,sklearn_train_test_split:()=>fm,sklearn_train_test_split_no_target:()=>mm});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{Panic_with_status_code:()=>Bm,base_delay:()=>Fm,controls_millis:()=>Lm,controls_mstimer2:()=>Um,controls_mstimer2_start:()=>Vm,controls_mstimer2_stop:()=>zm,reset:()=>$m,time_localtime:()=>Pm,time_sleep:()=>jm});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{turtle_bgcolor:()=>dg,turtle_bgcolor_hex:()=>Eg,turtle_bgcolor_hex_new:()=>yg,turtle_circle:()=>lg,turtle_circle_advanced:()=>ug,turtle_clear:()=>ng,turtle_clone:()=>_g,turtle_color:()=>Tg,turtle_color_hex:()=>xg,turtle_color_seclet:()=>Ng,turtle_create:()=>Gm,turtle_done:()=>Hm,turtle_exitonclick:()=>Wm,turtle_fill:()=>rg,turtle_fillcolor:()=>gg,turtle_fillcolor_hex:()=>Ig,turtle_fillcolor_hex_new:()=>bg,turtle_getscreen:()=>Dg,turtle_goto:()=>Qm,turtle_listen:()=>$g,turtle_move:()=>Xm,turtle_numinput:()=>Cg,turtle_onclick:()=>Pg,turtle_onkey:()=>Lg,turtle_ontimer:()=>Bg,turtle_pencolor:()=>mg,turtle_pencolor_hex:()=>wg,turtle_pencolor_hex_new:()=>vg,turtle_penup:()=>ig,turtle_pos_shape:()=>eg,turtle_rotate:()=>qm,turtle_screen_delay:()=>Zm,turtle_screen_savefig:()=>Ug,turtle_setheading:()=>Km,turtle_setup:()=>pg,turtle_setxy:()=>Jm,turtle_shape:()=>Ag,turtle_shapesize:()=>Sg,turtle_size:()=>og,turtle_size_speed:()=>sg,turtle_speed:()=>ag,turtle_stamp:()=>tg,turtle_textinput:()=>Og,turtle_title:()=>hg,turtle_tracer:()=>fg,turtle_update:()=>Fg,turtle_visible:()=>cg,turtle_write:()=>Mg,turtle_write_format:()=>kg,turtle_write_format_skulpt:()=>Rg});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{AI_ChooseAndGet:()=>Vg,AI_Face_match:()=>Hg,AI_ImageClassify:()=>Gg,AI_ImageClassify_Func:()=>Qg,AI_Nlp:()=>Xg,AI_Nlp_Func:()=>e_,AI_Nlp_Func_sim:()=>t_,AI_Nlp_Sim:()=>qg,AI_Nlp_Topic:()=>Kg,AI_Nlp_newsSummary:()=>Zg,AI_Ocr:()=>Wg,AI_Ocr_Func:()=>Jg,AI_Speech_asr:()=>Yg,AI_Speech_synthesis:()=>jg,AI_audio:()=>n_,AI_client:()=>zg,AI_photo:()=>i_,AI_result:()=>r_});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{algorithm_add_path:()=>c_,algorithm_add_school:()=>o_,algorithm_all_books:()=>S_,algorithm_all_books_sequence:()=>A_,algorithm_book_scale:()=>P_,algorithm_check_feet:()=>G_,algorithm_chick_calculate:()=>Y_,algorithm_color_seclet:()=>ly,algorithm_current_school:()=>g_,algorithm_del_path:()=>d_,algorithm_delete_book:()=>F_,algorithm_divide_books:()=>N_,algorithm_find_path:()=>a_,algorithm_first_book:()=>C_,algorithm_fz_calc:()=>q_,algorithm_fz_compare:()=>K_,algorithm_fz_move:()=>Q_,algorithm_fz_set_min:()=>Z_,algorithm_get_current_location:()=>oy,algorithm_get_half_books:()=>D_,algorithm_hxdb_add:()=>iy,algorithm_hxdb_init_soldier:()=>ey,algorithm_hxdb_last_line:()=>ny,algorithm_hxdb_result:()=>ry,algorithm_hxdb_stand_in_line:()=>ty,algorithm_init_fzsf:()=>X_,algorithm_init_hxdb:()=>J_,algorithm_init_jttl:()=>V_,algorithm_move_recent:()=>b_,algorithm_new_path:()=>l_,algorithm_next_book:()=>k_,algorithm_no_left:()=>p_,algorithm_no_path:()=>__,algorithm_no_ring2:()=>O_,algorithm_not_home:()=>T_,algorithm_not_school:()=>x_,algorithm_number_add:()=>$_,algorithm_number_zero:()=>B_,algorithm_prepare:()=>s_,algorithm_prepare2:()=>m_,algorithm_prepare_2_1:()=>y_,algorithm_prepare_2_2:()=>v_,algorithm_print_book2:()=>L_,algorithm_print_jttl_answer:()=>H_,algorithm_print_number:()=>U_,algorithm_print_path:()=>f_,algorithm_print_path2:()=>E_,algorithm_rabbit_add:()=>W_,algorithm_rabbit_number_in_range:()=>j_,algorithm_rabbit_zero:()=>z_,algorithm_return_path:()=>h_,algorithm_set_path:()=>u_,algorithm_two_left:()=>R_,algorithm_void_path:()=>ay,algorithm_yes_ring2:()=>M_,hanoi_init:()=>w_,hanoi_init_offline:()=>sy,hanoi_move:()=>I_});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{requests_attribute:()=>hy,requests_get:()=>cy,requests_get_old:()=>uy,requests_method:()=>py,requests_post:()=>dy});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{array_create:()=>My,array_toarray:()=>Yy,dataframe_aggregate_func:()=>$v,dataframe_create:()=>_y,dataframe_create_from_index:()=>yy,dataframe_create_from_one_index:()=>vy,dataframe_fillna:()=>Iv,dataframe_get:()=>Vy,dataframe_groupby:()=>Bv,dataframe_head_tail:()=>Lv,dataframe_info:()=>Av,dataframe_median:()=>wv,dataframe_select:()=>Pv,dataframe_sort_values:()=>Fv,matrix_multiplication:()=>xv,matrix_transpose:()=>Tv,numpy_argmin_template_match:()=>pv,numpy_astype:()=>cv,numpy_c_:()=>vv,numpy_dot:()=>Mv,numpy_linalg_det:()=>bv,numpy_linalg_inv:()=>Ev,numpy_max:()=>Cv,numpy_mean:()=>fv,numpy_mean_digit:()=>hv,numpy_min:()=>Sv,numpy_ones:()=>yv,numpy_random_random:()=>Nv,numpy_reshape:()=>uv,numpy_shape:()=>lv,numpy_size:()=>Ov,numpy_square:()=>kv,numpy_std:()=>mv,numpy_sum:()=>Rv,numpy_trig:()=>By,pandas_drop_columns:()=>_v,pandas_dropna:()=>gv,pandas_readcsv:()=>Uy,pl_axes:()=>wy,pl_bar:()=>Dy,pl_hist:()=>Ly,pl_label:()=>Oy,pl_legend:()=>Sy,pl_pie:()=>Fy,pl_plot:()=>Ay,pl_plot_bar:()=>ky,pl_plot_easy:()=>Iy,pl_plot_scatter:()=>Ry,pl_plot_xy:()=>Ny,pl_savefig:()=>zy,pl_show:()=>Ey,pl_subplot:()=>$y,pl_text:()=>jy,pl_ticks:()=>Py,pl_title:()=>Cy,plot_axes:()=>Hy,plot_bar:()=>tv,plot_cla:()=>Uv,plot_hist:()=>iv,plot_label:()=>Zy,plot_legend:()=>qy,plot_pie:()=>nv,plot_plot:()=>Xy,plot_plot_bar:()=>Qy,plot_plot_easy:()=>Wy,plot_plot_scatter:()=>Jy,plot_plot_xy:()=>ev,plot_savefig:()=>ov,plot_show:()=>Gy,plot_subplot:()=>sv,plot_text:()=>av,plot_ticks:()=>rv,plot_title:()=>Ky,py_sum:()=>Dv,pylab_imshow:()=>dv,series_create:()=>my,series_create_from_index:()=>gy,series_create_from_text:()=>by,series_get_num:()=>xy,series_index_value:()=>Ty});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{ds_add_node_by_attr:()=>Hv,ds_add_node_by_name:()=>Gv,ds_create_linkedlist:()=>Vv,ds_create_node:()=>zv,ds_del_node_by_attr:()=>Xv,ds_del_node_by_name:()=>Wv,ds_get_node_attr:()=>jv,ds_reverse_linkedlist:()=>qv,ds_set_node_attr:()=>Yv});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{factory_block:()=>ib,factory_block_return:()=>rb,factory_block_return_with_textarea:()=>ob,factory_block_with_textarea:()=>sb,factory_callMethod_noreturn:()=>tb,factory_callMethod_return:()=>nb,factory_declare:()=>eb,factory_from_import:()=>Kv,factory_function_noreturn:()=>Qv,factory_function_return:()=>Jv,factory_import:()=>Zv});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{hardware_arduino_analog_read:()=>db,hardware_arduino_analog_write:()=>hb,hardware_arduino_digital_read:()=>cb,hardware_arduino_digital_write:()=>ub,hardware_arduino_start:()=>ab,inout_highlow:()=>lb});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{inout_input:()=>pb,inout_print:()=>fb,inout_print_end:()=>gb,inout_print_inline:()=>mb,inout_print_many:()=>vb,inout_type_input:()=>_b,pyinout_type_input:()=>yb});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{IOT_EMQX_INIT_AND_CONNECT_BY_MIXLY_CODE:()=>Rb,IOT_EMQX_INIT_AND_CONNECT_BY_SHARE_CODE:()=>Fb,IOT_EMQX_PING:()=>Lb,IOT_FORMATTING:()=>Mb,IOT_FORMAT_STRING:()=>kb,IOT_MIXIO_NTP:()=>Pb,IOT_MIXIO_PUBLISH:()=>Tb,IOT_MIXIO_PUBLISHEX:()=>xb,IOT_MIXIO_SUBSCRIBE:()=>Eb,IOT_MIXIO_UNSUBSCRIBE:()=>wb,iot_mixio_check:()=>Sb,iot_mixio_connect:()=>bb,iot_mixio_connect_only:()=>Ab,iot_mixio_disconnect:()=>Ib,iot_mixio_format_msg:()=>Ob,iot_mixio_format_topic:()=>Cb,iot_mixly_key:()=>Nb,iot_mixly_key_py:()=>Db});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{pins_analog_read:()=>zb,pins_analog_write:()=>Vb,pins_digital:()=>Bb,pins_digital_read:()=>Ub,pins_digital_write:()=>$b});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{serial_close:()=>Hb,serial_open:()=>jb,serial_read_b:()=>Gb,serial_write:()=>Yb});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{sklearn_DecisionTreeClassifier_Regressor:()=>nT,sklearn_GaussianNB:()=>sT,sklearn_KMeans:()=>lT,sklearn_KMeans_fit:()=>uT,sklearn_KNeighborsClassifier_Regressor:()=>rT,sklearn_LinearRegression:()=>eT,sklearn_RandomForestClassifier_Regressor:()=>iT,sklearn_Ridge:()=>tT,sklearn_cluster_centers_labels_inertia:()=>gT,sklearn_coef_intercept:()=>mT,sklearn_data_target:()=>Zb,sklearn_fit:()=>cT,sklearn_fit_no_target:()=>dT,sklearn_load:()=>Kb,sklearn_make_blobs:()=>qb,sklearn_make_classification:()=>Wb,sklearn_make_regression:()=>Xb,sklearn_pca:()=>oT,sklearn_pca_fit_transform:()=>aT,sklearn_predict:()=>hT,sklearn_save_load_model:()=>_T,sklearn_score:()=>pT,sklearn_score_no_target:()=>fT,sklearn_train_test_split:()=>Qb,sklearn_train_test_split_no_target:()=>Jb});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{controls_end_program:()=>vT,controls_millis:()=>yT,time_localtime:()=>bT});var te={};__webpack_require__.r(te),__webpack_require__.d(te,{turtle_bgcolor:()=>VT,turtle_bgcolor_hex:()=>XT,turtle_bgcolor_hex_new:()=>ZT,turtle_circle:()=>PT,turtle_circle_advanced:()=>$T,turtle_clear:()=>kT,turtle_clone:()=>WT,turtle_color:()=>tx,turtle_color_hex:()=>ex,turtle_color_seclet:()=>ux,turtle_create:()=>TT,turtle_done:()=>xT,turtle_exitonclick:()=>ET,turtle_fill:()=>NT,turtle_fillcolor:()=>HT,turtle_fillcolor_hex:()=>KT,turtle_fillcolor_hex_new:()=>JT,turtle_getscreen:()=>cx,turtle_goto:()=>CT,turtle_listen:()=>mx,turtle_move:()=>wT,turtle_numinput:()=>sx,turtle_onclick:()=>px,turtle_onkey:()=>hx,turtle_ontimer:()=>fx,turtle_pencolor:()=>GT,turtle_pencolor_hex:()=>qT,turtle_pencolor_hex_new:()=>QT,turtle_penup:()=>RT,turtle_pos_shape:()=>OT,turtle_rotate:()=>IT,turtle_screen_delay:()=>ST,turtle_screen_savefig:()=>gx,turtle_setheading:()=>AT,turtle_setup:()=>jT,turtle_setxy:()=>BT,turtle_shape:()=>nx,turtle_shapesize:()=>ix,turtle_size:()=>FT,turtle_size_speed:()=>DT,turtle_speed:()=>LT,turtle_stamp:()=>MT,turtle_textinput:()=>rx,turtle_title:()=>zT,turtle_tracer:()=>YT,turtle_update:()=>dx,turtle_visible:()=>UT,turtle_write:()=>ox,turtle_write_format:()=>ax,turtle_write_format_skulpt:()=>lx});var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{sklearn_LinearRegression:()=>_x});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{sklearn_LinearRegression:()=>yx});var re={};__webpack_require__.r(re);var se={};__webpack_require__.r(se),__webpack_require__.d(se,{tensorflow_add:()=>Ex,tensorflow_compile:()=>wx,tensorflow_fit:()=>Ix,tensorflow_get_loss:()=>Ax,tensorflow_get_tensor_data:()=>Cx,tensorflow_init_tensor:()=>bx,tensorflow_layers_dense:()=>xx,tensorflow_predict:()=>Sx,tensorflow_prepare_picture:()=>kx,tensorflow_save_or_export_model:()=>Ox,tensorflow_sequential:()=>Tx,tensorflow_use_load_model:()=>Mx});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{BaseTransition:()=>rS,BaseTransitionPropsValidators:()=>tS,Comment:()=>sM,DeprecationTypes:()=>bk,EffectScope:()=>KE,ErrorCodes:()=>eA,ErrorTypeStrings:()=>fk,Fragment:()=>iM,KeepAlive:()=>$S,ReactiveEffect:()=>tw,Static:()=>oM,Suspense:()=>ZO,Teleport:()=>XA,Text:()=>rM,TrackOpTypes:()=>UI,Transition:()=>Rk,TransitionGroup:()=>OR,TriggerOpTypes:()=>VI,VueElement:()=>bR,assertNumber:()=>JI,callWithAsyncErrorHandling:()=>iA,callWithErrorHandling:()=>nA,camelize:()=>cE,capitalize:()=>pE,cloneVNode:()=>AM,compatUtils:()=>vk,computed:()=>ak,createApp:()=>oN,createBlock:()=>gM,createCommentVNode:()=>OM,createElementBlock:()=>mM,createElementVNode:()=>xM,createHydrationRenderer:()=>TO,createPropsRestProxy:()=>LC,createRenderer:()=>bO,createSSRApp:()=>aN,createSlots:()=>fC,createStaticVNode:()=>CM,createTextVNode:()=>SM,createVNode:()=>EM,customRef:()=>NI,defineAsyncComponent:()=>FS,defineComponent:()=>dS,defineCustomElement:()=>_R,defineEmits:()=>wC,defineExpose:()=>IC,defineModel:()=>CC,defineOptions:()=>AC,defineProps:()=>EC,defineSSRCustomElement:()=>yR,defineSlots:()=>SC,devtools:()=>mk,effect:()=>fw,effectScope:()=>ZE,getCurrentInstance:()=>$M,getCurrentScope:()=>QE,getCurrentWatcher:()=>GI,getTransitionRawChildren:()=>cS,guardReactiveProps:()=>IM,h:()=>lk,handleError:()=>rA,hasInjectionContext:()=>nO,hydrate:()=>sN,hydrateOnIdle:()=>MS,hydrateOnInteraction:()=>NS,hydrateOnMediaQuery:()=>RS,hydrateOnVisible:()=>kS,initCustomFormatter:()=>uk,initDirectivesForSSR:()=>dN,inject:()=>tO,isMemoSame:()=>dk,isProxy:()=>_I,isReactive:()=>fI,isReadonly:()=>mI,isRef:()=>xI,isRuntimeOnly:()=>ZM,isShallow:()=>gI,isVNode:()=>_M,markRaw:()=>vI,mergeDefaults:()=>DC,mergeModels:()=>FC,mergeProps:()=>NM,nextTick:()=>hA,normalizeClass:()=>CE,normalizeProps:()=>OE,normalizeStyle:()=>EE,onActivated:()=>VS,onBeforeMount:()=>qS,onBeforeUnmount:()=>JS,onBeforeUpdate:()=>ZS,onDeactivated:()=>zS,onErrorCaptured:()=>rC,onMounted:()=>KS,onRenderTracked:()=>iC,onRenderTriggered:()=>nC,onScopeDispose:()=>JE,onServerPrefetch:()=>tC,onUnmounted:()=>eC,onUpdated:()=>QS,onWatcherCleanup:()=>HI,openBlock:()=>uM,popScopeId:()=>DA,provide:()=>eO,proxyRefs:()=>kI,pushScopeId:()=>NA,queuePostFlushCb:()=>mA,reactive:()=>uI,readonly:()=>dI,ref:()=>EI,registerRuntimeCompiler:()=>KM,render:()=>rN,renderList:()=>pC,renderSlot:()=>mC,resolveComponent:()=>aC,resolveDirective:()=>cC,resolveDynamicComponent:()=>uC,resolveFilter:()=>yk,resolveTransitionHooks:()=>oS,setBlockTracking:()=>pM,setDevtoolsHook:()=>gk,setTransitionHooks:()=>uS,shallowReactive:()=>cI,shallowReadonly:()=>hI,shallowRef:()=>wI,ssrContextKey:()=>OO,ssrUtils:()=>_k,stop:()=>mw,toDisplayString:()=>GE,toHandlerKey:()=>fE,toHandlers:()=>_C,toRaw:()=>yI,toRef:()=>PI,toRefs:()=>DI,toValue:()=>OI,transformVNodeArgs:()=>vM,triggerRef:()=>SI,unref:()=>CI,useAttrs:()=>kC,useCssModule:()=>ER,useCssVars:()=>Zk,useHost:()=>TR,useId:()=>hS,useModel:()=>BO,useSSRContext:()=>MO,useShadowRoot:()=>xR,useSlots:()=>MC,useTemplateRef:()=>fS,useTransitionState:()=>JA,vModelCheckbox:()=>BR,vModelDynamic:()=>GR,vModelRadio:()=>UR,vModelSelect:()=>VR,vModelText:()=>PR,vShow:()=>Xk,version:()=>hk,warn:()=>pk,watch:()=>DO,watchEffect:()=>kO,watchPostEffect:()=>RO,watchSyncEffect:()=>NO,withAsyncContext:()=>PC,withCtx:()=>LA,withDefaults:()=>OC,withDirectives:()=>PA,withKeys:()=>QR,withMemo:()=>ck,withModifiers:()=>KR,withScopeId:()=>FA});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{COPYFILE_EXCL:()=>VP,COPYFILE_FICLONE:()=>zP,COPYFILE_FICLONE_FORCE:()=>jP,F_OK:()=>PP,O_APPEND:()=>ZP,O_CREAT:()=>WP,O_DIRECT:()=>rB,O_DIRECTORY:()=>QP,O_DSYNC:()=>nB,O_EXCL:()=>XP,O_NOATIME:()=>JP,O_NOCTTY:()=>qP,O_NOFOLLOW:()=>eB,O_NONBLOCK:()=>sB,O_RDONLY:()=>YP,O_RDWR:()=>HP,O_SYMLINK:()=>iB,O_SYNC:()=>tB,O_TRUNC:()=>KP,O_WRONLY:()=>GP,R_OK:()=>BP,S_IFBLK:()=>cB,S_IFCHR:()=>hB,S_IFDIR:()=>dB,S_IFIFO:()=>pB,S_IFLNK:()=>lB,S_IFMT:()=>oB,S_IFREG:()=>uB,S_IFSOCK:()=>aB,S_IRGRP:()=>xB,S_IROTH:()=>AB,S_IRUSR:()=>yB,S_IRWXG:()=>TB,S_IRWXO:()=>IB,S_IRWXU:()=>_B,S_ISGID:()=>mB,S_ISUID:()=>fB,S_ISVTX:()=>gB,S_IWGRP:()=>EB,S_IWOTH:()=>SB,S_IWUSR:()=>vB,S_IXGRP:()=>wB,S_IXOTH:()=>CB,S_IXUSR:()=>bB,UV_FS_O_FILEMAP:()=>OB,W_OK:()=>$P,X_OK:()=>UP,size_max:()=>MB});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{FileHandle:()=>JU,access:()=>IV,appendFile:()=>cV,chmod:()=>vV,chown:()=>_V,constants:()=>ae,copyFile:()=>CV,cp:()=>MV,exists:()=>tV,lchmod:()=>bV,lchown:()=>yV,link:()=>fV,lstat:()=>iV,lutimes:()=>xV,mkdir:()=>hV,mkdtemp:()=>SV,open:()=>aV,opendir:()=>OV,readFile:()=>lV,readdir:()=>pV,readlink:()=>gV,realpath:()=>EV,rename:()=>eV,rm:()=>AV,rmdir:()=>dV,stat:()=>nV,statfs:()=>kV,symlink:()=>mV,truncate:()=>rV,unlink:()=>sV,utimes:()=>TV,watch:()=>wV,writeFile:()=>uV});var ue={};__webpack_require__.r(ue),__webpack_require__.d(ue,{BigIntStatsFs:()=>PB,Dir:()=>WU,Dirent:()=>HU,ReadStream:()=>qU,Stats:()=>DB,StatsFs:()=>LB,WriteStream:()=>KU,_synced:()=>z$,access:()=>hz,accessSync:()=>PU,appendFile:()=>zV,appendFileSync:()=>pU,chmod:()=>az,chmodSync:()=>RU,chown:()=>sz,chownSync:()=>MU,chroot:()=>W$,close:()=>YV,closeSync:()=>mU,constants:()=>ae,copyFile:()=>Tz,copyFileSync:()=>UU,cp:()=>Iz,cpSync:()=>YU,createReadStream:()=>_z,createWriteStream:()=>yz,exists:()=>DV,existsSync:()=>nU,fchmod:()=>ZV,fchmodSync:()=>xU,fchown:()=>KV,fchownSync:()=>TU,fdatasync:()=>WV,fdatasyncSync:()=>yU,fstat:()=>jV,fstatSync:()=>fU,fsync:()=>HV,fsyncSync:()=>_U,ftruncate:()=>GV,ftruncateSync:()=>gU,futimes:()=>QV,futimesSync:()=>EU,lchmod:()=>lz,lchmodSync:()=>NU,lchown:()=>oz,lchownSync:()=>kU,link:()=>nz,linkSync:()=>SU,lopenSync:()=>uU,lstat:()=>LV,lstatSync:()=>rU,lutimes:()=>cz,lutimesSync:()=>FU,mkdir:()=>ez,mkdirSync:()=>IU,mkdtemp:()=>bz,mkdtempSync:()=>$U,mount:()=>$$,mountObject:()=>G$,mounts:()=>B$,open:()=>$V,openAsBlob:()=>Sz,openSync:()=>lU,opendir:()=>wz,opendirSync:()=>jU,promises:()=>le,read:()=>qV,readFile:()=>UV,readFileSync:()=>dU,readSync:()=>bU,readdir:()=>tz,readdirSync:()=>AU,readlink:()=>rz,readlinkSync:()=>OU,readv:()=>xz,readvSync:()=>VU,realpath:()=>dz,realpathSync:()=>LU,rename:()=>NV,renameSync:()=>tU,rm:()=>vz,rmSync:()=>BU,rmdir:()=>JV,rmdirSync:()=>wU,stat:()=>FV,statSync:()=>iU,statfs:()=>Az,statfsSync:()=>GU,symlink:()=>iz,symlinkSync:()=>CU,truncate:()=>PV,truncateSync:()=>sU,umount:()=>U$,unlink:()=>BV,unlinkSync:()=>oU,unwatchFile:()=>mz,utimes:()=>uz,utimesSync:()=>DU,watch:()=>gz,watchFile:()=>fz,write:()=>XV,writeFile:()=>VV,writeFileSync:()=>hU,writeSync:()=>vU,writev:()=>Ez,writevSync:()=>zU});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{maxNorm:()=>e7,minMaxNorm:()=>i7,nonNeg:()=>n7,unitNorm:()=>t7});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{constant:()=>o7,glorotNormal:()=>p7,glorotUniform:()=>h7,heNormal:()=>f7,heUniform:()=>m7,identity:()=>c7,leCunNormal:()=>g7,leCunUniform:()=>_7,ones:()=>s7,orthogonal:()=>y7,randomNormal:()=>l7,randomUniform:()=>a7,truncatedNormal:()=>u7,varianceScaling:()=>d7,zeros:()=>r7});var he={};__webpack_require__.r(he),__webpack_require__.d(he,{Layer:()=>N9,RNN:()=>Vte,RNNCell:()=>zte,activation:()=>Tie,add:()=>Mie,alphaDropout:()=>bre,average:()=>kie,averagePooling1d:()=>Uie,averagePooling2d:()=>jie,averagePooling3d:()=>Hie,avgPool1d:()=>Vie,avgPool2d:()=>Yie,avgPool3d:()=>Wie,avgPooling1d:()=>zie,avgPooling2d:()=>Gie,avgPooling3d:()=>Xie,batchNormalization:()=>Pie,bidirectional:()=>hre,categoryEncoding:()=>Ire,centerCrop:()=>Ere,concatenate:()=>Rie,conv1d:()=>hie,conv2d:()=>pie,conv2dTranspose:()=>fie,conv3d:()=>mie,conv3dTranspose:()=>gie,convLstm2d:()=>lre,convLstm2dCell:()=>ure,cropping2D:()=>yie,dense:()=>xie,depthwiseConv2d:()=>bie,dot:()=>Lie,dropout:()=>Eie,elu:()=>oie,embedding:()=>Oie,flatten:()=>Iie,gaussianDropout:()=>vre,gaussianNoise:()=>yre,globalAveragePooling1d:()=>qie,globalAveragePooling2d:()=>Kie,globalMaxPool1d:()=>fre,globalMaxPool2d:()=>mre,globalMaxPooling1d:()=>Zie,globalMaxPooling2d:()=>Qie,gru:()=>nre,gruCell:()=>ire,input:()=>Bee,inputLayer:()=>sie,layerNormalization:()=>Bie,leakyReLU:()=>lie,lstm:()=>rre,lstmCell:()=>sre,masking:()=>Tre,maxPool1d:()=>gre,maxPool2d:()=>_re,maxPooling1d:()=>Jie,maxPooling2d:()=>ere,maxPooling3d:()=>tre,maximum:()=>Nie,minimum:()=>Die,multiply:()=>Fie,permute:()=>Cie,prelu:()=>uie,randomWidth:()=>Are,reLU:()=>aie,repeatVector:()=>Aie,rescaling:()=>xre,reshape:()=>Sie,resizing:()=>wre,rnn:()=>cre,separableConv2d:()=>_ie,simpleRNN:()=>ore,simpleRNNCell:()=>are,softmax:()=>cie,spatialDropout1d:()=>wie,stackedRNNCells:()=>dre,thresholdedReLU:()=>die,timeDistributed:()=>pre,upSampling2d:()=>vie,zeroPadding2d:()=>$ie});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{MAPE:()=>Pre,MSE:()=>Ure,binaryAccuracy:()=>Sre,binaryCrossentropy:()=>Cre,categoricalAccuracy:()=>Mre,categoricalCrossentropy:()=>kre,cosineProximity:()=>Dre,mape:()=>Bre,meanAbsoluteError:()=>Fre,meanAbsolutePercentageError:()=>Lre,meanSquaredError:()=>$re,mse:()=>Vre,precision:()=>Rre,r2Score:()=>zre,recall:()=>Nre,sparseCategoricalAccuracy:()=>Ore});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{modelFromJSON:()=>Nee});var me={};__webpack_require__.r(me),__webpack_require__.d(me,{l1:()=>Yre,l1l2:()=>jre,l2:()=>Gre});var ge={};__webpack_require__.r(ge),__webpack_require__.d(ge,{json:()=>dse});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{json:()=>hse});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{json:()=>pse});var ve={};__webpack_require__.r(ve),__webpack_require__.d(ve,{json:()=>fse});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{json:()=>mse});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{json:()=>gse});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{json:()=>_se});var Ee={};__webpack_require__.r(Ee),__webpack_require__.d(Ee,{json:()=>yse});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{json:()=>vse});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{json:()=>bse});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{json:()=>Tse});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{json:()=>xse});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{json:()=>Ese});var Oe={};__webpack_require__.r(Oe),__webpack_require__.d(Oe,{json:()=>wse});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{json:()=>Ise});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{json:()=>Ase});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{json:()=>Sse});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{json:()=>Cse});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{json:()=>Ose});var Fe={};__webpack_require__.r(Fe),__webpack_require__.d(Fe,{OP_SCOPE_SUFFIX:()=>Hse.BTT,abs:()=>Hse.tnl,acos:()=>Hse.HQu,acosh:()=>Hse.FqL,add:()=>Hse.WQq,addN:()=>Hse.QiD,all:()=>Hse.Q7R,any:()=>Hse.bzn,argMax:()=>Hse.FLi,argMin:()=>Hse.XRg,asin:()=>Hse.qRo,asinh:()=>Hse.yHs,atan:()=>Hse.rYl,atan2:()=>Hse.FPz,atanh:()=>Hse.rfv,avgPool:()=>Hse.$jT,avgPool3d:()=>Hse.sub,basicLSTMCell:()=>Hse.lZX,batchNorm:()=>Hse.$v7,batchNorm2d:()=>Hse.BFc,batchNorm3d:()=>Hse.kSi,batchNorm4d:()=>Hse.T5N,batchToSpaceND:()=>Hse.GTe,bincount:()=>Hse.HbZ,bitwiseAnd:()=>Hse.vjT,booleanMaskAsync:()=>Hse.ftb,broadcastArgs:()=>Hse.ROE,broadcastTo:()=>Hse.hOW,buffer:()=>Hse.ra8,cast:()=>Hse.wgE,ceil:()=>Hse.mkO,clipByValue:()=>Hse.zQh,clone:()=>Hse.o8B,complex:()=>Hse.faB,concat:()=>Hse.xWs,concat1d:()=>Hse.I1m,concat2d:()=>Hse.RPU,concat3d:()=>Hse.O5O,concat4d:()=>Hse.P1l,conv1d:()=>Hse.kA9,conv2d:()=>Hse.Xtf,conv2dTranspose:()=>Hse.wX9,conv3d:()=>Hse.IPL,conv3dTranspose:()=>Hse.jIJ,cos:()=>Hse.gnS,cosh:()=>Hse.yIG,cosineWindow:()=>Hse._jP,cumprod:()=>Hse.Lp0,cumsum:()=>Hse.rCv,denseBincount:()=>Hse.aOp,depthToSpace:()=>Hse.Rj8,depthwiseConv2d:()=>Hse.Gl3,diag:()=>Hse.smy,dilation2d:()=>Hse.X7t,div:()=>Hse.y4m,divNoNan:()=>Hse.ek5,dot:()=>Hse.Omf,dropout:()=>Hse.EZY,einsum:()=>Hse._3C,elu:()=>Hse.Pqc,enclosingPowerOfTwo:()=>Hse.FJY,ensureShape:()=>Hse.QP2,equal:()=>Hse.LCg,erf:()=>Hse.Y12,euclideanNorm:()=>Hse.p4S,exp:()=>Hse.oNF,expandDims:()=>Hse.UG6,expm1:()=>Hse.IYd,eye:()=>Hse.y5U,fft:()=>Hse.hVP,fill:()=>Hse.GSj,floor:()=>Hse.RIf,floorDiv:()=>Hse.wh_,fused:()=>Hse.cZk,gather:()=>Hse.kgh,gatherND:()=>Hse.SY9,greater:()=>Hse.rhj,greaterEqual:()=>Hse.DQN,ifft:()=>Hse.KGM,imag:()=>Hse.ngS,image:()=>Hse.Slp,inTopKAsync:()=>Hse.U4u,irfft:()=>Hse.ggX,isFinite:()=>Hse.MIs,isInf:()=>Hse.EN4,isNaN:()=>Hse.yrW,leakyRelu:()=>Hse.H8d,less:()=>Hse.M7h,lessEqual:()=>Hse.InN,linalg:()=>Hse.mPL,linspace:()=>Hse.mT8,localResponseNormalization:()=>Hse.Kgs,log:()=>Hse.Rm2,log1p:()=>Hse.Kko,logSigmoid:()=>Hse.nqI,logSoftmax:()=>Hse.HPB,logSumExp:()=>Hse.VZ,logicalAnd:()=>Hse.n76,logicalNot:()=>Hse.NSZ,logicalOr:()=>Hse.ztW,logicalXor:()=>Hse.rxB,losses:()=>Hse.YYh,lowerBound:()=>Hse.yzS,matMul:()=>Hse.NoW,max:()=>Hse.T9B,maxPool:()=>Hse.jgi,maxPool3d:()=>Hse.NYV,maxPoolWithArgmax:()=>Hse.RO,maximum:()=>Hse.PhQ,mean:()=>Hse.i2o,meshgrid:()=>Hse.OYQ,min:()=>Hse.jkA,minimum:()=>Hse.BpO,mirrorPad:()=>Hse.FFZ,mod:()=>Hse.ziu,moments:()=>Hse.Clk,movingAverage:()=>Hse.CRk,mul:()=>Hse.lKK,multiRNNCell:()=>Hse.YDF,multinomial:()=>Hse.OjQ,neg:()=>Hse.HZy,norm:()=>Hse.xbf,notEqual:()=>Hse.Ec,oneHot:()=>Hse.Mw0,ones:()=>Hse.SaS,onesLike:()=>Hse.P61,op:()=>Hse.op,outerProduct:()=>Hse.X4o,pad:()=>Hse.eVF,pad1d:()=>Hse.BZs,pad2d:()=>Hse.grY,pad3d:()=>Hse.XHu,pad4d:()=>Hse.WLX,pool:()=>Hse.dzn,pow:()=>Hse.n7C,prelu:()=>Hse.NsG,print:()=>Hse.yyV,prod:()=>Hse._eU,raggedGather:()=>Hse.whe,raggedRange:()=>Hse.iyU,raggedTensorToTensor:()=>Hse.Q0_,rand:()=>Hse._9M,randomGamma:()=>Hse.pR9,randomNormal:()=>Hse.FE$,randomStandardNormal:()=>Hse.m0H,randomUniform:()=>Hse.YeY,randomUniformInt:()=>Hse.HYA,range:()=>Hse.y17,real:()=>Hse.xav,reciprocal:()=>Hse.VOZ,relu:()=>Hse.VVh,relu6:()=>Hse.j__,reshape:()=>Hse.tQQ,reverse:()=>Hse.BEg,reverse1d:()=>Hse.QD2,reverse2d:()=>Hse.LMr,reverse3d:()=>Hse.I2l,reverse4d:()=>Hse.JYU,rfft:()=>Hse.z8$,round:()=>Hse.LIG,rsqrt:()=>Hse.Z$r,scalar:()=>Hse.d_2,scatterND:()=>Hse.NFr,searchSorted:()=>Hse.sZg,selu:()=>Hse.WfX,separableConv2d:()=>Hse.wdz,setdiff1dAsync:()=>Hse.F12,sigmoid:()=>Hse.ry7,sign:()=>Hse._SZ,signal:()=>Hse.vPA,sin:()=>Hse.F8e,sinh:()=>Hse.L0l,slice:()=>Hse.dik,slice1d:()=>Hse.Q$M,slice2d:()=>Hse.zAd,slice3d:()=>Hse.wck,slice4d:()=>Hse.R0O,softmax:()=>Hse.Vs9,softplus:()=>Hse.lw0,spaceToBatchND:()=>Hse.eDJ,sparse:()=>Hse.lMo,sparseToDense:()=>Hse.Zhr,spectral:()=>Hse.lOn,split:()=>Hse.lDo,sqrt:()=>Hse.RZD,square:()=>Hse.EwI,squaredDifference:()=>Hse.Pbu,squeeze:()=>Hse.r2V,stack:()=>Hse.t$z,step:()=>Hse.PMw,stridedSlice:()=>Hse.Ym9,string:()=>Hse.YjP,sub:()=>Hse.jbE,sum:()=>Hse.czq,tan:()=>Hse.Mlm,tanh:()=>Hse.ymU,tensor:()=>Hse.OEK,tensor1d:()=>Hse.tGX,tensor2d:()=>Hse.KtR,tensor3d:()=>Hse.$_$,tensor4d:()=>Hse.g9W,tensor5d:()=>Hse.Lpo,tensor6d:()=>Hse.yxw,tensorScatterUpdate:()=>Hse.NNh,tile:()=>Hse.Vsq,topk:()=>Hse.rfw,transpose:()=>Hse.mgz,truncatedNormal:()=>Hse.efE,unique:()=>Hse.AmM,unsortedSegmentSum:()=>Hse.zAU,unstack:()=>Hse.K$i,upperBound:()=>Hse.rni,variable:()=>Hse.bvq,where:()=>Hse._M9,whereAsync:()=>Hse.YJN,zeros:()=>Hse.Ul9,zerosLike:()=>Hse.POl});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{CSVDataset:()=>pae,Dataset:()=>tae,FileDataSource:()=>Aae,TextLineDataset:()=>oae,URLDataSource:()=>Sae,array:()=>iae,csv:()=>Cae,func:()=>Oae,generator:()=>Mae,microphone:()=>Rae,version_data:()=>Nae,webcam:()=>kae,zip:()=>rae});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{addImpl:()=>Qae,bincountImpl:()=>nle,bincountReduceImpl:()=>ile,bitwiseAndImpl:()=>rle,castImpl:()=>Wae,ceilImpl:()=>cle,concatImpl:()=>ple,equalImpl:()=>fle,expImpl:()=>_le,expm1Impl:()=>ble,floorDivImpl:()=>Ale,floorImpl:()=>Ele,gatherNdImpl:()=>Ole,gatherV2Impl:()=>Mle,greaterEqualImpl:()=>Dle,greaterImpl:()=>kle,lessEqualImpl:()=>Ule,lessImpl:()=>Ple,linSpaceImpl:()=>jle,logImpl:()=>Yle,maxImpl:()=>Wle,maximumImpl:()=>Xle,minimumImpl:()=>Zle,multiplyImpl:()=>eue,negImpl:()=>rue,notEqualImpl:()=>oue,prodImpl:()=>hue,raggedGatherImpl:()=>_ue,raggedRangeImpl:()=>vue,raggedTensorToTensorImpl:()=>wue,rangeImpl:()=>Iue,rsqrtImpl:()=>Aue,scatterImpl:()=>Oue,sigmoidImpl:()=>Mue,simpleAbsImpl:()=>Pae,sliceImpl:()=>Nue,sparseFillEmptyRowsImpl:()=>Lue,sparseReshapeImpl:()=>Pue,sparseSegmentReductionImpl:()=>Bue,sqrtImpl:()=>$ue,squaredDifferenceImpl:()=>zue,staticRegexReplaceImpl:()=>Gue,stridedSliceImpl:()=>Xue,stringNGramsImpl:()=>Kue,stringSplitImpl:()=>Que,stringToHashBucketFastImpl:()=>Jue,subImpl:()=>ece,tileImpl:()=>rce,topKImpl:()=>ace,transposeImpl:()=>uue,uniqueImpl:()=>lce});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{assertNotComplex:()=>wme,bindCanvasToFramebuffer:()=>Qfe,bindColorTextureToFramebuffer:()=>Jfe,bindTextureToProgramUniformSampler:()=>Zfe,bindTextureUnit:()=>Wfe,bindVertexBufferToProgramAttribute:()=>Hfe,callAndCheck:()=>Sfe,canBeRepresented:()=>Mfe,createFragmentShader:()=>Dfe,createFramebuffer:()=>Gfe,createProgram:()=>Pfe,createStaticIndexBuffer:()=>Vfe,createStaticVertexBuffer:()=>Ufe,createTexture:()=>jfe,createVertexShader:()=>Nfe,getBatchDim:()=>sme,getExtensionOrThrow:()=>Rfe,getFramebufferErrorMessage:()=>nme,getMaxTexturesInShader:()=>gme,getNumChannels:()=>zfe,getProgramUniformLocation:()=>Kfe,getProgramUniformLocationOrThrow:()=>qfe,getRowsCols:()=>ome,getShapeAs3D:()=>ame,getTextureShapeFromLogicalShape:()=>lme,getWebGLDisjointQueryTimerVersion:()=>_me,getWebGLErrorMessage:()=>kfe,getWebGLMaxTextureSize:()=>pme,hasExtension:()=>yme,isCapableOfRenderingToFloatTexture:()=>bme,isDownloadFloatTextureEnabled:()=>Tme,isReshapeFree:()=>cme,isWebGLFenceEnabled:()=>Eme,isWebGLVersionEnabled:()=>vme,linkProgram:()=>Bfe,logShaderSourceAndInfoLog:()=>Lfe,resetMaxTextureSize:()=>fme,resetMaxTexturesInShader:()=>mme,unbindColorTextureFromFramebuffer:()=>eme,unbindTextureUnit:()=>Xfe,validateFramebuffer:()=>tme,validateProgram:()=>$fe,validateTextureSize:()=>Yfe});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{bindVertexProgramAttributeStreams:()=>_ge,createBufferFromOutputTexture:()=>bge,createFloat16MatrixTexture:()=>cge,createFloat16PackedMatrixTexture:()=>gge,createFloat32MatrixTexture:()=>lge,createIndexBuffer:()=>sge,createPackedMatrixTexture:()=>fge,createUnsignedBytesMatrixTexture:()=>hge,createVertexBuffer:()=>rge,createVertexShader:()=>ige,downloadByteEncodedFloatMatrixFromOutputTexture:()=>xge,downloadFloat32MatrixFromBuffer:()=>Tge,downloadMatrixFromPackedOutputTexture:()=>wge,downloadPackedMatrixFromBuffer:()=>Ege,getInternalFormatForFloat16MatrixTexture:()=>uge,getInternalFormatForFloat16PackedMatrixTexture:()=>mge,getInternalFormatForFloat32MatrixTexture:()=>age,getInternalFormatForPackedMatrixTexture:()=>pge,getInternalFormatForUnsignedBytesMatrixTexture:()=>dge,uploadDenseMatrixToTexture:()=>yge,uploadPixelDataToTexture:()=>vge});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{Abs:()=>v3.Abs,Acos:()=>v3.Acos,Acosh:()=>v3.Acosh,AdadeltaOptimizer:()=>v3.AdadeltaOptimizer,AdagradOptimizer:()=>v3.AdagradOptimizer,AdamOptimizer:()=>v3.AdamOptimizer,AdamaxOptimizer:()=>v3.AdamaxOptimizer,Add:()=>v3.Add,AddN:()=>v3.AddN,All:()=>v3.All,Any:()=>v3.Any,ArgMax:()=>v3.ArgMax,ArgMin:()=>v3.ArgMin,Asin:()=>v3.Asin,Asinh:()=>v3.Asinh,Atan:()=>v3.Atan,Atan2:()=>v3.Atan2,Atanh:()=>v3.Atanh,AvgPool:()=>v3.AvgPool,AvgPool3D:()=>v3.AvgPool3D,AvgPool3DGrad:()=>v3.AvgPool3DGrad,AvgPoolGrad:()=>v3.AvgPoolGrad,BatchMatMul:()=>v3.BatchMatMul,BatchToSpaceND:()=>v3.BatchToSpaceND,Bincount:()=>v3.Bincount,BitwiseAnd:()=>v3.BitwiseAnd,BroadcastArgs:()=>v3.BroadcastArgs,BroadcastTo:()=>v3.BroadcastTo,Callback:()=>Hre,CallbackList:()=>E7,Cast:()=>v3.Cast,Ceil:()=>v3.Ceil,ClipByValue:()=>v3.ClipByValue,Complex:()=>v3.Complex,ComplexAbs:()=>v3.ComplexAbs,Concat:()=>v3.Concat,Conv2D:()=>v3.Conv2D,Conv2DBackpropFilter:()=>v3.Conv2DBackpropFilter,Conv2DBackpropInput:()=>v3.Conv2DBackpropInput,Conv3D:()=>v3.Conv3D,Conv3DBackpropFilterV2:()=>v3.Conv3DBackpropFilterV2,Conv3DBackpropInputV2:()=>v3.Conv3DBackpropInputV2,Cos:()=>v3.Cos,Cosh:()=>v3.Cosh,CropAndResize:()=>v3.CropAndResize,Cumprod:()=>v3.Cumprod,Cumsum:()=>v3.Cumsum,CustomCallback:()=>A7,DataStorage:()=>v3.DataStorage,DenseBincount:()=>v3.DenseBincount,DepthToSpace:()=>v3.DepthToSpace,DepthwiseConv2dNative:()=>v3.DepthwiseConv2dNative,DepthwiseConv2dNativeBackpropFilter:()=>v3.DepthwiseConv2dNativeBackpropFilter,DepthwiseConv2dNativeBackpropInput:()=>v3.DepthwiseConv2dNativeBackpropInput,Diag:()=>v3.Diag,Dilation2D:()=>v3.Dilation2D,Dilation2DBackpropFilter:()=>v3.Dilation2DBackpropFilter,Dilation2DBackpropInput:()=>v3.Dilation2DBackpropInput,Draw:()=>v3.Draw,ENV:()=>v3.ENV,EarlyStopping:()=>qre,Einsum:()=>v3.Einsum,Elu:()=>v3.Elu,EluGrad:()=>v3.EluGrad,Environment:()=>v3.Environment,Equal:()=>v3.Equal,Erf:()=>v3.Erf,Exp:()=>v3.Exp,ExpandDims:()=>v3.ExpandDims,Expm1:()=>v3.Expm1,FFT:()=>v3.FFT,Fill:()=>v3.Fill,FlipLeftRight:()=>v3.FlipLeftRight,Floor:()=>v3.Floor,FloorDiv:()=>v3.FloorDiv,FromPixels:()=>v3.FromPixels,FusedBatchNorm:()=>v3.FusedBatchNorm,FusedConv2D:()=>v3.FusedConv2D,FusedDepthwiseConv2D:()=>v3.FusedDepthwiseConv2D,GPGPUContext:()=>Ige,GatherNd:()=>v3.GatherNd,GatherV2:()=>v3.GatherV2,GraphModel:()=>voe,Greater:()=>v3.Greater,GreaterEqual:()=>v3.GreaterEqual,History:()=>I7,IFFT:()=>v3.IFFT,Identity:()=>v3.Identity,Imag:()=>v3.Imag,InputSpec:()=>C9,IsFinite:()=>v3.IsFinite,IsInf:()=>v3.IsInf,IsNan:()=>v3.IsNan,KernelBackend:()=>v3.KernelBackend,LRN:()=>v3.LRN,LRNGrad:()=>v3.LRNGrad,LayerVariable:()=>I9,LayersModel:()=>kee,LeakyRelu:()=>v3.LeakyRelu,Less:()=>v3.Less,LessEqual:()=>v3.LessEqual,LinSpace:()=>v3.LinSpace,Log:()=>v3.Log,Log1p:()=>v3.Log1p,LogSoftmax:()=>v3.LogSoftmax,LogicalAnd:()=>v3.LogicalAnd,LogicalNot:()=>v3.LogicalNot,LogicalOr:()=>v3.LogicalOr,LogicalXor:()=>v3.LogicalXor,LowerBound:()=>v3.LowerBound,MathBackendCPU:()=>Lae,MathBackendWebGL:()=>U_e,MatrixBandPart:()=>v3.MatrixBandPart,Max:()=>v3.Max,MaxPool:()=>v3.MaxPool,MaxPool3D:()=>v3.MaxPool3D,MaxPool3DGrad:()=>v3.MaxPool3DGrad,MaxPoolGrad:()=>v3.MaxPoolGrad,MaxPoolWithArgmax:()=>v3.MaxPoolWithArgmax,Maximum:()=>v3.Maximum,Mean:()=>v3.Mean,Min:()=>v3.Min,Minimum:()=>v3.Minimum,MirrorPad:()=>v3.MirrorPad,Mod:()=>v3.Mod,MomentumOptimizer:()=>v3.MomentumOptimizer,Multinomial:()=>v3.Multinomial,Multiply:()=>v3.Multiply,Neg:()=>v3.Neg,NonMaxSuppressionV3:()=>v3.NonMaxSuppressionV3,NonMaxSuppressionV4:()=>v3.NonMaxSuppressionV4,NonMaxSuppressionV5:()=>v3.NonMaxSuppressionV5,NotEqual:()=>v3.NotEqual,OP_SCOPE_SUFFIX:()=>v3.OP_SCOPE_SUFFIX,OneHot:()=>v3.OneHot,OnesLike:()=>v3.OnesLike,Optimizer:()=>v3.Optimizer,OptimizerConstructors:()=>v3.OptimizerConstructors,Pack:()=>v3.Pack,PadV2:()=>v3.PadV2,Pool:()=>v3.Pool,Pow:()=>v3.Pow,Prelu:()=>v3.Prelu,Prod:()=>v3.Prod,RMSPropOptimizer:()=>v3.RMSPropOptimizer,RNN:()=>Vte,RaggedGather:()=>v3.RaggedGather,RaggedRange:()=>v3.RaggedRange,RaggedTensorToTensor:()=>v3.RaggedTensorToTensor,Range:()=>v3.Range,Rank:()=>v3.Rank,Real:()=>v3.Real,RealDiv:()=>v3.RealDiv,Reciprocal:()=>v3.Reciprocal,Reduction:()=>v3.Reduction,Relu:()=>v3.Relu,Relu6:()=>v3.Relu6,Reshape:()=>v3.Reshape,ResizeBilinear:()=>v3.ResizeBilinear,ResizeBilinearGrad:()=>v3.ResizeBilinearGrad,ResizeNearestNeighbor:()=>v3.ResizeNearestNeighbor,ResizeNearestNeighborGrad:()=>v3.ResizeNearestNeighborGrad,Reverse:()=>v3.Reverse,RotateWithOffset:()=>v3.RotateWithOffset,Round:()=>v3.Round,Rsqrt:()=>v3.Rsqrt,SGDOptimizer:()=>v3.SGDOptimizer,ScatterNd:()=>v3.ScatterNd,SearchSorted:()=>v3.SearchSorted,Select:()=>v3.Select,Selu:()=>v3.Selu,Sequential:()=>Fee,Sigmoid:()=>v3.Sigmoid,Sign:()=>v3.Sign,Sin:()=>v3.Sin,Sinh:()=>v3.Sinh,Slice:()=>v3.Slice,Softmax:()=>v3.Softmax,Softplus:()=>v3.Softplus,SpaceToBatchND:()=>v3.SpaceToBatchND,SparseFillEmptyRows:()=>v3.SparseFillEmptyRows,SparseReshape:()=>v3.SparseReshape,SparseSegmentMean:()=>v3.SparseSegmentMean,SparseSegmentSum:()=>v3.SparseSegmentSum,SparseToDense:()=>v3.SparseToDense,SplitV:()=>v3.SplitV,Sqrt:()=>v3.Sqrt,Square:()=>v3.Square,SquaredDifference:()=>v3.SquaredDifference,StaticRegexReplace:()=>v3.StaticRegexReplace,Step:()=>v3.Step,StridedSlice:()=>v3.StridedSlice,StringNGrams:()=>v3.StringNGrams,StringSplit:()=>v3.StringSplit,StringToHashBucketFast:()=>v3.StringToHashBucketFast,Sub:()=>v3.Sub,Sum:()=>v3.Sum,SymbolicTensor:()=>O9,Tan:()=>v3.Tan,Tanh:()=>v3.Tanh,Tensor:()=>v3.Tensor,TensorBuffer:()=>v3.TensorBuffer,TensorScatterUpdate:()=>v3.TensorScatterUpdate,Tile:()=>v3.Tile,TopK:()=>v3.TopK,Transform:()=>v3.Transform,Transpose:()=>v3.Transpose,Unique:()=>v3.Unique,Unpack:()=>v3.Unpack,UnsortedSegmentSum:()=>v3.UnsortedSegmentSum,UpperBound:()=>v3.UpperBound,Variable:()=>v3.Variable,ZerosLike:()=>v3.ZerosLike,_FusedMatMul:()=>v3._FusedMatMul,abs:()=>v3.abs,acos:()=>v3.acos,acosh:()=>v3.acosh,add:()=>v3.add,addN:()=>v3.addN,all:()=>v3.all,any:()=>v3.any,argMax:()=>v3.argMax,argMin:()=>v3.argMin,asin:()=>v3.asin,asinh:()=>v3.asinh,atan:()=>v3.atan,atan2:()=>v3.atan2,atanh:()=>v3.atanh,avgPool:()=>v3.avgPool,avgPool3d:()=>v3.avgPool3d,backend:()=>v3.backend,backend_util:()=>v3.backend_util,basicLSTMCell:()=>v3.basicLSTMCell,batchNorm:()=>v3.batchNorm,batchNorm2d:()=>v3.batchNorm2d,batchNorm3d:()=>v3.batchNorm3d,batchNorm4d:()=>v3.batchNorm4d,batchToSpaceND:()=>v3.batchToSpaceND,bincount:()=>v3.bincount,bitwiseAnd:()=>v3.bitwiseAnd,booleanMaskAsync:()=>v3.booleanMaskAsync,broadcastArgs:()=>v3.broadcastArgs,broadcastTo:()=>v3.broadcastTo,broadcast_util:()=>v3.broadcast_util,browser:()=>v3.browser,buffer:()=>v3.buffer,callbacks:()=>Kre,cast:()=>v3.cast,ceil:()=>v3.ceil,clipByValue:()=>v3.clipByValue,clone:()=>v3.clone,complex:()=>v3.complex,concat:()=>v3.concat,concat1d:()=>v3.concat1d,concat2d:()=>v3.concat2d,concat3d:()=>v3.concat3d,concat4d:()=>v3.concat4d,constraints:()=>ce,conv1d:()=>v3.conv1d,conv2d:()=>v3.conv2d,conv2dTranspose:()=>v3.conv2dTranspose,conv3d:()=>v3.conv3d,conv3dTranspose:()=>v3.conv3dTranspose,copyRegisteredKernels:()=>v3.copyRegisteredKernels,cos:()=>v3.cos,cosh:()=>v3.cosh,cosineWindow:()=>v3.cosineWindow,cumprod:()=>v3.cumprod,cumsum:()=>v3.cumsum,customGrad:()=>v3.customGrad,data:()=>Le,denseBincount:()=>v3.denseBincount,deprecationWarn:()=>v3.deprecationWarn,depthToSpace:()=>v3.depthToSpace,depthwiseConv2d:()=>v3.depthwiseConv2d,deregisterOp:()=>nse,device_util:()=>v3.device_util,diag:()=>v3.diag,dilation2d:()=>v3.dilation2d,disableDeprecationWarnings:()=>v3.disableDeprecationWarnings,dispose:()=>v3.dispose,disposeVariables:()=>v3.disposeVariables,div:()=>v3.div,divNoNan:()=>v3.divNoNan,dot:()=>v3.dot,dropout:()=>v3.dropout,einsum:()=>v3.einsum,elu:()=>v3.elu,enableDebugMode:()=>v3.enableDebugMode,enableProdMode:()=>v3.enableProdMode,enclosingPowerOfTwo:()=>v3.enclosingPowerOfTwo,engine:()=>v3.engine,ensureShape:()=>v3.ensureShape,env:()=>v3.env,equal:()=>v3.equal,erf:()=>v3.erf,euclideanNorm:()=>v3.euclideanNorm,exp:()=>v3.exp,expandDims:()=>v3.expandDims,expm1:()=>v3.expm1,eye:()=>v3.eye,fft:()=>v3.fft,fill:()=>v3.fill,findBackend:()=>v3.findBackend,findBackendFactory:()=>v3.findBackendFactory,floor:()=>v3.floor,floorDiv:()=>v3.floorDiv,forceHalfFloat:()=>z_e,fused:()=>v3.fused,gather:()=>v3.gather,gatherND:()=>v3.gatherND,gather_util:()=>v3.gather_util,getBackend:()=>v3.getBackend,getGradient:()=>v3.getGradient,getKernel:()=>v3.getKernel,getKernelsForBackend:()=>v3.getKernelsForBackend,gpgpu_util:()=>$e,grad:()=>v3.grad,grads:()=>v3.grads,greater:()=>v3.greater,greaterEqual:()=>v3.greaterEqual,ifft:()=>v3.ifft,imag:()=>v3.imag,image:()=>v3.image,inTopKAsync:()=>v3.inTopKAsync,initializers:()=>de,input:()=>Bee,io:()=>v3.io,irfft:()=>v3.irfft,isFinite:()=>v3.isFinite,isInf:()=>v3.isInf,isNaN:()=>v3.isNaN,keep:()=>v3.keep,kernel_impls:()=>v3.kernel_impls,layers:()=>he,leakyRelu:()=>v3.leakyRelu,less:()=>v3.less,lessEqual:()=>v3.lessEqual,linalg:()=>v3.linalg,linspace:()=>v3.linspace,loadGraphModel:()=>boe,loadGraphModelSync:()=>Toe,loadLayersModel:()=>Dee,localResponseNormalization:()=>v3.localResponseNormalization,log:()=>v3.log,log1p:()=>v3.log1p,logSigmoid:()=>v3.logSigmoid,logSoftmax:()=>v3.logSoftmax,logSumExp:()=>v3.logSumExp,logicalAnd:()=>v3.logicalAnd,logicalNot:()=>v3.logicalNot,logicalOr:()=>v3.logicalOr,logicalXor:()=>v3.logicalXor,losses:()=>v3.losses,lowerBound:()=>v3.lowerBound,matMul:()=>v3.matMul,math:()=>v3.math,max:()=>v3.max,maxPool:()=>v3.maxPool,maxPool3d:()=>v3.maxPool3d,maxPoolWithArgmax:()=>v3.maxPoolWithArgmax,maximum:()=>v3.maximum,mean:()=>v3.mean,memory:()=>v3.memory,meshgrid:()=>v3.meshgrid,metrics:()=>pe,min:()=>v3.min,minimum:()=>v3.minimum,mirrorPad:()=>v3.mirrorPad,mod:()=>v3.mod,model:()=>Lee,models:()=>fe,moments:()=>v3.moments,movingAverage:()=>v3.movingAverage,mul:()=>v3.mul,multiRNNCell:()=>v3.multiRNNCell,multinomial:()=>v3.multinomial,neg:()=>v3.neg,nextFrame:()=>v3.nextFrame,norm:()=>v3.norm,notEqual:()=>v3.notEqual,oneHot:()=>v3.oneHot,ones:()=>v3.ones,onesLike:()=>v3.onesLike,op:()=>v3.op,outerProduct:()=>v3.outerProduct,pad:()=>v3.pad,pad1d:()=>v3.pad1d,pad2d:()=>v3.pad2d,pad3d:()=>v3.pad3d,pad4d:()=>v3.pad4d,pool:()=>v3.pool,pow:()=>v3.pow,prelu:()=>v3.prelu,print:()=>v3.print,prod:()=>v3.prod,profile:()=>v3.profile,raggedGather:()=>v3.raggedGather,raggedRange:()=>v3.raggedRange,raggedTensorToTensor:()=>v3.raggedTensorToTensor,rand:()=>v3.rand,randomGamma:()=>v3.randomGamma,randomNormal:()=>v3.randomNormal,randomStandardNormal:()=>v3.randomStandardNormal,randomUniform:()=>v3.randomUniform,randomUniformInt:()=>v3.randomUniformInt,range:()=>v3.range,ready:()=>v3.ready,real:()=>v3.real,reciprocal:()=>v3.reciprocal,registerBackend:()=>v3.registerBackend,registerCallbackConstructor:()=>$ee,registerGradient:()=>v3.registerGradient,registerKernel:()=>v3.registerKernel,registerOp:()=>ese,regularizers:()=>me,relu:()=>v3.relu,relu6:()=>v3.relu6,removeBackend:()=>v3.removeBackend,reshape:()=>v3.reshape,reverse:()=>v3.reverse,reverse1d:()=>v3.reverse1d,reverse2d:()=>v3.reverse2d,reverse3d:()=>v3.reverse3d,reverse4d:()=>v3.reverse4d,rfft:()=>v3.rfft,round:()=>v3.round,rsqrt:()=>v3.rsqrt,scalar:()=>v3.scalar,scatterND:()=>v3.scatterND,scatter_util:()=>v3.scatter_util,searchSorted:()=>v3.searchSorted,selu:()=>v3.selu,separableConv2d:()=>v3.separableConv2d,sequential:()=>Pee,serialization:()=>v3.serialization,setBackend:()=>v3.setBackend,setPlatform:()=>v3.setPlatform,setWebGLContext:()=>yfe,setdiff1dAsync:()=>v3.setdiff1dAsync,shared:()=>Pe,sigmoid:()=>v3.sigmoid,sign:()=>v3.sign,signal:()=>v3.signal,sin:()=>v3.sin,sinh:()=>v3.sinh,slice:()=>v3.slice,slice1d:()=>v3.slice1d,slice2d:()=>v3.slice2d,slice3d:()=>v3.slice3d,slice4d:()=>v3.slice4d,slice_util:()=>v3.slice_util,softmax:()=>v3.softmax,softplus:()=>v3.softplus,spaceToBatchND:()=>v3.spaceToBatchND,sparse:()=>v3.sparse,sparseToDense:()=>v3.sparseToDense,spectral:()=>v3.spectral,split:()=>v3.split,sqrt:()=>v3.sqrt,square:()=>v3.square,squaredDifference:()=>v3.squaredDifference,squeeze:()=>v3.squeeze,stack:()=>v3.stack,step:()=>v3.step,stridedSlice:()=>v3.stridedSlice,string:()=>v3.string,sub:()=>v3.sub,sum:()=>v3.sum,sumOutType:()=>v3.sumOutType,tan:()=>v3.tan,tanh:()=>v3.tanh,tensor:()=>v3.tensor,tensor1d:()=>v3.tensor1d,tensor2d:()=>v3.tensor2d,tensor3d:()=>v3.tensor3d,tensor4d:()=>v3.tensor4d,tensor5d:()=>v3.tensor5d,tensor6d:()=>v3.tensor6d,tensorScatterUpdate:()=>v3.tensorScatterUpdate,tensor_util:()=>v3.tensor_util,test_util:()=>v3.test_util,tidy:()=>v3.tidy,tile:()=>v3.tile,time:()=>v3.time,topk:()=>v3.topk,train:()=>v3.train,transpose:()=>v3.transpose,truncatedNormal:()=>v3.truncatedNormal,unique:()=>v3.unique,unregisterGradient:()=>v3.unregisterGradient,unregisterKernel:()=>v3.unregisterKernel,unsortedSegmentSum:()=>v3.unsortedSegmentSum,unstack:()=>v3.unstack,upcastType:()=>v3.upcastType,upperBound:()=>v3.upperBound,util:()=>v3.util,valueAndGrad:()=>v3.valueAndGrad,valueAndGrads:()=>v3.valueAndGrads,variable:()=>v3.variable,variableGrads:()=>v3.variableGrads,version:()=>Lwe,version_converter:()=>xoe,version_core:()=>v3.version_core,version_cpu:()=>uce,version_layers:()=>dee,version_webgl:()=>V_e,webgl:()=>j_e,webgl_util:()=>Be,where:()=>v3.where,whereAsync:()=>v3.whereAsync,zeros:()=>v3.zeros,zerosLike:()=>v3.zerosLike});const Ve=Blockly;Object.assign(Ve.Lang.ZhHans,{PYTHON_PYODIDE_IMAGE:"图像",PYTHON_PYODIDE_TOOL:"可教机器",PYTHON_PYODIDE_GAME:"生命游戏",PYTHON_PYODIDE_GAME_EPOCH:"代数",PYTHON_PYODIDE_GAME_START:"开始",PYTHON_PYODIDE_GAME_PAUSE:"暂停",PYTHON_PYODIDE_GAME_RANDOM:"随机初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3内核载入中...",PYTHON_PYODIDE_FILE_SYSTEM:"本地文件系统",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"载入本地文件夹"}),Object.assign(Ve.Lang.ZhHant,{PYTHON_PYODIDE_IMAGE:"影像",PYTHON_PYODIDE_TOOL:"可教機器",PYTHON_PYODIDE_GAME:"生命遊戲",PYTHON_PYODIDE_GAME_EPOCH:"代數",PYTHON_PYODIDE_GAME_START:"開始",PYTHON_PYODIDE_GAME_PAUSE:"暫停",PYTHON_PYODIDE_GAME_RANDOM:"隨機初始化",PYTHON_PYODIDE_GAME_RESET:"重置",PYTHON_PYODIDE_LOADING:"Python3核心載入...",PYTHON_PYODIDE_FILE_SYSTEM:"本機檔案系統",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"載入本機資料夾"}),Object.assign(Ve.Lang.En,{PYTHON_PYODIDE_IMAGE:"Image",PYTHON_PYODIDE_TOOL:"Teachable Machine",PYTHON_PYODIDE_GAME:"Game of Life",PYTHON_PYODIDE_GAME_EPOCH:"Iterations",PYTHON_PYODIDE_GAME_START:"Start",PYTHON_PYODIDE_GAME_PAUSE:"Pause",PYTHON_PYODIDE_GAME_RANDOM:"Random Initialization",PYTHON_PYODIDE_GAME_RESET:"Reset",PYTHON_PYODIDE_LOADING:"Python3 kernel loading...",PYTHON_PYODIDE_FILE_SYSTEM:"Local File System",PYTHON_PYODIDE_LOAD_FILE_SYSTEM:"Load Local Folder"}),Object.assign(Ve.Lang.ZhHans.MSG,{}),Object.assign(Ve.Lang.ZhHant.MSG,{}),Object.assign(Ve.Lang.En.MSG,{});const ze=Mixly,je={NAME_TYPE:"VARIABLE",allVariables:function(e){var t;if(e.getDescendants)t=e.getDescendants();else{if(!e.getAllBlocks)throw"Not Block or Workspace: "+e;t=e.getAllBlocks()}for(var n=Object.create(null),i=0;i<t.length;i++)for(var r=t[i].getVars(),s=0;s<r.length;s++){var o=r[s];o&&(n[o]=o)}var a=[];for(var l in n)a.push(n[l]);return a},renameVariable:function(e,t,n){Ve.Events.setGroup(!0);for(var i=n.getAllBlocks(),r=0;r<i.length;r++)i[r].renameVar(e,t);Ve.Events.setGroup(!1)},flyoutCategory:function(e){var t=je.allVariables(e),n=[];((o=Ve.utils.xml.createElement("block")).setAttribute("type","variables_global"),n.push(o),Ve.Blocks.variables_set)&&((o=Ve.utils.xml.createElement("block")).setAttribute("type","variables_set"),n.push(o));Ve.Blocks.variables_change&&((o=Ve.utils.xml.createElement("block")).setAttribute("type","variables_change"),n.push(o));Ve.Blocks.controls_type&&((o=Ve.utils.xml.createElement("block")).setAttribute("type","controls_type"),n.push(o));Ve.Blocks.controls_typeLists&&((o=Ve.utils.xml.createElement("block")).setAttribute("type","controls_typeLists"),n.push(o));if(Ve.Blocks.lists_zip){(o=Ve.utils.xml.createElement("block")).setAttribute("type","lists_zip"),o.setAttribute("inline","false");var i=Ve.utils.xml.createElement("mutation");i.setAttribute("items",2),o.appendChild(i);for(let e=0;e<2;e++){let t=Ve.utils.xml.createElement("value");t.setAttribute("name",`ADD${e}`),o.appendChild(t)}n.push(o)}Ve.Blocks.unpack_iterable_object&&((o=Ve.utils.xml.createElement("block")).setAttribute("type","unpack_iterable_object"),n.push(o));for(var r=0;r<t.length;r++){if(Ve.Blocks.variables_set){(o=Ve.utils.xml.createElement("block")).setAttribute("type","variables_set"),Ve.Blocks.variables_get&&o.setAttribute("gap",8),(a=Ve.utils.xml.createElement("field",null,t[r])).setAttribute("name","VAR");var s=Ve.utils.xml.createTextNode(t[r]);a.appendChild(s),o.appendChild(a),n.push(o)}if(Ve.Blocks.variables_get){var o,a;(o=Ve.utils.xml.createElement("block")).setAttribute("type","variables_get"),Ve.Blocks.variables_set&&o.setAttribute("gap",24),(a=Ve.utils.xml.createElement("field",null,t[r])).setAttribute("name","VAR");s=Ve.utils.xml.createTextNode(t[r]);a.appendChild(s),o.appendChild(a),n.push(o)}}return n},generateUniqueName:function(e){var t=je.allVariables(e),n="";if(t.length)for(var i=1,r="ijkmnopqrstuvwxyzabcdefgh",s=0,o=r.charAt(s);!n;){for(var a=!1,l=0;l<t.length;l++)if(t[l]==o){a=!0;break}a?(25==++s&&(s=0,i++),o=r.charAt(s),i>1&&(o+=i)):n=o}else n="i";return n}},Ye=je;
/**
* @license
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class Ge{constructor(e,t){if(this.variablePrefix_=t||"",this.reservedDict_=Object.create(null),e)for(var n=e.split(","),i=0;i<n.length;i++)this.reservedDict_[n[i]]=!0;this.reset()}static equals(e,t){return e==t}reset(){this.db_=Object.create(null),this.dbReverse_=Object.create(null),this.variableMap_=null}setVariableMap(e){this.variableMap_=e}getNameForUserVariable_(e){if(!this.variableMap_)return null;var t=this.variableMap_.getVariableById(e);return t?t.name:null}getName(e,t){if(t==Ye.NAME_TYPE){var n=this.getNameForUserVariable_(e);n&&(e=n)}var i=e+"_"+t,r=t==Ye.NAME_TYPE||t==Ge.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"";if(i in this.db_)return r+this.db_[i];var s=this.getDistinctName(e,t);return this.db_[i]=s.substr(r.length),s}getDistinctName(e,t){for(var n=this.safeName_(e),i="";this.dbReverse_[n+i]||n+i in this.reservedDict_;)i=i?i+1:2;return n+=i,this.dbReverse_[n]=!0,(t==Ye.NAME_TYPE||t==Ge.DEVELOPER_VARIABLE_TYPE?this.variablePrefix_:"")+n}safeName_(e){return e?(e=encodeURI(e.replace(/ /g,"_")).replace(/[^,\w]/g,"_"),-1!="0123456789".indexOf(e[0])&&(e="my_"+e)):e="unnamed",e}}Ge.DEVELOPER_VARIABLE_TYPE="DEVELOPER_VARIABLE";const He=Ge,We=330,Xe={init:function(){this.setColour(We),this.appendDummyInput().appendField(new Ve.FieldTextInput(""),"VAR"),this.setOutput(!0),this.setTooltip(Ve.Msg.VARIABLES_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){He.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")}},qe={init:function(){this.setColour(We),this.appendValueInput("VALUE").appendField(new Ve.FieldTextInput(""),"VAR").appendField(Ve.Msg.MIXLY_VALUE2),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.VARIABLES_SET_TOOLTIP)},getVars:function(){var e=this.getFieldValue("VAR");return null==e?[]:e.split(",")},renameVar:function(e,t){He.equals(e,this.getFieldValue("VAR"))&&this.setFieldValue(t,"VAR")}},Ke={init:function(){this.setColour(We);var e=[[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"],[Ve.Msg.LANG_MATH_BOOLEAN,"bool"],[Ve.Msg.LANG_MATH_STRING,"str"],[Ve.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Ve.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Ve.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Ve.Msg.LANG_MATH_BYTE,"bytes"]];this.appendValueInput("MYVALUE").appendField(new Ve.FieldDropdown(e),"OP"),this.setOutput(!0)}},Ze={init:function(){this.setColour(We),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PYTHON_GLOBAL).setCheck("var"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.TEXT_PRINT_TOOLTIP)}},Qe={init:function(){this.setColour(We),this.appendValueInput("DATA").appendField(Ve.Msg.MICROBIT_PYTHON_TYPE),this.setOutput(!0),this.setTooltip(Ve.Msg.MICROBIT_PYTHON_TYPE)}},Je={init:function(){this.setColour(We),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_CONTORL_GET_TYPE).appendField(new Ve.FieldDropdown([[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.MIXLY_MICROBIT_TYPE_FLOAT,"float"],[Ve.Msg.MIXLY_MICROBIT_TYPE_STRING,"str"],[Ve.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Ve.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Ve.Msg.MIXLY_MICROBIT_TYPE_DICT,"dict"],[Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Ve.Msg.LANG_MATH_BYTE,"bytes"],[Ve.Msg.LOGIC_NULL,"type(None)"]]),"type"),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("type");return Ve.Msg.MICROBIT_controls_TypeLists+{int:Ve.Msg.LANG_MATH_INT,float:Ve.Msg.MIXLY_MICROBIT_TYPE_FLOAT,str:Ve.Msg.MIXLY_MICROBIT_TYPE_STRING,list:Ve.Msg.MIXLY_MICROBIT_TYPE_LIST,tuple:Ve.Msg.MIXLY_MICROBIT_TYPE_TUPLE,dict:Ve.Msg.MIXLY_MICROBIT_TYPE_DICT,set:Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,image:Ve.Msg.MIXLY_MICROBIT_IMAGE,bytes:Ve.Msg.LANG_MATH_BYTE,NoneType:Ve.Msg.LOGIC_NULL}[t]})}},et={init:function(){this.setColour(We),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new Ve.icons.MutatorIcon(["lists_zip_item"],this)),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_zip_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("lists_zip_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP)}}},tt={init:function(){this.setColour(We),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},nt={init:function(){this.setColour(We),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM_TOOLTIP),this.contextMenu=!1}},it={init:function(){this.setColour(We),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_VARIABLE_UNPACK).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_PYTHON_LISTS_ZIP_ITEM,"*"],[Ve.Msg.MIXLY_MICROBIT_TYPE_DICT,"**"]]),"TYPE"),this.setTooltip(""),this.setOutput(!0)}},rt=120,st={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_NAME_MAIN),this.appendStatementInput("DO").appendField(""),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},ot={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETUP),this.appendStatementInput("DO").appendField(""),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_SETUP)}},at={init:function(){var e=[[Ve.Msg.MIXLY_mSecond,"delay"],[Ve.Msg.MIXLY_uSecond,"delayMicroseconds"]];this.setColour(rt),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY).appendField(new Ve.FieldDropdown(e),"UNIT").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#id9"),this.wiki={"zh-hans":{page:["Arduino AVR","控制","延时"]}}}},lt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CONTROL_END_PROGRAM),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_END_TOOLTIP)}},ut={init:function(){this.setColour(rt),this.appendValueInput("IF0").setCheck([Boolean,Number]).appendField(Ve.Msg.CONTROLS_IF_MSG_IF),this.appendStatementInput("DO0").appendField(Ve.Msg.CONTROLS_IF_MSG_THEN),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setHelpUrl("https://mixly.readthedocs.io/zh_CN/latest/arduino/03.Control.html#if"),this.setMutator(new Ve.icons.MutatorIcon(["controls_if_elseif","controls_if_else"],this));var e=this;this.setTooltip(function(){return e.elseifCount_||e.elseCount_?!e.elseifCount_&&e.elseCount_?Ve.Msg.CONTROLS_IF_TOOLTIP_2:e.elseifCount_&&!e.elseCount_?Ve.Msg.CONTROLS_IF_TOOLTIP_3:e.elseifCount_&&e.elseCount_?Ve.Msg.CONTROLS_IF_TOOLTIP_4:"":Ve.Msg.CONTROLS_IF_TOOLTIP_1}),this.elseifCount_=0,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var r=this.elseifCount_;r>0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+r).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_if_if");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_if_elseif");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_if_else");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_if_elseif":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_if_else":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_if_elseif":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_if_else":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+e).appendField(Ve.Msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ct={init:function(){this.setColour(rt),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PYTHON_RANGE_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},dt={init:function(){this.setColour(rt),this.appendValueInput("LIST").setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CONTROLS_FOREACH_INPUT),this.appendValueInput("VAR").appendField(Ve.Msg.CONTROLS_FOREACH_INPUT_ITEM),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("“%1”","")})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ht={init:function(){this.setColour(rt),this.appendValueInput("BOOL").setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_MICROBIT_JS_CURRENT).appendField(new Ve.FieldDropdown(this.OPERATORS),"MODE"),this.appendStatementInput("DO").appendField(Ve.Msg.LANG_CONTROLS_WHILEUNTIL_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return{WHILE:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE,UNTIL:Ve.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}[t]})}},pt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TRY),this.appendStatementInput("try"),this.appendValueInput("IF1").appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO1").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["controls_except","controls_finally"],this)),this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_TRY_TOOLTIP),this.elseifCount_=1,this.elseCount_=0},mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;var e=document.createElement("mutation");return this.elseifCount_&&e.setAttribute("elseif",this.elseifCount_),this.elseCount_&&e.setAttribute("else",1),e},domToMutation:function(e){var t=this,n=[],i=[];this.elseCount_&&this.removeInput("ELSE");for(var r=this.elseifCount_;r>0;r--)t.getInputTargetBlock("IF"+r)&&t.getInputTargetBlock("IF"+r).previousConnection?n[r]=t.getInputTargetBlock("IF"+r).previousConnection:n[r]=null,this.removeInput("IF"+r),t.getInputTargetBlock("DO"+r)&&t.getInputTargetBlock("DO"+r).previousConnection?i[r]=t.getInputTargetBlock("DO"+r).previousConnection:i[r]=null,this.removeInput("DO"+r);this.elseifCount_=parseInt(e.getAttribute("elseif"),10),this.elseCount_=parseInt(e.getAttribute("else"),10);for(r=1;r<=this.elseifCount_;r++)this.appendValueInput("IF"+r).setCheck([Boolean,Number]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+r).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY);for(r=n.length-2;r>0;r--)n[r]&&n[r].reconnect(this,"IF"+r);for(r=i.length-2;r>0;r--)i[r]&&i[r].reconnect(this,"DO"+r)},decompose:function(e){var t=e.newBlock("controls_try");t.initSvg();for(var n=t.getInput("STACK").connection,i=1;i<=this.elseifCount_;i++){var r=e.newBlock("controls_except");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}if(this.elseCount_){var s=e.newBlock("controls_finally");s.initSvg(),n.connect(s.previousConnection)}return t},compose:function(e){this.elseCount_&&this.removeInput("ELSE"),this.elseCount_=0;for(var t=this.elseifCount_;t>0;t--)this.removeInput("IF"+t),this.removeInput("DO"+t);this.elseifCount_=0;for(var n=e.getInputTargetBlock("STACK"),i=[null],r=[null],s=null;n;){switch(n.type){case"controls_except":this.elseifCount_++,i.push(n.valueConnection_),r.push(n.statementConnection_);break;case"controls_finally":this.elseCount_++,s=n.statementConnection_;break;default:throw Error("Unknown block type: "+n.type)}n=n.nextConnection&&n.nextConnection.targetBlock()}this.updateShape_(),this.reconnectChildBlocks_(i,r,s)},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=1;t;){switch(t.type){case"controls_except":var i=this.getInput("IF"+n),r=this.getInput("DO"+n);t.valueConnection_=i&&i.connection.targetConnection,t.statementConnection_=r&&r.connection.targetConnection,n++;break;case"controls_finally":r=this.getInput("ELSE");t.statementConnection_=r&&r.connection.targetConnection;break;default:throw"Unknown block type."}t=t.nextConnection&&t.nextConnection.targetBlock()}},rebuildShape_:function(){var e=[null],t=[null],n=null;this.getInput("ELSE")&&(n=this.getInput("ELSE").connection.targetConnection);for(var i=1;this.getInput("IF"+i);){var r=this.getInput("IF"+i),s=this.getInput("DO"+i);console.log(r.connection.targetConnection),e.push(r.connection.targetConnection),t.push(s.connection.targetConnection),i++}this.updateShape_(),this.reconnectChildBlocks_(e,t,n)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var e=1;this.getInput("IF"+e);)this.removeInput("IF"+e),this.removeInput("DO"+e),e++;for(e=1;e<=this.elseifCount_;e++)this.appendValueInput("IF"+e).setCheck([Number,Boolean]).appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.appendStatementInput("DO"+e).appendField("");this.elseCount_&&this.appendStatementInput("ELSE").appendField(Ve.Msg.MIXLY_PYTHON_FINALLY)},reconnectChildBlocks_:function(e,t,n){for(var i=1;i<=this.elseifCount_;i++)e[i]&&e[i].reconnect(this,"IF"+i),t[i]&&t[i].reconnect(this,"DO"+i);n&&n.reconnect(this,"ELSE")}},ft={init:function(){this.setColour(rt);var e=new Ve.FieldDropdown(this.OPERATORS);this.appendDummyInput().appendField(e,"FLOW").appendField(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_INPUT_OFLOOP),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_FLOW_STATEMENTS_TOOLTIP);var t=this;this.setTooltip(function(){var e=t.getFieldValue("FLOW");return{BREAK:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK,CONTINUE:Ve.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}[e]})},onchange:function(){if(this.workspace){var e=!1,t=this;do{if("controls_repeat"==t.type||"controls_for"==t.type||"controls_forEach"==t.type||"controls_repeat_ext"==t.type||"controls_whileUntil"==t.type||"do_while"==t.type){e=!0;break}t=t.getSurroundParent()}while(t);e?this.setWarningText(null):this.setWarningText(Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_WARNING)}}},mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.CONTROLS_FOR_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},gt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_WITH).appendField(new Ve.FieldTextInput("i"),"VAR"),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_DO),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){return Ve.Msg.MIXLY_PYTHON_CONTROLS_FOR_RANGE_TOOLTIP.replace("%1",e.getFieldValue("VAR"))})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}};ht.OPERATORS=[[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"WHILE"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"UNTIL"]],ft.OPERATORS=[[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK,"BREAK"],[Ve.Msg.LANG_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE,"CONTINUE"]];const _t={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_IF_TITLE_IF),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.CONTROLS_IF_IF_TOOLTIP),this.contextMenu=!1}},yt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSEIF_TOOLTIP),this.contextMenu=!1}},vt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_IF_ELSE_TITLE_ELSE),this.setPreviousStatement(!0),this.setTooltip(Ve.Msg.CONTROLS_IF_ELSE_TOOLTIP),this.contextMenu=!1}},bt={init:function(){this.setColour(rt),this.appendDummyInput().appendField("try"),this.appendStatementInput("STACK"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.contextMenu=!1}},Tt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_EXCEPT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_EXCEPT_TOOLTIP)}},xt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_FINALLY),this.setPreviousStatement(!0),this.contextMenu=!1,this.setTooltip(Ve.Msg.MIXLY_MIXPY_CONTROL_FINALLY_TOOLTIP)}},Et={init:function(){this.jsonInit({message0:Ve.Msg.CONTROLS_REPEAT_TITLE,args0:[{type:"input_value",name:"TIMES"}],previousStatement:null,nextStatement:null,colour:rt,tooltip:Ve.Msg.CONTROLS_REPEAT_TOOLTIP,helpUrl:Ve.Msg.CONTROLS_REPEAT_HELPURL}),this.appendStatementInput("DO")}},wt={init:function(){this.setColour(rt),this.appendValueInput("BOOL").appendField("lambda"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_STAT),this.setOutput(!0)}},It={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_PASS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_PASS_TOOLTIP)}},At={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_START),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PARAMS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_TOOLTIP)}},St={init:function(){this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_REPEAT+Ve.Msg.MIXLY_DO),this.appendStatementInput("input_data").setCheck(null),this.appendValueInput("select_data").setCheck(null).appendField(Ve.Msg.CONTROLS_OPERATOR_UNTIL).appendField(new Ve.FieldDropdown([[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_WHILE,"true"],[Ve.Msg.LANG_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL,"false"]]),"type"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(rt),this.setTooltip("do-while loop"),this.setHelpUrl("")}},Ct={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_OP_GARBAGE_COLLECT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ot={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_ALLOC),this.setOutput(!0)}},Mt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_MEM_FREE),this.setOutput(!0)}},kt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET+Ve.Msg.MIXLY_DEVICE+"ID"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_GET_UNIQUE_IDEN)}},Rt={init:function(){this.setColour(rt),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_RTC_TIMESTAMP),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TIMESTAMP_TO_DATA),this.setInputsInline(!0),this.setOutput(!0,Number)}},Nt={init:function(){this.setColour(rt),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET_UNIQUE_IDEN),this.setOutput(!0)}},Dt=230;Ve.FieldTextInput.math_number_validator=function(e){return String(e)},Ve.FieldTextInput.math_number_validator_include_blank=function(e){if(""===e)return"";return/^-?(0X|0x|0O|0o|0B|0b)?[a-fA-F0-9]{1,}(\.[a-fA-F0-9]+)?$/.test(e)?String(e):null};const Ft={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator),"NUM"),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Lt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_TOOLTIP}[t]})}},Pt={init:function(){this.setColour(Dt);this.appendDummyInput("").appendField(Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT).appendField(new Ve.FieldDropdown([["π","pi"],["e","e"]]),"CONSTANT"),this.setOutput(!0,Number);var e=this;this.setTooltip(function(){var t=e.getFieldValue("CONSTANT");return{pi:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_PI_MP_TOOLTIP,e:Ve.Msg.MIXLY_PYTHON_MATH_CONSTANT_E_MP_TOOLTIP}[t]})}},Bt={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+","ADD"],["-","MINUS"],["×","MULTIPLY"],["÷","DIVIDE"],["%","QUYU"],["//","ZHENGCHU"],["**","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},$t={init:function(){this.setColour(Dt),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown([["+=","ADD"],["-=","MINUS"],["×=","MULTIPLY"],["÷=","DIVIDE"],["%=","QUYU"],["//=","ZHENGCHU"],["**=","POWER"]]),"OP"),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{ADD:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_ADD,MINUS:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS,MULTIPLY:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY,DIVIDE:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,QUYU:Ve.Msg.MATH_MODULO_TOOLTIP,ZHENGCHU:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE,POWER:Ve.Msg.MATH_ARITHMETIC_TOOLTIP_POWER}[t]})}},Ut={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("A").setCheck(Number),this.appendValueInput("B").setCheck(Number).appendField(new Ve.FieldDropdown([["&","&"],["|","|"],[">>",">>"],["<<","<<"]]),"OP"),this.setInputsInline(!0),this.setTooltip("位运算")}},Vt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown([["sin","SIN"],["cos","COS"],["tan","TAN"],["asin","ASIN"],["acos","ACOS"],["atan","ATAN"],["-","-"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]),"OP");var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{SIN:Ve.Msg.MATH_TRIG_TOOLTIP_SIN,COS:Ve.Msg.MATH_TRIG_TOOLTIP_COS,TAN:Ve.Msg.MATH_TRIG_TOOLTIP_TAN,ASIN:Ve.Msg.MATH_TRIG_TOOLTIP_ASIN,ACOS:Ve.Msg.MATH_TRIG_TOOLTIP_ACOS,ATAN:Ve.Msg.MATH_TRIG_TOOLTIP_ATAN,LN:Ve.Msg.MATH_SINGLE_TOOLTIP_LN}[t]})}},zt={init:function(){var e=[[Ve.Msg.MATH_BIN,"bin"],[Ve.Msg.MATH_OCT,"oct"],[Ve.Msg.MATH_HEX,"hex"]];this.setColour(Dt),this.setOutput(!0,String),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{bin:Ve.Msg.MATH_DEC_TOOLTIP_BIN,oct:Ve.Msg.MATH_DEC_TOOLTIP_OCT,hex:Ve.Msg.MATH_DEC_TOOLTIP_HEX}[e]})}},jt={init:function(){var e=[[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"],[Ve.Msg.MATH_ABS,"fabs"],[Ve.Msg.MATH_SQRT,"sqrt"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{sqrt:Ve.Msg.MATH_SINGLE_TOOLTIP_ROOT,fabs:Ve.Msg.MATH_SINGLE_TOOLTIP_ABS,sq:Ve.Msg.MATH_SINGLE_TOOLTIP_SQ,round:Ve.Msg.MATH_SINGLE_TOOLTIP_ROUND,ceil:Ve.Msg.MATH_SINGLE_TOOLTIP_CEIL,floor:Ve.Msg.MATH_SINGLE_TOOLTIP_FLOOR}[e]})}},Yt={init:function(){var e=[[Ve.Msg.MIXLY_MAX,"max"],[Ve.Msg.MIXLY_MIN,"min"]];this.setColour(Dt),this.appendValueInput("A").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown(e),"OP").appendField("("),this.appendValueInput("B").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(","),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(")"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{max:Ve.Msg.MIXLY_TOOLTIP_MATH_MAX,min:Ve.Msg.MIXLY_TOOLTIP_MATH_MIN}[e]})}},Gt={init:function(){var e=[[Ve.Msg.MATH_TWO,"two"],[Ve.Msg.MATH_EIGHT,"eight"],[Ve.Msg.MATH_TEN,"ten"],[Ve.Msg.MATH_SIXTEEN,"sixteen"]];this.setColour(Dt),this.appendDummyInput("").appendField(Ve.Msg.MATH_BA),this.appendValueInput("NUM").appendField(new Ve.FieldDropdown(e),"OP").appendField(Ve.Msg.MATH_JinZhi).setCheck(Number),this.appendDummyInput("").appendField(Ve.Msg.MATH_ZHW).appendField(new Ve.FieldDropdown(e),"OP2").appendField(Ve.Msg.MATH_JinZhi),this.setFieldValue("ten","OP2"),this.setOutput(!0),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP"),n={two:Ve.Msg.MATH_Before_two,eight:Ve.Msg.MATH_Before_eight,ten:Ve.Msg.MATH_Before_ten,sixteen:Ve.Msg.MATH_Before_sixteen},i=t.getFieldValue("OP2"),r={two:Ve.Msg.MATH_Behind_two,eight:Ve.Msg.MATH_Behind_eight,ten:Ve.Msg.MATH_Behind_ten,sixteen:Ve.Msg.MATH_Behind_sixteen};return n[e]+r[i]})}},Ht={init:function(){var e=[[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(Dt),this.setOutput(!0,Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_RANDOM).appendField(new Ve.FieldDropdown(e),"TYPE"),this.appendValueInput("FROM").setCheck(Number).appendField(Ve.Msg.LANG_CONTROLS_FOR_INPUT_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LANG_MATH_RANDOM_INT_INPUT_TO),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TYPE"),n={int:Ve.Msg.LANG_MATH_INT,float:Ve.Msg.LANG_MATH_FLOAT_RANDOM};return Ve.Msg.MATH_RANDOM_INT_TOOLTIP+n[e]})}},Wt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_CONSTRAIN),this.appendValueInput("LOW").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_LOW),this.appendValueInput("HIGH").setCheck(Number).appendField(Ve.Msg.LANG_MATH_CONSTRAIN_INPUT_HIGH),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_CONSTRAIN_TOOLTIP)}},Xt={init:function(){this.setColour(Dt),this.appendValueInput("NUM",Number).appendField(Ve.Msg.MIXLY_MAP).setCheck(Number),this.appendValueInput("fromLow",Number).appendField(Ve.Msg.MIXLY_MAP_FROM).setCheck(Number),this.appendValueInput("fromHigh",Number).appendField(",").setCheck(Number),this.appendValueInput("toLow",Number).appendField(Ve.Msg.MIXLY_MAP_TO).setCheck(Number),this.appendValueInput("toHigh",Number).appendField(",").setCheck(Number),this.appendDummyInput("").appendField("]"),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_MAP)}},qt={init:function(){this.setColour(Dt),this.appendDummyInput().appendField(new Ve.FieldTextInput("0",Ve.FieldTextInput.math_number_validator_include_blank),"NUM"),this.setOutput(!0),this.setTooltip(Ve.Msg.MATH_NUMBER_TOOLTIP)}},Kt={init:function(){this.setColour(Dt),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.LANG_MATH_RANDOM_SEED),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_MATH_RANDOM_SEED)}},Zt={init:function(){this.setColour(Dt),this.setOutput(!0,Number),this.appendValueInput("VALUE").setCheck(Number),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MATH_ROUND).appendField(Ve.Msg.TEXT_KEEP),this.appendDummyInput().appendField(Ve.Msg.TEXT_DECIMAL),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MATH_ROUND_NEW_TOOLTIP)}},Qt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"],[Ve.Msg.MIXLY_TO_BITES,"b"],[Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_INT,"bti"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOINT,float:Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOFLOAT,b:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOBYTE}[e]})}},Jt={init:function(){var e=[[Ve.Msg.MIXLY_TO_INT,"int"],[Ve.Msg.MIXLY_TO_FLOAT,"float"]];this.setColour(Dt),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{int:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOINT,float:Ve.Msg.MIXLY_TOOLTIP_TEXT_TOFLOAT}[e]})}},en=Xt,tn={init:function(){this.setColour(Dt),this.appendValueInput("VAR").appendField(Ve.Msg.LANG_MATH_BYTE+Ve.Msg.MIXLY_TO_HEX),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOHEX)}},nn={init:function(){this.setColour(Dt),this.itemCount_=1,this.setMutator(new Ve.icons.MutatorIcon(["lists_create_with_item"],this)),this.appendDummyInput("DUMMY").appendField(Ve.Msg.MIXLY_PRODUCT+Ve.Msg.MIXLY_GENERATE_CARTESIAN_PRODUCT),this.appendValueInput("REPEAT").appendField(Ve.Msg.MIXLY_EVERY_PER_ELEPER_ELEMENT),this.appendDummyInput().appendField(Ve.Msg.CONTROLS_REPEAT_TITLE_TIMES),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP),this.updateShape_()},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("lists_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput(`ADD${i}`).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput(`ADD${n}`);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else{let e=0;for(;this.getInput(`ADD${e}`);)this.removeInput(`ADD${e}`),e++}if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.MIXLY_EMPTY_REMINDER);else for(let e=0;e<this.itemCount_;e++)this.appendValueInput(`ADD${e}`),this.moveInputBefore(`ADD${e}`,"REPEAT")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},rn={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SET_RADIAN),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TRANS_TO_ANGLE),this.setInputsInline(!0)}},sn={init:function(){this.setColour(Dt),this.setOutput(!0),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SET_DEGREE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TRANS_TO_RADIAN),this.setInputsInline(!0)}},on=160,an={init:function(){this.setColour(on),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}},ln={init:function(){this.setColour(on),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Ve.FieldMultilineInput("Hello\nMixly"),"VALUE").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TEXT_LINES_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}},un={init:function(){this.setColour(on),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TEXT_BYTES).appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput(""),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TEXT_TEXT_TOOLTIP)},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}};Ve.FieldTextInput.char_validator=function(e){if(e.length>1&&"\\"===e.charAt(0)){var t=e.charAt(1);if("0"===t||"b"===t||"f"===t||"n"===t||"r"===t||"t"===t||"\\"===t||"'"===t)return String(e).substring(0,2);if("x"===t&&"0"===e.charAt(2)&&"B"===e.charAt(3))return String(e).substring(0,4)}return String(e).substring(0,1)};const cn={init:function(){this.setColour(on),this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput("",Ve.FieldTextInput.char_validator),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TEXT_CHAR_TOOLTIP)},newQuote_:function(e){if(1==e)var t="../../media/quote2.png";else t="../../media/quote3.png";return new Ve.FieldImage(t,7,12,'"')}},dn={init:function(){this.setColour(on),this.appendValueInput("A").setCheck([String,Number]),this.appendValueInput("B").setCheck([String,Number]).appendField(Ve.Msg.MIXLY_TEXT_JOIN),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_JOIN)}},hn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXLY_TOCHAR),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOCHAR)}},pn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.MIXLY_TOASCII),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_TOASCII)}},fn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOSTRING),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOTEXT)}},mn={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_LENGTH),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TEXT_LENGTH)}},gn={init:function(){this.WHERE_OPTIONS=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.TEXT_GET_INDEX_RANDOM+1+Ve.Msg.TEXT_CHARAT2,"RANDOM"]],this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.LISTS_GET_INDEX_GET,"MODE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(Ve.Msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=e.getFieldValue("WHERE"),i="";switch(t+" "+n){case"GET FROM_START":case"GET FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE RANDOM":i=Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM}return"FROM_START"!=n&&"FROM_END"!=n||(i+=" "+Ve.Msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",Ve.Msg.ONE_BASED_INDEXING?"#1":"#0")),i});var t=this;this.setTooltip(function(){var e=t.getFieldValue("WHERE"),n={FROM_START:Ve.Msg.LISTS_GET_INDEX_FROM_START,FROM_END:Ve.Msg.LISTS_GET_INDEX_FROM_END,RANDOM:Ve.Msg.TEXT_GET_INDEX_RANDOM};return Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+n[e]+"n"+Ve.Msg.TEXT_CHARAT2})},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("statement",!this.outputConnection);var t=this.getInput("AT").type==Ve.INPUT_VALUE;return e.setAttribute("at",t),e},domToMutation:function(e){var t="true"==e.getAttribute("statement");this.updateStatement_(t),e="false"!=e.getAttribute("at"),this.updateAt_(e)},updateStatement_:function(e){e!=!this.outputConnection&&(this.unplug(!0,!0),e?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(e){this.removeInput("AT"),this.removeInput("ORDINAL",!0),e?(this.appendValueInput("AT").setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL").appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT");var t=new Ve.FieldDropdown(this.WHERE_OPTIONS,function(t){var n="FROM_START"==t||"FROM_END"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT").appendField(t,"WHERE"),Ve.Msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}},_n={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setOutput(!0),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_RETURN+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.LISTS_GET_INDEX_FROM_START+"n"+Ve.Msg.TEXT_CHARAT2)}},yn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput().appendField(Ve.Msg.TEXT_RANDOM_CHAR),this.setOutput(!0),this.setTooltip(Ve.Msg.TEXT_RANDOM_CHAR_TOOLTIP)}},vn={init:function(){this.WHERE_OPTIONS_1=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Ve.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),Ve.Msg.TEXT_CHARAT2&&this.appendDummyInput("ORDINAL"+e).appendField(Ve.Msg.TEXT_CHARAT2)):this.appendDummyInput("AT"+e);var n=new Ve.FieldDropdown(this["WHERE_OPTIONS_"+e],function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=t){var r=this.sourceBlock_;return r.updateAt_(e,i),r.setFieldValue(n,"WHERE"+e),null}});this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},bn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("AT1").appendField(Ve.Msg.LISTS_GET_INDEX_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT2),this.setInputsInline(!0),this.setOutput(!0,["List",String]),this.setTooltip(Ve.Msg._GET_TEXT_SUBLIST_TOOLTIP)}},Tn={init:function(){var e=[[Ve.Msg.MIXLY_EQUALS,"==="],[Ve.Msg.MIXLY_STARTSWITH,"startswith"],[Ve.Msg.MIXLY_ENDSWITH,"endswith"]];this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(new Ve.FieldDropdown(e),"DOWHAT").setCheck(String),this.setOutput(!0,[Boolean,Number]),this.setInputsInline(!0)}},xn={init:function(){this.setColour(on),this.appendValueInput("STR1").setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_COMPARETO).setCheck(String),this.setOutput(!0,Number),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_COMPARETO_HELP)}},En={init:function(){var e=[[Ve.Msg.TEXT_UPPER,"upper"],[Ve.Msg.TEXT_TITLE,"title"],[Ve.Msg.TEXT_CAPITALIZE,"capitalize"],[Ve.Msg.TEXT_SWAPCASE,"swapcase"],[Ve.Msg.TEXT_LOWER,"lower"]];this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"CAPITAL").setCheck(String),this.setOutput(!0,String);var t=this;this.setTooltip(function(){var e=t.getFieldValue("CAPITAL");return{upper:Ve.Msg.MIXLY_MIXPY_TEXT_UPPER_TOOLTIP,title:Ve.Msg.MIXLY_MIXPY_TEXT_TITLE_TOOLTIP,swapcase:Ve.Msg.MIXLY_MIXPY_TEXT_SWAPCASE_TOOLTIP,capitalize:Ve.Msg.MIXLY_MIXPY_TEXT_CAPITALIZE_TOOLTIP,lower:Ve.Msg.MIXLY_MIXPY_TEXT_LOWER_TOOLTIP}[e]})}},wn={init:function(){var e=[[Ve.Msg.TEXT_LJUST,"ljust"],[Ve.Msg.TEXT_CENTER,"center"],[Ve.Msg.TEXT_RJUST,"rjust"]];this.setColour(on),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"CENTER").setCheck(String),this.appendValueInput("WID").appendField(Ve.Msg.MIXLY_WIDTH).setCheck(Number),this.appendValueInput("Symbol").appendField(Ve.Msg.MIXLY_RECT_Fill).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_CENTER_TOOLTIP)}},In={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).setCheck(String),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_MID+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER).setCheck(String),this.appendDummyInput().appendField(Ve.Msg.MIXLY_LIST_INDEX),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FIND_TOOLTIP)}},An={init:function(){this.setColour(on),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_USE_STR).setCheck(String),this.appendValueInput("LIST").appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_SEQ).setCheck("List","Tuple","Set","Dict"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_GET_STR),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TEXT_JOIN_SEQ_TOOLTIP)}},Sn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_MIXPY_REPLACE).setCheck(String),this.appendValueInput("STR2").appendField(Ve.Msg.LISTS_SET_INDEX_INPUT_TO).setCheck(String),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_REPLACE_TOOLTIP)}},Cn={init:function(){this.setColour(on),this.appendValueInput("VAR"),this.appendValueInput("VAL").appendField(Ve.Msg.LIST_SPLIT_AS),this.appendDummyInput("").appendField(Ve.Msg.LIST_SPLIT),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_SPLIT_TOOLTIP),this.setInputsInline(!0)}},On={init:function(){var e=[[Ve.Msg.TEXT_TRIM_BOTH,"strip"],[Ve.Msg.TEXT_TRIM_LEFT,"lstrip"],[Ve.Msg.TEXT_TRIM_RIGHT,"rstrip"]];this.setColour(on),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_STRIM),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"TOWHAT"),this.appendDummyInput("").appendField(Ve.Msg.TEXT_BLANK),this.setOutput(!0,String),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("TOWHAT");return{strip:Ve.Msg.TEXT_TRIM_BOTH_TOOLTIP,lstrip:Ve.Msg.TEXT_TRIM_LEFT_TOOLTIP,rstrip:Ve.Msg.TEXT_TRIM_RIGHT_TOOLTIP}[e]})}},Mn={init:function(){this.setColour(on),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendDummyInput("").appendField(new Ve.FieldTextInput("str"),"VAR"),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("text_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.PROCEDURES_BEFORE_PARAMS)}},getVars:function(){if(null!=this.getFieldValue("VAR"))return-1==this.getFieldValue("VAR").indexOf("'")&&-1==this.getFieldValue("VAR").indexOf('"')?[this.getFieldValue("VAR")]:[]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},kn={init:function(){this.setColour(on),this.appendDummyInput().appendField(Ve.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Rn={init:function(){this.setColour(on),this.appendDummyInput().appendField(Ve.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Nn=bn,Dn=xn,Fn=_n,Ln={init:function(){this.setColour(on),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT),this.appendValueInput("VAR").setCheck(String),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_create_with_item"],this)),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TEXT_FORMAT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("text_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("text_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField();else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.PROCEDURES_BEFORE_PARAMS)}}},Pn={init:function(){this.setColour(on);var e=[[Ve.Msg.MIXPY_TEXT_ENCODE,"encode"],[Ve.Msg.MIXPY_TEXT_DECODE,"decode"]];this.appendDummyInput().appendField(new Ve.FieldDropdown([["ASCII","ASCII"],["gb2312","gb2312"],["gbk","gbk"],["utf-8","utf-8"],["utf-16","utf-16"],["utf-32","utf-32"]]),"CODE").appendField(" "),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.LANG_MATH_STRING),this.setOutput(!0,String),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_TEXT_ENCODE_DECODE_TOOLTIP)}},Bn={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.MIXLY_PYTHON_TEXT_EVAL),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TEXT_EVAL_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TEXT_EVAL_TOOLTIP)}},$n={init:function(){this.setColour(on),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.MIXLY_PYTHON_OS_SYSTEM),this.setInputsInline(!0),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_OS_SYSTEM_TOOLTIP)}},Un=260,Vn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_INDEX_HELPURL),this.setColour(Un),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM)}},zn={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Un),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Ve.Msg.TEXT_CHARAT_TAIL+" "+Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.PYTHON_LISTS_GET_SUBLIST_TOOLTIP)}},jn={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row").setCheck(null).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.DATAFRAME_RAW),this.appendValueInput("col").setCheck(null).appendField(Ve.Msg.DATAFRAME_COLUMN),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(Un),this.setTooltip(""),this.setHelpUrl("")}},Yn={init:function(){this.appendValueInput("LIST").setCheck(null),this.appendValueInput("row_start").setCheck(null).appendField(Ve.Msg.MIXLY_GET+" "+Ve.Msg.DATAFRAME_RAW+" ["),this.appendValueInput("row_end").setCheck(null).appendField(","),this.appendValueInput("col_start").setCheck(null).appendField(") "+Ve.Msg.DATAFRAME_COLUMN+" ["),this.appendValueInput("col_end").setCheck(null).appendField(","),this.appendDummyInput().appendField(") "+Ve.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setOutput(!0,"List"),this.setColour(Un),this.setTooltip(""),this.setHelpUrl("")}},Gn={init:function(){this.setColour(Un),this.appendDummyInput("").appendField(new Ve.FieldTextInput("mylist"),"VAR").appendField("[").appendField("]"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("lists_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Hn={init:function(){this.setColour(Un),this.appendDummyInput("").appendField(new Ve.FieldTextInput("mylist"),"VAR").appendField(" = [").appendField(new Ve.FieldTextInput("0,0,0"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_LISTS_CREATE_WITH_TEXT2)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Wn={init:function(){this.setColour(Un),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_LIST),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Xn={init:function(){this.setColour(Un),this.appendDummyInput().appendField(Ve.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},qn={init:function(){this.setColour(Un),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_LIST_ASSIGN_AT),this.appendValueInput("TO").appendField(Ve.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.LANG_LISTS_SET_INDEX_TOOLTIP)}},Kn={init:function(){this.setColour(Un),this.TYPE=[[Ve.Msg.MIXLY_blockpy_set_add,"append"],[Ve.Msg.MIXLY_MICROBIT_LIST_EXTEND,"extend"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(new Ve.FieldDropdown(this.TYPE),"OP").appendField(Ve.Msg.MIXLY_MICROBIT_LIST_A_ITEM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_JS_LIST_TO_END),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{append:Ve.Msg.MIXLY_TOOLTIP_LIST_APPEND,extend:Ve.Msg.LISTS_EXTEND_TOOLTIP}[t]})}},Zn={init:function(){this.setColour(Un),this.appendValueInput("LIST"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},Qn={init:function(){this.setColour(Un),this.appendValueInput("LIST"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+Ve.Msg.MIXLY_MICROBIT_RANDOM),this.appendDummyInput().appendField(Ve.Msg.LANG_LISTS_GET_INDEX2+Ve.Msg.LISTS_GET_RANDOM_SUBLIST),this.setTooltip(Ve.Msg.LISTS_GET_RANDOM_SUBLIST_TOOLTIP),this.setOutput(!0,"List")}},Jn={init:function(){this.setColour(Un),this.appendValueInput("LIST"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_JS_LIST_INSERT_AT),this.appendValueInput("VALUE").appendField(Ve.Msg.MIXLY_MICROBIT_JS_LIST_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.LANG_LISTS_SET_INDEX_TOOLTIP),this.setTooltip(Ve.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT)}},ei={init:function(){this.setColour(Un),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_JS_LIST_REVERSE),this.setTooltip(Ve.Msg.LANG_LISTS_CLEAR_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ti={init:function(){this.setColour(Un),this.appendValueInput("VAR"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_CLEAR),this.setTooltip(Ve.Msg.LANG_LISTS_REVERSE_TOOLTIP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ni={init:function(){this.setColour(Un),this.TYPE=[[Ve.Msg.SERIES_INDEX,"del"],[Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE,"remove"]],this.appendValueInput("LIST").setCheck("List"),this.appendValueInput("DATA").appendField(Ve.Msg.MIXLY_MIXPY_LISTS_REMOVE).appendField(new Ve.FieldDropdown(this.TYPE),"OP"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("OP");return{del:Ve.Msg.LISTS_SET_INDEX_TOOLTIP_DELETE,remove:Ve.Msg.MIXLY_TOOLTIP_LIST_REMOVE}[t]})}},ii={init:function(){this.setColour(Un),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(Ve.Msg.MIXLY_MICROBIT_LIST_POP),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM)}},ri={init:function(){var e=[[Ve.Msg.MIXLY_LIST_INDEX,"INDEX"],[Ve.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Un),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Ve.Msg.HTML_VALUE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_DE).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{INDEX:Ve.Msg.MIXLY_TOOLTIP_LIST_FIND_INDEX,COUNT:Ve.Msg.MIXLY_TOOLTIP_LIST_FIND_COUNT}[e]})}},si={init:function(){var e=[[Ve.Msg.MIXLY_LIST_LEN,"LEN"],[Ve.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[Ve.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[Ve.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[Ve.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[Ve.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[Ve.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[Ve.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Un),this.setOutput(!0,Number),this.appendValueInput("data"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{LEN:Ve.Msg.LISTS_LENGTH_TOOLTIP,SUM:Ve.Msg.MATH_ONLIST_TOOLTIP_SUM,MAX:Ve.Msg.MATH_ONLIST_TOOLTIP_MAX,MIN:Ve.Msg.MATH_ONLIST_TOOLTIP_MIN,AVERAGE:Ve.Msg.MATH_ONLIST_TOOLTIP_AVERAGE,MEDIAN:Ve.Msg.MATH_ONLIST_TOOLTIP_MEDIAN,MODE:Ve.Msg.MATH_ONLIST_TOOLTIP_MODE,STD_DEV:Ve.Msg.MATH_ONLIST_TOOLTIP_STD_DEV}[e]})}},oi={init:function(){this.jsonInit({args0:[{type:"input_value",name:"LIST",check:"List"},{type:"field_dropdown",name:"TYPE",options:[[Ve.Msg.LISTS_SORT_TYPE_NUMERIC,"NUMERIC"],[Ve.Msg.LISTS_SORT_TYPE_TEXT,"TEXT"],[Ve.Msg.LISTS_SORT_TYPE_IGNORECASE,"IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[[Ve.Msg.LISTS_SORT_ORDER_ASCENDING,"1"],[Ve.Msg.LISTS_SORT_ORDER_DESCENDING,"-1"]]}],message0:Ve.Msg.LISTS_SORT_TITLE,inputsInline:!0,output:"List",colour:Un,tooltip:Ve.Msg.LISTS_SORT_TOOLTIP,helpUrl:Ve.Msg.LISTS_SORT_HELPURL})}},ai={init:function(){var e=[[Ve.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"],[Ve.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD,"array"]];this.setColour(Un),this.appendValueInput("VAR").setCheck("List"),this.appendDummyInput("").appendField(Ve.Msg.A_TO_B).appendField(new Ve.FieldDropdown(e),"OP");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{tuple:Ve.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_TUPLE,set:Ve.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_SET,array:Ve.Msg.MIXLY_TOOLTIP_CONVERT_LIST_TO_ARRAY}[e]}),this.setInputsInline(!0),this.setOutput(!0)}},li={init:function(){this.setColour(Un),this.appendDummyInput("").appendField("[").appendField(new Ve.FieldTextInput("0,0,0"),"CONTENT").appendField("]"),this.setInputsInline(!0),this.setOutput(!0)}},ui={init:function(){this.setColour(Un),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setMutator(new Ve.icons.MutatorIcon(["lists_create_with_item"],this)),this.setTooltip(Ve.Msg.LISTS_CREATE_WITH_PYTHON_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("lists_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("lists_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.LISTS_CREATE_PYTHON_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.blockpy_LISTS_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ci={init:function(){var e=[[Ve.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Ve.Msg.MIXLY_MICROBIT_TYPE_TUPLE,"tuple"],[Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Un),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.A_TO_B).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0),this.setOutput(!0)}},di={init:function(){this.setColour(Un),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(Ve.Msg.OBJECT_DELETE),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hi={init:function(){this.setColour(Un),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOLIST),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOLIST)}},pi=Gn,fi=Hn,mi=Vn,gi=zn,_i=qn,yi=Jn,vi=ni,bi=hi,Ti={init:function(){this.setColour(Un),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_USE_LIST),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TO_INDEX_SEQUENCE),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},xi={init:function(){this.setColour(Un),this.appendDummyInput().appendField(Ve.Msg.blockpy_USE_LIST),this.appendValueInput("LIST"),this.appendValueInput("VALUE").appendField(Ve.Msg.MIXLY_TO_INDEX_SEQUENCE).appendField(Ve.Msg.MIXLY_INDEX+Ve.Msg.MIXLY_STARTSWITH),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_TOTO_INDEX_SEQUENC_TOOLTIP)}},Ei={init:function(){this.setColour(Un),this.appendValueInput("CON"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_MIXGO_MUSIC_SHOW_IN),this.appendValueInput("LIST"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MID),this.setInputsInline(!0),this.setOutput(!0)}},wi=345,Ii={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new Ve.FieldTextInput("mydict"),"VAR").appendField(new Ve.FieldLabel(Ve.Msg.DICTS_CREATE_WITH_INPUT_WITH),"TIP"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("dicts_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var e=[],t=0;this.getInput("ADD"+t);t++)e.push(this.getFieldValue("KEY"+t)),this.removeInput("ADD"+t);if(0==this.itemCount_)this.getField("TIP").setValue(Ve.Msg.DICTS_CREATE_EMPTY_TITLE);else{this.getField("TIP").setValue(Ve.Msg.DICTS_CREATE_WITH_INPUT_WITH);for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldTextInput(e.length>t?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ai={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},Si={init:function(){this.setColour(wi),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ci={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_KEYS),this.setTooltip(Ve.Msg.DICTS_KEYS_TOOLTIP),this.setOutput(!0,"List")}},Oi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_TOOLTIP)}},Mi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_GET_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.setOutput(!0),this.setTooltip(Ve.Msg.DICTS_GET_DEFAULT_TOOLTIP)}},ki={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_ADD),this.appendDummyInput(),this.appendValueInput("VAR").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_ADD_OR_CHANGE_TOOLTIP)}},Ri={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_DELETE_IN),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DELETE_VALUE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_DELETE_TOOLTIP)}},Ni={init:function(){this.setColour(wi),this.appendValueInput("DICT2").setCheck("Dict").appendField(Ve.Msg.MAKE_DICT),this.appendValueInput("DICT").setCheck("Dict").appendField(Ve.Msg.DICT_UPDATE),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MID),this.setTooltip(Ve.Msg.DICTS_UPDATE_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Di={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_CLEAR),this.setTooltip(Ve.Msg.DICTS_CLEAR_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_ITEMS),this.setTooltip(Ve.Msg.DICTS_ITEMS_TOOLTIP),this.setOutput(!0,"List")}},Li={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_VALUES),this.setTooltip(Ve.Msg.DICTS_VALUES_TOOLTIP),this.setOutput(!0,"List")}},Pi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_LENGTH),this.setTooltip(Ve.Msg.DICT_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Bi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.DICT_DELDICT),this.setTooltip(Ve.Msg.DICTS_DEL_TOOLTIP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$i={init:function(){this.MODE=[[Ve.Msg.DICTS_ADD_OR_CHANGE,"INSERT"],[Ve.Msg.MIXLY_MICROBIT_JS_DELETE_VAR,"DELETE"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("AT2"),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).appendField(Ve.Msg.DICTS_ADD_VALUE),this.updateAt_(!0),this.setInputsInline(!0),this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t="";switch(e.getFieldValue("WHERE")){case"INSERT":t=Ve.Msg.DICTS_ADD_TOOLTIP;break;case"DELETE":t=Ve.Msg.DICTS_DELETE_TOOLTIP}return t})},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",t),e},domToMutation:function(e){var t="true"==e.getAttribute("at2");this.updateAt_(t)},updateAt_:function(e){this.removeInput("AT2"),this.removeInput("ORDINAL",!0),e?this.appendValueInput("AT2").setCheck(Number):this.appendDummyInput("AT2");var t=new Ve.FieldDropdown(this.MODE,function(t){var n="INSERT"==t;if(n!=e){var i=this.sourceBlock_;return i.updateAt_(n),i.setFieldValue(t,"WHERE"),null}});this.getInput("AT2").appendField(t,"WHERE")}},Ui={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_DICT_POP),this.appendValueInput("KEY"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setTooltip(Ve.Msg.DICT_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},Vi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.DICTS_SET_DEFAULT),this.appendDummyInput("").appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_SETDEFAULT_TOOLTIP)}},zi={init:function(){this.setColour(wi),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),"TIP").appendField(" "),this.itemCount_=3,this.updateShape_(),this.setOutput(!0,"Dict"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setMutator(new Ve.icons.MutatorIcon(["dicts_create_with_item"],this)),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("dicts_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("dicts_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var e=[],t=0;this.getInput("ADD"+t);t++)e.push(this.getFieldValue("KEY"+t)),this.removeInput("ADD"+t);if(0==this.itemCount_)this.getField("TIP").setValue(Ve.Msg.LOGIC_NULL+Ve.Msg.MIXLY_MICROBIT_TYPE_DICT);else{this.getField("TIP").setValue(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT);for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldTextInput(e.length>t?e[t]:0==t?'"key"':'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ji={init:function(){this.setColour(wi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TODICT),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TODICT)}},Yi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Gi={init:function(){this.setColour(wi),this.appendValueInput("VAR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CONVERT_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Hi={init:function(){this.setColour(wi),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("VAR1").appendField("key1"),this.appendValueInput("VAR2").appendField("index"),this.appendValueInput("VAR3").appendField("key2"),this.appendValueInput("VAR4").appendField("key3"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CONVERT_TO_JSON_TOOLTIP),this.setOutput(!0)}},Wi={init:function(){this.setColour(wi),this.appendValueInput("DICT"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TO_JSON),this.setTooltip(Ve.Msg.MIXLY_TO_JSON_TOOLTIP),this.setOutput(!0)}},Xi=210,qi={init:function(){var e=Ve.RTL?[["=","EQ"],["≠","NEQ"],[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["=","EQ"],["≠","NEQ"],["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{EQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_EQ,NEQ:Ve.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,LT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LT,LTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_LTE,GT:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GT,GTE:Ve.Msg.LOGIC_COMPARE_TOOLTIP_GTE}[e]}),this.prevBlocks_=[null,null]}},Ki={init:function(){var e=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]],t=Ve.RTL?[[">","LT"],["≥","LTE"],["<","GT"],["≤","GTE"]]:[["<","LT"],["≤","LTE"],[">","GT"],["≥","GTE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"OP1"),this.appendValueInput("C").appendField(new Ve.FieldDropdown(t),"OP2"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_COMPARE_CONTINOUS_TOOLTIP)}},Zi={init:function(){var e=[[Ve.Msg.LOGIC_OPERATION_AND,"AND"],[Ve.Msg.LOGIC_OPERATION_OR,"OR"],[Ve.Msg.LOGIC_OPERATION_NOR,"NOR"],[Ve.Msg.LOGIC_OPERATION_XOR,"XOR"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("A").setCheck([Boolean,Number]),this.appendValueInput("B").setCheck([Boolean,Number]).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{AND:Ve.Msg.LOGIC_OPERATION_TOOLTIP_AND,OR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_OR,NOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_NOR,XOR:Ve.Msg.LOGIC_OPERATION_TOOLTIP_XOR}[e]})}},Qi={init:function(){this.setColour(Xi),this.setOutput(!0,Boolean),this.appendValueInput("BOOL").setCheck([Number,Boolean]).appendField(Ve.Msg.LOGIC_NEGATE_TITLE),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Ji={init:function(){var e=[[Ve.Msg.LOGIC_BOOLEAN_TRUE,"TRUE"],[Ve.Msg.LOGIC_BOOLEAN_FALSE,"FALSE"]];this.setColour(Xi),this.setOutput(!0,Boolean),this.appendDummyInput().appendField(new Ve.FieldDropdown(e),"BOOL"),this.setTooltip(Ve.Msg.LOGIC_BOOLEAN_TOOLTIP)}},er={init:function(){this.setColour(Xi),this.setOutput(!0),this.appendDummyInput().appendField(Ve.Msg.LOGIC_NULL),this.setTooltip(Ve.Msg.LOGIC_NULL_TOOLTIP)}},tr={init:function(){this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(Ve.Msg.LOGIC_TERNARY_IF_TRUE),this.appendValueInput("C").appendField(Ve.Msg.LOGIC_TERNARY_IF_FALSE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_LOGIT_TRUEORFALSE)}},nr={init:function(){var e=[[Ve.Msg.TEXT_APPEND_TO,"in"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT_IN,"not in"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").setCheck([String,"List"]).appendField(new Ve.FieldDropdown(e),"BOOL"),this.appendDummyInput("").appendField(Ve.Msg.MICROBIT_LOGIC_IS_IN),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.IN)}},ir={init:function(){var e=[[Ve.Msg.MIXLY_PYTHON_LOGIC_IS,"is"],[Ve.Msg.MIXLY_PYTHON_LOGIC_IS_NOT,"is not"]];this.setColour(Xi),this.appendValueInput("A"),this.appendValueInput("B").appendField(new Ve.FieldDropdown(e),"BOOL"),this.setOutput(!0,Boolean),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_LOGIC_IS_TOOLTIP)}},rr={init:function(){this.setColour(Xi),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOBOOL),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOBOOL)}},sr={init:function(){this.setColour(0),this.appendValueInput("fn").setCheck(String).appendField(Ve.Msg.MIXLY_PYTHON_STORAGE_OPEN_FILE_WITH_OS+"(For Windows)"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},or={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"],[Ve.Msg.MIXLY_ADD,"a"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_ADD,"ab"],[Ve.Msg.MIXLY_R_W,"r+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_R_W,"rb+"],[Ve.Msg.MIXLY_W_R,"w+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_W_R,"wb+"],[Ve.Msg.MIXLY_A_R,"a+"],[Ve.Msg.MATH_BIN+Ve.Msg.MIXLY_A_R,"ab+"]]),"MODE"),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_AS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r})},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ar={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},lr={init:function(){this.setColour(0),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE);this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,"r"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,"w"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,"rb"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE,"wb"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_TEXT_ENCODE).appendField(new Ve.FieldDropdown([["ANSI","ANSI"],["gbk","gbk"],["utf-8","utf-8"]]),"CODE"),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setOutput(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_USE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MODE,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_OPEN_FILE,s=Ve.Msg.MIXLY_BELONG,o=Ve.Msg.PY_STORAGE_FILE_OBJECT;return n+{r:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_READ,w:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_WRITE,rb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_READ,wb:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_BIT_WRITE}[t]+s+i+r+o})}},ur={init:function(){this.setColour(0),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE+Ve.Msg.MIXLY_MICROBIT_TYPE_STRING+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_WRITE)}},cr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES,"readlines"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String)}},dr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,"read"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,"readline"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE,"readlines"]]),"MODE"),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER;return n+{read:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_NO_MORE_THAN_SIZE,readline:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE,readlines:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ALL_LINES_NO_MORE_THAN_SIZE}[t]+"x"+i})}},hr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FROM_FILE),this.setNextStatement(!0),this.appendValueInput("SIZE").setCheck(Number).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_ONE_LINE_NO_MORE_THAN_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MICROBIT_PYTHON_TYPE)}},pr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.HTML_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CAN_WRITE_ORNOT1)}},fr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILENAME),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILENAME)}},mr={init:function(){this.setColour(0),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CLOSE_FILE)}},gr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_LIST_ALL_FILES)}};Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE;const _r={init:function(){this.setColour(0),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE,"remove"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_DIRS,"removedirs"]]),"MODE"),this.appendValueInput("FILE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_DELETE_FILE)}},yr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_FILE_SIZE+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SIZE)}},vr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RETURN_FILE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PRESENT_LOCATION),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_TELL)}},br={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck("Variable").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,"start"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,"current"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END,"end"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET),this.appendValueInput("SIZE").setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE"),n=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_SET_FILE_POSITION+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CURRENT_POSITION,i=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHARACTER,r=Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_OFFSET;return n+" "+{start:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_START,current:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_CURRENT,end:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_FILE_SEEK_END}[t]+r+"x"+i})}},Tr={init:function(){this.setColour(0),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET_CURRENT_DIR)}},xr={init:function(){this.setColour(0),this.appendValueInput("PATH").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_SET),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,"mkdir"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MAKEDIRS,"makedirs"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1);var e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_PATH+"x"+Ve.Msg.MIXLY_ESP32_SET+{mkdir:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,makedirs:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Er={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME),this.appendValueInput("NEWFILE").setCheck(String).appendField(Ve.Msg.MIXLY_AS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_RENAME)}},wr={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_CHANGE_DIR)}},Ir={init:function(){this.setColour(0),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_FILE,"isfile"],[Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_DIR,"isdir"]]),"MODE"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,Boolean);let e=this;this.setTooltip(function(){var t=e.getFieldValue("MODE");return Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH+"x"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_IS_OR_NOT+{isfile:Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_MKDIR,isdir:Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKEDIRS}[t]})}},Ar={init:function(){this.setColour(0),this.appendValueInput("SPISUB").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"SPI").setCheck("var"),this.appendValueInput("PINSUB").appendField("CS"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE).setCheck("var"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP+Ve.Msg.LISTS_SET_INDEX_INPUT_TO).appendField(Ve.Msg.MIXLY_SD_CARD),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Sr={init:function(){this.setColour(0),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SD_CARD),this.appendValueInput("DIR").setCheck(String).appendField(Ve.Msg.MIXLY_SDCARD_MOUNT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip()}},Cr={init:function(){var e=Ve.Procedures.findLegalName("",this),t=new Ve.FieldTextInput(e,Ve.Procedures.rename);t.setSpellcheck(!1),this.appendDummyInput().appendField(t,"NAME").appendField("","PARAMS"),this.setMutator(new Ve.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText(Ve.Msg.PROCEDURES_DEFNORETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_DEFNORETURN_TOOLTIP),this.setHelpUrl(Ve.Msg.PROCEDURES_DEFNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:function(e){this.hasStatements_!==e&&(e?(this.appendStatementInput("STACK").appendField(Ve.Msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=e)},updateParams_:function(){var e="";this.arguments_.length&&(e=Ve.Msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),Ve.Events.disable();try{this.setFieldValue(e,"PARAMS")}finally{Ve.Events.enable()}},mutationToDom:function(e){var t=Ve.utils.xml.createElement("mutation");e&&t.setAttribute("name",this.getFieldValue("NAME"));for(var n=0;n<this.argumentVarModels_.length;n++){var i=Ve.utils.xml.createElement("arg"),r=this.argumentVarModels_[n];i.setAttribute("name",r.name),i.setAttribute("varid",r.getId()),e&&this.paramIds_&&i.setAttribute("paramId",this.paramIds_[n]),t.appendChild(i)}return this.hasStatements_||t.setAttribute("statements","false"),t},domToMutation:function(e){this.arguments_=[],this.argumentVarModels_=[];for(var t,n=0;t=e.childNodes[n];n++)if("arg"==t.nodeName.toLowerCase()){var i=t.getAttribute("name"),r=t.getAttribute("varid")||t.getAttribute("varId");this.arguments_.push(i);var s=Ve.Variables.getOrCreateVariablePackage(this.workspace,r,i,"");null!=s?this.argumentVarModels_.push(s):console.log("Failed to create a variable with name "+i+", ignoring.")}this.updateParams_(),Ve.Procedures.mutateCallers(this),this.setStatements_("false"!==e.getAttribute("statements"))},saveExtraState:function(){if(!this.argumentVarModels_.length&&this.hasStatements_)return null;const e=Object.create(null);if(this.argumentVarModels_.length){e.params=[];for(let t=0;t<this.argumentVarModels_.length;t++)e.params.push({name:this.argumentVarModels_[t].name,id:this.argumentVarModels_[t].getId()})}return this.hasStatements_||(e.hasStatements=!1),e},loadExtraState:function(e){if(this.arguments_=[],this.argumentVarModels_=[],e.params)for(let t=0;t<e.params.length;t++){const n=e.params[t],i=Ve.Variables.getOrCreateVariablePackage(this.workspace,n.id,n.name,"");this.arguments_.push(i.name),this.argumentVarModels_.push(i)}this.updateParams_(),Ve.Procedures.mutateCallers(this),this.setStatements_(!1!==e.hasStatements)},decompose:function(e){var t=Ve.utils.xml.createElement("block");t.setAttribute("type","procedures_mutatorcontainer");var n=Ve.utils.xml.createElement("statement");n.setAttribute("name","STACK"),t.appendChild(n);for(var i=n,r=0;r<this.arguments_.length;r++){var s=Ve.utils.xml.createElement("block");s.setAttribute("type","procedures_mutatorarg");var o=Ve.utils.xml.createElement("field");o.setAttribute("name","NAME");var a=Ve.utils.xml.createTextNode(this.arguments_[r]);o.appendChild(a),s.appendChild(o);var l=Ve.utils.xml.createElement("next");s.appendChild(l),i.appendChild(s),i=l}var u=Ve.Xml.domToBlock(t,e);return"procedures_defreturn"==this.type?u.setFieldValue(this.hasStatements_,"STATEMENTS"):u.removeInput("STATEMENT_INPUT"),Ve.Procedures.mutateCallers(this),u},compose:function(e){this.arguments_=[],this.paramIds_=[],this.argumentVarModels_=[];for(var t=e.getInputTargetBlock("STACK");t&&!t.isInsertionMarker();){var n=t.getFieldValue("NAME");this.arguments_.push(n);var i=this.workspace.getVariable(n,"");this.argumentVarModels_.push(i),this.paramIds_.push(t.id),t=t.nextConnection&&t.nextConnection.targetBlock()}this.updateParams_(),Ve.Procedures.mutateCallers(this);var r=e.getFieldValue("STATEMENTS");if(null!==r&&(r="TRUE"==r,this.hasStatements_!=r))if(r)this.setStatements_(!0),this.statementConnection_&&this.statementConnection_.reconnect(this,"STACK"),this.statementConnection_=null;else{var s=this.getInput("STACK").connection;if(this.statementConnection_=s.targetConnection,this.statementConnection_){var o=s.targetBlock();o.unplug(),o.bumpNeighbours()}this.setStatements_(!1)}},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(e,t){var n=this.workspace.getVariableById(e);if(""==n.type){for(var i=n.name,r=this.workspace.getVariableById(t),s=!1,o=0;o<this.argumentVarModels_.length;o++)this.argumentVarModels_[o].getId()==e&&(this.arguments_[o]=r.name,this.argumentVarModels_[o]=r,s=!0);s&&(this.displayRenamedVar_(i,r.name),Ve.Procedures.mutateCallers(this))}},updateVarName:function(e){for(var t=e.name,n=!1,i=0;i<this.argumentVarModels_.length;i++)if(this.argumentVarModels_[i].getId()==e.getId()){var r=this.arguments_[i];this.arguments_[i]=t,n=!0}n&&(this.displayRenamedVar_(r,t),Ve.Procedures.mutateCallers(this))},displayRenamedVar_:function(e,t){this.updateParams_();const n=this.getIcon(Ve.icons.MutatorIcon.TYPE);if(n&&n.bubbleIsVisible())for(var i,r=n.getWorkspace().getAllBlocks(!1),s=0;i=r[s];s++)"procedures_mutatorarg"==i.type&&Ve.Names.equals(e,i.getFieldValue("NAME"))&&i.setFieldValue(t,"NAME")},customContextMenu:function(e){if(!this.isInFlyout){var t={enabled:!0},n=this.getFieldValue("NAME");t.text=Ve.Msg.PROCEDURES_CREATE_DO.replace("%1",n);var i=Ve.utils.xml.createElement("mutation");i.setAttribute("name",n);for(var r=0;r<this.arguments_.length;r++){var s=Ve.utils.xml.createElement("arg");s.setAttribute("name",this.arguments_[r]),i.appendChild(s)}var o=Ve.utils.xml.createElement("block");if(o.setAttribute("type",this.callType_),o.appendChild(i),t.callback=Ve.ContextMenu.callbackFactory(this,o),e.push(t),!this.isCollapsed())for(r=0;r<this.argumentVarModels_.length;r++){var a={enabled:!0},l=this.argumentVarModels_[r];a.text=Ve.Msg.VARIABLES_SET_CREATE_GET.replace("%1",l.name);var u=Ve.Variables.generateVariableFieldDom(l),c=Ve.utils.xml.createElement("block");c.setAttribute("type","variables_get"),c.appendChild(u),a.callback=Ve.ContextMenu.callbackFactory(this,c),e.push(a)}}},callType_:"procedures_callnoreturn"},Or={init:function(){var e=Ve.Procedures.findLegalName("",this),t=new Ve.FieldTextInput(e,Ve.Procedures.rename);t.setSpellcheck(!1),this.appendDummyInput().appendField(t,"NAME").appendField("","PARAMS"),this.appendValueInput("RETURN").setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.setMutator(new Ve.icons.MutatorIcon(["procedures_mutatorarg"],this)),(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&Ve.Msg.PROCEDURES_DEFRETURN_COMMENT&&this.setCommentText(Ve.Msg.PROCEDURES_DEFRETURN_COMMENT),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_DEFRETURN_TOOLTIP),this.setHelpUrl(Ve.Msg.PROCEDURES_DEFRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null},setStatements_:Cr.setStatements_,updateParams_:Cr.updateParams_,mutationToDom:Cr.mutationToDom,domToMutation:Cr.domToMutation,decompose:Cr.decompose,compose:Cr.compose,getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!0]},getVars:Cr.getVars,getVarModels:Cr.getVarModels,renameVarById:Cr.renameVarById,updateVarName:Cr.updateVarName,displayRenamedVar_:Cr.displayRenamedVar_,customContextMenu:Cr.customContextMenu,callType_:"procedures_callreturn"},Mr={init:function(){this.appendDummyInput().appendField(Ve.Msg.PROCEDURES_MUTATORCONTAINER_TITLE),this.appendStatementInput("STACK"),this.appendDummyInput("STATEMENT_INPUT").appendField(Ve.Msg.PROCEDURES_ALLOW_STATEMENTS).appendField(new Ve.FieldCheckbox("TRUE"),"STATEMENTS"),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP),this.contextMenu=!1}},kr={init:function(){var e=new Ve.FieldTextInput(Ve.Procedures.DEFAULT_ARG,this.validator_);e.oldShowEditorFn_=e.showEditor_;e.showEditor_=function(){this.createdVariables_=[],this.oldShowEditorFn_()},this.appendDummyInput().appendField(Ve.Msg.PROCEDURES_BEFORE_PARAMS).appendField(e,"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_MUTATORARG_TOOLTIP),this.contextMenu=!1,e.onFinishEditing_=this.deleteIntermediateVars_,e.createdVariables_=[],e.onFinishEditing_("x")},validator_:function(e){var t=this.getSourceBlock(),n=t.workspace.getRootWorkspace();if(!(e=e.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"")))return null;for(var i=(t.workspace.targetWorkspace||t.workspace).getAllBlocks(!1),r=e.toLowerCase(),s=0;s<i.length;s++)if(i[s].id!=this.getSourceBlock().id){var o=i[s].getFieldValue("NAME");if(o&&o.toLowerCase()==r)return null}if(t.isInFlyout)return e;var a=n.getVariable(e,"");return a&&a.name!=e&&n.renameVariableById(a.getId(),e),a||(a=n.createVariable(e,""))&&this.createdVariables_&&this.createdVariables_.push(a),e},deleteIntermediateVars_:function(e){var t=this.getSourceBlock().workspace.getRootWorkspace();if(t)for(var n=0;n<this.createdVariables_.length;n++){var i=this.createdVariables_[n];i.name!=e&&t.deleteVariableById(i.getId())}}},Rr={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(Ve.Msg.PROCEDURES_CALLNORETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(e,t){if(Ve.Names.equals(e,this.getProcedureCall())){this.setFieldValue(t,"NAME");var n=this.outputConnection?Ve.Msg.PROCEDURES_CALLRETURN_TOOLTIP:Ve.Msg.PROCEDURES_CALLNORETURN_TOOLTIP;this.setTooltip(n.replace("%1",t))}},setProcedureParameters_:function(e,t){const n=Ve.Procedures.getDefinition(this.getProcedureCall(),this.workspace),i=n&&n.getIcon(Ve.icons.MutatorIcon.TYPE),r=i&&i.bubbleIsVisible();if(r?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null),e.join("\n")!==this.arguments_.join("\n")){if(t.length!==e.length)throw Error("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_={},this.quarkIds_=[]);for(let e=0;e<this.arguments_.length;e++){const n=this.getInput("ARG"+e);if(n){const i=n?.connection?.targetConnection;this.quarkConnections_[this.quarkIds_[e]]=i,r&&i&&!t.includes(this.quarkIds_[e])&&(i.disconnect(),i.getSourceBlock().bumpNeighbours())}}this.arguments_=[].concat(e),this.argumentVarModels_=[];for(var s=0;s<this.arguments_.length;s++){var o=Ve.Variables.getOrCreateVariablePackage(this.workspace,null,this.arguments_[s],"");this.argumentVarModels_.push(o)}if(this.updateShape_(),this.quarkIds_=t,this.quarkIds_)for(let e=0;e<this.arguments_.length;e++){const t=this.quarkIds_[e];if(t in this.quarkConnections_){const n=this.quarkConnections_[t];n?.reconnect(this,"ARG"+e)||delete this.quarkConnections_[t]}}}else this.quarkIds_=t},updateShape_:function(){for(var e=0;e<this.arguments_.length;e++){var t=this.getField("ARGNAME"+e);if(t){Ve.Events.disable();try{t.setValue(this.arguments_[e])}finally{Ve.Events.enable()}}else{t=new Ve.FieldLabel(this.arguments_[e]),this.appendValueInput("ARG"+e).setAlign(Ve.inputs.Align.RIGHT).appendField(t,"ARGNAME"+e).init()}}for(;this.getInput("ARG"+e);)this.removeInput("ARG"+e),e++;var n=this.getInput("TOPROW");n&&(this.arguments_.length?this.getField("WITH")||(n.appendField(Ve.Msg.PROCEDURES_CALL_BEFORE_PARAMS,"WITH"),n.init()):this.getField("WITH")&&n.removeField("WITH"))},mutationToDom:function(){var e=Ve.utils.xml.createElement("mutation");e.setAttribute("name",this.getProcedureCall());for(var t=0;t<this.arguments_.length;t++){var n=Ve.utils.xml.createElement("arg");n.setAttribute("name",this.arguments_[t]),e.appendChild(n)}return e},domToMutation:function(e){var t=e.getAttribute("name");this.renameProcedure(this.getProcedureCall(),t);for(var n,i=[],r=[],s=0;n=e.childNodes[s];s++)"arg"==n.nodeName.toLowerCase()&&(i.push(n.getAttribute("name")),r.push(n.getAttribute("paramId")));this.setProcedureParameters_(i,r)},saveExtraState:function(){const e=Object.create(null);return e.name=this.getProcedureCall(),this.arguments_.length&&(e.params=this.arguments_),e},loadExtraState:function(e){this.renameProcedure(this.getProcedureCall(),e.name);const t=e.params;if(t){const e=[];e.length=t.length,e.fill(null),this.setProcedureParameters_(t,e)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},onchange:function(e){if(this.workspace&&!this.workspace.isFlyout&&e.recordUndo)if(e.type==Ve.Events.BLOCK_CREATE&&-1!=e.ids.indexOf(this.id)){var t=this.getProcedureCall();if((p=Ve.Procedures.getDefinition(t,this.workspace))&&p.type!=this.defType_&&(p=null),p){if(JSON.stringify(p.getVars())!=JSON.stringify(this.arguments_)){let e=p.arguments_,t=[];for(var n=0;n<this.arguments_.length;n++){var i=this.getInput("ARG"+n);if(i){var r=i.connection.targetConnection;r?t.push(r.sourceBlock_.id):t.push(null)}}this.setProcedureParameters_(e,t)}}else{Ve.Events.setGroup(e.group);var s=Ve.utils.xml.createElement("xml"),o=Ve.utils.xml.createElement("block");o.setAttribute("type",this.defType_);var a=this.getRelativeToSurfaceXY(),l=a.x+Ve.SNAP_RADIUS*(this.RTL?-1:1),u=a.y+2*Ve.SNAP_RADIUS;o.setAttribute("x",l),o.setAttribute("y",u);var c=this.mutationToDom();o.appendChild(c);var d=Ve.utils.xml.createElement("field");d.setAttribute("name","NAME");var h=this.getProcedureCall();h||(h=Ve.Procedures.findLegalName("",this),this.renameProcedure("",h)),d.appendChild(Ve.utils.xml.createTextNode(h)),o.appendChild(d),s.appendChild(o),Ve.Xml.domToWorkspace(s,this.workspace),Ve.Events.setGroup(!1)}}else if(e.type==Ve.Events.BLOCK_DELETE){t=this.getProcedureCall();(p=Ve.Procedures.getDefinition(t,this.workspace))||(Ve.Events.setGroup(e.group),this.dispose(!0),Ve.Events.setGroup(!1))}else if(e.type==Ve.Events.CHANGE&&"disabled"==e.element){var p;t=this.getProcedureCall();if((p=Ve.Procedures.getDefinition(t,this.workspace))&&p.id==e.blockId){var f=Ve.Events.getGroup();f&&console.log("Saw an existing group while responding to a definition change"),Ve.Events.setGroup(e.group),e.newValue?(this.previousEnabledState_=this.isEnabled(),this.setEnabled(!1)):this.setEnabled(this.previousEnabledState_),Ve.Events.setGroup(f)}}},customContextMenu:function(e){if(this.workspace.isMovable()){var t={enabled:!0};t.text=Ve.Msg.PROCEDURES_HIGHLIGHT_DEF;var n=this.getProcedureCall(),i=this.workspace;t.callback=function(){var e=Ve.Procedures.getDefinition(n,i);e&&(i.centerOnBlock(e.id),e.select())},e.push(t)}},defType_:"procedures_defnoreturn"},Nr={init:function(){this.appendDummyInput("TOPROW").appendField("","NAME"),this.setOutput(!0),this.setStyle("procedure_blocks"),this.setHelpUrl(Ve.Msg.PROCEDURES_CALLRETURN_HELPURL),this.arguments_=[],this.argumentVarModels_=[],this.quarkConnections_={},this.quarkIds_=null,this.previousEnabledState_=!0},getProcedureCall:Rr.getProcedureCall,renameProcedure:Rr.renameProcedure,setProcedureParameters_:Rr.setProcedureParameters_,updateShape_:Rr.updateShape_,mutationToDom:Rr.mutationToDom,domToMutation:Rr.domToMutation,getVars:Rr.getVars,getVarModels:Rr.getVarModels,onchange:Rr.onchange,customContextMenu:Rr.customContextMenu,defType_:"procedures_defreturn"},Dr={init:function(){this.appendValueInput("CONDITION").setCheck("Boolean").appendField(Ve.Msg.CONTROLS_IF_MSG_IF),this.appendValueInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle("procedure_blocks"),this.setTooltip(Ve.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(Ve.Msg.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){var e=Ve.utils.xml.createElement("mutation");return e.setAttribute("value",Number(this.hasReturnValue_)),e},domToMutation:function(e){var t=e.getAttribute("value");this.hasReturnValue_=1==t,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){if(this.workspace.isDragging&&!this.workspace.isDragging()){var e=!1,t=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(t.type)){e=!0;break}t=t.getSurroundParent()}while(t);e?("procedures_defnoreturn"==t.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=t.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null),this.isInFlyout||this.setEnabled(!0)):(this.setWarningText(Ve.Msg.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.getInheritedDisabled()||this.setEnabled(!1))}},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn"]},Fr={init:function(){this.setStyle("procedure_blocks"),this.appendValueInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.PROCEDURES_IFRETURN_TOOLTIP),this.hasReturnValue_=!0},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("value",Number(this.hasReturnValue_)),e},domToMutation:function(e){var t=e.getAttribute("value");this.hasReturnValue_=1==t,this.hasReturnValue_||(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN))},onchange:function(){var e=!1,t=this;do{if(-1!=this.FUNCTION_TYPES.indexOf(t.type)){e=!0;break}t=t.getSurroundParent()}while(t);e?("procedures_defnoreturn"==t.type&&this.hasReturnValue_?(this.removeInput("VALUE"),this.appendDummyInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):"procedures_defreturn"!=t.type||this.hasReturnValue_||(this.removeInput("VALUE"),this.appendValueInput("VALUE").appendField(Ve.Msg.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(Ve.Msg.PROCEDURES_IFRETURN_WARNING)},FUNCTION_TYPES:["procedures_defnoreturn","procedures_defreturn","method_procedures_defnoreturn","method_procedures_defreturn"]},Lr=195,Pr={init:function(){this.setColour(Lr),this.appendDummyInput("").appendField(new Ve.FieldTextInput("mytup"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("tuple_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("tuple_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Br={init:function(){this.setColour(Lr),this.appendDummyInput().appendField(Ve.Msg.TUPLE_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},$r={init:function(){this.setColour(Lr),this.appendDummyInput().appendField(Ve.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Ur={init:function(){this.setColour(Lr),this.appendDummyInput("").appendField(new Ve.FieldTextInput("mytup"),"VAR").appendField(" = (").appendField(new Ve.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Vr={init:function(){this.setColour(Lr),this.appendDummyInput("").appendField("(").appendField(new Ve.FieldTextInput("0,0,0"),"TEXT").appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},zr={init:function(){this.setColour(Lr),this.setOutput(!0),this.appendValueInput("TUP").setCheck("Tuple"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(Ve.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(Ve.Msg.TUPLE_GET_INDEX_TOOLTIP)}},jr={init:function(){this.setColour(Lr),this.appendValueInput("TUP"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_LENGTH),this.setTooltip(Ve.Msg.TUPLE_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},Yr={init:function(){this.setColour(Lr),this.appendValueInput("TUP").setCheck("Tuple"),this.appendDummyInput("").appendField(Ve.Msg.TUPLE_DEL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TUPLE_DEL_TOOLTIP)}},Gr={init:function(){this.setColour(Lr),this.appendValueInput("TUP1").setCheck("Tuple"),this.appendDummyInput("").appendField(Ve.Msg.TUPLE_JOIN),this.appendValueInput("TUP2").setCheck("Tuple"),this.setInputsInline(!0),this.setTooltip(Ve.Msg.TUPLE_JOIN_TOOLTIP),this.setOutput(!0,"Tuple")}},Hr={init:function(){this.appendValueInput("TUP").setCheck("Tuple");var e=[[Ve.Msg.blockpy_TUPLE_MAX,"max"],[Ve.Msg.blockpy_TUPLE_MIN,"min"],[Ve.Msg.MATH_ONLIST_OPERATOR_SUM,"sum"]];this.setColour(Lr),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{max:Ve.Msg.MIXLY_TOOLTIP_TUPLE_MAX,min:Ve.Msg.MIXLY_TOOLTIP_TUPLE_MIN,sum:Ve.Msg.MIXLY_TOOLTIP_TUPLE_SUM}[e]})}},Wr={init:function(){var e=[[Ve.Msg.MIXLY_MICROBIT_TYPE_LIST,"list"],[Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD,"set"]];this.setColour(Lr),this.appendValueInput("VAR").setCheck("Tuple"),this.appendDummyInput("").appendField(Ve.Msg.A_TO_B).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{list:Ve.Msg.TUPLE_TO_LISTS,set:Ve.Msg.TUPLE_TO_SET}[e]})}},Xr={init:function(){var e=[[Ve.Msg.MIXLY_LIST_INDEX,"INDEX"],[Ve.Msg.MIXLY_LIST_COUNT,"COUNT"]];this.setColour(Lr),this.appendValueInput("VAR").setCheck("List"),this.appendValueInput("data").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(Ve.Msg.HTML_VALUE),this.appendDummyInput().appendField(Ve.Msg.MIXLY_DE).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0),this.setOutput(!0,Number);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{INDEX:Ve.Msg.MIXLY_TOOLTIP_TUPLE_FIND_INDEX,COUNT:Ve.Msg.MIXLY_TOOLTIP_TUPLE_FIND_COUNT}[e]})}},qr={init:function(){var e=[[Ve.Msg.MIXLY_LIST_LEN,"LEN"],[Ve.Msg.MATH_ONLIST_OPERATOR_SUM,"SUM"],[Ve.Msg.MATH_ONLIST_OPERATOR_MAX,"MAX"],[Ve.Msg.MATH_ONLIST_OPERATOR_MIN,"MIN"],[Ve.Msg.MATH_ONLIST_OPERATOR_AVERAGE,"AVERAGE"],[Ve.Msg.MATH_ONLIST_OPERATOR_MEDIAN,"MEDIAN"],[Ve.Msg.MATH_ONLIST_OPERATOR_MODE,"MODE"],[Ve.Msg.MATH_ONLIST_OPERATOR_STD_DEV,"STD_DEV"]];this.setColour(Lr),this.setOutput(!0,Number),this.appendValueInput("data").setCheck("List"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"OP"),this.setInputsInline(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OP");return{LEN:Ve.Msg.TUPLE_LENGTH_TOOLTIP,SUM:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_SUM,MAX:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MAX,MIN:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MIN,AVERAGE:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_AVERAGE,MEDIAN:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MEDIAN,MODE:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_MODE,STD_DEV:Ve.Msg.MATH_ONLIST_TOOLTIP_TUPLE_STD_DEV}[e]})}},Kr={init:function(){this.WHERE_OPTIONS_1=[[Ve.Msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[Ve.Msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[Ve.Msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Lr),this.appendValueInput("LIST").setCheck("List"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),this.setInputsInline(!0),this.setOutput(!0,"List"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(Ve.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation"),t=this.getInput("AT1").type==Ve.INPUT_VALUE;e.setAttribute("at1",t);var n=this.getInput("AT2").type==Ve.INPUT_VALUE;return e.setAttribute("at2",n),e},domToMutation:function(e){var t="true"==e.getAttribute("at1"),n="true"==e.getAttribute("at2");this.updateAt_(1,t),this.updateAt_(2,n)},updateAt_:function(e,t){this.removeInput("AT"+e),this.removeInput("ORDINAL"+e,!0),t?(this.appendValueInput("AT"+e).setCheck(Number),Ve.Msg.TEXT_CHARAT_TAIL&&this.appendDummyInput("ORDINAL"+e).appendField(Ve.Msg.TEXT_CHARAT_TAIL)):this.appendDummyInput("AT"+e);var n=new Ve.FieldDropdown(this["WHERE_OPTIONS_"+e],function(n){var i="FROM_START"==n||"FROM_END"==n;if(i!=t){var r=this.sourceBlock_;return r.updateAt_(e,i),r.setFieldValue(n,"WHERE"+e),null}});this.getInput("AT"+e).appendField(n,"WHERE"+e),1==e&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2"))}},Zr={init:function(){this.setColour(Lr),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0,"Tuple"),this.setMutator(new Ve.icons.MutatorIcon(["tuple_create_with_item"],this)),this.setTooltip(Ve.Msg.TUPLE_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("tuple_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("tuple_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.TUPLE_CREATE_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.TUPLE_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Qr={init:function(){this.setHelpUrl(Ve.Msg.LISTS_GET_SUBLIST_HELPURL),this.setColour(Lr),this.appendValueInput("LIST"),this.appendDummyInput(""),this.appendValueInput("AT1").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.LISTS_GET_INDEX_FROM_START),this.appendValueInput("AT2").appendField(Ve.Msg.TEXT_CHARAT_TAIL+" "+Ve.Msg.LISTS_GET_SUBLIST_END_FROM_START),this.appendDummyInput().appendField(Ve.Msg.TEXT_CHARAT_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Tuple"),this.setTooltip(Ve.Msg.PYTHON_TUPLE_GET_SUBLIST_TOOLTIP)}},Jr={init:function(){this.setColour(Lr),this.appendValueInput("TUP"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET+" "+Ve.Msg.LISTS_GET_INDEX_RANDOM),this.setTooltip(Ve.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM),this.setOutput(!0)}},es={init:function(){this.setColour(Lr),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOTUPLE),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOTUPLE)}};const ts={init:function(){this.setColour(Lr),this.appendDummyInput("").appendField("(").appendField(new Ve.FieldTextInput(function(){var e=new Date;return e.getFullYear()+","+(e.getMonth()+1)+","+e.getDate()+","+e.getHours()+","+e.getMinutes()+","+e.getSeconds()}()),"CONTENT").appendField(")"),this.setOutput(!0)}},ns={init:function(){this.setColour(Lr),this.appendValueInput("params").appendField("(").appendField(Ve.Msg.MIXLY_NAME_OF_PARAMS),this.appendDummyInput().appendField(",").appendField(Ve.Msg.MIXLY_TYPE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TYPE_BOOLEAN,"boolean"],[Ve.Msg.MIXLY_TYPE_STRING,"string"],[Ve.Msg.MIXLY_TYPE_NUMBER,"number"],[Ve.Msg.MIXLY_TYPE_INTEGER,"integer"],[Ve.Msg.MIXLY_TYPE_NULL,"null"]]),"type"),this.appendValueInput("des").appendField(",").appendField(Ve.Msg.MIXLY_DESCRIPTION),this.appendDummyInput().appendField(")"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_TOOLTIP_TUPLE_CREATE_WITH_TEXT)}},is=100,rs={init:function(){this.setColour(is),this.appendDummyInput("").appendField(new Ve.FieldTextInput("s1"),"VAR"),this.itemCount_=3,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["set_create_with_item"],this)),this.setTooltip(Ve.Msg.blockpy_SET_CREATE_WITH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("set_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("set_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.blockpy_SET_CREATE_EMPTY_TITLE);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.blockpy_SET_CREATE_WITH_INPUT_WITH)}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ss={init:function(){this.setColour(is),this.appendDummyInput().appendField(Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TITLE_ADD),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.blockpy_SET_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},os={init:function(){this.setColour(is),this.appendDummyInput().appendField(Ve.Msg.blockpy_SET_VARIABLES_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_SET_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},as={init:function(){this.setColour(is),this.appendValueInput("SET"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_LENGTH),this.setInputsInline(!0),this.setTooltip(Ve.Msg.SET_LENGTH_TOOLTIP),this.setOutput(!0,Number)}},ls={init:function(){this.setColour(is),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_SET_GET_AND_REMOVE_LAST),this.setTooltip(Ve.Msg.SET_POP_TOOLTIP),this.setInputsInline(!0),this.setOutput(!0)}},us={init:function(){this.setColour(is),this.appendValueInput("SET").setCheck("Set"),this.appendDummyInput("").appendField(Ve.Msg.SET_CLEAR),this.setPreviousStatement(!0),this.setNextStatement(!0)}},cs={init:function(){this.appendValueInput("SET1").setCheck("Set");var e=[[Ve.Msg.blockpy_set_union,"union"],[Ve.Msg.blockpy_set_intersection,"intersection"],[Ve.Msg.blockpy_set_difference,"difference"]];this.setColour(is),this.appendDummyInput("").appendField(Ve.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_set_get_operate).appendField(new Ve.FieldDropdown(e),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,"set");var t=this;this.setTooltip(function(){var e=t.getFieldValue("OPERATE");return{union:Ve.Msg.MIXLY_TOOLTIP_SET_UNION,intersection:Ve.Msg.MIXLY_TOOLTIP_SET_INTERSECTION,difference:Ve.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE}[e]})}},ds={init:function(){this.appendValueInput("SET1").setCheck("Set");var e=[[Ve.Msg.blockpy_set_union,"update"],[Ve.Msg.blockpy_set_intersection,"intersection_update"],[Ve.Msg.blockpy_set_difference,"difference_update"]];this.setColour(is),this.appendDummyInput("").appendField(Ve.Msg.blockpy_and_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_set_get_operate).appendField(new Ve.FieldDropdown(e),"OPERATE"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_set_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OPERATE");return{update:Ve.Msg.MIXLY_TOOLTIP_SET_UPDATE,intersection_update:Ve.Msg.MIXLY_TOOLTIP_SET_INTERSECTION_UPDATE,difference_update:Ve.Msg.MIXLY_TOOLTIP_SET_DIFFERENCE_UPDATE}[e]})}},hs={init:function(){this.appendValueInput("SET").setCheck("Set");var e=[[Ve.Msg.MIXLY_blockpy_set_add,"add"],[Ve.Msg.MIXLY_blockpy_set_discard,"discard"]];this.setColour(is),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"OPERATE"),this.appendValueInput("data").appendField(Ve.Msg.blockpy_SET_VARIABLES_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OPERATE");return{add:Ve.Msg.SET_ADD_TOOLTIP,discard:Ve.Msg.SET_DISCARD_TOOLTIP}[e]})}},ps={init:function(){this.appendValueInput("SET1").setCheck("Set");var e=[[Ve.Msg.blockpy_set_sub,"issubset"],[Ve.Msg.blockpy_set_super,"issuperset"]];this.setColour(is),this.appendDummyInput("").appendField(Ve.Msg.blockpy_is_set),this.appendValueInput("SET2").setCheck("Set"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_set_of).appendField(new Ve.FieldDropdown(e),"OPERATE"),this.setInputsInline(!0),this.setOutput(!0,Boolean);var t=this;this.setTooltip(function(){var e=t.getFieldValue("OPERATE");return{issubset:Ve.Msg.MIXLY_TOOLTIP_SET_SUB,issuperset:Ve.Msg.MIXLY_TOOLTIP_SET_SUPER}[e]})}},fs={init:function(){this.appendValueInput("SET").setCheck("Set"),this.setColour(is),this.appendValueInput("VAR").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_set_add_update),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.SET_UPDATE_TOOLTIP)}},ms={init:function(){this.setColour(is),this.appendDummyInput("").appendField("{").appendField(new Ve.FieldTextInput("0,0,0"),"TEXT").appendField("}"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_TOOLTIP_SET_CREATE_WITH_TEXT)}},gs={init:function(){this.setColour(is),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOSET),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOSET)}},_s="#1ec1e4",ys={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_DOCUMENT),this.appendStatementInput("HEAD").appendField(Ve.Msg.HTML_HEAD),this.appendStatementInput("BODY").appendField(Ve.Msg.HTML_BODY),this.setOutput(!0)}},vs={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_LEVEL).appendField(new Ve.FieldDropdown([["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bs={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_HEAD,"head"],[Ve.Msg.HTML_BODY,"body"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ts={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_P,"p"],[Ve.Msg.HTML_SPAN,"span"],[Ve.Msg.HTML_FORM,"form"],[Ve.Msg.HTML_TABLE,"table"],[Ve.Msg.HTML_LINE,"tr"],[Ve.Msg.HTML_CELL,"td"],[Ve.Msg.HTML_OL,"ol"],[Ve.Msg.HTML_UL,"ul"],[Ve.Msg.HTML_LI,"li"]]),"LEVEL"),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xs={init:function(){this.setColour(_s),this.appendDummyInput().appendField("<").appendField(new Ve.FieldTextInput("tag"),"LEVEL").appendField(">"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.appendStatementInput("DO").appendField(""),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Es={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_STYLE),this.appendStatementInput("STYLE"),this.setOutput(!0)}},ws={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_FORM_CONTENT).appendField(new Ve.FieldDropdown([[Ve.Msg.HTML_TEXT,"text"],[Ve.Msg.HTML_EMAIL,"email"],[Ve.Msg.HTML_NUMBER,"number"],[Ve.Msg.HTML_PASSWORD,"password"],[Ve.Msg.HTML_CHECKBOX,"checkbox"],[Ve.Msg.HTML_RADIOBUTTON,"radiobutton"],[Ve.Msg.HTML_BUTTON,"button"],[Ve.Msg.HTML_COLOUR,"colour"],[Ve.Msg.HTML_DATE,"date"],[Ve.Msg.HTML_LOCALTIME,"local time"],[Ve.Msg.HTML_FILE,"file"],[Ve.Msg.HTML_HIDDEN,"hidden"],[Ve.Msg.HTML_IMAGE,"image"],[Ve.Msg.HTML_MONTH,"month"],[Ve.Msg.HTML_RANGE,"range"],[Ve.Msg.HTML_RESET,"reset"],[Ve.Msg.HTML_SEARCH,"search"],[Ve.Msg.HTML_SUBMIT,"submit"],[Ve.Msg.HTML_TELEPHONENUMBER,"telephone number"],[Ve.Msg.HTML_TIME,"time"],[Ve.Msg.HTML_URL,"url"],[Ve.Msg.HTML_WEEK,"week"]]),"LEVEL"),this.appendDummyInput().appendField(Ve.Msg.HTML_NAME).appendField(new Ve.FieldTextInput("car"),"NAME"),this.appendDummyInput().appendField(Ve.Msg.HTML_VALUE).appendField(new Ve.FieldTextInput("go"),"VALUE"),this.appendValueInput("style").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Is={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldTextInput("value"),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},As={init:function(){this.setColour(_s),this.appendDummyInput().appendField(new Ve.FieldTextInput("property"),"KEY").appendField(":").appendField(new Ve.FieldColour("#ff0000"),"RGB_LED_COLOR"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ss={init:function(){this.setColour(_s),this.appendDummyInput().appendField(Ve.Msg.HTML_TEXT).appendField(new Ve.FieldTextInput("text"),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cs=160,Os={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Tabular Abstraction:"),this.appendDummyInput().appendField(new Ve.FieldTable(""),"TEXT")}},Ms={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendDummyInput().appendField("Code Block:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT")}},ks={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("Code Expression:"),this.appendDummyInput().appendField(new Ve.FieldMultilineInput(""),"TEXT"),this.setOutput(!0)}},Rs={init:function(){this.setColour(Cs),this.setPreviousStatement(!0),this.setNextStatement(!0),this.appendValueInput("VALUE").appendField(""),this.setInputsInline(!1)}},Ns={init:function(){this.setColour(Cs),this.appendDummyInput().appendTitle("Comment:").appendTitle(new Ve.FieldTextInput(""),"TEXT"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("This comment will be ignored by Python")}},Ds={init:function(){this.setColour(Cs),this.appendValueInput("VALUE").appendField(Ve.Msg.TYPE_CHECK),this.setInputsInline(!1),this.setOutput(!0,"Type")}},Fs={init:function(){this.setColour(Cs),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["text_print_multiple_item"],this)),this.setTooltip(Ve.Msg.TEXT_PRINT_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=Ve.Block.obtain(e,"text_print_multiple_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("text_print_multiple_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("PRINT"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("PRINT"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("PRINT"+e);)this.removeInput("PRINT"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField("print");else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("PRINT"+e);0==e&&t.appendField("print")}}},Ls={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("print"),this.appendStatementInput("STACK"),this.setTooltip(""),this.contextMenu=!1}},Ps={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("item"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},Bs={init:function(){this.setColour(Cs),this.itemCount_=1,this.hasReturn_=!1,this.appendDummyInput().appendField(new Ve.FieldTextInput("str"),"NAME"),this.updateShape_(),this.setMutator(new Ve.icons.MutatorIcon(["function_call_item"],this)),this.setTooltip("Can be used to call any function")},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e.setAttribute("hasReturn",this.hasReturn_?"TRUE":"FALSE"),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.hasReturn_="TRUE"===e.getAttribute("hasReturn"),this.updateShape_()},decompose:function(e){var t=Ve.Block.obtain(e,"function_call_container");t.initSvg(),t.setFieldValue(this.hasStatements_?"TRUE":"FALSE","RETURN");for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("function_call_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},setReturn:function(e){this.unplug(!0,!0),this.setOutput(e),this.setPreviousStatement(!e),this.setNextStatement(!e),this.rendered&&this.render()},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.hasReturn_="TRUE"===e.getFieldValue("RETURN"),this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ARGUMENT"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ARGUMENT"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ARGUMENT"+e);)this.removeInput("ARGUMENT"+e),e++;for(e=0;e<this.itemCount_;e++)this.appendValueInput("ARGUMENT"+e);this.setReturn(this.hasReturn_)}},$s={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("Arguments"),this.appendStatementInput("STACK"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("has return").appendField(new Ve.FieldCheckbox("TRUE"),"RETURN"),this.setTooltip(""),this.contextMenu=!1}},Us={init:function(){this.setColour(Cs),this.appendDummyInput().appendField("argument"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(""),this.contextMenu=!1}},Vs={init:function(){this.appendValueInput("MODULE").setCheck(null),this.appendValueInput("NAME").setCheck(null).appendField("."),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(230),this.setTooltip(""),this.setHelpUrl("")}},zs=function(e,t){return[t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),t.ORDER_ATOMIC]},js=function(e,t){if(""==this.getFieldValue("VAR"))return" = None\n";var n=t.valueToCode(this,"VALUE",t.ORDER_ASSIGNMENT)||"None";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = "+n+"\n"},Ys=function(e,t){var n=this.getFieldValue("OP"),i=t.valueToCode(this,"MYVALUE",t.ORDER_ATOMIC)||"None";if("bytes"==n)var r=n+"("+i+',"UTF-8")';else r=n+"("+i+")";return[r,t.ORDER_ATOMIC]},Gs=function(e,t){return"global "+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"None")+"\n"},Hs=function(e,t){return["type("+(t.valueToCode(this,"DATA",t.ORDER_ATOMIC)||"None")+")",t.ORDER_ATOMIC]},Ws=function(e,t){return[this.getFieldValue("type"),t.ORDER_ATOMIC]},Xs=function(e,t){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=t.valueToCode(this,"ADD"+i,t.ORDER_NONE)||"[]";return[n="zip("+n.join(", ")+")",t.ORDER_ATOMIC]},qs=function(e,t){const n=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"[]";return[`${this.getFieldValue("TYPE")}(${n})`,t.ORDER_ATOMIC]},Ks=function(e,t){var n=t.statementToCode(e,"DO");return"if __name__ == '__main__':\n"+(n=t.addLoopTrap(n,e.id)||t.PASS)},Zs=function(e,t){var n=t.statementToCode(this,"DO");return(n=n.replace(/(^\s*)|(\s*$)/g,"").replace(/\n {4}/g,"\n")).endsWith("\n")?t.setups_.setup_setup=n:t.setups_.setup_setup=n+"\n",""},Qs=function(e,t){var n=0,i="";do{i+=(0==n?"if ":"elif ")+(t.valueToCode(e,"IF"+n,t.ORDER_NONE)||"False")+":\n"+(t.statementToCode(e,"DO"+n)||t.PASS),++n}while(e.getInput("IF"+n));return e.getInput("ELSE")&&(i+="else:\n"+(t.statementToCode(e,"ELSE")||t.PASS)),i},Js=function(e,t){var n=1,i=t.valueToCode(this,"IF"+n,t.ORDER_NONE)||"null",r="try:\n"+(t.statementToCode(this,"try")||" pass\n");for(n=1;n<=this.elseifCount_;n++)""!==(i=t.valueToCode(this,"IF"+n,t.ORDER_NONE)||"")&&(i=" "+i),r+="except"+i+": \n"+(t.statementToCode(this,"DO"+n)||" pass\n");return this.elseCount_&&(r+="finally:\n"+(t.statementToCode(this,"ELSE")||" pass\n")),r},eo=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",r=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",s=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",o=t.statementToCode(e,"DO"),a=(o=t.addLoopTrap(o,e.id)||t.PASS,""),l=function(e,t){return t.provideFunction_("upRange",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start <= stop:"," yield start"," start += abs(step)"])},u=function(e,t){return t.provideFunction_("downRange",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(start, stop, step):"," while start >= stop:"," yield start"," start -= abs(step)"])};if(e=function(e,t,n){return"("+e+" <= "+t+") and "+l()+"("+e+", "+t+", "+n+") or "+u()+"("+e+", "+t+", "+n+")"},Ve.isNumber(i)&&Ve.isNumber(r)&&Ve.isNumber(s))i=parseFloat(i),r=parseFloat(r),s=Math.abs(parseFloat(s)),0==i%1&&0==r%1&&0==s%1?(i<=r?(r++,e=0==i&&1==s?r:i+", "+r,1!=s&&(e+=", "+s)):e=i+", "+--r+", -"+s,e="range("+e+")"):(e=i<r?l():u(),e+="("+i+", "+r+", "+s+")");else{var c=function(e,i){if(Ve.isNumber(e))e=parseFloat(e);else{var r=t.variableDB_.getDistinctName(n+i,Ve.Variables.NAME_TYPE);a+=r+" = "+e+"\n",e=r}return e};i=c(i,"_start"),r=c(r,"_end");c(s,"_inc"),e="number"==typeof i&&"number"==typeof r?i<r?l(0,r):u(0,r):e(i,r,s)}return a+="for "+n+" in "+e+":\n"+o},to=function(e,t){var n=t.variableDB_.getName(e.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=t.valueToCode(e,"FROM",t.ORDER_NONE)||"0",r=t.valueToCode(e,"TO",t.ORDER_NONE)||"0",s=t.valueToCode(e,"STEP",t.ORDER_NONE)||"1",o=t.statementToCode(e,"DO"),a=t.addLoopTrap(o,e.id)||t.PASS;return t.setups_.mixly_range="def mixly_range(start, stop, step):\n for i in range(start, stop + 1, step):\n yield i\n\n","for "+n+" in mixly_range("+i+", "+r+", "+s+"):\n"+a},no=function(e,t){var n="UNTIL"==e.getFieldValue("MODE"),i=t.valueToCode(e,"BOOL",t.ORDER_NONE)||"False",r=t.statementToCode(e,"DO");return n&&(i="not "+i),"while "+i+":\n"+(r=t.addLoopTrap(r,e.id)||t.PASS)},io=function(e){switch(e.getFieldValue("FLOW")){case"BREAK":return"break\n";case"CONTINUE":return"continue\n"}throw"Unknown flow statement."},ro=function(e,t){return"sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},so=function(e,t){return"panic("+(t.valueToCode(this,"STATUS_CODE",t.ORDER_ATOMIC)||"1000")+")\n"},oo=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},ao=function(e,t){return t.definitions_.import_microbit="from microbit import *","reset()\n"},lo=function(){return"interrupts();\n"},uo=function(){return"noInterrupts();\n"},co=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"''",i=t.valueToCode(e,"LIST",t.ORDER_RELATIONAL)||"[]",r=t.statementToCode(e,"DO");return"for "+n+" in "+i+":\n"+(r=t.addLoopTrap(r,e.id)||t.PASS)},ho=function(e,t){return["range("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},po=function(e,t){var n="lambda "+(t.valueToCode(e,"BOOL",t.ORDER_NONE)||"None")+": "+(t.statementToCode(e,"DO")||"pass");return[n=n.replace("\n","").replace(" ",""),t.ORDER_ATOMIC]},fo=function(e,t){return t.definitions_.import_time="import time","time.sleep("+(t.valueToCode(this,"DELAY_TIME",t.ORDER_ATOMIC)||"1000")+")\n"},mo=function(){return"pass\n"},go=function(e,t){t.definitions_.import__thread="import _thread";var n=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return"_thread.start_new_thread("+t.variableDB_.getName(t.valueToCode(this,"callback",t.ORDER_NONE)||"None",Ve.Procedures.NAME_TYPE)+", "+n+")\n"},_o=function(e,t){var n=t.valueToCode(this,"select_data",t.ORDER_NONE)||"False",i=t.statementToCode(this,"input_data");return i="true"==this.getFieldValue("type")?i+" if ("+n+"):\n break\n":i+" if not ("+n+"):\n break\n","while True:\n"+(i=t.addLoopTrap(i,this.id)||t.PASS)},yo=function(e,t){var n=t.valueToCode(this,"TIMES",t.ORDER_ATOMIC),i=t.statementToCode(e,"DO");return"for _my_variable in range("+n+"):\n"+(i=t.addLoopTrap(i,e.id)||t.PASS)},vo=function(e,t){t.definitions_.import_gc="import gc";return"gc.collect()\n"},bo=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_alloc()",t.ORDER_ATOMIC]},To=function(e,t){t.definitions_.import_gc="import gc";return["gc.mem_free()",t.ORDER_ATOMIC]},xo=function(e,t){t.definitions_.import_machine="import machine";return["machine.unique_id()",t.ORDER_ATOMIC]},Eo=yo,wo=function(e,t){return t.definitions_.import_datetime="import datetime",["datetime.datetime.fromtimestamp("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Io=function(e,t){var n=ze.Boards.getSelectedBoardKey().split(":")[2];t.definitions_["import_"+n+"uuid"]="from "+n+" import uuid";return["uuid()",t.ORDER_ATOMIC]},Ao=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},So=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},Co=function(e,t){return t.definitions_.import_math="import math",["math."+this.getFieldValue("CONSTANT"),t.ORDER_ATOMIC]},Oo=function(e,t){var n=this.getFieldValue("OP"),i=t.ORDER_ATOMIC;return["("+(t.valueToCode(this,"A",i)||"0")+n+(t.valueToCode(this,"B",i)||"0")+")",i]},Mo=function(e,t){var n=(i={ADD:[" + ",t.ORDER_ADDITIVE],MINUS:[" - ",t.ORDER_ADDITIVE],MULTIPLY:[" * ",t.ORDER_MULTIPLICATIVE],DIVIDE:[" / ",t.ORDER_MULTIPLICATIVE],QUYU:[" % ",t.ORDER_MULTIPLICATIVE],ZHENGCHU:[" // ",t.ORDER_MULTIPLICATIVE],POWER:[" ** ",t.ORDER_EXPONENTIATION]}[e.getFieldValue("OP")])[0],i=i[1];return[(t.valueToCode(e,"A",i)||"0")+n+(e=t.valueToCode(e,"B",i)||"0"),i]},ko=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0",i=t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0";switch(this.getFieldValue("OP")){case"ADD":var r="+=";break;case"MINUS":r="-=";break;case"MULTIPLY":r="*=";break;case"DIVIDE":r="/=";break;case"QUYU":r="%=";break;case"ZHENGCHU":r="//=";break;case"POWER":r="**="}return n+" "+r+" "+i+"\n"},Ro=function(e,t){var n,i=e.getFieldValue("OP");if("NEG"==i)return["-"+(n=t.valueToCode(e,"NUM",t.ORDER_UNARY_SIGN)||"0"),t.ORDER_UNARY_SIGN];switch(t.definitions_.import_math="import math",e="SIN"==i||"COS"==i||"TAN"==i?t.valueToCode(e,"NUM",t.ORDER_MULTIPLICATIVE)||"0":t.valueToCode(e,"NUM",t.ORDER_NONE)||"0",i){case"ABS":n="math.fabs("+e+")";break;case"ROOT":n="math.sqrt("+e+")";break;case"LN":n="math.log("+e+")";break;case"LOG10":n="math.log10("+e+")";break;case"EXP":n="math.exp("+e+")";break;case"POW10":n="math.pow(10,"+e+")";break;case"ROUND":n="round("+e+")";break;case"ROUNDUP":n="math.ceil("+e+")";break;case"ROUNDDOWN":n="math.floor("+e+")";break;case"SIN":n="math.sin("+e+")";break;case"COS":n="math.cos("+e+")";break;case"TAN":n="math.tan("+e+")";break;case"++":n="++("+e+")";break;case"--":n="--("+e+")";break;case"-":n="-("+e+")"}if(n)return[n,t.ORDER_EXPONENTIATION];switch(i){case"ASIN":n="math.degrees(math.asin("+e+"))";break;case"ACOS":n="math.degrees(math.acos("+e+"))";break;case"ATAN":n="math.degrees(math.atan("+e+"))"}return[n,t.ORDER_MULTIPLICATIVE]},No=Ro,Do=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},Fo=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",i=this.getFieldValue("OP"),r="";return"round"===i?r=i+"("+n+")":(r="math."+i+"("+n+")",t.definitions_.import_math="import math"),[r,t.ORDER_ATOMIC]},Lo=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_NONE)||"0",i=t.valueToCode(this,"B",t.ORDER_NONE)||"0";return[this.getFieldValue("OP")+"("+n+", "+i+")",t.ORDER_ATOMIC]},Po=function(e,t){t.definitions_.import_random="import random";var n=this.getFieldValue("TYPE"),i=t.valueToCode(this,"FROM",t.ORDER_NONE)||"0",r=t.valueToCode(this,"TO",t.ORDER_NONE)||"0";if("int"==n)var s="random.randint("+i+", "+r+")";else if("float"==n)s="random.uniform("+i+", "+r+")";return[s,t.ORDER_UNARY_POSTFIX]},Bo=function(e,t){var n=t.valueToCode(this,"NUM",t.ORDER_NONE),i=t.valueToCode(this,"fromLow",t.ORDER_ATOMIC),r=t.valueToCode(this,"fromHigh",t.ORDER_ATOMIC),s=t.valueToCode(this,"toLow",t.ORDER_ATOMIC),o=t.valueToCode(this,"toHigh",t.ORDER_ATOMIC);return t.definitions_.import_mixpy_math_map="from mixpy import math_map",["math_map("+n+", "+i+", "+r+", "+s+", "+o+")",t.ORDER_NONE]},$o=function(e,t){return["min(max("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"LOW",t.ORDER_NONE)||"0")+"), "+(t.valueToCode(this,"HIGH",t.ORDER_NONE)||"0")+")",t.ORDER_UNARY_POSTFIX]},Uo=function(e,t){var n=e.getFieldValue("OP"),i=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0",r=e.getFieldValue("OP2");t.definitions_.import_math="import math";var s="",o="10";if("two"==n?o="2":"eight"==n?o="8":"ten"==n?o="10":"sixteen"==n&&(o="16"),"two"==r?s="bin":"eight"==r?s="oct":"ten"==r?s="":"sixteen"==r&&(s="hex"),""==s)var a="int(str("+i+"), "+o+")";else a=s+"(int(str("+i+"), "+o+"))";return[a,t.ORDER_ATOMIC]},Vo=function(e,t){return t.definitions_.import_random="import random","random.seed("+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+");\n"},zo=function(e,t){var n=this.getFieldValue("NUM");return[n,n<0?t.ORDER_UNARY_PREFIX:t.ORDER_ATOMIC]},jo=function(e,t){return["round("+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"VAR",t.ORDER_NONE)||"0")+")",t.ORDER_ATOMIC]},Yo=function(e,t){var n=this.getFieldValue("TOWHAT"),i=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[i+'.encode("utf-8")',t.ORDER_ATOMIC]:"bti"==n?["int.from_bytes("+i+',"big")',t.ORDER_ATOMIC]:[n+"("+i+")",t.ORDER_ATOMIC]},Go=function(e,t){var n=this.getFieldValue("TOWHAT"),i=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return"b"==n?[i+'.encode("utf-8")',t.ORDER_ATOMIC]:[n+"("+i+")",t.ORDER_ATOMIC]},Ho=Bo,Wo=function(e,t){return t.definitions_.import_hexlify="from ubinascii import hexlify",["hexlify("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+").decode()",t.ORDER_ATOMIC]},Xo=function(e,t){t.definitions_.import_itertools="import itertools";let n=t.valueToCode(this,"REPEAT",t.ORDER_ATOMIC),i=new Array(this.itemCount_);for(let e=0;e<this.itemCount_;e++)i[e]=t.valueToCode(this,`ADD${e}`,t.ORDER_NONE)||"0";let r="";return this.itemCount_&&(r=`itertools.product(${i.join(", ")}, repeat=${n})`),[r,t.ORDER_ATOMIC]},qo=function(e,t){return t.definitions_.import_math="import math",["math.degrees("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Ko=function(e,t){return t.definitions_.import_math="import math",["math.radians("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Zo=function(e,t){return[t.quote_(this.getFieldValue("TEXT")),t.ORDER_ATOMIC]},Qo=function(e,t){return['"""'+this.getFieldValue("VALUE")+'"""',t.ORDER_ATOMIC]},Jo=function(e,t){return[`b'${this.getFieldValue("TEXT")}'`,t.ORDER_ATOMIC]},ea=function(e,t){return["'"+this.getFieldValue("TEXT")+"'",t.ORDER_ATOMIC]},ta=function(e,t){return[t.valueToCode(this,"A",t.ORDER_ATOMIC)+" + "+t.valueToCode(this,"B",t.ORDER_ATOMIC),t.ORDER_ADDITIVE]},na=function(e,t){return["chr("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},ia=function(e,t){return["ord("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"a")+")",t.ORDER_ATOMIC]},ra=function(e,t){return["str("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},sa=function(e,t){return["len("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},oa=function(e,t){var n=e.getFieldValue("WHERE")||"FROM_START",i=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';switch(n){case"FROM_START":return[i+"["+(e=t.getAdjustedInt(e,"AT"))+"]",t.ORDER_ATOMIC];case"FROM_END":return[i+"["+(e=t.getAdjustedInt(e,"AT",1,!0))+"]",t.ORDER_ATOMIC];case"RANDOM":return t.definitions_.import_random="import random",["random.choice("+i+")",t.ORDER_FUNCTION_CALL]}throw"Unhandled combination (lists_getIndex)."},aa=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+(t.valueToCode(this,"AT",t.ORDER_ATOMIC)||0)+"]",t.ORDER_ATOMIC]},la=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""';return t.definitions_.import_random="import random",["random.choice("+n+")",t.ORDER_FUNCTION_CALL]},ua=function(e,t){var n=t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""',i=t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""',r=this.getFieldValue("DOWHAT");return"==="===r?[n+" == "+i,t.ORDER_ATOMIC]:[n+"."+r+"("+i+")",t.ORDER_ATOMIC]},ca=function(e,t){return["cmp("+(t.valueToCode(this,"STR1",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"STR2",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},da=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',i=e.getFieldValue("WHERE1"),r=e.getFieldValue("WHERE2");switch(i){case"FROM_START":"0"==(s=t.getAdjustedInt(e,"AT1"))&&(s="");break;case"FROM_END":var s=t.getAdjustedInt(e,"AT1",0,!0);break;case"FIRST":s="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(r){case"FROM_START":var o=t.getAdjustedInt(e,"AT2");break;case"FROM_END":o=t.getAdjustedInt(e,"AT2",0,!0);Ve.isNumber(String(o))?"0"==o&&(o=""):(t.definitions_.import_sys="import sys",o+=" or sys.maxsize");break;case"LAST":o="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+s+" : "+o+"]",t.ORDER_ATOMIC]},ha=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"["+t.valueToCode(this,"AT1",t.ORDER_ATOMIC)+" : "+t.valueToCode(this,"AT2",t.ORDER_ATOMIC)+"]",t.ORDER_ATOMIC]},pa=function(e,t){var n=this.getFieldValue("CAPITAL");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},fa=function(e,t){var n=this.getFieldValue("CENTER");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"WID",t.ORDER_ATOMIC)+","+t.valueToCode(this,"Symbol",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ma=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".find("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ga=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".join("+(t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},_a=function(e,t){return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".replace("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ya=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+".split("+(t.valueToCode(this,"VAL",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},va=function(e,t){var n=this.getFieldValue("TOWHAT");return[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},ba=function(e,t){for(var n=this.getFieldValue("VAR"),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0";return[i=n+".format("+i.join(", ")+")",t.ORDER_ATOMIC]},Ta=function(e,t){for(var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0";return[i=n+".format("+i.join(", ")+")",t.ORDER_ATOMIC]},xa=ha,Ea=ca,wa=aa,Ia=function(e,t){var n=this.getFieldValue("DIR"),i=this.getFieldValue("CODE");return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+"."+n+'("'+i+'")',t.ORDER_ATOMIC]},Aa=function(e,t){return["eval("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Sa=function(e,t){return t.definitions_.import_os="import os","os.system("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},Ca=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+"["+t.valueToCode(this,"AT1",t.ORDER_ADDITIVE)+" : "+t.valueToCode(this,"AT2",t.ORDER_ADDITIVE)+"]",t.ORDER_ATOMIC]},Oa=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ATOMIC)||"mylist")+"["+(t.valueToCode(this,"row",t.ORDER_ATOMIC)||0)+","+(t.valueToCode(this,"col",t.ORDER_ATOMIC)||0)+"]",t.ORDER_ATOMIC]},Ma=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ATOMIC)||"mylist")+"["+(t.valueToCode(this,"row_start",t.ORDER_ATOMIC)||0)+" : "+(t.valueToCode(this,"row_end",t.ORDER_ATOMIC)||1)+","+(t.valueToCode(this,"col_start",t.ORDER_ATOMIC)||0)+" : "+(t.valueToCode(this,"col_end",t.ORDER_ATOMIC)||1)+"]",t.ORDER_ATOMIC]},ka=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0";return i=n+" = ["+i.join(", ")+"]\n"},Ra=function(e,t){return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = ["+this.getFieldValue("TEXT")+"]\n"},Na=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+"["+(t.valueToCode(this,"AT",t.ORDER_ADDITIVE)||0)+"]",t.ORDER_ATOMIC]},Da=function(e,t){return(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+"["+(t.valueToCode(this,"AT",t.ORDER_ADDITIVE)||"0")+"] = "+(t.valueToCode(this,"TO",t.ORDER_ASSIGNMENT)||"0")+"\n"},Fa=function(e,t){var n=t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"DATA",t.ORDER_ASSIGNMENT)||"0";return n+"."+this.getFieldValue("OP")+"("+i+")\n"},La=function(e,t){return t.definitions_.import_random="import random",["random.choice("+(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+")",t.ORDER_ATOMIC]},Pa=function(e,t){return t.definitions_.import_random="import random",["random.sample("+(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+","+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},Ba=function(e,t){return(t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0")+".insert("+(t.valueToCode(this,"AT",t.ORDER_ADDITIVE)||"0")+", "+(t.valueToCode(this,"VALUE",t.ORDER_ASSIGNMENT)||"0")+")\n"},$a=function(e,t){return(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+".reverse()\n"},Ua=function(e,t){return(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Va=function(e,t){var n=this.getFieldValue("OP"),i=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0";if("INDEX"==n)var s=i+".index("+r+")";else if("COUNT"==n)s=i+".count("+r+")";return[s,t.ORDER_ATOMIC]},za=function(e,t){var n=t.valueToCode(this,"LIST",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"DATA",t.ORDER_ASSIGNMENT)||"0";return"del"==this.getFieldValue("OP")?"del "+n+"["+i+"]\n":n+".remove("+i+")\n"},ja=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+".pop("+(t.valueToCode(this,"VALUE",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},Ya=function(e,t){var n,i=e.getFieldValue("OP");switch(t.definitions_.import_math="import math",e=t.valueToCode(e,"data",t.ORDER_NONE),i){case"LEN":n="len("+e+")";break;case"SUM":n="sum("+e+")";break;case"MIN":n="min("+e+")";break;case"MAX":n="max("+e+")";break;case"AVERAGE":t.definitions_.import_mixpy_math_mean="from mixpy import math_mean",n="math_mean("+e+")";break;case"MEDIAN":t.definitions_.import_mixpy_math_median="from mixpy import math_median",n="math_median("+e+")";break;case"MODE":t.definitions_.import_mixpy_math_modes="from mixpy import math_modes",n="math_modes("+e+")";break;case"STD_DEV":t.definitions_.import_mixpy_math_standard_deviation="from mixpy import math_standard_deviation",n="math_standard_deviation("+e+")";break;default:throw"Unknown operator: "+i}if(n)return[n,t.ORDER_ATOMIC]},Ga=function(e,t){return t.definitions_.import_mixpy_lists_sort="from mixpy import lists_sort",["lists_sort("+(t.valueToCode(e,"LIST",t.ORDER_NONE)||"[]")+', "'+e.getFieldValue("TYPE")+'", '+("1"===e.getFieldValue("DIRECTION")?"False":"True")+")",t.ORDER_ATOMIC]},Ha=function(e,t){var n=this.getFieldValue("OP"),i=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0",r="";return"array"==n?(t.definitions_.import_numpy="import numpy",r="numpy.array("+i+")"):r=n+"("+i+")",[r,t.ORDER_ATOMIC]},Wa=function(e,t){return["["+this.getFieldValue("CONTENT")+"]",t.ORDER_ATOMIC]},Xa=function(e,t){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=t.valueToCode(this,"ADD"+i,t.ORDER_NONE)||"0";return[n="["+n.join(", ")+"]",t.ORDER_ATOMIC]},qa=Ha,Ka=function(e,t){return"del "+(t.valueToCode(this,"TUP",t.ORDER_ASSIGNMENT)||"0")+"\n"},Za=ka,Qa=Ra,Ja=Na,el=Ca,tl=Da,nl=Ba,il=za,rl=function(e,t){return["list("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},sl=function(e,t){return[(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+".tolist()",t.ORDER_ATOMIC]},ol=function(e,t){return["enumerate("+(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist")+",start="+(t.valueToCode(this,"VALUE",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},al=function(e,t){var n=t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"mylist";return[(t.valueToCode(this,"CON",t.ORDER_ASSIGNMENT)||"0")+" in "+n,t.ORDER_ATOMIC]},ll=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++){var s=this.getFieldValue("KEY"+r);i[r]=s+":"+(t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0")}return i=n+"= {"+i.join(", ")+"}\n"},ul=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".keys()",t.ORDER_ATOMIC]},cl=function(e,t){var n=ze.Boards.getSelectedBoardKey().split(":")[2],i=t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT);if("educore"==n)var s=i+".get("+r+")";else s=i+"["+r+"]";return[s,t.ORDER_ATOMIC]},dl=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".get("+t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT)+","+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},hl=function(e,t){return(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"mydict")+"["+t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT)+"] = "+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+"\n"},pl=function(e,t){return"del "+(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"mydict")+"["+t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT)+"]\n"},fl=function(e,t){var n=t.valueToCode(this,"DICT2",t.ORDER_ASSIGNMENT)||"0";return(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".update("+n+")\n"},ml=function(e,t){return(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".clear()\n"},gl=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".items()",t.ORDER_ATOMIC]},_l=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".values()",t.ORDER_ATOMIC]},yl=function(e,t){return["len("+(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},vl=function(e,t){return"del "+(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+"\n"},bl=function(e,t){var n=t.valueToCode(e,"DICT",t.ORDER_MEMBER)||"[]",i=e.getFieldValue("WHERE"),r=t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT);switch(i){case"INSERT":var s=n+"["+r+"] = "+(t.valueToCode(this,"AT2",t.ORDER_ASSIGNMENT)||"0")+"\n";break;case"DELETE":s="del "+n+"["+r+"]\n";break;default:throw"Unhandled option (lists_setIndex2)"}return s},Tl=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+".pop("+t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT)+")",t.ORDER_ATOMIC]},xl=function(e,t){return(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"mydict")+".setdefault("+t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT)+","+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+")\n"},El=function(e,t){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++){var r=this.getFieldValue("KEY"+i);n[i]=r+": "+(t.valueToCode(this,"ADD"+i,t.ORDER_NONE)||"0")}return[n="{"+n.join(", ")+"}",t.ORDER_ATOMIC]},wl=function(e,t){return["dict("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},Il=function(e,t){return t.definitions_.import_json="import json",["json.dumps("+(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},Al=function(e,t){return t.definitions_.import_json="import json",["json.loads("+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"null")+")",t.ORDER_ATOMIC]},Sl=function(e,t){return[(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+"["+(t.valueToCode(this,"VAR1",t.ORDER_ASSIGNMENT)||"null")+"]["+(t.valueToCode(this,"VAR2",t.ORDER_ASSIGNMENT)||"null")+"]["+(t.valueToCode(this,"VAR3",t.ORDER_ASSIGNMENT)||"null")+"]["+(t.valueToCode(this,"VAR4",t.ORDER_ASSIGNMENT)||"null")+"]",t.ORDER_ATOMIC]},Cl=function(e,t){return t.definitions_.import_json="import json",t.definitions_.import_ujson="import ujson",["ujson.loads("+(t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},Ol=function(e,t){var n=this.getFieldValue("OP"),i=Ol.OPERATORS[n],r="=="==i||"!="==i?t.ORDER_EQUALITY:t.ORDER_RELATIONAL;return[(t.valueToCode(this,"A",r)||"0")+" "+i+" "+(t.valueToCode(this,"B",r)||"0"),r]},Ml=function(e,t){var n=this.getFieldValue("OP1"),i=Ol.OPERATORS[n],r=this.getFieldValue("OP2"),s=Ol.OPERATORS[r];return[(t.valueToCode(this,"A",t.ORDER_RELATIONAL)||"0")+" "+i+" "+(t.valueToCode(this,"B",t.ORDER_RELATIONAL)||"0")+" "+s+" "+(t.valueToCode(this,"C",t.ORDER_RELATIONAL)||"0"),t.ORDER_RELATIONAL]};Ol.OPERATORS={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="};const kl=function(e,t){var n=this.getFieldValue("OP"),i="&&"==n?t.ORDER_LOGICAL_AND:t.ORDER_LOGICAL_OR,r=t.valueToCode(this,"A",i)||"False",s=t.valueToCode(this,"B",i)||"False";if("AND"==n)var o=r+" and "+s;else if("OR"==n)o=r+" or "+s;else if("NOR"==n)o="not("+r+"^"+s+")";else o=r+"^"+s;return[o,i]},Rl=function(e,t){var n=t.ORDER_UNARY_PREFIX;return["not "+(t.valueToCode(this,"BOOL",n)||"False"),n]},Nl=function(e,t){return["TRUE"==this.getFieldValue("BOOL")?"True":"False",t.ORDER_ATOMIC]},Dl=function(e,t){return["None",t.ORDER_ATOMIC]},Fl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"False";return["("+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"False")+" if "+n+" else "+(t.valueToCode(this,"C",t.ORDER_ATOMIC)||"False")+")",t.ORDER_ATOMIC]},Ll=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Pl=function(e,t){var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''";return[n+" "+this.getFieldValue("BOOL")+" "+i,t.ORDER_ATOMIC]},Bl=function(e,t){return["bool("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},$l=function(e,t){return t.definitions_.import_os="import os","os.startfile("+t.valueToCode(this,"fn",t.ORDER_ATOMIC)+")\n"},Ul=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+" = open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')\n"},Vl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"')",t.ORDER_ATOMIC]},zl=function(e,t){return["open("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", '"+this.getFieldValue("MODE")+"', encoding=\""+this.getFieldValue("CODE")+'")',t.ORDER_ATOMIC]},jl=function(e,t){var n=t.valueToCode(this,"data",t.ORDER_ATOMIC);return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".write("+n+")\n"},Yl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"()",t.ORDER_ATOMIC]},Gl=function(e,t){var n=this.getFieldValue("MODE");return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+"."+n+"("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Hl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".readline("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Wl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".writable()",t.ORDER_ATOMIC]},Xl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".name()",t.ORDER_ATOMIC]},ql=function(e,t){return t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".close()\n"},Kl=function(e,t){t.definitions_.import_os="import os";return["os.listdir()",t.ORDER_ATOMIC]},Zl=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},Ql=function(e,t){return t.definitions_.import_os="import os",["os.path.getsize("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Jl=function(e,t){return[t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".tell()",t.ORDER_ATOMIC]},eu=function(e,t){var n=this.getFieldValue("MODE"),i=0;return i="start"==n?0:"current"==n?1:2,t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+".seek("+t.valueToCode(this,"SIZE",t.ORDER_ATOMIC)+","+i+")\n"},tu=function(e,t){return t.definitions_.import_os="import os","os.chdir("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},nu=function(e,t){t.definitions_.import_os="import os";return["os.getcwd()",t.ORDER_ATOMIC]},iu=function(e,t){return t.definitions_.import_os="import os","os."+this.getFieldValue("MODE")+"("+t.valueToCode(this,"PATH",t.ORDER_ATOMIC)+")\n"},ru=function(e,t){return t.definitions_.import_os="import os","os.rename("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NEWFILE",t.ORDER_ATOMIC)+")\n"},su=function(e,t){t.definitions_.import_os="import os";var n=t.valueToCode(this,"FILE",t.ORDER_ATOMIC);return["os."+this.getFieldValue("MODE")+"("+n+")",t.ORDER_ATOMIC]},ou=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = sdcard.SDCard("+t.valueToCode(this,"SPISUB",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PINSUB",t.ORDER_ATOMIC)+")\n"},au=function(e,t){return t.definitions_.import_os="import os",t.definitions_.import_sdcard="import sdcard","os.mount("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DIR",t.ORDER_ATOMIC)+")\n"},lu=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(i=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);var r=t.valueToCode(this,"RETURN",t.ORDER_NONE)||"";r&&(r=" return "+r+"\n");for(var s=[],o=0;o<this.arguments_.length;o++){var a=t.variableDB_.getName(this.arguments_[o],Ve.Variables.NAME_TYPE);s[o]=a}var l="def "+n+"("+s.join(", ")+"):\n"+i+r+"\n";return l=t.scrub_(this,l),t.setups_[n]=l,null},uu=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=(this.getInput("STACK")&&t.statementToCode(this,"STACK"))??" pass\n";t.INFINITE_LOOP_TRAP&&(i=t.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+this.id+"'")+i);for(var r=[],s=0;s<this.arguments_.length;s++){var o=t.variableDB_.getName(this.arguments_[s],Ve.Variables.NAME_TYPE);r[s]=o}var a="def "+n+"("+r.join(", ")+"):\n"+i+"\n";return a=t.scrub_(this,a),t.setups_[n]=a,null},cu=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=[],r=0;r<this.arguments_.length;r++)i[r]=t.valueToCode(this,"ARG"+r,t.ORDER_NONE)||"null";return[n+"("+i.join(", ")+")",t.ORDER_UNARY_POSTFIX]},du=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("NAME"),Ve.Procedures.NAME_TYPE),i=[],r=0;r<this.arguments_.length;r++)i[r]=t.valueToCode(this,"ARG"+r,t.ORDER_NONE)||"null";return n+"("+i.join(", ")+")\n"},hu=function(e,t){var n="if ("+(t.valueToCode(this,"CONDITION",t.ORDER_NONE)||"False")+") :\n";this.hasReturnValue_?n+=" return "+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"None"):n+=" return None";return n+="\n"},pu=function(e,t){var n="";this.hasReturnValue_?n+="return "+(t.valueToCode(this,"VALUE",t.ORDER_NONE)||"None"):n+="return None";return n+="\n"},fu=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0";if(1!=this.itemCount_)i=n+"= ("+i.join(", ")+")\n";else i=n+"= ("+i.join(", ")+",)\n";return i},mu=function(e,t){return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+"= ("+this.getFieldValue("TEXT")+")\n"},gu=function(e,t){return["("+this.getFieldValue("TEXT")+")",t.ORDER_ATOMIC]},_u=function(e,t){var n=t.valueToCode(this,"TUP",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"AT",t.ORDER_ADDITIVE)||"1";return i.match(/^\d+$/)&&(i=parseInt(i,10)),[n+"["+i+"]",t.ORDER_ATOMIC]},yu=function(e,t){return["len("+(t.valueToCode(this,"TUP",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},vu=function(e,t){return"del "+(t.valueToCode(this,"TUP",t.ORDER_ASSIGNMENT)||"0")+"\n"},bu=function(e,t){return[(t.valueToCode(this,"TUP1",t.ORDER_ASSIGNMENT)||"0")+" + "+(t.valueToCode(this,"TUP2",t.ORDER_ASSIGNMENT)||"0"),t.ORDER_ATOMIC]},Tu=function(e,t){var n=t.valueToCode(this,"TUP",t.ORDER_ASSIGNMENT)||"0";return[this.getFieldValue("DIR")+"("+n+")",t.ORDER_ATOMIC]},xu=function(e,t){return[this.getFieldValue("OP")+"("+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+")\n",t.ORDER_ATOMIC]},Eu=function(e,t){var n=this.getFieldValue("OP"),i=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0";if("INDEX"==n)var s=i+".index("+r+")";else if("COUNT"==n)s=i+".count("+r+")";return[s,t.ORDER_ATOMIC]},wu=function(e,t){var n,i=e.getFieldValue("OP");switch(t.definitions_.import_math="import math",e=t.valueToCode(e,"data",t.ORDER_NONE),i){case"LEN":n="len("+e+")";break;case"SUM":n="sum("+e+")";break;case"MIN":n="min("+e+")";break;case"MAX":n="max("+e+")";break;case"AVERAGE":n=t.provideFunction_("math_mean",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = [e for e in myList if type(e) == int or type(e) == float]"," if not localList: return"," return float(sum(localList)) / len(localList)"])+"("+e+")";break;case"MEDIAN":n=t.provideFunction_("math_median",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(myList):"," localList = sorted([e for e in myList if type(e) == int or type(e) == float])"," if not localList: return"," if len(localList) % 2 == 0:"," return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0"," else:"," return localList[(len(localList) - 1) // 2]"])+"("+e+")";break;case"MODE":n=t.provideFunction_("math_modes",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(some_list):"," modes = []"," # Using a lists of [item, count] to keep count rather than dict",' # to avoid "unhashable" errors when the counted item is itself a list or dict.'," counts = []"," maxCount = 1"," for item in some_list:"," found = False"," for count in counts:"," if count[0] == item:"," count[1] += 1"," maxCount = max(maxCount, count[1])"," found = True"," if not found:"," counts.append([item, 1])"," for counted_item, item_count in counts:"," if item_count == maxCount:"," modes.append(counted_item)"," return modes"])+"("+e+")";break;case"STD_DEV":t.definitions_.import_math="import math",n=t.provideFunction_("math_standard_deviation",["def "+t.FUNCTION_NAME_PLACEHOLDER_+"(numbers):"," n = len(numbers)"," if n == 0: return"," mean = float(sum(numbers)) / n"," variance = sum((x - mean) ** 2 for x in numbers) / n"," return math.sqrt(variance)"])+"("+e+")";break;default:throw"Unknown operator: "+i}if(n)return[n,t.ORDER_FUNCTION_CALL]},Iu=function(e,t){var n=t.valueToCode(e,"LIST",t.ORDER_MEMBER)||"[]",i=e.getFieldValue("WHERE1"),r=e.getFieldValue("WHERE2");switch(i){case"FROM_START":"0"==(s=t.getAdjustedInt(e,"AT1"))&&(s="");break;case"FROM_END":var s=t.getAdjustedInt(e,"AT1",1,!0);break;case"FIRST":s="0";break;default:throw"Unhandled option (lists_getSublist)"}switch(r){case"FROM_START":var o=t.getAdjustedInt(e,"AT2",1);o-=1;break;case"FROM_END":o=t.getAdjustedInt(e,"AT2",1,!0);Ve.isNumber(String(o))?"0"==o&&(o=""):(t.definitions_.import_sys="import sys",o+=" or sys.maxsize");break;case"LAST":o="-1";break;default:throw"Unhandled option (lists_getSublist)"}return[n+"["+s+" : "+o+"]",t.ORDER_MEMBER]},Au=function(e,t){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=t.valueToCode(this,"ADD"+i,t.ORDER_NONE)||"0";if(1!=this.itemCount_)n="("+n.join(", ")+")";else n="("+n.join(", ")+",)";return[n,t.ORDER_ATOMIC]},Su=function(e,t){return[(t.valueToCode(this,"LIST",t.ORDER_ADDITIVE)||"0")+"["+(t.valueToCode(this,"AT1",t.ORDER_ADDITIVE)||"0")+" : "+(t.valueToCode(this,"AT2",t.ORDER_ADDITIVE)||"0")+"]",t.ORDER_ATOMIC]},Cu=function(e,t){return t.definitions_.import_random="import random",["random.choice("+(t.valueToCode(this,"TUP",t.ORDER_ADDITIVE)||"mytup")+")",t.ORDER_ATOMIC]},Ou=function(e,t){return["tuple("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},Mu=function(e,t){return["("+this.getFieldValue("CONTENT")+")",t.ORDER_ATOMIC]},ku=function(e,t){var n=t.valueToCode(this,"params",t.ORDER_ATOMIC)||"0",i=t.valueToCode(this,"des",t.ORDER_ATOMIC)||"0";return["("+n+',"'+this.getFieldValue("type")+'",'+i+")",t.ORDER_ATOMIC]},Ru=function(e,t){for(var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"0";return i=n+"= {"+i.join(", ")+"}\n",0==this.itemCount_&&(i=n+" = set()\n"),i},Nu=function(e,t){return["len("+(t.valueToCode(this,"SET",t.ORDER_ASSIGNMENT)||"0")+")",t.ORDER_ATOMIC]},Du=function(e,t){return[(t.valueToCode(this,"SET",t.ORDER_ASSIGNMENT)||"0")+".pop()",t.ORDER_ATOMIC]},Fu=function(e,t){return(t.valueToCode(this,"SET",t.ORDER_ASSIGNMENT)||"0")+".clear()\n"},Lu=function(e,t){var n=t.valueToCode(this,"SET1",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"SET2",t.ORDER_ASSIGNMENT)||"0";return[n+"."+this.getFieldValue("OPERATE")+"("+i+")",t.ORDER_ATOMIC]},Pu=function(e,t){var n=t.valueToCode(this,"SET1",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"SET2",t.ORDER_ASSIGNMENT)||"0";return n+"."+this.getFieldValue("OPERATE")+"("+i+")\n"},Bu=function(e,t){return(t.valueToCode(this,"SET",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("OPERATE")+"("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+")\n"},$u=function(e,t){var n=t.valueToCode(this,"SET1",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"SET2",t.ORDER_ASSIGNMENT)||"0";return[n+"."+this.getFieldValue("OPERATE")+"("+i+")",t.ORDER_ATOMIC]},Uu=function(e,t){return(t.valueToCode(this,"SET",t.ORDER_ASSIGNMENT)||"0")+".update("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},Vu=function(e,t){return["{"+this.getFieldValue("TEXT")+"}",t.ORDER_ATOMIC]},zu=function(e,t){return["set("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},ju=function(e,t){return["'''<!DOCTYPE HTML>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n"+t.statementToCode(this,"HEAD")+"</head>\n<body>\n"+t.statementToCode(this,"BODY")+"</body>\n</html>\n'''",t.ORDER_ATOMIC]},Yu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<h"+i+">\n"+n+"</h"+i+">\n"},Gu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");if("head"==i)var r="<"+i+'>\n\t<meta charset="utf-8">\n'+n+"</"+i+">\n";else r="<"+i+">\n"+n+"</"+i+">\n";return r},Hu=function(e,t){var n=t.statementToCode(this,"DO"),i=this.getFieldValue("LEVEL");return"<"+i+">\n"+n+"</"+i+">\n"},Wu=function(e,t){var n=t.statementToCode(this,"DO"),i=t.valueToCode(this,"style"),r=this.getFieldValue("LEVEL");return"<"+r+" "+i+" >\n"+n+"</"+r+">\n"},Xu=function(e,t){return['style="'+t.statementToCode(this,"STYLE")+'"',t.ORDER_ATOMIC]},qu=function(e,t){return'<input type="'+this.getFieldValue("LEVEL")+'" name="'+this.getFieldValue("NAME")+'" value="'+this.getFieldValue("VALUE")+'" '+(t.valueToCode(this,"style")||"")+" />"},Ku=function(){return this.getFieldValue("KEY")+":"+this.getFieldValue("VALUE")+";"},Zu=function(){return this.getFieldValue("TEXT")+"\n"},Qu=function(e){return e.getFieldValue("TEXT")+"\n"},Ju=function(e,t){return[e.getFieldValue("TEXT"),t.ORDER_ATOMIC]},ec=function(e,t){return(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"")+"\n"},tc=function(){return""},nc=function(e,t){return["type("+(t.valueToCode(e,"VALUE",t.ORDER_MEMBER)||"___")+")",t.ORDER_ATOMIC]},ic=function(e,t){for(var n=e.getFieldValue("NAME"),i=e.hasReturn_,r=new Array(e.itemCount_),s=0;s<e.itemCount_;s++)r[s]=t.valueToCode(e,"ARGUMENT"+s,t.ORDER_NONE)||"___";var o=n+"("+r.join(", ")+")";return i?[o,t.ORDER_ATOMIC]:o+"\n"},rc=function(e,t){var n=t.valueToCode(e,"MODULE",t.ORDER_ATOMIC),i=t.valueToCode(e,"NAME",t.ORDER_ATOMIC);return[n+"."+(i=i.substring(1,i.length-1)),t.ORDER_NONE]},sc={};sc.NAME_TYPE=Ve.PROCEDURE_CATEGORY_NAME,sc.allProcedures=function(e){for(var t=e.getAllBlocks(!1),n=[],i=[],r=0;r<t.length;r++)if(t[r].getProcedureDef){var s=t[r].getProcedureDef();s&&(s[2]?n.push(s):i.push(s))}return i.sort(sc.procTupleComparator_),n.sort(sc.procTupleComparator_),[i,n]},sc.procTupleComparator_=function(e,t){return e[0].toLowerCase().localeCompare(t[0].toLowerCase())},sc.findLegalName=function(e,t){if(t.isInFlyout)return e;for(e=e||Ve.Msg.UNNAMED_KEY||"unnamed";!sc.isLegalName_(e,t.workspace,t);){var n=e.match(/^(.*?)(\d+)$/);n?e=n[1]+(parseInt(n[2],10)+1):e+="2"}return e},sc.isLegalName_=function(e,t,n){return!sc.isNameUsed(e,t,n)},sc.isNameUsed=function(e,t,n){for(var i=t.getAllBlocks(!1),r=0;r<i.length;r++)if(i[r]!=n&&i[r].getProcedureDef){var s=i[r].getProcedureDef();if(Ve.Names.equals(s[0],e))return!0}return!1},sc.rename=function(e){e=e.trim();var t=sc.findLegalName(e,this.getSourceBlock()),n=this.getValue();if(n!=e&&n!=t)for(var i=this.getSourceBlock().workspace.getAllBlocks(!1),r=0;r<i.length;r++)i[r].renameProcedure&&i[r].renameProcedure(n,t);return t},sc.flyoutCategory=function(e){var t,n,i=[];Ve.Blocks.procedures_defnoreturn&&((n=Ve.utils.xml.createElement("block")).setAttribute("type","procedures_defnoreturn"),n.setAttribute("gap",16),(t=Ve.utils.xml.createElement("field")).setAttribute("name","NAME"),t.appendChild(Ve.utils.xml.createTextNode(Ve.Msg.PROCEDURES_DEFNORETURN_PROCEDURE)),n.appendChild(t),i.push(n));Ve.Blocks.procedures_defreturn&&((n=Ve.utils.xml.createElement("block")).setAttribute("type","procedures_defreturn"),n.setAttribute("gap",16),(t=Ve.utils.xml.createElement("field")).setAttribute("name","NAME"),t.appendChild(Ve.utils.xml.createTextNode(Ve.Msg.PROCEDURES_DEFRETURN_PROCEDURE)),n.appendChild(t),i.push(n));Ve.Blocks.procedures_return&&((n=Ve.utils.xml.createElement("block")).setAttribute("type","procedures_return"),n.setAttribute("gap",16),i.push(n));Ve.Blocks.procedures_ifreturn&&((n=Ve.utils.xml.createElement("block")).setAttribute("type","procedures_ifreturn"),n.setAttribute("gap",16),i.push(n));function r(e,t){for(var n=0;n<e.length;n++){var r=e[n][0],s=e[n][1],o=Ve.utils.xml.createElement("block");o.setAttribute("type",t),o.setAttribute("gap",16);var a=Ve.utils.xml.createElement("mutation");a.setAttribute("name",r),o.appendChild(a);for(var l=0;l<s.length;l++){var u=Ve.utils.xml.createElement("arg");u.setAttribute("name",s[l]),a.appendChild(u)}i.push(o)}}i.length&&i[i.length-1].setAttribute("gap",24);var s=sc.allProcedures(e);return r(s[0],"procedures_callnoreturn"),r(s[1],"procedures_callreturn"),i},sc.getCallers=function(e,t){for(var n=[],i=t.getAllBlocks(!1),r=0;r<i.length;r++)if(i[r].getProcedureCall){var s=i[r].getProcedureCall();s&&Ve.Names.equals(s,e)&&n.push(i[r])}return n},sc.mutateCallers=function(e){const t=Ve.Events.getRecordUndo(),n=e.getProcedureDef()[0],i=e.mutationToDom(!0),r=Ve.Procedures.getCallers(n,e.workspace);for(let e,n=0;e=r[n];n++){const n=e.mutationToDom(),r=n&&Ve.utils.xml.domToText(n);e.domToMutation&&e.domToMutation(i);const s=e.mutationToDom(),o=s&&Ve.utils.xml.domToText(s);r!==o&&(Ve.Events.setRecordUndo(!1),Ve.Events.fire(new(Ve.Events.get(Ve.Events.BLOCK_CHANGE))(e,"mutation",null,r,o)),Ve.Events.setRecordUndo(t))}},sc.getDefinition=function(e,t){for(var n=t.getTopBlocks(!1),i=0;i<n.length;i++)if(n[i].getProcedureDef){var r=n[i].getProcedureDef();if(r&&Ve.Names.equals(r[0],e))return n[i]}return null};const oc=sc,ac=new Ve.Generator("Python");ac.INDENT=" ",ac.addReservedWords("False,None,True,and,as,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,nonlocal,not,or,pass,print,raise,return,try,while,with,yield,NotImplemented,Ellipsis,__debug__,quit,exit,copyright,license,credits,ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EnvironmentError,Exception,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StandardError,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,ZeroDivisionError,_,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,all,any,apply,ascii,basestring,bin,bool,buffer,bytearray,bytes,callable,chr,classmethod,cmp,coerce,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,execfile,exit,file,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,intern,isinstance,issubclass,iter,len,license,list,locals,long,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,raw_input,reduce,reload,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,unichr,unicode,vars,xrange,zip"),ac.ORDER_ATOMIC=0,ac.ORDER_COLLECTION=1,ac.ORDER_STRING_CONVERSION=1,ac.ORDER_UNARY_POSTFIX=1,ac.ORDER_UNARY_PREFIX=2,ac.ORDER_MEMBER=2.1,ac.ORDER_FUNCTION_CALL=2.2,ac.ORDER_EXPONENTIATION=3,ac.ORDER_UNARY_SIGN=4,ac.ORDER_BITWISE_NOT=4,ac.ORDER_MULTIPLICATIVE=5,ac.ORDER_ADDITIVE=6,ac.ORDER_BITWISE_SHIFT=7,ac.ORDER_BITWISE_AND=8,ac.ORDER_BITWISE_XOR=9,ac.ORDER_BITWISE_OR=10,ac.ORDER_RELATIONAL=11,ac.ORDER_EQUALITY=11,ac.ORDER_LOGICAL_NOT=12,ac.ORDER_LOGICAL_AND=13,ac.ORDER_LOGICAL_OR=14,ac.ORDER_ASSIGNMENT=14,ac.ORDER_CONDITIONAL=15,ac.ORDER_LAMBDA=16,ac.ORDER_NONE=99,ac.ORDER_OVERRIDES=[[ac.ORDER_FUNCTION_CALL,ac.ORDER_MEMBER],[ac.ORDER_FUNCTION_CALL,ac.ORDER_FUNCTION_CALL],[ac.ORDER_MEMBER,ac.ORDER_MEMBER],[ac.ORDER_MEMBER,ac.ORDER_FUNCTION_CALL]],ac.init=function(){ac.PASS=this.INDENT+"pass\n",ac.definitions_=Object.create(null),ac.functionNames_=Object.create(null),ac.setups_=Object.create(null),ac.loops_=Object.create(null),ac.codeEnd_=Object.create(null),ac.variableDB_?ac.variableDB_.reset():ac.variableDB_=new He(ac.RESERVED_WORDS_)},ac.finish=function(e){""!==e&&(e=(e=e.replace(/\n/g,"\n")).replace(/\n\s+$/,"\n"));var t=[],n=[],i=[];for(var r in this.definitions_){var s=this.definitions_[r];0===r.indexOf("import")?t.push(s):0===r.indexOf("var_declare")?n.push(s):i.push(s)}t.length&&t.push("\n\n"),n.length&&n.push("\n\n"),i.length&&i.push("\n\n");var o=[];for(var r in ac.functions_)o.push(ac.functions_[r]);o.length&&o.push("\n\n");var a=[];for(var r in ac.setups_)a.push(ac.setups_[r]);a.length&&a.push("\n\n");var l=[];for(var r in ac.loops_)l.push(ac.loops_[r]);var u=[];for(var r in ac.codeEnd_)u.push(ac.codeEnd_[r]);return 0!==u.length&&u.push("\n"),l.length>0?t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+"while True:\n"+l.join("")+u.join("\n"):t.join("\n")+n.join("\n")+i.join("\n")+o.join("\n")+a.join("")+e+u.join("\n")},ac.scrubNakedValue=function(e){return e+"\n"},ac.quote_=function(e){var t="'";return-1!==e.indexOf("'")&&(-1===e.indexOf('"')?t='"':e=e.replace(/'/g,"\\'")),t+e+t},ac.multiline_quote_=function(e){return"'''"+(e=e.replace(/'''/g,"\\'\\'\\'"))+"'''"},ac.scrub_=function(e,t,n){var i="";if(!e.outputConnection||!e.outputConnection.targetConnection){(s=e.getCommentText())&&(s=Ve.utils.string.wrap(s,ac.COMMENT_WRAP-3),i+=ac.prefixLines(s+"\n","# "));for(var r=0;r<e.inputList.length;r++)if(e.inputList[r].type==Ve.INPUT_VALUE){var s,o=e.inputList[r].connection.targetBlock();if(o)(s=ac.allNestedComments(o))&&(i+=ac.prefixLines(s,"# "))}}var a=e.nextConnection&&e.nextConnection.targetBlock();return i+t+(n?"":ac.blockToCode(a))},ac.getAdjustedInt=function(e,t,n,i){var r=n||0;e.workspace.options.oneBasedIndex&&r--;var s=e.workspace.options.oneBasedIndex?"1":"0",o=r?ac.ORDER_ADDITIVE:ac.ORDER_NONE,a=ac.valueToCode(e,t,o)||s;return Ve.isNumber(a)?(a=parseInt(a,10)+r,i&&(a=-a)):(a=r>0?"int("+a+" + "+r+")":r<0?"int("+a+" - "+-r+")":"int("+a+")",i&&(a="-"+a)),a};const lc=205,uc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_CHOOSE_AND_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_CHOOSE_AND_GET_ONE_FILE_NAME,"getOneFile"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_MANY_FILE_NAMES,"getManyFiles"],[Ve.Msg.MIXLY_CHOOSE_AND_GET_DIR,"getDirectory"]]),"TYPE"),this.setInputsInline(!0),this.setOutput(!0)}},cc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SETUP).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"AipImageClassify"],[Ve.Msg.MIXLY_AipSpeech,"AipSpeech"],[Ve.Msg.MIXLY_AipImageCensor,"AipImageCensor"],[Ve.Msg.MIXLY_AipFace,"AipFace"],[Ve.Msg.MIXLY_AipOcr,"AipOcr"],[Ve.Msg.MIXLY_AipNlp,"AipNlp"]]),"CTYPE"),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("API_KEY").appendField("API_KEY").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("SECRET_KEY").appendField("SECRET_KEY").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_synthesis).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_synthesis_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},hc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipSpeech_asr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_AipSpeech_File).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipSpeech_ASR_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},pc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipImageClassify).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipImageClassify_advancedGeneral_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},fc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify_advancedGeneral,"advancedGeneral"],[Ve.Msg.MIXLY_AipImageClassify_dishDetect,"dishDetect"],[Ve.Msg.MIXLY_AipImageClassify_carDetect,"carDetect"],[Ve.Msg.MIXLY_AipImageClassify_animalDetect,"animalDetect"],[Ve.Msg.MIXLY_AipImageClassify_plantDetect,"plantDetect"],[Ve.Msg.MIXLY_AipImageClassify_logoSearch,"logoSearch"]]),"TYPE"),this.setOutput(!0)}},mc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipFace_match).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"1"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("VAR2").appendField(Ve.Msg.MIXLY_AipImageClassify_Image+"2"+Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipFace_match_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},gc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipOcr).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ADDR").appendField(Ve.Msg.MIXLY_AipImageClassify_Image).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipOcr_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},_c={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipOcr_basicGeneral,"basicGeneral"],[Ve.Msg.MIXLY_AipOcr_webImage,"webImage"],[Ve.Msg.MIXLY_AipOcr_idcard,"idcard"],[Ve.Msg.MIXLY_AipOcr_bankcard,"bankcard"],[Ve.Msg.MIXLY_AipOcr_drivingLicense,"drivingLicense"],[Ve.Msg.MIXLY_AipOcr_vehicleLicense,"vehicleLicense"],[Ve.Msg.MIXLY_AipOcr_licensePlate,"licensePlate"],[Ve.Msg.MIXLY_AipOcr_businessLicense,"businessLicense"],[Ve.Msg.MIXLY_AipOcr_receipt,"receipt"],[Ve.Msg.MIXLY_AipOcr_trainTicket,"trainTicket"],[Ve.Msg.MIXLY_AipOcr_taxiReceipt,"taxiReceipt"],[Ve.Msg.MIXLY_AipOcr_form,"tableRecognition"],[Ve.Msg.MIXLY_AipOcr_vatInvoice,"vatInvoice"],[Ve.Msg.MIXLY_AipOcr_passport,"passport"],[Ve.Msg.MIXLY_AipOcr_handwriting,"handwriting"]]),"TYPE"),this.setOutput(!0)}},yc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.OLED_STRING).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},vc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_Sim).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("FUNC").appendField(Ve.Msg.MIXLY_AIP_FUNC).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.OLED_STRING+"1").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.OLED_STRING+"2").setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Sim_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},bc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_lexer,"lexer"],[Ve.Msg.MIXLY_AipNlp_depParser,"depParser"],[Ve.Msg.MIXLY_AipNlp_wordEmbedding,"wordEmbedding"],[Ve.Msg.MIXLY_AipNlp_dnnlm,"dnnlm"],[Ve.Msg.MIXLY_AipNlp_commentTag,"commentTag"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"sentimentClassify"],[Ve.Msg.MIXLY_AipNlp_keyword,"keyword"],[Ve.Msg.MIXLY_AipNlp_topic,"topic"],[Ve.Msg.MIXLY_AipNlp_ecnet,"ecnet"],[Ve.Msg.MIXLY_AipNlp_emotion,"emotion"]]),"TYPE"),this.setOutput(!0)}},Tc={init:function(){this.setColour(lc),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipNlp_wordSimEmbedding,"wordSimEmbedding"],[Ve.Msg.MIXLY_AipNlp_simnet,"simnet"]]),"TYPE"),this.setOutput(!0)}},xc={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_topic).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR1").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR2").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Topic_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},Ec={init:function(){this.setColour(lc),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_AipNlp_summary).appendField(Ve.Msg.MIXLY_Client).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("STR").appendField(Ve.Msg.MIXLY_AipNlp_Topic_Content).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("LEN").appendField(Ve.Msg.MIXLY_LIST_LEN).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("ATTR").appendField(Ve.Msg.MIXLY_AIP_ATTR).setAlign(Ve.inputs.Align.RIGHT),this.setTooltip(Ve.Msg.MIXLY_AipNlp_Summary_TOOLTIP),this.setInputsInline(!1),this.setOutput(!0)}},wc={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_AUDIO),this.appendValueInput("TIME").appendField(Ve.Msg.MIXPY_AI_AUDIO_TIME),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_AUDIO_TOOLTIP)}},Ic={init:function(){this.setColour(lc),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_AI_PHOTO),this.appendValueInput("BUT").appendField(Ve.Msg.MIXPY_AI_PHOTO_BUTTON),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXPY_AI_PHOTO_TOOLTIP)}},Ac={init:function(){this.setColour(lc),this.appendValueInput("AI").appendField(Ve.Msg.MIXPY_AI_RESULT).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AipImageClassify,"Image"],[Ve.Msg.MIXLY_AipSpeech_asr,"Speech"],[Ve.Msg.MIXLY_AipFace_match,"Face"],[Ve.Msg.MIXLY_AipOcr,"Ocr"],[Ve.Msg.MIXLY_AipNlp_simnet,"OcrSimilarity"],[Ve.Msg.MIXLY_AipNlp_sentimentClassify,"Emotion"]]),"CTYPE"),this.setOutput(!0),this.setTooltip(Ve.Msg.LOGIC_NEGATE_TOOLTIP)}},Sc="#526FC3",Cc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Oc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_SCHOOL),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Mc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIND_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEW_PATH),this.setOutput(!0)}},Rc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_SET_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Nc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ADD_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Dc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DEL_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Fc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_RETURN_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Lc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_LEFT),this.setOutput(!0)}},Pc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Bc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},$c={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_CURRENT_SCHOOL),this.setOutput(!0)}},Uc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_PATH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Vc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PREPARE_2_2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_MOVE_RECENT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Yc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_HOME),this.setOutput(!0)}},Gc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NOT_SCHOOL),this.setOutput(!0)}},Hc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_PATH2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Wc={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Xc={init:function(){this.appendDummyInput().appendField("移动圆盘从"),this.appendValueInput("FROM_NUM").setCheck(null).appendField("柱"),this.appendDummyInput().appendField("到"),this.appendValueInput("TO_NUM").setCheck(null).appendField("柱"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Kc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_ALL_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Zc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_FIRST_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Qc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NO_RING),this.setOutput(!0)}},Jc={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_YES_RING),this.setOutput(!0)}},ed={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NEXT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},td={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_TWO_LEFT),this.setOutput(!0)}},nd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DIVIDE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},id={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_HALF_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},rd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},sd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},od={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_DELETE_BOOKS2),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ad={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_BOOK),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},ld={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置待查书总数 N=").appendField(new Ve.FieldDropdown([["5","5"],["10","10"],["20","20"],["50","50"]]),"NUM"),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},ud={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ZERO),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},cd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_NUMBER_ADD),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},dd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_NUMBER),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},hd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField("n"+Ve.Msg.MIXLY_VALUE2).appendField(new Ve.FieldTextInput("50"),"NUM"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},pd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_SEQUENCE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_PRINT_DIVIDE),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化鸡兔同笼问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有若干只鸡、兔在同一个笼子里。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从上面数鸡兔有10个头"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("从下面数鸡兔有32只脚。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问笼中有多少只鸡和多少只兔?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},gd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子的数量为0只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},_d={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("兔子的数量在范围之内"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},yd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("根据(头数-兔子数)计算出鸡的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},vd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算得到脚的数量正确"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},bd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出鸡、兔的数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Td={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("假设兔子数量要更多一只"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},xd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("加载路线图"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ed={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("计算").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("长度"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},wd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置S1为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Id={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("的长度比").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME2").appendField("短"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Ad={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("设置").appendField(new Ve.FieldDropdown([["S1","1"],["S2","2"],["S3","3"],["S4","4"]]),"PATHNAME").appendField("为Smin"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Sd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("按照Smin移动"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Cd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化韩信点兵问题:"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("有未知数量的若干士兵。"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若3人一排列队多1人"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若5人一排列队多2人"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("若7人一排列队多2人"),this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("问士兵的数量最少是多少人?"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Od={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("初始化士兵为").appendField(new Ve.FieldTextInput("7"),"NUM").appendField("个"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Md={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("使士兵").appendField(new Ve.FieldDropdown([["3","3"],["5","5"],["7","7"]]),"NUM").appendField("人一排列队"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},kd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("剩余").appendField(new Ve.FieldTextInput("1"),"NUM").appendField("个士兵"),this.setOutput(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Rd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("增加1个士兵"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Nd={init:function(){this.appendDummyInput().setAlign(Ve.inputs.Align.LEFT).appendField("输出士兵数量"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setTooltip(""),this.setHelpUrl("")}},Dd={init:function(){this.appendDummyInput().appendField("准备").appendField(new Ve.FieldNumber(3,0,100,1),"NUM").appendField("层汉诺塔"),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.HTML_COLOUR),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(Sc),this.setInputsInline(!0),this.setTooltip(""),this.setHelpUrl("")}},Fd={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_GET_CURRENT_LOCATION),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},Ld={init:function(){this.setColour(Sc),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MIXPY_ALGORITHM_VOID_PATH),this.setOutput(!0)}},Pd={init:function(){this.setColour(Sc),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Bd="#3288dd",$d={init:function(){this.setColour(Bd),this.appendValueInput("DOMAIN").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS_GET).appendField(new Ve.FieldTextInput("response"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_REQUESTS_GET_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ud={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["get","get"],["head","head"],["delete","delete"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS).appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},Vd={init:function(){this.setColour(Bd),this.appendValueInput("URL").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["patch","patch"]]),"TYPE").appendField(Ve.Msg.blockpy_REQUESTS),this.appendValueInput("data").appendField(Ve.Msg.blockpy_REQUESTS+Ve.Msg.OLED_STRING),this.appendDummyInput("").appendField(Ve.Msg.MIXPY_REQUESTS_GET_RESULT),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("")}},zd={init:function(){this.appendValueInput("VAL");var e=[[Ve.Msg.blockpy_REQUESTS_GET_ATTR_STATUS_CODE,"status_code"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_TEXT,"text"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_COOKIES,"cookies"],[Ve.Msg.blockpy_REQUESTS_GET_ATTR_CONTENT,"content"],[Ve.Msg.MIXPY_TEXT_ENCODE,"encoding"]];this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_JS_GET).appendField(new Ve.FieldDropdown(e),"ATTR"),this.setInputsInline(!0),this.setOutput(!0,String)}},jd={init:function(){this.appendValueInput("VAR").appendField(Ve.Msg.DISPLAY_IMAGE_LET2).setCheck(String);this.setColour(Bd),this.appendDummyInput("").appendField(Ve.Msg.blockpy_CONDUCT).appendField(new Ve.FieldDropdown([["post","post"],["put","put"],["delete","delete"],["head","head"],["option","option"]]),"DIR"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_REQUESTS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var e=this;this.setTooltip(function(){var t=e.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[t]})}},Yd="f0a559",Gd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_IMREAD),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Hd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.OLED_BITMAP),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_AipNlp_Topic_Title),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Wd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_CV_IMWRITE),this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.HTML_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Xd={init:function(){this.setColour(Yd),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS+Ve.Msg.MIXLY_CV_OR_PRESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_WAITKEY_TOOLTIP)}},qd={init:function(){this.setColour(Yd),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CV_DESTROY_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0)}},Kd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);var e=[[Ve.Msg.MIXLY_CV_RECT,"rectangle"],[Ve.Msg.MIXLY_CV_LINE,"line"]];this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendValueInput("x2").setCheck(Number).appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_END+"(x2"),this.appendValueInput("y2").setCheck(Number).appendField(",y2"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Zd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE);this.appendValueInput("data").setCheck(String).appendField(Ve.Msg.MIXLY_CV_DRAWTEXT),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_BEGIN+"(x1"),this.appendValueInput("y1").setCheck(Number).appendField(",y1"),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME).appendField(new Ve.FieldDropdown([["SIMPLEX","SIMPLEX"],["PLAIN","PLAIN"],["DUPLEX","DUPLEX"],["COMPLEX","COMPLEX"],["COMPLEX_SMALL","COMPLEX_SMALL"],["TRIPLEX","TRIPLEX"],["SCRIPT_SIMPLEX","SCRIPT_SIMPLEX"],["SCRIPT_COMPLEX","SCRIPT_COMPLEX"]]),"font"),this.appendValueInput("size").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput().appendField(") "+Ve.Msg.MIXLY_CV_DRAWLINE_COLOR).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendValueInput("thick").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_DRAWLINE_THICKNESS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_CV_DRAWLINE_RECT_TOOLTIP)}},Qd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.MIXLY_CV_FACE_CLASSIFIER),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},Jd={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},eh={init:function(){this.setColour(Yd),this.appendValueInput("FILE").appendField(Ve.Msg.MIXLY_MICROBIT_IMAGE),this.appendValueInput("FACE").appendField(Ve.Msg.MIXLY_CV_FACE_DETECT),this.appendValueInput("SCALE").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_SCALE),this.appendValueInput("NEIGHBOR").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_NEIGHBOR),this.appendValueInput("x1").setCheck(Number).appendField(Ve.Msg.MIXLY_CV_FACE_DETECT_RANGE).appendField(Ve.Msg.blockpy_TUPLE_MIN),this.appendValueInput("y1").setCheck(Number).appendField("×"),this.appendValueInput("x2").setCheck(Number).appendField(Ve.Msg.blockpy_TUPLE_MAX),this.appendValueInput("y2").setCheck(Number).appendField("×"),this.setInputsInline(!0),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)}},th=170,nh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ih={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_series_create).appendField(new Ve.FieldTextInput("ser1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_series_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},rh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},sh={init:function(){this.setColour(th);var e=[[Ve.Msg.DATAFRAME_RAW,"index"],[Ve.Msg.DATAFRAME_COLUMN,"columns"]];this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"COLUMN_RAW"),this.appendValueInput("INDEX").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_series_set_index),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},oh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.blockpy_dataframe_create).appendField(new Ve.FieldTextInput("df1"),"VAR"),this.appendValueInput("SER").appendField(Ve.Msg.blockpy_series_via),this.appendValueInput("INDEX_COLUMN").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_column),this.appendValueInput("INDEX_RAW").setCheck([String,"List"]).appendField(Ve.Msg.blockpy_dataframe_set_index_raw),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_dataframe_create_index_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},ah={init:function(){this.setColour(th),this.appendDummyInput("").appendField(new Ve.FieldTextInput("ser1"),"VAR").appendField(" = [").appendField(new Ve.FieldTextInput("1,2,3"),"TEXT").appendField("]"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SERIES_CREATE_FROM_TEXT)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},lh={init:function(){this.setColour(th);var e=[[Ve.Msg.SERIES_INDEX,"index"],[Ve.Msg.HTML_VALUE,"value"]];this.appendValueInput("SERIES").setCheck("Series"),this.appendDummyInput("").appendField(Ve.Msg.SERIES_INDEX_VALUE).appendField(new Ve.FieldDropdown(e),"INDEX_VALUE"),this.setOutput(!0,"List");var t=this;this.setTooltip(function(){var e=t.getFieldValue("INDEX_VALUE");return{index:Ve.Msg.SERIES_INDEX_TOOLTIP,value:Ve.Msg.HTML_VALUE_TOOLTIP}[e]})}},uh={init:function(){this.setColour(th),this.setOutput(!0),this.appendValueInput("SER").setCheck("Series"),this.appendValueInput("AT").setCheck(Number).appendField(Ve.Msg.LANG_LISTS_GET_INDEX1),this.appendDummyInput("").appendField(Ve.Msg.LANG_LISTS_GET_INDEX2),this.setInputsInline(!0),this.setTooltip(Ve.Msg.TUPLE_GET_INDEX_TOOLTIP)}},ch={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},dh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_h={init:function(){this.setColour(th),this.appendValueInput("FROM").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_SPLITBYDOU).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_FROM),this.appendValueInput("TO").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXPY_DATA_ARRAY_CREATE_TO),this.appendValueInput("STEP").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_STEP),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},yh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},vh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},bh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Th={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},xh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Eh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Ih={init:function(){var e=[["sin","sin"],["cos","cos"],["tan","tan"],["arcsin","arcsin"],["arccos","arccos"],["arctan","arctan"],[Ve.Msg.LANG_MATH_TO_ROUND,"round"],[Ve.Msg.LANG_MATH_TO_CEIL,"ceil"],[Ve.Msg.LANG_MATH_TO_FLOOR,"floor"]];this.setColour(th),this.setOutput(!0),this.setInputsInline(!0),this.appendDummyInput().appendField(Ve.Msg.mixpy_NUMPY_TRIG),this.appendValueInput("NUM").setCheck(Number).appendField(new Ve.FieldDropdown(e),"OP"),this.setTooltip(Ve.Msg.mixpy_NUMPY_TRIG_TOOLTIP)}},Ah={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Sh={init:function(){this.setColour(th),this.appendValueInput("FILENAME").appendField(Ve.Msg.MIXPY_PANDAS_READ_CSV),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_Y,"0"],[Ve.Msg.mixpy_PANDAS_READCSV_HEADER_N,"None"]]),"MODE"),this.appendDummyInput().appendField(Ve.Msg.mixpy_PANDAS_READCSV_TITLE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.mixpy_PANDAS_READCSV_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ch={init:function(){this.setColour(th),this.appendValueInput("DICT").setCheck("Dict"),this.appendValueInput("KEY").appendField(Ve.Msg.mixpy_DATAFRAME_GET),this.appendDummyInput("").appendField(Ve.Msg.mixpy_DATAFRAME_GET_INDEX).appendField(new Ve.FieldDropdown([[Ve.Msg.DATAFRAME_COLUMN,"column"],[Ve.Msg.DATAFRAME_RAW,"raw"]]),"MODE"),this.setOutput(!0),this.setTooltip(Ve.Msg.mixpy_DATAFRAME_GET_TOOLTIP)}},Oh={init:function(){this.setColour(th),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Mh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},kh={init:function(){this.setColour(th),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TOARRAY),this.setOutput(!0,"List"),this.setTooltip(Ve.Msg.MIXLY_PYTHON_TOOLTIP_TOARRAY)}},Rh={init:function(){this.setColour(th),this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("SER").setCheck("Series").appendField(Ve.Msg.MIXLY_MICROPYTHON_SOCKET_MAKE),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_PLOT),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Dh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SHOW),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Fh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.mixpy_PL_AXES),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Lh={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_LEGEND),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ph={init:function(){this.setColour(th),this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_TITLE),this.appendValueInput("TITLE").setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Bh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.blockpy_PYLAB_SET_LABEL).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("LABEL").appendField(Ve.Msg.blockpy_PYLAB_LABEL).setCheck(String),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},$h={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PYLAB_PLOT_BAR_PLOT,"plot"],[Ve.Msg.mixpy_PYLAB_PLOT_BAR_BAR,"bar"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_DISPLAY_DRAW).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{plot:Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP,bar:Ve.Msg.mixpy_PYLAB_PLOT_BAR_EASY_TOOLTIP}[e]})}},Uh={init:function(){this.setColour(th);var e=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],t=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_SCATTER).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("S").appendField(Ve.Msg.MIXLY_MICROBIT_JS_NUMBER),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(t),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(e),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip("")}},Vh={init:function(){this.setColour(th);var e=[[Ve.Msg.blockpy_PYLAB_PLOT_LINE_SOLID,"-"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_DOTTED,"--"],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_CHAIN,"-."],[Ve.Msg.blockpy_PYLAB_PLOT_LINE_POINT_DOTTED,":"],[Ve.Msg.MIXLY_MICROBIT_JS_INOUT_PULL_NONE,""]],t=[[Ve.Msg.COLOUR_RGB_BLUE,"b"],[Ve.Msg.COLOUR_RGB_GREEN,"g"],[Ve.Msg.COLOUR_RGB_RED,"r"],[Ve.Msg.COLOUR_CYAN,"c"],[Ve.Msg.COLOUR_MAGENTA,"m"],[Ve.Msg.COLOUR_YELLOW,"y"],[Ve.Msg.COLOUR_BLACK,"k"],[Ve.Msg.COLOUR_WHITE,"w"]],n=[[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CIRCULAR,"."],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PIXEL,","],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_LARGE_DOT,"o"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_DOWN,"v"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_UP,"^"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_LEFT,"<"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIANGLE_RIGHT,">"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_UP,"1"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_DOWN,"2"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_LEFT,"3"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_TRIMARKER_RIGHT,"4"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_SQUARE,"s"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PENTAGON,"p"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_STAR,"*"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_VERTICAL,"h"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HEXAGON_HORIZONTAL,"H"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_PLUS,"+"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_CROSS,"x"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND,"D"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_DIAMOND_SMALL,"d"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_VERTICAL,"|"],[Ve.Msg.blockpy_PYLAB_PLOT_DOT_HORIZONTAL,"_"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PLOT_XY).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_DOT).appendField(new Ve.FieldDropdown(n),"DOT"),this.appendDummyInput("").appendField(Ve.Msg.blockpy_PYLAB_PLOT_LINE).appendField(new Ve.FieldDropdown(e),"LINE"),this.appendDummyInput("").appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldDropdown(t),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},zh={init:function(){this.setColour(th);var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.AILGN_EDGE,"edge"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_BAR).appendField(Ve.Msg.mixpy_PYLAB_PLOT_X),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_PLOT_Y),this.appendValueInput("WIDTH").setCheck(Number).appendField(Ve.Msg.MIXLY_WIDTH),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_BAR_ALIGN).appendField(new Ve.FieldDropdown(e),"ALIGN"),this.appendDummyInput().appendField(Ve.Msg.HTML_COLOUR).appendField(new Ve.FieldColour("#0000ff"),"COLOR"),this.appendValueInput("TAG").setCheck(String).appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},jh={init:function(){this.setColour(th);var e=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"False"],[Ve.Msg.mixpy_PL_PIE_SHADOW_Y,"True"]],t=[[Ve.Msg.mixpy_PL_PIE_SHADOW_N,"None"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_Z,"%.0f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_O,"%.1f%%"],[Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT_T,"%.2f%%"]];this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_PIE).appendField(Ve.Msg.COLOUR_BLEND_RATIO),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.appendValueInput("EXPLODE").appendField(Ve.Msg.mixpy_PYLAB_PIE_EXPLODE),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_AUTOPCT).appendField(new Ve.FieldDropdown(t),"autopct"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PYLAB_PIE_SHADOW).appendField(new Ve.FieldDropdown(e),"SHADOW"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_PLOT_XY_TOOLTIP)}},Yh={init:function(){this.setColour(th),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_HIST).appendField(Ve.Msg.MIXLY_SD_DATA),this.appendValueInput("B").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MONITOR_SCROLL_INTERVAL),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Gh={init:function(){this.setColour(th);var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.appendDummyInput().appendField(Ve.Msg.MIXLY_SETTING).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("A").appendField(Ve.Msg.mixpy_PYLAB_TICKS).appendField(Ve.Msg.MIXLY_MICROBIT_JS_I2C_VALUE),this.appendValueInput("B").appendField(Ve.Msg.mixpy_PYLAB_TICKS_TAG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PYLAB_TICKS_TOOLTIP)}},Hh={init:function(){this.setColour(th),this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT).appendField(Ve.Msg.mixpy_SUBPLOT_VERTICLE),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_HORIZEN),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_SUBPLOT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_CONTROLS_RANGE_TOOLTIP)}},Wh={init:function(){this.setColour(th),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_PL_SAVEFIG_TOOLTIP)}},Xh={init:function(){this.setColour(th);var e=[[Ve.Msg.TEXT_TRIM_LEFT,"right"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.TEXT_TRIM_RIGHT,"left"]],t=[[Ve.Msg.mixpy_PL_TEXT_TOP,"bottom"],[Ve.Msg.mixpy_PL_TEXT_CENTER,"center"],[Ve.Msg.mixpy_PL_TEXT_BOTTOM,"top"]];this.appendValueInput("VET").setCheck(Number).appendField(Ve.Msg.MIXLY_SETTING).appendField(Ve.Msg.mixpy_PL_TEXT_X),this.appendValueInput("HOR").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_Y),this.appendValueInput("NUM").setCheck(Number).appendField(Ve.Msg.mixpy_PL_TEXT_TAG),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_HOR).appendField(new Ve.FieldDropdown(e),"HALIGN"),this.appendDummyInput("").appendField(Ve.Msg.mixpy_PL_TEXT_VER).appendField(new Ve.FieldDropdown(t),"VALIGN"),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.mixpy_PL_TEXT_TOOLTIP)}},qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取维度"),this.setOutput(!0),this.setTooltip("Returns the shape of the array.")}},Kh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("变形"),this.appendValueInput("DIMENSIONS").appendField("后维度为"),this.setOutput(!0),this.setTooltip("Reshapes the array to the specified dimensions.")}},Zh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("把"),this.appendDummyInput().appendField("转换为").appendField(new Ve.FieldDropdown([["uint8","numpy.uint8"],["int32","numpy.int32"],["float32","numpy.float32"],["float64","numpy.float64"]]),"TYPE"),this.setOutput(!0),this.setTooltip("Converts array to specified type.")}},Qh={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("创建二维图"),this.appendDummyInput().appendField("颜色").appendField(new Ve.FieldDropdown([["gray","gray"],["viridis","viridis"],["plasma","plasma"],["inferno","inferno"],["magma","magma"],["cividis","cividis"],["hot","hot"],["cool","cool"],["spring","spring"],["summer","summer"],["autumn","autumn"],["winter","winter"],["jet","jet"]]),"COLORMAP"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Displays an image with the specified colormap.")}},Jh={init:function(){this.setColour(th),this.appendValueInput("X").appendField("从数据集"),this.appendValueInput("Y").appendField("获取平均图像,标签"),this.appendValueInput("DIGIT").appendField("为"),this.setOutput(!0),this.setTooltip("Computes the mean of X where y equals the specified digit.")}},ep={init:function(){this.setColour(th),this.appendValueInput("IMAGE").appendField("获取模板匹配结果,图片:"),this.appendValueInput("TEMPLATES").appendField("模板:"),this.setOutput(!0),this.setTooltip("Finds the index of the template that minimizes the sum of absolute differences with the image.")}},tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平均值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the mean of the array along the specified axis.")}},np={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取标准差"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","NONE"],["0","0"],["1","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Computes the standard deviation of the array along the specified axis.")}},ip={init:function(){this.setColour(th),this.appendValueInput("DF").appendField("丢弃缺省值"),this.setOutput(!0),this.setTooltip("Drops rows with NaN values from the dataframe.")}},rp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("从数据集"),this.appendValueInput("COLUMNS").appendField("中删除列").setCheck(String),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip("从数据框中删除指定的列。用逗号分隔多个列名。")}},sp={init:function(){this.setColour(th),this.appendValueInput("NUM").appendField("生成单位行向量"),this.setOutput(!0),this.setTooltip("Creates an array of ones with the specified length.")}},op={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("列拼接数组1"),this.appendValueInput("ARRAY2").appendField("数组2"),this.setOutput(!0),this.setTooltip("Concatenates two arrays along the second axis using numpy.c_.")}},ap={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取行列式"),this.setOutput(!0),this.setTooltip("Computes the determinant of an array using numpy.linalg.det.")}},lp={init:function(){this.setColour(th),this.appendValueInput("MATRIX").appendField("获取转置"),this.setOutput(!0),this.setTooltip("Computes the transpose of the given matrix.")}},up={init:function(){this.setColour(th),this.appendValueInput("MATRIX1"),this.appendValueInput("MATRIX2").appendField("@"),this.setOutput(!0),this.setTooltip("Multiplies two matrices.")}},cp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取逆矩阵"),this.setOutput(!0),this.setTooltip("Computes the inverse of the given matrix using numpy.linalg.inv.")}},dp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取中位数"),this.setOutput(!0),this.setTooltip("Computes the median of the given dataframe.")}},hp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("填充缺失值"),this.appendValueInput("VALUE").appendField("填充值"),this.appendDummyInput().appendField("是否修改原数据").appendField(new Ve.FieldDropdown([["True","True"],["False","False"]]),"INPLACE"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip("Fills NaN values in the dataframe with the specified value.")}},pp={init:function(){this.setColour(th),this.appendValueInput("DATAFRAME").appendField("获取DataFrame信息"),this.setOutput(!0),this.setTooltip("Displays information about the DataFrame.")}},fp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最小值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the minimum value along the specified axis.")}},mp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取最大值"),this.appendDummyInput().appendField("沿着axis").appendField(new Ve.FieldDropdown([["None","None"],["行","0"],["列","1"]]),"AXIS"),this.setOutput(!0),this.setTooltip("Returns the maximum value along the specified axis.")}},gp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组大小"),this.setOutput(!0),this.setTooltip("Returns the size of the array.")}},_p={init:function(){this.setColour(th),this.appendValueInput("ARRAY1").appendField("点乘数组1"),this.appendValueInput("ARRAY2").appendField("点乘数组2"),this.setOutput(!0),this.setTooltip("Returns the dot product of two arrays.")}},yp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取平方数组"),this.setOutput(!0),this.setTooltip("Returns the element-wise square of the array.")}},vp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("获取数组元素和"),this.setOutput(!0),this.setTooltip("Returns the sum of the array.")}},bp={init:function(){this.setColour(th),this.appendValueInput("SIZE").appendField("生成随机数组"),this.setOutput(!0),this.setTooltip("Returns a random array of the specified size.")}},Tp={init:function(){this.setColour(th),this.appendValueInput("ARRAY").appendField("Python求和"),this.setOutput(!0),this.setTooltip("Returns the sum of the iterable.")}},xp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("值排序"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("排序方式").appendField(new Ve.FieldDropdown([["升序","True"],["降序","False"]]),"AS_CENDING"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ep={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("获取").appendField(new Ve.FieldDropdown([["前几行","head"],["最后几行","tail"]]),"TYPE"),this.appendValueInput("LINES").setAlign(Ve.inputs.Align.RIGHT).appendField("行数"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},wp={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("筛选数据"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("满足条件"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ip={init:function(){this.setColour(th),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.appendValueInput("KEY").setAlign(Ve.inputs.Align.RIGHT).appendField("通过标签"),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField("分组"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Ap={init:function(){this.setColour(th),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldDropdown([["求最小值","min"],["求最大值","max"],["求和","sum"],["求平均值","mean"],["求中位数","median"],["求标准差","std"]]),"TYPE"),this.appendValueInput("DICT").setAlign(Ve.inputs.Align.RIGHT).setCheck("Dict"),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip("")}},Sp={init:function(){this.setColour(th),this.appendDummyInput().appendField("清除已有图像"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Cp=80,Op={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_NEW)),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_HEAD)).appendField(new Ve.FieldTextInput("head"),"VAR"),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.DS_CREATE_LINKEDLIST_TYPE)).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ATTRIBUTE),this.itemCount_=1,this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["ds_create_linkedlist_item"],this)),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("ds_create_linkedlist_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("ds_create_linkedlist_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var e=[],t=0;this.getInput("ADD"+t);t++)e.push(this.getFieldValue("KEY"+t)),this.removeInput("ADD"+t);for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldTextInput(e.length>t?e[t]:"name"),"KEY"+t).appendField("=")},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Mp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TITLE),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_CONTAINER_TOOLTIP),this.contextMenu=!1}},kp={init:function(){this.setColour(Cp),this.appendDummyInput().appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TOOLTIP),this.contextMenu=!1}},Rp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_USE).appendField(new Ve.FieldTextInput("tag"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_NODE_NEW),this.appendValueInput("NODE"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_CREATE_NODE_TOOLTIP)}},Np={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_GET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendDummyInput("").appendField(Ve.Msg.DICTS_ADD_VALUE),this.setOutput(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_GET_NODE_ATTR_TOOLTIP)}},Dp={init:function(){this.setColour(Cp),this.appendDummyInput("").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_AIP_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.DS_SET_NODE_ATTR_SET),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_SET_NODE_ATTR_TOOLTIP)}},Fp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_SET_NODE_ATTR_NODE),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Lp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE);var e=[[Ve.Msg.DS_ADD_NODE_BEFORE,"before"],[Ve.Msg.DS_ADD_NODE_AFTER,"after"]];this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_CREATE_LINKEDLIST_ITEM_TITLE).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.appendValueInput("NODE3").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.DS_ADD_NODE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_ADD_NODE_TOOLTIP)}},Pp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_DEL_NODE_NAME),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Bp={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_LINKEDLIST),this.appendDummyInput("").appendField(Ve.Msg.DS_DEL_NODE_ATTR).appendField(new Ve.FieldTextInput("name"),"TYPE"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_AS),this.appendDummyInput("").appendField(Ve.Msg.DS_ADD_NODE_ATTR),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},$p={init:function(){this.setColour(Cp),this.appendValueInput("NODE").appendField(Ve.Msg.DS_ADD_NODE_HEAD_NODE),this.appendDummyInput("").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST),this.appendValueInput("NODE2").appendField(Ve.Msg.DS_REVERSE_LINKEDLIST_NEW_HEAD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.DS_DEL_NODE_TOOLTIP)}},Up="#777777",Vp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("from ").appendField(new Ve.FieldTextInput("ESP32"),"path").appendField(" import ").appendField(new Ve.FieldTextInput("*"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField("import ").appendField(new Ve.FieldTextInput("module"),"module"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:function(){var e=document.createElement("mutation");e.setAttribute("items",this.itemCount_);for(var t=0;t<this.arguments_.length;t++){var n=document.createElement("arg");n.setAttribute("name",this.arguments_[t]),e.appendChild(n)}return e},domToMutation:function(e){this.arguments_=[];for(var t=0;e.childNodes[t];t++){let n=e.childNodes[t];"arg"==n.nodeName.toLowerCase()&&this.arguments_.push(n.getAttribute("name"))}this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("factory_create_with_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("factory_create_with_item");r.initSvg(),r.setFieldValue(this.arguments_[i],"NAME"),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){this.arguments_=[];for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)this.arguments_.push(t.getFieldValue("NAME")),n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;for(e=0;e<this.itemCount_;e++)this.appendValueInput("ADD"+e).setAlign(Ve.inputs.Align.RIGHT).appendField(this.arguments_[e])}},Yp={init:function(){this.setColour(Up),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PARAMS),this.appendStatementInput("STACK"),this.contextMenu=!1}},Gp={init:function(){this.setColour(Up),this.appendDummyInput().appendField(Ve.Msg.LISTS_CREATE_WITH_ITEM_TITLE+":").appendField(new Ve.FieldTextInput("x"),"NAME"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.contextMenu=!1}},Hp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("my_function"),"NAME"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:jp.mutationToDom,domToMutation:jp.domToMutation,decompose:jp.decompose,compose:jp.compose,saveConnections:jp.saveConnections,updateShape_:jp.updateShape_},Wp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("test"),"NAME").appendField("=").appendField(new Ve.FieldTextInput("Test"),"TYPE").appendField("()"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("test"),"NAME").appendField(".").appendField(new Ve.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:jp.mutationToDom,domToMutation:jp.domToMutation,decompose:jp.decompose,compose:jp.compose,saveConnections:jp.saveConnections,updateShape_:jp.updateShape_},qp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("test"),"NAME").appendField(".").appendField(new Ve.FieldTextInput("callMethod"),"METHOD"),this.itemCount_=1,this.arguments_=["x"],this.updateShape_(),this.setOutput(!0),this.setMutator(new Ve.icons.MutatorIcon(["factory_create_with_item"],this))},mutationToDom:jp.mutationToDom,domToMutation:jp.domToMutation,decompose:jp.decompose,compose:jp.compose,saveConnections:jp.saveConnections,updateShape_:jp.updateShape_},Kp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput('display.scroll("Hello World!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldTextInput("test"),"VALUE"),this.setOutput(!0)}},Qp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldMultilineInput('display.scroll("Hello World!")\ndisplay.scroll("Hello Mixly!")'),"VALUE"),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jp={init:function(){this.setColour(Up),this.appendDummyInput("").appendField(new Ve.FieldMultilineInput("Hello\nMixly"),"VALUE"),this.setOutput(!0)}},ef=40,tf={init:function(){this.setColour(ef),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_HARDWARE),this.appendValueInput("SUB").setCheck("var"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_HARDWARE_START),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null)}},nf={init:function(){this.setColour(ef),this.appendDummyInput("").appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_HIGH,"HIGH"],[Ve.Msg.MIXLY_LOW,"LOW"]]),"BOOL"),this.setOutput(!0,Boolean),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_INOUT_HIGHLOW)}},rf={init:function(){this.setColour(ef),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(Ve.Msg.MIXLY_Digital_PINMODEOUT).appendField(Ve.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("STAT").appendField(Ve.Msg.MIXLY_STAT).setCheck([Number,Boolean]),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.LANG_INOUT_DIGITAL_WRITE_TOOLTIP)}},sf={init:function(){this.setColour(ef),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(Ve.Msg.MIXLY_Digital_PINMODEIN).appendField(Ve.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_INOUT_DIGITAL_READ)}},of={init:function(){this.setColour(ef),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(Ve.Msg.MIXLY_Analog_PINMODEOUT).appendField(Ve.Msg.MIXLY_PIN).setCheck(Number),this.appendValueInput("NUM",Number).appendField(Ve.Msg.MIXLY_VALUE2).setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_WRITE)}},af={init:function(){this.setColour(ef),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_HARDWARE).setCheck("var"),this.appendValueInput("PIN",Number).appendField(Ve.Msg.MIXLY_Analog_PINMODEIN).appendField(Ve.Msg.MIXLY_PIN).setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_MACHINE_VALUE),this.setInputsInline(!0),this.setOutput(!0,[Boolean,Number]),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_INOUT_ANALOG_READ)}},lf={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_inout_raw_input).setCheck(String),this.setOutput(!0),this.setTooltip(Ve.Msg.INOUT_input_TOOLTIP)}},uf={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SERIAL_PRINTLN),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.BLOCKPY_PRINT_TOOLTIP)}},cf={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SERIAL_PRINT),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.TEXT_PRINT_TOOLTIP)}},df={init:function(){this.setColour(20),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_SERIAL_PRINT),this.appendValueInput("END").appendField(Ve.Msg.MIXLY_ENDSWITH),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_PYTHON_INOUT_PRINT_END_TOOLTIP)}},hf={init:function(){var e=[[Ve.Msg.LANG_MATH_STRING,"str"],[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("VAR").appendField(Ve.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{str:Ve.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Ve.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Ve.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[e]})}},pf={init:function(){var e=[[Ve.Msg.LANG_MATH_STRING,"str"],[Ve.Msg.LANG_MATH_INT,"int"],[Ve.Msg.LANG_MATH_FLOAT,"float"]];this.setColour(20),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_GET).appendField(new Ve.FieldDropdown(e),"DIR"),this.appendValueInput("VAR").appendField(Ve.Msg.PROCEDURES_MUTATORCONTAINER_TITLE).setCheck(String),this.setInputsInline(!0),this.setOutput(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{str:Ve.Msg.MIXLY_MIXPY_INOUT_STR_INPUT_TOOLTIP,int:Ve.Msg.MIXLY_MIXPY_INOUT_INT_INPUT_TOOLTIP,float:Ve.Msg.MIXLY_MIXPY_INOUT_FLOAT_INPUT_TOOLTIP}[e]})}},ff={init:function(){this.setColour(20),this.itemCount_=2,this.updateShape_(),this.setPreviousStatement(!1),this.setNextStatement(!1),this.setInputsInline(!0),this.setMutator(new Ve.icons.MutatorIcon(["inout_print_item"],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("inout_print_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("inout_print_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){if(this.getInput("EMPTY"))this.removeInput("EMPTY");else for(var e=0;this.getInput("ADD"+e);)this.removeInput("ADD"+e),e++;if(0==this.itemCount_)this.appendDummyInput("EMPTY").appendField(Ve.Msg.MIXLY_MIXPY_INOUT_PRINT_EMPTY);else for(e=0;e<this.itemCount_;e++){var t=this.appendValueInput("ADD"+e);0==e&&t.appendField(Ve.Msg.MIXLY_SERIAL_PRINTLN)}}},mf={init:function(){this.setColour(20),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SERIAL_PRINTLN),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_CONTAINER_TOOLTIP),this.contextMenu=!1}},gf={init:function(){this.setColour(20),this.appendDummyInput().appendField(Ve.Msg.LISTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_INOUT_PRINT_MANY_ITEM_TOOLTIP),this.contextMenu=!1}},_f="#526FC3",yf={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"+Ve.Msg.TUPLE_JOIN),this.appendValueInput("CLIENT").setCheck(String).appendField(Ve.Msg.MIXLY_ESP32_ONENET_CLIENT),this.appendValueInput("SERVER").setCheck(String).appendField(Ve.Msg.MIXLY_ESP32_ONENET_SERVER),this.appendValueInput("USERNAME").setCheck(String).appendField(Ve.Msg.MIXLY_ESP32_ONENET_USERNAME),this.appendValueInput("PASSWORD").setCheck(String).appendField(Ve.Msg.MIXLY_ESP32_ONENET_PASSWORD),this.appendValueInput("TOPIC").setCheck(String).appendField(Ve.Msg.MIXLY_ESP32_ONENET_TOPIC),this.appendValueInput("SUB").appendField(Ve.Msg.MIXLY_ESP32_ONENET_SUB),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_ONENET_CONNECT_TOOLTIP)}},vf={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_ONENET_DISCONNECT_TOOLTIP)}},bf={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_ONENET_CHECK_TOOLTIP)}},Tf={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET"),this.appendValueInput("DICT").appendField(Ve.Msg.MIXLY_ESP32_PUBLISH_ONENET),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_IOT_ONENET_PRINT_DATA).appendField(new Ve.FieldCheckbox("TRUE"),"is_print"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_DICT_TOOLTIP)}},xf={init:function(){this.setColour("#78AAE0"),this.appendValueInput("VAR").setCheck("var").appendField("OneNET").setAlign(Ve.inputs.Align.RIGHT),this.appendDummyInput().appendField(new Ve.FieldLabel(Ve.Msg.MIXLY_ESP32_PUBLISH_ONENET),"TIP").setAlign(Ve.inputs.Align.RIGHT),this.itemCount_=2,this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setMutator(new Ve.Mutator(["iot_publish_item"])),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_ONENET_PUBLISH_TOOLTIP)},mutationToDom:function(){var e=document.createElement("mutation");return e.setAttribute("items",this.itemCount_),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute("items"),10),this.updateShape_()},decompose:function(e){var t=e.newBlock("iot_publish_container");t.initSvg();for(var n=t.getInput("STACK").connection,i=0;i<this.itemCount_;i++){var r=e.newBlock("iot_create_with_item");r.initSvg(),n.connect(r.previousConnection),n=r.nextConnection}return t},compose:function(e){for(var t=e.getInputTargetBlock("STACK"),n=[],i=0;t;)n[i]=t.valueConnection_,t=t.nextConnection&&t.nextConnection.targetBlock(),i++;this.itemCount_=i,this.updateShape_();for(i=0;i<this.itemCount_;i++)n[i]&&this.getInput("ADD"+i).connection.connect(n[i])},saveConnections:function(e){for(var t=e.getInputTargetBlock("STACK"),n=0;t;){var i=this.getInput("ADD"+n);t.valueConnection_=i&&i.connection.targetConnection,n++,t=t.nextConnection&&t.nextConnection.targetBlock()}},updateShape_:function(){this.getInput("EMPTY")&&this.removeInput("EMPTY");for(var e=[],t=0;this.getInput("ADD"+t);t++)e.push(this.getFieldValue("KEY"+t)),this.removeInput("ADD"+t);if(0==this.itemCount_)this.setFieldValue(Ve.Msg.MIXLY_ESP32_PUBLISH_ONENET_EMPTY,"TIP");else{this.setFieldValue(Ve.Msg.MIXLY_ESP32_PUBLISH_ONENET,"TIP");for(t=0;t<this.itemCount_;t++)this.appendValueInput("ADD"+t).setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldTextInput(e.length>t?e[t]:'"key'+(t+1)+'"'),"KEY"+t).appendField(":")}},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Ef={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_TYPE_DICT),this.appendStatementInput("STACK"),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP),this.contextMenu=!1}},wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},If={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.DICTS_CREATE_WITH_ITEM_TITLE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP),this.contextMenu=!1}},Af={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("USERNAME").setCheck(String).appendField(Ve.Msg.MIXLY_WIFI_USERNAME).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PASSWORD").setCheck(String).appendField(Ve.Msg.MIXLY_IOT_PASSWORD).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("PROJECT").setCheck(String).appendField(Ve.Msg.MIXLY_EMQX_PROJECT).setAlign(Ve.inputs.Align.RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Sf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Ve.Msg.HTML_BODY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Cf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_NEW).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("MSG").appendField(Ve.Msg.HTML_BODY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_Service_quality_display).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_AT_MOST_ONCE,"0"],[Ve.Msg.MIXLY_AT_LEAST_ONCE,"1"]]),"quality"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PUBLISH_TOOLTIP)}},Of={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MIXLY_EMQX_SUBSCRIBE+Ve.Msg.MIXLY_MICROBIT_MSG).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.appendValueInput("METHOD").appendField(Ve.Msg.MIXLY_EMQX_SET_METHOD),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},Mf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendValueInput("TOPIC").appendField(Ve.Msg.MSG.stop+Ve.Msg.MIXLY_EMQX_SUBSCRIBE).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_TOPIC),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_SUBSCRIBE_TOOLTIP)}},kf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_DISCONNECT_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Rf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_CONNECT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Nf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_ESP32_CHECK_ONENET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Df={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.MQTT_Topic),this.setInputsInline(!0),this.setOutput(!0)}},Ff={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT).appendField(Ve.Msg.MIXLY_EMQX_PUBLISH_MSG),this.setInputsInline(!0),this.setOutput(!0)}},Lf={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_ESP32_IOT_MAP_FORMATING),this.setOutput(!0)}},Pf={init:function(){this.setColour(_f),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROPYTHON_FORMAT+"(Json)"),this.setOutput(!0)}},Bf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_EMQX_PING),this.setInputsInline(!0),this.setOutput(!0),this.setTooltip(Ve.Msg.MIXLY_ESP32_IOT_EMQX_PING_TOOLTIP)}},$f={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MIXLY_GET_NTP),this.appendValueInput("addr").appendField(Ve.blynk_SERVER_ADD),this.setInputsInline(!0),this.setOutput(!0)}},Uf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+Ve.Msg.MIXLY_MIXIO_SHARE_KEY).setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vf={init:function(){this.setColour(_f),this.appendDummyInput().appendField(Ve.Msg.MIXLY_CREATE_MQTT_CLIENT_AND_CONNECT),this.appendValueInput("SERVER").appendField(Ve.Msg.MIXLY_EMQX_SERVER).setAlign(Ve.inputs.Align.RIGHT),this.appendValueInput("KEY").appendField(Ve.Msg.CONTROLS_FOR_INPUT_WITH+"Mixly Key").setAlign(Ve.inputs.Align.RIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(this.newQuote_(!0)).appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID").appendField(this.newQuote_(!1)),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")},newQuote_:function(e){if(e==this.RTL)var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==";else t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC";return new Ve.FieldImage(t,12,12,'"')}},jf={init:function(){this.VISITOR_ID=ze.Config.BOARD.visitorId.str32.substring(0,8).toUpperCase(),this.setColour(_f),this.appendDummyInput("").appendField(new Ve.FieldTextInput(this.visitorId),"VISITOR_ID"),this.setOutput(!0,null)},onchange:function(){const e=this.getFieldValue("VISITOR_ID");this.VISITOR_ID!==e&&this.setFieldValue(this.VISITOR_ID,"VISITOR_ID")}},Yf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MixIO").appendField(Ve.Msg.MSG.catEthernet_clinet),this.setOutput(!0),this.setInputsInline(!0)}},Gf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.DISPLAY_IMAGE_LET2),this.appendDummyInput().appendField(Ve.Msg.MIXLY_REQUESTS_GET).appendField(Ve.Msg.MIXLY_GET_CURRENT_TIME).appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Hf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("HTTP"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"text"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},Wf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client),this.appendValueInput("addr").appendField(Ve.Msg.MIXLY_CONNECTTO),this.appendDummyInput().appendField(Ve.Msg.MIXLY_INIT_SUBSCRIBE).appendField(Ve.MQTT_Topic).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_GET_CURRENT_TIME,""]]),"key").appendField(Ve.Msg.MIXLY_OPEN_DEBUG).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"]]),"key2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xf={init:function(){this.setColour(_f),this.appendDummyInput().appendField("MQTT"+Ve.Msg.MIXLY_Client).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_REQUESTS_LEN,"client_len"],[Ve.Msg.MIXLY_REQUESTS_GET_LEN,"server_len"],[Ve.Msg.MIXLY_REQUESTS_MESSAGE,"time_msg()"]]),"key"),this.setOutput(!0),this.setInputsInline(!0)}},qf=yf,Kf=vf,Zf=bf,Qf=xf,Jf=230,em={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_write),"PIN"),this.setOutput(!0)}},tm={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.digital_read),"PIN"),this.setOutput(!0)}},nm={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_write),"PIN"),this.setOutput(!0)}},im={init:function(){this.setColour(Jf),this.appendDummyInput("").appendField(new Ve.FieldDropdown(ze.Profile.default.analog_read),"PIN"),this.setOutput(!0)}},rm={init:function(){this.setColour(40),this.appendDummyInput("").appendField(new Ve.FieldLabel(Ve.Msg.MIXPY_SERIAL_OPEN)).appendField(new Ve.FieldTextInput("ser"),"SER"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SERIAL_BEGIN).appendField(new Ve.FieldDropdown([["115200","115200"],["256000","256000"],["128000","128000"],["57600","57600"],["56000","56000"],["43000","43000"],["38400","38400"],["28800","28800"],["19200","19200"],["9600","9600"],["4800","4800"],["2400","2400"],["1200","1200"],["600","600"],["300","300"],["110","110"]]),"BPS"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_OPEN_TIMEOUT),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_OPEN_TOOLTIP)}},sm={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXPY_SERIAL_WRITE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_WRITE_TOOLTIP)}},om={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendValueInput("VAR").setCheck(Number).appendField(Ve.Msg.MIXPY_SERIAL_READ),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.MIXPY_SERIAL_READ_TOOLTIP)}},am={init:function(){this.setColour(40),this.appendValueInput("SER"),this.appendDummyInput().appendField(Ve.Msg.MIXPY_SERIAL_CLOSE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setTooltip(Ve.Msg.MIXPY_SERIAL_CLOSE_TOOLTIP)}},lm=80,um={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLASSIFICATION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_redundant").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REDUNDANT_FEATURES),this.appendValueInput("n_repeated").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_REPEATED_FEATURES),this.appendValueInput("n_classes").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLASSES),this.appendValueInput("n_clusters_per_class").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_PER_CLASSES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},cm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_REGRESSION_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("n_informative").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_EFFECTIVE_FEATURES),this.appendValueInput("n_targets").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_LABELS),this.appendValueInput("bias").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.DEVIATION),this.appendValueInput("noise").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NOISE),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},dm={init:function(){this.appendDummyInput().appendField(Ve.Msg.SKLEARN_CLUSTERING_GENERATION),this.appendValueInput("n_samples").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_SAMPLES),this.appendValueInput("n_features").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_FEATURES),this.appendValueInput("centers").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS),this.appendValueInput("cluster_std").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.STANDARD_DEVIATION_OF_CLUSTER),this.appendValueInput("center_box").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.CLUSTER_BOUNDING_BOX),this.appendValueInput("shuffle").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SHUFFLE_SAMPLES),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},hm={init:function(){var e=[[Ve.Msg.SKLEARN_LOAD_IRIS,"load_iris"],[Ve.Msg.SKLEARN_LOAD_BOSTON,"load_boston"],[Ve.Msg.SKLEARN_LOAD_DIABETES,"load_diabetes"],[Ve.Msg.SKLEARN_LOAD_BREAST_CANCER,"load_breast_cancer"],[Ve.Msg.SKLEARN_LOAD_LINNERUD,"load_linnerud"],[Ve.Msg.SKLEARN_LOAD_DIGITS,"load_digits"]];this.appendDummyInput().appendField("sklearn "+Ve.Msg.LOAD).appendField(new Ve.FieldDropdown(e),"type").appendField(new Ve.FieldTextInput("iris"),"name"),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")},getVars:function(){return[this.getFieldValue("name")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("name"))&&this.setTitleValue(t,"name")}},pm={init:function(){this.appendValueInput("name").setCheck(null).appendField("sklearn "+Ve.Msg.DATA_SET),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.EIGENVALUES,"data"],[Ve.Msg.LABEL_VALUE,"target"],[Ve.Msg.FEATURE,"feature_names"],[Ve.Msg.mixpy_PYLAB_TICKS_TAG,"target_names"]]),"type"),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},fm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.DATA_SEGMENTATION),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("test_size").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.TEST_SET_PROPORTION),this.appendValueInput("rondom_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},gm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},_m={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RIDGE_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("alpha").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGULA_INTENSITY),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("normalize").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_REGRESSION_NORMIALIZATION),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},ym={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_DECISIONTREE_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"DecisionTreeClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"DecisionTreeRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},vm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_RANDOMFOREST_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"RandomForestClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"RandomForestRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_estimators").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_TREES),this.appendValueInput("max_depth").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAXIMUM_TREE_DEPTH),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},bm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KNN_INIT).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLASSIFICATION_ALGORITHM,"KNeighborsClassifier"],[Ve.Msg.SKLEARN_REGRESSION_ALGORITHM,"KNeighborsRegressor"]]),"type"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("K").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("K"),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Tm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GAUSSINNB_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},xm={init:function(){this.appendDummyInput().appendField("sklearn 初始化 PCA 算法"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_components").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_PCA_N_COMPONENTS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Em={init:function(){this.appendDummyInput().appendField("sklearn PCA 降维"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},wm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_KMEANS_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("n_clusters").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.NUMBER_OF_CLUSTERS_JUST),this.appendValueInput("max_iter").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_MAX_ITER),this.appendValueInput("random_state").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.RANDOM_SEED),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Im={init:function(){this.appendDummyInput().appendField("sklearn K-均值聚类"),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Am={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Sm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.TRAINING_MODEL),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Cm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.MODEL_PRODICTION),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Om={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.appendValueInput("train_target").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.LABEL_VALUE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Mm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.CALCULATE_THE_SCORE),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("train_data").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.EIGENVALUES),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},km={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_GENERALIZED_LINEAR_REGRESSION),this.appendValueInput("model_name").setAlign(Ve.inputs.Align.RIGHT).setCheck(null).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_COEF,"coef_"],[Ve.Msg.SKLEARN_INTERCEPT,"intercept_"]]),"type"),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Rm={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_CLUSTERING),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendDummyInput().appendField(Ve.Msg.MIXLY_GET).appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_CLUSTER_CENTER,"cluster_centers_"],[Ve.Msg.SKLEARN_LABELS_AFTER_CLUSTERING,"labels_"],[Ve.Msg.SKLEARN_CLUSTERING_SUM_OF_SQUARED_DISTANCES,"inertia_"]]),"type"),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Nm={init:function(){this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField("sklearn").appendField(new Ve.FieldDropdown([[Ve.Msg.SKLEARN_SAVE_MODEL,"dump"],[Ve.Msg.SKLEARN_LOAD_MODEL,"load"]]),"type").appendField(" "+Ve.Msg.MODEL_NAME),this.appendValueInput("address").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_MICROBIT_PY_STORAGE_THE_PATH),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(lm),this.setTooltip(""),this.setHelpUrl("")}},Dm=120,Fm={init:function(){this.setColour(Dm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY+"("+Ve.Msg.MIXLY_MILLIS+")").setCheck(Number),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Lm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField(Ve.Msg.blockpy_time_time),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_MILLIS)}},Pm={init:function(){this.setColour(Dm),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME),this.appendDummyInput().appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_ALL,"all"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_YEAR,"0"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MONTH,"1"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DATE,"2"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_HOUR,"3"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_MINUTE,"4"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_SECOND,"5"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INWEEK,"6"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_INYEAR,"7"],[Ve.Msg.MIXLY_SYSTEM_TIME_LOCALTIME_DST,"8"]]),"op"),this.setOutput(!0),this.setInputsInline(!0)}},Bm={init:function(){this.setColour(Dm),this.appendValueInput("STATUS_CODE",Number).appendField(Ve.Msg.MIXLY_MICROBIT_Panic_with_status_code).setCheck(Number),this.setPreviousStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},$m={init:function(){this.setColour(Dm),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MICROBIT_Reset_micro),this.setPreviousStatement(!0)}},Um={init:function(){this.setColour(Dm),this.appendValueInput("TIME").setCheck(Number).setAlign(Ve.inputs.Align.RIGHT).appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_EVERY),this.appendDummyInput().appendField("ms"),this.appendStatementInput("DO").appendField(Ve.Msg.MIXLY_MSTIMER2_DO),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Vm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_MSTIMER2_START),this.setPreviousStatement(!0),this.setNextStatement(!0)}},zm={init:function(){this.setColour(Dm),this.appendDummyInput().appendField("MsTimer2").appendField(Ve.Msg.MIXLY_STOP),this.setPreviousStatement(!0),this.setNextStatement(!0)}},jm={init:function(){this.setColour(Dm),this.appendValueInput("DELAY_TIME",Number).appendField(Ve.Msg.MIXLY_DELAY).setCheck(Number),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SECOND),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_CONTROL_DELAY)}},Ym=180,Gm={init:function(){this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_create).appendField(new Ve.FieldTextInput("tina"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.blockpy_turtle_create_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Hm={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_TURTLE_DONE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Wm={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.MIXLY_PYTHON_TURTLE_EXITONCLICK),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Xm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_forward,"forward"],[Ve.Msg.blockpy_backward,"backward"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_MOVE_BY_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{forward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_FORWARD,backward:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BACKWARD}[e]})}},qm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_left,"left"],[Ve.Msg.blockpy_right,"right"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_rotate).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MICROBIT_JS_BY_ANGLE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{left:Ve.Msg.MIXLY_TOOLTIP_TURTEL_LEFT,right:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RIGHT}[e]})}},Km={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_setheading),this.appendDummyInput().appendField(Ve.Msg.blockpy_setheading_degree),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Zm={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_SCREEN_DELAY),this.appendDummyInput().appendField(Ve.Msg.MIXLY_MILLIS),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SCREEN_DELAY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Qm={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto),this.appendValueInput("val").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_goto_y),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_goto_position),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Jm={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.PYLAB_LABEL_X,"x"],[Ve.Msg.PYLAB_LABEL_Y,"y"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_MIXPY_TURTLE_SETXY_TOOLTIP)}},eg={init:function(){this.setColour(Ym);var e=[[Ve.Msg.TURTLE_POS,"pos"],[Ve.Msg.TURTLE_SHAPE,"shape"],[Ve.Msg.TURTLE_HEADING,"heading"],[Ve.Msg.MIXLY_MIXPY_TURTLE_WIDTH,"width"],[Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE,"shapesize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_POS_SHAPE).appendField(new Ve.FieldDropdown(e),"DIR");var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pos:Ve.Msg.MIXLY_TOOLTIP_TURTEL_POS,shape:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHAPE,heading:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HEADING,width:Ve.Msg.MIXLY_TOOLTIP_TURTEL_WIDTH,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_GET_SPEED,shapesize:Ve.Msg.MIXLY_TURTEL_GET_SHAPESIZE_TOOLTIP}[e]}),this.setOutput(!0),this.setInputsInline(!0)}},tg={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput().appendField(Ve.Msg.TURTLE_STAMP),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ng={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.MIXLY_LCD_STAT_CLEAR,"clear"],[Ve.Msg.blockpy_turtle_reset,"reset"],[Ve.Msg.blockpy_turtle_home,"home"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{clear:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CLEAR,reset:Ve.Msg.MIXLY_TOOLTIP_TURTEL_RESET,home:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HOME}[e]})}},ig={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_penup,"penup"],[Ve.Msg.blockpy_turtle_pendown,"pendown"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{penup:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENUP,pendown:Ve.Msg.MIXLY_TOOLTIP_TURTEL_PENDOWN}[e]})}},rg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_beginfill,"begin"],[Ve.Msg.blockpy_turtle_endfill,"end"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{begin:Ve.Msg.MIXLY_TOOLTIP_TURTEL_BEGINFILL,end:Ve.Msg.MIXLY_TOOLTIP_TURTEL_ENDFILL}[e]})}},sg={init:function(){this.appendDummyInput("").appendField(new Ve.FieldTextInput("tina"),"TUR");var e=[[Ve.Msg.blockpy_turtle_size,"pensize"],[Ve.Msg.MIXLY_SPEED,"speed"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_set).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_set_num),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{pensize:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE,speed:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED}[e]})}},og={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_size),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SIZE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},ag={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_set_speed),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_SPEED),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},lg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_circle,"circle"],[Ve.Msg.blockpy_turtle_dot,"dot"]];this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.blockpy_turtle_draw).appendField(new Ve.FieldDropdown(e),"DIR").appendField(Ve.Msg.blockpy_turtle_radius),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{circle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE,dot:Ve.Msg.MIXLY_TOOLTIP_TURTEL_DOT}[e]})}},ug={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_DRAW_CIRCLE).appendField(Ve.Msg.blockpy_turtle_radius),this.appendValueInput("data").setCheck(Number).appendField(Ve.Msg.blockpy_turtle_angle),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_TURTEL_CIRCLE)}},cg={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_hide,"hideturtle"],[Ve.Msg.blockpy_turtle_show,"showturtle"]];this.setColour(Ym),this.appendDummyInput("").appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0);var t=this;this.setTooltip(function(){var e=t.getFieldValue("DIR");return{hideturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_HIDE,showturtle:Ve.Msg.MIXLY_TOOLTIP_TURTEL_SHOW}[e]})}},dg={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_bgcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},hg={init:function(){this.setColour(Ym),this.appendValueInput("TITLE").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_TURTLE_TITLE_SET),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},pg={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTLE_SETUP_SET),this.appendValueInput("WIDTH").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_WIDTH),this.appendValueInput("HEIGHT").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_HEIGHT),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},fg={init:function(){this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTLE_TRACER),this.appendValueInput("STEP").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_TURTLE_TRACER_STEP),this.appendValueInput("DELAY").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MIXLY_TURTLE_TRACER_DELAY_MS),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},mg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},gg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},_g={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.TURTLE_CLONE),this.setTooltip(Ve.Msg.TURTLE_CLONE_TOOLTIP),this.setOutput(!0)}},yg={init:function(){this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},vg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},bg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Tg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_pencolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME"),this.appendDummyInput().appendField(Ve.Msg.blockpy_turtle_fillcolor).appendField(new Ve.FieldColour("#ff0000"),"FIELDNAME2"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},xg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR1").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor),this.appendValueInput("VAR2").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Eg={init:function(){this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_bgcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},wg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_pencolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ig={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_fillcolor_hex),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ag={init:function(){this.appendValueInput("TUR").setCheck("Turtle");var e=[[Ve.Msg.blockpy_turtle_shape_arrow,"arrow"],[Ve.Msg.blockpy_turtle_shape_turtle,"turtle"],[Ve.Msg.blockpy_turtle_shape_circle,"circle"],[Ve.Msg.blockpy_turtle_shape_square,"square"],[Ve.Msg.blockpy_turtle_shape_triangle,"triangle"],[Ve.Msg.blockpy_turtle_shape_classic,"classic"]];this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.blockpy_turtle_shape).appendField(new Ve.FieldDropdown(e),"DIR"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_SHAPE_TOOLTIP)}},Sg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE),this.appendValueInput("WID").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_WID),this.appendValueInput("LEN").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_LEN),this.appendValueInput("OUTLINE").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTEL_SHAPESIZE_OUTLINE),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TOOLTIP_SHAPESIZE)}},Cg={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_NUMINPUT),this.setColour(Ym),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.appendValueInput("DEFAULT").setCheck(Number).appendField(Ve.Msg.DICTS_DEFAULT_VALUE),this.appendValueInput("MIN").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MIN),this.appendValueInput("MAX").setCheck(Number).appendField(Ve.Msg.MATH_ONLIST_OPERATOR_MAX),this.setInputsInline(!0),this.setOutput(!0,Number),this.setTooltip(Ve.Msg.TURTLE_NUMINPUT_TOOLTIP)}},Og={init:function(){this.appendDummyInput("").appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT),this.setColour(Ym),this.appendValueInput("TITLE").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_TITLE),this.appendValueInput("PROMPT").setCheck(String).appendField(Ve.Msg.MIXLY_MIXPY_TURTLE_TEXTINPUT_PROMPT),this.setInputsInline(!0),this.setOutput(!0,String),this.setTooltip(Ve.Msg.TURTLE_TEXTINPUT_TOOLTIP)}},Mg={init:function(){this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},kg={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD_ITALIC,'bold","italic']];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Rg={init:function(){var e=[[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_FALSE,"False"],[Ve.Msg.MIXLY_TURTLE_WRITE_MOVE_TRUE,"True"]],t=[[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_LEFT,"left"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_CENTER,"center"],[Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN_RIGHT,"right"]],n=[[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_NORMAL,"normal"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_BOLD,"bold"],[Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE_ITALIC,"italic"]];this.appendValueInput("TUR").setCheck("Turtle"),this.setColour(Ym),this.appendValueInput("VAR").setCheck(String).appendField(Ve.Msg.blockpy_turtle_write),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_MOVE).appendField(new Ve.FieldDropdown(e),"MOVE"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_ALIGN).appendField(new Ve.FieldDropdown(t),"ALIGN"),this.appendValueInput("FONTNAME").setCheck(String).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NAME),this.appendValueInput("FONTNUM").setCheck(Number).appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_NUM),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTLE_WRITE_FONT_TYPE).appendField(new Ve.FieldDropdown(n),"FONTTYPE"),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.TURTLE_WRITE_TOOLTIP)}},Ng={init:function(){this.setColour(Ym),this.appendDummyInput("").setAlign(Ve.inputs.Align.RIGHT).appendField(new Ve.FieldColour("ff0000"),"COLOR"),this.setInputsInline(!0),this.setOutput(!0,String)}},Dg={init:function(){this.setColour(Ym),this.appendValueInput("TUR").setCheck("Turtle"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_GETSCREEN).appendField(new Ve.FieldTextInput("screen"),"VAR"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_GETSCREEN_TOOLTIP)},getVars:function(){return[this.getFieldValue("VAR")]},renameVar:function(e,t){Ve.Names.equals(e,this.getFieldValue("VAR"))&&this.setTitleValue(t,"VAR")}},Fg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTLE_UPDATE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},Lg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONKEY_TOOLTIP)}},Pg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONCLICK_TOOLTIP)}},Bg={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("VAR").appendField(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER),this.appendDummyInput("").appendField(Ve.Msg.MIXLY_mSecond),this.appendValueInput("callback").appendField(Ve.Msg.MIXLY_PYTHON_CONTROLS_THREAD_USE),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setInputsInline(!0),this.setTooltip(Ve.Msg.MIXLY_TURTEL_EVENT_ONTIMER_TOOLTIP)}},$g={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_TURTEL_SCREEN_LISTEN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0)}},Ug={init:function(){this.setColour(Ym),this.appendValueInput("TUR"),this.appendValueInput("FILE").setCheck(String).appendField(Ve.Msg.mixpy_PL_SAVEFIG),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setOutput(!1),this.setTooltip(Ve.Msg.mixpy_TURTLE_SAVEFIG_TOOLTIP)}},Vg=function(e,t){var n=this.getFieldValue("TYPE");return t.definitions_.import_FileDialog="import FileDialog",["FileDialog."+n+"()",t.ORDER_ATOMIC]},zg=function(e,t){var n=this.getFieldValue("CTYPE");return t.definitions_.import_aip="import aip",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+" = aip."+n+"("+t.valueToCode(this,"API_KEY",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"SECRET_KEY",t.ORDER_ATOMIC)+")\n"},jg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".synthesis("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Yg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".asr("+(t.valueToCode(this,"FILE",t.ORDER_ATOMIC)||'""')+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Gg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Hg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".match("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Wg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"ADDR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Xg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},qg=function(e,t){t.definitions_.import_aip="import aip";var n=t.valueToCode(this,"SUB",t.ORDER_ATOMIC),i=t.valueToCode(this,"STR1",t.ORDER_ATOMIC),r=t.valueToCode(this,"STR2",t.ORDER_ATOMIC);return[n+"."+t.valueToCode(this,"FUNC",t.ORDER_ATOMIC)+"("+i+","+r+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Kg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".topic("+t.valueToCode(this,"STR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Zg=function(e,t){return t.definitions_.import_aip="import aip",[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".newsSummary("+t.valueToCode(this,"STR",t.ORDER_ATOMIC)+","+t.valueToCode(this,"LEN",t.ORDER_ATOMIC)+", options="+(t.valueToCode(this,"ATTR",t.ORDER_ATOMIC)||"{}")+")",t.ORDER_ATOMIC]},Qg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},Jg=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},e_=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},t_=function(e,t){return[this.getFieldValue("TYPE"),t.ORDER_ATOMIC]},n_=function(e,t){return t.definitions_.import_audio="import audio","audio.audio_record("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"TIME",t.ORDER_ATOMIC)||"0")+")\n"},i_=function(e,t){return t.definitions_.import_audio="import cam","cam.photo_capture("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+","+(t.valueToCode(this,"BUT",t.ORDER_ATOMIC)||'""')+")\n"},r_=function(e,t){var n=t.valueToCode(this,"AI",t.ORDER_ASSIGNMENT)||"0",i=this.getFieldValue("CTYPE");if("Image"==i)var r=n+'["result"][0]["keyword"]';if("Speech"==i)r=n+'["result"][0]';if("Face"==i||"OcrSimilarity"==i)r=n+'["score"]';if("Ocr"==i)r=n+'["words_result"]';return[r,t.ORDER_ATOMIC]},s_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,1,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,1,1,0,0], [0,0,1,0,0,1,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},o_=function(){return"path = [1]\nmask.show()\ncar = sprite.Sprite('xnie', position[1][0], position[1][1])\nhouse[1].show()\ncar.nowPos = 1\ndef drive(n):\n if g[car.nowPos][n]==1:\n car.slideTo(position[n][0], position[n][1], 1)\n car.nowPos = n\n else:\n print('移动失败!程序有误!')\n exit()\n"},a_=function(e,t){t.definitions_.import_random="import random";return"f = path[(len(path) - 1)]\nflag = 0\nfor _my_variable in [6,5,4,3,2,1,0]:\n if vis[_my_variable+1] == 0 and g[f][_my_variable+1] == 1:\n if mark[f][_my_variable+1] == 0:\n flag = 1\n break\n"},l_=function(e,t){return["flag == 1",t.ORDER_ATOMIC]},u_=function(){return"mark[f][_my_variable+1] = 1\nvis[_my_variable+1] = 1\n"},c_=function(){return"path.append(_my_variable+1)\ndrive(path[len(path) - 1])\nhouse[_my_variable+1].show()\n"},d_=function(e,t){t.definitions_.import_time="import time";return"del path[len(path) - 1]\nhouse[0].show()\ntime.sleep(0.5)\nhouse[0].hide()\n"},h_=function(){var e="for i in range(7):\n mark[f][i+1] = 0\n vis[f] = 0\n";return e="house[f].hide()\ndrive(path[len(path) - 1])\n"+e},p_=function(e,t){return["len(path) == 7",t.ORDER_ATOMIC]},f_=function(){return'name = ["","学校","小智家","小欣家","小思家","小科家","贝贝家","乐乐家"]\nres = ""\nfor i in path:\n res = res + name[i] + "-"\nprint(res[:-1])\n'},m_=function(e,t){t.definitions_.import_sprite="import sprite";return"g = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,1,0,0,0,0,0,0], [0,0,0,1,0,0,1,0,0,0], [0,1,1,0,1,0,0,0,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,0,1,0,0,0,1,0,0], [0,0,1,0,0,0,0,1,0,0], [0,0,0,0,1,1,1,0,0,0]]\nmark = [[0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0]]\nvis = [0,1,0,0,0,0,0,0,0]\nposition = [[0, 0], [200, 200], [250, 60], [320, 200], [280, 380], [470, 250], [670, 90], [650, 340]]\nsprite.clearAllSprites()\nsprite.createBackground('ditu')\nmask = sprite.Sprite('white', 96, 354)\nmask.hide()\nhouse = [\n sprite.Sprite('mark', 150, 380),\n sprite.Sprite('xtxn', 96, 170),\n sprite.Sprite('xnvijx', 270, 45),\n sprite.Sprite('xnxbjx', 310, 182),\n sprite.Sprite('xnsijx', 300, 370),\n sprite.Sprite('xnkejx', 495, 220),\n sprite.Sprite('bwbwjx', 716, 85),\n sprite.Sprite('lelejx', 686, 314)\n]\nbarricade = sprite.Sprite('barricade', 610, 170)\nbarricade.enlargeTo(100)\nfor i in house:\n i.filterBrighter()\n i.hide()\n"},g_=function(e,t){return["f == 1",t.ORDER_ATOMIC]},__=function(){return"print('没有符合条件的路线')\n"},y_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g = [[10000,10000,10000,10000,10000,10000,10000,10000,10000,10000,10000],[10000,10000,500,300,10000,10000,10000,10000,10000,10000,10000],[10000,500,10000,10000,100,10000,10000,10000,10000,10000,10000],[10000,300,10000,10000,400,300,10000,10000,10000,10000,10000],[10000,10000,100,400,10000,10000,200,10000,10000,10000,10000],[10000,10000,10000,300,10000,10000,100,200,10000,10000,10000],[10000,10000,10000,10000,200,100,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,200,10000,10000,100,10000,10000],[10000,10000,10000,10000,10000,10000,100,100,10000,10000,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小思家","银行","邮局","餐厅","书店","医院","超市","小科家"]\nposition = [[0, 0], [60, 320], [510, 390], [240, 200], [750, 330], [410, 90], [540, 190], [550, 30], [720, 120]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_si_ke\')\nstu = sprite.Sprite(\'girl\', 60, 320)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},v_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'g =[[10000,10000,10000,10000,10000,10000,10000],[10000,10000,300,500,10000,10000,10000],[10000,300,10000,10000,300,700,10000],[10000,500,10000,10000,10000,100,10000],[10000,10000,300,10000,10000,10000,200],[10000,10000,700,100,10000,10000,100],[10000,10000,10000,10000,200,100,10000]]\nnow=1\nlast=1\npath=[]\npath.append(1)\nname = ["","小智家","邮局","银行","书店","餐厅","学校"]\nposition = [[0, 0], [70, 340], [70, 90], [550, 310], [420, 70], [730, 250], [650, 130]]\nsprite.clearAllSprites()\nsprite.createBackground(\'map_zhi_xue\')\nstu = sprite.Sprite(\'boy\', 70, 340)\nstu.enlargeTo(100)\ntime.sleep(1)\n\n'},b_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return'tmp=10000\nfor i in range(0, len(g), 1):\n if g[now][i]<tmp and i!=last:\n next=i\n tmp=g[now][i]\nstu.slideTo(position[next][0], position[next][1], 1)\ntime.sleep(0.5)\npath.append(next)\nlast=now\nnow=next\nif len(path)>6:\n print("路线错乱!程序有误!")\n exit()\n'},T_=function(e,t){return["name[now] != '小科家'",t.ORDER_ATOMIC]},x_=function(e,t){return["name[now] != '学校'",t.ORDER_ATOMIC]},E_=function(){return'res = ""\nfor i in path:\n res = res + name[i] + "→"\nprint(res[:-1])\n'},w_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");if(n>=7)var i="print('层数过高不得高于6层')\nexit()\n";else i="sprite.clearAllSprites()\n_Hanoicolor = ['blue', 'red', 'yellow', 'green', 'purple', 'black']\n_Hanoi = [[], [], []]\nA = 0\nB = 1\nC = 2\n_n = "+n+"\n_HanoiColumn = [\n sprite.Sprite('HanoiColumn', 200, 320),\n sprite.Sprite('HanoiColumn', 400, 320),\n sprite.Sprite('HanoiColumn', 600, 320)\n]\n_HanoiColumnNumber = [\n sprite.Text('A', 190, 120),\n sprite.Text('B', 390, 120),\n sprite.Text('C', 590, 120)\n]\n_HanoiBlock = []\nfor i in range(0, _n, 1):\n _HanoiBlock.append(sprite.Sprite(_Hanoicolor[i], 200, 400-(_n-i-1)*27))\n _HanoiBlock[i].setScale(25, 30*i+30)\n _Hanoi[0].insert(0, _HanoiBlock[i])\n_steptext = sprite.Text('步数0', 30, 30)\n_steps = {'steps' : 0}\ntime.sleep(1)\n";return i},I_=function(e,t){var n=t.valueToCode(this,"FROM_NUM",t.ORDER_ATOMIC)||"0",i=t.valueToCode(this,"TO_NUM",t.ORDER_ATOMIC)||"0";return`if len(_Hanoi[${n}])>0 :\n _HanoiBlockMoved = _Hanoi[${n}].pop()\n if len(_Hanoi[${i}]) > 0 :\n _HanoiBlockSuppressed = _Hanoi[${i}].pop()\n if _HanoiBlock.index(_HanoiBlockMoved) > _HanoiBlock.index(_HanoiBlockSuppressed):\n print('非法移动!程序有误!')\n exit()\n else:\n _Hanoi[${i}].append(_HanoiBlockSuppressed)\n _HanoiBlockMoved.slideTo(${n}*200+200, 180, 0.2)\n _HanoiBlockMoved.slideTo(${i}*200+200, 180, 0.5)\n _HanoiBlockMoved.slideTo(${i}*200+200, 400-len(_Hanoi[${i}])*27, 0.2)\n _Hanoi[${i}].append(_HanoiBlockMoved)\n _steps['steps'] += 1\n _steptext.changeText('步数:'+str(_steps['steps']))\nelse :\n print('非法移动!程序有误!')\n exit()\n`},A_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=1\n n=5\n ring[5]=1\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=2\n n=len(ring)-1\nring[n]=1\ntime.sleep(1)\n"},S_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if 'mode' not in globals() or mode == 0:\n sprite.clearAllSprites()\n ring=[0,0,0,0,0,0,0,0,0,0]\n mode=2\n n=5\n name=['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\n Books = []\n for i in range(1, 11, 1):\n Books.append(sprite.Sprite('books/book'+str(i), (130*i-650) if i>5 else 130*i, 320 if i>5 else 120))\nelse:\n mode=1\n n=len(ring)-1\nring[n]=n\nlist=ring\ntemp=Books\ntime.sleep(1)\n"},C_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"res=0\nflag=ring[res]\nBooks[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n"},O_=function(e,t){return["(('mode' not in globals())or(mode==1 and flag==0)or(mode==2 and not any(value > 0 for value in qian))or(mode==0))",t.ORDER_ATOMIC]},M_=function(e,t){return["(('mode' in globals())and((mode==1 and flag!=0)or(mode==2 and any(value > 0 for value in qian))))",t.ORDER_ATOMIC]},k_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="res+=1\nflag=ring[res]\n";return n="Books[res].filterGray()\ntime.sleep(0.3)\n"+(n+="Books[res].filterBrighter()\ntime.sleep(0.1)\nBooks[res].filterOrigin()\n")},R_=function(e,t){return["len(list)>=2",t.ORDER_ATOMIC]},N_=function(){return"mid = int(len(list)/2)\nqian = list[0:mid]\nhou = list[mid:]\nqiantemp = temp[0:mid]\nhoutemp = temp[mid:]\n"},D_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"quchu = qian\nlist = hou\nquchutemp = qiantemp\ntemp = houtemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterGray()\ntime.sleep(0.5)\n"},F_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"list = quchu\ntemp = quchutemp\nfor i in qiantemp:\n i.filterBrighter()\ntime.sleep(0.5)\nfor i in qiantemp:\n i.filterOrigin()\nfor i in houtemp:\n\ti.filterBrighter()\ntime.sleep(0.5)\nfor i in houtemp:\n i.filterGray()\ntime.sleep(0.5)\n"},L_=function(){return"if 'list' in globals():\n res = list[0]\nBooks[res].filterBrighter()\nprint('未消磁的书籍是第'+str(res+1)+'本《'+name[res%10]+'》。')\nif res!=n:\n print('答案错误!请检查程序!')\nmode=0\n"},P_=function(e,t){var n=this.getFieldValue("NUM");return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",`sprite.clearAllSprites()\nring = []\nname = ['小王子','海底两万里','荷花镇的早市','孔子的故事','夏洛的网','草房子','月下看猫头鹰','会唱歌的咖啡磨','父与子','城南旧事']\nBooks = []\nfor i in range(${n}):\n ring.append(0)\nfor i in range(1, ${n}+1, 1):\n Books.append(sprite.Sprite('books/book'+str(i%10 if i%10!=0 else 10), ${{5:"130*i, 120",10:"(130*i-650) if i>5 else 130*i, 320 if i>5 else 120",20:"(65*i-650)+30 if i>10 else 65*i+30, 320 if i>10 else 120",50:"(26*i-650)+50 if i>25 else 26*i+50, 320 if i>25 else 120"}[n]}))\ntime.sleep(1)\nmode=3\n`},B_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt=0\ncntText = sprite.Text('计数器0', 30, 200)\n"},$_=function(e,t){t.definitions_.import_sprite="import sprite";return"cnt+=1\ncntText.changeText('计数器:'+str(cnt))\n"},U_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('计数器大小:'+str(cnt))\n"},V_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\n_head = 10\n_foot = 32\n_footText = sprite.Text('脚的数量:', 20, 10)\n_sprite = []\n"},z_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit = 0\ntime.sleep(1)\n"},j_=function(e,t){return["_rabbit < _head",t.ORDER_ATOMIC]},Y_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_chick = _head - _rabbit\nfor i in range(0, _chick, 1):\n _sprite.append(sprite.Sprite('jttl/chick', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\n\ntime.sleep(0.5)\n_footText.changeText('脚的数量:'+str(_rabbit*4 + _chick*2))\ntime.sleep(1)\n"},G_=function(e,t){return["_rabbit*4 + _chick*2 == _foot",t.ORDER_ATOMIC]},H_=function(e,t){t.definitions_.import_sprite="import sprite";return"print('鸡的数量:'+str(_chick)+'只;\\n兔的数量'+str(_rabbit)+'只。')\n"},W_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_rabbit += 1\nsprite.clearAllSprites()\n_sprite = []\n_footText = sprite.Text('脚的数量:', 20, 10)\nfor i in range(0, _rabbit, 1):\n _sprite.append(sprite.Sprite('jttl/rabbit', len(_sprite)*130+130 if len(_sprite)<5 else len(_sprite)*130+130-650, 120 if len(_sprite)<5 else 320))\ntime.sleep(0.5)\n"},X_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/fzsf/map_ck_xxjsjs')\n_S1 = sprite.Sprite('/fzsf/S1',400,225,'S1')\n_S2 = sprite.Sprite('/fzsf/S2',400,225,'S2')\n_S3 = sprite.Sprite('/fzsf/S3',400,225,'S3')\n_S4 = sprite.Sprite('/fzsf/S4',400,225,'S4')\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_text_1 = sprite.Text('S1',0,0,'text')\n_text_2 = sprite.Text('S2',0,30,'text2')\n_text_3 = sprite.Text('S3',0,60,'text3')\n_text_4 = sprite.Text('S4',0,90,'text4')\n_position = [[60, 270], [240, 50], [260, 380], [440, 190], [730, 60], [700, 400]]\n_Llen = [0, 170, 230, 100, 150, 10, 30, 50]\n_Slen = [0, 0, 0, 0, 0]\n_tag = [0, [0, 1, 3], [0, 2, 3], [3, 4, 5], [3, 5]]\nbear = sprite.Sprite('mixbear',60,270,'bear')\nbear.enlargeTo(80)\n_pos = 0\ntime.sleep(1)\n"},q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME");const i=[0,[1,3],[2,4],[5,7],[6]];var r="";return r+=`_S${n}.show()\ntime.sleep(1)\n`,r+=4!=n?`_Slen[${n}] = _Llen[${i[n][0]}] + _Llen[${i[n][1]}]\n_text_${n}.changeText('S${n}'+str(_Slen[${n}])+'m')\ntime.sleep(1)\n_S${n}.hide()\ntime.sleep(1)\n`:"_Slen[4] = _Llen[6]\n_text_4.changeText('S4'+str(_Slen[4])+'m')\ntime.sleep(1)\n_S4.hide()\ntime.sleep(1)\n"},K_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return[n+=`_Slen[${this.getFieldValue("PATHNAME")}] < _Slen[${this.getFieldValue("PATHNAME2")}]`,t.ORDER_ATOMIC]},Z_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("PATHNAME"),i="";return i+=`\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\n_Smin = ${n}\n_S${n}.show()\ntime.sleep(0.5)\n_S${n}.hide()\ntime.sleep(0.5)\n_S${n}.show()\ntime.sleep(1)\n`},Q_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"if(_pos == _tag[_Smin][0]):\n for i in range(1, len(_tag[_Smin]), 1):\n bear.slideTo(_position[_tag[_Smin][i]][0], _position[_tag[_Smin][i]][1], 1)\n _pos = _tag[_Smin][len(_tag[_Smin])-1]\nelse:\n print('移动错误!程序有误!')\n exit()\n_S1.hide()\n_S2.hide()\n_S3.hide()\n_S4.hide()\nif(_pos == 5):\n print('成功抵达信息科技教室!')\n"},J_=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"sprite.clearAllSprites()\nsprite.createBackground('/hxdb/hxdbbg')\n_soldier = []\n_num = sprite.Text('目前士兵数量0',0,0,'num')\n_last = sprite.Text('剩余0',500,0,'last')\n_line = 3\n"},ey=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n="";return n+=`for i in range(0, ${this.getFieldValue("NUM")}, 1):\n _soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\n_num.changeText('目前士兵数量:'+str(len(_soldier)))\n`},ty=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";var n=this.getFieldValue("NUM");return`for i in range(0, len(_soldier), 1):\n _soldier[i].slideTo(30 + (i%${n})*50 + (i//(4*${n}))*(${n}+1)*50 +(i%3-2), 80+(i//${n})*100-(i//(4*${n}))*4*100+(i%2), 0.05)\n_line = ${n}\n_last.changeText('剩余:'+str(len(_soldier)%_line))\ntime.sleep(2)\n`},ny=function(e,t){return t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite",[`len(_soldier)%_line == ${this.getFieldValue("NUM")}`,t.ORDER_ATOMIC]},iy=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"_num.changeText('目前士兵数量:'+str(len(_soldier)+1))\n_last.changeText('剩余:')\ntime.sleep(0.5)\n_soldier.append(sprite.Sprite('/hxdb/soldier', 30 + (len(_soldier)%_line)*50 + (len(_soldier)//(4*_line))*(_line+1)*50 +(len(_soldier)%3-2), 80+(len(_soldier)//_line)*100-(len(_soldier)//(4*_line))*4*100+(len(_soldier)%2)))\ntime.sleep(1)\n"},ry=function(e,t){t.definitions_.import_time="import time",t.definitions_.import_sprite="import sprite";return"print('符合要求的士兵数量为:'+str(len(_soldier)))\n"},sy=function(e,t){t.definitions_.import_turtle="import turtle",t.definitions_.import_time="import time",t.definitions_.import_math="import math";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC),i=this.getFieldValue("NUM");return t.setups_.init_Hanoi="\ndef init_Hanoi():\n pen = turtle.Turtle()\n pen.hideturtle()\n pen.speed(0)\n for i in range(0, 3, 1):\n pen.penup()\n pen.setheading(0)\n pen.goto(150 * i - 200,-100)\n pen.pendown()\n pen.pensize(5)\n pen.forward(100)\n pen.goto(150 * i - 150,-100)\n pen.setheading(90)\n pen.forward(200)",t.setups_.begin="\ndef begin(): \n s = turtle.Turtle()\n s.hideturtle()\n s.penup()\n s.speed(0)\n s.goto(0,-150)\n s.write('3')\n time.sleep(1)\n s.clear()\n s.write('2')\n time.sleep(1)\n s.clear()\n s.write('1')\n time.sleep(1)\n s.clear()\n s.write('Start!')\n time.sleep(1)\n s.clear()\n",t.setups_.move="\ndef move(x, y):\n try:\n t = tower[x].pop(-1)\n a = tower_num[x].pop(-1)\n if tower_num[y]!=[]:\n b = tower_num[y][-1]\n if a<b:\n print('非法移动,不能将大盘放置在小盘上')\n exit() \n t.goto(150 * y - 150,20 * len(tower[y]) - 90)\n tower[y].append(t)\n tower_num[y].append(a)\n except IndexError:\n print('非法移动,未找到可移动的圆盘')\n exit()\n",`num = ${i}\ntower = [[], [], []]\ntower_num = [[], [], []]\nA,B,C=0,1,2\ntotal_num=[0]\ncolor= (${n})\ninit_Hanoi()\nfor i in range(0, num, 1):\n tina = turtle.Turtle()\n tina.penup()\n tina.shape('square')\n if num == 1:\n tina.shapesize(1,7,1)\n else:\n tina.shapesize(1,7 - (6 / (num - 1)) * i,1)\n tina.color("#000000",color)\n tina.speed(3)\n tina.goto(-150,20 * i - 90)\n tower[0].append(tina)\n tower_num[0].append(i)\ncount_turtle=turtle.Turtle()\ncount_turtle.hideturtle()\ncount_turtle.penup()\ncount_turtle.goto(0,150)\ncount_turtle.write('总步数0') \nbegin()\n`},oy=function(){return"f = path[(len(path) - 1)]\n"},ay=function(e,t){return["len(path)==0",t.ORDER_ATOMIC]},ly=function(e,t){return['"'+this.getFieldValue("COLOR")+'"',t.ORDER_ATOMIC]},uy=function(e,t){return t.definitions_.import_requests="import requests",t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+"= requests.get("+t.valueToCode(this,"DOMAIN",t.ORDER_ATOMIC)+")\n"},cy=function(e,t){return t.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+t.valueToCode(this,"URL",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},dy=function(e,t){return t.definitions_.import_requests="import requests",["requests."+this.getFieldValue("TYPE")+"("+t.valueToCode(this,"URL",t.ORDER_ATOMIC)+",data="+t.valueToCode(this,"data",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},hy=function(e,t){return t.definitions_.import_requests="import requests",[(t.valueToCode(this,"VAL",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("ATTR"),t.ORDER_ATOMIC]},py=function(e,t){return t.definitions_.import_requests="import requests","requests."+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"};var fy=__webpack_require__(20936);const my=function(e,t){t.definitions_.import_pandas="import pandas";var n=t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.Series("+n+")\n"},gy=function(e,t){t.definitions_.import_pandas="import pandas";var n=t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"INDEX",t.ORDER_ATOMIC)||"''";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.Series("+n+",index="+i+")\n"},_y=function(e,t){t.definitions_.import_pandas="import pandas";var n=t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.DataFrame("+n+")\n"},yy=function(e,t){t.definitions_.import_pandas="import pandas";var n=t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"INDEX_COLUMN",t.ORDER_ATOMIC)||"''",r=t.valueToCode(this,"INDEX_RAW",t.ORDER_ATOMIC)||"''";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.DataFrame("+n+",columns="+i+",index="+r+")\n"},vy=function(e,t){t.definitions_.import_pandas="import pandas";var n=this.getFieldValue("COLUMN_RAW"),i=t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"INDEX",t.ORDER_ATOMIC)||"''";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.DataFrame("+i+","+n+"="+r+")\n"},by=function(e,t){return t.definitions_.import_pandas="import pandas",t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = pandas.Series(["+this.getFieldValue("TEXT")+"])\n"},Ty=function(e,t){return t.definitions_.import_pandas="import pandas",[(t.valueToCode(this,"SERIES",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("INDEX_VALUE"),t.ORDER_ATOMIC]},xy=function(e,t){return[(t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0")+"["+(t.valueToCode(this,"AT",t.ORDER_ADDITIVE)||"1")+"]",t.ORDER_ATOMIC]},Ey=function(e,t){t.definitions_.import_pylab="import pylab";return"pylab.show()\n"},wy=function(e,t){t.definitions_.import_pylab="import pylab";return"pylab.axes(aspect=1)\n"},Iy=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.plot("+(t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0")+")\n"},Ay=function(e,t){t.definitions_.import_pylab="import pylab";var n=this.getFieldValue("LINE"),i=this.getFieldValue("COLOR"),r=this.getFieldValue("DOT");return"pylab.plot("+(t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0")+",'"+r+n+i+"')\n"},Sy=function(e,t){t.definitions_.import_pylab="import pylab",t.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'pylab.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},Cy=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.title("+t.valueToCode(this,"TITLE",t.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},Oy=function(e,t){return t.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"label("+t.valueToCode(this,"LABEL",t.ORDER_ATOMIC)+', fontproperties = "STSong")\n'},My=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.arange("+(t.valueToCode(this,"FROM",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"TO",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"STEP",t.ORDER_NONE)||"1")+")",t.ORDER_ATOMIC]},ky=function(e,t){return t.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+","+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+")\n"},Ry=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.scatter("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+","+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+",s="+(t.valueToCode(this,"S",t.ORDER_ATOMIC)||"''")+",c='"+this.getFieldValue("COLOR")+"',marker='"+this.getFieldValue("DOT")+"',label="+(t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''")+")\n"},Ny=function(e,t){t.definitions_.import_pylab="import pylab";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=this.getFieldValue("LINE"),s=this.getFieldValue("COLOR");return"pylab.plot("+n+","+i+",'"+this.getFieldValue("DOT")+r+s+"',label="+(t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''")+")\n"},Dy=function(e,t){t.definitions_.import_pylab="import pylab";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''",s=t.valueToCode(this,"WIDTH",t.ORDER_RELATIONAL)||"0",o=this.getFieldValue("COLOR");return"pylab.bar("+n+","+i+',align="'+this.getFieldValue("ALIGN")+'",color="'+o+'",width='+s+",label="+r+")\n"},Fy=function(e,t){t.definitions_.import_pylab="import pylab";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=t.valueToCode(this,"EXPLODE",t.ORDER_ATOMIC)||"''",s=this.getFieldValue("SHADOW"),o=this.getFieldValue("autopct");return"None"!=o&&(o="'"+o+"'"),"pylab.pie("+n+",explode="+r+",labels="+i+",autopct="+o+",shadow="+s+")\n"},Ly=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.hist("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+","+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+")\n"},Py=function(e,t){return t.definitions_.import_pylab="import pylab","pylab."+this.getFieldValue("DIR")+"ticks("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+","+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+",fontproperties = 'STSong')\n"},By=function(e,t){t.definitions_.import_numpy="import numpy";var n=t.valueToCode(this,"NUM",t.ORDER_NONE)||"0";return["numpy."+this.getFieldValue("OP")+"("+n+")",t.ORDER_ATOMIC]},$y=function(e,t){return t.definitions_.import_numpy="import numpy","pylab.subplot("+(t.valueToCode(this,"VET",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"HOR",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+")\n"},Uy=function(e,t){return t.definitions_.import_pandas="import pandas",["pandas.read_csv("+t.valueToCode(this,"FILENAME",t.ORDER_ATOMIC)+", header="+this.getFieldValue("MODE")+")",t.ORDER_ATOMIC]},Vy=function(e,t){var n=this.getFieldValue("MODE"),i=t.valueToCode(this,"DICT",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"KEY",t.ORDER_ASSIGNMENT);if("column"==n)var s=i+"["+r+"]";else if("raw"==n)s=i+".loc["+r+"]";return[s,t.ORDER_ATOMIC]},zy=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.savefig("+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},jy=function(e,t){return t.definitions_.import_numpy="import numpy","pylab.text("+(t.valueToCode(this,"VET",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"HOR",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(t.valueToCode(this,"FONTNUM",t.ORDER_ASSIGNMENT)||"0")+")\n"},Yy=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0";return t.definitions_.import_numpy="import numpy",["numpy.array("+n+")",t.ORDER_ATOMIC]},Gy=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.show()\n"},Hy=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.axes(aspect=1)\n"},Wy=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.plot("+(t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0")+")\n"},Xy=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=this.getFieldValue("LINE"),i=this.getFieldValue("COLOR"),r=this.getFieldValue("DOT");return"plt.plot("+(t.valueToCode(this,"SER",t.ORDER_ASSIGNMENT)||"0")+", '"+r+n+i+"')\n"},qy=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt",t.definitions_.import_matplotlib_font_manager="import matplotlib.font_manager";return'plt.legend(prop=matplotlib.font_manager.FontProperties("STSong"))\n'},Ky=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.title("+t.valueToCode(this,"TITLE",t.ORDER_ATOMIC)+', fontproperties="STSong")\n'},Zy=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"label("+t.valueToCode(this,"LABEL",t.ORDER_ATOMIC)+', fontproperties="STSong")\n'},Qy=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+", "+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+")\n"},Jy=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.scatter("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+", "+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+", s="+(t.valueToCode(this,"S",t.ORDER_ATOMIC)||"''")+", c='"+this.getFieldValue("COLOR")+"', marker='"+this.getFieldValue("DOT")+"', label="+(t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''")+")\n"},ev=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=this.getFieldValue("LINE"),s=this.getFieldValue("COLOR");return"plt.plot("+n+", "+i+", '"+this.getFieldValue("DOT")+r+s+"', label="+(t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''")+")\n"},tv=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=t.valueToCode(this,"TAG",t.ORDER_ATOMIC)||"''",s=t.valueToCode(this,"WIDTH",t.ORDER_RELATIONAL)||"0",o=this.getFieldValue("COLOR");return"plt.bar("+n+", "+i+', align="'+this.getFieldValue("ALIGN")+'", color="'+o+'", width='+s+", label="+r+")\n"},nv=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";var n=t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''",i=t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''",r=t.valueToCode(this,"EXPLODE",t.ORDER_ATOMIC)||"''",s=this.getFieldValue("SHADOW"),o=this.getFieldValue("autopct");return"None"!=o&&(o="'"+o+"'"),"plt.pie("+n+", explode="+r+", labels="+i+", autopct="+o+", shadow="+s+")\n"},iv=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.hist("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+", "+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+")\n"},rv=function(e,t){return t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt."+this.getFieldValue("DIR")+"ticks("+(t.valueToCode(this,"A",t.ORDER_ATOMIC)||"''")+", "+(t.valueToCode(this,"B",t.ORDER_ATOMIC)||"''")+", fontproperties = 'STSong')\n"},sv=function(e,t){return t.definitions_.import_numpy="import numpy",t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.subplot("+(t.valueToCode(this,"VET",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"HOR",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+")\n"},ov=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.savefig('1.png')\n"},av=function(e,t){return t.definitions_.import_numpy="import numpy",t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt","plt.text("+(t.valueToCode(this,"VET",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"HOR",t.ORDER_NONE)||"0")+", "+(t.valueToCode(this,"NUM",t.ORDER_NONE)||"0")+", ha='"+this.getFieldValue("HALIGN")+"', va='"+this.getFieldValue("VALIGN")+"', fontsize="+(t.valueToCode(this,"FONTNUM",t.ORDER_ASSIGNMENT)||"0")+")\n"},lv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.shape("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},uv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.reshape("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+", "+(t.valueToCode(e,"DIMENSIONS",t.ORDER_ATOMIC)||"(1, -1)")+")",t.ORDER_ATOMIC]},cv=function(e,t){return t.definitions_.import_numpy="import numpy",[(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+".astype("+e.getFieldValue("TYPE")+")",t.ORDER_ATOMIC]},dv=function(e,t){return t.definitions_.import_pylab="import pylab","pylab.imshow("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+', cmap="'+(e.getFieldValue("COLORMAP")||"gray")+'")\n'},hv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.mean("+(t.valueToCode(e,"X",t.ORDER_ATOMIC)||"[]")+"["+(t.valueToCode(e,"Y",t.ORDER_ATOMIC)||"[]")+" == "+(t.valueToCode(e,"DIGIT",t.ORDER_ATOMIC)||"0")+"], axis=0)",t.ORDER_ATOMIC]},pv=function(e,t){return t.definitions_.import_numpy="import numpy",t.definitions_.import_cv2="import cv2",["numpy.argmin([numpy.sum(cv2.absdiff("+(t.valueToCode(e,"IMAGE",t.ORDER_ATOMIC)||"[]")+", template)) for template in "+(t.valueToCode(e,"TEMPLATES",t.ORDER_ATOMIC)||"[]")+"])",t.ORDER_ATOMIC]},fv=function(e,t){t.definitions_.import_numpy="import numpy";var n=t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]",i=e.getFieldValue("AXIS");if("NONE"===i)var r="numpy.mean("+n+")";else r="numpy.mean("+n+", axis="+i+")";return[r,t.ORDER_ATOMIC]},mv=function(e,t){t.definitions_.import_numpy="import numpy";var n=t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]",i=e.getFieldValue("AXIS");if("NONE"===i)var r="numpy.std("+n+")";else r="numpy.std("+n+", axis="+i+")";return[r,t.ORDER_ATOMIC]},gv=function(e,t){return t.definitions_.import_pandas="import pandas",[(t.valueToCode(e,"DF",t.ORDER_ATOMIC)||"df")+".dropna()",t.ORDER_MEMBER]},_v=function(e,t){return t.definitions_.import_pandas="import pandas",[(t.valueToCode(e,"DATAFRAME",t.ORDER_ATOMIC)||"df")+".drop(columns="+(t.valueToCode(e,"COLUMNS",t.ORDER_ATOMIC)||"[]")+", axis=1)",t.ORDER_ATOMIC]},yv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.ones("+(t.valueToCode(e,"NUM",t.ORDER_ATOMIC)||"1")+")",t.ORDER_ATOMIC]},vv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.c_["+(t.valueToCode(e,"ARRAY1",t.ORDER_ATOMIC)||"[]")+", "+(t.valueToCode(e,"ARRAY2",t.ORDER_ATOMIC)||"[]")+"]",t.ORDER_ATOMIC]},bv=function(e,t){return t.definitions_.import_numpy="import numpy",t.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.det("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},Tv=function(e,t){return[(t.valueToCode(e,"MATRIX",t.ORDER_ATOMIC)||"[]")+".T",t.ORDER_ATOMIC]},xv=function(e,t){return[(t.valueToCode(e,"MATRIX1",t.ORDER_ATOMIC)||"[]")+" @ "+(t.valueToCode(e,"MATRIX2",t.ORDER_ATOMIC)||"[]"),t.ORDER_ATOMIC]},Ev=function(e,t){return t.definitions_.import_numpy="import numpy",t.definitions_.import_linalg="import numpy.linalg",["numpy.linalg.inv("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},wv=function(e,t){return[(t.valueToCode(e,"DATAFRAME",t.ORDER_ATOMIC)||"df")+".median()",t.ORDER_ATOMIC]},Iv=function(e,t){return(t.valueToCode(e,"DATAFRAME",t.ORDER_ATOMIC)||"df")+".fillna(value="+(t.valueToCode(e,"VALUE",t.ORDER_ATOMIC)||"0")+", inplace="+(e.getFieldValue("INPLACE")||"False")+")\n"},Av=function(e,t){return[(t.valueToCode(e,"DATAFRAME",t.ORDER_ATOMIC)||"df")+".info()",t.ORDER_ATOMIC]},Sv=function(e,t){t.definitions_.import_numpy="import numpy";var n=t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]",i=e.getFieldValue("AXIS");return["None"===i?"numpy.min("+n+")":"numpy.min("+n+", axis="+i+")",t.ORDER_ATOMIC]},Cv=function(e,t){t.definitions_.import_numpy="import numpy";var n=t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]",i=e.getFieldValue("AXIS");return["None"===i?"numpy.max("+n+")":"numpy.max("+n+", axis="+i+")",t.ORDER_ATOMIC]},Ov=function(e,t){return t.definitions_.import_numpy="import numpy",[(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+".size",t.ORDER_ATOMIC]},Mv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.dot("+(t.valueToCode(e,"ARRAY1",t.ORDER_ATOMIC)||"[]")+", "+(t.valueToCode(e,"ARRAY2",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},kv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.square("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},Rv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.sum("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},Nv=function(e,t){return t.definitions_.import_numpy="import numpy",["numpy.random.random("+(t.valueToCode(e,"SIZE",t.ORDER_ATOMIC)||"1")+")",t.ORDER_ATOMIC]},Dv=function(e,t){return["sum("+(t.valueToCode(e,"ARRAY",t.ORDER_ATOMIC)||"[]")+")",t.ORDER_ATOMIC]},Fv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.sort_values(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"}, ascending=${e.getFieldValue("AS_CENDING")})`,t.ORDER_ATOMIC]},Lv=function(e,t){const n=t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df",i=t.valueToCode(e,"LINES",t.ORDER_ATOMIC)||"1";return[`${n}.${e.getFieldValue("TYPE")}(${i})`,t.ORDER_ATOMIC]},Pv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}[${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"df['tag'] > 1"}]`,t.ORDER_ATOMIC]},Bv=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.groupby(by=${t.valueToCode(e,"KEY",t.ORDER_ATOMIC)||"'tag'"})`,t.ORDER_ATOMIC]},$v=function(e,t){return[`${t.valueToCode(e,"DICT",t.ORDER_ATOMIC)||"df"}.${e.getFieldValue("TYPE")}()`,t.ORDER_ATOMIC]},Uv=function(e,t){t.definitions_.import_matplotlib_pyplot="import matplotlib.pyplot as plt";return"plt.cla()\n"},Vv=function(e,t){var n=t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE),i=t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),r="class "+i+":\n";r+=" def __init__(self):\n";for(var s=new Array(this.itemCount_),o=0;o<this.itemCount_;o++){var a=this.getFieldValue("KEY"+o);s[o]=" self."+a+" = "+(t.valueToCode(this,"ADD"+o,t.ORDER_NONE)||"0")}return r+=s.join("\n")+"\n",r+=" self.next = None\n",r+=n+" = "+i+"()\n"},zv=function(e,t){return(t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0")+" = "+t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE)+"()\n"},jv=function(e,t){return[(t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0")+"."+t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),t.ORDER_ATOMIC]},Yv=function(e,t){return(t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0")+"."+t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE)+" = "+(t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0")+"\n"},Gv=function(e,t){var n=t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"NODE2",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"NODE3",t.ORDER_ASSIGNMENT)||"0",s=this.getFieldValue("DIR");if("after"==s){var o="now = "+n+"\n";o+="while now != "+i+" and now != None:\n",o+=" now = now.next\n",o+="if now != None:\n",o+=" "+r+".next = now.next\n",o+=" now.next = "+r+"\n",o+=' print("插入节点成功")\n',o+="else:\n",o+=' print("插入节点失败,未找到指定名称的节点")\n'}if("before"==s){o="if "+n+" == "+i+":\n";o+=" "+r+".next = "+n+"\n",o+="else:\n",o+=" now = "+n+"\n",o+=" while now.next != "+i+" and now.next != None:\n",o+=" now = now.next\n",o+=" if now != None:\n",o+=" "+r+".next = now.next\n",o+=" now.next = "+r+"\n",o+=' print("插入节点成功")\n',o+=" else:\n",o+=' print("插入节点失败,未找到指定名称的节点")\n'}return o},Hv=function(e,t){var n=t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0",r=t.valueToCode(this,"NODE3",t.ORDER_ASSIGNMENT)||"0",s=t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),o=this.getFieldValue("DIR");if("after"==o){var a="now = "+n+"\n";a+="while now."+s+" != "+i+" and now != None:\n",a+=" now = now.next\n",a+="if now != None:\n",a+=" "+r+".next = now.next\n",a+=" now.next = "+r+"\n",a+=' print("插入节点成功")\n',a+="else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}if("before"==o){a="if "+n+"."+s+" == "+i+":\n";a+=" "+r+".next = "+n+"\n",a+="else:\n",a+=" now = "+n+"\n",a+=" while now.next."+s+" != "+i+"and now.next != None:\n",a+=" now = now.next\n",a+=" if now != None:\n",a+=" "+r+".next = now.next\n",a+=" now.next = "+r+"\n",a+=' print("插入节点成功")\n',a+=" else:\n",a+=' print("插入节点失败,未找到指定的节点")\n'}return a},Wv=function(e,t){var n=t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"NODE2",t.ORDER_ASSIGNMENT)||"0",r="if "+n+" == "+i+":\n";return r+=" "+n+".next = None\n",r+="else:\n",r+=" now = "+n+"\n",r+=" while now.next != "+i+" and now.next != None:\n",r+=" now = now.next\n",r+=" if now != None:\n",r+=" now.next = now.next.next\n",r+=' print("删除节点成功")\n',r+=" else:\n",r+=' print("删除节点失败,未找到指定名称的节点")\n'},Xv=function(e,t){var n=t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"VAR",t.ORDER_ASSIGNMENT)||"0",r=t.variableDB_.getName(this.getFieldValue("TYPE"),Ve.Variables.NAME_TYPE),s="if "+n+"."+r+" == "+i+":\n";return s+=" "+n+".next = None\n",s+="else:\n",s+=" now = "+n+"\n",s+=" while now.next."+r+" != "+i+" and now.next != None:\n",s+=" now = now.next\n",s+=" if now != None:\n",s+=" now.next = now.next.next\n",s+=' print("删除节点成功")\n',s+=" else:\n",s+=' print("删除节点失败,未找到指定的节点")\n'},qv=function(e,t){var n="ptr = "+(t.valueToCode(this,"NODE",t.ORDER_ASSIGNMENT)||"0")+"\n";return n+="before = None\n",n+="while ptr != None:\n",n+=" last = before\n",n+=" before = ptr\n",n+=" ptr = ptr.next\n",n+=" before.next = last\n",n+=(t.valueToCode(this,"NODE2",t.ORDER_ASSIGNMENT)||"0")+" = before\n"},Kv=function(e,t){var n=this.getFieldValue("path"),i=this.getFieldValue("module");return t.definitions_["import_"+n+"_"+i]="from "+n+" import "+i,""},Zv=function(e,t){var n=this.getFieldValue("module");return t.definitions_["import_"+n]="import "+n,""},Qv=function(e,t){for(var n=this.getFieldValue("NAME"),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"";return n+"("+i.join(", ")+")\n"},Jv=function(e,t){for(var n=this.getFieldValue("NAME"),i=new Array(this.itemCount_),r=0;r<this.itemCount_;r++)i[r]=t.valueToCode(this,"ADD"+r,t.ORDER_NONE)||"";return[n+"("+i.join(", ")+")",t.ORDER_ATOMIC]},eb=function(){var e=this.getFieldValue("TYPE");return this.getFieldValue("NAME")+" = "+e+"()\n"},tb=function(e,t){for(var n=this.getFieldValue("NAME"),i=this.getFieldValue("METHOD"),r=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)r[s]=t.valueToCode(this,"ADD"+s,t.ORDER_NONE)||"";return n+"."+i+"("+r.join(", ")+")\n"},nb=function(e,t){for(var n=this.getFieldValue("NAME"),i=this.getFieldValue("METHOD"),r=new Array(this.itemCount_),s=0;s<this.itemCount_;s++)r[s]=t.valueToCode(this,"ADD"+s,t.ORDER_NONE)||"";return[n+"."+i+"("+r.join(", ")+")",t.ORDER_ATOMIC]},ib=function(){return this.getFieldValue("VALUE")+"\n"},rb=function(e,t){return[this.getFieldValue("VALUE"),t.ORDER_ATOMIC]},sb=function(){return this.getFieldValue("VALUE")+"\n"},ob=function(e,t){return[this.getFieldValue("VALUE"),t.ORDER_ATOMIC]},ab=function(e,t){return t.definitions_.import_s4alib="import s4alib",t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+' = s4alib.s4a_start("'+ze.JSFuncs.getCom()+'")\n'},lb=function(e,t){return["HIGH"==this.getFieldValue("BOOL")?"1":"0",t.ORDER_ATOMIC]},ub=function(e,t){t.definitions_.import_s4alib="import s4alib";var n="";return n+=t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".digital_write("+t.valueToCode(this,"PIN",t.ORDER_ATOMIC)+","+t.valueToCode(this,"STAT",t.ORDER_ATOMIC)+")\n"},cb=function(e,t){t.definitions_.import_s4alib="import s4alib";return[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".digital_read("+t.valueToCode(this,"PIN",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},db=function(e,t){t.definitions_.import_s4alib="import s4alib";return[t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".analog_read("+t.valueToCode(this,"PIN",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},hb=function(e,t){t.definitions_.import_s4alib="import s4alib";var n="";return n+=t.valueToCode(this,"SUB",t.ORDER_ATOMIC)+".analog_write("+t.valueToCode(this,"PIN",t.ORDER_ATOMIC)+","+t.valueToCode(this,"NUM",t.ORDER_ATOMIC)+")\n"},pb=function(e,t){return["input("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")",t.ORDER_ATOMIC]},fb=function(e,t){return"print("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")\n"},mb=function(e,t){return"print("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+',end ="")\n'},gb=function(e,t){return"print("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+",end ="+(t.valueToCode(this,"END",t.ORDER_ATOMIC)||'""')+")\n"},_b=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',i=this.getFieldValue("DIR");if("str"==i)var r="input("+n+")";else if("int"==i)r="int(input("+n+"))";else if("float"==i)r="float(input("+n+"))";return[r,t.ORDER_ATOMIC]},yb=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""',i=this.getFieldValue("DIR");if(t.definitions_.import_pyinput="import pyinput","str"==i)var r="pyinput.input("+n+")";else if("int"==i)r="int(pyinput.input("+n+"))";else if("float"==i)r="float(pyinput.input("+n+"))";return[r,t.ORDER_ATOMIC]},vb=function(e,t){for(var n=new Array(this.itemCount_),i=0;i<this.itemCount_;i++)n[i]=t.valueToCode(this,"ADD"+i,t.ORDER_NONE)||"0";return n="print("+n.join(", ")+")\n"},bb=function(e,t){t.definitions_.import_mixiot="import mixiot";var n=t.valueToCode(this,"SERVER",t.ORDER_ATOMIC),i=t.valueToCode(this,"USERNAME",t.ORDER_ATOMIC),r=t.valueToCode(this,"PASSWORD",t.ORDER_ATOMIC),s=t.valueToCode(this,"PROJECT",t.ORDER_ATOMIC),o=Math.round(new Date).toString(),a="f'python-mqtt-"+i.replace("'","").replace("'","")+o.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO("+n+", 1883 ,"+i+", "+r+", "+s+", "+a+")\n"},Tb=function(e,t){var n=t.valueToCode(this,"TOPIC",t.ORDER_ATOMIC),i=t.valueToCode(this,"MSG",t.ORDER_ATOMIC);return t.definitions_.import_mixiot="import mixiot","mqtt_client.publish("+n+", "+i+")\n"},xb=function(e,t){var n=t.valueToCode(this,"TOPIC",t.ORDER_ATOMIC),i=t.valueToCode(this,"MSG",t.ORDER_ATOMIC),r=this.getFieldValue("quality");return t.definitions_.import_mixiot="import mixiot","mqtt_client.publish(MQTT_USR_PRJ + "+n+", "+i+", qos="+r+")\n"},Eb=function(e,t){var n=t.valueToCode(this,"TOPIC",t.ORDER_ATOMIC),i=t.valueToCode(this,"METHOD",t.ORDER_ATOMIC);return t.definitions_.import_mixiot="import mixiot","mqtt_client.subscribe_and_set_callback("+n+","+i+")\n"},wb=function(e,t){var n=t.valueToCode(this,"TOPIC",t.ORDER_ATOMIC);return t.definitions_.import_mixiot="import mixiot","mqtt_client.unsubscribe("+n+")\n"},Ib=function(e,t){t.definitions_.import_mixiot="import mixiot";return"mqtt_client.disconnect()\n"},Ab=function(e,t){t.definitions_.import_mixiot="import mixiot";return"mqtt_client.connect()\n"},Sb=function(e,t){t.definitions_.import_mixiot="import mixiot";return"mqtt_client.check_msg()\n"},Cb=function(e,t){return['mqtt_client.decode("utf-8").split("/")[-1]',t.ORDER_ATOMIC]},Ob=function(e,t){return['mqtt_client.decode("utf-8")',t.ORDER_ATOMIC]},Mb=function(e,t){return t.definitions_.import_mixpy="import mixpy",["mixpy.format_content("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+", mqtt_client.client_id)",t.ORDER_ATOMIC]},kb=function(e,t){return t.definitions_.import_mixpy="import mixpy",["mixpy.format_str("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Rb=function(e,t){t.definitions_.import_mixiot="import mixiot";var n=t.valueToCode(this,"SERVER",t.ORDER_ATOMIC),i=t.valueToCode(this,"KEY",t.ORDER_ATOMIC),r=Math.round(new Date).toString(),s="f'python-mqtt-"+i.replace("'","").replace("'","")+r.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_mixly_key("+n+", 1883 ,"+i+", "+s+")\n"},Nb=function(e,t){return[this.getFieldValue("VISITOR_ID"),t.ORDER_ATOMIC]},Db=function(e,t){return["'"+this.getFieldValue("VISITOR_ID")+"'",t.ORDER_ATOMIC]},Fb=function(e,t){t.definitions_.import_mixiot="import mixiot";var n=t.valueToCode(this,"SERVER",t.ORDER_ATOMIC),i=t.valueToCode(this,"KEY",t.ORDER_ATOMIC),r=Math.round(new Date).toString(),s="f'python-mqtt-"+i.replace("'","").replace("'","")+r.replace("'","").replace("'","")+"'";return"mqtt_client = mixiot.MixIO.from_share_key("+n+", 1883 ,"+i+", "+s+")\n"},Lb=function(e,t){t.definitions_.import_mixiot="import mixiot";return["mqtt_client.pingSync()",t.ORDER_ATOMIC]},Pb=function(e,t){return t.definitions_.import_mixiot="import mixiot",["mixiot.ntp("+t.valueToCode(this,"addr",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Bb=function(e,t){return[this.getFieldValue("PIN"),t.ORDER_ATOMIC]},$b=Bb,Ub=Bb,Vb=Bb,zb=Bb,jb=function(e,t){t.definitions_.import_serial="import serial";var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0",i=t.variableDB_.getName(this.getFieldValue("SER"),Ve.Variables.NAME_TYPE),r=this.getFieldValue("BPS");return i+' = serial.Serial("'+ze.JSFuncs.getCom()+'", '+r+", timeout="+n+")\n"},Yb=function(e,t){return t.definitions_.import_serial="import serial",(t.valueToCode(this,"SER",t.ORDER_ADDITIVE)||"ser")+".write("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||'""')+")\n"},Gb=function(e,t){return t.definitions_.import_serial="import serial",[(t.valueToCode(this,"SER",t.ORDER_ADDITIVE)||"ser")+".read("+(t.valueToCode(this,"VAR",t.ORDER_ATOMIC)||"0")+")",t.ORDER_ATOMIC]},Hb=function(e,t){return t.definitions_.import_serial="import serial",(t.valueToCode(this,"SER",t.ORDER_ADDITIVE)||"ser")+".close()\n"},Wb=function(e,t){var n=t.valueToCode(this,"n_samples",t.ORDER_ATOMIC)||"100",i=t.valueToCode(this,"n_features",t.ORDER_ATOMIC)||"20",r=t.valueToCode(this,"n_informative",t.ORDER_ATOMIC)||"2",s=t.valueToCode(this,"n_redundant",t.ORDER_ATOMIC)||"2",o=t.valueToCode(this,"n_repeated",t.ORDER_ATOMIC)||"0",a=t.valueToCode(this,"n_classes",t.ORDER_ATOMIC)||"2",l=t.valueToCode(this,"n_clusters_per_class",t.ORDER_ATOMIC)||"2",u=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_make_classification="from sklearn.datasets import make_classification",["make_classification(n_samples="+n+", n_features="+i+", n_informative="+r+", n_redundant="+s+", n_repeated="+o+", n_classes="+a+", n_clusters_per_class="+l+", random_state="+u+")",t.ORDER_ATOMIC]},Xb=function(e,t){var n=t.valueToCode(this,"n_samples",t.ORDER_ATOMIC)||"100",i=t.valueToCode(this,"n_features",t.ORDER_ATOMIC)||"100",r=t.valueToCode(this,"n_informative",t.ORDER_ATOMIC)||"10",s=t.valueToCode(this,"n_targets",t.ORDER_ATOMIC)||"1",o=t.valueToCode(this,"bias",t.ORDER_ATOMIC)||"0.0",a=t.valueToCode(this,"noise",t.ORDER_ATOMIC)||"0.0",l=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_make_regression="from sklearn.datasets import make_regression",["make_regression(n_samples="+n+", n_features="+i+", n_informative="+r+", n_targets="+s+", bias="+o+", noise="+a+", random_state="+l+")",t.ORDER_ATOMIC]},qb=function(e,t){var n=t.valueToCode(this,"n_samples",t.ORDER_ATOMIC)||"100",i=t.valueToCode(this,"n_features",t.ORDER_ATOMIC)||"2",r=t.valueToCode(this,"centers",t.ORDER_ATOMIC)||"None",s=t.valueToCode(this,"cluster_std",t.ORDER_ATOMIC)||"1.0",o=t.valueToCode(this,"center_box",t.ORDER_ATOMIC)||"(-10.0,10.0)",a=t.valueToCode(this,"shuffle",t.ORDER_ATOMIC)||"True",l=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_make_blobs="from sklearn.datasets import make_blobs",["make_blobs(n_samples="+n+", n_features="+i+", centers="+r+", cluster_std="+s+", center_box="+o+", shuffle="+a+", random_state="+l+")",t.ORDER_ATOMIC]},Kb=function(e,t){var n=this.getFieldValue("type"),i=this.getFieldValue("name");return t.definitions_.import_sklearn_datasets="from sklearn import datasets",i+" = datasets."+n+"()\n"},Zb=function(e,t){return[(t.valueToCode(this,"name",t.ORDER_ATOMIC)||"iris")+"."+this.getFieldValue("type"),t.ORDER_ATOMIC]},Qb=function(e,t){var n=t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"iris_X",i=t.valueToCode(this,"train_target",t.ORDER_ATOMIC)||"iris_y",r=t.valueToCode(this,"test_size",t.ORDER_ATOMIC)||"0.3",s=t.valueToCode(this,"rondom_state",t.ORDER_ATOMIC)||"None";if(t.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split","None"==i)var o="train_test_split("+n+", test_size="+r+", random_state="+s+")";else o="train_test_split("+n+", "+i+", test_size="+r+", random_state="+s+")";return[o,t.ORDER_ATOMIC]},Jb=function(e,t){var n=t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"iris_X",i=t.valueToCode(this,"test_size",t.ORDER_ATOMIC)||"0.3",r=t.valueToCode(this,"rondom_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_train_test_split="from sklearn.model_selection import train_test_split",["train_test_split("+n+", test_size="+i+", random_state="+r+")",t.ORDER_ATOMIC]},eT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"fit_intercept",t.ORDER_ATOMIC)||"True",r=t.valueToCode(this,"normalize",t.ORDER_ATOMIC)||"False",s=t.valueToCode(this,"n_jobs",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_linear_model="from sklearn.linear_model import LinearRegression",n+" = LinearRegression(fit_intercept="+i+", normalize="+r+", n_jobs="+s+")\n"},tT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"alpha",t.ORDER_ATOMIC)||"1.0",r=t.valueToCode(this,"fit_intercept",t.ORDER_ATOMIC)||"True",s=t.valueToCode(this,"normalize",t.ORDER_ATOMIC)||"False",o=t.valueToCode(this,"max_iter",t.ORDER_ATOMIC)||"300",a=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_linear_model="from sklearn.linear_model import Ridge",n+" = Ridge(alpha="+i+", fit_intercept="+r+", normalize="+s+", max_iter="+o+", random_state="+a+")\n"},nT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=this.getFieldValue("type"),r=t.valueToCode(this,"max_depth",t.ORDER_ATOMIC)||"None",s=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_["import_sklearn_"+i]="from sklearn.tree import "+i,n+" = "+i+"(max_depth="+r+", random_state="+s+")\n"},iT=function(e,t){var n=this.getFieldValue("type"),i=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"Model",r=t.valueToCode(this,"n_estimators",t.ORDER_ATOMIC)||"100",s=t.valueToCode(this,"max_depth",t.ORDER_ATOMIC)||"None",o=t.valueToCode(this,"n_jobs",t.ORDER_ATOMIC)||"None",a=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_["import_sklearn_"+n]="from sklearn.ensemble import "+n,i+" = "+n+"(n_estimators="+r+", max_depth="+s+", n_jobs="+o+", random_state="+a+")\n"},rT=function(e,t){var n=this.getFieldValue("type"),i=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",r=t.valueToCode(this,"K",t.ORDER_ATOMIC)||"5",s=t.valueToCode(this,"n_jobs",t.ORDER_ATOMIC)||"None";return t.definitions_["import_sklearn_"+n]="from sklearn.neighbors import "+n,i+" = "+n+"(n_neighbors="+r+", n_jobs="+s+")\n"},sT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model";return t.definitions_.import_sklearn_GaussianNB="from sklearn.naive_bayes import GaussianNB",n+" = GaussianNB()\n"},oT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"pca",i=t.valueToCode(this,"n_components",t.ORDER_ATOMIC)||"2";return t.definitions_.import_sklearn_pca="from sklearn.decomposition import PCA",n+" = PCA(n_components="+i+")\n"},aT=function(e,t){return[t.valueToCode(e,"model_name",t.ORDER_ATOMIC)+".fit_transform("+t.valueToCode(e,"train_data",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},lT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"n_clusters",t.ORDER_ATOMIC)||"8",r=t.valueToCode(this,"max_iter",t.ORDER_ATOMIC)||"300",s=t.valueToCode(this,"random_state",t.ORDER_ATOMIC)||"None";return t.definitions_.import_sklearn_KMeans="from sklearn.cluster import KMeans",n+" = KMeans(n_clusters="+i+", max_iter="+r+", random_state="+s+")\n"},uT=function(e,t){return t.valueToCode(e,"model_name",t.ORDER_ATOMIC)+".fit("+t.valueToCode(e,"train_data",t.ORDER_ATOMIC)+")\n"},cT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"X_train",r=t.valueToCode(this,"train_target",t.ORDER_ATOMIC)||"y_train";if("None"==r)var s=n+".fit("+i+")\n";else s=n+".fit("+i+", "+r+")\n";return s},dT=function(e,t){return(t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model")+".fit("+(t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"X_train")+")\n"},hT=function(e,t){return[(t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model")+".predict("+(t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"X_test")+")",t.ORDER_ATOMIC]},pT=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"X_train",r=t.valueToCode(this,"train_target",t.ORDER_ATOMIC)||"y_train";if("None"==r)var s=n+".score("+i+")";else s=n+".score("+i+", "+r+")";return[s,t.ORDER_ATOMIC]},fT=function(e,t){return[(t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model")+".score("+(t.valueToCode(this,"train_data",t.ORDER_ATOMIC)||"X_train")+")",t.ORDER_ATOMIC]},mT=function(e,t){return[(t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),t.ORDER_ATOMIC]},gT=function(e,t){return[(t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model")+"."+this.getFieldValue("type"),t.ORDER_ATOMIC]},_T=function(e,t){var n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=this.getFieldValue("type"),r=t.valueToCode(this,"address",t.ORDER_ATOMIC)||"D:/mixly/test.pkl";t.definitions_.import_sklearn_joblib="import joblib";return"dump"==i?"joblib.dump("+n+", "+r+")\n":n+" = joblib.load("+r+")\n"},yT=function(e,t){t.definitions_.import_time="import time";return["time.time()",t.ORDER_ATOMIC]},vT=function(){return"exit()\n"},bT=function(e,t){t.definitions_.import_time="import time";var n=this.getFieldValue("op"),i="time.localtime()["+n+"]";if("all"===n){return["time.localtime()",t.ORDER_ASSIGNMENT]}return[i,t.ORDER_ASSIGNMENT]},TT=function(e,t){return t.definitions_.import_turtle="import turtle",t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = turtle.Turtle()\n"},xT=function(e,t){t.definitions_.import_turtle="import turtle";return"turtle.done()\n"},ET=function(e,t){t.definitions_.import_turtle="import turtle";return"turtle.exitonclick()\n"},wT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},IT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},AT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".setheading("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+")\n"},ST=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".screen.delay("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+")\n"},CT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".goto("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+","+(t.valueToCode(this,"val",t.ORDER_ASSIGNMENT)||"0")+")\n"},OT=function(e,t){return t.definitions_.import_turtle="import turtle",[(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()",t.ORDER_ATOMIC]},MT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".stamp()\n"},kT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},RT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},NT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"_fill()\n"},DT=function(e,t){return t.definitions_.import_turtle="import turtle",this.getFieldValue("TUR")+"."+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},FT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".pensize("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+")\n"},LT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".speed("+(t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0")+")\n"},PT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},BT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".set"+this.getFieldValue("DIR")+"("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},$T=function(e,t){t.definitions_.import_turtle="import turtle";var n=t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"data",t.ORDER_ASSIGNMENT)||"0";return n+".circle ("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+i+")\n"},UT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+"."+this.getFieldValue("DIR")+"()\n"},VT=function(e,t){return t.definitions_.import_turtle="import turtle",'turtle.bgcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},zT=function(e,t){t.definitions_.import_turtle="import turtle";return`turtle.title(${t.valueToCode(this,"TITLE",t.ORDER_ASSIGNMENT)||"Mixly"})\n`},jT=function(e,t){t.definitions_.import_turtle="import turtle";return`turtle.setup(width=${t.valueToCode(this,"WIDTH",t.ORDER_ASSIGNMENT)||"1"}, height=${t.valueToCode(this,"HEIGHT",t.ORDER_ASSIGNMENT)||"None"})\n`},YT=function(e,t){t.definitions_.import_turtle="import turtle";return`turtle.tracer(${t.valueToCode(this,"STEP",t.ORDER_ASSIGNMENT)||"1"}, delay=${t.valueToCode(this,"DELAY",t.ORDER_ASSIGNMENT)||"None"})\n`},GT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+'.pencolor("'+this.getFieldValue("FIELDNAME")+'")\n'},HT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+'.fillcolor("'+this.getFieldValue("FIELDNAME")+'")\n'},WT=function(e,t){return t.definitions_.import_turtle="import turtle",[(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".clone()",t.ORDER_ATOMIC]},XT=function(e,t){return t.definitions_.import_turtle="import turtle","turtle.bgcolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},qT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".pencolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},KT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".fillcolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},ZT=function(e,t){return t.definitions_.import_turtle="import turtle","turtle.bgcolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},QT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".pencolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},JT=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".fillcolor("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},ex=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".color("+t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+","+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+")\n"},tx=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+'.color("'+this.getFieldValue("FIELDNAME")+'","'+this.getFieldValue("FIELDNAME2")+'")\n'},nx=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".shape('"+this.getFieldValue("DIR")+"')\n"},ix=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".shapesize("+(t.valueToCode(this,"WID",t.ORDER_ASSIGNMENT)||"0")+","+(t.valueToCode(this,"LEN",t.ORDER_ASSIGNMENT)||"0")+","+(t.valueToCode(this,"OUTLINE",t.ORDER_ASSIGNMENT)||"0")+")\n"},rx=function(e,t){return t.definitions_.import_turtle="import turtle",["turtle.textinput("+t.valueToCode(this,"TITLE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PROMPT",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},sx=function(e,t){return t.definitions_.import_turtle="import turtle",["turtle.numinput("+t.valueToCode(this,"TITLE",t.ORDER_ATOMIC)+","+t.valueToCode(this,"PROMPT",t.ORDER_ATOMIC)+","+t.valueToCode(this,"DEFAULT",t.ORDER_ATOMIC)+",minval = "+t.valueToCode(this,"MIN",t.ORDER_ATOMIC)+",maxval = "+t.valueToCode(this,"MAX",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},ox=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".write("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+")\n"},ax=function(e,t){t.definitions_.import_turtle="import turtle";var n=this.getFieldValue("MOVE"),i=this.getFieldValue("ALIGN"),r=t.valueToCode(this,"FONTNAME",t.ORDER_ATOMIC),s=t.valueToCode(this,"FONTNUM",t.ORDER_ASSIGNMENT)||"0",o=this.getFieldValue("FONTTYPE");return(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".write("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+n+',align="'+i+'",font=('+r+","+s+',"'+o+'"))\n'},lx=function(e,t){t.definitions_.import_turtle="import turtle";var n=this.getFieldValue("MOVE"),i=this.getFieldValue("ALIGN"),r=t.valueToCode(this,"FONTNAME",t.ORDER_ATOMIC),s=t.valueToCode(this,"FONTNUM",t.ORDER_ASSIGNMENT)||"0",o=this.getFieldValue("FONTTYPE");return(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".write("+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+","+n+',align="'+i+'",font=('+r+","+s+',"'+o+'"))\n'},ux=function(e,t){return['"'+this.getFieldValue("COLOR")+'"',t.ORDER_ATOMIC]},cx=function(e,t){t.definitions_.import_turtle="import turtle";var n=t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0";return t.variableDB_.getName(this.getFieldValue("VAR"),Ve.Variables.NAME_TYPE)+" = "+n+".getscreen()\n"},dx=function(e,t){return t.definitions_.import_turtle="import turtle",`${t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0"}.update()\n`},hx=function(e,t){t.definitions_.import_turtle="import turtle";var n=t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return n+".onkey("+(t.valueToCode(this,"callback",t.ORDER_NONE)||"None")+", "+i+")\n"},px=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".onclick("+(t.valueToCode(this,"callback",t.ORDER_NONE)||"None")+")\n"},fx=function(e,t){t.definitions_.import_turtle="import turtle";var n=t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0",i=t.valueToCode(this,"VAR",t.ORDER_NONE)||"None";return n+".ontimer("+(t.valueToCode(this,"callback",t.ORDER_NONE)||"None")+", "+i+")\n"},mx=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".listen()\n"},gx=function(e,t){return t.definitions_.import_turtle="import turtle",(t.valueToCode(this,"TUR",t.ORDER_ASSIGNMENT)||"0")+".getcanvas().postscript(file="+t.valueToCode(this,"FILE",t.ORDER_ATOMIC)+")\n"},_x={init:function(){this.appendDummyInput().appendField("sklearn "+Ve.Msg.SKLEARN_LINEARREGRESSION_INIT),this.appendValueInput("model_name").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.MODEL_NAME),this.appendValueInput("fit_intercept").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_CALCULATE_MODEL_INTERRUPT),this.appendValueInput("n_jobs").setCheck(null).setAlign(Ve.inputs.Align.RIGHT).appendField(Ve.Msg.SKLEARN_THREADS),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(80),this.setTooltip(""),this.setHelpUrl("")}},yx=function(e,t){const n=t.valueToCode(this,"model_name",t.ORDER_ATOMIC)||"model",i=t.valueToCode(this,"fit_intercept",t.ORDER_ATOMIC)||"True",r=t.valueToCode(this,"n_jobs",t.ORDER_ATOMIC)||"None";t.definitions_.import_sklearn_linear_model="from sklearn.linear_model import LinearRegression";return n+" = LinearRegression(fit_intercept="+i+", n_jobs="+r+")\n"},vx="#1216ab";Ve.Blocks.tensorflow_init_tensor={init:function(){this.appendValueInput("VAR").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_INIT_TENSOR),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_sequential={init:function(){this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_SEQUENTIAL),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_layers_dense={init:function(){this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_INIT_LAYERS_DENSE_LAYER),this.appendValueInput("VAR1").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_OUTPUT_DIMENSION),this.appendValueInput("VAR2").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_INPUT_SHAPE),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_add={init:function(){this.appendValueInput("VAR1").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_MODEL),this.appendValueInput("VAR2").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_ADD_LAYER),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_compile={init:function(){this.appendValueInput("VAR1").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_COMPILE_MODEL),this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_LOSS_FUNCTION_TYPE).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TENSORFLOW_MEAN_SQUARED_ERROR,"meanSquaredError"]]),"VAR2"),this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_OPTIMIZER).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TENSORFLOW_SGD,"sgd"]]),"VAR3"),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_fit={init:function(){this.appendValueInput("VAR1").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_MODEL),this.appendValueInput("VAR2").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_INPUT_DATA),this.appendValueInput("VAR3").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_TARGET_DATA),this.appendValueInput("VAR4").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_EPOCHS),this.appendValueInput("VAR5").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_VERBOSE),this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_FIT_RETURN_HISTORY),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_get_loss={init:function(){this.appendValueInput("VAR").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_GET_LOSS_FROM_HISTORY),this.appendDummyInput().setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_GET_LOSS_FROM_HISTORY_2),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_predict={init:function(){this.appendValueInput("VAR1").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_PREDICT),this.appendValueInput("VAR2").setCheck(null).setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_PREDICT_INPUT_DATA),this.appendDummyInput().setAlign(Ve.ALIGN_RIGHT).appendField(Ve.Msg.MIXLY_TENSORFLOW_PREDICT_RETURN_RESULT),this.setInputsInline(!1),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_get_tensor_data={init:function(){this.appendValueInput("VAR").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_GET_TENSOR_DATA),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_save_or_export_model={init:function(){this.appendValueInput("NAME1").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_MODEL),this.appendValueInput("NAME2").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_TENSORFLOW_SAVE_MODEL,"save"],[Ve.Msg.MIXLY_TENSORFLOW_EXPORT_MODEL,"export"]]),"NAME").appendField(Ve.Msg.MIXLY_TENSORFLOW_SAVE_MODEL_NAME),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_use_load_model={init:function(){this.appendValueInput("NAME").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_LOAD_MODEL).appendField(Ve.Msg.MIXLY_TENSORFLOW_MODEL_NAME),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}},Ve.Blocks.tensorflow_prepare_picture={init:function(){this.appendValueInput("NAME").setCheck(null).setAlign(Ve.ALIGN_LEFT).appendField(Ve.Msg.MIXLY_TENSORFLOW_PREPARE_PICTURE_TO_TENSOR).appendField(Ve.Msg.MIXLY_TENSORFLOW_PREPARE_PICTURE_READ_PICTURE),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(vx),this.setTooltip(""),this.setHelpUrl("")}};const bx=function(e,t){var n=t.valueToCode(this,"VAR",t.ORDER_ATOMIC);return t.definitions_.import_tensorflow="import tensorflow",["tensorflow.tensor("+n+")",t.ORDER_ATOMIC]},Tx=function(e,t){t.definitions_.import_tensorflow="import tensorflow";return["tensorflow.sequential()",t.ORDER_ATOMIC]},xx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",["tensorflow.layers.dense(units = "+t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+", input_shape = "+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Ex=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+".add("+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+")\n"},wx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+'.compile(loss = "'+this.getFieldValue("VAR2")+'", optimizer = "'+this.getFieldValue("VAR3")+'")\n'},Ix=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",["await "+t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+".fit("+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+", "+t.valueToCode(this,"VAR3",t.ORDER_ATOMIC)+", epochs="+t.valueToCode(this,"VAR4",t.ORDER_ATOMIC)+", verbose="+t.valueToCode(this,"VAR5",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Ax=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",[t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".history.loss",t.ORDER_ATOMIC]},Sx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",[t.valueToCode(this,"VAR1",t.ORDER_ATOMIC)+".predict("+t.valueToCode(this,"VAR2",t.ORDER_ATOMIC)+")",t.ORDER_ATOMIC]},Cx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",["(await "+t.valueToCode(this,"VAR",t.ORDER_ATOMIC)+".data())",t.ORDER_ATOMIC]},Ox=function(e,t){t.definitions_.import_tensorflow="import tensorflow";var n=t.valueToCode(this,"NAME1",t.ORDER_ATOMIC),i=this.getFieldValue("NAME"),r=t.valueToCode(this,"NAME2",t.ORDER_ATOMIC).replace(/^'|'$/g,"");return"export"==i?`await ${n}.save("downloads://${r}")\n`:`await ${n}.save("indexeddb://${r}")\n`},Mx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",[`await tensorflow.load_model("${t.valueToCode(this,"NAME",t.ORDER_ATOMIC).replace(/^'|'$/g,"")}")`,t.ORDER_ATOMIC]},kx=function(e,t){return t.definitions_.import_tensorflow="import tensorflow",t.definitions_.import_numpy="import numpy",t.definitions_.import_PIL="import PIL",[`(await tensorflow.prepare_qmyixtxi(tensorflow.tensor(numpy.array(PIL.Image.open(${t.valueToCode(this,"NAME",t.ORDER_ATOMIC)}).convert('RGB')))))`,t.ORDER_ATOMIC]};var Rx=__webpack_require__(26944);const Nx=$;var Dx=__webpack_require__.n(Nx);
/**
* @vue/shared v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
/*! #__NO_SIDE_EFFECTS__ */
function Fx(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const Lx={},Px=[],Bx=()=>{},$x=()=>!1,Ux=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vx=e=>e.startsWith("onUpdate:"),zx=Object.assign,jx=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Yx=Object.prototype.hasOwnProperty,Gx=(e,t)=>Yx.call(e,t),Hx=Array.isArray,Wx=e=>"[object Map]"===nE(e),Xx=e=>"[object Set]"===nE(e),qx=e=>"[object Date]"===nE(e),Kx=e=>"function"==typeof e,Zx=e=>"string"==typeof e,Qx=e=>"symbol"==typeof e,Jx=e=>null!==e&&"object"==typeof e,eE=e=>(Jx(e)||Kx(e))&&Kx(e.then)&&Kx(e.catch),tE=Object.prototype.toString,nE=e=>tE.call(e),iE=e=>nE(e).slice(8,-1),rE=e=>"[object Object]"===nE(e),sE=e=>Zx(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,oE=Fx(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),aE=Fx("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),lE=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},uE=/-(\w)/g,cE=lE(e=>e.replace(uE,(e,t)=>t?t.toUpperCase():"")),dE=/\B([A-Z])/g,hE=lE(e=>e.replace(dE,"-$1").toLowerCase()),pE=lE(e=>e.charAt(0).toUpperCase()+e.slice(1)),fE=lE(e=>e?`on${pE(e)}`:""),mE=(e,t)=>!Object.is(e,t),gE=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_E=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},yE=e=>{const t=parseFloat(e);return isNaN(t)?e:t},vE=e=>{const t=Zx(e)?Number(e):NaN;return isNaN(t)?e:t};let bE;const TE=()=>bE||(bE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:{});const xE=Fx("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol");function EE(e){if(Hx(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],r=Zx(i)?SE(i):EE(i);if(r)for(const e in r)t[e]=r[e]}return t}if(Zx(e)||Jx(e))return e}const wE=/;(?![^(]*\))/g,IE=/:([^]+)/,AE=/\/\*[^]*?\*\//g;function SE(e){const t={};return e.replace(AE,"").split(wE).forEach(e=>{if(e){const n=e.split(IE);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function CE(e){let t="";if(Zx(e))t=e;else if(Hx(e))for(let n=0;n<e.length;n++){const i=CE(e[n]);i&&(t+=i+" ")}else if(Jx(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function OE(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Zx(t)&&(e.class=CE(t)),n&&(e.style=EE(n)),e}const ME=Fx("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),kE=Fx("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),RE=Fx("annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"),NE=Fx("area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"),DE="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",FE=Fx(DE),LE=Fx(DE+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function PE(e){return!!e||""===e}const BE=Fx("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),$E=Fx("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan");const UE=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function VE(e,t){return e.replace(UE,e=>t?'"'===e?'\\\\\\"':`\\\\${e}`:`\\${e}`)}function zE(e,t){if(e===t)return!0;let n=qx(e),i=qx(t);if(n||i)return!(!n||!i)&&e.getTime()===t.getTime();if(n=Qx(e),i=Qx(t),n||i)return e===t;if(n=Hx(e),i=Hx(t),n||i)return!(!n||!i)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let i=0;n&&i<e.length;i++)n=zE(e[i],t[i]);return n}(e,t);if(n=Jx(e),i=Jx(t),n||i){if(!n||!i)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const i=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(i&&!r||!i&&r||!zE(e[n],t[n]))return!1}}return String(e)===String(t)}function jE(e,t){return e.findIndex(e=>zE(e,t))}const YE=e=>!(!e||!0!==e.__v_isRef),GE=e=>Zx(e)?e:null==e?"":Hx(e)||Jx(e)&&(e.toString===tE||!Kx(e.toString))?YE(e)?GE(e.value):JSON.stringify(e,HE,2):String(e),HE=(e,t)=>YE(t)?HE(e,t.value):Wx(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],i)=>(e[WE(t,i)+" =>"]=n,e),{})}:Xx(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>WE(e))}:Qx(t)?WE(t):!Jx(t)||Hx(t)||rE(t)?t:String(t),WE=(e,t="")=>{var n;return Qx(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let XE,qE;class KE{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=XE,!e&&XE&&(this.index=(XE.scopes||(XE.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=XE;try{return XE=this,e()}finally{XE=t}}else 0}on(){XE=this}off(){XE=this.parent}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}function ZE(e){return new KE(e)}function QE(){return XE}function JE(e,t=!1){XE&&XE.cleanups.push(e)}const ew=new WeakSet;class tw{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,XE&&XE.active&&XE.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,ew.has(this)&&(ew.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||sw(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,bw(this),lw(this);const e=qE,t=gw;qE=this,gw=!0;try{return this.fn()}finally{0,uw(this),qE=e,gw=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)hw(e);this.deps=this.depsTail=void 0,bw(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?ew.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){cw(this)&&this.run()}get dirty(){return cw(this)}}let nw,iw,rw=0;function sw(e,t=!1){if(e.flags|=8,t)return e.next=iw,void(iw=e);e.next=nw,nw=e}function ow(){rw++}function aw(){if(--rw>0)return;if(iw){let e=iw;for(iw=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;nw;){let t=nw;for(nw=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}function lw(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function uw(e){let t,n=e.depsTail,i=n;for(;i;){const e=i.prevDep;-1===i.version?(i===n&&(n=e),hw(i),pw(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=e}e.deps=t,e.depsTail=n}function cw(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(dw(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function dw(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===Tw)return;e.globalVersion=Tw;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!cw(e))return void(e.flags&=-3);const n=qE,i=gw;qE=e,gw=!0;try{lw(e);const n=e.fn(e._value);(0===t.version||mE(n,e._value))&&(e._value=n,t.version++)}catch(e){throw t.version++,e}finally{qE=n,gw=i,uw(e),e.flags&=-3}}function hw(e,t=!1){const{dep:n,prevSub:i,nextSub:r}=e;if(i&&(i.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)hw(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function pw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function fw(e,t){e.effect instanceof tw&&(e=e.effect.fn);const n=new tw(e);t&&zx(n,t);try{n.run()}catch(e){throw n.stop(),e}const i=n.run.bind(n);return i.effect=n,i}function mw(e){e.effect.stop()}let gw=!0;const _w=[];function yw(){_w.push(gw),gw=!1}function vw(){const e=_w.pop();gw=void 0===e||e}function bw(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=qE;qE=void 0;try{t()}finally{qE=e}}}let Tw=0;class xw{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ew{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!qE||!gw||qE===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==qE)t=this.activeLink=new xw(qE,this),qE.deps?(t.prevDep=qE.depsTail,qE.depsTail.nextDep=t,qE.depsTail=t):qE.deps=qE.depsTail=t,ww(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=qE.depsTail,t.nextDep=void 0,qE.depsTail.nextDep=t,qE.depsTail=t,qE.deps===t&&(qE.deps=e)}return t}trigger(e){this.version++,Tw++,this.notify(e)}notify(e){ow();try{0;for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{aw()}}}function ww(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ww(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Iw=new WeakMap,Aw=Symbol(""),Sw=Symbol(""),Cw=Symbol("");function Ow(e,t,n){if(gw&&qE){let t=Iw.get(e);t||Iw.set(e,t=new Map);let i=t.get(n);i||(t.set(n,i=new Ew),i.map=t,i.key=n),i.track()}}function Mw(e,t,n,i,r,s){const o=Iw.get(e);if(!o)return void Tw++;const a=e=>{e&&e.trigger()};if(ow(),"clear"===t)o.forEach(a);else{const r=Hx(e),s=r&&sE(n);if(r&&"length"===n){const e=Number(i);o.forEach((t,n)=>{("length"===n||n===Cw||!Qx(n)&&n>=e)&&a(t)})}else switch((void 0!==n||o.has(void 0))&&a(o.get(n)),s&&a(o.get(Cw)),t){case"add":r?s&&a(o.get("length")):(a(o.get(Aw)),Wx(e)&&a(o.get(Sw)));break;case"delete":r||(a(o.get(Aw)),Wx(e)&&a(o.get(Sw)));break;case"set":Wx(e)&&a(o.get(Aw))}}aw()}function kw(e){const t=yI(e);return t===e?t:(Ow(t,0,Cw),gI(e)?t:t.map(bI))}function Rw(e){return Ow(e=yI(e),0,Cw),e}const Nw={__proto__:null,[Symbol.iterator](){return Dw(this,Symbol.iterator,bI)},concat(...e){return kw(this).concat(...e.map(e=>Hx(e)?kw(e):e))},entries(){return Dw(this,"entries",e=>(e[1]=bI(e[1]),e))},every(e,t){return Lw(this,"every",e,t,void 0,arguments)},filter(e,t){return Lw(this,"filter",e,t,e=>e.map(bI),arguments)},find(e,t){return Lw(this,"find",e,t,bI,arguments)},findIndex(e,t){return Lw(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Lw(this,"findLast",e,t,bI,arguments)},findLastIndex(e,t){return Lw(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Lw(this,"forEach",e,t,void 0,arguments)},includes(...e){return Bw(this,"includes",e)},indexOf(...e){return Bw(this,"indexOf",e)},join(e){return kw(this).join(e)},lastIndexOf(...e){return Bw(this,"lastIndexOf",e)},map(e,t){return Lw(this,"map",e,t,void 0,arguments)},pop(){return $w(this,"pop")},push(...e){return $w(this,"push",e)},reduce(e,...t){return Pw(this,"reduce",e,t)},reduceRight(e,...t){return Pw(this,"reduceRight",e,t)},shift(){return $w(this,"shift")},some(e,t){return Lw(this,"some",e,t,void 0,arguments)},splice(...e){return $w(this,"splice",e)},toReversed(){return kw(this).toReversed()},toSorted(e){return kw(this).toSorted(e)},toSpliced(...e){return kw(this).toSpliced(...e)},unshift(...e){return $w(this,"unshift",e)},values(){return Dw(this,"values",bI)}};function Dw(e,t,n){const i=Rw(e),r=i[t]();return i===e||gI(e)||(r._next=r.next,r.next=()=>{const e=r._next();return e.value&&(e.value=n(e.value)),e}),r}const Fw=Array.prototype;function Lw(e,t,n,i,r,s){const o=Rw(e),a=o!==e&&!gI(e),l=o[t];if(l!==Fw[t]){const t=l.apply(e,s);return a?bI(t):t}let u=n;o!==e&&(a?u=function(t,i){return n.call(this,bI(t),i,e)}:n.length>2&&(u=function(t,i){return n.call(this,t,i,e)}));const c=l.call(o,u,i);return a&&r?r(c):c}function Pw(e,t,n,i){const r=Rw(e);let s=n;return r!==e&&(gI(e)?n.length>3&&(s=function(t,i,r){return n.call(this,t,i,r,e)}):s=function(t,i,r){return n.call(this,t,bI(i),r,e)}),r[t](s,...i)}function Bw(e,t,n){const i=yI(e);Ow(i,0,Cw);const r=i[t](...n);return-1!==r&&!1!==r||!_I(n[0])?r:(n[0]=yI(n[0]),i[t](...n))}function $w(e,t,n=[]){yw(),ow();const i=yI(e)[t].apply(e,n);return aw(),vw(),i}const Uw=Fx("__proto__,__v_isRef,__isVue"),Vw=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(Qx));function zw(e){Qx(e)||(e=String(e));const t=yI(this);return Ow(t,0,e),t.hasOwnProperty(e)}class jw{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!i;if("__v_isReadonly"===t)return i;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(i?r?lI:aI:r?oI:sI).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=Hx(e);if(!i){let e;if(s&&(e=Nw[t]))return e;if("hasOwnProperty"===t)return zw}const o=Reflect.get(e,t,xI(e)?e:n);return(Qx(t)?Vw.has(t):Uw(t))?o:(i||Ow(e,0,t),r?o:xI(o)?s&&sE(t)?o:o.value:Jx(o)?i?dI(o):uI(o):o)}}class Yw extends jw{constructor(e=!1){super(!1,e)}set(e,t,n,i){let r=e[t];if(!this._isShallow){const t=mI(r);if(gI(n)||mI(n)||(r=yI(r),n=yI(n)),!Hx(e)&&xI(r)&&!xI(n))return!t&&(r.value=n,!0)}const s=Hx(e)&&sE(t)?Number(t)<e.length:Gx(e,t),o=Reflect.set(e,t,n,xI(e)?e:i);return e===yI(i)&&(s?mE(n,r)&&Mw(e,"set",t,n):Mw(e,"add",t,n)),o}deleteProperty(e,t){const n=Gx(e,t),i=(e[t],Reflect.deleteProperty(e,t));return i&&n&&Mw(e,"delete",t,void 0),i}has(e,t){const n=Reflect.has(e,t);return Qx(t)&&Vw.has(t)||Ow(e,0,t),n}ownKeys(e){return Ow(e,0,Hx(e)?"length":Aw),Reflect.ownKeys(e)}}class Gw extends jw{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Hw=new Yw,Ww=new Gw,Xw=new Yw(!0),qw=new Gw(!0),Kw=e=>e,Zw=e=>Reflect.getPrototypeOf(e);function Qw(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Jw(e,t){const n={get(n){const i=this.__v_raw,r=yI(i),s=yI(n);e||(mE(n,s)&&Ow(r,0,n),Ow(r,0,s));const{has:o}=Zw(r),a=t?Kw:e?TI:bI;return o.call(r,n)?a(i.get(n)):o.call(r,s)?a(i.get(s)):void(i!==r&&i.get(n))},get size(){const t=this.__v_raw;return!e&&Ow(yI(t),0,Aw),Reflect.get(t,"size",t)},has(t){const n=this.__v_raw,i=yI(n),r=yI(t);return e||(mE(t,r)&&Ow(i,0,t),Ow(i,0,r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,i){const r=this,s=r.__v_raw,o=yI(s),a=t?Kw:e?TI:bI;return!e&&Ow(o,0,Aw),s.forEach((e,t)=>n.call(i,a(e),a(t),r))}};zx(n,e?{add:Qw("add"),set:Qw("set"),delete:Qw("delete"),clear:Qw("clear")}:{add(e){t||gI(e)||mI(e)||(e=yI(e));const n=yI(this);return Zw(n).has.call(n,e)||(n.add(e),Mw(n,"add",e,e)),this},set(e,n){t||gI(n)||mI(n)||(n=yI(n));const i=yI(this),{has:r,get:s}=Zw(i);let o=r.call(i,e);o||(e=yI(e),o=r.call(i,e));const a=s.call(i,e);return i.set(e,n),o?mE(n,a)&&Mw(i,"set",e,n):Mw(i,"add",e,n),this},delete(e){const t=yI(this),{has:n,get:i}=Zw(t);let r=n.call(t,e);r||(e=yI(e),r=n.call(t,e));i&&i.call(t,e);const s=t.delete(e);return r&&Mw(t,"delete",e,void 0),s},clear(){const e=yI(this),t=0!==e.size,n=e.clear();return t&&Mw(e,"clear",void 0,void 0),n}});return["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(e,t,n){return function(...i){const r=this.__v_raw,s=yI(r),o=Wx(s),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,u=r[e](...i),c=n?Kw:t?TI:bI;return!t&&Ow(s,0,l?Sw:Aw),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[c(e[0]),c(e[1])]:c(e),done:t}},[Symbol.iterator](){return this}}}}(i,e,t)}),n}function eI(e,t){const n=Jw(e,t);return(t,i,r)=>"__v_isReactive"===i?!e:"__v_isReadonly"===i?e:"__v_raw"===i?t:Reflect.get(Gx(n,i)&&i in t?n:t,i,r)}const tI={get:eI(!1,!1)},nI={get:eI(!1,!0)},iI={get:eI(!0,!1)},rI={get:eI(!0,!0)};const sI=new WeakMap,oI=new WeakMap,aI=new WeakMap,lI=new WeakMap;function uI(e){return mI(e)?e:pI(e,!1,Hw,tI,sI)}function cI(e){return pI(e,!1,Xw,nI,oI)}function dI(e){return pI(e,!0,Ww,iI,aI)}function hI(e){return pI(e,!0,qw,rI,lI)}function pI(e,t,n,i,r){if(!Jx(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=r.get(e);if(s)return s;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(iE(a));var a;if(0===o)return e;const l=new Proxy(e,2===o?i:n);return r.set(e,l),l}function fI(e){return mI(e)?fI(e.__v_raw):!(!e||!e.__v_isReactive)}function mI(e){return!(!e||!e.__v_isReadonly)}function gI(e){return!(!e||!e.__v_isShallow)}function _I(e){return!!e&&!!e.__v_raw}function yI(e){const t=e&&e.__v_raw;return t?yI(t):e}function vI(e){return!Gx(e,"__v_skip")&&Object.isExtensible(e)&&_E(e,"__v_skip",!0),e}const bI=e=>Jx(e)?uI(e):e,TI=e=>Jx(e)?dI(e):e;function xI(e){return!!e&&!0===e.__v_isRef}function EI(e){return II(e,!1)}function wI(e){return II(e,!0)}function II(e,t){return xI(e)?e:new AI(e,t)}class AI{constructor(e,t){this.dep=new Ew,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:yI(e),this._value=t?e:bI(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||gI(e)||mI(e);e=n?e:yI(e),mE(e,t)&&(this._rawValue=e,this._value=n?e:bI(e),this.dep.trigger())}}function SI(e){e.dep&&e.dep.trigger()}function CI(e){return xI(e)?e.value:e}function OI(e){return Kx(e)?e():CI(e)}const MI={get:(e,t,n)=>"__v_raw"===t?e:CI(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const r=e[t];return xI(r)&&!xI(n)?(r.value=n,!0):Reflect.set(e,t,n,i)}};function kI(e){return fI(e)?e:new Proxy(e,MI)}class RI{constructor(e){this.__v_isRef=!0,this._value=void 0;const t=this.dep=new Ew,{get:n,set:i}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function NI(e){return new RI(e)}function DI(e){const t=Hx(e)?new Array(e.length):{};for(const n in e)t[n]=BI(e,n);return t}class FI{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=Iw.get(e);return n&&n.get(t)}(yI(this._object),this._key)}}class LI{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function PI(e,t,n){return xI(e)?e:Kx(e)?new LI(e):Jx(e)&&arguments.length>1?BI(e,t,n):EI(e)}function BI(e,t,n){const i=e[t];return xI(i)?i:new FI(e,t,n)}class $I{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ew(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Tw-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags||qE===this))return sw(this,!0),!0}get value(){const e=this.dep.track();return dw(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}const UI={GET:"get",HAS:"has",ITERATE:"iterate"},VI={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},zI={},jI=new WeakMap;let YI;function GI(){return YI}function HI(e,t=!1,n=YI){if(n){let t=jI.get(n);t||jI.set(n,t=[]),t.push(e)}else 0}function WI(e,t=1/0,n){if(t<=0||!Jx(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,xI(e))WI(e.value,t,n);else if(Hx(e))for(let i=0;i<e.length;i++)WI(e[i],t,n);else if(Xx(e)||Wx(e))e.forEach(e=>{WI(e,t,n)});else if(rE(e)){for(const i in e)WI(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&WI(e[i],t,n)}return e}
/**
* @vue/runtime-core v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
const XI=[];let qI=!1;function KI(e,...t){if(qI)return;qI=!0,yw();const n=XI.length?XI[XI.length-1].component:null,i=n&&n.appContext.config.warnHandler,r=function(){let e=XI[XI.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const i=e.component&&e.component.parent;e=i&&i.vnode}return t}();if(i)nA(i,n,11,[e+t.map(e=>{var t,n;return null!=(n=null==(t=e.toString)?void 0:t.call(e))?n:JSON.stringify(e)}).join(""),n&&n.proxy,r.map(({vnode:e})=>`at <${sk(n,e.type)}>`).join("\n"),r]);else{const n=[`[Vue warn]: ${e}`,...t];r.length&&n.push("\n",...function(e){const t=[];return e.forEach((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",i=!!e.component&&null==e.component.parent,r=` at <${sk(e.component,e.type,i)}`,s=">"+n;return e.props?[r,...ZI(e.props),s]:[r+s]}(e))}),t}(r)),console.warn(...n)}vw(),qI=!1}function ZI(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...QI(n,e[n]))}),n.length>3&&t.push(" ..."),t}function QI(e,t,n){return Zx(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:xI(t)?(t=QI(e,yI(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Kx(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=yI(t),n?t:[`${e}=`,t])}function JI(e,t){}const eA={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},tA={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function nA(e,t,n,i){try{return i?e(...i):e()}catch(e){rA(e,t,n)}}function iA(e,t,n,i){if(Kx(e)){const r=nA(e,t,n,i);return r&&eE(r)&&r.catch(e=>{rA(e,t,n)}),r}if(Hx(e)){const r=[];for(let s=0;s<e.length;s++)r.push(iA(e[s],t,n,i));return r}}function rA(e,t,n,i=!0){t&&t.vnode;const{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Lx;if(t){let i=t.parent;const s=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const t=i.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,s,o))return;i=i.parent}if(r)return yw(),nA(r,null,10,[e,s,o]),void vw()}!function(e,t,n,i=!0,r=!1){if(r)throw e;console.error(e)}(e,0,0,i,s)}const sA=[];let oA=-1;const aA=[];let lA=null,uA=0;const cA=Promise.resolve();let dA=null;function hA(e){const t=dA||cA;return e?t.then(this?e.bind(this):e):t}function pA(e){if(!(1&e.flags)){const t=yA(e),n=sA[sA.length-1];!n||!(2&e.flags)&&t>=yA(n)?sA.push(e):sA.splice(function(e){let t=oA+1,n=sA.length;for(;t<n;){const i=t+n>>>1,r=sA[i],s=yA(r);s<e||s===e&&2&r.flags?t=i+1:n=i}return t}(t),0,e),e.flags|=1,fA()}}function fA(){dA||(dA=cA.then(vA))}function mA(e){Hx(e)?aA.push(...e):lA&&-1===e.id?lA.splice(uA+1,0,e):1&e.flags||(aA.push(e),e.flags|=1),fA()}function gA(e,t,n=oA+1){for(0;n<sA.length;n++){const t=sA[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;0,sA.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function _A(e){if(aA.length){const e=[...new Set(aA)].sort((e,t)=>yA(e)-yA(t));if(aA.length=0,lA)return void lA.push(...e);for(lA=e,uA=0;uA<lA.length;uA++){const e=lA[uA];0,4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}lA=null,uA=0}}const yA=e=>null==e.id?2&e.flags?-1:1/0:e.id;function vA(e){try{for(oA=0;oA<sA.length;oA++){const e=sA[oA];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),nA(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;oA<sA.length;oA++){const e=sA[oA];e&&(e.flags&=-2)}oA=-1,sA.length=0,_A(),dA=null,(sA.length||aA.length)&&vA(e)}}let bA,TA=[],xA=!1;function EA(e,...t){bA?bA.emit(e,...t):xA||TA.push({event:e,args:t})}function wA(e,t){var n,i;if(bA=e,bA)bA.enabled=!0,TA.forEach(({event:e,args:t})=>bA.emit(e,...t)),TA=[];else if("undefined"!=typeof window&&window.HTMLElement&&!(null==(i=null==(n=window.navigator)?void 0:n.userAgent)?void 0:i.includes("jsdom"))){(t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{wA(e,t)}),setTimeout(()=>{bA||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xA=!0,TA=[])},3e3)}else xA=!0,TA=[]}const IA=OA("component:added"),AA=OA("component:updated"),SA=OA("component:removed"),CA=e=>{bA&&"function"==typeof bA.cleanupBuffer&&!bA.cleanupBuffer(e)&&SA(e)};
/*! #__NO_SIDE_EFFECTS__ */
function OA(e){return t=>{EA(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let MA=null,kA=null;function RA(e){const t=MA;return MA=e,kA=e&&e.type.__scopeId||null,t}function NA(e){kA=e}function DA(){kA=null}const FA=e=>LA;function LA(e,t=MA,n){if(!t)return e;if(e._n)return e;const i=(...n)=>{i._d&&pM(-1);const r=RA(t);let s;try{s=e(...n)}finally{RA(r),i._d&&pM(1)}return __VUE_PROD_DEVTOOLS__&&AA(t),s};return i._n=!0,i._c=!0,i._d=!0,i}function PA(e,t){if(null===MA)return e;const n=tk(MA),i=e.dirs||(e.dirs=[]);for(let e=0;e<t.length;e++){let[r,s,o,a=Lx]=t[e];r&&(Kx(r)&&(r={mounted:r,updated:r}),r.deep&&WI(s),i.push({dir:r,instance:n,value:s,oldValue:void 0,arg:o,modifiers:a}))}return e}function BA(e,t,n,i){const r=e.dirs,s=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];s&&(a.oldValue=s[o].value);let l=a.dir[i];l&&(yw(),iA(l,n,8,[e.el,a,e,t]),vw())}}const $A=Symbol("_vte"),UA=e=>e.__isTeleport,VA=e=>e&&(e.disabled||""===e.disabled),zA=e=>e&&(e.defer||""===e.defer),jA=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,YA=e=>"function"==typeof MathMLElement&&e instanceof MathMLElement,GA=(e,t)=>{const n=e&&e.to;if(Zx(n)){if(t){return t(n)}return null}return n},HA={name:"Teleport",__isTeleport:!0,process(e,t,n,i,r,s,o,a,l,u){const{mc:c,pc:d,pbc:h,o:{insert:p,querySelector:f,createText:m,createComment:g}}=u,_=VA(t.props);let{shapeFlag:y,children:v,dynamicChildren:b}=t;if(null==e){const e=t.el=m(""),u=t.anchor=m("");p(e,n,i),p(u,n,i);const d=(e,t)=>{16&y&&(r&&r.isCE&&(r.ce._teleportTarget=e),c(v,e,t,r,s,o,a,l))},h=()=>{const e=t.target=GA(t.props,f),n=KA(e,t,m,p);e&&("svg"!==o&&jA(e)?o="svg":"mathml"!==o&&YA(e)&&(o="mathml"),_||(d(e,n),qA(t,!1)))};_&&(d(n,u),qA(t,!0)),zA(t.props)?vO(()=>{h(),t.el.__isMounted=!0},s):h()}else{if(zA(t.props)&&!e.el.__isMounted)return void vO(()=>{HA.process(e,t,n,i,r,s,o,a,l,u),delete e.el.__isMounted},s);t.el=e.el,t.targetStart=e.targetStart;const c=t.anchor=e.anchor,p=t.target=e.target,m=t.targetAnchor=e.targetAnchor,g=VA(e.props),y=g?n:p,v=g?c:m;if("svg"===o||jA(p)?o="svg":("mathml"===o||YA(p))&&(o="mathml"),b?(h(e.dynamicChildren,b,y,r,s,o,a),AO(e,t,!0)):l||d(e,t,y,v,r,s,o,a,!1),_)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):WA(t,n,c,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=GA(t.props,f);e&&WA(t,e,null,u,0)}else g&&WA(t,p,m,u,1);qA(t,_)}},remove(e,t,n,{um:i,o:{remove:r}},s){const{shapeFlag:o,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:h}=e;if(d&&(r(u),r(c)),s&&r(l),16&o){const e=s||!VA(h);for(let r=0;r<a.length;r++){const s=a[r];i(s,t,n,e,!!s.dynamicChildren)}}},move:WA,hydrate:function(e,t,n,i,r,s,{o:{nextSibling:o,parentNode:a,querySelector:l,insert:u,createText:c}},d){const h=t.target=GA(t.props,l);if(h){const l=VA(t.props),p=h._lpa||h.firstChild;if(16&t.shapeFlag)if(l)t.anchor=d(o(e),t,a(e),n,i,r,s),t.targetStart=p,t.targetAnchor=p&&o(p);else{t.anchor=o(e);let a=p;for(;a;){if(a&&8===a.nodeType)if("teleport start anchor"===a.data)t.targetStart=a;else if("teleport anchor"===a.data){t.targetAnchor=a,h._lpa=t.targetAnchor&&o(t.targetAnchor);break}a=o(a)}t.targetAnchor||KA(h,t,c,u),d(p&&o(p),t,h,n,i,r,s)}qA(t,l)}return t.anchor&&o(t.anchor)}};function WA(e,t,n,{o:{insert:i},m:r},s=2){0===s&&i(e.targetAnchor,t,n);const{el:o,anchor:a,shapeFlag:l,children:u,props:c}=e,d=2===s;if(d&&i(o,t,n),(!d||VA(c))&&16&l)for(let e=0;e<u.length;e++)r(u[e],t,n,2);d&&i(a,t,n)}const XA=HA;function qA(e,t){const n=e.ctx;if(n&&n.ut){let i,r;for(t?(i=e.el,r=e.anchor):(i=e.targetStart,r=e.targetAnchor);i&&i!==r;)1===i.nodeType&&i.setAttribute("data-v-owner",n.uid),i=i.nextSibling;n.ut()}}function KA(e,t,n,i){const r=t.targetStart=n(""),s=t.targetAnchor=n("");return r[$A]=s,e&&(i(r,e),i(s,e)),s}const ZA=Symbol("_leaveCb"),QA=Symbol("_enterCb");function JA(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return KS(()=>{e.isMounted=!0}),JS(()=>{e.isUnmounting=!0}),e}const eS=[Function,Array],tS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:eS,onEnter:eS,onAfterEnter:eS,onEnterCancelled:eS,onBeforeLeave:eS,onLeave:eS,onAfterLeave:eS,onLeaveCancelled:eS,onBeforeAppear:eS,onAppear:eS,onAfterAppear:eS,onAppearCancelled:eS},nS=e=>{const t=e.subTree;return t.component?nS(t.component):t};function iS(e){let t=e[0];if(e.length>1){let n=!1;for(const i of e)if(i.type!==sM){0,t=i,n=!0;break}}return t}const rS={name:"BaseTransition",props:tS,setup(e,{slots:t}){const n=$M(),i=JA();return()=>{const r=t.default&&cS(t.default(),!0);if(!r||!r.length)return;const s=iS(r),o=yI(e),{mode:a}=o;if(i.isLeaving)return aS(s);const l=lS(s);if(!l)return aS(s);let u=oS(l,o,i,n,e=>u=e);l.type!==sM&&uS(l,u);let c=n.subTree&&lS(n.subTree);if(c&&c.type!==sM&&!yM(l,c)&&nS(n).type!==sM){let e=oS(c,o,i,n);if(uS(c,e),"out-in"===a&&l.type!==sM)return i.isLeaving=!0,e.afterLeave=()=>{i.isLeaving=!1,8&n.job.flags||n.update(),delete e.afterLeave,c=void 0},aS(s);"in-out"===a&&l.type!==sM?e.delayLeave=(e,t,n)=>{sS(i,c)[String(c.key)]=c,e[ZA]=()=>{t(),e[ZA]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{n(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function sS(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function oS(e,t,n,i,r){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:h,onLeave:p,onAfterLeave:f,onLeaveCancelled:m,onBeforeAppear:g,onAppear:_,onAfterAppear:y,onAppearCancelled:v}=t,b=String(e.key),T=sS(n,e),x=(e,t)=>{e&&iA(e,i,9,t)},E=(e,t)=>{const n=t[1];x(e,t),Hx(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:a,beforeEnter(t){let i=l;if(!n.isMounted){if(!s)return;i=g||l}t[ZA]&&t[ZA](!0);const r=T[b];r&&yM(e,r)&&r.el[ZA]&&r.el[ZA](),x(i,[t])},enter(e){let t=u,i=c,r=d;if(!n.isMounted){if(!s)return;t=_||u,i=y||c,r=v||d}let o=!1;const a=e[QA]=t=>{o||(o=!0,x(t?r:i,[e]),w.delayedLeave&&w.delayedLeave(),e[QA]=void 0)};t?E(t,[e,a]):a()},leave(t,i){const r=String(e.key);if(t[QA]&&t[QA](!0),n.isUnmounting)return i();x(h,[t]);let s=!1;const o=t[ZA]=n=>{s||(s=!0,i(),x(n?m:f,[t]),t[ZA]=void 0,T[r]===e&&delete T[r])};T[r]=e,p?E(p,[t,o]):o()},clone(e){const s=oS(e,t,n,i,r);return r&&r(s),s}};return w}function aS(e){if(PS(e))return(e=AM(e)).children=null,e}function lS(e){if(!PS(e))return UA(e.type)&&e.children?iS(e.children):e;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&Kx(n.default))return n.default()}}function uS(e,t){6&e.shapeFlag&&e.component?(e.transition=t,uS(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function cS(e,t=!1,n){let i=[],r=0;for(let s=0;s<e.length;s++){let o=e[s];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:s);o.type===iM?(128&o.patchFlag&&r++,i=i.concat(cS(o.children,t,a))):(t||o.type!==sM)&&i.push(null!=a?AM(o,{key:a}):o)}if(r>1)for(let e=0;e<i.length;e++)i[e].patchFlag=-2;return i}
/*! #__NO_SIDE_EFFECTS__ */function dS(e,t){return Kx(e)?(()=>zx({name:e.name},t,{setup:e}))():e}function hS(){const e=$M();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function pS(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function fS(e){const t=$M(),n=wI(null);if(t){const i=t.refs===Lx?t.refs={}:t.refs;Object.defineProperty(i,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}else 0;return n}function mS(e,t,n,i,r=!1){if(Hx(e))return void e.forEach((e,s)=>mS(e,t&&(Hx(t)?t[s]:t),n,i,r));if(DS(i)&&!r)return void(512&i.shapeFlag&&i.type.__asyncResolved&&i.component.subTree.component&&mS(e,t,n,i.component.subTree));const s=4&i.shapeFlag?tk(i.component):i.el,o=r?null:s,{i:a,r:l}=e;const u=t&&t.r,c=a.refs===Lx?a.refs={}:a.refs,d=a.setupState,h=yI(d),p=d===Lx?()=>!1:e=>Gx(h,e);if(null!=u&&u!==l&&(Zx(u)?(c[u]=null,p(u)&&(d[u]=null)):xI(u)&&(u.value=null)),Kx(l))nA(l,a,12,[o,c]);else{const t=Zx(l),i=xI(l);if(t||i){const a=()=>{if(e.f){const n=t?p(l)?d[l]:c[l]:l.value;r?Hx(n)&&jx(n,s):Hx(n)?n.includes(s)||n.push(s):t?(c[l]=[s],p(l)&&(d[l]=c[l])):(l.value=[s],e.k&&(c[e.k]=l.value))}else t?(c[l]=o,p(l)&&(d[l]=o)):i&&(l.value=o,e.k&&(c[e.k]=o))};o?(a.id=-1,vO(a,n)):a()}else 0}}let gS=!1;const _S=()=>{gS||(console.error("Hydration completed but contains mismatches."),gS=!0)},yS=e=>{if(1===e.nodeType)return(e=>e.namespaceURI.includes("svg")&&"foreignObject"!==e.tagName)(e)?"svg":(e=>e.namespaceURI.includes("MathML"))(e)?"mathml":void 0},vS=e=>8===e.nodeType;function bS(e){const{mt:t,p:n,o:{patchProp:i,createText:r,nextSibling:s,parentNode:o,remove:a,insert:l,createComment:u}}=e,c=(n,i,a,u,y,v=!1)=>{v=v||!!i.dynamicChildren;const b=vS(n)&&"["===n.data,T=()=>f(n,i,a,u,y,b),{type:x,ref:E,shapeFlag:w,patchFlag:I}=i;let A=n.nodeType;i.el=n,__VUE_PROD_DEVTOOLS__&&(_E(n,"__vnode",i,!0),_E(n,"__vueParentComponent",a,!0)),-2===I&&(v=!1,i.dynamicChildren=null);let S=null;switch(x){case rM:3!==A?""===i.children?(l(i.el=r(""),o(n),n),S=n):S=T():(n.data!==i.children&&(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&KI("Hydration text mismatch in",n.parentNode,`\n - rendered on server: ${JSON.stringify(n.data)}\n - expected on client: ${JSON.stringify(i.children)}`),_S(),n.data=i.children),S=s(n));break;case sM:_(n)?(S=s(n),g(i.el=n.content.firstChild,n,a)):S=8!==A||b?T():s(n);break;case oM:if(b&&(A=(n=s(n)).nodeType),1===A||3===A){S=n;const e=!i.children.length;for(let t=0;t<i.staticCount;t++)e&&(i.children+=1===S.nodeType?S.outerHTML:S.data),t===i.staticCount-1&&(i.anchor=S),S=s(S);return b?s(S):S}T();break;case iM:S=b?p(n,i,a,u,y,v):T();break;default:if(1&w)S=1===A&&i.type.toLowerCase()===n.tagName.toLowerCase()||_(n)?d(n,i,a,u,y,v):T();else if(6&w){i.slotScopeIds=y;const e=o(n);if(S=b?m(n):vS(n)&&"teleport start"===n.data?m(n,n.data,"teleport end"):s(n),t(i,e,null,a,u,yS(e),v),DS(i)&&!i.type.__asyncResolved){let t;b?(t=EM(iM),t.anchor=S?S.previousSibling:e.lastChild):t=3===n.nodeType?SM(""):EM("div"),t.el=n,i.component.subTree=t}}else 64&w?S=8!==A?T():i.type.hydrate(n,i,a,u,y,v,e,h):128&w?S=i.type.hydrate(n,i,a,u,yS(o(n)),y,v,e,c):__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&KI("Invalid HostVNode type:",x,`(${typeof x})`)}return null!=E&&mS(E,null,u,i),S},d=(e,t,n,r,s,o)=>{o=o||!!t.dynamicChildren;const{type:l,props:u,patchFlag:c,shapeFlag:d,dirs:p,transition:f}=t,m="input"===l||"option"===l;if(m||-1!==c){p&&BA(t,null,n,"created");let l,y=!1;if(_(e)){y=IO(null,f)&&n&&n.vnode.props&&n.vnode.props.appear;const i=e.content.firstChild;y&&f.beforeEnter(i),g(i,e,n),t.el=e=i}if(16&d&&(!u||!u.innerHTML&&!u.textContent)){let i=h(e.firstChild,t,e,n,r,s,o),l=!1;for(;i;){SS(e,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!l&&(KI("Hydration children mismatch on",e,"\nServer rendered element contains more child nodes than client vdom."),l=!0),_S());const t=i;i=i.nextSibling,a(t)}}else if(8&d){let n=t.children;"\n"!==n[0]||"PRE"!==e.tagName&&"TEXTAREA"!==e.tagName||(n=n.slice(1)),e.textContent!==n&&(SS(e,0)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&KI("Hydration text content mismatch on",e,`\n - rendered on server: ${e.textContent}\n - expected on client: ${t.children}`),_S()),e.textContent=t.children)}if(u)if(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||m||!o||48&c){const r=e.tagName.includes("-");for(const s in u)!__VUE_PROD_HYDRATION_MISMATCH_DETAILS__||p&&p.some(e=>e.dir.created)||!TS(e,s,u[s],t,n)||_S(),(m&&(s.endsWith("value")||"indeterminate"===s)||Ux(s)&&!oE(s)||"."===s[0]||r)&&i(e,s,null,u[s],void 0,n)}else if(u.onClick)i(e,"onClick",null,u.onClick,void 0,n);else if(4&c&&fI(u.style))for(const e in u.style)u.style[e];(l=u&&u.onVnodeBeforeMount)&&DM(l,n,t),p&&BA(t,null,n,"beforeMount"),((l=u&&u.onVnodeMounted)||p||y)&&tM(()=>{l&&DM(l,n,t),y&&f.enter(e),p&&BA(t,null,n,"mounted")},r)}return e.nextSibling},h=(e,t,i,o,a,u,d)=>{d=d||!!t.dynamicChildren;const h=t.children,p=h.length;let f=!1;for(let t=0;t<p;t++){const m=d?h[t]:h[t]=MM(h[t]),g=m.type===rM;e?(g&&!d&&t+1<p&&MM(h[t+1]).type===rM&&(l(r(e.data.slice(m.children.length)),i,s(e)),e.data=m.children),e=c(e,m,o,a,u,d)):g&&!m.children?l(m.el=r(""),i):(SS(i,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!f&&(KI("Hydration children mismatch on",i,"\nServer rendered element contains fewer child nodes than client vdom."),f=!0),_S()),n(null,m,i,null,o,a,yS(i),u))}return e},p=(e,t,n,i,r,a)=>{const{slotScopeIds:c}=t;c&&(r=r?r.concat(c):c);const d=o(e),p=h(s(e),t,d,n,i,r,a);return p&&vS(p)&&"]"===p.data?s(t.anchor=p):(_S(),l(t.anchor=u("]"),d,p),p)},f=(e,t,i,r,l,u)=>{if(SS(e.parentElement,1)||(__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&KI("Hydration node mismatch:\n- rendered on server:",e,3===e.nodeType?"(text)":vS(e)&&"["===e.data?"(start of fragment)":"","\n- expected on client:",t.type),_S()),t.el=null,u){const t=m(e);for(;;){const n=s(e);if(!n||n===t)break;a(n)}}const c=s(e),d=o(e);return a(e),n(null,t,d,c,i,r,yS(d),l),i&&(i.vnode.el=t.el,XO(i,t.el)),c},m=(e,t="[",n="]")=>{let i=0;for(;e;)if((e=s(e))&&vS(e)&&(e.data===t&&i++,e.data===n)){if(0===i)return s(e);i--}return e},g=(e,t,n)=>{const i=t.parentNode;i&&i.replaceChild(e,t);let r=n;for(;r;)r.vnode.el===t&&(r.vnode.el=r.subTree.el=e),r=r.parent},_=e=>1===e.nodeType&&"TEMPLATE"===e.tagName;return[(e,t)=>{if(!t.hasChildNodes())return __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&KI("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,e,t),_A(),void(t._vnode=e);c(t.firstChild,e,null,null,null),_A(),t._vnode=e},c]}function TS(e,t,n,i,r){let s,o,a,l;if("class"===t)a=e.getAttribute("class"),l=CE(n),function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(xS(a||""),xS(l))||(s=2,o="class");else if("style"===t){a=e.getAttribute("style")||"",l=Zx(n)?n:function(e){if(!e)return"";if(Zx(e))return e;let t="";for(const n in e){const i=e[n];(Zx(i)||"number"==typeof i)&&(t+=`${n.startsWith("--")?n:hE(n)}:${i};`)}return t}(EE(n));const t=ES(a),u=ES(l);if(i.dirs)for(const{dir:e,value:t}of i.dirs)"show"!==e.name||t||u.set("display","none");r&&wS(r,i,u),function(e,t){if(e.size!==t.size)return!1;for(const[n,i]of e)if(i!==t.get(n))return!1;return!0}(t,u)||(s=3,o="style")}else(e instanceof SVGElement&&$E(t)||e instanceof HTMLElement&&(LE(t)||BE(t)))&&(LE(t)?(a=e.hasAttribute(t),l=PE(n)):null==n?(a=e.hasAttribute(t),l=!1):(a=e.hasAttribute(t)?e.getAttribute(t):"value"===t&&"TEXTAREA"===e.tagName&&e.value,l=!!function(e){if(null==e)return!1;const t=typeof e;return"string"===t||"number"===t||"boolean"===t}(n)&&String(n)),a!==l&&(s=4,o=t));if(null!=s&&!SS(e,s)){const t=e=>!1===e?"(not rendered)":`${o}="${e}"`;return KI(`Hydration ${AS[s]} mismatch on`,e,`\n - rendered on server: ${t(a)}\n - expected on client: ${t(l)}\n Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.\n You should fix the source of the mismatch.`),!0}return!1}function xS(e){return new Set(e.trim().split(/\s+/))}function ES(e){const t=new Map;for(const n of e.split(";")){let[e,i]=n.split(":");e=e.trim(),i=i&&i.trim(),e&&i&&t.set(e,i)}return t}function wS(e,t,n){const i=e.subTree;if(e.getCssVars&&(t===i||i&&i.type===iM&&i.children.includes(t))){const t=e.getCssVars();for(const e in t)n.set(`--${VE(e,!1)}`,String(t[e]))}t===i&&e.parent&&wS(e.parent,e.vnode,n)}const IS="data-allow-mismatch",AS={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function SS(e,t){if(0===t||1===t)for(;e&&!e.hasAttribute(IS);)e=e.parentElement;const n=e&&e.getAttribute(IS);if(null==n)return!1;if(""===n)return!0;{const e=n.split(",");return!(0!==t||!e.includes("children"))||n.split(",").includes(AS[t])}}const CS=TE().requestIdleCallback||(e=>setTimeout(e,1)),OS=TE().cancelIdleCallback||(e=>clearTimeout(e)),MS=(e=1e4)=>t=>{const n=CS(t,{timeout:e});return()=>OS(n)};const kS=e=>(t,n)=>{const i=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting){i.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element)return function(e){const{top:t,left:n,bottom:i,right:r}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:o}=window;return(t>0&&t<s||i>0&&i<s)&&(n>0&&n<o||r>0&&r<o)}(e)?(t(),i.disconnect(),!1):void i.observe(e)}),()=>i.disconnect()},RS=e=>t=>{if(e){const n=matchMedia(e);if(!n.matches)return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t);t()}},NS=(e=[])=>(t,n)=>{Zx(e)&&(e=[e]);let i=!1;const r=e=>{i||(i=!0,s(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},s=()=>{n(t=>{for(const n of e)t.removeEventListener(n,r)})};return n(t=>{for(const n of e)t.addEventListener(n,r,{once:!0})}),s};const DS=e=>!!e.type.__asyncLoader;
/*! #__NO_SIDE_EFFECTS__ */function FS(e){Kx(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:r=200,hydrate:s,timeout:o,suspensible:a=!0,onError:l}=e;let u,c=null,d=0;const h=()=>{let e;return c||(e=c=t().catch(e=>{if(e=e instanceof Error?e:new Error(String(e)),l)return new Promise((t,n)=>{l(e,()=>t((d++,c=null,h())),()=>n(e),d+1)});throw e}).then(t=>e!==c&&c?c:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),u=t,t)))};return dS({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(e,t,n){const i=s?()=>{const i=s(n,t=>function(e,t){if(vS(e)&&"["===e.data){let n=1,i=e.nextSibling;for(;i;){if(1===i.nodeType){if(!1===t(i))break}else if(vS(i))if("]"===i.data){if(0===--n)break}else"["===i.data&&n++;i=i.nextSibling}}else t(e)}(e,t));i&&(t.bum||(t.bum=[])).push(i)}:n;u?i():h().then(()=>!t.isUnmounted&&i())},get __asyncResolved(){return u},setup(){const e=BM;if(pS(e),u)return()=>LS(u,e);const t=t=>{c=null,rA(t,e,13,!i)};if(a&&e.suspense||WM)return h().then(t=>()=>LS(t,e)).catch(e=>(t(e),()=>i?EM(i,{error:e}):null));const s=EI(!1),l=EI(),d=EI(!!r);return r&&setTimeout(()=>{d.value=!1},r),null!=o&&setTimeout(()=>{if(!s.value&&!l.value){const e=new Error(`Async component timed out after ${o}ms.`);t(e),l.value=e}},o),h().then(()=>{s.value=!0,e.parent&&PS(e.parent.vnode)&&e.parent.update()}).catch(e=>{t(e),l.value=e}),()=>s.value&&u?LS(u,e):l.value&&i?EM(i,{error:l.value}):n&&!d.value?EM(n):void 0}})}function LS(e,t){const{ref:n,props:i,children:r,ce:s}=t.vnode,o=EM(e,i,r);return o.ref=n,o.ce=s,delete t.vnode.ce,o}const PS=e=>e.type.__isKeepAlive,BS={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=$M(),i=n.ctx;if(!i.renderer)return()=>{const e=t.default&&t.default();return e&&1===e.length?e[0]:e};const r=new Map,s=new Set;let o=null;__VUE_PROD_DEVTOOLS__&&(n.__v_cache=r);const a=n.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:d}}}=i,h=d("div");function p(e){GS(e),c(e,n,a,!0)}function f(e){r.forEach((t,n)=>{const i=rk(t.type);i&&!e(i)&&m(n)})}function m(e){const t=r.get(e);!t||o&&yM(t,o)?o&&GS(o):p(t),r.delete(e),s.delete(e)}i.activate=(e,t,n,i,r)=>{const s=e.component;u(e,t,n,0,a),l(s.vnode,e,t,n,s,a,i,e.slotScopeIds,r),vO(()=>{s.isDeactivated=!1,s.a&&gE(s.a);const t=e.props&&e.props.onVnodeMounted;t&&DM(t,s.parent,e)},a),__VUE_PROD_DEVTOOLS__&&IA(s)},i.deactivate=e=>{const t=e.component;CO(t.m),CO(t.a),u(e,h,null,1,a),vO(()=>{t.da&&gE(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&DM(n,t.parent,e),t.isDeactivated=!0},a),__VUE_PROD_DEVTOOLS__&&IA(t)},DO(()=>[e.include,e.exclude],([e,t])=>{e&&f(t=>US(e,t)),t&&f(e=>!US(t,e))},{flush:"post",deep:!0});let g=null;const _=()=>{null!=g&&(qO(n.subTree.type)?vO(()=>{r.set(g,HS(n.subTree))},n.subTree.suspense):r.set(g,HS(n.subTree)))};return KS(_),QS(_),JS(()=>{r.forEach(e=>{const{subTree:t,suspense:i}=n,r=HS(t);if(e.type===r.type&&e.key===r.key){GS(r);const e=r.component.da;return void(e&&vO(e,i))}p(e)})}),()=>{if(g=null,!t.default)return o=null;const n=t.default(),i=n[0];if(n.length>1)return o=null,n;if(!(_M(i)&&(4&i.shapeFlag||128&i.shapeFlag)))return o=null,i;let a=HS(i);if(a.type===sM)return o=null,a;const l=a.type,u=rk(DS(a)?a.type.__asyncResolved||{}:l),{include:c,exclude:d,max:h}=e;if(c&&(!u||!US(c,u))||d&&u&&US(d,u))return a.shapeFlag&=-257,o=a,i;const p=null==a.key?l:a.key,f=r.get(p);return a.el&&(a=AM(a),128&i.shapeFlag&&(i.ssContent=a)),g=p,f?(a.el=f.el,a.component=f.component,a.transition&&uS(a,a.transition),a.shapeFlag|=512,s.delete(p),s.add(p)):(s.add(p),h&&s.size>parseInt(h,10)&&m(s.values().next().value)),a.shapeFlag|=256,o=a,qO(i.type)?i:a}}},$S=BS;function US(e,t){return Hx(e)?e.some(e=>US(e,t)):Zx(e)?e.split(",").includes(t):"[object RegExp]"===nE(e)&&(e.lastIndex=0,e.test(t))}function VS(e,t){jS(e,"a",t)}function zS(e,t){jS(e,"da",t)}function jS(e,t,n=BM){const i=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(WS(t,i,n),n){let e=n.parent;for(;e&&e.parent;)PS(e.parent.vnode)&&YS(i,t,n,e),e=e.parent}}function YS(e,t,n,i){const r=WS(t,e,i,!0);eC(()=>{jx(i[t],r)},n)}function GS(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function HS(e){return 128&e.shapeFlag?e.ssContent:e}function WS(e,t,n=BM,i=!1){if(n){const r=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{yw();const r=zM(n),s=iA(t,n,e,i);return r(),vw(),s});return i?r.unshift(s):r.push(s),s}}const XS=e=>(t,n=BM)=>{WM&&"sp"!==e||WS(e,(...e)=>t(...e),n)},qS=XS("bm"),KS=XS("m"),ZS=XS("bu"),QS=XS("u"),JS=XS("bum"),eC=XS("um"),tC=XS("sp"),nC=XS("rtg"),iC=XS("rtc");function rC(e,t=BM){WS("ec",e,t)}const sC="components",oC="directives";function aC(e,t){return dC(sC,e,!0,t)||e}const lC=Symbol.for("v-ndc");function uC(e){return Zx(e)?dC(sC,e,!1)||e:e||lC}function cC(e){return dC(oC,e)}function dC(e,t,n=!0,i=!1){const r=MA||BM;if(r){const n=r.type;if(e===sC){const e=rk(n,!1);if(e&&(e===t||e===cE(t)||e===pE(cE(t))))return n}const s=hC(r[e]||n[e],t)||hC(r.appContext[e],t);return!s&&i?n:s}}function hC(e,t){return e&&(e[t]||e[cE(t)]||e[pE(cE(t))])}function pC(e,t,n,i){let r;const s=n&&n[i],o=Hx(e);if(o||Zx(e)){let n=!1;o&&fI(e)&&(n=!gI(e),e=Rw(e)),r=new Array(e.length);for(let i=0,o=e.length;i<o;i++)r[i]=t(n?bI(e[i]):e[i],i,void 0,s&&s[i])}else if("number"==typeof e){0,r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,s&&s[n])}else if(Jx(e))if(e[Symbol.iterator])r=Array.from(e,(e,n)=>t(e,n,void 0,s&&s[n]));else{const n=Object.keys(e);r=new Array(n.length);for(let i=0,o=n.length;i<o;i++){const o=n[i];r[i]=t(e[o],o,i,s&&s[i])}}else r=[];return n&&(n[i]=r),r}function fC(e,t){for(let n=0;n<t.length;n++){const i=t[n];if(Hx(i))for(let t=0;t<i.length;t++)e[i[t].name]=i[t].fn;else i&&(e[i.name]=i.key?(...e)=>{const t=i.fn(...e);return t&&(t.key=i.key),t}:i.fn)}return e}function mC(e,t,n={},i,r){if(MA.ce||MA.parent&&DS(MA.parent)&&MA.parent.ce)return"default"!==t&&(n.name=t),uM(),gM(iM,null,[EM("slot",n,i&&i())],64);let s=e[t];s&&s._c&&(s._d=!1),uM();const o=s&&gC(s(n)),a=n.key||o&&o.key,l=gM(iM,{key:(a&&!Qx(a)?a:`_${t}`)+(!o&&i?"_fb":"")},o||(i?i():[]),o&&1===e._?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function gC(e){return e.some(e=>!_M(e)||e.type!==sM&&!(e.type===iM&&!gC(e.children)))?e:null}function _C(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:fE(i)]=e[i];return n}const yC=e=>e?YM(e)?tk(e):yC(e.parent):null,vC=zx(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>yC(e.parent),$root:e=>yC(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?zC(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{pA(e.update)}),$nextTick:e=>e.n||(e.n=hA.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?LO.bind(e):Bx}),bC=(e,t)=>e!==Lx&&!e.__isScriptSetup&&Gx(e,t),TC={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:i,data:r,props:s,accessCache:o,type:a,appContext:l}=e;let u;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return r[t];case 4:return n[t];case 3:return s[t]}else{if(bC(i,t))return o[t]=1,i[t];if(r!==Lx&&Gx(r,t))return o[t]=2,r[t];if((u=e.propsOptions[0])&&Gx(u,t))return o[t]=3,s[t];if(n!==Lx&&Gx(n,t))return o[t]=4,n[t];__VUE_OPTIONS_API__&&!BC||(o[t]=0)}}const c=vC[t];let d,h;return c?("$attrs"===t&&Ow(e.attrs,0,""),c(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==Lx&&Gx(n,t)?(o[t]=4,n[t]):(h=l.config.globalProperties,Gx(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:i,setupState:r,ctx:s}=e;return bC(r,t)?(r[t]=n,!0):i!==Lx&&Gx(i,t)?(i[t]=n,!0):!Gx(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:r,propsOptions:s}},o){let a;return!!n[o]||e!==Lx&&Gx(e,o)||bC(t,o)||(a=s[0])&&Gx(a,o)||Gx(i,o)||Gx(vC,o)||Gx(r.config.globalProperties,o)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:Gx(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};const xC=zx({},TC,{get(e,t){if(t!==Symbol.unscopables)return TC.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!xE(t)});function EC(){return null}function wC(){return null}function IC(e){0}function AC(e){0}function SC(){return null}function CC(){0}function OC(e,t){return null}function MC(){return RC().slots}function kC(){return RC().attrs}function RC(){const e=$M();return e.setupContext||(e.setupContext=ek(e))}function NC(e){return Hx(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function DC(e,t){const n=NC(e);for(const e in t){if(e.startsWith("__skip"))continue;let i=n[e];i?Hx(i)||Kx(i)?i=n[e]={type:i,default:t[e]}:i.default=t[e]:null===i&&(i=n[e]={default:t[e]}),i&&t[`__skip_${e}`]&&(i.skipFactory=!0)}return n}function FC(e,t){return e&&t?Hx(e)&&Hx(t)?e.concat(t):zx({},NC(e),NC(t)):e||t}function LC(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function PC(e){const t=$M();let n=e();return jM(),eE(n)&&(n=n.catch(e=>{throw zM(t),e})),[n,()=>zM(t)]}let BC=!0;function $C(e){const t=zC(e),n=e.proxy,i=e.ctx;BC=!1,t.beforeCreate&&UC(t.beforeCreate,e,"bc");const{data:r,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:d,mounted:h,beforeUpdate:p,updated:f,activated:m,deactivated:g,beforeDestroy:_,beforeUnmount:y,destroyed:v,unmounted:b,render:T,renderTracked:x,renderTriggered:E,errorCaptured:w,serverPrefetch:I,expose:A,inheritAttrs:S,components:C,directives:O,filters:M}=t;if(u&&function(e,t){Hx(e)&&(e=HC(e));for(const n in e){const i=e[n];let r;r=Jx(i)?"default"in i?tO(i.from||n,i.default,!0):tO(i.from||n):tO(i),xI(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(u,i,null),o)for(const e in o){const t=o[e];Kx(t)&&(i[e]=t.bind(n))}if(r){0;const t=r.call(n,n);0,Jx(t)&&(e.data=uI(t))}if(BC=!0,s)for(const e in s){const t=s[e],r=Kx(t)?t.bind(n,n):Kx(t.get)?t.get.bind(n,n):Bx;0;const o=!Kx(t)&&Kx(t.set)?t.set.bind(n):Bx,a=ak({get:r,set:o});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(a)for(const e in a)VC(a[e],i,n,e);if(l){const e=Kx(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{eO(t,e[t])})}function k(e,t){Hx(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&UC(c,e,"c"),k(qS,d),k(KS,h),k(ZS,p),k(QS,f),k(VS,m),k(zS,g),k(rC,w),k(iC,x),k(nC,E),k(JS,y),k(eC,b),k(tC,I),Hx(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})})}else e.exposed||(e.exposed={});T&&e.render===Bx&&(e.render=T),null!=S&&(e.inheritAttrs=S),C&&(e.components=C),O&&(e.directives=O),I&&pS(e)}function UC(e,t,n){iA(Hx(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function VC(e,t,n,i){let r=i.includes(".")?PO(n,i):()=>n[i];if(Zx(e)){const n=t[e];Kx(n)&&DO(r,n)}else if(Kx(e))DO(r,e.bind(n));else if(Jx(e))if(Hx(e))e.forEach(e=>VC(e,t,n,i));else{const i=Kx(e.handler)?e.handler.bind(n):t[e.handler];Kx(i)&&DO(r,i,e)}else 0}function zC(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(e=>jC(l,e,o,!0)),jC(l,t,o)):l=t,Jx(t)&&s.set(t,l),l}function jC(e,t,n,i=!1){const{mixins:r,extends:s}=t;s&&jC(e,s,n,!0),r&&r.forEach(t=>jC(e,t,n,!0));for(const r in t)if(i&&"expose"===r);else{const i=YC[r]||n&&n[r];e[r]=i?i(e[r],t[r]):t[r]}return e}const YC={data:GC,props:qC,emits:qC,methods:XC,computed:XC,beforeCreate:WC,created:WC,beforeMount:WC,mounted:WC,beforeUpdate:WC,updated:WC,beforeDestroy:WC,beforeUnmount:WC,destroyed:WC,unmounted:WC,activated:WC,deactivated:WC,errorCaptured:WC,serverPrefetch:WC,components:XC,directives:XC,watch:function(e,t){if(!e)return t;if(!t)return e;const n=zx(Object.create(null),e);for(const i in t)n[i]=WC(e[i],t[i]);return n},provide:GC,inject:function(e,t){return XC(HC(e),HC(t))}};function GC(e,t){return t?e?function(){return zx(Kx(e)?e.call(this,this):e,Kx(t)?t.call(this,this):t)}:t:e}function HC(e){if(Hx(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function WC(e,t){return e?[...new Set([].concat(e,t))]:t}function XC(e,t){return e?zx(Object.create(null),e,t):t}function qC(e,t){return e?Hx(e)&&Hx(t)?[...new Set([...e,...t])]:zx(Object.create(null),NC(e),NC(null!=t?t:{})):t}function KC(){return{app:null,config:{isNativeTag:$x,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ZC=0;function QC(e,t){return function(n,i=null){Kx(n)||(n=zx({},n)),null==i||Jx(i)||(i=null);const r=KC(),s=new WeakSet,o=[];let a=!1;const l=r.app={_uid:ZC++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:hk,get config(){return r.config},set config(e){0},use:(e,...t)=>(s.has(e)||(e&&Kx(e.install)?(s.add(e),e.install(l,...t)):Kx(e)&&(s.add(e),e(l,...t))),l),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),l),component:(e,t)=>t?(r.components[e]=t,l):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,l):r.directives[e],mount(s,o,u){if(!a){0;const c=l._ceVNode||EM(n,i);return c.appContext=r,!0===u?u="svg":!1===u&&(u=void 0),o&&t?t(c,s):e(c,s,u),a=!0,l._container=s,s.__vue_app__=l,__VUE_PROD_DEVTOOLS__&&(l._instance=c.component,function(e,t){EA("app:init",e,t,{Fragment:iM,Text:rM,Comment:sM,Static:oM})}(l,hk)),tk(c.component)}},onUnmount(e){o.push(e)},unmount(){a&&(iA(o,l._instance,16),e(null,l._container),__VUE_PROD_DEVTOOLS__&&(l._instance=null,function(e){EA("app:unmount",e)}(l)),delete l._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,l),runWithContext(e){const t=JC;JC=l;try{return e()}finally{JC=t}}};return l}}let JC=null;function eO(e,t){if(BM){let n=BM.provides;const i=BM.parent&&BM.parent.provides;i===n&&(n=BM.provides=Object.create(i)),n[e]=t}else 0}function tO(e,t,n=!1){const i=BM||MA;if(i||JC){const r=JC?JC._context.provides:i?null==i.parent?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return n&&Kx(t)?t.call(i&&i.proxy):t}else 0}function nO(){return!!(BM||MA||JC)}const iO={},rO=()=>Object.create(iO),sO=e=>Object.getPrototypeOf(e)===iO;function oO(e,t,n,i){const[r,s]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(oE(l))continue;const u=t[l];let c;r&&Gx(r,c=cE(l))?s&&s.includes(c)?(o||(o={}))[c]=u:n[c]=u:zO(e.emitsOptions,l)||l in i&&u===i[l]||(i[l]=u,a=!0)}if(s){const t=yI(n),i=o||Lx;for(let o=0;o<s.length;o++){const a=s[o];n[a]=aO(r,t,a,i[a],e,!Gx(i,a))}}return a}function aO(e,t,n,i,r,s){const o=e[n];if(null!=o){const e=Gx(o,"default");if(e&&void 0===i){const e=o.default;if(o.type!==Function&&!o.skipFactory&&Kx(e)){const{propsDefaults:s}=r;if(n in s)i=s[n];else{const o=zM(r);i=s[n]=e.call(null,t),o()}}else i=e;r.ce&&r.ce._setProp(n,i)}o[0]&&(s&&!e?i=!1:!o[1]||""!==i&&i!==hE(n)||(i=!0))}return i}const lO=new WeakMap;function uO(e,t,n=!1){const i=__VUE_OPTIONS_API__&&n?lO:t.propsCache,r=i.get(e);if(r)return r;const s=e.props,o={},a=[];let l=!1;if(__VUE_OPTIONS_API__&&!Kx(e)){const i=e=>{l=!0;const[n,i]=uO(e,t,!0);zx(o,n),i&&a.push(...i)};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}if(!s&&!l)return Jx(e)&&i.set(e,Px),Px;if(Hx(s))for(let e=0;e<s.length;e++){0;const t=cE(s[e]);cO(t)&&(o[t]=Lx)}else if(s){0;for(const e in s){const t=cE(e);if(cO(t)){const n=s[e],i=o[t]=Hx(n)||Kx(n)?{type:n}:zx({},n),r=i.type;let l=!1,u=!0;if(Hx(r))for(let e=0;e<r.length;++e){const t=r[e],n=Kx(t)&&t.name;if("Boolean"===n){l=!0;break}"String"===n&&(u=!1)}else l=Kx(r)&&"Boolean"===r.name;i[0]=l,i[1]=u,(l||Gx(i,"default"))&&a.push(t)}}}const u=[o,a];return Jx(e)&&i.set(e,u),u}function cO(e){return"$"!==e[0]&&!oE(e)}const dO=e=>"_"===e[0]||"$stable"===e,hO=e=>Hx(e)?e.map(MM):[MM(e)],pO=(e,t,n)=>{if(t._n)return t;const i=LA((...e)=>hO(t(...e)),n);return i._c=!1,i},fO=(e,t,n)=>{const i=e._ctx;for(const n in e){if(dO(n))continue;const r=e[n];if(Kx(r))t[n]=pO(0,r,i);else if(null!=r){0;const e=hO(r);t[n]=()=>e}}},mO=(e,t)=>{const n=hO(t);e.slots.default=()=>n},gO=(e,t,n)=>{for(const i in t)(n||"_"!==i)&&(e[i]=t[i])},_O=(e,t,n)=>{const i=e.slots=rO();if(32&e.vnode.shapeFlag){const e=t._;e?(gO(i,t,n),n&&_E(i,"_",e,!0)):fO(t,i)}else t&&mO(e,t)},yO=(e,t,n)=>{const{vnode:i,slots:r}=e;let s=!0,o=Lx;if(32&i.shapeFlag){const e=t._;e?n&&1===e?s=!1:gO(r,t,n):(s=!t.$stable,fO(t,r)),o=t}else t&&(mO(e,t),o={default:1});if(s)for(const e in r)dO(e)||null!=o[e]||delete r[e]};const vO=tM;function bO(e){return xO(e)}function TO(e){return xO(e,bS)}function xO(e,t){"boolean"!=typeof __VUE_OPTIONS_API__&&(TE().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(TE().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(TE().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const n=TE();n.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&wA(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:i,remove:r,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:h,setScopeId:p=Bx,insertStaticContent:f}=e,m=(e,t,n,i=null,r=null,s=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!yM(e,t)&&(i=z(e),P(e,r,s,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:u,ref:c,shapeFlag:d}=t;switch(u){case rM:g(e,t,n,i);break;case sM:_(e,t,n,i);break;case oM:null==e&&y(t,n,i,o);break;case iM:S(e,t,n,i,r,s,o,a,l);break;default:1&d?b(e,t,n,i,r,s,o,a,l):6&d?C(e,t,n,i,r,s,o,a,l):(64&d||128&d)&&u.process(e,t,n,i,r,s,o,a,l,G)}null!=c&&r&&mS(c,e&&e.ref,s,t||e,!t)},g=(e,t,n,r)=>{if(null==e)i(t.el=a(t.children),n,r);else{const n=t.el=e.el;t.children!==e.children&&u(n,t.children)}},_=(e,t,n,r)=>{null==e?i(t.el=l(t.children||""),n,r):t.el=e.el},y=(e,t,n,i)=>{[e.el,e.anchor]=f(e.children,t,n,i,e.el,e.anchor)},v=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),r(e),e=n;r(t)},b=(e,t,n,i,r,s,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?T(t,n,i,r,s,o,a,l):w(e,t,r,s,o,a,l)},T=(e,t,n,r,a,l,u,d)=>{let h,p;const{props:f,shapeFlag:m,transition:g,dirs:_}=e;if(h=e.el=o(e.type,l,f&&f.is,f),8&m?c(h,e.children):16&m&&E(e.children,h,null,r,a,EO(e,l),u,d),_&&BA(e,null,r,"created"),x(h,e,e.scopeId,u,r),f){for(const e in f)"value"===e||oE(e)||s(h,e,null,f[e],l,r);"value"in f&&s(h,"value",null,f.value,l),(p=f.onVnodeBeforeMount)&&DM(p,r,e)}__VUE_PROD_DEVTOOLS__&&(_E(h,"__vnode",e,!0),_E(h,"__vueParentComponent",r,!0)),_&&BA(e,null,r,"beforeMount");const y=IO(a,g);y&&g.beforeEnter(h),i(h,t,n),((p=f&&f.onVnodeMounted)||y||_)&&vO(()=>{p&&DM(p,r,e),y&&g.enter(h),_&&BA(e,null,r,"mounted")},a)},x=(e,t,n,i,r)=>{if(n&&p(e,n),i)for(let t=0;t<i.length;t++)p(e,i[t]);if(r){let n=r.subTree;if(t===n||qO(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=r.vnode;x(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},E=(e,t,n,i,r,s,o,a,l=0)=>{for(let u=l;u<e.length;u++){const l=e[u]=a?kM(e[u]):MM(e[u]);m(null,l,t,n,i,r,s,o,a)}},w=(e,t,n,i,r,o,a)=>{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:u,dynamicChildren:d,dirs:h}=t;u|=16&e.patchFlag;const p=e.props||Lx,f=t.props||Lx;let m;if(n&&wO(n,!1),(m=f.onVnodeBeforeUpdate)&&DM(m,n,t,e),h&&BA(t,e,n,"beforeUpdate"),n&&wO(n,!0),(p.innerHTML&&null==f.innerHTML||p.textContent&&null==f.textContent)&&c(l,""),d?I(e.dynamicChildren,d,l,n,i,EO(t,r),o):a||N(e,t,l,null,n,i,EO(t,r),o,!1),u>0){if(16&u)A(l,p,f,n,r);else if(2&u&&p.class!==f.class&&s(l,"class",null,f.class,r),4&u&&s(l,"style",p.style,f.style,r),8&u){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const i=e[t],o=p[i],a=f[i];a===o&&"value"!==i||s(l,i,o,a,r,n)}}1&u&&e.children!==t.children&&c(l,t.children)}else a||null!=d||A(l,p,f,n,r);((m=f.onVnodeUpdated)||h)&&vO(()=>{m&&DM(m,n,t,e),h&&BA(t,e,n,"updated")},i)},I=(e,t,n,i,r,s,o)=>{for(let a=0;a<t.length;a++){const l=e[a],u=t[a],c=l.el&&(l.type===iM||!yM(l,u)||70&l.shapeFlag)?d(l.el):n;m(l,u,c,null,i,r,s,o,!0)}},A=(e,t,n,i,r)=>{if(t!==n){if(t!==Lx)for(const o in t)oE(o)||o in n||s(e,o,t[o],null,r,i);for(const o in n){if(oE(o))continue;const a=n[o],l=t[o];a!==l&&"value"!==o&&s(e,o,l,a,r,i)}"value"in n&&s(e,"value",t.value,n.value,r)}},S=(e,t,n,r,s,o,l,u,c)=>{const d=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;m&&(u=u?u.concat(m):m),null==e?(i(d,n,r),i(h,n,r),E(t.children||[],n,h,s,o,l,u,c)):p>0&&64&p&&f&&e.dynamicChildren?(I(e.dynamicChildren,f,n,s,o,l,u),(null!=t.key||s&&t===s.subTree)&&AO(e,t,!0)):N(e,t,n,h,s,o,l,u,c)},C=(e,t,n,i,r,s,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,i,o,l):O(t,n,i,r,s,o,l):M(e,t,l)},O=(e,t,n,i,r,s,o)=>{const a=e.component=PM(e,i,r);if(PS(e)&&(a.ctx.renderer=G),XM(a,!1,o),a.asyncDep){if(r&&r.registerDep(a,k,o),!e.el){const e=a.subTree=EM(sM);_(null,e,t,n)}}else k(a,e,t,n,r,s,o)},M=(e,t,n)=>{const i=t.component=e.component;if(function(e,t,n){const{props:i,children:r,component:s}=e,{props:o,children:a,patchFlag:l}=t,u=s.emitsOptions;0;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==o&&(i?!o||WO(i,o,u):!!o);if(1024&l)return!0;if(16&l)return i?WO(i,o,u):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==i[n]&&!zO(u,n))return!0}}return!1}(e,t,n)){if(i.asyncDep&&!i.asyncResolved)return void R(i,t,n);i.next=t,i.update()}else t.el=e.el,i.vnode=t},k=(e,t,n,i,r,s,o)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:i,parent:l,vnode:u}=e;{const n=SO(e);if(n)return t&&(t.el=u.el,R(e,t,o)),void n.asyncDep.then(()=>{e.isUnmounted||a()})}let c,h=t;0,wO(e,!1),t?(t.el=u.el,R(e,t,o)):t=u,n&&gE(n),(c=t.props&&t.props.onVnodeBeforeUpdate)&&DM(c,l,t,u),wO(e,!0);const p=jO(e);0;const f=e.subTree;e.subTree=p,m(f,p,d(f.el),z(f),e,r,s),t.el=p.el,null===h&&XO(e,p.el),i&&vO(i,r),(c=t.props&&t.props.onVnodeUpdated)&&vO(()=>DM(c,l,t,u),r),__VUE_PROD_DEVTOOLS__&&AA(e)}else{let o;const{el:a,props:l}=t,{bm:u,m:c,parent:d,root:h,type:p}=e,f=DS(t);if(wO(e,!1),u&&gE(u),!f&&(o=l&&l.onVnodeBeforeMount)&&DM(o,d,t),wO(e,!0),a&&W){const t=()=>{e.subTree=jO(e),W(a,e.subTree,e,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,e,t):t()}else{h.ce&&h.ce._injectChildStyle(p);const o=e.subTree=jO(e);0,m(null,o,n,i,e,r,s),t.el=o.el}if(c&&vO(c,r),!f&&(o=l&&l.onVnodeMounted)){const e=t;vO(()=>DM(o,d,e),r)}(256&t.shapeFlag||d&&DS(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&vO(e.a,r),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&IA(e),t=n=i=null}};e.scope.on();const l=e.effect=new tw(a);e.scope.off();const u=e.update=l.run.bind(l),c=e.job=l.runIfDirty.bind(l);c.i=e,c.id=e.uid,l.scheduler=()=>pA(c),wO(e,!0),u()},R=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:r,attrs:s,vnode:{patchFlag:o}}=e,a=yI(r),[l]=e.propsOptions;let u=!1;if(!(i||o>0)||16&o){let i;oO(e,t,r,s)&&(u=!0);for(const s in a)t&&(Gx(t,s)||(i=hE(s))!==s&&Gx(t,i))||(l?!n||void 0===n[s]&&void 0===n[i]||(r[s]=aO(l,a,s,void 0,e,!0)):delete r[s]);if(s!==a)for(const e in s)t&&Gx(t,e)||(delete s[e],u=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let i=0;i<n.length;i++){let o=n[i];if(zO(e.emitsOptions,o))continue;const c=t[o];if(l)if(Gx(s,o))c!==s[o]&&(s[o]=c,u=!0);else{const t=cE(o);r[t]=aO(l,a,t,c,e,!1)}else c!==s[o]&&(s[o]=c,u=!0)}}u&&Mw(e.attrs,"set","")}(e,t.props,i,n),yO(e,t.children,n),yw(),gA(e),vw()},N=(e,t,n,i,r,s,o,a,l=!1)=>{const u=e&&e.children,d=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:f}=t;if(p>0){if(128&p)return void F(u,h,n,i,r,s,o,a,l);if(256&p)return void D(u,h,n,i,r,s,o,a,l)}8&f?(16&d&&V(u,r,s),h!==u&&c(n,h)):16&d?16&f?F(u,h,n,i,r,s,o,a,l):V(u,r,s,!0):(8&d&&c(n,""),16&f&&E(h,n,i,r,s,o,a,l))},D=(e,t,n,i,r,s,o,a,l)=>{t=t||Px;const u=(e=e||Px).length,c=t.length,d=Math.min(u,c);let h;for(h=0;h<d;h++){const i=t[h]=l?kM(t[h]):MM(t[h]);m(e[h],i,n,null,r,s,o,a,l)}u>c?V(e,r,s,!0,!1,d):E(t,n,i,r,s,o,a,l,d)},F=(e,t,n,i,r,s,o,a,l)=>{let u=0;const c=t.length;let d=e.length-1,h=c-1;for(;u<=d&&u<=h;){const i=e[u],c=t[u]=l?kM(t[u]):MM(t[u]);if(!yM(i,c))break;m(i,c,n,null,r,s,o,a,l),u++}for(;u<=d&&u<=h;){const i=e[d],u=t[h]=l?kM(t[h]):MM(t[h]);if(!yM(i,u))break;m(i,u,n,null,r,s,o,a,l),d--,h--}if(u>d){if(u<=h){const e=h+1,d=e<c?t[e].el:i;for(;u<=h;)m(null,t[u]=l?kM(t[u]):MM(t[u]),n,d,r,s,o,a,l),u++}}else if(u>h)for(;u<=d;)P(e[u],r,s,!0),u++;else{const p=u,f=u,g=new Map;for(u=f;u<=h;u++){const e=t[u]=l?kM(t[u]):MM(t[u]);null!=e.key&&g.set(e.key,u)}let _,y=0;const v=h-f+1;let b=!1,T=0;const x=new Array(v);for(u=0;u<v;u++)x[u]=0;for(u=p;u<=d;u++){const i=e[u];if(y>=v){P(i,r,s,!0);continue}let c;if(null!=i.key)c=g.get(i.key);else for(_=f;_<=h;_++)if(0===x[_-f]&&yM(i,t[_])){c=_;break}void 0===c?P(i,r,s,!0):(x[c-f]=u+1,c>=T?T=c:b=!0,m(i,t[c],n,null,r,s,o,a,l),y++)}const E=b?function(e){const t=e.slice(),n=[0];let i,r,s,o,a;const l=e.length;for(i=0;i<l;i++){const l=e[i];if(0!==l){if(r=n[n.length-1],e[r]<l){t[i]=r,n.push(i);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<l?s=a+1:o=a;l<e[n[s]]&&(s>0&&(t[i]=n[s-1]),n[s]=i)}}s=n.length,o=n[s-1];for(;s-- >0;)n[s]=o,o=t[o];return n}(x):Px;for(_=E.length-1,u=v-1;u>=0;u--){const e=f+u,d=t[e],h=e+1<c?t[e+1].el:i;0===x[u]?m(null,d,n,h,r,s,o,a,l):b&&(_<0||u!==E[_]?L(d,n,h,2):_--)}}},L=(e,t,n,r,s=null)=>{const{el:o,type:a,transition:l,children:u,shapeFlag:c}=e;if(6&c)return void L(e.component.subTree,t,n,r);if(128&c)return void e.suspense.move(t,n,r);if(64&c)return void a.move(e,t,n,G);if(a===iM){i(o,t,n);for(let e=0;e<u.length;e++)L(u[e],t,n,r);return void i(e.anchor,t,n)}if(a===oM)return void(({el:e,anchor:t},n,r)=>{let s;for(;e&&e!==t;)s=h(e),i(e,n,r),e=s;i(t,n,r)})(e,t,n);if(2!==r&&1&c&&l)if(0===r)l.beforeEnter(o),i(o,t,n),vO(()=>l.enter(o),s);else{const{leave:e,delayLeave:r,afterLeave:s}=l,a=()=>i(o,t,n),u=()=>{e(o,()=>{a(),s&&s()})};r?r(o,a,u):u()}else i(o,t,n)},P=(e,t,n,i=!1,r=!1)=>{const{type:s,props:o,ref:a,children:l,dynamicChildren:u,shapeFlag:c,patchFlag:d,dirs:h,cacheIndex:p}=e;if(-2===d&&(r=!1),null!=a&&mS(a,null,n,e,!0),null!=p&&(t.renderCache[p]=void 0),256&c)return void t.ctx.deactivate(e);const f=1&c&&h,m=!DS(e);let g;if(m&&(g=o&&o.onVnodeBeforeUnmount)&&DM(g,t,e),6&c)U(e.component,n,i);else{if(128&c)return void e.suspense.unmount(n,i);f&&BA(e,null,t,"beforeUnmount"),64&c?e.type.remove(e,t,n,G,i):u&&!u.hasOnce&&(s!==iM||d>0&&64&d)?V(u,t,n,!1,!0):(s===iM&&384&d||!r&&16&c)&&V(l,t,n),i&&B(e)}(m&&(g=o&&o.onVnodeUnmounted)||f)&&vO(()=>{g&&DM(g,t,e),f&&BA(e,null,t,"unmounted")},n)},B=e=>{const{type:t,el:n,anchor:i,transition:s}=e;if(t===iM)return void $(n,i);if(t===oM)return void v(e);const o=()=>{r(n),s&&!s.persisted&&s.afterLeave&&s.afterLeave()};if(1&e.shapeFlag&&s&&!s.persisted){const{leave:t,delayLeave:i}=s,r=()=>t(n,o);i?i(e.el,o,r):r()}else o()},$=(e,t)=>{let n;for(;e!==t;)n=h(e),r(e),e=n;r(t)},U=(e,t,n)=>{const{bum:i,scope:r,job:s,subTree:o,um:a,m:l,a:u}=e;CO(l),CO(u),i&&gE(i),r.stop(),s&&(s.flags|=8,P(o,e,t,n)),a&&vO(a,t),vO(()=>{e.isUnmounted=!0},t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve()),__VUE_PROD_DEVTOOLS__&&CA(e)},V=(e,t,n,i=!1,r=!1,s=0)=>{for(let o=s;o<e.length;o++)P(e[o],t,n,i,r)},z=e=>{if(6&e.shapeFlag)return z(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=h(e.anchor||e.el),n=t&&t[$A];return n?h(n):t};let j=!1;const Y=(e,t,n)=>{null==e?t._vnode&&P(t._vnode,null,null,!0):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,gA(),_A(),j=!1)},G={p:m,um:P,m:L,r:B,mt:O,mc:E,pc:N,pbc:I,n:z,o:e};let H,W;return t&&([H,W]=t(G)),{render:Y,hydrate:H,createApp:QC(Y,H)}}function EO({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function wO({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function IO(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function AO(e,t,n=!1){const i=e.children,r=t.children;if(Hx(i)&&Hx(r))for(let e=0;e<i.length;e++){const t=i[e];let s=r[e];1&s.shapeFlag&&!s.dynamicChildren&&((s.patchFlag<=0||32===s.patchFlag)&&(s=r[e]=kM(r[e]),s.el=t.el),n||-2===s.patchFlag||AO(t,s)),s.type===rM&&(s.el=t.el)}}function SO(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:SO(t)}function CO(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const OO=Symbol.for("v-scx"),MO=()=>{{const e=tO(OO);return e}};function kO(e,t){return FO(e,null,t)}function RO(e,t){return FO(e,null,{flush:"post"})}function NO(e,t){return FO(e,null,{flush:"sync"})}function DO(e,t,n){return FO(e,t,n)}function FO(e,t,n=Lx){const{immediate:i,deep:r,flush:s,once:o}=n;const a=zx({},n);const l=t&&i||!t&&"post"!==s;let u;if(WM)if("sync"===s){const e=MO();u=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=Bx,e.resume=Bx,e.pause=Bx,e}const c=BM;a.call=(e,t,n)=>iA(e,c,t,n);let d=!1;"post"===s?a.scheduler=e=>{vO(e,c&&c.suspense)}:"sync"!==s&&(d=!0,a.scheduler=(e,t)=>{t?e():pA(e)}),a.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,c&&(e.id=c.uid,e.i=c))};const h=function(e,t,n=Lx){const{immediate:i,deep:r,once:s,scheduler:o,augmentJob:a,call:l}=n,u=e=>r?e:gI(e)||!1===r||0===r?WI(e,1):WI(e);let c,d,h,p,f=!1,m=!1;if(xI(e)?(d=()=>e.value,f=gI(e)):fI(e)?(d=()=>u(e),f=!0):Hx(e)?(m=!0,f=e.some(e=>fI(e)||gI(e)),d=()=>e.map(e=>xI(e)?e.value:fI(e)?u(e):Kx(e)?l?l(e,2):e():void 0)):d=Kx(e)?t?l?()=>l(e,2):e:()=>{if(h){yw();try{h()}finally{vw()}}const t=YI;YI=c;try{return l?l(e,3,[p]):e(p)}finally{YI=t}}:Bx,t&&r){const e=d,t=!0===r?1/0:r;d=()=>WI(e(),t)}const g=QE(),_=()=>{c.stop(),g&&g.active&&jx(g.effects,c)};if(s&&t){const e=t;t=(...t)=>{e(...t),_()}}let y=m?new Array(e.length).fill(zI):zI;const v=e=>{if(1&c.flags&&(c.dirty||e))if(t){const e=c.run();if(r||f||(m?e.some((e,t)=>mE(e,y[t])):mE(e,y))){h&&h();const n=YI;YI=c;try{const n=[e,y===zI?void 0:m&&y[0]===zI?[]:y,p];l?l(t,3,n):t(...n),y=e}finally{YI=n}}}else c.run()};return a&&a(v),c=new tw(d),c.scheduler=o?()=>o(v,!1):v,p=e=>HI(e,!1,c),h=c.onStop=()=>{const e=jI.get(c);if(e){if(l)l(e,4);else for(const t of e)t();jI.delete(c)}},t?i?v(!0):y=c.run():o?o(v.bind(null,!0),!0):c.run(),_.pause=c.pause.bind(c),_.resume=c.resume.bind(c),_.stop=_,_}(e,t,a);return WM&&(u?u.push(h):l&&h()),h}function LO(e,t,n){const i=this.proxy,r=Zx(e)?e.includes(".")?PO(i,e):()=>i[e]:e.bind(i,i);let s;Kx(t)?s=t:(s=t.handler,n=t);const o=zM(this),a=FO(r,s.bind(i),n);return o(),a}function PO(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function BO(e,t,n=Lx){const i=$M();const r=cE(t);const s=hE(t),o=$O(e,r),a=NI((o,a)=>{let l,u,c=Lx;return NO(()=>{const t=e[r];mE(l,t)&&(l=t,a())}),{get:()=>(o(),n.get?n.get(l):l),set(e){const o=n.set?n.set(e):e;if(!(mE(o,l)||c!==Lx&&mE(e,c)))return;const d=i.vnode.props;d&&(t in d||r in d||s in d)&&(`onUpdate:${t}`in d||`onUpdate:${r}`in d||`onUpdate:${s}`in d)||(l=e,a()),i.emit(`update:${t}`,o),mE(e,o)&&mE(e,c)&&!mE(o,u)&&a(),c=e,u=o}}});return a[Symbol.iterator]=()=>{let e=0;return{next:()=>e<2?{value:e++?o||Lx:a,done:!1}:{done:!0}}},a}const $O=(e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${cE(t)}Modifiers`]||e[`${hE(t)}Modifiers`];function UO(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||Lx;let r=n;const s=t.startsWith("update:"),o=s&&$O(i,t.slice(7));let a;o&&(o.trim&&(r=n.map(e=>Zx(e)?e.trim():e)),o.number&&(r=n.map(yE))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){EA("component:emit",e.appContext.app,e,t,n)}(e,t,r);let l=i[a=fE(t)]||i[a=fE(cE(t))];!l&&s&&(l=i[a=fE(hE(t))]),l&&iA(l,e,6,r);const u=i[a+"Once"];if(u){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,iA(u,e,6,r)}}function VO(e,t,n=!1){const i=t.emitsCache,r=i.get(e);if(void 0!==r)return r;const s=e.emits;let o={},a=!1;if(__VUE_OPTIONS_API__&&!Kx(e)){const i=e=>{const n=VO(e,t,!0);n&&(a=!0,zx(o,n))};!n&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return s||a?(Hx(s)?s.forEach(e=>o[e]=null):zx(o,s),Jx(e)&&i.set(e,o),o):(Jx(e)&&i.set(e,null),null)}function zO(e,t){return!(!e||!Ux(t))&&(t=t.slice(2).replace(/Once$/,""),Gx(e,t[0].toLowerCase()+t.slice(1))||Gx(e,hE(t))||Gx(e,t))}function jO(e){const{type:t,vnode:n,proxy:i,withProxy:r,propsOptions:[s],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:d,data:h,setupState:p,ctx:f,inheritAttrs:m}=e,g=RA(e);let _,y;try{if(4&n.shapeFlag){const e=r||i,t=e;_=MM(u.call(t,e,c,d,p,h,f)),y=a}else{const e=t;0,_=MM(e.length>1?e(d,{attrs:a,slots:o,emit:l}):e(d,null)),y=t.props?a:GO(a)}}catch(t){aM.length=0,rA(t,e,1),_=EM(sM)}let v=_;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=v;e.length&&7&t&&(s&&e.some(Vx)&&(y=HO(y,s)),v=AM(v,y,!1,!0))}return n.dirs&&(v=AM(v,null,!1,!0),v.dirs=v.dirs?v.dirs.concat(n.dirs):n.dirs),n.transition&&uS(v,n.transition),_=v,RA(g),_}function YO(e,t=!0){let n;for(let t=0;t<e.length;t++){const i=e[t];if(!_M(i))return;if(i.type!==sM||"v-if"===i.children){if(n)return;n=i}}return n}const GO=e=>{let t;for(const n in e)("class"===n||"style"===n||Ux(n))&&((t||(t={}))[n]=e[n]);return t},HO=(e,t)=>{const n={};for(const i in e)Vx(i)&&i.slice(9)in t||(n[i]=e[i]);return n};function WO(e,t,n){const i=Object.keys(t);if(i.length!==Object.keys(e).length)return!0;for(let r=0;r<i.length;r++){const s=i[r];if(t[s]!==e[s]&&!zO(n,s))return!0}return!1}function XO({vnode:e,parent:t},n){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.el=e.el),i!==e)break;(e=t.vnode).el=n,t=t.parent}}const qO=e=>e.__isSuspense;let KO=0;const ZO={name:"Suspense",__isSuspense:!0,process(e,t,n,i,r,s,o,a,l,u){if(null==e)!function(e,t,n,i,r,s,o,a,l){const{p:u,o:{createElement:c}}=l,d=c("div"),h=e.suspense=JO(e,r,i,t,d,n,s,o,a,l);u(null,h.pendingBranch=e.ssContent,d,null,i,h,s,o),h.deps>0?(QO(e,"onPending"),QO(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,o),nM(h,e.ssFallback)):h.resolve(!1,!0)}(t,n,i,r,s,o,a,l,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback)return t.suspense=e.suspense,t.suspense.vnode=t,void(t.el=e.el);!function(e,t,n,i,r,s,o,a,{p:l,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const h=t.ssContent,p=t.ssFallback,{activeBranch:f,pendingBranch:m,isInFallback:g,isHydrating:_}=d;if(m)d.pendingBranch=h,yM(h,m)?(l(m,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():g&&(_||(l(f,p,n,i,r,null,s,o,a),nM(d,p)))):(d.pendingId=KO++,_?(d.isHydrating=!1,d.activeBranch=m):u(m,r,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),g?(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0?d.resolve():(l(f,p,n,i,r,null,s,o,a),nM(d,p))):f&&yM(h,f)?(l(f,h,n,i,r,d,s,o,a),d.resolve(!0)):(l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0&&d.resolve()));else if(f&&yM(h,f))l(f,h,n,i,r,d,s,o,a),nM(d,h);else if(QO(t,"onPending"),d.pendingBranch=h,512&h.shapeFlag?d.pendingId=h.component.suspenseId:d.pendingId=KO++,l(null,h,d.hiddenContainer,null,r,d,s,o,a),d.deps<=0)d.resolve();else{const{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):0===e&&d.fallback(p)}}(e,t,n,i,r,o,a,l,u)}},hydrate:function(e,t,n,i,r,s,o,a,l){const u=t.suspense=JO(t,i,n,e.parentNode,document.createElement("div"),null,r,s,o,a,!0),c=l(e,u.pendingBranch=t.ssContent,n,u,s,o);0===u.deps&&u.resolve(!1,!0);return c},normalize:function(e){const{shapeFlag:t,children:n}=e,i=32&t;e.ssContent=eM(i?n.default:n),e.ssFallback=i?eM(n.fallback):EM(sM)}};function QO(e,t){const n=e.props&&e.props[t];Kx(n)&&n()}function JO(e,t,n,i,r,s,o,a,l,u,c=!1){const{p:d,m:h,um:p,n:f,o:{parentNode:m,remove:g}}=u;let _;const y=function(e){const t=e.props&&e.props.suspensible;return null!=t&&!1!==t}(e);y&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const v=e.props?vE(e.props.timeout):void 0;const b=s,T={vnode:e,parent:t,parentComponent:n,namespace:o,container:i,hiddenContainer:r,deps:0,pendingId:KO++,timeout:"number"==typeof v?v:-1,activeBranch:null,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){const{vnode:i,activeBranch:r,pendingBranch:o,pendingId:a,effects:l,parentComponent:u,container:c}=T;let d=!1;T.isHydrating?T.isHydrating=!1:e||(d=r&&o.transition&&"out-in"===o.transition.mode,d&&(r.transition.afterLeave=()=>{a===T.pendingId&&(h(o,c,s===b?f(r):s,0),mA(l))}),r&&(m(r.el)===c&&(s=f(r)),p(r,u,T,!0)),d||h(o,c,s,0)),nM(T,o),T.pendingBranch=null,T.isInFallback=!1;let g=T.parent,v=!1;for(;g;){if(g.pendingBranch){g.effects.push(...l),v=!0;break}g=g.parent}v||d||mA(l),T.effects=[],y&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,0!==t.deps||n||t.resolve()),QO(i,"onResolve")},fallback(e){if(!T.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:i,container:r,namespace:s}=T;QO(t,"onFallback");const o=f(n),u=()=>{T.isInFallback&&(d(null,e,r,o,i,null,s,a,l),nM(T,e))},c=e.transition&&"out-in"===e.transition.mode;c&&(n.transition.afterLeave=u),T.isInFallback=!0,p(n,i,null,!0),c||u()},move(e,t,n){T.activeBranch&&h(T.activeBranch,e,t,n),T.container=e},next:()=>T.activeBranch&&f(T.activeBranch),registerDep(e,t,n){const i=!!T.pendingBranch;i&&T.deps++;const r=e.vnode.el;e.asyncDep.catch(t=>{rA(t,e,0)}).then(s=>{if(e.isUnmounted||T.isUnmounted||T.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:a}=e;qM(e,s,!1),r&&(a.el=r);const l=!r&&e.subTree.el;t(e,a,m(r||e.subTree.el),r?null:f(e.subTree),T,o,n),l&&g(l),XO(e,a.el),i&&0===--T.deps&&T.resolve()})},unmount(e,t){T.isUnmounted=!0,T.activeBranch&&p(T.activeBranch,n,e,t),T.pendingBranch&&p(T.pendingBranch,n,e,t)}};return T}function eM(e){let t;if(Kx(e)){const n=hM&&e._c;n&&(e._d=!1,uM()),e=e(),n&&(e._d=!0,t=lM,cM())}if(Hx(e)){const t=YO(e);0,e=t}return e=MM(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function tM(e,t){t&&t.pendingBranch?Hx(e)?t.effects.push(...e):t.effects.push(e):mA(e)}function nM(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let r=t.el;for(;!r&&t.component;)r=(t=t.component.subTree).el;n.el=r,i&&i.subTree===n&&(i.vnode.el=r,XO(i,r))}const iM=Symbol.for("v-fgt"),rM=Symbol.for("v-txt"),sM=Symbol.for("v-cmt"),oM=Symbol.for("v-stc"),aM=[];let lM=null;function uM(e=!1){aM.push(lM=e?null:[])}function cM(){aM.pop(),lM=aM[aM.length-1]||null}let dM,hM=1;function pM(e,t=!1){hM+=e,e<0&&lM&&t&&(lM.hasOnce=!0)}function fM(e){return e.dynamicChildren=hM>0?lM||Px:null,cM(),hM>0&&lM&&lM.push(e),e}function mM(e,t,n,i,r,s){return fM(xM(e,t,n,i,r,s,!0))}function gM(e,t,n,i,r){return fM(EM(e,t,n,i,r,!0))}function _M(e){return!!e&&!0===e.__v_isVNode}function yM(e,t){return e.type===t.type&&e.key===t.key}function vM(e){dM=e}const bM=({key:e})=>null!=e?e:null,TM=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?Zx(e)||xI(e)||Kx(e)?{i:MA,r:e,k:t,f:!!n}:e:null);function xM(e,t=null,n=null,i=0,r=null,s=(e===iM?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&bM(t),ref:t&&TM(t),scopeId:kA,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:MA};return a?(RM(l,n),128&s&&e.normalize(l)):n&&(l.shapeFlag|=Zx(n)?8:16),hM>0&&!o&&lM&&(l.patchFlag>0||6&s)&&32!==l.patchFlag&&lM.push(l),l}const EM=wM;function wM(e,t=null,n=null,i=0,r=null,s=!1){if(e&&e!==lC||(e=sM),_M(e)){const i=AM(e,t,!0);return n&&RM(i,n),hM>0&&!s&&lM&&(6&i.shapeFlag?lM[lM.indexOf(e)]=i:lM.push(i)),i.patchFlag=-2,i}if(ok(e)&&(e=e.__vccOpts),t){t=IM(t);let{class:e,style:n}=t;e&&!Zx(e)&&(t.class=CE(e)),Jx(n)&&(_I(n)&&!Hx(n)&&(n=zx({},n)),t.style=EE(n))}return xM(e,t,n,i,r,Zx(e)?1:qO(e)?128:UA(e)?64:Jx(e)?4:Kx(e)?2:0,s,!0)}function IM(e){return e?_I(e)||sO(e)?zx({},e):e:null}function AM(e,t,n=!1,i=!1){const{props:r,ref:s,patchFlag:o,children:a,transition:l}=e,u=t?NM(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&bM(u),ref:t&&t.ref?n&&s?Hx(s)?s.concat(TM(t)):[s,TM(t)]:TM(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==iM?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&AM(e.ssContent),ssFallback:e.ssFallback&&AM(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&uS(c,l.clone(c)),c}function SM(e=" ",t=0){return EM(rM,null,e,t)}function CM(e,t){const n=EM(oM,null,e);return n.staticCount=t,n}function OM(e="",t=!1){return t?(uM(),gM(sM,null,e)):EM(sM,null,e)}function MM(e){return null==e||"boolean"==typeof e?EM(sM):Hx(e)?EM(iM,null,e.slice()):_M(e)?kM(e):EM(rM,null,String(e))}function kM(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:AM(e)}function RM(e,t){let n=0;const{shapeFlag:i}=e;if(null==t)t=null;else if(Hx(t))n=16;else if("object"==typeof t){if(65&i){const n=t.default;return void(n&&(n._c&&(n._d=!1),RM(e,n()),n._c&&(n._d=!0)))}{n=32;const i=t._;i||sO(t)?3===i&&MA&&(1===MA.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=MA}}else Kx(t)?(t={default:t,_ctx:MA},n=32):(t=String(t),64&i?(n=16,t=[SM(t)]):n=8);e.children=t,e.shapeFlag|=n}function NM(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)if("class"===e)t.class!==i.class&&(t.class=CE([t.class,i.class]));else if("style"===e)t.style=EE([t.style,i.style]);else if(Ux(e)){const n=t[e],r=i[e];!r||n===r||Hx(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=i[e])}return t}function DM(e,t,n,i=null){iA(e,t,7,[n,i])}const FM=KC();let LM=0;function PM(e,t,n){const i=e.type,r=(t?t.appContext:e.appContext)||FM,s={uid:LM++,vnode:e,type:i,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new KE(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:uO(i,r),emitsOptions:VO(i,r),emit:null,emitted:null,propsDefaults:Lx,inheritAttrs:i.inheritAttrs,ctx:Lx,data:Lx,props:Lx,attrs:Lx,slots:Lx,refs:Lx,setupState:Lx,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=UO.bind(null,s),e.ce&&e.ce(s),s}let BM=null;const $M=()=>BM||MA;let UM,VM;{const e=TE(),t=(t,n)=>{let i;return(i=e[t])||(i=e[t]=[]),i.push(n),e=>{i.length>1?i.forEach(t=>t(e)):i[0](e)}};UM=t("__VUE_INSTANCE_SETTERS__",e=>BM=e),VM=t("__VUE_SSR_SETTERS__",e=>WM=e)}const zM=e=>{const t=BM;return UM(e),e.scope.on(),()=>{e.scope.off(),UM(t)}},jM=()=>{BM&&BM.scope.off(),UM(null)};function YM(e){return 4&e.vnode.shapeFlag}let GM,HM,WM=!1;function XM(e,t=!1,n=!1){t&&VM(t);const{props:i,children:r}=e.vnode,s=YM(e);!function(e,t,n,i=!1){const r={},s=rO();e.propsDefaults=Object.create(null),oO(e,t,r,s);for(const t in e.propsOptions[0])t in r||(r[t]=void 0);n?e.props=i?r:cI(r):e.type.props?e.props=r:e.props=s,e.attrs=s}(e,i,s,t),_O(e,r,n);const o=s?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,TC),!1;const{setup:i}=n;if(i){yw();const n=e.setupContext=i.length>1?ek(e):null,r=zM(e),s=nA(i,e,0,[e.props,n]),o=eE(s);if(vw(),r(),!o&&!e.sp||DS(e)||pS(e),o){if(s.then(jM,jM),t)return s.then(n=>{qM(e,n,t)}).catch(t=>{rA(t,e,0)});e.asyncDep=s}else qM(e,s,t)}else QM(e,t)}(e,t):void 0;return t&&VM(!1),o}function qM(e,t,n){Kx(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Jx(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=kI(t)),QM(e,n)}function KM(e){GM=e,HM=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,xC))}}const ZM=()=>!GM;function QM(e,t,n){const i=e.type;if(!e.render){if(!t&&GM&&!i.render){const t=i.template||__VUE_OPTIONS_API__&&zC(e).template;if(t){0;const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:s,compilerOptions:o}=i,a=zx(zx({isCustomElement:n,delimiters:s},r),o);i.render=GM(t,a)}}e.render=i.render||Bx,HM&&HM(e)}if(__VUE_OPTIONS_API__){const t=zM(e);yw();try{$C(e)}finally{vw(),t()}}}const JM={get:(e,t)=>(Ow(e,0,""),e[t])};function ek(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,JM),slots:e.slots,emit:e.emit,expose:t}}function tk(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(kI(vI(e.exposed)),{get:(t,n)=>n in t?t[n]:n in vC?vC[n](e):void 0,has:(e,t)=>t in e||t in vC})):e.proxy}const nk=/(?:^|[-_])(\w)/g,ik=e=>e.replace(nk,e=>e.toUpperCase()).replace(/[-_]/g,"");function rk(e,t=!0){return Kx(e)?e.displayName||e.name:e.name||t&&e.__name}function sk(e,t,n=!1){let i=rk(t);if(!i&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(i=e[1])}if(!i&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};i=n(e.components||e.parent.type.components)||n(e.appContext.components)}return i?ik(i):n?"App":"Anonymous"}function ok(e){return Kx(e)&&"__vccOpts"in e}const ak=(e,t)=>{const n=function(e,t,n=!1){let i,r;return Kx(e)?i=e:(i=e.get,r=e.set),new $I(i,r,n)}(e,0,WM);return n};function lk(e,t,n){const i=arguments.length;return 2===i?Jx(t)&&!Hx(t)?_M(t)?EM(e,null,[t]):EM(e,t):EM(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&_M(n)&&(n=[n]),EM(e,t,n))}function uk(){return void 0}function ck(e,t,n,i){const r=n[i];if(r&&dk(r,e))return r;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function dk(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(mE(n[e],t[e]))return!1;return hM>0&&lM&&lM.push(e),!0}const hk="3.5.13",pk=Bx,fk=tA,mk=bA,gk=wA,_k={createComponentInstance:PM,setupComponent:XM,renderComponentRoot:jO,setCurrentRenderingInstance:RA,isVNode:_M,normalizeVNode:MM,getComponentPublicInstance:tk,ensureValidVNode:gC,pushWarningContext:function(e){XI.push(e)},popWarningContext:function(){XI.pop()}},yk=null,vk=null,bk=null;
/**
* @vue/runtime-dom v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
let Tk;const xk="undefined"!=typeof window&&window.trustedTypes;if(xk)try{Tk=xk.createPolicy("vue",{createHTML:e=>e})}catch(e){}const Ek=Tk?e=>Tk.createHTML(e):e=>e,wk="undefined"!=typeof document?document:null,Ik=wk&&wk.createElement("template"),Ak={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const r="svg"===t?wk.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?wk.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?wk.createElement(e,{is:n}):wk.createElement(e);return"select"===e&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:e=>wk.createTextNode(e),createComment:e=>wk.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>wk.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,r,s){const o=n?n.previousSibling:t.lastChild;if(r&&(r===s||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==s&&(r=r.nextSibling););else{Ik.innerHTML=Ek("svg"===i?`<svg>${e}</svg>`:"mathml"===i?`<math>${e}</math>`:e);const r=Ik.content;if("svg"===i||"mathml"===i){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sk="transition",Ck="animation",Ok=Symbol("_vtc"),Mk={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},kk=zx({},tS,Mk),Rk=(e=>(e.displayName="Transition",e.props=kk,e))((e,{slots:t})=>lk(rS,Fk(e),t)),Nk=(e,t=[])=>{Hx(e)?e.forEach(e=>e(...t)):e&&e(...t)},Dk=e=>!!e&&(Hx(e)?e.some(e=>e.length>1):e.length>1);function Fk(e){const t={};for(const n in e)n in Mk||(t[n]=e[n]);if(!1===e.css)return t;const{name:n="v",type:i,duration:r,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=o,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;if(Jx(e))return[Lk(e.enter),Lk(e.leave)];{const t=Lk(e);return[t,t]}}(r),m=f&&f[0],g=f&&f[1],{onBeforeEnter:_,onEnter:y,onEnterCancelled:v,onLeave:b,onLeaveCancelled:T,onBeforeAppear:x=_,onAppear:E=y,onAppearCancelled:w=v}=t,I=(e,t,n,i)=>{e._enterCancelled=i,Bk(e,t?c:a),Bk(e,t?u:o),n&&n()},A=(e,t)=>{e._isLeaving=!1,Bk(e,d),Bk(e,p),Bk(e,h),t&&t()},S=e=>(t,n)=>{const r=e?E:y,o=()=>I(t,e,n);Nk(r,[t,o]),$k(()=>{Bk(t,e?l:s),Pk(t,e?c:a),Dk(r)||Vk(t,i,m,o)})};return zx(t,{onBeforeEnter(e){Nk(_,[e]),Pk(e,s),Pk(e,o)},onBeforeAppear(e){Nk(x,[e]),Pk(e,l),Pk(e,u)},onEnter:S(!1),onAppear:S(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>A(e,t);Pk(e,d),e._enterCancelled?(Pk(e,h),Gk()):(Gk(),Pk(e,h)),$k(()=>{e._isLeaving&&(Bk(e,d),Pk(e,p),Dk(b)||Vk(e,i,g,n))}),Nk(b,[e,n])},onEnterCancelled(e){I(e,!1,void 0,!0),Nk(v,[e])},onAppearCancelled(e){I(e,!0,void 0,!0),Nk(w,[e])},onLeaveCancelled(e){A(e),Nk(T,[e])}})}function Lk(e){return vE(e)}function Pk(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ok]||(e[Ok]=new Set)).add(t)}function Bk(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));const n=e[Ok];n&&(n.delete(t),n.size||(e[Ok]=void 0))}function $k(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Uk=0;function Vk(e,t,n,i){const r=e._endId=++Uk,s=()=>{r===e._endId&&i()};if(null!=n)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=zk(e,t);if(!o)return i();const u=o+"end";let c=0;const d=()=>{e.removeEventListener(u,h),s()},h=t=>{t.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,h)}function zk(e,t){const n=window.getComputedStyle(e),i=e=>(n[e]||"").split(", "),r=i(`${Sk}Delay`),s=i(`${Sk}Duration`),o=jk(r,s),a=i(`${Ck}Delay`),l=i(`${Ck}Duration`),u=jk(a,l);let c=null,d=0,h=0;t===Sk?o>0&&(c=Sk,d=o,h=s.length):t===Ck?u>0&&(c=Ck,d=u,h=l.length):(d=Math.max(o,u),c=d>0?o>u?Sk:Ck:null,h=c?c===Sk?s.length:l.length:0);return{type:c,timeout:d,propCount:h,hasTransform:c===Sk&&/\b(transform|all)(,|$)/.test(i(`${Sk}Property`).toString())}}function jk(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Yk(t)+Yk(e[n])))}function Yk(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function Gk(){return document.body.offsetHeight}const Hk=Symbol("_vod"),Wk=Symbol("_vsh"),Xk={beforeMount(e,{value:t},{transition:n}){e[Hk]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):qk(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),qk(e,!0),i.enter(e)):i.leave(e,()=>{qk(e,!1)}):qk(e,t))},beforeUnmount(e,{value:t}){qk(e,t)}};function qk(e,t){e.style.display=t?e[Hk]:"none",e[Wk]=!t}const Kk=Symbol("");function Zk(e){const t=$M();if(!t)return;const n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Jk(e,n))};const i=()=>{const i=e(t.proxy);t.ce?Jk(t.ce,i):Qk(t.subTree,i),n(i)};ZS(()=>{mA(i)}),KS(()=>{DO(i,Bx,{flush:"post"});const e=new MutationObserver(i);e.observe(t.subTree.el.parentNode,{childList:!0}),eC(()=>e.disconnect())})}function Qk(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Qk(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el)Jk(e.el,t);else if(e.type===iM)e.children.forEach(e=>Qk(e,t));else if(e.type===oM){let{el:n,anchor:i}=e;for(;n&&(Jk(n,t),n!==i);)n=n.nextSibling}}function Jk(e,t){if(1===e.nodeType){const n=e.style;let i="";for(const e in t)n.setProperty(`--${e}`,t[e]),i+=`--${e}: ${t[e]};`;n[Kk]=i}}const eR=/(^|;)\s*display\s*:/;const tR=/\s*!important$/;function nR(e,t,n){if(Hx(n))n.forEach(n=>nR(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=function(e,t){const n=rR[t];if(n)return n;let i=cE(t);if("filter"!==i&&i in e)return rR[t]=i;i=pE(i);for(let n=0;n<iR.length;n++){const r=iR[n]+i;if(r in e)return rR[t]=r}return t}(e,t);tR.test(n)?e.setProperty(hE(i),n.replace(tR,""),"important"):e[i]=n}}const iR=["Webkit","Moz","ms"],rR={};const sR="http://www.w3.org/1999/xlink";function oR(e,t,n,i,r,s=FE(t)){i&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(sR,t.slice(6,t.length)):e.setAttributeNS(sR,t,n):null==n||s&&!PE(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Qx(n)?String(n):n)}function aR(e,t,n,i,r){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?Ek(n):n));const s=e.tagName;if("value"===t&&"PROGRESS"!==s&&!s.includes("-")){const i="OPTION"===s?e.getAttribute("value")||"":e.value,r=null==n?"checkbox"===e.type?"on":"":String(n);return i===r&&"_value"in e||(e.value=r),null==n&&e.removeAttribute(t),void(e._value=n)}let o=!1;if(""===n||null==n){const i=typeof e[t];"boolean"===i?n=PE(n):null==n&&"string"===i?(n="",o=!0):"number"===i&&(n=0,o=!0)}try{e[t]=n}catch(e){0}o&&e.removeAttribute(r||t)}function lR(e,t,n,i){e.addEventListener(t,n,i)}const uR=Symbol("_vei");function cR(e,t,n,i,r=null){const s=e[uR]||(e[uR]={}),o=s[t];if(i&&o)o.value=i;else{const[n,a]=function(e){let t;if(dR.test(e)){let n;for(t={};n=e.match(dR);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):hE(e.slice(2));return[n,t]}(t);if(i){const o=s[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();iA(function(e,t){if(Hx(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=fR(),n}(i,r);lR(e,n,o,a)}else o&&(!function(e,t,n,i){e.removeEventListener(t,n,i)}(e,n,o,a),s[t]=void 0)}}const dR=/(?:Once|Passive|Capture)$/;let hR=0;const pR=Promise.resolve(),fR=()=>hR||(pR.then(()=>hR=0),hR=Date.now());const mR=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const gR={};
/*! #__NO_SIDE_EFFECTS__ */function _R(e,t,n){const i=dS(e,t);rE(i)&&zx(i,t);class r extends bR{constructor(e){super(i,e,n)}}return r.def=i,r}
/*! #__NO_SIDE_EFFECTS__ */const yR=(e,t)=>_R(e,t,aN),vR="undefined"!=typeof HTMLElement?HTMLElement:class{};class bR extends vR{constructor(e,t={},n=oN){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._ob=null,this.shadowRoot&&n!==oN?this._root=this.shadowRoot:!1!==e.shadowRoot?(this.attachShadow({mode:"open"}),this._root=this.shadowRoot):this._root=this,this._def.__asyncLoader||this._resolveProps(this._def)}connectedCallback(){if(!this.isConnected)return;this.shadowRoot||this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.parentNode||e.host);)if(e instanceof bR){this._parent=e;break}this._instance||(this._resolved?(this._setParent(),this._update()):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._instance.provides=e._instance.provides)}disconnectedCallback(){this._connected=!1,hA(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null)})}_resolveDef(){if(this._pendingResolve)return;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(e=>{for(const t of e)this._setAttr(t.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:n,styles:i}=e;let r;if(n&&!Hx(n))for(const e in n){const t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=vE(this._props[e])),(r||(r=Object.create(null)))[cE(e)]=!0)}this._numberProps=r,t&&this._resolveProps(e),this.shadowRoot&&this._applyStyles(i),this._mount(e)},t=this._def.__asyncLoader;t?this._pendingResolve=t().then(t=>e(this._def=t,!0)):e(this._def)}_mount(e){__VUE_PROD_DEVTOOLS__&&!e.name&&(e.name="VueElement"),this._app=this._createApp(e),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const t=this._instance&&this._instance.exposed;if(t)for(const e in t)Gx(this,e)||Object.defineProperty(this,e,{get:()=>CI(t[e])})}_resolveProps(e){const{props:t}=e,n=Hx(t)?t:Object.keys(t||{});for(const e of Object.keys(this))"_"!==e[0]&&n.includes(e)&&this._setProp(e,this[e]);for(const e of n.map(cE))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!0)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const t=this.hasAttribute(e);let n=t?this.getAttribute(e):gR;const i=cE(e);t&&this._numberProps&&this._numberProps[i]&&(n=vE(n)),this._setProp(i,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,i=!1){if(t!==this._props[e]&&(t===gR?delete this._props[e]:(this._props[e]=t,"key"===e&&this._app&&(this._app._ceVNode.key=t)),i&&this._instance&&this._update(),n)){const n=this._ob;n&&n.disconnect(),!0===t?this.setAttribute(hE(e),""):"string"==typeof t||"number"==typeof t?this.setAttribute(hE(e),t+""):t||this.removeAttribute(hE(e)),n&&n.observe(this,{attributes:!0})}}_update(){rN(this._createVNode(),this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const t=EM(this._def,zx(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;const t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,rE(t[0])?zx({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),hE(e)!==e&&t(hE(e),n)},this._setParent()}),t}_applyStyles(e,t){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}const n=this._nonce;for(let t=e.length-1;t>=0;t--){const i=document.createElement("style");n&&i.setAttribute("nonce",n),i.textContent=e[t],this.shadowRoot.prepend(i)}}_parseSlots(){const e=this._slots={};let t;for(;t=this.firstChild;){const n=1===t.nodeType&&t.getAttribute("slot")||"default";(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){const e=(this._teleportTarget||this).querySelectorAll("slot"),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){const i=e[n],r=i.getAttribute("name")||"default",s=this._slots[r],o=i.parentNode;if(s)for(const e of s){if(t&&1===e.nodeType){const n=t+"-s",i=document.createTreeWalker(e,1);let r;for(e.setAttribute(n,"");r=i.nextNode();)r.setAttribute(n,"")}o.insertBefore(e,i)}else for(;i.firstChild;)o.insertBefore(i.firstChild,i);o.removeChild(i)}}_injectChildStyle(e){this._applyStyles(e.styles,e)}_removeChildStyle(e){0}}function TR(e){const t=$M(),n=t&&t.ce;return n||null}function xR(){const e=TR();return e&&e.shadowRoot}function ER(e="$style"){{const t=$M();if(!t)return Lx;const n=t.type.__cssModules;if(!n)return Lx;const i=n[e];return i||Lx}}const wR=new WeakMap,IR=new WeakMap,AR=Symbol("_moveCb"),SR=Symbol("_enterCb"),CR=(e=>(delete e.props.mode,e))({name:"TransitionGroup",props:zx({},kk,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=$M(),i=JA();let r,s;return QS(()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const i=e.cloneNode(),r=e[Ok];r&&r.forEach(e=>{e.split(/\s+/).forEach(e=>e&&i.classList.remove(e))});n.split(/\s+/).forEach(e=>e&&i.classList.add(e)),i.style.display="none";const s=1===t.nodeType?t:t.parentNode;s.appendChild(i);const{hasTransform:o}=zk(i);return s.removeChild(i),o}(r[0].el,n.vnode.el,t))return;r.forEach(MR),r.forEach(kR);const i=r.filter(RR);Gk(),i.forEach(e=>{const n=e.el,i=n.style;Pk(n,t),i.transform=i.webkitTransform=i.transitionDuration="";const r=n[AR]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[AR]=null,Bk(n,t))};n.addEventListener("transitionend",r)})}),()=>{const o=yI(e),a=Fk(o);let l=o.tag||iM;if(r=[],s)for(let e=0;e<s.length;e++){const t=s[e];t.el&&t.el instanceof Element&&(r.push(t),uS(t,oS(t,a,i,n)),wR.set(t,t.el.getBoundingClientRect()))}s=t.default?cS(t.default()):[];for(let e=0;e<s.length;e++){const t=s[e];null!=t.key&&uS(t,oS(t,a,i,n))}return EM(l,null,s)}}}),OR=CR;function MR(e){const t=e.el;t[AR]&&t[AR](),t[SR]&&t[SR]()}function kR(e){IR.set(e,e.el.getBoundingClientRect())}function RR(e){const t=wR.get(e),n=IR.get(e),i=t.left-n.left,r=t.top-n.top;if(i||r){const t=e.el.style;return t.transform=t.webkitTransform=`translate(${i}px,${r}px)`,t.transitionDuration="0s",e}}const NR=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Hx(t)?e=>gE(t,e):t};function DR(e){e.target.composing=!0}function FR(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const LR=Symbol("_assign"),PR={created(e,{modifiers:{lazy:t,trim:n,number:i}},r){e[LR]=NR(r);const s=i||r.props&&"number"===r.props.type;lR(e,t?"change":"input",t=>{if(t.target.composing)return;let i=e.value;n&&(i=i.trim()),s&&(i=yE(i)),e[LR](i)}),n&&lR(e,"change",()=>{e.value=e.value.trim()}),t||(lR(e,"compositionstart",DR),lR(e,"compositionend",FR),lR(e,"change",FR))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:r,number:s}},o){if(e[LR]=NR(o),e.composing)return;const a=null==t?"":t;if((!s&&"number"!==e.type||/^0\d/.test(e.value)?e.value:yE(e.value))!==a){if(document.activeElement===e&&"range"!==e.type){if(i&&t===n)return;if(r&&e.value.trim()===a)return}e.value=a}}},BR={deep:!0,created(e,t,n){e[LR]=NR(n),lR(e,"change",()=>{const t=e._modelValue,n=jR(e),i=e.checked,r=e[LR];if(Hx(t)){const e=jE(t,n),s=-1!==e;if(i&&!s)r(t.concat(n));else if(!i&&s){const n=[...t];n.splice(e,1),r(n)}}else if(Xx(t)){const e=new Set(t);i?e.add(n):e.delete(n),r(e)}else r(YR(e,i))})},mounted:$R,beforeUpdate(e,t,n){e[LR]=NR(n),$R(e,t,n)}};function $R(e,{value:t,oldValue:n},i){let r;if(e._modelValue=t,Hx(t))r=jE(t,i.props.value)>-1;else if(Xx(t))r=t.has(i.props.value);else{if(t===n)return;r=zE(t,YR(e,!0))}e.checked!==r&&(e.checked=r)}const UR={created(e,{value:t},n){e.checked=zE(t,n.props.value),e[LR]=NR(n),lR(e,"change",()=>{e[LR](jR(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[LR]=NR(i),t!==n&&(e.checked=zE(t,i.props.value))}},VR={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const r=Xx(t);lR(e,"change",()=>{const t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?yE(jR(e)):jR(e));e[LR](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,hA(()=>{e._assigning=!1})}),e[LR]=NR(i)},mounted(e,{value:t}){zR(e,t)},beforeUpdate(e,t,n){e[LR]=NR(n)},updated(e,{value:t}){e._assigning||zR(e,t)}};function zR(e,t){const n=e.multiple,i=Hx(t);if(!n||i||Xx(t)){for(let r=0,s=e.options.length;r<s;r++){const s=e.options[r],o=jR(s);if(n)if(i){const e=typeof o;s.selected="string"===e||"number"===e?t.some(e=>String(e)===String(o)):jE(t,o)>-1}else s.selected=t.has(o);else if(zE(jR(s),t))return void(e.selectedIndex!==r&&(e.selectedIndex=r))}n||-1===e.selectedIndex||(e.selectedIndex=-1)}}function jR(e){return"_value"in e?e._value:e.value}function YR(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const GR={created(e,t,n){WR(e,t,n,null,"created")},mounted(e,t,n){WR(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){WR(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){WR(e,t,n,i,"updated")}};function HR(e,t){switch(e){case"SELECT":return VR;case"TEXTAREA":return PR;default:switch(t){case"checkbox":return BR;case"radio":return UR;default:return PR}}}function WR(e,t,n,i,r){const s=HR(e.tagName,n.props&&n.props.type)[r];s&&s(e,t,n,i)}const XR=["ctrl","shift","alt","meta"],qR={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>XR.some(n=>e[`${n}Key`]&&!t.includes(n))},KR=(e,t)=>{const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=(n,...i)=>{for(let e=0;e<t.length;e++){const i=qR[t[e]];if(i&&i(n,t))return}return e(n,...i)})},ZR={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},QR=(e,t)=>{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=n=>{if(!("key"in n))return;const i=hE(n.key);return t.some(e=>e===i||ZR[e]===i)?e(n):void 0})},JR=zx({patchProp:(e,t,n,i,r,s)=>{const o="svg"===r;"class"===t?function(e,t,n){const i=e[Ok];i&&(t=(t?[t,...i]:[...i]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,i,o):"style"===t?function(e,t,n){const i=e.style,r=Zx(n);let s=!1;if(n&&!r){if(t)if(Zx(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&nR(i,t,"")}else for(const e in t)null==n[e]&&nR(i,e,"");for(const e in n)"display"===e&&(s=!0),nR(i,e,n[e])}else if(r){if(t!==n){const e=i[Kk];e&&(n+=";"+e),i.cssText=n,s=eR.test(n)}}else t&&e.removeAttribute("style");Hk in e&&(e[Hk]=s?i.display:"",e[Wk]&&(i.display="none"))}(e,n,i):Ux(t)?Vx(t)||cR(e,t,0,i,s):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,i){if(i)return"innerHTML"===t||"textContent"===t||!!(t in e&&mR(t)&&Kx(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(mR(t)&&Zx(n))return!1;return t in e}(e,t,i,o))?(aR(e,t,i),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||oR(e,t,i,o,0,"value"!==t)):!e._isVueCE||!/[A-Z]/.test(t)&&Zx(i)?("true-value"===t?e._trueValue=i:"false-value"===t&&(e._falseValue=i),oR(e,t,i,o)):aR(e,cE(t),i,0,t)}},Ak);let eN,tN=!1;function nN(){return eN||(eN=bO(JR))}function iN(){return eN=tN?eN:TO(JR),tN=!0,eN}const rN=(...e)=>{nN().render(...e)},sN=(...e)=>{iN().hydrate(...e)},oN=(...e)=>{const t=nN().createApp(...e);const{mount:n}=t;return t.mount=e=>{const i=uN(e);if(!i)return;const r=t._component;Kx(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const s=n(i,!1,lN(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t},aN=(...e)=>{const t=iN().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=uN(e);if(t)return n(t,!0,lN(t))},t};function lN(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}function uN(e){if(Zx(e)){return document.querySelector(e)}return e}let cN=!1;const dN=()=>{cN||(cN=!0,PR.getSSRProps=({value:e})=>({value:e}),UR.getSSRProps=({value:e},t)=>{if(t.props&&zE(t.props.value,e))return{checked:!0}},BR.getSSRProps=({value:e},t)=>{if(Hx(e)){if(t.props&&jE(e,t.props.value)>-1)return{checked:!0}}else if(Xx(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},GR.getSSRProps=(e,t)=>{if("string"!=typeof t.type)return;const n=HR(t.type.toUpperCase(),t.props&&t.props.type);return n.getSSRProps?n.getSSRProps(e,t):void 0},Xk.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}})},hN=Symbol(""),pN=Symbol(""),fN=Symbol(""),mN=Symbol(""),gN=Symbol(""),_N=Symbol(""),yN=Symbol(""),vN=Symbol(""),bN=Symbol(""),TN=Symbol(""),xN=Symbol(""),EN=Symbol(""),wN=Symbol(""),IN=Symbol(""),AN=Symbol(""),SN=Symbol(""),CN=Symbol(""),ON=Symbol(""),MN=Symbol(""),kN=Symbol(""),RN=Symbol(""),NN=Symbol(""),DN=Symbol(""),FN=Symbol(""),LN=Symbol(""),PN=Symbol(""),BN=Symbol(""),$N=Symbol(""),UN=Symbol(""),VN=Symbol(""),zN=Symbol(""),jN=Symbol(""),YN=Symbol(""),GN=Symbol(""),HN=Symbol(""),WN=Symbol(""),XN=Symbol(""),qN=Symbol(""),KN=Symbol(""),ZN={[hN]:"Fragment",[pN]:"Teleport",[fN]:"Suspense",[mN]:"KeepAlive",[gN]:"BaseTransition",[_N]:"openBlock",[yN]:"createBlock",[vN]:"createElementBlock",[bN]:"createVNode",[TN]:"createElementVNode",[xN]:"createCommentVNode",[EN]:"createTextVNode",[wN]:"createStaticVNode",[IN]:"resolveComponent",[AN]:"resolveDynamicComponent",[SN]:"resolveDirective",[CN]:"resolveFilter",[ON]:"withDirectives",[MN]:"renderList",[kN]:"renderSlot",[RN]:"createSlots",[NN]:"toDisplayString",[DN]:"mergeProps",[FN]:"normalizeClass",[LN]:"normalizeStyle",[PN]:"normalizeProps",[BN]:"guardReactiveProps",[$N]:"toHandlers",[UN]:"camelize",[VN]:"capitalize",[zN]:"toHandlerKey",[jN]:"setBlockTracking",[YN]:"pushScopeId",[GN]:"popScopeId",[HN]:"withCtx",[WN]:"unref",[XN]:"isRef",[qN]:"withMemo",[KN]:"isMemoSame"};const QN={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function JN(e,t,n,i,r,s,o,a=!1,l=!1,u=!1,c=QN){return e&&(a?(e.helper(_N),e.helper(uD(e.inSSR,u))):e.helper(lD(e.inSSR,u)),o&&e.helper(ON)),{type:13,tag:t,props:n,children:i,patchFlag:r,dynamicProps:s,directives:o,isBlock:a,disableTracking:l,isComponent:u,loc:c}}function eD(e,t=QN){return{type:17,loc:t,elements:e}}function tD(e,t=QN){return{type:15,loc:t,properties:e}}function nD(e,t){return{type:16,loc:QN,key:Zx(e)?iD(e,!0):e,value:t}}function iD(e,t=!1,n=QN,i=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:i}}function rD(e,t=QN){return{type:8,loc:t,children:e}}function sD(e,t=[],n=QN){return{type:14,loc:n,callee:e,arguments:t}}function oD(e,t=void 0,n=!1,i=!1,r=QN){return{type:18,params:e,returns:t,newline:n,isSlot:i,loc:r}}function aD(e,t,n,i=!0){return{type:19,test:e,consequent:t,alternate:n,newline:i,loc:QN}}function lD(e,t){return e||t?bN:TN}function uD(e,t){return e||t?yN:vN}function cD(e,{helper:t,removeHelper:n,inSSR:i}){e.isBlock||(e.isBlock=!0,n(lD(i,e.isComponent)),t(_N),t(uD(i,e.isComponent)))}const dD=new Uint8Array([123,123]),hD=new Uint8Array([125,125]);function pD(e){return e>=97&&e<=122||e>=65&&e<=90}function fD(e){return 32===e||10===e||9===e||12===e||13===e}function mD(e){return 47===e||62===e||fD(e)}function gD(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}const _D={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};function yD(e,{compatConfig:t}){const n=t&&t[e];return"MODE"===e?n||3:n}function vD(e,t){const n=yD("MODE",t),i=yD(e,t);return 3===n?!0===i:!1!==i}function bD(e,t,n,...i){return vD(e,t)}function TD(e){throw e}function xD(e){}function ED(e,t,n,i){const r=new SyntaxError(String(`https://vuejs.org/error-reference/#compiler-${e}`));return r.code=e,r.loc=t,r}const wD=e=>4===e.type&&e.isStatic;function ID(e){switch(e){case"Teleport":case"teleport":return pN;case"Suspense":case"suspense":return fN;case"KeepAlive":case"keep-alive":return mN;case"BaseTransition":case"base-transition":return gN}}const AD=/^\d|[^\$\w\xA0-\uFFFF]/,SD=e=>!AD.test(e),CD=/[A-Za-z_$\xA0-\uFFFF]/,OD=/[\.\?\w$\xA0-\uFFFF]/,MD=/\s+[.[]\s*|\s*[.[]\s+/g,kD=e=>4===e.type?e.content:e.loc.source,RD=e=>{const t=kD(e).trim().replace(MD,e=>e.trim());let n=0,i=[],r=0,s=0,o=null;for(let e=0;e<t.length;e++){const a=t.charAt(e);switch(n){case 0:if("["===a)i.push(n),n=1,r++;else if("("===a)i.push(n),n=2,s++;else if(!(0===e?CD:OD).test(a))return!1;break;case 1:"'"===a||'"'===a||"`"===a?(i.push(n),n=3,o=a):"["===a?r++:"]"===a&&(--r||(n=i.pop()));break;case 2:if("'"===a||'"'===a||"`"===a)i.push(n),n=3,o=a;else if("("===a)s++;else if(")"===a){if(e===t.length-1)return!1;--s||(n=i.pop())}break;case 3:a===o&&(n=i.pop(),o=null)}}return!r&&!s},ND=/^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,DD=e=>ND.test(kD(e));function FD(e,t,n=!1){for(let i=0;i<e.props.length;i++){const r=e.props[i];if(7===r.type&&(n||r.exp)&&(Zx(t)?r.name===t:t.test(r.name)))return r}}function LD(e,t,n=!1,i=!1){for(let r=0;r<e.props.length;r++){const s=e.props[r];if(6===s.type){if(n)continue;if(s.name===t&&(s.value||i))return s}else if("bind"===s.name&&(s.exp||i)&&PD(s.arg,t))return s}}function PD(e,t){return!(!e||!wD(e)||e.content!==t)}function BD(e){return 5===e.type||2===e.type}function $D(e){return 7===e.type&&"slot"===e.name}function UD(e){return 1===e.type&&3===e.tagType}function VD(e){return 1===e.type&&2===e.tagType}const zD=new Set([PN,BN]);function jD(e,t=[]){if(e&&!Zx(e)&&14===e.type){const n=e.callee;if(!Zx(n)&&zD.has(n))return jD(e.arguments[0],t.concat(e))}return[e,t]}function YD(e,t,n){let i,r,s=13===e.type?e.props:e.arguments[2],o=[];if(s&&!Zx(s)&&14===s.type){const e=jD(s);s=e[0],o=e[1],r=o[o.length-1]}if(null==s||Zx(s))i=tD([t]);else if(14===s.type){const e=s.arguments[0];Zx(e)||15!==e.type?s.callee===$N?i=sD(n.helper(DN),[tD([t]),s]):s.arguments.unshift(tD([t])):GD(t,e)||e.properties.unshift(t),!i&&(i=s)}else 15===s.type?(GD(t,s)||s.properties.unshift(t),i=s):(i=sD(n.helper(DN),[tD([t]),s]),r&&r.callee===BN&&(r=o[o.length-2]));13===e.type?r?r.arguments[0]=i:e.props=i:r?r.arguments[0]=i:e.arguments[2]=i}function GD(e,t){let n=!1;if(4===e.key.type){const i=e.key.content;n=t.properties.some(e=>4===e.key.type&&e.key.content===i)}return n}function HD(e,t){return`_${t}_${e.replace(/[^\w]/g,(t,n)=>"-"===t?"_":e.charCodeAt(n).toString())}`}const WD=/([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/,XD={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:$x,isPreTag:$x,isIgnoreNewlineTag:$x,isCustomElement:$x,onError:TD,onWarn:xD,comments:!1,prefixIdentifiers:!1};let qD=XD,KD=null,ZD="",QD=null,JD=null,eF="",tF=-1,nF=-1,iF=0,rF=!1,sF=null;const oF=[],aF=new class{constructor(e,t){this.stack=e,this.cbs=t,this.state=1,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=1,this.inRCDATA=!1,this.inXML=!1,this.inVPre=!1,this.newlines=[],this.mode=0,this.delimiterOpen=dD,this.delimiterClose=hD,this.delimiterIndex=-1,this.currentSequence=void 0,this.sequenceIndex=0}get inSFCRoot(){return 2===this.mode&&0===this.stack.length}reset(){this.state=1,this.mode=0,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=1,this.inRCDATA=!1,this.currentSequence=void 0,this.newlines.length=0,this.delimiterOpen=dD,this.delimiterClose=hD}getPos(e){let t=1,n=e+1;for(let i=this.newlines.length-1;i>=0;i--){const r=this.newlines[i];if(e>r){t=i+2,n=e-r;break}}return{column:n,line:t,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){60===e?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const e=this.index+1-this.delimiterOpen.length;e>this.sectionStart&&this.cbs.ontext(this.sectionStart,e),this.state=3,this.sectionStart=e}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const t=this.sequenceIndex===this.currentSequence.length;if(t?mD(e):(32|e)===this.currentSequence[this.sequenceIndex]){if(!t)return void this.sequenceIndex++}else this.inRCDATA=!1;this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(62===e||fD(e)){const t=this.index-this.currentSequence.length;if(this.sectionStart<t){const e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}return this.sectionStart=t+2,this.stateInClosingTagName(e),void(this.inRCDATA=!1)}this.sequenceIndex=0}(32|e)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:0===this.sequenceIndex?this.currentSequence===_D.TitleEnd||this.currentSequence===_D.TextareaEnd&&!this.inSFCRoot?this.inVPre||e!==this.delimiterOpen[0]||(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e)):this.fastForwardTo(60)&&(this.sequenceIndex=1):this.sequenceIndex=Number(60===e)}stateCDATASequence(e){e===_D.Cdata[this.sequenceIndex]?++this.sequenceIndex===_D.Cdata.length&&(this.state=28,this.currentSequence=_D.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=23,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length;){const t=this.buffer.charCodeAt(this.index);if(10===t&&this.newlines.push(this.index),t===e)return!0}return this.index=this.buffer.length-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===_D.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index-2):this.cbs.oncomment(this.sectionStart,this.index-2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=1):0===this.sequenceIndex?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}startSpecial(e,t){this.enterRCDATA(e,t),this.state=31}enterRCDATA(e,t){this.inRCDATA=!0,this.currentSequence=e,this.sequenceIndex=t}stateBeforeTagName(e){33===e?(this.state=22,this.sectionStart=this.index+1):63===e?(this.state=24,this.sectionStart=this.index+1):pD(e)?(this.sectionStart=this.index,0===this.mode?this.state=6:this.inSFCRoot?this.state=34:this.inXML?this.state=6:this.state=116===e?30:115===e?29:6):47===e?this.state=8:(this.state=1,this.stateText(e))}stateInTagName(e){mD(e)&&this.handleTagName(e)}stateInSFCRootTagName(e){if(mD(e)){const t=this.buffer.slice(this.sectionStart,this.index);"template"!==t&&this.enterRCDATA(gD("</"+t),0),this.handleTagName(e)}}handleTagName(e){this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)}stateBeforeClosingTagName(e){fD(e)||(62===e?(this.state=1,this.sectionStart=this.index+1):(this.state=pD(e)?9:27,this.sectionStart=this.index))}stateInClosingTagName(e){(62===e||fD(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=10,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){62===e&&(this.state=1,this.sectionStart=this.index+1)}stateBeforeAttrName(e){62===e?(this.cbs.onopentagend(this.index),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):47===e?this.state=7:60===e&&47===this.peek()?(this.cbs.onopentagend(this.index),this.state=5,this.sectionStart=this.index):fD(e)||this.handleAttrStart(e)}handleAttrStart(e){118===e&&45===this.peek()?(this.state=13,this.sectionStart=this.index):46===e||58===e||64===e||35===e?(this.cbs.ondirname(this.index,this.index+1),this.state=14,this.sectionStart=this.index+1):(this.state=12,this.sectionStart=this.index)}stateInSelfClosingTag(e){62===e?(this.cbs.onselfclosingtag(this.index),this.state=1,this.sectionStart=this.index+1,this.inRCDATA=!1):fD(e)||(this.state=11,this.stateBeforeAttrName(e))}stateInAttrName(e){(61===e||mD(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.handleAttrNameEnd(e))}stateInDirName(e){61===e||mD(e)?(this.cbs.ondirname(this.sectionStart,this.index),this.handleAttrNameEnd(e)):58===e?(this.cbs.ondirname(this.sectionStart,this.index),this.state=14,this.sectionStart=this.index+1):46===e&&(this.cbs.ondirname(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDirArg(e){61===e||mD(e)?(this.cbs.ondirarg(this.sectionStart,this.index),this.handleAttrNameEnd(e)):91===e?this.state=15:46===e&&(this.cbs.ondirarg(this.sectionStart,this.index),this.state=16,this.sectionStart=this.index+1)}stateInDynamicDirArg(e){93===e?this.state=14:(61===e||mD(e))&&(this.cbs.ondirarg(this.sectionStart,this.index+1),this.handleAttrNameEnd(e))}stateInDirModifier(e){61===e||mD(e)?(this.cbs.ondirmodifier(this.sectionStart,this.index),this.handleAttrNameEnd(e)):46===e&&(this.cbs.ondirmodifier(this.sectionStart,this.index),this.sectionStart=this.index+1)}handleAttrNameEnd(e){this.sectionStart=this.index,this.state=17,this.cbs.onattribnameend(this.index),this.stateAfterAttrName(e)}stateAfterAttrName(e){61===e?this.state=18:47===e||62===e?(this.cbs.onattribend(0,this.sectionStart),this.sectionStart=-1,this.state=11,this.stateBeforeAttrName(e)):fD(e)||(this.cbs.onattribend(0,this.sectionStart),this.handleAttrStart(e))}stateBeforeAttrValue(e){34===e?(this.state=19,this.sectionStart=this.index+1):39===e?(this.state=20,this.sectionStart=this.index+1):fD(e)||(this.sectionStart=this.index,this.state=21,this.stateInAttrValueNoQuotes(e))}handleInAttrValue(e,t){(e===t||this.fastForwardTo(t))&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(34===t?3:2,this.index+1),this.state=11)}stateInAttrValueDoubleQuotes(e){this.handleInAttrValue(e,34)}stateInAttrValueSingleQuotes(e){this.handleInAttrValue(e,39)}stateInAttrValueNoQuotes(e){fD(e)||62===e?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(1,this.index),this.state=11,this.stateBeforeAttrName(e)):39!==e&&60!==e&&61!==e&&96!==e||this.cbs.onerr(18,this.index)}stateBeforeDeclaration(e){91===e?(this.state=26,this.sequenceIndex=0):this.state=45===e?25:23}stateInDeclaration(e){(62===e||this.fastForwardTo(62))&&(this.state=1,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(62===e||this.fastForwardTo(62))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeComment(e){45===e?(this.state=28,this.currentSequence=_D.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=23}stateInSpecialComment(e){(62===e||this.fastForwardTo(62))&&(this.cbs.oncomment(this.sectionStart,this.index),this.state=1,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){e===_D.ScriptEnd[3]?this.startSpecial(_D.ScriptEnd,4):e===_D.StyleEnd[3]?this.startSpecial(_D.StyleEnd,4):(this.state=6,this.stateInTagName(e))}stateBeforeSpecialT(e){e===_D.TitleEnd[3]?this.startSpecial(_D.TitleEnd,4):e===_D.TextareaEnd[3]?this.startSpecial(_D.TextareaEnd,4):(this.state=6,this.stateInTagName(e))}startEntity(){}stateInEntity(){}parse(e){for(this.buffer=e;this.index<this.buffer.length;){const e=this.buffer.charCodeAt(this.index);switch(10===e&&this.newlines.push(this.index),this.state){case 1:this.stateText(e);break;case 2:this.stateInterpolationOpen(e);break;case 3:this.stateInterpolation(e);break;case 4:this.stateInterpolationClose(e);break;case 31:this.stateSpecialStartSequence(e);break;case 32:this.stateInRCDATA(e);break;case 26:this.stateCDATASequence(e);break;case 19:this.stateInAttrValueDoubleQuotes(e);break;case 12:this.stateInAttrName(e);break;case 13:this.stateInDirName(e);break;case 14:this.stateInDirArg(e);break;case 15:this.stateInDynamicDirArg(e);break;case 16:this.stateInDirModifier(e);break;case 28:this.stateInCommentLike(e);break;case 27:this.stateInSpecialComment(e);break;case 11:this.stateBeforeAttrName(e);break;case 6:this.stateInTagName(e);break;case 34:this.stateInSFCRootTagName(e);break;case 9:this.stateInClosingTagName(e);break;case 5:this.stateBeforeTagName(e);break;case 17:this.stateAfterAttrName(e);break;case 20:this.stateInAttrValueSingleQuotes(e);break;case 18:this.stateBeforeAttrValue(e);break;case 8:this.stateBeforeClosingTagName(e);break;case 10:this.stateAfterClosingTagName(e);break;case 29:this.stateBeforeSpecialS(e);break;case 30:this.stateBeforeSpecialT(e);break;case 21:this.stateInAttrValueNoQuotes(e);break;case 7:this.stateInSelfClosingTag(e);break;case 23:this.stateInDeclaration(e);break;case 22:this.stateBeforeDeclaration(e);break;case 25:this.stateBeforeComment(e);break;case 24:this.stateInProcessingInstruction(e);break;case 33:this.stateInEntity()}this.index++}this.cleanup(),this.finish()}cleanup(){this.sectionStart!==this.index&&(1===this.state||32===this.state&&0===this.sequenceIndex?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):19!==this.state&&20!==this.state&&21!==this.state||(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}finish(){this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length;this.sectionStart>=e||(28===this.state?this.currentSequence===_D.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):6===this.state||11===this.state||18===this.state||17===this.state||12===this.state||13===this.state||14===this.state||15===this.state||16===this.state||20===this.state||19===this.state||21===this.state||9===this.state||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,t){}}(oF,{onerr:CF,ontext(e,t){hF(cF(e,t),e,t)},ontextentity(e,t,n){hF(e,t,n)},oninterpolation(e,t){if(rF)return hF(cF(e,t),e,t);let n=e+aF.delimiterOpen.length,i=t-aF.delimiterClose.length;for(;fD(ZD.charCodeAt(n));)n++;for(;fD(ZD.charCodeAt(i-1));)i--;let r=cF(n,i);r.includes("&")&&(r=qD.decodeEntities(r,!1)),xF({type:5,content:SF(r,!1,EF(n,i)),loc:EF(e,t)})},onopentagname(e,t){const n=cF(e,t);QD={type:1,tag:n,ns:qD.getNamespace(n,oF[0],qD.ns),tagType:0,props:[],children:[],loc:EF(e-1,t),codegenNode:void 0}},onopentagend(e){dF(e)},onclosetag(e,t){const n=cF(e,t);if(!qD.isVoidTag(n)){let i=!1;for(let e=0;e<oF.length;e++){if(oF[e].tag.toLowerCase()===n.toLowerCase()){i=!0,e>0&&CF(24,oF[0].loc.start.offset);for(let n=0;n<=e;n++){pF(oF.shift(),t,n<e)}break}}i||CF(23,fF(e,60))}},onselfclosingtag(e){const t=QD.tag;QD.isSelfClosing=!0,dF(e),oF[0]&&oF[0].tag===t&&pF(oF.shift(),e)},onattribname(e,t){JD={type:6,name:cF(e,t),nameLoc:EF(e,t),value:void 0,loc:EF(e)}},ondirname(e,t){const n=cF(e,t),i="."===n||":"===n?"bind":"@"===n?"on":"#"===n?"slot":n.slice(2);if(rF||""!==i||CF(26,e),rF||""===i)JD={type:6,name:n,nameLoc:EF(e,t),value:void 0,loc:EF(e)};else if(JD={type:7,name:i,rawName:n,exp:void 0,arg:void 0,modifiers:"."===n?[iD("prop")]:[],loc:EF(e)},"pre"===i){rF=aF.inVPre=!0,sF=QD;const e=QD.props;for(let t=0;t<e.length;t++)7===e[t].type&&(e[t]=AF(e[t]))}},ondirarg(e,t){if(e===t)return;const n=cF(e,t);if(rF)JD.name+=n,IF(JD.nameLoc,t);else{const i="["!==n[0];JD.arg=SF(i?n:n.slice(1,-1),i,EF(e,t),i?3:0)}},ondirmodifier(e,t){const n=cF(e,t);if(rF)JD.name+="."+n,IF(JD.nameLoc,t);else if("slot"===JD.name){const e=JD.arg;e&&(e.content+="."+n,IF(e.loc,t))}else{const i=iD(n,!0,EF(e,t));JD.modifiers.push(i)}},onattribdata(e,t){eF+=cF(e,t),tF<0&&(tF=e),nF=t},onattribentity(e,t,n){eF+=e,tF<0&&(tF=t),nF=n},onattribnameend(e){const t=JD.loc.start.offset,n=cF(t,e);7===JD.type&&(JD.rawName=n),QD.props.some(e=>(7===e.type?e.rawName:e.name)===n)&&CF(2,t)},onattribend(e,t){if(QD&&JD){if(IF(JD.loc,t),0!==e)if(eF.includes("&")&&(eF=qD.decodeEntities(eF,!0)),6===JD.type)"class"===JD.name&&(eF=TF(eF).trim()),1!==e||eF||CF(13,t),JD.value={type:2,content:eF,loc:1===e?EF(tF,nF):EF(tF-1,nF+1)},aF.inSFCRoot&&"template"===QD.tag&&"lang"===JD.name&&eF&&"html"!==eF&&aF.enterRCDATA(gD("</template"),0);else{let e=0;JD.exp=SF(eF,!1,EF(tF,nF),0,e),"for"===JD.name&&(JD.forParseResult=function(e){const t=e.loc,n=e.content,i=n.match(WD);if(!i)return;const[,r,s]=i,o=(e,n,i=!1)=>{const r=t.start.offset+n;return SF(e,!1,EF(r,r+e.length),0,i?1:0)},a={source:o(s.trim(),n.indexOf(s,r.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let l=r.trim().replace(uF,"").trim();const u=r.indexOf(l),c=l.match(lF);if(c){l=l.replace(lF,"").trim();const e=c[1].trim();let t;if(e&&(t=n.indexOf(e,u+l.length),a.key=o(e,t,!0)),c[2]){const i=c[2].trim();i&&(a.index=o(i,n.indexOf(i,a.key?t+e.length:u+l.length),!0))}}l&&(a.value=o(l,u,!0));return a}(JD.exp));let t=-1;"bind"===JD.name&&(t=JD.modifiers.findIndex(e=>"sync"===e.content))>-1&&bD("COMPILER_V_BIND_SYNC",qD,JD.loc,JD.rawName)&&(JD.name="model",JD.modifiers.splice(t,1))}7===JD.type&&"pre"===JD.name||QD.props.push(JD)}eF="",tF=nF=-1},oncomment(e,t){qD.comments&&xF({type:3,content:cF(e,t),loc:EF(e-4,t+3)})},onend(){const e=ZD.length;for(let t=0;t<oF.length;t++)pF(oF[t],e-1),CF(24,oF[t].loc.start.offset)},oncdata(e,t){0!==oF[0].ns?hF(cF(e,t),e,t):CF(1,e-9)},onprocessinginstruction(e){0===(oF[0]?oF[0].ns:qD.ns)&&CF(21,e-1)}}),lF=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,uF=/^\(|\)$/g;function cF(e,t){return ZD.slice(e,t)}function dF(e){aF.inSFCRoot&&(QD.innerLoc=EF(e+1,e+1)),xF(QD);const{tag:t,ns:n}=QD;0===n&&qD.isPreTag(t)&&iF++,qD.isVoidTag(t)?pF(QD,e):(oF.unshift(QD),1!==n&&2!==n||(aF.inXML=!0)),QD=null}function hF(e,t,n){{const t=oF[0]&&oF[0].tag;"script"!==t&&"style"!==t&&e.includes("&")&&(e=qD.decodeEntities(e,!1))}const i=oF[0]||KD,r=i.children[i.children.length-1];r&&2===r.type?(r.content+=e,IF(r.loc,n)):i.children.push({type:2,content:e,loc:EF(t,n)})}function pF(e,t,n=!1){IF(e.loc,n?fF(t,60):function(e,t){let n=e;for(;ZD.charCodeAt(n)!==t&&n<ZD.length-1;)n++;return n}(t,62)+1),aF.inSFCRoot&&(e.children.length?e.innerLoc.end=zx({},e.children[e.children.length-1].loc.end):e.innerLoc.end=zx({},e.innerLoc.start),e.innerLoc.source=cF(e.innerLoc.start.offset,e.innerLoc.end.offset));const{tag:i,ns:r,children:s}=e;if(rF||("slot"===i?e.tagType=2:gF(e)?e.tagType=3:function({tag:e,props:t}){if(qD.isCustomElement(e))return!1;if("component"===e||(n=e.charCodeAt(0),n>64&&n<91)||ID(e)||qD.isBuiltInComponent&&qD.isBuiltInComponent(e)||qD.isNativeTag&&!qD.isNativeTag(e))return!0;var n;for(let e=0;e<t.length;e++){const n=t[e];if(6===n.type){if("is"===n.name&&n.value){if(n.value.content.startsWith("vue:"))return!0;if(bD("COMPILER_IS_ON_ELEMENT",qD,n.loc))return!0}}else if("bind"===n.name&&PD(n.arg,"is")&&bD("COMPILER_IS_ON_ELEMENT",qD,n.loc))return!0}return!1}(e)&&(e.tagType=1)),aF.inRCDATA||(e.children=yF(s)),0===r&&qD.isIgnoreNewlineTag(i)){const e=s[0];e&&2===e.type&&(e.content=e.content.replace(/^\r?\n/,""))}0===r&&qD.isPreTag(i)&&iF--,sF===e&&(rF=aF.inVPre=!1,sF=null),aF.inXML&&0===(oF[0]?oF[0].ns:qD.ns)&&(aF.inXML=!1);{const t=e.props;if(!aF.inSFCRoot&&vD("COMPILER_NATIVE_TEMPLATE",qD)&&"template"===e.tag&&!gF(e)){const t=oF[0]||KD,n=t.children.indexOf(e);t.children.splice(n,1,...e.children)}const n=t.find(e=>6===e.type&&"inline-template"===e.name);n&&bD("COMPILER_INLINE_TEMPLATE",qD,n.loc)&&e.children.length&&(n.value={type:2,content:cF(e.children[0].loc.start.offset,e.children[e.children.length-1].loc.end.offset),loc:n.loc})}}function fF(e,t){let n=e;for(;ZD.charCodeAt(n)!==t&&n>=0;)n--;return n}const mF=new Set(["if","else","else-if","for","slot"]);function gF({tag:e,props:t}){if("template"===e)for(let e=0;e<t.length;e++)if(7===t[e].type&&mF.has(t[e].name))return!0;return!1}const _F=/\r\n/g;function yF(e,t){const n="preserve"!==qD.whitespace;let i=!1;for(let t=0;t<e.length;t++){const r=e[t];if(2===r.type)if(iF)r.content=r.content.replace(_F,"\n");else if(vF(r.content)){const s=e[t-1]&&e[t-1].type,o=e[t+1]&&e[t+1].type;!s||!o||n&&(3===s&&(3===o||1===o)||1===s&&(3===o||1===o&&bF(r.content)))?(i=!0,e[t]=null):r.content=" "}else n&&(r.content=TF(r.content))}return i?e.filter(Boolean):e}function vF(e){for(let t=0;t<e.length;t++)if(!fD(e.charCodeAt(t)))return!1;return!0}function bF(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(10===n||13===n)return!0}return!1}function TF(e){let t="",n=!1;for(let i=0;i<e.length;i++)fD(e.charCodeAt(i))?n||(t+=" ",n=!0):(t+=e[i],n=!1);return t}function xF(e){(oF[0]||KD).children.push(e)}function EF(e,t){return{start:aF.getPos(e),end:null==t?t:aF.getPos(t),source:null==t?t:cF(e,t)}}function wF(e){return EF(e.start.offset,e.end.offset)}function IF(e,t){e.end=aF.getPos(t),e.source=cF(e.start.offset,t)}function AF(e){const t={type:6,name:e.rawName,nameLoc:EF(e.loc.start.offset,e.loc.start.offset+e.rawName.length),value:void 0,loc:e.loc};if(e.exp){const n=e.exp.loc;n.end.offset<e.loc.end.offset&&(n.start.offset--,n.start.column--,n.end.offset++,n.end.column++),t.value={type:2,content:e.exp.content,loc:n}}return t}function SF(e,t=!1,n,i=0,r=0){return iD(e,t,n,i)}function CF(e,t,n){qD.onError(ED(e,EF(t,t)))}function OF(e,t){if(aF.reset(),QD=null,JD=null,eF="",tF=-1,nF=-1,oF.length=0,ZD=e,qD=zx({},XD),t){let e;for(e in t)null!=t[e]&&(qD[e]=t[e])}aF.mode="html"===qD.parseMode?1:"sfc"===qD.parseMode?2:0,aF.inXML=1===qD.ns||2===qD.ns;const n=t&&t.delimiters;n&&(aF.delimiterOpen=gD(n[0]),aF.delimiterClose=gD(n[1]));const i=KD=function(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:QN}}([],e);return aF.parse(ZD),i.loc=EF(0,e.length),i.children=yF(i.children),KD=null,i}function MF(e,t){RF(e,void 0,t,kF(e,e.children[0]))}function kF(e,t){const{children:n}=e;return 1===n.length&&1===t.type&&!VD(t)}function RF(e,t,n,i=!1,r=!1){const{children:s}=e,o=[];for(let t=0;t<s.length;t++){const a=s[t];if(1===a.type&&0===a.tagType){const e=i?0:NF(a,n);if(e>0){if(e>=2){a.codegenNode.patchFlag=-1,o.push(a);continue}}else{const e=a.codegenNode;if(13===e.type){const t=e.patchFlag;if((void 0===t||512===t||1===t)&&LF(a,n)>=2){const t=PF(a);t&&(e.props=n.hoist(t))}e.dynamicProps&&(e.dynamicProps=n.hoist(e.dynamicProps))}}}else if(12===a.type){if((i?0:NF(a,n))>=2){o.push(a);continue}}if(1===a.type){const t=1===a.tagType;t&&n.scopes.vSlot++,RF(a,e,n,!1,r),t&&n.scopes.vSlot--}else if(11===a.type)RF(a,e,n,1===a.children.length,!0);else if(9===a.type)for(let t=0;t<a.branches.length;t++)RF(a.branches[t],e,n,1===a.branches[t].children.length,r)}let a=!1;if(o.length===s.length&&1===e.type)if(0===e.tagType&&e.codegenNode&&13===e.codegenNode.type&&Hx(e.codegenNode.children))e.codegenNode.children=l(eD(e.codegenNode.children)),a=!0;else if(1===e.tagType&&e.codegenNode&&13===e.codegenNode.type&&e.codegenNode.children&&!Hx(e.codegenNode.children)&&15===e.codegenNode.children.type){const t=u(e.codegenNode,"default");t&&(t.returns=l(eD(t.returns)),a=!0)}else if(3===e.tagType&&t&&1===t.type&&1===t.tagType&&t.codegenNode&&13===t.codegenNode.type&&t.codegenNode.children&&!Hx(t.codegenNode.children)&&15===t.codegenNode.children.type){const n=FD(e,"slot",!0),i=n&&n.arg&&u(t.codegenNode,n.arg);i&&(i.returns=l(eD(i.returns)),a=!0)}if(!a)for(const e of o)e.codegenNode=n.cache(e.codegenNode);function l(e){const t=n.cache(e);return r&&n.hmr&&(t.needArraySpread=!0),t}function u(e,t){if(e.children&&!Hx(e.children)&&15===e.children.type){const n=e.children.properties.find(e=>e.key===t||e.key.content===t);return n&&n.value}}o.length&&n.transformHoist&&n.transformHoist(s,n,e)}function NF(e,t){const{constantCache:n}=t;switch(e.type){case 1:if(0!==e.tagType)return 0;const i=n.get(e);if(void 0!==i)return i;const r=e.codegenNode;if(13!==r.type)return 0;if(r.isBlock&&"svg"!==e.tag&&"foreignObject"!==e.tag&&"math"!==e.tag)return 0;if(void 0===r.patchFlag){let i=3;const s=LF(e,t);if(0===s)return n.set(e,0),0;s<i&&(i=s);for(let r=0;r<e.children.length;r++){const s=NF(e.children[r],t);if(0===s)return n.set(e,0),0;s<i&&(i=s)}if(i>1)for(let r=0;r<e.props.length;r++){const s=e.props[r];if(7===s.type&&"bind"===s.name&&s.exp){const r=NF(s.exp,t);if(0===r)return n.set(e,0),0;r<i&&(i=r)}}if(r.isBlock){for(let t=0;t<e.props.length;t++){if(7===e.props[t].type)return n.set(e,0),0}t.removeHelper(_N),t.removeHelper(uD(t.inSSR,r.isComponent)),r.isBlock=!1,t.helper(lD(t.inSSR,r.isComponent))}return n.set(e,i),i}return n.set(e,0),0;case 2:case 3:return 3;case 9:case 11:case 10:default:return 0;case 5:case 12:return NF(e.content,t);case 4:return e.constType;case 8:let s=3;for(let n=0;n<e.children.length;n++){const i=e.children[n];if(Zx(i)||Qx(i))continue;const r=NF(i,t);if(0===r)return 0;r<s&&(s=r)}return s;case 20:return 2}}const DF=new Set([FN,LN,PN,BN]);function FF(e,t){if(14===e.type&&!Zx(e.callee)&&DF.has(e.callee)){const n=e.arguments[0];if(4===n.type)return NF(n,t);if(14===n.type)return FF(n,t)}return 0}function LF(e,t){let n=3;const i=PF(e);if(i&&15===i.type){const{properties:e}=i;for(let i=0;i<e.length;i++){const{key:r,value:s}=e[i],o=NF(r,t);if(0===o)return o;let a;if(o<n&&(n=o),a=4===s.type?NF(s,t):14===s.type?FF(s,t):0,0===a)return a;a<n&&(n=a)}}return n}function PF(e){const t=e.codegenNode;if(13===t.type)return t.props}function BF(e,{filename:t="",prefixIdentifiers:n=!1,hoistStatic:i=!1,hmr:r=!1,cacheHandlers:s=!1,nodeTransforms:o=[],directiveTransforms:a={},transformHoist:l=null,isBuiltInComponent:u=Bx,isCustomElement:c=Bx,expressionPlugins:d=[],scopeId:h=null,slotted:p=!0,ssr:f=!1,inSSR:m=!1,ssrCssVars:g="",bindingMetadata:_=Lx,inline:y=!1,isTS:v=!1,onError:b=TD,onWarn:T=xD,compatConfig:x}){const E=t.replace(/\?.*$/,"").match(/([^/\\]+)\.\w+$/),w={filename:t,selfName:E&&pE(cE(E[1])),prefixIdentifiers:n,hoistStatic:i,hmr:r,cacheHandlers:s,nodeTransforms:o,directiveTransforms:a,transformHoist:l,isBuiltInComponent:u,isCustomElement:c,expressionPlugins:d,scopeId:h,slotted:p,ssr:f,inSSR:m,ssrCssVars:g,bindingMetadata:_,inline:y,isTS:v,onError:b,onWarn:T,compatConfig:x,root:e,helpers:new Map,components:new Set,directives:new Set,hoists:[],imports:[],cached:[],constantCache:new WeakMap,temps:0,identifiers:Object.create(null),scopes:{vFor:0,vSlot:0,vPre:0,vOnce:0},parent:null,grandParent:null,currentNode:e,childIndex:0,inVOnce:!1,helper(e){const t=w.helpers.get(e)||0;return w.helpers.set(e,t+1),e},removeHelper(e){const t=w.helpers.get(e);if(t){const n=t-1;n?w.helpers.set(e,n):w.helpers.delete(e)}},helperString:e=>`_${ZN[w.helper(e)]}`,replaceNode(e){w.parent.children[w.childIndex]=w.currentNode=e},removeNode(e){const t=w.parent.children,n=e?t.indexOf(e):w.currentNode?w.childIndex:-1;e&&e!==w.currentNode?w.childIndex>n&&(w.childIndex--,w.onNodeRemoved()):(w.currentNode=null,w.onNodeRemoved()),w.parent.children.splice(n,1)},onNodeRemoved:Bx,addIdentifiers(e){},removeIdentifiers(e){},hoist(e){Zx(e)&&(e=iD(e)),w.hoists.push(e);const t=iD(`_hoisted_${w.hoists.length}`,!1,e.loc,2);return t.hoisted=e,t},cache(e,t=!1,n=!1){const i=function(e,t,n=!1,i=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:i,needArraySpread:!1,loc:QN}}(w.cached.length,e,t,n);return w.cached.push(i),i}};return w.filters=new Set,w}function $F(e,t){const n=BF(e,t);UF(e,n),t.hoistStatic&&MF(e,n),t.ssr||function(e,t){const{helper:n}=t,{children:i}=e;if(1===i.length){const n=i[0];if(kF(e,n)&&n.codegenNode){const i=n.codegenNode;13===i.type&&cD(i,t),e.codegenNode=i}else e.codegenNode=n}else if(i.length>1){let i=64;0,e.codegenNode=JN(t,n(hN),void 0,e.children,i,void 0,void 0,!0,void 0,!1)}}(e,n),e.helpers=new Set([...n.helpers.keys()]),e.components=[...n.components],e.directives=[...n.directives],e.imports=n.imports,e.hoists=n.hoists,e.temps=n.temps,e.cached=n.cached,e.transformed=!0,e.filters=[...n.filters]}function UF(e,t){t.currentNode=e;const{nodeTransforms:n}=t,i=[];for(let r=0;r<n.length;r++){const s=n[r](e,t);if(s&&(Hx(s)?i.push(...s):i.push(s)),!t.currentNode)return;e=t.currentNode}switch(e.type){case 3:t.ssr||t.helper(xN);break;case 5:t.ssr||t.helper(NN);break;case 9:for(let n=0;n<e.branches.length;n++)UF(e.branches[n],t);break;case 10:case 11:case 1:case 0:!function(e,t){let n=0;const i=()=>{n--};for(;n<e.children.length;n++){const r=e.children[n];Zx(r)||(t.grandParent=t.parent,t.parent=e,t.childIndex=n,t.onNodeRemoved=i,UF(r,t))}}(e,t)}t.currentNode=e;let r=i.length;for(;r--;)i[r]()}function VF(e,t){const n=Zx(e)?t=>t===e:t=>e.test(t);return(e,i)=>{if(1===e.type){const{props:r}=e;if(3===e.tagType&&r.some($D))return;const s=[];for(let o=0;o<r.length;o++){const a=r[o];if(7===a.type&&n(a.name)){r.splice(o,1),o--;const n=t(e,a,i);n&&s.push(n)}}return s}}}const zF="/*@__PURE__*/",jF=e=>`${ZN[e]}: _${ZN[e]}`;function YF(e,t={}){const n=function(e,{mode:t="function",prefixIdentifiers:n="module"===t,sourceMap:i=!1,filename:r="template.vue.html",scopeId:s=null,optimizeImports:o=!1,runtimeGlobalName:a="Vue",runtimeModuleName:l="vue",ssrRuntimeModuleName:u="vue/server-renderer",ssr:c=!1,isTS:d=!1,inSSR:h=!1}){const p={mode:t,prefixIdentifiers:n,sourceMap:i,filename:r,scopeId:s,optimizeImports:o,runtimeGlobalName:a,runtimeModuleName:l,ssrRuntimeModuleName:u,ssr:c,isTS:d,inSSR:h,source:e.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper:e=>`_${ZN[e]}`,push(e,t=-2,n){p.code+=e},indent(){f(++p.indentLevel)},deindent(e=!1){e?--p.indentLevel:f(--p.indentLevel)},newline(){f(p.indentLevel)}};function f(e){p.push("\n"+" ".repeat(e),0)}return p}(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:i,push:r,prefixIdentifiers:s,indent:o,deindent:a,newline:l,scopeId:u,ssr:c}=n,d=Array.from(e.helpers),h=d.length>0,p=!s&&"module"!==i;!function(e,t){const{ssr:n,prefixIdentifiers:i,push:r,newline:s,runtimeModuleName:o,runtimeGlobalName:a,ssrRuntimeModuleName:l}=t,u=a,c=Array.from(e.helpers);if(c.length>0&&(r(`const _Vue = ${u}\n`,-1),e.hoists.length)){r(`const { ${[bN,TN,xN,EN,wN].filter(e=>c.includes(e)).map(jF).join(", ")} } = _Vue\n`,-1)}(function(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:i}=t;i();for(let r=0;r<e.length;r++){const s=e[r];s&&(n(`const _hoisted_${r+1} = `),XF(s,t),i())}t.pure=!1})(e.hoists,t),s(),r("return ")}(e,n);if(r(`function ${c?"ssrRender":"render"}(${(c?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ")}) {`),o(),p&&(r("with (_ctx) {"),o(),h&&(r(`const { ${d.map(jF).join(", ")} } = _Vue\n`,-1),l())),e.components.length&&(GF(e.components,"component",n),(e.directives.length||e.temps>0)&&l()),e.directives.length&&(GF(e.directives,"directive",n),e.temps>0&&l()),e.filters&&e.filters.length&&(l(),GF(e.filters,"filter",n),l()),e.temps>0){r("let ");for(let t=0;t<e.temps;t++)r(`${t>0?", ":""}_temp${t}`)}return(e.components.length||e.directives.length||e.temps)&&(r("\n",0),l()),c||r("return "),e.codegenNode?XF(e.codegenNode,n):r("null"),p&&(a(),r("}")),a(),r("}"),{ast:e,code:n.code,preamble:"",map:n.map?n.map.toJSON():void 0}}function GF(e,t,{helper:n,push:i,newline:r,isTS:s}){const o=n("filter"===t?CN:"component"===t?IN:SN);for(let n=0;n<e.length;n++){let a=e[n];const l=a.endsWith("__self");l&&(a=a.slice(0,-6)),i(`const ${HD(a,t)} = ${o}(${JSON.stringify(a)}${l?", true":""})${s?"!":""}`),n<e.length-1&&r()}}function HF(e,t){const n=e.length>3||!1;t.push("["),n&&t.indent(),WF(e,t,n),n&&t.deindent(),t.push("]")}function WF(e,t,n=!1,i=!0){const{push:r,newline:s}=t;for(let o=0;o<e.length;o++){const a=e[o];Zx(a)?r(a,-3):Hx(a)?HF(a,t):XF(a,t),o<e.length-1&&(n?(i&&r(","),s()):i&&r(", "))}}function XF(e,t){if(Zx(e))t.push(e,-3);else if(Qx(e))t.push(t.helper(e));else switch(e.type){case 1:case 9:case 11:case 12:XF(e.codegenNode,t);break;case 2:!function(e,t){t.push(JSON.stringify(e.content),-3,e)}(e,t);break;case 4:qF(e,t);break;case 5:!function(e,t){const{push:n,helper:i,pure:r}=t;r&&n(zF);n(`${i(NN)}(`),XF(e.content,t),n(")")}(e,t);break;case 8:KF(e,t);break;case 3:!function(e,t){const{push:n,helper:i,pure:r}=t;r&&n(zF);n(`${i(xN)}(${JSON.stringify(e.content)})`,-3,e)}(e,t);break;case 13:!function(e,t){const{push:n,helper:i,pure:r}=t,{tag:s,props:o,children:a,patchFlag:l,dynamicProps:u,directives:c,isBlock:d,disableTracking:h,isComponent:p}=e;let f;l&&(f=String(l));c&&n(i(ON)+"(");d&&n(`(${i(_N)}(${h?"true":""}), `);r&&n(zF);const m=d?uD(t.inSSR,p):lD(t.inSSR,p);n(i(m)+"(",-2,e),WF(function(e){let t=e.length;for(;t--&&null==e[t];);return e.slice(0,t+1).map(e=>e||"null")}([s,o,a,f,u]),t),n(")"),d&&n(")");c&&(n(", "),XF(c,t),n(")"))}(e,t);break;case 14:!function(e,t){const{push:n,helper:i,pure:r}=t,s=Zx(e.callee)?e.callee:i(e.callee);r&&n(zF);n(s+"(",-2,e),WF(e.arguments,t),n(")")}(e,t);break;case 15:!function(e,t){const{push:n,indent:i,deindent:r,newline:s}=t,{properties:o}=e;if(!o.length)return void n("{}",-2,e);const a=o.length>1||!1;n(a?"{":"{ "),a&&i();for(let e=0;e<o.length;e++){const{key:i,value:r}=o[e];ZF(i,t),n(": "),XF(r,t),e<o.length-1&&(n(","),s())}a&&r(),n(a?"}":" }")}(e,t);break;case 17:!function(e,t){HF(e.elements,t)}(e,t);break;case 18:!function(e,t){const{push:n,indent:i,deindent:r}=t,{params:s,returns:o,body:a,newline:l,isSlot:u}=e;u&&n(`_${ZN[HN]}(`);n("(",-2,e),Hx(s)?WF(s,t):s&&XF(s,t);n(") => "),(l||a)&&(n("{"),i());o?(l&&n("return "),Hx(o)?HF(o,t):XF(o,t)):a&&XF(a,t);(l||a)&&(r(),n("}"));u&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}(e,t);break;case 19:!function(e,t){const{test:n,consequent:i,alternate:r,newline:s}=e,{push:o,indent:a,deindent:l,newline:u}=t;if(4===n.type){const e=!SD(n.content);e&&o("("),qF(n,t),e&&o(")")}else o("("),XF(n,t),o(")");s&&a(),t.indentLevel++,s||o(" "),o("? "),XF(i,t),t.indentLevel--,s&&u(),s||o(" "),o(": ");const c=19===r.type;c||t.indentLevel++;XF(r,t),c||t.indentLevel--;s&&l(!0)}(e,t);break;case 20:!function(e,t){const{push:n,helper:i,indent:r,deindent:s,newline:o}=t,{needPauseTracking:a,needArraySpread:l}=e;l&&n("[...(");n(`_cache[${e.index}] || (`),a&&(r(),n(`${i(jN)}(-1`),e.inVOnce&&n(", true"),n("),"),o(),n("("));n(`_cache[${e.index}] = `),XF(e.value,t),a&&(n(`).cacheIndex = ${e.index},`),o(),n(`${i(jN)}(1),`),o(),n(`_cache[${e.index}]`),s());n(")"),l&&n(")]")}(e,t);break;case 21:WF(e.body,t,!0,!1)}}function qF(e,t){const{content:n,isStatic:i}=e;t.push(i?JSON.stringify(n):n,-3,e)}function KF(e,t){for(let n=0;n<e.children.length;n++){const i=e.children[n];Zx(i)?t.push(i,-3):XF(i,t)}}function ZF(e,t){const{push:n}=t;if(8===e.type)n("["),KF(e,t),n("]");else if(e.isStatic){n(SD(e.content)?e.content:JSON.stringify(e.content),-2,e)}else n(`[${e.content}]`,-3,e)}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const QF=VF(/^(if|else|else-if)$/,(e,t,n)=>function(e,t,n,i){if(!("else"===t.name||t.exp&&t.exp.content.trim())){const i=t.exp?t.exp.loc:e.loc;n.onError(ED(28,t.loc)),t.exp=iD("true",!1,i)}0;if("if"===t.name){const r=JF(e,t),s={type:9,loc:wF(e.loc),branches:[r]};if(n.replaceNode(s),i)return i(s,r,!0)}else{const r=n.parent.children;let s=r.indexOf(e);for(;s-- >=-1;){const o=r[s];if(o&&3===o.type)n.removeNode(o);else{if(!o||2!==o.type||o.content.trim().length){if(o&&9===o.type){"else-if"===t.name&&void 0===o.branches[o.branches.length-1].condition&&n.onError(ED(30,e.loc)),n.removeNode();const r=JF(e,t);0,o.branches.push(r);const s=i&&i(o,r,!1);UF(r,n),s&&s(),n.currentNode=null}else n.onError(ED(30,e.loc));break}n.removeNode(o)}}}}(e,t,n,(e,t,i)=>{const r=n.parent.children;let s=r.indexOf(e),o=0;for(;s-- >=0;){const e=r[s];e&&9===e.type&&(o+=e.branches.length)}return()=>{if(i)e.codegenNode=eL(t,o,n);else{const i=function(e){for(;;)if(19===e.type){if(19!==e.alternate.type)return e;e=e.alternate}else 20===e.type&&(e=e.value)}(e.codegenNode);i.alternate=eL(t,o+e.branches.length-1,n)}}}));function JF(e,t){const n=3===e.tagType;return{type:10,loc:e.loc,condition:"else"===t.name?void 0:t.exp,children:n&&!FD(e,"for")?e.children:[e],userKey:LD(e,"key"),isTemplateIf:n}}function eL(e,t,n){return e.condition?aD(e.condition,tL(e,t,n),sD(n.helper(xN),['""',"true"])):tL(e,t,n)}function tL(e,t,n){const{helper:i}=n,r=nD("key",iD(`${t}`,!1,QN,2)),{children:s}=e,o=s[0];if(1!==s.length||1!==o.type){if(1===s.length&&11===o.type){const e=o.codegenNode;return YD(e,r,n),e}{let t=64;return JN(n,i(hN),tD([r]),s,t,void 0,void 0,!0,!1,!1,e.loc)}}{const e=o.codegenNode,t=14===(a=e).type&&a.callee===qN?a.arguments[1].returns:a;return 13===t.type&&cD(t,n),YD(t,r,n),e}var a}const nL=(e,t,n)=>{const{modifiers:i,loc:r}=e,s=e.arg;let{exp:o}=e;if(o&&4===o.type&&!o.content.trim()&&(o=void 0),!o){if(4!==s.type||!s.isStatic)return n.onError(ED(52,s.loc)),{props:[nD(s,iD("",!0,r))]};iL(e),o=e.exp}return 4!==s.type?(s.children.unshift("("),s.children.push(') || ""')):s.isStatic||(s.content=`${s.content} || ""`),i.some(e=>"camel"===e.content)&&(4===s.type?s.isStatic?s.content=cE(s.content):s.content=`${n.helperString(UN)}(${s.content})`:(s.children.unshift(`${n.helperString(UN)}(`),s.children.push(")"))),n.inSSR||(i.some(e=>"prop"===e.content)&&rL(s,"."),i.some(e=>"attr"===e.content)&&rL(s,"^")),{props:[nD(s,o)]}},iL=(e,t)=>{const n=e.arg,i=cE(n.content);e.exp=iD(i,!1,n.loc)},rL=(e,t)=>{4===e.type?e.isStatic?e.content=t+e.content:e.content=`\`${t}\${${e.content}}\``:(e.children.unshift(`'${t}' + (`),e.children.push(")"))},sL=VF("for",(e,t,n)=>{const{helper:i,removeHelper:r}=n;return function(e,t,n,i){if(!t.exp)return void n.onError(ED(31,t.loc));const r=t.forParseResult;if(!r)return void n.onError(ED(32,t.loc));oL(r,n);const{addIdentifiers:s,removeIdentifiers:o,scopes:a}=n,{source:l,value:u,key:c,index:d}=r,h={type:11,loc:t.loc,source:l,valueAlias:u,keyAlias:c,objectIndexAlias:d,parseResult:r,children:UD(e)?e.children:[e]};n.replaceNode(h),a.vFor++;const p=i&&i(h);return()=>{a.vFor--,p&&p()}}(e,t,n,t=>{const s=sD(i(MN),[t.source]),o=UD(e),a=FD(e,"memo"),l=LD(e,"key",!1,!0);l&&7===l.type&&!l.exp&&iL(l);let u=l&&(6===l.type?l.value?iD(l.value.content,!0):void 0:l.exp);const c=l&&u?nD("key",u):null,d=4===t.source.type&&t.source.constType>0,h=d?64:l?128:256;return t.codegenNode=JN(n,i(hN),void 0,s,h,void 0,void 0,!0,!d,!1,e.loc),()=>{let l;const{children:h}=t;const p=1!==h.length||1!==h[0].type,f=VD(e)?e:o&&1===e.children.length&&VD(e.children[0])?e.children[0]:null;if(f?(l=f.codegenNode,o&&c&&YD(l,c,n)):p?l=JN(n,i(hN),c?tD([c]):void 0,e.children,64,void 0,void 0,!0,void 0,!1):(l=h[0].codegenNode,o&&c&&YD(l,c,n),l.isBlock!==!d&&(l.isBlock?(r(_N),r(uD(n.inSSR,l.isComponent))):r(lD(n.inSSR,l.isComponent))),l.isBlock=!d,l.isBlock?(i(_N),i(uD(n.inSSR,l.isComponent))):i(lD(n.inSSR,l.isComponent))),a){const e=oD(aL(t.parseResult,[iD("_cached")]));e.body={type:21,body:[rD(["const _memo = (",a.exp,")"]),rD(["if (_cached",...u?[" && _cached.key === ",u]:[],` && ${n.helperString(KN)}(_cached, _memo)) return _cached`]),rD(["const _item = ",l]),iD("_item.memo = _memo"),iD("return _item")],loc:QN},s.arguments.push(e,iD("_cache"),iD(String(n.cached.length))),n.cached.push(null)}else s.arguments.push(oD(aL(t.parseResult),l,!0))}})});function oL(e,t){e.finalized||(e.finalized=!0)}function aL({value:e,key:t,index:n},i=[]){return function(e){let t=e.length;for(;t--&&!e[t];);return e.slice(0,t+1).map((e,t)=>e||iD("_".repeat(t+1),!1))}([e,t,n,...i])}const lL=iD("undefined",!1),uL=(e,t)=>{if(1===e.type&&(1===e.tagType||3===e.tagType)){const n=FD(e,"slot");if(n)return n.exp,t.scopes.vSlot++,()=>{t.scopes.vSlot--}}},cL=(e,t,n,i)=>oD(e,n,!1,!0,n.length?n[0].loc:i);function dL(e,t,n=cL){t.helper(HN);const{children:i,loc:r}=e,s=[],o=[];let a=t.scopes.vSlot>0||t.scopes.vFor>0;const l=FD(e,"slot",!0);if(l){const{arg:e,exp:t}=l;e&&!wD(e)&&(a=!0),s.push(nD(e||iD("default",!0),n(t,void 0,i,r)))}let u=!1,c=!1;const d=[],h=new Set;let p=0;for(let e=0;e<i.length;e++){const r=i[e];let f;if(!UD(r)||!(f=FD(r,"slot",!0))){3!==r.type&&d.push(r);continue}if(l){t.onError(ED(37,f.loc));break}u=!0;const{children:m,loc:g}=r,{arg:_=iD("default",!0),exp:y,loc:v}=f;let b;wD(_)?b=_?_.content:"default":a=!0;const T=FD(r,"for"),x=n(y,T,m,g);let E,w;if(E=FD(r,"if"))a=!0,o.push(aD(E.exp,hL(_,x,p++),lL));else if(w=FD(r,/^else(-if)?$/,!0)){let n,r=e;for(;r--&&(n=i[r],3===n.type););if(n&&UD(n)&&FD(n,/^(else-)?if$/)){let e=o[o.length-1];for(;19===e.alternate.type;)e=e.alternate;e.alternate=w.exp?aD(w.exp,hL(_,x,p++),lL):hL(_,x,p++)}else t.onError(ED(30,w.loc))}else if(T){a=!0;const e=T.forParseResult;e?(oL(e),o.push(sD(t.helper(MN),[e.source,oD(aL(e),hL(_,x),!0)]))):t.onError(ED(32,T.loc))}else{if(b){if(h.has(b)){t.onError(ED(38,v));continue}h.add(b),"default"===b&&(c=!0)}s.push(nD(_,x))}}if(!l){const e=(e,i)=>{const s=n(e,void 0,i,r);return t.compatConfig&&(s.isNonScopedSlot=!0),nD("default",s)};u?d.length&&d.some(e=>fL(e))&&(c?t.onError(ED(39,d[0].loc)):s.push(e(void 0,d))):s.push(e(void 0,i))}const f=a?2:pL(e.children)?3:1;let m=tD(s.concat(nD("_",iD(f+"",!1))),r);return o.length&&(m=sD(t.helper(RN),[m,eD(o)])),{slots:m,hasDynamicSlots:a}}function hL(e,t,n){const i=[nD("name",e),nD("fn",t)];return null!=n&&i.push(nD("key",iD(String(n),!0))),tD(i)}function pL(e){for(let t=0;t<e.length;t++){const n=e[t];switch(n.type){case 1:if(2===n.tagType||pL(n.children))return!0;break;case 9:if(pL(n.branches))return!0;break;case 10:case 11:if(pL(n.children))return!0}}return!1}function fL(e){return 2!==e.type&&12!==e.type||(2===e.type?!!e.content.trim():fL(e.content))}const mL=new WeakMap,gL=(e,t)=>function(){if(1!==(e=t.currentNode).type||0!==e.tagType&&1!==e.tagType)return;const{tag:n,props:i}=e,r=1===e.tagType;let s=r?function(e,t,n=!1){let{tag:i}=e;const r=bL(i),s=LD(e,"is",!1,!0);if(s)if(r||vD("COMPILER_IS_ON_ELEMENT",t)){let e;if(6===s.type?e=s.value&&iD(s.value.content,!0):(e=s.exp,e||(e=iD("is",!1,s.arg.loc))),e)return sD(t.helper(AN),[e])}else 6===s.type&&s.value.content.startsWith("vue:")&&(i=s.value.content.slice(4));const o=ID(i)||t.isBuiltInComponent(i);if(o)return n||t.helper(o),o;return t.helper(IN),t.components.add(i),HD(i,"component")}(e,t):`"${n}"`;const o=Jx(s)&&s.callee===AN;let a,l,u,c,d,h=0,p=o||s===pN||s===fN||!r&&("svg"===n||"foreignObject"===n||"math"===n);if(i.length>0){const n=_L(e,t,void 0,r,o);a=n.props,h=n.patchFlag,c=n.dynamicPropNames;const i=n.directives;d=i&&i.length?eD(i.map(e=>function(e,t){const n=[],i=mL.get(e);i?n.push(t.helperString(i)):(t.helper(SN),t.directives.add(e.name),n.push(HD(e.name,"directive")));const{loc:r}=e;e.exp&&n.push(e.exp);e.arg&&(e.exp||n.push("void 0"),n.push(e.arg));if(Object.keys(e.modifiers).length){e.arg||(e.exp||n.push("void 0"),n.push("void 0"));const t=iD("true",!1,r);n.push(tD(e.modifiers.map(e=>nD(e,t)),r))}return eD(n,e.loc)}(e,t))):void 0,n.shouldUseBlock&&(p=!0)}if(e.children.length>0){s===mN&&(p=!0,h|=1024);if(r&&s!==pN&&s!==mN){const{slots:n,hasDynamicSlots:i}=dL(e,t);l=n,i&&(h|=1024)}else if(1===e.children.length&&s!==pN){const n=e.children[0],i=n.type,r=5===i||8===i;r&&0===NF(n,t)&&(h|=1),l=r||2===i?n:e.children}else l=e.children}c&&c.length&&(u=function(e){let t="[";for(let n=0,i=e.length;n<i;n++)t+=JSON.stringify(e[n]),n<i-1&&(t+=", ");return t+"]"}(c)),e.codegenNode=JN(t,s,a,l,0===h?void 0:h,u,d,!!p,!1,r,e.loc)};function _L(e,t,n=e.props,i,r,s=!1){const{tag:o,loc:a,children:l}=e;let u=[];const c=[],d=[],h=l.length>0;let p=!1,f=0,m=!1,g=!1,_=!1,y=!1,v=!1,b=!1;const T=[],x=e=>{u.length&&(c.push(tD(yL(u),a)),u=[]),e&&c.push(e)},E=()=>{t.scopes.vFor>0&&u.push(nD(iD("ref_for",!0),iD("true")))},w=({key:e,value:n})=>{if(wD(e)){const s=e.content,o=Ux(s);if(!o||i&&!r||"onclick"===s.toLowerCase()||"onUpdate:modelValue"===s||oE(s)||(y=!0),o&&oE(s)&&(b=!0),o&&14===n.type&&(n=n.arguments[0]),20===n.type||(4===n.type||8===n.type)&&NF(n,t)>0)return;"ref"===s?m=!0:"class"===s?g=!0:"style"===s?_=!0:"key"===s||T.includes(s)||T.push(s),!i||"class"!==s&&"style"!==s||T.includes(s)||T.push(s)}else v=!0};for(let r=0;r<n.length;r++){const l=n[r];if(6===l.type){const{loc:e,name:n,nameLoc:i,value:r}=l;let s=!0;if("ref"===n&&(m=!0,E()),"is"===n&&(bL(o)||r&&r.content.startsWith("vue:")||vD("COMPILER_IS_ON_ELEMENT",t)))continue;u.push(nD(iD(n,!0,i),iD(r?r.content:"",s,r?r.loc:e)))}else{const{name:n,arg:r,exp:m,loc:g,modifiers:_}=l,y="bind"===n,b="on"===n;if("slot"===n){i||t.onError(ED(40,g));continue}if("once"===n||"memo"===n)continue;if("is"===n||y&&PD(r,"is")&&(bL(o)||vD("COMPILER_IS_ON_ELEMENT",t)))continue;if(b&&s)continue;if((y&&PD(r,"key")||b&&h&&PD(r,"vue:before-update"))&&(p=!0),y&&PD(r,"ref")&&E(),!r&&(y||b)){if(v=!0,m)if(y){if(E(),x(),vD("COMPILER_V_BIND_OBJECT_ORDER",t)){c.unshift(m);continue}c.push(m)}else x({type:14,loc:g,callee:t.helper($N),arguments:i?[m]:[m,"true"]});else t.onError(ED(y?34:35,g));continue}y&&_.some(e=>"prop"===e.content)&&(f|=32);const T=t.directiveTransforms[n];if(T){const{props:n,needRuntime:i}=T(l,e,t);!s&&n.forEach(w),b&&r&&!wD(r)?x(tD(n,a)):u.push(...n),i&&(d.push(l),Qx(i)&&mL.set(l,i))}else aE(n)||(d.push(l),h&&(p=!0))}}let I;if(c.length?(x(),I=c.length>1?sD(t.helper(DN),c,a):c[0]):u.length&&(I=tD(yL(u),a)),v?f|=16:(g&&!i&&(f|=2),_&&!i&&(f|=4),T.length&&(f|=8),y&&(f|=32)),p||0!==f&&32!==f||!(m||b||d.length>0)||(f|=512),!t.inSSR&&I)switch(I.type){case 15:let e=-1,n=-1,i=!1;for(let t=0;t<I.properties.length;t++){const r=I.properties[t].key;wD(r)?"class"===r.content?e=t:"style"===r.content&&(n=t):r.isHandlerKey||(i=!0)}const r=I.properties[e],s=I.properties[n];i?I=sD(t.helper(PN),[I]):(r&&!wD(r.value)&&(r.value=sD(t.helper(FN),[r.value])),s&&(_||4===s.value.type&&"["===s.value.content.trim()[0]||17===s.value.type)&&(s.value=sD(t.helper(LN),[s.value])));break;case 14:break;default:I=sD(t.helper(PN),[sD(t.helper(BN),[I])])}return{props:I,directives:d,patchFlag:f,dynamicPropNames:T,shouldUseBlock:p}}function yL(e){const t=new Map,n=[];for(let i=0;i<e.length;i++){const r=e[i];if(8===r.key.type||!r.key.isStatic){n.push(r);continue}const s=r.key.content,o=t.get(s);o?("style"===s||"class"===s||Ux(s))&&vL(o,r):(t.set(s,r),n.push(r))}return n}function vL(e,t){17===e.value.type?e.value.elements.push(t.value):e.value=eD([e.value,t.value],e.loc)}function bL(e){return"component"===e||"Component"===e}const TL=(e,t)=>{if(VD(e)){const{children:n,loc:i}=e,{slotName:r,slotProps:s}=function(e,t){let n,i='"default"';const r=[];for(let t=0;t<e.props.length;t++){const n=e.props[t];if(6===n.type)n.value&&("name"===n.name?i=JSON.stringify(n.value.content):(n.name=cE(n.name),r.push(n)));else if("bind"===n.name&&PD(n.arg,"name")){if(n.exp)i=n.exp;else if(n.arg&&4===n.arg.type){const e=cE(n.arg.content);i=n.exp=iD(e,!1,n.arg.loc)}}else"bind"===n.name&&n.arg&&wD(n.arg)&&(n.arg.content=cE(n.arg.content)),r.push(n)}if(r.length>0){const{props:i,directives:s}=_L(e,t,r,!1,!1);n=i,s.length&&t.onError(ED(36,s[0].loc))}return{slotName:i,slotProps:n}}(e,t),o=[t.prefixIdentifiers?"_ctx.$slots":"$slots",r,"{}","undefined","true"];let a=2;s&&(o[2]=s,a=3),n.length&&(o[3]=oD([],n,!1,!1,i),a=4),t.scopeId&&!t.slotted&&(a=5),o.splice(a),e.codegenNode=sD(t.helper(kN),o,i)}};const xL=(e,t,n,i)=>{const{loc:r,modifiers:s,arg:o}=e;let a;if(e.exp||s.length||n.onError(ED(35,r)),4===o.type)if(o.isStatic){let e=o.content;0,e.startsWith("vue:")&&(e=`vnode-${e.slice(4)}`);a=iD(0!==t.tagType||e.startsWith("vnode")||!/[A-Z]/.test(e)?fE(cE(e)):`on:${e}`,!0,o.loc)}else a=rD([`${n.helperString(zN)}(`,o,")"]);else a=o,a.children.unshift(`${n.helperString(zN)}(`),a.children.push(")");let l=e.exp;l&&!l.content.trim()&&(l=void 0);let u=n.cacheHandlers&&!l&&!n.inVOnce;if(l){const e=RD(l),t=!(e||DD(l)),n=l.content.includes(";");0,(t||u&&e)&&(l=rD([`${t?"$event":"(...args)"} => ${n?"{":"("}`,l,n?"}":")"]))}let c={props:[nD(a,l||iD("() => {}",!1,r))]};return i&&(c=i(c)),u&&(c.props[0].value=n.cache(c.props[0].value)),c.props.forEach(e=>e.key.isHandlerKey=!0),c},EL=(e,t)=>{if(0===e.type||1===e.type||11===e.type||10===e.type)return()=>{const n=e.children;let i,r=!1;for(let e=0;e<n.length;e++){const t=n[e];if(BD(t)){r=!0;for(let r=e+1;r<n.length;r++){const s=n[r];if(!BD(s)){i=void 0;break}i||(i=n[e]=rD([t],t.loc)),i.children.push(" + ",s),n.splice(r,1),r--}}}if(r&&(1!==n.length||0!==e.type&&(1!==e.type||0!==e.tagType||e.props.find(e=>7===e.type&&!t.directiveTransforms[e.name])||"template"===e.tag)))for(let e=0;e<n.length;e++){const i=n[e];if(BD(i)||8===i.type){const r=[];2===i.type&&" "===i.content||r.push(i),t.ssr||0!==NF(i,t)||r.push("1"),n[e]={type:12,content:i,loc:i.loc,codegenNode:sD(t.helper(EN),r)}}}}},wL=new WeakSet,IL=(e,t)=>{if(1===e.type&&FD(e,"once",!0)){if(wL.has(e)||t.inVOnce||t.inSSR)return;return wL.add(e),t.inVOnce=!0,t.helper(jN),()=>{t.inVOnce=!1;const e=t.currentNode;e.codegenNode&&(e.codegenNode=t.cache(e.codegenNode,!0,!0))}}},AL=(e,t,n)=>{const{exp:i,arg:r}=e;if(!i)return n.onError(ED(41,e.loc)),SL();const s=i.loc.source.trim(),o=4===i.type?i.content:s,a=n.bindingMetadata[s];if("props"===a||"props-aliased"===a)return n.onError(ED(44,i.loc)),SL();if(!o.trim()||!RD(i))return n.onError(ED(42,i.loc)),SL();const l=r||iD("modelValue",!0),u=r?wD(r)?`onUpdate:${cE(r.content)}`:rD(['"onUpdate:" + ',r]):"onUpdate:modelValue";let c;c=rD([`${n.isTS?"($event: any)":"$event"} => ((`,i,") = $event)"]);const d=[nD(l,e.exp),nD(u,c)];if(e.modifiers.length&&1===t.tagType){const t=e.modifiers.map(e=>e.content).map(e=>(SD(e)?e:JSON.stringify(e))+": true").join(", "),n=r?wD(r)?`${r.content}Modifiers`:rD([r,' + "Modifiers"']):"modelModifiers";d.push(nD(n,iD(`{ ${t} }`,!1,e.loc,2)))}return SL(d)};function SL(e=[]){return{props:e}}const CL=/[\w).+\-_$\]]/,OL=(e,t)=>{vD("COMPILER_FILTERS",t)&&(5===e.type?ML(e.content,t):1===e.type&&e.props.forEach(e=>{7===e.type&&"for"!==e.name&&e.exp&&ML(e.exp,t)}))};function ML(e,t){if(4===e.type)kL(e,t);else for(let n=0;n<e.children.length;n++){const i=e.children[n];"object"==typeof i&&(4===i.type?kL(i,t):8===i.type?ML(e,t):5===i.type&&ML(i.content,t))}}function kL(e,t){const n=e.content;let i,r,s,o,a=!1,l=!1,u=!1,c=!1,d=0,h=0,p=0,f=0,m=[];for(s=0;s<n.length;s++)if(r=i,i=n.charCodeAt(s),a)39===i&&92!==r&&(a=!1);else if(l)34===i&&92!==r&&(l=!1);else if(u)96===i&&92!==r&&(u=!1);else if(c)47===i&&92!==r&&(c=!1);else if(124!==i||124===n.charCodeAt(s+1)||124===n.charCodeAt(s-1)||d||h||p){switch(i){case 34:l=!0;break;case 39:a=!0;break;case 96:u=!0;break;case 40:p++;break;case 41:p--;break;case 91:h++;break;case 93:h--;break;case 123:d++;break;case 125:d--}if(47===i){let e,t=s-1;for(;t>=0&&(e=n.charAt(t)," "===e);t--);e&&CL.test(e)||(c=!0)}}else void 0===o?(f=s+1,o=n.slice(0,s).trim()):g();function g(){m.push(n.slice(f,s).trim()),f=s+1}if(void 0===o?o=n.slice(0,s).trim():0!==f&&g(),m.length){for(s=0;s<m.length;s++)o=RL(o,m[s],t);e.content=o,e.ast=void 0}}function RL(e,t,n){n.helper(CN);const i=t.indexOf("(");if(i<0)return n.filters.add(t),`${HD(t,"filter")}(${e})`;{const r=t.slice(0,i),s=t.slice(i+1);return n.filters.add(r),`${HD(r,"filter")}(${e}${")"!==s?","+s:s}`}}const NL=new WeakSet,DL=(e,t)=>{if(1===e.type){const n=FD(e,"memo");if(!n||NL.has(e))return;return NL.add(e),()=>{const i=e.codegenNode||t.currentNode.codegenNode;i&&13===i.type&&(1!==e.tagType&&cD(i,t),e.codegenNode=sD(t.helper(qN),[n.exp,oD(void 0,i),"_cache",String(t.cached.length)]),t.cached.push(null))}}};function FL(e,t={}){const n=t.onError||TD,i="module"===t.mode;!0===t.prefixIdentifiers?n(ED(47)):i&&n(ED(48));t.cacheHandlers&&n(ED(49)),t.scopeId&&!i&&n(ED(50));const r=zx({},t,{prefixIdentifiers:!1}),s=Zx(e)?OF(e,r):e,[o,a]=[[IL,QF,DL,sL,OL,TL,gL,uL,EL],{on:xL,bind:nL,model:AL}];return $F(s,zx({},r,{nodeTransforms:[...o,...t.nodeTransforms||[]],directiveTransforms:zx({},a,t.directiveTransforms||{})})),YF(s,r)}const LL=Symbol(""),PL=Symbol(""),BL=Symbol(""),$L=Symbol(""),UL=Symbol(""),VL=Symbol(""),zL=Symbol(""),jL=Symbol(""),YL=Symbol(""),GL=Symbol("");var HL;let WL;HL={[LL]:"vModelRadio",[PL]:"vModelCheckbox",[BL]:"vModelText",[$L]:"vModelSelect",[UL]:"vModelDynamic",[VL]:"withModifiers",[zL]:"withKeys",[jL]:"vShow",[YL]:"Transition",[GL]:"TransitionGroup"},Object.getOwnPropertySymbols(HL).forEach(e=>{ZN[e]=HL[e]});const XL={parseMode:"html",isVoidTag:NE,isNativeTag:e=>ME(e)||kE(e)||RE(e),isPreTag:e=>"pre"===e,isIgnoreNewlineTag:e=>"pre"===e||"textarea"===e,decodeEntities:function(e,t=!1){return WL||(WL=document.createElement("div")),t?(WL.innerHTML=`<div foo="${e.replace(/"/g,"&quot;")}">`,WL.children[0].getAttribute("foo")):(WL.innerHTML=e,WL.textContent)},isBuiltInComponent:e=>"Transition"===e||"transition"===e?YL:"TransitionGroup"===e||"transition-group"===e?GL:void 0,getNamespace(e,t,n){let i=t?t.ns:n;if(t&&2===i)if("annotation-xml"===t.tag){if("svg"===e)return 1;t.props.some(e=>6===e.type&&"encoding"===e.name&&null!=e.value&&("text/html"===e.value.content||"application/xhtml+xml"===e.value.content))&&(i=0)}else/^m(?:[ions]|text)$/.test(t.tag)&&"mglyph"!==e&&"malignmark"!==e&&(i=0);else t&&1===i&&("foreignObject"!==t.tag&&"desc"!==t.tag&&"title"!==t.tag||(i=0));if(0===i){if("svg"===e)return 1;if("math"===e)return 2}return i}},qL=(e,t)=>{const n=SE(e);return iD(JSON.stringify(n),!1,t,3)};function KL(e,t){return ED(e,t)}const ZL=Fx("passive,once,capture"),QL=Fx("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),JL=Fx("left,right"),eP=Fx("onkeyup,onkeydown,onkeypress"),tP=(e,t)=>wD(e)&&"onclick"===e.content.toLowerCase()?iD(t,!0):4!==e.type?rD(["(",e,`) === "onClick" ? "${t}" : (`,e,")"]):e;const nP=(e,t)=>{1!==e.type||0!==e.tagType||"script"!==e.tag&&"style"!==e.tag||t.removeNode()};const iP=[e=>{1===e.type&&e.props.forEach((t,n)=>{6===t.type&&"style"===t.name&&t.value&&(e.props[n]={type:7,name:"bind",arg:iD("style",!0,t.loc),exp:qL(t.value.content,t.loc),modifiers:[],loc:t.loc})})}],rP={cloak:()=>({props:[]}),html:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(KL(53,r)),t.children.length&&(n.onError(KL(54,r)),t.children.length=0),{props:[nD(iD("innerHTML",!0,r),i||iD("",!0))]}},text:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(KL(55,r)),t.children.length&&(n.onError(KL(56,r)),t.children.length=0),{props:[nD(iD("textContent",!0),i?NF(i,n)>0?i:sD(n.helperString(NN),[i],r):iD("",!0))]}},model:(e,t,n)=>{const i=AL(e,t,n);if(!i.props.length||1===t.tagType)return i;e.arg&&n.onError(KL(58,e.arg.loc));const{tag:r}=t,s=n.isCustomElement(r);if("input"===r||"textarea"===r||"select"===r||s){let o=BL,a=!1;if("input"===r||s){const i=LD(t,"type");if(i){if(7===i.type)o=UL;else if(i.value)switch(i.value.content){case"radio":o=LL;break;case"checkbox":o=PL;break;case"file":a=!0,n.onError(KL(59,e.loc))}}else(function(e){return e.props.some(e=>!(7!==e.type||"bind"!==e.name||e.arg&&4===e.arg.type&&e.arg.isStatic))})(t)&&(o=UL)}else"select"===r&&(o=$L);a||(i.needRuntime=n.helper(o))}else n.onError(KL(57,e.loc));return i.props=i.props.filter(e=>!(4===e.key.type&&"modelValue"===e.key.content)),i},on:(e,t,n)=>xL(e,t,n,t=>{const{modifiers:i}=e;if(!i.length)return t;let{key:r,value:s}=t.props[0];const{keyModifiers:o,nonKeyModifiers:a,eventOptionModifiers:l}=((e,t,n)=>{const i=[],r=[],s=[];for(let o=0;o<t.length;o++){const a=t[o].content;"native"===a&&bD("COMPILER_V_ON_NATIVE",n)||ZL(a)?s.push(a):JL(a)?wD(e)?eP(e.content.toLowerCase())?i.push(a):r.push(a):(i.push(a),r.push(a)):QL(a)?r.push(a):i.push(a)}return{keyModifiers:i,nonKeyModifiers:r,eventOptionModifiers:s}})(r,i,n,e.loc);if(a.includes("right")&&(r=tP(r,"onContextmenu")),a.includes("middle")&&(r=tP(r,"onMouseup")),a.length&&(s=sD(n.helper(VL),[s,JSON.stringify(a)])),!o.length||wD(r)&&!eP(r.content.toLowerCase())||(s=sD(n.helper(zL),[s,JSON.stringify(o)])),l.length){const e=l.map(pE).join("");r=wD(r)?iD(`${r.content}${e}`,!0):rD(["(",r,`) + "${e}"`])}return{props:[nD(r,s)]}}),show:(e,t,n)=>{const{exp:i,loc:r}=e;return i||n.onError(KL(61,r)),{props:[],needRuntime:n.helper(jL)}}};const sP=Object.create(null);KM(function(e,t){if(!Zx(e)){if(!e.nodeType)return Bx;e=e.innerHTML}const n=function(e,t){return e+JSON.stringify(t,(e,t)=>"function"==typeof t?t.toString():t)}(e,t),i=sP[n];if(i)return i;if("#"===e[0]){const t=document.querySelector(e);0,e=t?t.innerHTML:""}const r=zx({hoistStatic:!0,onError:void 0,onWarn:Bx},t);r.isCustomElement||"undefined"==typeof customElements||(r.isCustomElement=e=>!!customElements.get(e));const{code:s}=function(e,t={}){return FL(e,zx({},XL,t,{nodeTransforms:[nP,...iP,...t.nodeTransforms||[]],directiveTransforms:zx({},rP,t.directiveTransforms||{}),transformHoist:null}))}(e,r),o=new Function("Vue",s)(oe);return o._rc=!0,sP[n]=o});var oP=__webpack_require__(66619),aP=__webpack_require__.n(oP);const lP={stage:new(aP().Container),pointer:{x:0,y:0},backgroundSprite:null,sprites:{},texts:{},counter:0,keys:{},state:!1,running:!1,repeatPlay:()=>{},displayTag:!1,processingDisplayEvent:null,successDisplayEvents:[],successProcessingDisplayEvents:[],startTime:performance.now(),timer:0,lastFrameTime:null,lastSecond:null,targetFPS:60,frameCount:0,currentFPS:60,canvasHeight:450,canvasWidth:800,gameLoop:()=>{1==lP.state&&(lP.repeatPlay(),lP.gameLoopDisplay()),lP.timer=performance.now()-lP.startTime},animate:e=>{e-lP.lastFrameTime>=1e3/lP.targetFPS&&(lP.frameCount++,lP.gameLoop(),lP.renderer.render(lP.stage),lP.lastFrameTime=e),e-lP.lastSecond>=1e3&&(lP.currentFPS=lP.frameCount,lP.frameCount=0,lP.lastSecond=e),requestAnimationFrame(lP.animate)}};lP.createBackground=(e,t=0)=>{var n;return 0==t&&(n=new(aP().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),n.name="background",n.anchor.set(.5),n.x=lP.canvasWidth/2,n.y=lP.canvasHeight/2,n.width=lP.canvasWidth,n.height=lP.canvasHeight,n.interactive=!0,n.buttonMode=!0,n.isDown=!1,n.isUp=!0,n.on("mousedown",function(){this.isDown=!0,this.isUp=!1,lP.state&&this.runningMouseDown()}).on("mouseup",function(){this.isDown=!1,this.isUp=!0}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0}),n.runningMouseDown=new Function(""),lP.backgroundSprite&&lP.backgroundSprite.parent&&lP.stage.removeChild(lP.backgroundSprite),lP.backgroundSprite=n,lP.stage.addChildAt(lP.backgroundSprite,0),0},lP.createASprite=(e,t=lP.canvasWidth/2,n=lP.canvasHeight/2,i="",r=0)=>{var s;return""==i&&(i="sprite"+ ++lP.counter),0==r&&(s=new(aP().Sprite.fromImage)(`../common/media/spriteimg/${e}.png`)),lP.sprites[i]||lP.texts[i]||(s.name=i,s.anchor.set(.5),s.x=t,s.y=n,s.interactive=!0,s.buttonMode=!0,s.isDown=!1,s.isUp=!0,s.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,lP.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,lP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,lP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!lP.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),s.runningMouseDown=new Function(""),s.show=function(){this.visible=!0},s.hide=function(){this.visible=!1},s.enlarge=function(e){const t=this.height/this.width;var n=Math.sqrt(this.height*this.width);n+=e,this.width=Math.sqrt(n*n/t),this.height=this.width*t},s.enlargeTo=function(e){var t=this.height/this.width;this.width=Math.sqrt(e*e/t),this.height=this.width*t},s.expandTo=async function(e,t=1){if(lP.running){lP.displayTag=!0,lP.processingDisplayEvent={sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"};var n=new Promise(e=>{if(!1===lP.displayTag)e();else{const t=setInterval(()=>{!1===lP.displayTag&&(clearInterval(t),e())},10)}});return await n}return lP.successProcessingDisplayEvents.push({sprite:this,targetS:e,totalTime:1e3*t,startTime:performance.now(),displayType:"expand"}),0},s.move=function(e){this.x+=e*Math.cos(this.rotation),this.y+=e*Math.sin(this.rotation)},s.moveTo=function(e,t){this.x=e,this.y=t},s.slideTo=async function(e,t,n=1){if(lP.running){lP.displayTag=!0,lP.processingDisplayEvent={sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"};var i=new Promise(e=>{const t=setInterval(()=>{!1===lP.displayTag&&(clearInterval(t),e())},10)});return await i}return lP.successProcessingDisplayEvents.push({sprite:this,targetX:e,targetY:t,totalTime:1e3*n,startTime:performance.now(),displayType:"slide"}),0},s.addX=function(e){this.x+=e},s.addY=function(e){this.y+=e},s.rotate=function(e){this.rotation+=Math.PI/180*e},s.rotateTo=function(e){this.rotation=Math.PI/180*e},s.circleTo=async function(e,t=1){if(lP.running){lP.displayTag=!0,lP.processingDisplayEvent={sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"};var n=new Promise(e=>{if(!1===lP.displayTag)e();else{const t=setInterval(()=>{!1===lP.displayTag&&(clearInterval(t),e())},10)}});return await n}return lP.successProcessingDisplayEvents.push({sprite:this,targetDegree:e,totalTime:1e3*t,startTime:performance.now(),displayType:"circle"}),0},s.hit=function(e){return lP.hitTestRectangle(this,e)},s.outOfScreen=function(){return this.y>=lP.renderer.height||this.y<=0||this.x<=0||this.x>=lP.renderer.width},s.mouseAction=function(e){this.runningMouseDown=e},s.setScale=function(e=0,t=0){0==e&&(e=this.height),0==t&&(t=this.width),this.height=e,this.width=t},s.filterGray=function(){const e=new(aP().filters.ColorMatrixFilter);e.blackAndWhite(),this.filters=[e]},s.filterBrighter=function(){const e=new(aP().filters.ColorMatrixFilter);e.brightness(1.25),this.filters=[e]},s.filterOrigin=function(){this.filters=null},lP.stage.addChild(s),lP.sprites[i]=s),i},lP.clearAllSprites=()=>{lP.backgroundSprite&&lP.backgroundSprite.parent&&lP.backgroundSprite.parent.removeChild(lP.backgroundSprite);for(const e in lP.sprites)lP.sprites[e].parent.removeChild(lP.sprites[e]),delete lP.sprites[e];for(const e in lP.texts)lP.texts[e].parent.removeChild(lP.texts[e]),delete lP.texts[e];return lP.counter=0,lP.clearTimer(),0},lP.createText=(e,t=lP.canvasWidth/2,n=lP.canvasHeight/2,i="")=>{if(""==i&&(i="text"+ ++lP.counter),!lP.sprites[i]&&!lP.texts[i]){var r=new(aP().Text)(e);r.name=i,r.x=t,r.y=n,r.interactive=!0,r.buttonMode=!0,r.on("mousedown",function(e){this.isDown=!0,this.isUp=!1,lP.state?this.runningMouseDown():(this.data=e.data,this.alpha=.5,this.dragging=!0)}).on("mouseup",function(){this.isDown=!1,this.isUp=!0,lP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mouseupoutside",function(){this.isDown=!1,this.isUp=!0,lP.state||(this.alpha=1,this.dragging=!1,this.data=null)}).on("mousemove",function(){if(!lP.state&&this.dragging){var e=this.data.getLocalPosition(this.parent);this.position.x=e.x,this.position.y=e.y}}),r.runningMouseDown=new Function(""),r.changeText=function(e){this.text=e},r.show=function(){this.visible=!0},r.hide=function(){this.visible=!1},lP.stage.addChild(r),lP.texts[i]=r}return i},lP.hitTestRectangle=(e,t)=>{let n,i,r,s,o;return n=!1,e.centerX=e.x+e.width/2,e.centerY=e.y+e.height/2,t.centerX=t.x+t.width/2,t.centerY=t.y+t.height/2,e.halfWidth=e.width/2,e.halfHeight=e.height/2,t.halfWidth=t.width/2,t.halfHeight=t.height/2,s=e.centerX-t.centerX,o=e.centerY-t.centerY,i=e.halfWidth+t.halfWidth,r=e.halfHeight+t.halfHeight,n=Math.abs(s)<i&&Math.abs(o)<r,n},lP.repeat=e=>{lP.repeatPlay=e},lP.isKeyboardHit=e=>{if(!lP.keys[e]){let t=lP.keyboard(e);lP.keys[e]=t}return lP.keys[e].isDown},lP.keyboardListener=(e,t)=>{if(lP.keys[e])lP.keys[e].press=function(){lP.state&&t()};else{let n=lP.keyboard(e);n.press=function(){lP.state&&t()},lP.keys[e]=n}},lP.keyboard=e=>{let t={};t.value=e,t.isDown=!1,t.isUp=!0,t.press=void 0,t.release=void 0,t.downHandler=e=>{e.key===t.value&&(t.isUp&&t.press&&t.press(),t.isDown=!0,t.isUp=!1,e.preventDefault())},t.upHandler=e=>{e.key===t.value&&(t.isDown&&t.release&&t.release(),t.isDown=!1,t.isUp=!0,e.preventDefault())};const n=t.downHandler.bind(t),i=t.upHandler.bind(t);return window.addEventListener("keydown",n,!1),window.addEventListener("keyup",i,!1),t.unsubscribe=()=>{window.removeEventListener("keydown",n),window.removeEventListener("keyup",i)},t},lP.clearTimer=()=>{lP.startTime=performance.now()},lP.gameLoopDisplay=()=>{if(lP.processingDisplayEvent){const e=lP.processingDisplayEvent;switch(e.displayType){case"slide":if(performance.now()>=e.totalTime+e.startTime)e.sprite.moveTo(e.targetX,e.targetY),lP.displayTag=!1,lP.processingDisplayEvent=null;else(t=lP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&(e.sprite.addX((e.targetX-e.sprite.x)/t),e.sprite.addY((e.targetY-e.sprite.y)/t));break;case"expand":if(performance.now()>=e.totalTime+e.startTime)e.sprite.enlargeTo(e.targetS),lP.displayTag=!1,lP.processingDisplayEvent=null;else(t=lP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.enlarge((e.targetS-Math.sqrt(e.sprite.height*e.sprite.width))/t);break;case"circle":if(performance.now()>=e.totalTime+e.startTime)e.sprite.rotateTo(e.targetDegree),lP.displayTag=!1,lP.processingDisplayEvent=null;else(t=lP.currentFPS*(e.totalTime+e.startTime-performance.now())/1e3)>=1&&e.sprite.rotate((e.targetDegree-180*e.sprite.rotation/Math.PI)/t)}}if(!lP.running&&lP.successProcessingDisplayEvents.length)for(var e=lP.successProcessingDisplayEvents.length-1;e>=0;e--){const n=lP.successProcessingDisplayEvents[e];switch(n.displayType){case"slide":if(performance.now()>=n.totalTime+n.startTime)n.sprite.moveTo(n.targetX,n.targetY),lP.successProcessingDisplayEvents.splice(e,1);else(t=lP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&(n.sprite.addX((n.targetX-n.sprite.x)/t),n.sprite.addY((n.targetY-n.sprite.y)/t));break;case"expand":if(performance.now()>=n.totalTime+n.startTime)n.sprite.enlargeTo(n.targetS),lP.successProcessingDisplayEvents.splice(e,1);else(t=lP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.enlarge((n.targetS-Math.sqrt(n.sprite.height*n.sprite.width))/t);break;case"circle":var t;if(performance.now()>=n.totalTime+n.startTime)n.sprite.rotateTo(n.targetDegree),lP.successProcessingDisplayEvents.splice(e,1);else(t=lP.currentFPS*(n.totalTime+n.startTime-performance.now())/1e3)>=1&&n.sprite.rotate((n.targetDegree-180*n.sprite.rotation/Math.PI)/t)}}},lP.changeWidth=e=>{const t=Dx()(lP.renderer.view),n=t.width(),i=t.height();t.width(e),t.height(e/n*i)},lP.kill=()=>{lP.state=!1,lP.repeatPlay=new Function;for(let e in lP.keys)lP.keys[e].unsubscribe(),delete lP.keys[e];lP.processingDisplayEvent=null,lP.displayTag=!1,lP.running=!1,lP.clearTimer()},lP.runit=e=>{const t=Dx()(e);t.empty(),aP().SCALE_MODES.DEFAULT=aP().SCALE_MODES.NEAREST,lP.renderer=aP().autoDetectRenderer(lP.canvasWidth,lP.canvasHeight,{backgroundColor:16777215}),t.append(lP.renderer.view),lP.pointer={x:0,y:0},lP.stage.sortableChildren=!0,lP.stage.interactive=!0,lP.stage.on("mousemove",(e=aP().InteractionEvent)=>{lP.pointer.x=e.data.global.x,lP.pointer.y=e.data.global.y}),lP.lastFrameTime=0,lP.running=!0,lP.lastFrameTime||(lP.lastFrameTime=performance.now(),lP.lastSecond=performance.now()),lP.animate(performance.now()),lP.repeatPlay=new Function;for(let e in lP.keys)lP.keys[e].unsubscribe(),delete lP.keys[e];lP.backgroundSprite&&(lP.backgroundSprite.runningMouseDown=new Function);for(let e in lP.sprites)lP.sprites[e].runningMouseDown=new Function;for(let e in lP.texts)lP.texts[e].runningMouseDown=new Function;lP.processingDisplayEvent=null,lP.displayTag=!1,lP.clearTimer(),lP.changeWidth(Dx()("body").width()/2),lP.state=!0},window.mixlySprite=lP;const uP=lP;var cP=__webpack_require__(69610);class dP{constructor(e,t){this._pageLoad=new cP.D,this._kernelAvailable=new cP.D,this._loaderId="basthon-loader",this._doNotHideLoader=!0;const n=e.language;if(null!=t&&(this._loaderId=t),"loading"===document.readyState){const e=()=>{document.removeEventListener("DOMContentLoaded",e),this._pageLoad.resolve()};document.addEventListener("DOMContentLoaded",e)}else this._pageLoad.resolve();(async()=>{switch(n){case"python":case"python3":case"python3.11":const{KernelPython3:t}=await __webpack_require__.e(211).then(__webpack_require__.bind(__webpack_require__,20211));this._kernel=new t(e);break;case"python3-old":case"python3.8":const{KernelPython3Old:i}=await __webpack_require__.e(195).then(__webpack_require__.bind(__webpack_require__,95195));this._kernel=new i(e);break;case"js":case"javascript":const{KernelJavaScript:r}=await __webpack_require__.e(97).then(__webpack_require__.bind(__webpack_require__,4097));this._kernel=new r(e);break;case"sql":const{KernelSQL:s}=await Promise.all([__webpack_require__.e(960),__webpack_require__.e(837)]).then(__webpack_require__.bind(__webpack_require__,90592));this._kernel=new s(e);break;case"ocaml":const{KernelOCaml:o}=await __webpack_require__.e(38).then(__webpack_require__.bind(__webpack_require__,50038));this._kernel=new o(e);break;default:return window.console.error(`Kernel '${n}' not supported.`),void this._kernelAvailable.reject()}window.Basthon=this._kernel,this._kernelAvailable.resolve(this._kernel)})()}async pageLoad(){await this._pageLoad.promise}async kernelAvailable(){return await this._kernelAvailable.promise}async kernelLoaded(){const e=await this.kernelAvailable();return await e.loaded(),e}get kernel(){return this._kernel}get kernelSafe(){var e;return(null===(e=this.kernel)||void 0===e?void 0:e.ready)?this.kernel:null}async showLoader(e,t=!1,n=!0){this.kernelAvailable().then(()=>{var e;return null===(e=this.kernel)||void 0===e?void 0:e.init()}),__webpack_require__.e(317).then(__webpack_require__.bind(__webpack_require__,1317));const i="basthon-loader-"+(t?"full":"foot"),r=document.createElement("div");r.id=this._loaderId,r.classList.add("darklighted"),r.classList.add("basthon-loader-root"),r.classList.add(i);const s=document.createElement("div");s.classList.add("basthon-loader-container"),s.classList.add(i),r.appendChild(s);const o=document.createElement("div");o.classList.add("basthon-loader-spinner"),o.classList.add(i),o.innerHTML="<span><span></span><span></span></span>",s.appendChild(o);const a=document.createElement("div");a.classList.add("basthon-loader-break"),a.classList.add(i),s.appendChild(a);const l=document.createElement("div");l.classList.add("basthon-loader-text"),l.classList.add(i),l.innerHTML=e,s.appendChild(l),this._loaderTextElem=l;const u=document.createElement("div");u.classList.add("basthon-loader-text"),u.classList.add(i),u.style.display="none",s.appendChild(u),this._loaderTextError=u,await this.pageLoad(),document.body.appendChild(r),this._rootLoader=r;try{await this.kernelLoaded()}catch(e){const t=this.browser();this.setErrorText(`Erreur de chargement de Basthon !!!<br>Vérifiez que votre navigateur est à jour.<br>Version détectée : ${t.name} ${t.version}.`);for(const e of document.body.querySelectorAll(".basthon-loader-foot"))e.classList.remove("basthon-loader-foot"),e.classList.add("basthon-loader-full");return o.classList.remove("basthon-loader-spinner"),o.classList.add("basthon-loader-error"),void(this._doNotHideLoader=!0)}this._doNotHideLoader=!1,n&&this.hideLoader()}setLoaderText(e){null!=this._loaderTextElem&&(this._loaderTextElem.innerHTML=e)}setErrorText(e){null!=this._loaderTextElem&&(this._loaderTextElem.style.display="none"),null!=this._loaderTextError&&(this._loaderTextError.style.display="",this._loaderTextError.innerHTML=e)}hideLoader(){if(this._doNotHideLoader)return;const e=this._rootLoader;null!=e&&(e.classList.add("basthon-loader-hide"),window.setTimeout(()=>{this._rootLoader=void 0,e.remove()},1100))}browser(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""}:"Chrome"===n[1]&&null!=(e=t.match(/\bOPR|Edge\/(\d+)/))?{name:"Opera",version:e[1]}:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),{name:n[0],version:n[1]})}}class hP extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-image.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n flex-wrap: wrap;\r\n align-content: flex-start;\r\n overflow: auto;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] {\r\n background-color: #ffffff;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] {\r\n background-color: #1e1e1e;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item"></div>')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["images"],hP);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"images",id:"images",name:Ve.Msg.PYTHON_PYODIDE_IMAGE,title:Ve.Msg.PYTHON_PYODIDE_IMAGE}),e.changeTo("output"),e.get("images")}}constructor(){super();const e=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-image.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}clean(){this.getContent().empty()}display(e){const t=this.getContent(),n=function(e){e.style.width="auto",e.style.height="auto",e.style.maxWidth="100%",e.style.maxHeight="100%"};this.clean();let i=e.content,r=null,s=null;switch(e.display_type){case"p5":i.style.width="100%",i.style.height="100%",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",new MutationObserver(function(e){e.forEach(e=>e.addedNodes.forEach(e=>{const t=e;null!=t.tagName&&["canvas","video"].includes(t.tagName.toLowerCase())&&n(t)}))}).observe(i,{childList:!0}),i.querySelectorAll("canvas,video").forEach(n),t.append(i);break;case"matplotlib":r=i.querySelector("canvas"),r&&(i=r),i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"ocaml-canvas":i.style.width="",i.style.height="",i.style.maxWidth="100%",i.style.maxHeight="100%",t.append(i);break;case"turtle":i.setAttribute("width","100%"),i.setAttribute("height","100%"),t.append(i.outerHTML);break;case"sympy":t.append(e.content),void 0===window.MathJax?(console.log("Loading MathJax (Sympy expression needs it)."),function(){let e=document.createElement("script");e.type="text/javascript",e.src="https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js",document.getElementsByTagName("head")[0].appendChild(e)}()):window.MathJax.typeset();break;case"multiple":for(let n of["image/svg+xml","image/png","text/html","text/plain"])if(n in e.content){let i=e.content[n];"image/png"===n&&(i='<img src="data:image/png;base64,'+i+'" style="max-width: 100%; max-height: 100%;">'),t.append(i);break}break;case"tutor":if(t.append(Dx()(e.content.replace("overflow-y%3A%20hidden%3B",""))),s=this.getContent()[0].getElementsByTagName("iframe")[0],null==s)return;s.style.maxHeight=s.style.minHeight="100%",new IntersectionObserver((e,t)=>{const n=e[0];n&&!n.isIntersecting||(s.contentWindow?.postMessage({type:"redraw"},"*"),t.disconnect())}).observe(s);break;default:console.error(`Not supported node type '${e.display_type}' in eval.display result processing.`)}}}const pP=layui;var fP;!function(e){e[e.EPERM=1]="EPERM",e[e.ENOENT=2]="ENOENT",e[e.EINTR=4]="EINTR",e[e.EIO=5]="EIO",e[e.ENXIO=6]="ENXIO",e[e.EBADF=9]="EBADF",e[e.EAGAIN=11]="EAGAIN",e[e.ENOMEM=12]="ENOMEM",e[e.EACCES=13]="EACCES",e[e.EFAULT=14]="EFAULT",e[e.ENOTBLK=15]="ENOTBLK",e[e.EBUSY=16]="EBUSY",e[e.EEXIST=17]="EEXIST",e[e.EXDEV=18]="EXDEV",e[e.ENODEV=19]="ENODEV",e[e.ENOTDIR=20]="ENOTDIR",e[e.EISDIR=21]="EISDIR",e[e.EINVAL=22]="EINVAL",e[e.ENFILE=23]="ENFILE",e[e.EMFILE=24]="EMFILE",e[e.ETXTBSY=26]="ETXTBSY",e[e.EFBIG=27]="EFBIG",e[e.ENOSPC=28]="ENOSPC",e[e.ESPIPE=29]="ESPIPE",e[e.EROFS=30]="EROFS",e[e.EMLINK=31]="EMLINK",e[e.EPIPE=32]="EPIPE",e[e.EDOM=33]="EDOM",e[e.ERANGE=34]="ERANGE",e[e.EDEADLK=35]="EDEADLK",e[e.ENAMETOOLONG=36]="ENAMETOOLONG",e[e.ENOLCK=37]="ENOLCK",e[e.ENOSYS=38]="ENOSYS",e[e.ENOTEMPTY=39]="ENOTEMPTY",e[e.ELOOP=40]="ELOOP",e[e.ENOMSG=42]="ENOMSG",e[e.EBADE=52]="EBADE",e[e.EBADR=53]="EBADR",e[e.EXFULL=54]="EXFULL",e[e.ENOANO=55]="ENOANO",e[e.EBADRQC=56]="EBADRQC",e[e.ENOSTR=60]="ENOSTR",e[e.ENODATA=61]="ENODATA",e[e.ETIME=62]="ETIME",e[e.ENOSR=63]="ENOSR",e[e.ENONET=64]="ENONET",e[e.EREMOTE=66]="EREMOTE",e[e.ENOLINK=67]="ENOLINK",e[e.ECOMM=70]="ECOMM",e[e.EPROTO=71]="EPROTO",e[e.EBADMSG=74]="EBADMSG",e[e.EOVERFLOW=75]="EOVERFLOW",e[e.EBADFD=77]="EBADFD",e[e.ESTRPIPE=86]="ESTRPIPE",e[e.ENOTSOCK=88]="ENOTSOCK",e[e.EDESTADDRREQ=89]="EDESTADDRREQ",e[e.EMSGSIZE=90]="EMSGSIZE",e[e.EPROTOTYPE=91]="EPROTOTYPE",e[e.ENOPROTOOPT=92]="ENOPROTOOPT",e[e.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",e[e.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",e[e.ENOTSUP=95]="ENOTSUP",e[e.ENETDOWN=100]="ENETDOWN",e[e.ENETUNREACH=101]="ENETUNREACH",e[e.ENETRESET=102]="ENETRESET",e[e.ETIMEDOUT=110]="ETIMEDOUT",e[e.ECONNREFUSED=111]="ECONNREFUSED",e[e.EHOSTDOWN=112]="EHOSTDOWN",e[e.EHOSTUNREACH=113]="EHOSTUNREACH",e[e.EALREADY=114]="EALREADY",e[e.EINPROGRESS=115]="EINPROGRESS",e[e.ESTALE=116]="ESTALE",e[e.EREMOTEIO=121]="EREMOTEIO",e[e.EDQUOT=122]="EDQUOT"}(fP||(fP={}));const mP={[fP.EPERM]:"Operation not permitted",[fP.ENOENT]:"No such file or directory",[fP.EINTR]:"Interrupted system call",[fP.EIO]:"Input/output error",[fP.ENXIO]:"No such device or address",[fP.EBADF]:"Bad file descriptor",[fP.EAGAIN]:"Resource temporarily unavailable",[fP.ENOMEM]:"Cannot allocate memory",[fP.EACCES]:"Permission denied",[fP.EFAULT]:"Bad address",[fP.ENOTBLK]:"Block device required",[fP.EBUSY]:"Resource busy or locked",[fP.EEXIST]:"File exists",[fP.EXDEV]:"Invalid cross-device link",[fP.ENODEV]:"No such device",[fP.ENOTDIR]:"File is not a directory",[fP.EISDIR]:"File is a directory",[fP.EINVAL]:"Invalid argument",[fP.ENFILE]:"Too many open files in system",[fP.EMFILE]:"Too many open files",[fP.ETXTBSY]:"Text file busy",[fP.EFBIG]:"File is too big",[fP.ENOSPC]:"No space left on disk",[fP.ESPIPE]:"Illegal seek",[fP.EROFS]:"Cannot modify a read-only file system",[fP.EMLINK]:"Too many links",[fP.EPIPE]:"Broken pipe",[fP.EDOM]:"Numerical argument out of domain",[fP.ERANGE]:"Numerical result out of range",[fP.EDEADLK]:"Resource deadlock would occur",[fP.ENAMETOOLONG]:"File name too long",[fP.ENOLCK]:"No locks available",[fP.ENOSYS]:"Function not implemented",[fP.ENOTEMPTY]:"Directory is not empty",[fP.ELOOP]:"Too many levels of symbolic links",[fP.ENOMSG]:"No message of desired type",[fP.EBADE]:"Invalid exchange",[fP.EBADR]:"Invalid request descriptor",[fP.EXFULL]:"Exchange full",[fP.ENOANO]:"No anode",[fP.EBADRQC]:"Invalid request code",[fP.ENOSTR]:"Device not a stream",[fP.ENODATA]:"No data available",[fP.ETIME]:"Timer expired",[fP.ENOSR]:"Out of streams resources",[fP.ENONET]:"Machine is not on the network",[fP.EREMOTE]:"Object is remote",[fP.ENOLINK]:"Link has been severed",[fP.ECOMM]:"Communication error on send",[fP.EPROTO]:"Protocol error",[fP.EBADMSG]:"Bad message",[fP.EOVERFLOW]:"Value too large for defined data type",[fP.EBADFD]:"File descriptor in bad state",[fP.ESTRPIPE]:"Streams pipe error",[fP.ENOTSOCK]:"Socket operation on non-socket",[fP.EDESTADDRREQ]:"Destination address required",[fP.EMSGSIZE]:"Message too long",[fP.EPROTOTYPE]:"Protocol wrong type for socket",[fP.ENOPROTOOPT]:"Protocol not available",[fP.EPROTONOSUPPORT]:"Protocol not supported",[fP.ESOCKTNOSUPPORT]:"Socket type not supported",[fP.ENOTSUP]:"Operation is not supported",[fP.ENETDOWN]:"Network is down",[fP.ENETUNREACH]:"Network is unreachable",[fP.ENETRESET]:"Network dropped connection on reset",[fP.ETIMEDOUT]:"Connection timed out",[fP.ECONNREFUSED]:"Connection refused",[fP.EHOSTDOWN]:"Host is down",[fP.EHOSTUNREACH]:"No route to host",[fP.EALREADY]:"Operation already in progress",[fP.EINPROGRESS]:"Operation now in progress",[fP.ESTALE]:"Stale file handle",[fP.EREMOTEIO]:"Remote I/O error",[fP.EDQUOT]:"Disk quota exceeded"};class gP extends Error{static fromJSON(e){const t=new gP(e.errno,e.message,e.path,e.syscall);return t.code=e.code,t.stack=e.stack,t}static With(e,t,n){return new gP(fP[e],mP[fP[e]],t,n)}constructor(e,t=mP[e],n,i=""){super(t),this.errno=e,this.path=n,this.syscall=i,this.code=fP[e],this.message=this.code+": "+t+(this.path?`, '${this.path}'`:"")}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}}let _P="/";function yP(e,t){let n="",i=0,r=-1,s=0,o="\0";for(let a=0;a<=e.length;++a){if(a<e.length)o=e[a];else{if("/"==o)break;o="/"}if("/"==o){if(r===a-1||1===s);else if(2===s){if(n.length<2||2!==i||"."!==n.at(-1)||"."!==n.at(-2)){if(n.length>2){const e=n.lastIndexOf("/");-1===e?(n="",i=0):(n=n.slice(0,e),i=n.length-1-n.lastIndexOf("/")),r=a,s=0;continue}if(0!==n.length){n="",i=0,r=a,s=0;continue}}t&&(n+=n.length>0?"/..":"..",i=2)}else n.length>0?n+="/"+e.slice(r+1,a):n=e.slice(r+1,a),i=a-r-1;r=a,s=0}else"."===o&&-1!==s?++s:s=-1}return n}function vP(...e){let t="";for(const n of[...e.reverse(),_P])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;const n=t.startsWith("/");return t=yP(t,!n),n?`/${t}`:t.length?t:"/"}function bP(...e){if(!e.length)return".";const t=e.join("/");return t?.length?function(e){if(!e.length)return".";const t=e.startsWith("/"),n=e.endsWith("/");return(e=yP(e,!t)).length?(n&&(e+="/"),t?`/${e}`:e):t?"/":n?"./":"."}(t):"."}function TP(e){if(0===e.length)return".";const t="/"===e[0];let n=-1,i=!0;for(let t=e.length-1;t>=1;--t)if("/"===e[t]){if(!i){n=t;break}}else i=!1;return-1===n?t?"/":".":t&&1===n?"//":e.slice(0,n)}function xP(e,t){let n=0,i=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let s=t.length-1,o=-1;for(let a=e.length-1;a>=0;--a)if("/"===e[a]){if(!r){n=a+1;break}}else-1===o&&(r=!1,o=a+1),s>=0&&(e[a]===t[s]?-1===--s&&(i=a):(s=-1,i=o));return n===i?i=o:-1===i&&(i=e.length),e.slice(n,i)}for(let t=e.length-1;t>=0;--t)if("/"===e[t]){if(!r){n=t+1;break}}else-1===i&&(r=!1,i=t+1);return-1===i?"":e.slice(n,i)}function EP(e){const t=e.startsWith("/"),n={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;const i=t?1:0;let r=-1,s=0,o=-1,a=!0,l=e.length-1,u=0;for(;l>=i;--l)if("/"!==e[l])-1===o&&(a=!1,o=l+1),"."===e[l]?-1===r?r=l:1!==u&&(u=1):-1!==r&&(u=-1);else if(!a){s=l+1;break}if(-1!==o){const i=0===s&&t?1:s;-1===r||0===u||1===u&&r===o-1&&r===s+1?n.base=n.name=e.slice(i,o):(n.name=e.slice(i,r),n.base=e.slice(i,o),n.ext=e.slice(r,o))}return s>0?n.dir=e.slice(0,s-1):t&&(n.dir="/"),n}const wP=new TextEncoder;function IP(e){if("string"!=typeof e)throw new gP(fP.EINVAL,"Can not encode a non-string");return wP.encode(e)}const AP=new TextDecoder;function SP(e){if(!(e instanceof Uint8Array))throw new gP(fP.EINVAL,"Can not decode a non-Uint8Array");return AP.decode(e)}function CP(e){return JSON.parse(SP(e),(e,t)=>""==e?t:BigInt(t))}function OP(e){return IP(JSON.stringify(e,(e,t)=>""==e?t:t.toString()))}function MP(e,t){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e,8);if(!isNaN(t))return t}if("number"==typeof t)return t;throw new gP(fP.EINVAL,"Invalid mode: "+e?.toString())}function kP(e){if(e instanceof Date)return e;try{return new Date(e)}catch{throw new gP(fP.EINVAL,"Invalid time.")}}function RP(e){if((e=e.toString()).includes("\0"))throw new gP(fP.EINVAL,"Path can not contain null character");if(0==e.length)throw new gP(fP.EINVAL,"Path can not be empty");return vP(e.replaceAll(/[/\\]+/g,"/"))}function NP(e,t="utf8",n,i=0){return"object"!=typeof e||null===e?{encoding:"string"==typeof e?e:t??null,flag:n,mode:i}:{encoding:"string"==typeof e?.encoding?e.encoding:t??null,flag:"string"==typeof e?.flag?e.flag:n,mode:MP("mode"in e?e?.mode:null,i)}}function DP(){return crypto.getRandomValues(new BigUint64Array(1))[0]}const FP={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0,groups:[]};function LP(e){return{suid:e.uid,sgid:e.gid,euid:e.uid,egid:e.gid,groups:[],...e}}const PP=0,BP=4,$P=2,UP=1,VP=1,zP=2,jP=4,YP=0,GP=1,HP=2,WP=64,XP=128,qP=256,KP=512,ZP=1024,QP=65536,JP=262144,eB=131072,tB=1052672,nB=4096,iB=32768,rB=16384,sB=2048,oB=61440,aB=49152,lB=40960,uB=32768,cB=24576,dB=16384,hB=8192,pB=4096,fB=2048,mB=1024,gB=512,_B=448,yB=256,vB=128,bB=64,TB=56,xB=32,EB=16,wB=8,IB=7,AB=4,SB=2,CB=1,OB=0,MB=2**32-1,kB={checkAccess:!0,updateOnRead:!0,syncImmediately:!0,unsafeBufferReplace:!1};Promise.withResolvers??(Promise.withResolvers=function(){let e,t;const n=new Promise((n,i)=>{e=n,t=i});return{promise:n,resolve:e,reject:t}}),Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));class RB{_convert(e){return this._isBigint?BigInt(e):Number(e)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}constructor({atimeMs:e,mtimeMs:t,ctimeMs:n,birthtimeMs:i,uid:r,gid:s,size:o,mode:a,ino:l}={}){this.dev=this._convert(0),this.ino=this._convert(0),this.rdev=this._convert(0),this.nlink=this._convert(1),this.blksize=this._convert(4096),this.uid=this._convert(0),this.gid=this._convert(0);const u=Date.now();this.atimeMs=this._convert(e??u),this.mtimeMs=this._convert(t??u),this.ctimeMs=this._convert(n??u),this.birthtimeMs=this._convert(i??u),this.uid=this._convert(r??0),this.gid=this._convert(s??0),this.size=this._convert(o??0),this.ino=this._convert(l??0),this.mode=this._convert(a??420&uB),0==(this.mode&oB)&&(this.mode=this.mode|this._convert(uB))}isFile(){return(this.mode&oB)===uB}isDirectory(){return(this.mode&oB)===dB}isSymbolicLink(){return(this.mode&oB)===lB}isSocket(){return(this.mode&oB)===aB}isBlockDevice(){return(this.mode&oB)===cB}isCharacterDevice(){return(this.mode&oB)===hB}isFIFO(){return(this.mode&oB)===pB}hasAccess(e,t){const n=t?.credentials||FP;if(this.isSymbolicLink()||0===n.euid||0===n.egid)return!0;let i=0;return n.uid===this.uid&&(this.mode&yB&&(i|=BP),this.mode&vB&&(i|=$P),this.mode&bB&&(i|=UP)),(n.gid===this.gid||n.groups.includes(Number(this.gid)))&&(this.mode&xB&&(i|=BP),this.mode&EB&&(i|=$P),this.mode&wB&&(i|=UP)),this.mode&AB&&(i|=BP),this.mode&SB&&(i|=$P),this.mode&CB&&(i|=UP),(i&e)===e}chmod(e){this.mode=this._convert(this.mode&oB|e)}chown(e,t){e=Number(e),t=Number(t),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(t)&&0<=t&&t<2**32&&(this.gid=this._convert(t))}get atimeNs(){return 1000n*BigInt(this.atimeMs)}get mtimeNs(){return 1000n*BigInt(this.mtimeMs)}get ctimeNs(){return 1000n*BigInt(this.ctimeMs)}get birthtimeNs(){return 1000n*BigInt(this.birthtimeMs)}}function NB(e,t,n){!isNaN(t)&&0<=t&&t<2**32&&(e.uid=t),!isNaN(n)&&0<=n&&n<2**32&&(e.gid=n)}class DB extends RB{constructor(){super(...arguments),this._isBigint=!1}}class FB extends RB{constructor(){super(...arguments),this._isBigint=!0}}class LB{constructor(){this.type=525687744115,this.bsize=4096,this.blocks=0,this.bfree=0,this.bavail=0,this.files=MB,this.ffree=MB}}class PB{constructor(){this.type=0x7a656e6673n,this.bsize=4096n,this.blocks=0n,this.bfree=0n,this.bavail=0n,this.files=BigInt(MB),this.ffree=BigInt(MB)}}const BB=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function $B(e){if("number"==typeof e)return function(e){switch(e){case YP:return"r";case YP|tB:return"rs";case HP:return"r+";case HP|tB:return"rs+";case KP|WP|GP:return"w";case KP|WP|GP|XP:return"wx";case KP|WP|HP:return"w+";case KP|WP|HP|XP:return"wx+";case ZP|WP|GP:return"a";case ZP|WP|GP|XP:return"ax";case ZP|WP|HP:return"a+";case ZP|WP|HP|XP:return"ax+";default:throw new Error("Invalid flag number: "+e)}}(e);if(!BB.includes(e))throw new Error("Invalid flag string: "+e);return e}function UB(e){let t=0;return t<<=1,t+=+VB(e),t<<=1,t+=+zB(e),t<<=1,t}function VB(e){return-1!==e.indexOf("r")||-1!==e.indexOf("+")}function zB(e){return-1!==e.indexOf("w")||-1!==e.indexOf("a")||-1!==e.indexOf("+")}function jB(e){return-1!==e.indexOf("w")}function YB(e){return-1!==e.indexOf("a")}function GB(e){return-1!==e.indexOf("x")}class HB{constructor(e,t){this.fs=e,this.path=t}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}}class WB extends HB{constructor(e,t,n,i,r=new Uint8Array(new ArrayBuffer(0,e.metadata().noResizableBuffers?{}:{maxByteLength:MB}))){if(super(e,t),this.flag=n,this.stats=i,this._buffer=r,this._position=0,this.dirty=!1,this.closed=!1,this.stats.size!=r.byteLength){if(VB(this.flag))throw new Error(`Size mismatch: buffer length ${r.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return YB(this.flag)?this.stats.size:this._position}set position(e){this._position=e}async sync(){if(this.closed)throw gP.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw gP.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw gP.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw gP.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(e){if(this.closed)throw gP.With("EBADF",this.path,"File.dispose");if(this.dirty&&!e)throw gP.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw gP.With("EBADF",this.path,"File.stat");return Promise.resolve(new DB(this.stats))}statSync(){if(this.closed)throw gP.With("EBADF",this.path,"File.stat");return new DB(this.stats)}_truncate(e){if(this.closed)throw gP.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!zB(this.flag))throw new gP(fP.EPERM,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),e>this._buffer.length){const t=new Uint8Array(e-this._buffer.length);return void this._write(t,0,t.length,this._buffer.length)}this.stats.size=e,this._buffer=e?this._buffer.slice(0,e):new Uint8Array}async truncate(e){this._truncate(e),kB.syncImmediately&&await this.sync()}truncateSync(e){this._truncate(e),kB.syncImmediately&&this.syncSync()}_write(e,t=0,n=this.stats.size,i=this.position){if(this.closed)throw gP.With("EBADF",this.path,"File.write");if(!zB(this.flag))throw new gP(fP.EPERM,"File not opened with a writeable mode.");this.dirty=!0;const r=i+n,s=e.slice(t,t+n);if(r>this.stats.size&&(this.stats.size=r,r>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=r)this._buffer.buffer.resize(r);else if(kB.unsafeBufferReplace)this._buffer=s;else{const e=new Uint8Array(new ArrayBuffer(r,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:MB}));e.set(this._buffer),this._buffer=e}return this._buffer.set(s,i),this.stats.mtimeMs=Date.now(),this.position=i+s.byteLength,s.byteLength}async write(e,t,n,i){const r=this._write(e,t,n,i);return kB.syncImmediately&&await this.sync(),r}writeSync(e,t=0,n=this.stats.size,i=this.position){const r=this._write(e,t,n,i);return kB.syncImmediately&&this.syncSync(),r}_read(e,t=0,n=this.stats.size,i){if(this.closed)throw gP.With("EBADF",this.path,"File.read");if(!VB(this.flag))throw new gP(fP.EPERM,"File not opened with a readable mode.");kB.updateOnRead&&(this.dirty=!0),this.stats.atimeMs=Date.now(),i??(i=this.position);let r=i+n;r>this.stats.size&&(r=i+Math.max(this.stats.size-i,0)),this._position=r;const s=r-i;return 0==s||new Uint8Array(e.buffer,t,n).set(this._buffer.slice(i,r)),s}async read(e,t,n,i){const r=this._read(e,t,n,i);return kB.syncImmediately&&await this.sync(),{bytesRead:r,buffer:e}}readSync(e,t,n,i){const r=this._read(e,t,n,i);return kB.syncImmediately&&this.syncSync(),r}async chmod(e){if(this.closed)throw gP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>oB?~oB:oB)|e,(kB.syncImmediately||e>oB)&&await this.sync()}chmodSync(e){if(this.closed)throw gP.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.mode=this.stats.mode&(e>oB?~oB:oB)|e,(kB.syncImmediately||e>oB)&&this.syncSync()}async chown(e,t){if(this.closed)throw gP.With("EBADF",this.path,"File.chown");this.dirty=!0,NB(this.stats,e,t),kB.syncImmediately&&await this.sync()}chownSync(e,t){if(this.closed)throw gP.With("EBADF",this.path,"File.chown");this.dirty=!0,NB(this.stats,e,t),kB.syncImmediately&&this.syncSync()}async utimes(e,t){if(this.closed)throw gP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,kB.syncImmediately&&await this.sync()}utimesSync(e,t){if(this.closed)throw gP.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=e,this.stats.mtime=t,kB.syncImmediately&&this.syncSync()}}class XB{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:525687744115}}constructor(...e){}async ready(){}async exists(e){try{return await this.stat(e),!0}catch(e){return"ENOENT"!=e.code}}existsSync(e){try{return this.statSync(e),!0}catch(e){return"ENOENT"!=e.code}}}var qB=__webpack_require__(30228);Symbol.toStringTag,Symbol.iterator;const KB=Intl.NumberFormat("en",{notation:"compact"});KB.format.bind(KB);function ZB(e){return e.at(0).toUpperCase()+e.slice(1)}const QB=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],JB=[...QB,...QB.map(e=>ZB(e)),"char"],e$=/^(u?int|float)(8|16|32|64)$/i;function t$(e){return"char"==e?"uint8":e.toLowerCase()}function n$(e){return e$.test(e.toString())}function i$(e){return"char"==e||e$.test(e.toString().toLowerCase())}Symbol.struct_init||=Symbol("struct_init"),Symbol.struct_metadata||=Symbol("struct_metadata");Symbol.struct_init,Symbol.struct_metadata;function r$(e){const t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(e=>"Symbol.metadata"==e.description);var n;if(n=e,Symbol?.metadata&&(Symbol.metadata in n||Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)})),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}function s$(e){return"function"==typeof e&&r$(e)in e&&function(e){return null!=e&&"object"==typeof e&&Symbol.struct_metadata in e}(e[r$(e)])}function o$(e){return null!=e&&"object"==typeof e&&s$(e.constructor)}function a$(e){if(!o$(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct instance")}function l$(e){if(!function(e){return o$(e)||s$(e)}(e))throw new TypeError(("function"==typeof e?e.name:"object"==typeof e&&e?e.constructor.name:e)+" is not a struct")}function u$(e){if("string"==typeof e)return function(e){if(!i$(e))throw new TypeError("Not a valid primitive type: "+e)}(e),+t$(e).match(e$)[2]/8;l$(e);const t=s$(e)?e:e.constructor;return t[r$(t)][Symbol.struct_metadata].size}function c$(e,t){return Math.ceil(e/t)*t}function d$(e={}){return function(t,n){n.metadata??={},n.metadata[Symbol.struct_init]||=[];let i=0;const r=new Map;for(const t of n.metadata[Symbol.struct_init]){const{name:n,type:s,length:o}=t;if(!i$(s)&&!s$(s))throw new TypeError("Not a valid type: "+s);r.set(n,{offset:i,type:i$(s)?t$(s):s,length:o}),i+=u$(s)*(o||1),i=c$(i,e.align||1)}return n.metadata[Symbol.struct_metadata]={options:e,members:r,size:i},t}}function h$(e,t){return function(n,i){let r=i.name;if("symbol"==typeof r&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return i.metadata??={},i.metadata[Symbol.struct_init]||=[],i.metadata[Symbol.struct_init].push({name:r,type:e,length:t}),n}}function p$(e){a$(e);const{options:t,members:n}=e.constructor[r$(e.constructor)][Symbol.struct_metadata],i=new Uint8Array(u$(e)),r=new DataView(i.buffer);for(const[s,{type:o,length:a,offset:l}]of n)for(let n=0;n<(a||1);n++){const u=l+u$(o)*n;let c=a>0?e[s][n]:e[s];if("string"==typeof c&&(c=c.charCodeAt(0)),!n$(o)){i.set(c?p$(c):new Uint8Array(u$(o)),u);continue}const d="set"+ZB(o);"setInt64"!=d?"setUint64"!=d?r[d](u,Number(c),!t.bigEndian):r.setBigUint64(u,BigInt(c),!t.bigEndian):r.setBigInt64(u,BigInt(c),!t.bigEndian)}return i}function f$(e,t){a$(e);const{options:n,members:i}=e.constructor[r$(e.constructor)][Symbol.struct_metadata],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),s=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(const[t,{type:o,offset:a,length:l}]of i)for(let i=0;i<(l||1);i++){let u=l>0?e[t]:e;const c=l>0?i:t,d=a+u$(o)*i;if("string"==typeof e[t]){e[t]=e[t].slice(0,i)+String.fromCharCode(s.getUint8(d))+e[t].slice(i+1);continue}if(!n$(o)){if(null===u[c]||void 0===u[c])continue;f$(u[c],new Uint8Array(r.slice(d,d+u$(o))));continue}l>0&&(u||=[]);const h="get"+ZB(o);"getInt64"!=h?u[c]="getUint64"!=h?s[h](d,!n.bigEndian):s.getBigUint64(d,!n.bigEndian):u[c]=s.getBigInt64(d,!n.bigEndian)}}Symbol.metadata??=Symbol.for("Symbol.metadata");const m$=Object.fromEntries(JB.map(e=>{return[e,(t=e,function(e,n){return"number"==typeof e?h$(t,e):h$(t)(e,n)})];var t}));var g$=function(e,t,n,i,r,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,l=i.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?i.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h=!1,p=n.length-1;p>=0;p--){var f={};for(var m in i)f[m]="access"===m?{}:i[m];for(var m in i.access)f.access[m]=i.access[m];f.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[p])("accessor"===l?{get:d.get,set:d.set}:d[u],f);if("accessor"===l){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=o(g.get))&&(d.get=a),(a=o(g.set))&&(d.set=a),(a=o(g.init))&&r.unshift(a)}else(a=o(g))&&("field"===l?r.unshift(a):d[u]=a)}c&&Object.defineProperty(c,i.name,d),h=!0},_$=function(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0},y$=function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})};let v$=(()=>{var e,t,n,i,r,s,o,a,l,u,c;let d,h,p,f,m,g,_,y,v,b,T,x,E,w=[d$()],I=[],A=[],S=[],C=[],O=[],M=[],k=[],R=[],N=[],D=[],F=[],L=[],P=[],B=[],$=[],U=[],V=[],z=[],j=[],Y=[],G=[],H=[],W=[];var X=h=class{constructor(e){if(this.data=_$(this,A,void 0),this.size=(_$(this,S),_$(this,C,void 0)),this.mode=(_$(this,O),_$(this,M,void 0)),this.nlink=(_$(this,k),_$(this,R,void 0)),this.uid=(_$(this,N),_$(this,D,void 0)),this.gid=(_$(this,F),_$(this,L,void 0)),this.atimeMs=(_$(this,P),_$(this,B,void 0)),this.birthtimeMs=(_$(this,$),_$(this,U,void 0)),this.mtimeMs=(_$(this,V),_$(this,z,void 0)),this.ctimeMs=(_$(this,j),_$(this,Y,void 0)),this.ino=(_$(this,G),_$(this,H,void 0)),_$(this,W),e){const t=u$(X),n=t-u$("uint64");if(e.byteLength<n)throw new RangeError(`Can not create an inode from a buffer less than ${n} bytes`);if(e.byteLength<t){const n=new Uint8Array(t);n.set(new Uint8Array(ArrayBuffer.isView(e)?e.buffer:e));const i=crypto.getRandomValues(new Uint32Array(2));n.set(i,t-2),e=n}return void f$(this,e)}this.ino=DP(),this.data=DP(),this.nlink=1,this.size=4096;const t=Date.now();this.atimeMs=t,this.mtimeMs=t,this.ctimeMs=t,this.birthtimeMs=t}toStats(){return new DB(this)}update(e){let t=!1;return this.size!==e.size&&(this.size=e.size,t=!0),this.mode!==e.mode&&(this.mode=e.mode,t=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,t=!0),this.uid!==e.uid&&(this.uid=e.uid,t=!0),this.gid!==e.gid&&(this.gid=e.gid,t=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,t=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,t=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,t=!0),t}};return y$(h,"Inode"),(()=>{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;p=[(e=m$).uint64.bind(e)],f=[(t=m$).uint32.bind(t)],m=[(n=m$).uint16.bind(n)],g=[(i=m$).uint32.bind(i)],_=[(r=m$).uint32.bind(r)],y=[(s=m$).uint32.bind(s)],v=[(o=m$).float64.bind(o)],b=[(a=m$).float64.bind(a)],T=[(l=m$).float64.bind(l)],x=[(u=m$).float64.bind(u)],E=[(c=m$).uint64.bind(c)],g$(null,null,p,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:q},A,S),g$(null,null,f,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:q},C,O),g$(null,null,m,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:q},M,k),g$(null,null,g,{kind:"field",name:"nlink",static:!1,private:!1,access:{has:e=>"nlink"in e,get:e=>e.nlink,set:(e,t)=>{e.nlink=t}},metadata:q},R,N),g$(null,null,_,{kind:"field",name:"uid",static:!1,private:!1,access:{has:e=>"uid"in e,get:e=>e.uid,set:(e,t)=>{e.uid=t}},metadata:q},D,F),g$(null,null,y,{kind:"field",name:"gid",static:!1,private:!1,access:{has:e=>"gid"in e,get:e=>e.gid,set:(e,t)=>{e.gid=t}},metadata:q},L,P),g$(null,null,v,{kind:"field",name:"atimeMs",static:!1,private:!1,access:{has:e=>"atimeMs"in e,get:e=>e.atimeMs,set:(e,t)=>{e.atimeMs=t}},metadata:q},B,$),g$(null,null,b,{kind:"field",name:"birthtimeMs",static:!1,private:!1,access:{has:e=>"birthtimeMs"in e,get:e=>e.birthtimeMs,set:(e,t)=>{e.birthtimeMs=t}},metadata:q},U,V),g$(null,null,T,{kind:"field",name:"mtimeMs",static:!1,private:!1,access:{has:e=>"mtimeMs"in e,get:e=>e.mtimeMs,set:(e,t)=>{e.mtimeMs=t}},metadata:q},z,j),g$(null,null,x,{kind:"field",name:"ctimeMs",static:!1,private:!1,access:{has:e=>"ctimeMs"in e,get:e=>e.ctimeMs,set:(e,t)=>{e.ctimeMs=t}},metadata:q},Y,G),g$(null,null,E,{kind:"field",name:"ino",static:!1,private:!1,access:{has:e=>"ino"in e,get:e=>e.ino,set:(e,t)=>{e.ino=t}},metadata:q},H,W),g$(null,d={value:h},w,{kind:"class",name:h.name,metadata:q},null,I),X=h=d.value,q&&Object.defineProperty(h,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),_$(h,I)})(),X=h})();var b$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},T$=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class x$ extends XB{async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}constructor(e){super(),this.store=e,this._initialized=!1}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!0),r=EP(e),s=EP(t),o=await this.findInode(i,r.dir,"rename"),a=CP(await this.get(i,o.data,r.dir,"rename"));if(!a[r.base])throw gP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0===(s.dir+"/").indexOf(e+"/"))throw new gP(fP.EBUSY,r.dir);const u=s.dir==r.dir,c=u?o:await this.findInode(i,s.dir,"rename"),d=u?a:CP(await this.get(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new v$(await this.get(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw gP.With("EPERM",t,"rename");await i.remove(e.data),await i.remove(d[s.base])}d[s.base]=l,await i.set(o.data,OP(a)),await i.set(c.data,OP(d)),await i.commit()}catch(e){n.error=e,n.hasError=!0}finally{const e=T$(n);e&&await e}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!1),r=EP(e),s=EP(t),o=this.findInodeSync(i,r.dir,"rename"),a=CP(this.getSync(i,o.data,r.dir,"rename"));if(!a[r.base])throw gP.With("ENOENT",e,"rename");const l=a[r.base];if(delete a[r.base],0==(s.dir+"/").indexOf(e+"/"))throw new gP(fP.EBUSY,r.dir);const u=s.dir===r.dir,c=u?o:this.findInodeSync(i,s.dir,"rename"),d=u?a:CP(this.getSync(i,c.data,s.dir,"rename"));if(d[s.base]){const e=new v$(this.getSync(i,d[s.base],t,"rename"));if(!e.toStats().isFile())throw gP.With("EPERM",t,"rename");i.removeSync(e.data),i.removeSync(d[s.base])}d[s.base]=l,i.setSync(o.data,OP(a)),i.setSync(c.data,OP(d)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{T$(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{const n=b$(t,this.store.transaction(),!0);return(await this.findInode(n,e,"stat")).toStats()}catch(e){t.error=e,t.hasError=!0}finally{const e=T$(t);e&&await e}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=b$(t,this.store.transaction(),!1);return this.findInodeSync(n,e,"stat").toStats()}catch(e){t.error=e,t.hasError=!0}finally{T$(t)}}async createFile(e,t,n){const i=await this.commitNew(e,uB,n,new Uint8Array,"createFile");return new WB(this,e,t,i.toStats(),new Uint8Array)}createFileSync(e,t,n){const i=this.commitNewSync(e,uB,n,new Uint8Array,"createFile");return new WB(this,e,t,i.toStats(),new Uint8Array)}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!0),r=await this.findInode(i,e,"openFile"),s=await this.get(i,r.data,e,"openFile");return new WB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{const e=T$(n);e&&await e}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!1),r=this.findInodeSync(i,e,"openFile"),s=this.getSync(i,r.data,e,"openFile");return new WB(this,e,t,r.toStats(),s)}catch(e){n.error=e,n.hasError=!0}finally{T$(n)}}async unlink(e){return this.remove(e,!1,"unlink")}unlinkSync(e){this.removeSync(e,!1,"unlink")}async rmdir(e){if((await this.readdir(e)).length)throw gP.With("ENOTEMPTY",e,"rmdir");await this.remove(e,!0,"rmdir")}rmdirSync(e){if(this.readdirSync(e).length)throw gP.With("ENOTEMPTY",e,"rmdir");this.removeSync(e,!0,"rmdir")}async mkdir(e,t){await this.commitNew(e,dB,t,IP("{}"),"mkdir")}mkdirSync(e,t){this.commitNewSync(e,dB,t,IP("{}"),"mkdir")}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{const n=b$(t,this.store.transaction(),!0),i=await this.findInode(n,e,"readdir");return Object.keys(CP(await this.get(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{const e=T$(t);e&&await e}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=b$(t,this.store.transaction(),!1),i=this.findInodeSync(n,e,"readdir");return Object.keys(CP(this.getSync(n,i.data,e,"readdir")))}catch(e){t.error=e,t.hasError=!0}finally{T$(t)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=b$(i,this.store.transaction(),!0),s=await this._findInode(r,e,"sync"),o=new v$(await this.get(r,s,e,"sync")),a=o.update(n);await r.set(o.data,t),a&&await r.set(s,p$(o)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=T$(i);e&&await e}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=b$(i,this.store.transaction(),!1),s=this._findInodeSync(r,e,"sync"),o=new v$(this.getSync(r,s,e,"sync")),a=o.update(n);r.setSync(o.data,t),a&&r.setSync(s,p$(o)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{T$(i)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!0),r=TP(t),s=await this.findInode(i,r,"link"),o=CP(await this.get(i,s.data,r,"link")),a=await this._findInode(i,e,"link"),l=new v$(await this.get(i,a,e,"link"));l.nlink++,o[xP(t)]=a,i.setSync(a,p$(l)),i.setSync(s.data,OP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{const e=T$(n);e&&await e}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=b$(n,this.store.transaction(),!1),r=TP(t),s=this.findInodeSync(i,r,"link"),o=CP(this.getSync(i,s.data,r,"link")),a=this._findInodeSync(i,e,"link"),l=new v$(this.getSync(i,a,e,"link"));l.nlink++,o[xP(t)]=a,i.setSync(a,p$(l)),i.setSync(s.data,OP(o)),i.commitSync()}catch(e){n.error=e,n.hasError=!0}finally{T$(n)}}async checkRoot(){const e={stack:[],error:void 0,hasError:!1};try{const t=b$(e,this.store.transaction(),!0);if(await t.get(0n))return;const n=new v$;n.ino=0n,n.mode=511|dB,await t.set(n.data,IP("{}")),await t.set(0n,p$(n)),await t.commit()}catch(t){e.error=t,e.hasError=!0}finally{const t=T$(e);t&&await t}}checkRootSync(){const e={stack:[],error:void 0,hasError:!1};try{const t=b$(e,this.store.transaction(),!1);if(t.getSync(0n))return;const n=new v$;n.ino=0n,n.mode=511|dB,t.setSync(n.data,IP("{}")),t.setSync(0n,p$(n)),t.commitSync()}catch(t){e.error=t,e.hasError=!0}finally{T$(e)}}async _findInode(e,t,n,i=new Set){if(i.has(t))throw new gP(fP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=EP(t),o="/"==r?new v$(await this.get(e,0n,r,n)):await this.findInode(e,r,n,i),a=CP(await this.get(e,o.data,r,n));if(!(s in a))throw gP.With("ENOENT",vP(r,s),n);return a[s]}_findInodeSync(e,t,n,i=new Set){if(i.has(t))throw new gP(fP.EIO,"Infinite loop detected while finding inode",t);if(i.add(t),"/"==t)return 0n;const{dir:r,base:s}=EP(t),o="/"==r?new v$(this.getSync(e,0n,r,n)):this.findInodeSync(e,r,n,i),a=CP(this.getSync(e,o.data,r,n));if(!(s in a))throw gP.With("ENOENT",vP(r,s),n);return a[s]}async findInode(e,t,n,i=new Set){const r=await this._findInode(e,t,n,i);return new v$(await this.get(e,r,t,n))}findInodeSync(e,t,n,i=new Set){const r=this._findInodeSync(e,t,n,i);return new v$(this.getSync(e,r,t,n))}async get(e,t,n,i){const r=await e.get(t);if(!r)throw gP.With("ENOENT",n,i);return r}getSync(e,t,n,i){const r=e.getSync(t);if(!r)throw gP.With("ENOENT",n,i);return r}async allocNew(e,t,n){for(let t=0;t<5;t++){const t=DP();if(!await e.get(t))return t}throw new gP(fP.ENOSPC,"No IDs available",t,n)}allocNewSync(e,t,n){for(let t=0;t<5;t++){const t=DP();if(!e.getSync(t))return t}throw new gP(fP.ENOSPC,"No IDs available",t,n)}async commitNew(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw gP.With("EEXIST",e,r);const o=b$(s,this.store.transaction(),!0),{dir:a,base:l}=EP(e),u=await this.findInode(o,a,r),c=CP(await this.get(o,u.data,a,r));if(c[l])throw gP.With("EEXIST",e,r);const d=new v$;return d.ino=await this.allocNew(o,e,r),d.data=await this.allocNew(o,e,r),d.mode=n|t,d.uid=u.mode&fB?u.uid:FP.uid,d.gid=u.mode&mB?u.gid:FP.gid,d.size=i.length,await o.set(d.ino,p$(d)),await o.set(d.data,i),c[l]=d.ino,await o.set(u.data,OP(c)),await o.commit(),d}catch(e){s.error=e,s.hasError=!0}finally{const e=T$(s);e&&await e}}commitNewSync(e,t,n,i,r){const s={stack:[],error:void 0,hasError:!1};try{if("/"==e)throw gP.With("EEXIST",e,r);const o=b$(s,this.store.transaction(),!1),{dir:a,base:l}=EP(e),u=this.findInodeSync(o,a,r),c=CP(this.getSync(o,u.data,a,r));if(c[l])throw gP.With("EEXIST",e,r);const d=new v$;return d.ino=this.allocNewSync(o,e,r),d.data=this.allocNewSync(o,e,r),d.size=i.length,d.mode=n|t,d.uid=u.mode&fB?u.uid:FP.uid,d.gid=u.mode&mB?u.gid:FP.gid,o.setSync(d.ino,p$(d)),o.setSync(d.data,i),c[l]=d.ino,o.setSync(u.data,OP(c)),o.commitSync(),d}catch(e){s.error=e,s.hasError=!0}finally{T$(s)}}async remove(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=b$(i,this.store.transaction(),!0),{dir:s,base:o}=EP(e),a=await this.findInode(r,s,n),l=CP(await this.get(r,a.data,s,n));if(!l[o])throw gP.With("ENOENT",e,"remove");const u=l[o],c=new v$(await this.get(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw gP.With("EISDIR",e,"remove");await r.set(a.data,OP(l)),--c.nlink<1&&(await r.remove(c.data),await r.remove(u)),await r.commit()}catch(e){i.error=e,i.hasError=!0}finally{const e=T$(i);e&&await e}}removeSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=b$(i,this.store.transaction(),!1),{dir:s,base:o}=EP(e),a=this.findInodeSync(r,s,n),l=CP(this.getSync(r,a.data,s,n)),u=l[o];if(!u)throw gP.With("ENOENT",e,"remove");const c=new v$(this.getSync(r,u,e,n));if(delete l[o],!t&&c.toStats().isDirectory())throw gP.With("EISDIR",e,"remove");r.setSync(a.data,OP(l)),--c.nlink<1&&(r.removeSync(c.data),r.removeSync(u)),r.commitSync()}catch(e){i.error=e,i.hasError=!0}finally{T$(i)}}}class E${constructor(e){this.store=e,this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}}class w$ extends E${async keys(){return this.keysSync()}async get(e){return this.getSync(e)}async set(e,t){return this.setSync(e,t)}async remove(e){return this.removeSync(e)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}}class I$ extends w${constructor(){super(...arguments),this.originalData=new Map,this.modifiedKeys=new Set}keysSync(){return this.store.keys()}getSync(e){const t=this.store.get(e);return this.stashOldValue(e,t),t}setSync(e,t){return this.markModified(e),this.store.set(e,t)}removeSync(e){this.markModified(e),this.store.delete(e)}commitSync(){this.done=!0}abortSync(){if(this.done){for(const e of this.modifiedKeys){const t=this.originalData.get(e);t?this.store.set(e,t):this.store.delete(e)}this.done=!0}}stashOldValue(e,t){this.originalData.has(e)||this.originalData.set(e,t)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}}class A$ extends Map{constructor(e="tmp"){super(),this.name=e}async sync(){}clearSync(){this.clear()}transaction(){return new I$(this)}}const S$={name:"InMemory",isAvailable:()=>!0,options:{name:{type:"string",required:!1}},create({name:e}){const t=new x$(new A$(e));return t.checkRootSync(),t}},C$=S$;"function"==typeof SuppressedError&&SuppressedError;class O${constructor(){this.isEnabled=!1,this.sync=new Map,this.async=new Map}has(e){return this.isEnabled&&this.sync.has(e)}get(e){if(this.isEnabled)return this.sync.get(e)}set(e,t){this.isEnabled&&(this.sync.set(e,t),this.async.set(e,Promise.resolve(t)))}hasAsync(e){return this.isEnabled&&this.async.has(e)}getAsync(e){if(this.isEnabled)return this.async.get(e)}setAsync(e,t){this.isEnabled&&(this.async.set(e,t),t.then(t=>this.sync.set(e,t)))}clear(){this.isEnabled&&(this.sync.clear(),this.async.clear())}}const M$=new O$,k$=new O$;var R$=__webpack_require__(48287);function N$(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,"function"==typeof n?n.bind(t):n]))}const D$=new Map;let F$=100;function L$(e){const t=F$++;return D$.set(t,e),t}function P$(e){if(!D$.has(e))throw new gP(fP.EBADF);return D$.get(e)}const B$=new Map;function $$(e,t){if("/"!==e[0]&&(e="/"+e),e=vP(e),B$.has(e))throw new gP(fP.EINVAL,"Mount point "+e+" is already in use.");B$.set(e,t),k$.clear()}function U$(e){if("/"!==e[0]&&(e="/"+e),e=vP(e),!B$.has(e))throw new gP(fP.EINVAL,"Mount point "+e+" is already unmounted.");B$.delete(e),k$.clear()}function V$(e,t){const n=t?.root||"/";e=RP(bP(n,e));const i=[...B$].sort((e,t)=>e[0].length>t[0].length?-1:1);for(const[t,r]of i)if(t.length<=e.length&&e.startsWith(t))return""===(e=e.slice(t.length>1?t.length:0))&&(e=n),{fs:r,path:e,mountPoint:t,root:n};throw new gP(fP.EIO,"No file system")}async function z$(){await Promise.all([...B$.values()].map(e=>e.ready()))}function j$(e,t){for(const[n,i]of Object.entries(t))e=e?.replaceAll(n,i);return e}function Y$(e,t){"string"==typeof e.stack&&(e.stack=j$(e.stack,t));try{e.message=j$(e.message,t)}catch{}return e.path&&(e.path=j$(e.path,t)),e}function G$(e){"/"in e&&U$("/");for(const[t,n]of Object.entries(e))$$(t,n)}function H$(e,t){const n=e.metadata(),i=n.blockSize||4096;return{type:(t?BigInt:Number)(n.type),bsize:(t?BigInt:Number)(i),ffree:(t?BigInt:Number)(n.freeNodes||MB),files:(t?BigInt:Number)(n.totalNodes||MB),bavail:(t?BigInt:Number)(n.freeSpace/i),bfree:(t?BigInt:Number)(n.freeSpace/i),blocks:(t?BigInt:Number)(n.totalSpace/i)}}function W$(e,t){const n=this?.credentials;if(n?.uid&&n?.gid&&n?.euid&&n?.egid)throw new gP(fP.EPERM,"Can not chroot() as non-root user");return t&&this?(this.root+=e,this):function(e,t=structuredClone(FP)){const n={root:e,credentials:LP(t)},i=N$(ue,n),r=N$(le,n);return{...n,...i,promises:r}}(bP(this?.root||"/",e),n)}$$("/",C$.create({name:"root"}));class X$ extends qB{off(e,t,n,i){return super.off(e,t,n,i)}removeListener(e,t,n,i){return super.removeListener(e,t,n,i)}constructor(e){super(),this.path=e}setMaxListeners(){throw gP.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw gP.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw gP.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw gP.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw gP.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}}class q$ extends X${constructor(e,t){super(e),this.options=t,function(e,t){const n=RP(e);Z$.has(n)||Z$.set(n,new Set);Z$.get(n).add(t)}(e.toString(),this)}close(){super.emit("close"),function(e,t){const n=RP(e);Z$.has(n)&&(Z$.get(n).delete(t),0===Z$.get(n).size&&Z$.delete(n))}(this.path.toString(),this)}[Symbol.dispose](){this.close()}}class K$ extends X${constructor(e,t){super(e),this.options=t,this.start()}onInterval(){try{const n=iU(this.path);e=this.previous,t=n,(e.size!=t.size||+e.atime!=+t.atime||+e.mtime!=+t.mtime||+e.ctime!=+t.ctime||e.mode!=t.mode)&&(this.emit("change",n,this.previous),this.previous=n)}catch(e){this.emit("error",e)}var e,t}start(){const e=this.options.interval||5e3;try{this.previous=iU(this.path)}catch(e){return void this.emit("error",e)}this.intervalId=setInterval(this.onInterval.bind(this),e),this.options.persistent||"object"!=typeof this.intervalId||this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}}const Z$=new Map;function Q$(e,t){if(t=RP(t),Z$.has(t))for(const n of Z$.get(t))n.emit("change",e,xP(t));let n,i=t;for(;i!==n;)if(n=i,i=TP(i),Z$.has(i))for(const n of Z$.get(i))n.emit("change",e,t.slice(i.length+("/"==i?0:1)))}var J$=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},eU=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function tU(e,t){e=RP(e),t=RP(t);const n=V$(e,this),i=V$(t,this);if(kB.checkAccess&&!iU.call(this,TP(e)).hasAccess($P,this))throw gP.With("EACCES",e,"rename");try{if(n===i)return n.fs.renameSync(n.path,i.path),Q$("rename",e.toString()),void Q$("change",t.toString());hU.call(this,t,dU(e)),oU.call(this,e),Q$("rename",e.toString())}catch(r){throw Y$(r,{[n.path]:e,[i.path]:t})}}function nU(e){e=RP(e);try{const{fs:t,path:n}=V$(LU.call(this,e),this);return t.existsSync(n)}catch(e){if(e.errno==fP.ENOENT)return!1;throw e}}function iU(e,t){e=RP(e);const{fs:n,path:i}=V$(LU.call(this,e),this);try{const e=n.statSync(i);if(kB.checkAccess&&!e.hasAccess(BP,this))throw gP.With("EACCES",i,"stat");return t?.bigint?new FB(e):e}catch(t){throw Y$(t,{[i]:e})}}function rU(e,t){e=RP(e);const{fs:n,path:i}=V$(e,this);try{const e=n.statSync(i);return t?.bigint?new FB(e):e}catch(t){throw Y$(t,{[i]:e})}}function sU(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=J$(n,aU.call(this,e,"r+"),!1);if(t||(t=0),t<0)throw new gP(fP.EINVAL);i.truncateSync(t)}catch(e){n.error=e,n.hasError=!0}finally{eU(n)}}function oU(e){e=RP(e);const{fs:t,path:n}=V$(e,this);try{if(kB.checkAccess&&!(M$.get(e)||t.statSync(n)).hasAccess($P,this))throw gP.With("EACCES",n,"unlink");t.unlinkSync(n),Q$("rename",e.toString())}catch(t){throw Y$(t,{[n]:e})}}function aU(e,t,n,i=!0){e=RP(e);const r=MP(n,420),s=$B(t);e=i?LU.call(this,e):e;const{fs:o,path:a}=V$(e,this);let l;try{l=o.statSync(a)}catch{}if(!l){if(!zB(s)&&!YB(s)||"r+"==s)throw gP.With("ENOENT",e,"_open");const t=o.statSync(TP(a));if(kB.checkAccess&&!t.hasAccess($P,this))throw gP.With("EACCES",TP(e),"_open");if(!t.isDirectory())throw gP.With("ENOTDIR",TP(e),"_open");return o.createFileSync(a,s,r)}if(kB.checkAccess&&(!l.hasAccess(r,this)||!l.hasAccess(UB(s),this)))throw gP.With("EACCES",e,"_open");if(GB(s))throw gP.With("EEXIST",e,"_open");const u=o.openFileSync(a,s);return jB(s)&&u.truncateSync(0),u}function lU(e,t,n=PP){return L$(aU.call(this,e,t,n,!0))}function uU(e,t,n){return L$(aU.call(this,e,t,n,!1))}function cU(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=J$(i,aU.call(this,e,t,420,n),!1),s=r.statSync(),o=new Uint8Array(s.size);return r.readSync(o,0,s.size,0),o}catch(e){i.error=e,i.hasError=!0}finally{eU(i)}}function dU(e,t={}){const n=NP(t,null,"r",420);if(!VB($B(n.flag)))throw new gP(fP.EINVAL,"Flag passed to readFile must allow for reading.");const i=R$.Buffer.from(cU.call(this,"number"==typeof e?P$(e).path:e.toString(),n.flag,!0));return n.encoding?i.toString(n.encoding):i}function hU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=NP(n,"utf8","w+",420),s=$B(r.flag);if(!zB(s))throw new gP(fP.EINVAL,"Flag passed to writeFile must allow for writing.");if("string"!=typeof t&&!r.encoding)throw new gP(fP.EINVAL,"Encoding not specified");const o="string"==typeof t?R$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new gP(fP.EINVAL,"Data not specified");J$(i,aU.call(this,"number"==typeof e?P$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength,0),Q$("change",e.toString())}catch(e){i.error=e,i.hasError=!0}finally{eU(i)}}function pU(e,t,n={}){const i={stack:[],error:void 0,hasError:!1};try{const r=NP(n,"utf8","a+",420),s=$B(r.flag);if(!YB(s))throw new gP(fP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new gP(fP.EINVAL,"Encoding not specified");const o="string"==typeof t?R$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);J$(i,aU.call(this,"number"==typeof e?P$(e).path:e.toString(),s,r.mode,!0),!1).writeSync(o,0,o.byteLength)}catch(e){i.error=e,i.hasError=!0}finally{eU(i)}}function fU(e,t){const n=P$(e).statSync();return t?.bigint?new FB(n):n}function mU(e){P$(e).closeSync(),D$.delete(e)}function gU(e,t=0){if(t||(t=0),t<0)throw new gP(fP.EINVAL);P$(e).truncateSync(t)}function _U(e){P$(e).syncSync()}function yU(e){P$(e).datasyncSync()}function vU(e,t,n,i,r){let s,o,a,l;if("string"==typeof t){l="number"==typeof n?n:null;const e="string"==typeof i?i:"utf8";o=0,s=R$.Buffer.from(t,e),a=s.byteLength}else s=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=n,a=i,l="number"==typeof r?r:null;const u=P$(e);l??(l=u.position);const c=u.writeSync(s,o,a,l);return Q$("change",u.path),c}function bU(e,t,n,i,r){const s=P$(e),o="object"==typeof n?n.offset:n;return"object"==typeof n&&(i=n.length,r=n.position),r=Number(r),isNaN(r)&&(r=s.position),s.readSync(t,o,i,r)}function TU(e,t,n){P$(e).chownSync(t,n)}function xU(e,t){const n=MP(t,-1);if(n<0)throw new gP(fP.EINVAL,"Invalid mode.");P$(e).chmodSync(n)}function EU(e,t,n){P$(e).utimesSync(kP(t),kP(n))}function wU(e){e=RP(e);const{fs:t,path:n}=V$(LU.call(this,e),this);try{const i=M$.get(e)||t.statSync(n);if(!i.isDirectory())throw gP.With("ENOTDIR",n,"rmdir");if(kB.checkAccess&&!i.hasAccess($P,this))throw gP.With("EACCES",n,"rmdir");t.rmdirSync(n),Q$("rename",e.toString())}catch(t){throw Y$(t,{[n]:e})}}function IU(e,t){t="object"==typeof t?t:{mode:t};const n=MP(t?.mode,511);e=LU.call(this,e);const{fs:i,path:r,root:s}=V$(e,this),o={[r]:e};try{if(!t?.recursive){if(kB.checkAccess&&!i.statSync(TP(r)).hasAccess($P,this))throw gP.With("EACCES",TP(r),"mkdir");return i.mkdirSync(r,n)}const a=[];for(let t=r,n=e;!i.existsSync(t);t=TP(t),n=TP(n))a.unshift(t),o[t]=n;for(const e of a){if(kB.checkAccess&&!i.statSync(TP(e)).hasAccess($P,this))throw gP.With("EACCES",TP(e),"mkdir");i.mkdirSync(e,n),Q$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw Y$(e,o)}}function AU(e,t){t="object"==typeof t?t:{encoding:t},e=RP(e);const{fs:n,path:i}=V$(LU.call(this,e),this);let r;try{const t=M$.get(e)||n.statSync(i);if(M$.set(e,t),kB.checkAccess&&!t.hasAccess(BP,this))throw gP.With("EACCES",i,"readdir");if(!t.isDirectory())throw gP.With("ENOTDIR",i,"readdir");r=n.readdirSync(i)}catch(t){throw Y$(t,{[i]:e})}const s=[];for(const o of r){const r=M$.get(bP(e,o))||n.statSync(bP(i,o));if(M$.set(bP(e,o),r),t?.withFileTypes?s.push(new HU(o,r)):"buffer"==t?.encoding?s.push(R$.Buffer.from(o)):s.push(o),r.isDirectory()&&t?.recursive)for(const n of AU.call(this,bP(e,o),{...t,_isIndirect:!0}))n instanceof HU?(n.path=bP(o,n.path),s.push(n)):R$.Buffer.isBuffer(n)?s.push(R$.Buffer.from(bP(o,SP(n)))):s.push(bP(o,n))}return t?._isIndirect||M$.clear(),s}function SU(e,t){if(e=RP(e),kB.checkAccess&&!iU(TP(e)).hasAccess(BP,this))throw gP.With("EACCES",TP(e),"link");if(t=RP(t),kB.checkAccess&&!iU(TP(t)).hasAccess($P,this))throw gP.With("EACCES",TP(t),"link");const{fs:n,path:i}=V$(e,this),r=V$(t,this);if(n!=r.fs)throw gP.With("EXDEV",t,"link");try{if(kB.checkAccess&&!n.statSync(i).hasAccess(BP,this))throw gP.With("EACCES",i,"link");return n.linkSync(i,t)}catch(n){throw Y$(n,{[i]:e,[r.path]:t})}}function CU(e,t,n="file"){if(!["file","dir","junction"].includes(n))throw new gP(fP.EINVAL,"Invalid type: "+n);if(nU.call(this,t))throw gP.With("EEXIST",t.toString(),"symlink");hU.call(this,t,e.toString());aU.call(this,t,"r+",420,!1).chmodSync(lB)}function OU(e,t){const n=R$.Buffer.from(cU.call(this,e.toString(),"r",!1)),i="object"==typeof t?t?.encoding:t;return"buffer"==i?n:n.toString(i)}function MU(e,t,n){const i=lU.call(this,e,"r+");TU(i,t,n),mU(i)}function kU(e,t,n){const i=uU.call(this,e,"r+");TU(i,t,n),mU(i)}function RU(e,t){const n=lU.call(this,e,"r+");xU(n,t),mU(n)}function NU(e,t){const n=uU.call(this,e,"r+");xU(n,t),mU(n)}function DU(e,t,n){const i=lU.call(this,e,"r+");EU(i,t,n),mU(i)}function FU(e,t,n){const i=uU.call(this,e,"r+");EU(i,t,n),mU(i)}function LU(e,t){e=RP(e);const n=(this?.root||"")+e;if(k$.has(n))return k$.get(n);const{base:i,dir:r}=EP(e),s="/"==r?"/":k$.get((this?.root||"")+r)||LU.call(this,r),o=bP(s,i),{fs:a,path:l}=V$(o,this);try{const i=M$.get(o)||a.statSync(l);if(M$.set(o,i),!i.isSymbolicLink())return k$.set(e,o),o;const r=vP(s,OU.call(this,o,t).toString()),u=k$.get((this?.root||"")+r)||LU.call(this,r);return k$.set(n,u),u}catch(t){if("ENOENT"==t.code)return e;throw Y$(t,{[l]:o})}}function PU(e,t=384){if(kB.checkAccess&&!iU.call(this,e).hasAccess(t,this))throw new gP(fP.EACCES)}function BU(e,t){let n;e=RP(e);try{n=M$.get(e)||rU.bind(this)(e)}catch(e){if("ENOENT"!=e.code||!t?.force)throw e}if(n){switch(M$.set(e,n),n.mode&oB){case dB:if(t?.recursive)for(const n of AU.call(this,e,{_isIndirect:!0}))BU.call(this,bP(e,n),{...t,_isIndirect:!0});wU.call(this,e);break;case uB:case lB:case cB:case hB:oU.call(this,e);break;default:throw M$.clear(),new gP(fP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||M$.clear()}}function $U(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return IU.call(this,i),"buffer"==n?R$.Buffer.from(i):i}function UU(e,t,n){if(e=RP(e),t=RP(t),n&&n&VP&&nU(t))throw new gP(fP.EEXIST,"Destination file already exists.",t,"copyFile");hU.call(this,t,dU(e)),Q$("rename",t.toString())}function VU(e,t,n){const i=P$(e);let r=0;for(const e of t)r+=i.readSync(e,0,e.byteLength,n+r);return r}function zU(e,t,n){const i=P$(e);let r=0;for(const e of t)r+=i.writeSync(new Uint8Array(e.buffer),0,e.byteLength,n+r);return r}function jU(e,t){return e=RP(e),new WU(e,this)}function YU(e,t,n){e=RP(e),t=RP(t);const i=rU.call(this,e);if(n?.errorOnExist&&nU.call(this,t))throw new gP(fP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&oB){case dB:if(!n?.recursive)throw new gP(fP.EISDIR,e+" is a directory (not copied)",e,"cp");IU.call(this,t,{recursive:!0});for(const i of AU.call(this,e,{withFileTypes:!0}))n.filter&&!n.filter(bP(e,i.name),bP(t,i.name))||YU.call(this,bP(e,i.name),bP(t,i.name),n);break;case uB:case lB:UU.call(this,e,t);break;default:throw new gP(fP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&DU.call(this,t,i.atime,i.mtime)}function GU(e,t){e=RP(e);const{fs:n}=V$(e,this);return H$(n,t?.bigint)}class HU{get name(){return xP(this.path)}constructor(e,t){this.path=e,this.stats=t}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}}class WU{checkClosed(){if(this.closed)throw new gP(fP.EBADF,"Can not use closed Dir")}constructor(e,t){this.path=e,this.context=t,this.closed=!1}close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??(this._entries=await pV.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}read(e){if(!e)return this._read();this._read().then(t=>e(void 0,t))}readSync(){return this.checkClosed(),this._entries??(this._entries=AU.call(this.context,this.path,{withFileTypes:!0})),this._entries.length?this._entries.shift()??null:null}async next(){const e=await this._read();return e?{done:!1,value:e}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}}var XU=__webpack_require__(86248);class qU extends XU.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new gP(fP.EIO,t.toString()))}}}class KU extends XU.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(t){e(new gP(fP.EIO,t.toString()))}}}var ZU=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},QU=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class JU{constructor(e,t){this.context=t;const n="number"!=typeof e;this.fd=n?L$(e):e,this.file=n?e:P$(e)}async chown(e,t){await this.file.chown(e,t),Q$("change",this.file.path)}async chmod(e){const t=MP(e,-1);if(t<0)throw new gP(fP.EINVAL,"Invalid mode.");await this.file.chmod(t),Q$("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(e){if(e||(e=0),e<0)throw new gP(fP.EINVAL);await this.file.truncate(e),Q$("change",this.file.path)}async utimes(e,t){await this.file.utimes(kP(e),kP(t)),Q$("change",this.file.path)}async appendFile(e,t={}){const n=NP(t,"utf8","a",420);if(!YB($B(n.flag)))throw new gP(fP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof e&&!n.encoding)throw new gP(fP.EINVAL,"Encoding not specified");const i="string"==typeof e?R$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length),Q$("change",this.file.path)}read(e,t,n,i){return isNaN(+i)&&(i=this.file.position),this.file.read(e,t,n,i)}async readFile(e){const t=NP(e,null,"r",292);if(!VB($B(t.flag)))throw new gP(fP.EINVAL,"Flag passed must allow for reading.");const{size:n}=await this.stat(),{buffer:i}=await this.file.read(new Uint8Array(n),0,n,0),r=R$.Buffer.from(i);return t.encoding?r.toString(t.encoding):r}readableWebStream(e={}){const t=globalThis;if(!("ReadableStream"in t))throw new gP(fP.ENOSYS,"ReadableStream is missing on globalThis");return new t.ReadableStream({start:async e=>{try{const t=65536,n=1e7;let i=0,r=0,s=NaN;for(;s>0;){const o=await this.read(new Uint8Array(t),0,t,r);if(!o.bytesRead)return void e.close();if(e.enqueue(o.buffer.slice(0,o.bytesRead)),r+=o.bytesRead,++i>=n)throw new gP(fP.EFBIG,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");s=o.bytesRead}}catch(t){e.error(t)}},type:e.type})}readLines(e){throw gP.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){const t=await this.file.stat();if(kB.checkAccess&&!t.hasAccess(BP,this.context))throw gP.With("EACCES",this.file.path,"stat");return e?.bigint?new FB(t):t}async write(e,t,n,i){let r,s,o;if("string"==typeof e){i="number"==typeof t?t:null;const a="string"==typeof n?n:"utf8";s=0,r=R$.Buffer.from(e,a),o=r.length}else r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=t,o=n,i="number"==typeof i?i:null;i??(i=this.file.position);const a=await this.file.write(r,s,o,i);return Q$("change",this.file.path),{buffer:r,bytesWritten:a}}async writeFile(e,t={}){const n=NP(t,"utf8","w",420);if(!zB($B(n.flag)))throw new gP(fP.EINVAL,"Flag passed must allow for writing.");if("string"!=typeof e&&!n.encoding)throw new gP(fP.EINVAL,"Encoding not specified");const i="string"==typeof e?R$.Buffer.from(e,n.encoding):e;await this.file.write(i,0,i.length,0),Q$("change",this.file.path)}async close(){await this.file.close(),D$.delete(this.fd)}async writev(e,t){let n=0;for(const i of e)n+=(await this.write(i,0,i.length,t+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,t){let n=0;for(const i of e)n+=(await this.read(i,0,i.byteLength,t+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){const t=new qU({highWaterMark:e?.highWaterMark||65536,encoding:e.encoding,read:async e=>{try{const n=await this.read(new Uint8Array(e),0,e,this.file.position);t.push(n.bytesRead?n.buffer.slice(0,n.bytesRead):null),this.file.position+=n.bytesRead}catch(e){t.destroy(e)}}});return t.path=this.file.path,t}createWriteStream(e){const t=new KU({highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(e,t,n)=>{try{const{bytesWritten:i}=await this.write(e,null,t);n(i==e.length?null:new Error("Failed to write full chunk"))}catch(e){n(e)}}});return t.path=this.file.path,t}}async function eV(e,t){e=RP(e),t=RP(t);const n=V$(e,this),i=V$(t,this);if(kB.checkAccess&&!(await nV.call(this,TP(e))).hasAccess($P,this))throw gP.With("EACCES",e,"rename");try{if(n.mountPoint==i.mountPoint)return await n.fs.rename(n.path,i.path),Q$("rename",e.toString()),void Q$("change",t.toString());await uV.call(this,t,await lV(e)),await sV.call(this,e),Q$("rename",e.toString())}catch(r){throw Y$(r,{[n.path]:e,[i.path]:t})}}async function tV(e){try{const{fs:t,path:n}=V$(await EV.call(this,e),this);return await t.exists(n)}catch(e){if(e instanceof gP&&"ENOENT"==e.code)return!1;throw e}}async function nV(e,t){e=RP(e);const{fs:n,path:i}=V$(await EV.call(this,e),this);try{const e=await n.stat(i);if(kB.checkAccess&&!e.hasAccess(BP,this))throw gP.With("EACCES",i,"stat");return t?.bigint?new FB(e):e}catch(t){throw Y$(t,{[i]:e})}}async function iV(e,t){e=RP(e);const{fs:n,path:i}=V$(e,this);try{const e=await n.stat(i);return t?.bigint?new FB(e):e}catch(t){throw Y$(t,{[i]:e})}}async function rV(e,t=0){const n={stack:[],error:void 0,hasError:!1};try{const i=ZU(n,await aV.call(this,e,"r+"),!0);await i.truncate(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=QU(n);e&&await e}}async function sV(e){e=RP(e);const{fs:t,path:n}=V$(e,this);try{if(kB.checkAccess&&!(await(M$.getAsync(e)||t.stat(n))).hasAccess($P,this))throw gP.With("EACCES",n,"unlink");await t.unlink(n),Q$("rename",e.toString())}catch(t){throw Y$(t,{[n]:e})}}async function oV(e,t,n=420,i){e=RP(e);const r=MP(n,420),s=$B(t);e=i?await EV.call(this,e):e;const{fs:o,path:a}=V$(e,this),l=await o.stat(a).catch(()=>null);if(!l){if(!zB(s)&&!YB(s)||"r+"==s)throw gP.With("ENOENT",e,"_open");const t=await o.stat(TP(a));if(kB.checkAccess&&!t.hasAccess($P,this))throw gP.With("EACCES",TP(e),"_open");if(!t.isDirectory())throw gP.With("ENOTDIR",TP(e),"_open");return new JU(await o.createFile(a,s,r),this)}if(kB.checkAccess&&!l.hasAccess(UB(s),this))throw gP.With("EACCES",e,"_open");if(GB(s))throw gP.With("EEXIST",e,"_open");const u=new JU(await o.openFile(a,s),this);return jB(s)&&await u.truncate(0),u}async function aV(e,t="r",n=420){return await oV.call(this,e,t,n,!0)}async function lV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=NP(t,null,"r",420),r=ZU(n,"object"==typeof e&&"fd"in e?e:await aV.call(this,e,i.flag,i.mode),!0);return await r.readFile(i)}catch(e){n.error=e,n.hasError=!0}finally{const e=QU(n);e&&await e}}async function uV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=NP(n,"utf8","w+",420),s=ZU(i,e instanceof JU?e:await aV.call(this,e.toString(),r.flag,r.mode),!0),o=t;if("string"!=typeof o&&!(o instanceof Uint8Array))throw new gP(fP.EINVAL,"Iterables and streams not supported",s.file.path,"writeFile");await s.writeFile(o,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function cV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=NP(n,"utf8","a",420);if(!YB($B(r.flag)))throw new gP(fP.EINVAL,"Flag passed to appendFile must allow for appending.");if("string"!=typeof t&&!r.encoding)throw new gP(fP.EINVAL,"Encoding not specified");const s="string"==typeof t?R$.Buffer.from(t,r.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=ZU(i,"object"==typeof e&&"fd"in e?e:await aV.call(this,e,r.flag,r.mode),!0);await o.appendFile(s,r)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function dV(e){e=await EV.call(this,e);const{fs:t,path:n}=V$(e,this);try{const i=await(M$.getAsync(e)||t.stat(n));if(!i)throw gP.With("ENOENT",e,"rmdir");if(!i.isDirectory())throw gP.With("ENOTDIR",n,"rmdir");if(kB.checkAccess&&!i.hasAccess($P,this))throw gP.With("EACCES",n,"rmdir");await t.rmdir(n),Q$("rename",e.toString())}catch(t){throw Y$(t,{[n]:e})}}async function hV(e,t){t="object"==typeof t?t:{mode:t};const n=MP(t?.mode,511);e=await EV.call(this,e);const{fs:i,path:r,root:s}=V$(e,this),o={[r]:e};try{if(!t?.recursive){if(kB.checkAccess&&!(await i.stat(TP(r))).hasAccess($P,this))throw gP.With("EACCES",TP(r),"mkdir");return await i.mkdir(r,n),void Q$("rename",e.toString())}const a=[];for(let t=r,n=e;!await i.exists(t);t=TP(t),n=TP(n))a.unshift(t),o[t]=n;for(const e of a){if(kB.checkAccess&&!(await i.stat(TP(e))).hasAccess($P,this))throw gP.With("EACCES",TP(e),"mkdir");await i.mkdir(e,n),Q$("rename",e)}return 1==s.length?a[0]:a[0]?.slice(s.length)}catch(e){throw Y$(e,o)}}async function pV(e,t){t="object"==typeof t?t:{encoding:t},e=await EV.call(this,e);const n=t=>{throw Y$(t,{[r]:e})},{fs:i,path:r}=V$(e,this),s=M$.getAsync(e)||i.stat(r).catch(n);M$.setAsync(e,s);const o=await s;if(!o)throw gP.With("ENOENT",e,"readdir");if(kB.checkAccess&&!o.hasAccess(BP,this))throw gP.With("EACCES",e,"readdir");if(!o.isDirectory())throw gP.With("ENOTDIR",e,"readdir");const a=await i.readdir(r).catch(n),l=[];return await Promise.all(a.map(async s=>{let o;if(t?.recursive||t?.withFileTypes){const t=M$.getAsync(bP(e,s))||i.stat(bP(r,s)).catch(n);M$.setAsync(bP(e,s),t),o=await t}if(t?.withFileTypes?l.push(new HU(s,o)):"buffer"==t?.encoding?l.push(R$.Buffer.from(s)):l.push(s),t?.recursive&&o?.isDirectory())for(const n of await pV.call(this,bP(e,s),{...t,_isIndirect:!0}))n instanceof HU?(n.path=bP(s,n.path),l.push(n)):R$.Buffer.isBuffer(n)?l.push(R$.Buffer.from(bP(s,SP(n)))):l.push(bP(s,n))})),t?._isIndirect||M$.clear(),l}async function fV(e,t){e=RP(e),t=RP(t);const{fs:n,path:i}=V$(e,this),r=V$(t,this);if(n!=r.fs)throw gP.With("EXDEV",t,"link");try{if(kB.checkAccess&&!(await n.stat(TP(e))).hasAccess(BP,this))throw gP.With("EACCES",TP(i),"link");if(kB.checkAccess&&!(await nV.call(this,TP(t))).hasAccess($P,this))throw gP.With("EACCES",TP(t),"link");if(kB.checkAccess&&!(await n.stat(i)).hasAccess(BP,this))throw gP.With("EACCES",i,"link");return await n.link(i,r.path)}catch(n){throw Y$(n,{[r.path]:t,[i]:e})}}async function mV(e,t,n="file"){const i={stack:[],error:void 0,hasError:!1};try{if(!["file","dir","junction"].includes(n))throw new gP(fP.EINVAL,"Invalid symlink type: "+n);if(await tV.call(this,t))throw gP.With("EEXIST",t.toString(),"symlink");const r=ZU(i,await oV.call(this,t,"w+",420,!1),!0);await r.writeFile(e.toString()),await r.file.chmod(lB)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function gV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=ZU(n,await oV.call(this,RP(e),"r",420,!1),!0),r=await i.readFile(),s="object"==typeof t?t?.encoding:t;return"buffer"==s?r:r.toString(s)}catch(e){n.error=e,n.hasError=!0}finally{const e=QU(n);e&&await e}}async function _V(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=ZU(i,await aV.call(this,e,"r+"),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function yV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=ZU(i,await oV.call(this,e,"r+",420,!1),!0);await r.chown(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function vV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=ZU(n,await aV.call(this,e,"r+"),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=QU(n);e&&await e}}async function bV(e,t){const n={stack:[],error:void 0,hasError:!1};try{const i=ZU(n,await oV.call(this,e,"r+",420,!1),!0);await i.chmod(t)}catch(e){n.error=e,n.hasError=!0}finally{const e=QU(n);e&&await e}}async function TV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=ZU(i,await aV.call(this,e,"r+"),!0);await r.utimes(t,n)}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function xV(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{const r=ZU(i,await oV.call(this,e,"r+",420,!1),!0);await r.utimes(new Date(t),new Date(n))}catch(e){i.error=e,i.hasError=!0}finally{const e=QU(i);e&&await e}}async function EV(e,t){e=RP(e);const n=(this?.root||"")+e;if(k$.hasAsync(n))return k$.getAsync(n);const{base:i,dir:r}=EP(e),s="/"==r?"/":await(k$.getAsync((this?.root||"")+r)||EV.call(this,r)),o=bP(s,i),{fs:a,path:l}=V$(o,this);try{const t=M$.getAsync(o)||a.stat(l);if(M$.setAsync(o,t),!(await t).isSymbolicLink())return k$.set(e,o),o;const i=vP(s,(await gV.call(this,o)).toString()),r=k$.getAsync((this?.root||"")+i)||EV.call(this,i);return k$.setAsync(n,r),await r}catch(t){if("ENOENT"==t.code)return e;throw Y$(t,{[l]:o})}}function wV(e,t={}){return{[Symbol.asyncIterator](){const n=new q$(e.toString(),"string"!=typeof t?t:{encoding:t}),i=[];function r(){n.close();for(const e of i)e({value:null,done:!0});return i.length=0,Promise.resolve({value:null,done:!0})}return n.on("change",(e,t)=>{i.shift()?.({value:{eventType:e,filename:t},done:!1})}),{async next(){const{promise:e,resolve:t}=Promise.withResolvers();return i.push(t),e},return:r,throw:r}}}}async function IV(e,t=PP){if(!kB.checkAccess)return;if(!(await nV.call(this,e)).hasAccess(t,this))throw new gP(fP.EACCES)}async function AV(e,t){e=RP(e);const n=await(M$.getAsync(e)||iV.call(this,e).catch(e=>{if("ENOENT"!=e.code||!t?.force)throw e}));if(n){switch(M$.set(e,n),n.mode&oB){case dB:if(t?.recursive)for(const n of await pV.call(this,e,{_isIndirect:!0}))await AV.call(this,bP(e,n),{...t,_isIndirect:!0});await dV.call(this,e);break;case uB:case lB:case cB:case hB:await sV.call(this,e);break;default:throw M$.clear(),new gP(fP.EPERM,"File type not supported",e,"rm")}t?._isIndirect||M$.clear()}}async function SV(e,t){const n="object"==typeof t?t?.encoding:t||"utf8",i="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await hV.call(this,i),"buffer"==n?R$.Buffer.from(i):i}async function CV(e,t,n){if(e=RP(e),t=RP(t),n&&n&VP&&await tV.call(this,t))throw new gP(fP.EEXIST,"Destination file already exists.",t,"copyFile");await uV.call(this,t,await lV.call(this,e)),Q$("rename",t.toString())}function OV(e,t){return e=RP(e),Promise.resolve(new WU(e,this))}async function MV(e,t,n){e=RP(e),t=RP(t);const i=await iV.call(this,e);if(n?.errorOnExist&&await tV.call(this,t))throw new gP(fP.EEXIST,"Destination file or directory already exists.",t,"cp");switch(i.mode&oB){case dB:{if(!n?.recursive)throw new gP(fP.EISDIR,e+" is a directory (not copied)",e,"cp");const[i]=await Promise.all([pV.call(this,e,{withFileTypes:!0}),hV.call(this,t,{recursive:!0})]),r=async i=>{n.filter&&!n.filter(bP(e,i.name),bP(t,i.name))||await MV.call(this,bP(e,i.name),bP(t,i.name),n)};await Promise.all(i.map(r));break}case uB:case lB:await CV.call(this,e,t);break;default:throw new gP(fP.EPERM,"File type not supported",e,"rm")}n?.preserveTimestamps&&await TV.call(this,t,i.atime,i.mtime)}async function kV(e,t){e=RP(e);const{fs:n}=V$(e,this);return Promise.resolve(H$(n,t?.bigint))}const RV=()=>{};function NV(e,t,n=RV){eV.call(this,e,t).then(()=>n()).catch(n)}function DV(e,t=RV){tV.call(this,e).then(t).catch(()=>t(!1))}function FV(e,t,n=RV){n="function"==typeof t?t:n,nV.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function LV(e,t,n=RV){n="function"==typeof t?t:n,iV.call(this,e,"function"!=typeof t?t:{}).then(e=>n(void 0,e)).catch(n)}function PV(e,t=0,n=RV){n="function"==typeof t?t:n;const i="number"==typeof t?t:0;rV.call(this,e,i).then(()=>n()).catch(n)}function BV(e,t=RV){sV.call(this,e).then(()=>t()).catch(t)}function $V(e,t,n,i=RV){const r=MP(n,420);i="function"==typeof n?n:i,aV.call(this,e,t,r).then(e=>i(void 0,e.fd)).catch(i)}function UV(e,t,n=RV){n="function"==typeof t?t:n,lV.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function VV(e,t,n,i=RV){i="function"==typeof n?n:i,uV.call(this,e,t,"function"!=typeof n?n:null).then(()=>i(void 0)).catch(i)}function zV(e,t,n,i=RV){const r="function"!=typeof n?n:void 0;i="function"==typeof n?n:i,cV.call(this,e,t,r).then(()=>i()).catch(i)}function jV(e,t,n=RV){n="function"==typeof t?t:n,P$(e).stat().then(e=>n(void 0,"object"==typeof t&&t?.bigint?new FB(e):e)).catch(n)}function YV(e,t=RV){const n=P$(e).close();D$.delete(e),n.then(()=>t()).catch(t)}function GV(e,t,n=RV){const i="number"==typeof t?t:0;n="function"==typeof t?t:n;const r=P$(e);if(i<0)throw new gP(fP.EINVAL);r.truncate(i).then(()=>n()).catch(n)}function HV(e,t=RV){P$(e).sync().then(()=>t()).catch(t)}function WV(e,t=RV){P$(e).datasync().then(()=>t()).catch(t)}function XV(e,t,n,i,r,s=RV){let o,a,l,u,c;const d=new JU(e,this);if("string"==typeof t){switch(c="utf8",typeof n){case"function":s=n;break;case"number":u=n,c="string"==typeof i?i:"utf8",s="function"==typeof r?r:s;break;default:return void(s="function"==typeof i?i:"function"==typeof r?r:s)(new gP(fP.EINVAL,"Invalid arguments."))}o=R$.Buffer.from(t),a=0,l=o.length;const e=s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o.toString(c))).catch(e)}else{o=R$.Buffer.from(t.buffer),a=n,l=i,u="number"==typeof r?r:null;const e="function"==typeof r?r:s;d.write(o,a,l,u).then(({bytesWritten:t})=>e(void 0,t,o)).catch(e)}}function qV(e,t,n,i,r,s=RV){new JU(e,this).read(t,n,i,r).then(({bytesRead:e,buffer:t})=>s(void 0,e,t)).catch(s)}function KV(e,t,n,i=RV){new JU(e,this).chown(t,n).then(()=>i()).catch(i)}function ZV(e,t,n){new JU(e,this).chmod(t).then(()=>n()).catch(n)}function QV(e,t,n,i=RV){new JU(e,this).utimes(t,n).then(()=>i()).catch(i)}function JV(e,t=RV){dV.call(this,e).then(()=>t()).catch(t)}function ez(e,t,n=RV){hV.call(this,e,t).then(()=>n()).catch(n)}function tz(e,t,n=RV){n="function"==typeof t?t:n;const i="function"!=typeof t?t:{};pV.call(this,e,i).then(e=>n(void 0,e)).catch(n)}function nz(e,t,n=RV){fV.call(this,e,t).then(()=>n()).catch(n)}function iz(e,t,n,i=RV){const r="string"==typeof n?n:"file";i="function"==typeof n?n:i,mV.call(this,e,t,r).then(()=>i()).catch(i)}function rz(e,t,n=RV){n="function"==typeof t?t:n,gV.call(this,e).then(e=>n(void 0,e)).catch(n)}function sz(e,t,n,i=RV){_V.call(this,e,t,n).then(()=>i()).catch(i)}function oz(e,t,n,i=RV){yV.call(this,e,t,n).then(()=>i()).catch(i)}function az(e,t,n=RV){vV.call(this,e,t).then(()=>n()).catch(n)}function lz(e,t,n=RV){bV.call(this,e,t).then(()=>n()).catch(n)}function uz(e,t,n,i=RV){TV.call(this,e,t,n).then(()=>i()).catch(i)}function cz(e,t,n,i=RV){xV.call(this,e,t,n).then(()=>i()).catch(i)}function dz(e,t,n=RV){n="function"==typeof t?t:n,EV.call(this,e,"function"==typeof t?null:t).then(e=>n(void 0,e)).catch(n)}function hz(e,t,n=RV){const i="number"==typeof t?t:BP;n="function"==typeof t?t:n,IV.call(this,e,i).then(()=>n()).catch(n)}const pz=new Map;function fz(e,t,n){const i=RP(e.toString()),r="function"!=typeof t?t:{};if("function"==typeof t&&(n=t),!n)throw new gP(fP.EINVAL,"No listener specified",e.toString(),"watchFile");if(pz.has(i)){const e=pz.get(i);return void(e&&e.listeners.add(n))}const s=new K$(i,r);s.on("change",(e,t)=>{const n=pz.get(i);if(n)for(const i of n.listeners)i(e,t)}),pz.set(i,{watcher:s,listeners:new Set})}function mz(e,t=RV){const n=RP(e.toString()),i=pz.get(n);i&&(t&&t!==RV?i.listeners.delete(t):i.listeners.clear(),0===i.listeners.size&&(i.watcher.stop(),pz.delete(n)))}function gz(e,t,n){const i=new q$(RP(e),"object"==typeof t?t:{});return n="function"==typeof t?t:n,i.on("change",n||RV),i}function _z(e,t){const n=this;let i;const r=new qU({highWaterMark:(t="object"==typeof t?t:{encoding:t}).highWaterMark||65536,encoding:t.encoding||"utf8",async read(s){try{i||(i=await aV.call(n,e,"r",t?.mode));const o=await i.read(new Uint8Array(s),0,s,i.file.position);r.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),i.file.position+=o.bytesRead,o.bytesRead||await i.close()}catch(e){await(i?.close()),r.destroy(e)}},destroy(e,t){i?.close().then(()=>t(e)).catch(RV)}});return r.path=e.toString(),r}function yz(e,t){const n=this;let i;t="object"==typeof t?t:{encoding:t};const r=new KU({highWaterMark:t?.highWaterMark,async write(r,s,o){try{i||(i=await aV.call(n,e,"w",t?.mode||438)),await i.write(r,0,s),o(void 0)}catch(e){await(i?.close()),o(e)}},destroy(e,t){t(e),i?.close().then(()=>t(e)).catch(t)},final(e){i?.close().then(()=>e()).catch(e)}});return r.path=e.toString(),r}function vz(e,t,n=RV){n="function"==typeof t?t:n,AV.call(this,e,"function"==typeof t?void 0:t).then(()=>n(void 0)).catch(n)}function bz(e,t,n=RV){n="function"==typeof t?t:n,SV.call(this,e,"function"!=typeof t?t:null).then(e=>n(void 0,e)).catch(n)}function Tz(e,t,n,i=RV){i="function"==typeof n?n:i,CV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function xz(e,t,n,i=RV){i="function"==typeof n?n:i,new JU(e,this).readv(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesRead:t})=>i(void 0,t,e)).catch(i)}function Ez(e,t,n,i=RV){i="function"==typeof n?n:i,new JU(e,this).writev(t,"function"==typeof n?void 0:n).then(({buffers:e,bytesWritten:t})=>i(void 0,t,e)).catch(i)}function wz(e,t,n=RV){n="function"==typeof t?t:n,OV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}function Iz(e,t,n,i=RV){i="function"==typeof n?n:i,MV.call(this,e,t,"function"==typeof n?void 0:n).then(()=>i(void 0)).catch(i)}function Az(e,t,n=RV){n="function"==typeof t?t:n,kV.call(this,e,"function"==typeof t?void 0:t).then(e=>n(void 0,e)).catch(n)}async function Sz(e,t){const n=await aV.call(this,e.toString(),"r"),i=await n.readFile();return await n.close(),new Blob([i],t)}var Cz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Oz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});function Mz(e){return class extends e{constructor(){super(...arguments),this._queue=[],this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(e=>{const t=()=>this._queueRunning?setTimeout(t):e();t()})}async ready(){if(await super.ready(),await this.queueDone(),!this._isInitialized&&!this._disableSync){if(this.checkSync(),await this._sync.ready(),this._sync instanceof x$&&this instanceof x$){const e=this._sync.store.transaction(),t=this.store.transaction(),n=[];for(const i of await t.keys())n.push(t.get(i).then(t=>e.setSync(i,t)));return await Promise.all(n),void(this._isInitialized=!0)}try{await this.crossCopy("/"),this._isInitialized=!0}catch(e){throw this._isInitialized=!1,e}}}checkSync(e,t){if(this._disableSync)throw new gP(fP.ENOTSUP,"Sync caching has been disabled for this async file system",e,t);if(!this._sync)throw new gP(fP.ENOTSUP,"No sync cache is attached to this async file system",e,t)}renameSync(e,t){this.checkSync(e,"rename"),this._sync.renameSync(e,t),this.queue("rename",e,t)}statSync(e){return this.checkSync(e,"stat"),this._sync.statSync(e)}createFileSync(e,t,n){return this.checkSync(e,"createFile"),this._sync.createFileSync(e,t,n),this.queue("createFile",e,t,n),this.openFileSync(e,t)}openFileSync(e,t){this.checkSync(e,"openFile");const n=this._sync.openFileSync(e,t+"+"),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new WB(this,e,t,i,r)}unlinkSync(e){this.checkSync(e,"unlinkSync"),this._sync.unlinkSync(e),this.queue("unlink",e)}rmdirSync(e){this.checkSync(e,"rmdir"),this._sync.rmdirSync(e),this.queue("rmdir",e)}mkdirSync(e,t){this.checkSync(e,"mkdir"),this._sync.mkdirSync(e,t),this.queue("mkdir",e,t)}readdirSync(e){return this.checkSync(e,"readdir"),this._sync.readdirSync(e)}linkSync(e,t){this.checkSync(e,"link"),this._sync.linkSync(e,t),this.queue("link",e,t)}syncSync(e,t,n){this.checkSync(e,"sync"),this._sync.syncSync(e,t,n),this.queue("sync",e,t,n)}existsSync(e){return this.checkSync(e,"exists"),this._sync.existsSync(e)}async crossCopy(e){this.checkSync(e,"crossCopy");const t=await this.stat(e);if(!t.isDirectory()){const n={stack:[],error:void 0,hasError:!1};try{const i=Cz(n,await this.openFile(e,$B("r")),!0),r=Cz(n,this._sync.createFileSync(e,$B("w"),t.mode),!1),s=new Uint8Array(t.size);return await i.read(s),void r.writeSync(s,0,t.size)}catch(e){n.error=e,n.hasError=!0}finally{const e=Oz(n);e&&await e}}if("/"!==e){const t=await this.stat(e);this._sync.mkdirSync(e,t.mode)}const n=[];for(const t of await this.readdir(e))n.push(this.crossCopy(bP(e,t)));await Promise.all(n)}async _next(){if(!this._queueRunning)return;const[e,...t]=this._queue.shift();await this[e](...t),await this._next()}queue(...e){this._queue.push(e),this._next()}}}new Map;Mz(XB);new Map;Map;kz=XB;var kz;var Rz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Nz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});class Dz{get isLocked(){return this._isLocked}constructor(e){this.previous=e,this.current=Promise.withResolvers(),this._isLocked=!0}async done(){await(this.previous?.done()),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}}class Fz{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){const e=new Dz(this.currentLock);return this.currentLock=e,e}async lock(e,t){const n=this.currentLock,i=this.addLock(),r=(new Error).stack;return setTimeout(()=>{if(i.isLocked){const n=gP.With("EDEADLK",e,t);throw n.stack+=r?.slice(5),n}},5e3),await(n?.done()),i}lockSync(e,t){if(this.currentLock?.isLocked)throw gP.With("EBUSY",e,t);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,await this.lock(e,"rename"),!1);await this._fs.rename(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}renameSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,this.lockSync(e,"rename"),!1);return this._fs.renameSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}async stat(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,await this.lock(e,"stat"),!1);return await this._fs.stat(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}statSync(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,this.lockSync(e,"stat"),!1);return this._fs.statSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}async openFile(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,await this.lock(e,"openFile"),!1);const i=await this._fs.openFile(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}openFileSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,this.lockSync(e,"openFile"),!1);const i=this._fs.openFileSync(e,t);return i.fs=this,i}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}async createFile(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Rz(i,await this.lock(e,"createFile"),!1);const r=await this._fs.createFile(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Nz(i)}}createFileSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Rz(i,this.lockSync(e,"createFile"),!1);const r=this._fs.createFileSync(e,t,n);return r.fs=this,r}catch(e){i.error=e,i.hasError=!0}finally{Nz(i)}}async unlink(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,await this.lock(e,"unlink"),!1);await this._fs.unlink(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}unlinkSync(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,this.lockSync(e,"unlink"),!1);return this._fs.unlinkSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}async rmdir(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,await this.lock(e,"rmdir"),!1);await this._fs.rmdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}rmdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,this.lockSync(e,"rmdir"),!1);return this._fs.rmdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}async mkdir(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,await this.lock(e,"mkdir"),!1);await this._fs.mkdir(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}mkdirSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,this.lockSync(e,"mkdir"),!1);return this._fs.mkdirSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}async readdir(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,await this.lock(e,"readdir"),!1);return await this._fs.readdir(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}readdirSync(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,this.lockSync(e,"readdir"),!1);return this._fs.readdirSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}async exists(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,await this.lock(e,"exists"),!1);return await this._fs.exists(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}existsSync(e){const t={stack:[],error:void 0,hasError:!1};try{Rz(t,this.lockSync(e,"exists"),!1);return this._fs.existsSync(e)}catch(e){t.error=e,t.hasError=!0}finally{Nz(t)}}async link(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,await this.lock(e,"link"),!1);await this._fs.link(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}linkSync(e,t){const n={stack:[],error:void 0,hasError:!1};try{Rz(n,this.lockSync(e,"link"),!1);return this._fs.linkSync(e,t)}catch(e){n.error=e,n.hasError=!0}finally{Nz(n)}}async sync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Rz(i,await this.lock(e,"sync"),!1);await this._fs.sync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Nz(i)}}syncSync(e,t,n){const i={stack:[],error:void 0,hasError:!1};try{Rz(i,this.lockSync(e,"sync"),!1);return this._fs.syncSync(e,t,n)}catch(e){i.error=e,i.hasError=!0}finally{Nz(i)}}}var Lz=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(void 0===i){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if("function"!=typeof i)throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t},Pz=function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}return function e(){for(;t.stack.length;){var i=t.stack.pop();try{var r=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(r).then(e,function(t){return n(t),e()})}catch(e){n(e)}}if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i});const Bz="/.deleted";class $z extends XB{async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}constructor({writable:e,readable:t}){if(super(),this._isInitialized=!1,this._deletedFiles=new Set,this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this.writable=e,this.readable=t,this.writable.metadata().readonly)throw new gP(fP.EINVAL,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:Uz.name}}async sync(e,t,n){await this.copyForWrite(e),await this.writable.exists(e)||await this.writable.createFile(e,"w",420),await this.writable.sync(e,t,n)}syncSync(e,t,n){this.copyForWriteSync(e),this.writable.syncSync(e,t,n)}async _initialize(){if(!this._isInitialized){try{const e=await this.writable.openFile(Bz,$B("r")),{size:t}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(t));this._deleteLog=SP(n)}catch(e){if(e.errno!==fP.ENOENT)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(e){this._deleteLog=e,this._reparseDeletionLog(),await this.updateLog("")}async rename(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),await this.copyForWrite(e);try{await this.writable.rename(e,t)}catch{if(this._deletedFiles.has(e))throw gP.With("ENOENT",e,"rename")}}renameSync(e,t){this.checkInitialized(),this.checkPath(e),this.checkPath(t),this.copyForWriteSync(e);try{this.writable.renameSync(e,t)}catch{if(this._deletedFiles.has(e))throw gP.With("ENOENT",e,"rename")}}async stat(e){this.checkInitialized();try{return await this.writable.stat(e)}catch{if(this._deletedFiles.has(e))throw gP.With("ENOENT",e,"stat");const t=await this.readable.stat(e);return t.mode|=146,t}}statSync(e){this.checkInitialized();try{return this.writable.statSync(e)}catch{if(this._deletedFiles.has(e))throw gP.With("ENOENT",e,"stat");const t=this.readable.statSync(e);return t.mode|=146,t}}async openFile(e,t){if(await this.writable.exists(e))return this.writable.openFile(e,t);const n=await this.readable.openFile(e,$B("r")),i=await n.stat(),{buffer:r}=await n.read(new Uint8Array(i.size));return new WB(this,e,t,i,r)}openFileSync(e,t){if(this.writable.existsSync(e))return this.writable.openFileSync(e,t);const n=this.readable.openFileSync(e,$B("r")),i=n.statSync(),r=new Uint8Array(i.size);return n.readSync(r),new WB(this,e,t,i,r)}async createFile(e,t,n){return this.checkInitialized(),await this.writable.createFile(e,t,n),this.openFile(e,t)}createFileSync(e,t,n){return this.checkInitialized(),this.writable.createFileSync(e,t,n),this.openFileSync(e,t)}async link(e,t){this.checkInitialized(),await this.copyForWrite(e),await this.writable.link(e,t)}linkSync(e,t){this.checkInitialized(),this.copyForWriteSync(e),this.writable.linkSync(e,t)}async unlink(e){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e))throw gP.With("ENOENT",e,"unlink");await this.writable.exists(e)&&await this.writable.unlink(e),await this.exists(e)&&await this.deletePath(e)}unlinkSync(e){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e))throw gP.With("ENOENT",e,"unlink");this.writable.existsSync(e)&&this.writable.unlinkSync(e),this.existsSync(e)&&this.deletePath(e)}async rmdir(e){if(this.checkInitialized(),!await this.exists(e))throw gP.With("ENOENT",e,"rmdir");if(await this.writable.exists(e)&&await this.writable.rmdir(e),await this.exists(e)){if((await this.readdir(e)).length)throw gP.With("ENOTEMPTY",e,"rmdir");await this.deletePath(e)}}rmdirSync(e){if(this.checkInitialized(),!this.existsSync(e))throw gP.With("ENOENT",e,"rmdir");if(this.writable.existsSync(e)&&this.writable.rmdirSync(e),this.existsSync(e)){if(this.readdirSync(e).length)throw gP.With("ENOTEMPTY",e,"rmdir");this.deletePath(e)}}async mkdir(e,t){if(this.checkInitialized(),await this.exists(e))throw gP.With("EEXIST",e,"mkdir");await this.createParentDirectories(e),await this.writable.mkdir(e,t)}mkdirSync(e,t){if(this.checkInitialized(),this.existsSync(e))throw gP.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e),this.writable.mkdirSync(e,t)}async readdir(e){this.checkInitialized();const t=[];try{t.push(...await this.writable.readdir(e))}catch{}try{t.push(...(await this.readable.readdir(e)).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}readdirSync(e){this.checkInitialized();let t=[];try{t=t.concat(this.writable.readdirSync(e))}catch{}try{t=t.concat(this.readable.readdirSync(e).filter(t=>!this._deletedFiles.has(`${e}/${t}`)))}catch{}const n={};return t.filter(e=>{const t=!n[e];return n[e]=!0,t})}async deletePath(e){this._deletedFiles.add(e),await this.updateLog(`d${e}\n`)}async updateLog(e){if(this._deleteLog+=e,this._deleteLogUpdatePending)return void(this._deleteLogUpdateNeeded=!0);this._deleteLogUpdatePending=!0;const t=await this.writable.openFile(Bz,$B("w"));try{await t.write(IP(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(e){this._deleteLogError=e}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(const e of this._deleteLog.split("\n"))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new gP(fP.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;const e=this._deleteLogError;throw delete this._deleteLogError,e}checkPath(e){if(e==Bz)throw gP.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e){let t=TP(e);const n=[];for(;!this.writable.existsSync(t);)n.push(t),t=TP(t);for(const e of n.reverse())this.writable.mkdirSync(e,this.statSync(e).mode)}async createParentDirectories(e){let t=TP(e);const n=[];for(;!await this.writable.exists(t);)n.push(t),t=TP(t);for(const e of n.reverse()){const t=await this.stat(e);await this.writable.mkdir(e,t.mode)}}copyForWriteSync(e){if(!this.existsSync(e))throw gP.With("ENOENT",e,"copyForWrite");this.writable.existsSync(TP(e))||this.createParentDirectoriesSync(e),this.writable.existsSync(e)||this.copyToWritableSync(e)}async copyForWrite(e){if(!await this.exists(e))throw gP.With("ENOENT",e,"copyForWrite");if(await this.writable.exists(TP(e))||await this.createParentDirectories(e),!await this.writable.exists(e))return this.copyToWritable(e)}copyToWritableSync(e){const t={stack:[],error:void 0,hasError:!1};try{const n=this.statSync(e);if(n.isDirectory())return void this.writable.mkdirSync(e,n.mode);const i=new Uint8Array(n.size);Lz(t,this.readable.openFileSync(e,"r"),!1).readSync(i);Lz(t,this.writable.createFileSync(e,"w",146|n.mode),!1).writeSync(i)}catch(e){t.error=e,t.hasError=!0}finally{Pz(t)}}async copyToWritable(e){const t={stack:[],error:void 0,hasError:!1};try{const n=await this.stat(e);if(n.isDirectory())return void await this.writable.mkdir(e,n.mode);const i=new Uint8Array(n.size),r=Lz(t,await this.readable.openFile(e,"r"),!0);await r.read(i);const s=Lz(t,await this.writable.createFile(e,"w",146|n.mode),!0);await s.write(i)}catch(e){t.error=e,t.hasError=!0}finally{const e=Pz(t);e&&await e}}}class Uz extends(function(e){return class extends Fz{constructor(...t){super(),this._fs=new e(...t)}}}($z)){}function Vz(e,t,n){if(e instanceof gP)return e;const i=e instanceof DOMException?fP[function(e){switch(e.name){case"IndexSizeError":case"HierarchyRequestError":case"InvalidCharacterError":case"InvalidStateError":case"SyntaxError":case"NamespaceError":case"TypeMismatchError":case"ConstraintError":case"VersionError":case"URLMismatchError":case"InvalidNodeTypeError":return"EINVAL";case"WrongDocumentError":return"EXDEV";case"NoModificationAllowedError":case"InvalidModificationError":case"InvalidAccessError":case"SecurityError":case"NotAllowedError":return"EACCES";case"NotFoundError":return"ENOENT";case"NotSupportedError":return"ENOTSUP";case"InUseAttributeError":return"EBUSY";case"NetworkError":return"ENETDOWN";case"AbortError":return"EINTR";case"QuotaExceededError":return"ENOSPC";case"TimeoutError":return"ETIMEDOUT";case"ReadOnlyError":return"EROFS";default:return"EIO"}}(e)]:fP.EIO,r=new gP(i,e.message,t,n);return r.stack=e.stack,r.cause=e.cause,r}globalThis.__zenfs__=ue;class zz extends(Mz(XB)){constructor(e){super(),this._handles=new Map,this._sync=C$.create({name:"accessfs-cache"}),this._handles.set("/",e)}metadata(){return{...super.metadata(),name:"WebAccess",noResizableBuffers:!0}}async sync(e,t){await this.writeFile(e,t)}async rename(e,t){const n=await this.getHandle(e);if(n instanceof FileSystemDirectoryHandle){const n=await this.readdir(e);if(await this.mkdir(t),!n.length)return void await this.unlink(e);for(const i of n)await this.rename(bP(e,i),bP(t,i)),await this.unlink(e);return}if(!(n instanceof FileSystemFileHandle))throw new gP(fP.ENOTSUP,"Not a file or directory handle",e,"rename");const i=await n.getFile().catch(t=>{throw Vz(t,e,"rename")}),r=await this.getHandle(TP(t));if(!(r instanceof FileSystemDirectoryHandle))return;const s=await r.getFileHandle(xP(t),{create:!0}).catch(e=>{throw Vz(e,t,"rename")}),o=await s.createWritable();await o.write(await i.arrayBuffer()),await o.close(),await this.unlink(e)}async writeFile(e,t){if(t.buffer.resizable)throw new gP(fP.EINVAL,"Resizable buffers can not be written",e,"write");const n=await this.getHandle(TP(e));if(!(n instanceof FileSystemDirectoryHandle))return;const i=await n.getFileHandle(xP(e),{create:!0}),r=await i.createWritable();await r.write(t),await r.close()}async createFile(e,t){return await this.writeFile(e,new Uint8Array),this.openFile(e,t)}async stat(e){const t=await this.getHandle(e);if(!t)throw gP.With("ENOENT",e,"stat");if(t instanceof FileSystemDirectoryHandle)return new DB({mode:511|dB,size:4096});if(t instanceof FileSystemFileHandle){const{lastModified:e,size:n}=await t.getFile();return new DB({mode:511|uB,size:n,mtimeMs:e})}throw new gP(fP.EBADE,"Handle is not a directory or file",e,"stat")}async openFile(e,t){const n=await this.getHandle(e);if(!(n instanceof FileSystemFileHandle))throw gP.With("EISDIR",e,"openFile");const i=await n.getFile().catch(t=>{throw Vz(t,e,"openFile")}),r=new Uint8Array(await i.arrayBuffer()),s=new DB({mode:511|uB,size:i.size,mtimeMs:i.lastModified});return new WB(this,e,t,s,r)}async unlink(e){const t=await this.getHandle(TP(e));if(!(t instanceof FileSystemDirectoryHandle))throw gP.With("ENOTDIR",TP(e),"unlink");await t.removeEntry(xP(e),{recursive:!0}).catch(t=>{throw Vz(t,e,"unlink")})}async link(e){}async rmdir(e){return this.unlink(e)}async mkdir(e){if(await this.getHandle(e).catch(e=>{if("ENOENT"!=e.code)throw e}))throw gP.With("EEXIST",e,"mkdir");const t=await this.getHandle(TP(e));if(!(t instanceof FileSystemDirectoryHandle))throw gP.With("ENOTDIR",e,"mkdir");await t.getDirectoryHandle(xP(e),{create:!0})}async readdir(e){const t=await this.getHandle(e);if(!(t instanceof FileSystemDirectoryHandle))throw gP.With("ENOTDIR",e,"readdir");const n=[];for await(const e of t.keys())n.push(e);return n}async getHandle(e){if(this._handles.has(e))return this._handles.get(e);let t="/";for(const n of e.split("/").slice(1)){const e=this._handles.get(t);if(!(e instanceof FileSystemDirectoryHandle))throw gP.With("ENOTDIR",t,"getHandle");t=bP(t,n);const i=await e.getDirectoryHandle(n).catch(i=>{switch(i.name){case"TypeMismatchError":return e.getFileHandle(n).catch(e=>{});case"TypeError":throw new gP(fP.ENOENT,i.message,t,"getHandle");default:throw Vz(i,t,"getHandle")}});i&&this._handles.set(t,i)}return this._handles.get(e)}}function jz(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}let Yz;function Gz(){return Yz||(Yz=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const i=jz(n);return(e,n)=>i.then(i=>n(i.transaction(t,e).objectStore(t)))}("keyval-store","keyval")),Yz}class Hz extends zz{constructor(e){super(e)}async readFile(e){const t=await this.getHandle(e);if(t instanceof window.FileSystemFileHandle){const e=await t.getFile();return await e.text()}return""}}class Wz extends ze.FS{#e=null;#t=new TextEncoder;constructor(){super()}async showDirectoryPicker(){const e=await window.showDirectoryPicker({mode:"readwrite"});if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return await this.setFSCache(e),this.#e=new Hz(e),e}async loadFS(){let e=await this.getFSCache();if(!e)return null;if("granted"!==await e.requestPermission({mode:"readwrite"}))throw new Error("readwrite access to directory not granted");return this.#e=new Hz(e),e}async getFSCache(){return function(e,t=Gz()){return t("readonly",t=>jz(t.get(e)))}("mixly-pyodide-fs")}async setFSCache(e){await function(e,t,n=Gz()){return n("readwrite",n=>(n.put(t,e),jz(n.transaction)))}("mixly-pyodide-fs",e)}async createFile(e){return this.#e.createFile(e,"")}async readFile(e){return this.#e.readFile(e)}async writeFile(e,t){const n=this.#t.encode(t);return this.#e.writeFile(e,n)}async isFile(e){const t=await this.#e.stat(e);return!(!t||33279!==t.mode)}async renameFile(e,t){return await this.#e.rename(e,t)}async moveFile(e,t){return this.renameFile(e,t)}async deleteFile(e){return this.#e.unlink(e)}async createDirectory(e){return this.#e.mkdir(e,511)}async readDirectory(e){return await this.#e.readdir(e)}async isDirectory(e){const t=await this.#e.stat(e);return!(!t||16895!==t.mode)}async isDirectoryEmpty(e){const t=await this.readDirectory(e);return!t?.length}async renameDirectory(e,t){return this.#e.rename(e,t)}async moveDirectory(e,t){return this.#e.rename(e,t)}async deleteDirectory(e){return this.#e.rmdir(e)}}class Xz extends ze.FileTree{constructor(){super(new Wz)}async readFolder(e){let t=[];try{const n=this.getFS();if(!await n.isDirectory(e))return t;const i=await n.readDirectory(e);for(let r of i){const i=Rx.join(e,r);if(await n.isDirectory(i)){const e=await n.isDirectoryEmpty(i);t.push({type:"folder",id:i,children:!e,title:`/${this.getRootFolderName()}${i}`})}else t.push({type:"file",id:i,children:!1,title:`/${this.getRootFolderName()}${i}`})}}catch(e){ze.Debug.error(e)}return t}}class qz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .file-tree {\r\n width: 15%;\r\n height: 100%;\r\n border-right-width: 1px;\r\n border-right-style: solid;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: #c9c9c9;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > .file-tree {\r\n border-right-color: rgba(128, 128, 128, 0.35);\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > .editor {\r\n width: 85%;\r\n height: 100%;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div class="file-tree"></div>\r\n <div class="editor"></div>\r\n</div>')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-open-fs.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > button {\r\n margin: 15px;\r\n max-width: 200px;\r\n width: 100%;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n color: #fff !important;\r\n height: 25px;\r\n border-radius: 3px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <button class="layui-btn layui-btn-xs m-btn self-adaption-btn">{{ d.msg.loadFS }}</button>\r\n</div>')),ze.HTMLTemplate.add("html/statusbar/statusbar-filesystem-editor-empty.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > div {\r\n width: 150px;\r\n height: 150px;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-light.svg\');\r\n background-size: 100% auto;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] > div {\r\n background: url(\'../common/css/svg/empty/empty-dark.svg\');\r\n background-size: 100% auto;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div></div>\r\n</div>')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["file-system"],qz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"file-system",id:"file-system",name:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM,title:Ve.Msg.PYTHON_PYODIDE_FILE_SYSTEM}),e.changeTo("output"),e.get("file-system")}}#n=null;#i=null;#r=null;#s=null;#o=null;#a=null;#l=null;#u=null;#c=!1;#d=!1;#h=!1;#p=null;constructor(){super();const e=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem.html").render());this.setContent(e),this.#l=new Xz,this.#i=e.children(".file-tree"),this.#s=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-open-fs.html").render({msg:{loadFS:Ve.Msg.PYTHON_PYODIDE_LOAD_FILE_SYSTEM}})),this.#i.append(this.#s),this.#a=new ze.StatusBar,this.#r=e.children(".editor"),this.#o=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-filesystem-editor-empty.html").render()),this.#r.append(this.#o)}#f(){this.#u=new ze.DragV(this.getContent()[0],{min:"150px",startSize:"15%",full:[!1,!1]}),this.#u.bind("sizeChanged",()=>{this.resize()}),this.#s.children("button").click(()=>{this.selectFS().catch(ze.Debug.error)}),this.#l.bind("beforeSelectLeaf",e=>{const t=e[0].id,n=this.#a.getFileMode(Rx.extname(t));return n?(this.#a.setMode(n),!0):(pP.layer.msg(ze.Msg.Lang["statusbar.ampy.cannotEdit"],{time:1e3}),!1)}),this.#l.bind("afterSelectLeaf",async e=>{const t=e[0].id;this.#l.showProgress();const n=this.#l.getFS();try{const e=await n.readFile(t);this.showEditor(),this.#a.setValue(e),this.#a.scrollToTop(),this.#a.focus(),this.setStatus(!1)}catch(e){ze.Debug.error(e),this.hideEditor(),this.#l.deselectAll()}this.#l.hideProgress()}),this.#l.bind("afterCreateNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterDeleteNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRenameNode",e=>{this.#l.refreshFolder(e)}),this.#l.bind("afterRefreshNode",()=>{this.#l.getSelectedNodeId()||this.hideEditor()});const e=this.#l.getContextMenu().getItem("menu");e.add({weight:7,id:"copy_path",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["fileTree.copyPath"]),callback:(e,{$trigger:t})=>{let n=null;n="root"===t.attr("type")?this.#l.getRootFolderTitle():t.attr("title"),navigator.clipboard.writeText(n).catch(ze.Debug.error)}}}),e.add({weight:14,id:"sep5",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:"---------"}),e.add({weight:15,id:"refresh",preconditionFn:e=>{const t=this.#l.getSelectedNodeId();let n=e.attr("type"),i=e.attr("id");return"file"!==n||t===i},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.refresh"]),callback:(e,{$trigger:t})=>{let n=t.attr("type");if("root"===n)this.#l.openRootFolder(),this.#l.refreshFolder("/");else if("folder"===n){let e=t.attr("id");this.#l.openNode(e),this.#l.refreshFolder(e)}else{const e=this.#l.getSelectedNodes();this.#l.runEvent("afterSelectLeaf",e)}}}}),e.add({weight:16,id:"sep6",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:"---------"}),e.add({weight:17,id:"exit",preconditionFn:e=>{let t=e.attr("type");return["root"].includes(t)},data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["statusbar.ampy.exit"]),callback:()=>{this.closeFS()}}}),e.remove("copy"),e.remove("cut"),e.remove("paste"),e.remove("sep2");const t=this.#a.getContextMenu().getItem("code");t.empty(),t.add({weight:0,id:"cut",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.cut"],"Ctrl+X"),callback:()=>this.#a.cut()}}),t.add({weight:1,id:"copy",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.copy"],"Ctrl+C"),callback:()=>this.#a.copy()}}),t.add({weight:2,id:"paste",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.paste"],"Ctrl+V"),callback:()=>this.#a.paste()}}),t.add({weight:3,id:"sep1",data:"---------"}),t.add({weight:4,id:"togglecomment",data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["editor.contextMenu.togglecomment"],"Ctrl+/"),callback:()=>this.#a.commentLine()}}),t.add({weight:6,id:"sep2",preconditionFn:()=>this.#h,data:"---------"}),t.add({weight:7,id:"save",preconditionFn:()=>this.#h,data:{isHtmlName:!0,name:ze.Menu.getItem(ze.Msg.Lang["file.save"],"Ctrl+S"),callback:async()=>{await this.put()}}});const{commands:n}=this.#a.getEditor();n.addCommand({name:"save",bindKey:"Ctrl-S",exec:async()=>{this.#h&&await this.put()}})}async put(){this.#l.showProgress();const e=this.#l.getSelectedNodeId(),t=this.#l.getFS();try{await t.writeFile(e,this.#a.getValue()),this.setStatus(!1)}catch(e){ze.Debug.error(e)}finally{this.#l.hideProgress()}}showFileTree(){this.#c||(this.#s.detach(),this.#i.empty(),this.#i.append(this.#l.getContent()),this.#c=!0)}hideFileTree(){this.#c&&(this.#l.getContent().detach(),this.#i.empty(),this.#i.append(this.#s),this.#c=!1)}showEditor(){this.#d||(this.#o.detach(),this.#r.empty(),this.#r.append(this.#a.getContent()),this.#d=!0)}hideEditor(){this.#d&&(this.#a.getContent().detach(),this.#r.empty(),this.#r.append(this.#o),this.#d=!1,this.setStatus(!1))}getDrag(){return this.#u}init(){super.init(),this.hideCloseBtn(),this.#a.init(),this.#f();const e=this.#a.getEditor();e.setReadOnly(!1),e.renderer.setShowGutter(!0),e.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0,newLineMode:"unix"}),e.on("change",()=>{this.setStatus(!0)}),this.loadFS().catch(ze.Debug.error)}async loadFS(){const e=this.#l.getFS(),t=await e.loadFS();await this.openFS(t)}async selectFS(){const e=this.#l.getFS(),t=await e.showDirectoryPicker();await this.openFS(t)}async openFS(e){if(!e?.name)return;const t="/"+e.name;this.#l.setFolderPath("/"),this.#l.setRootFolderTitle(t),this.#l.setRootFolderName(e.name),this.#l.openRootFolder(),this.showFileTree(),this.#p=await window.pyodide.mountNativeFS(t,e)}closeFS(){const e=this.#l.getRootFolderTitle();if(Object.keys(window.pyodide.FS.root.contents).includes(Rx.basename(e))){const t=window.pyodide.FS.lookupPath(e,{follow_mount:!1});window.pyodide.FS.isMountpoint(t.node)&&window.pyodide.FS.unmount(e)}this.#l.getFS().setFSCache(null),this.#l.deselectAll(),this.hideFileTree(),this.hideEditor(),this.setStatus(!1)}onMounted(){super.onMounted(),this.#a.onMounted(),this.#l.onMounted()}onUnmounted(){super.onUnmounted(),this.#a.onUnmounted(),this.#l.onUnmounted()}resize(){super.resize(),this.#a.resize(),this.#l.resize()}setStatus(e){this.#h!==e&&(this.#h=e)}getNativeFS(){return this.#p}dispose(){this.#a.dispose(),this.#a=null,this.#l.dispose(),this.#l=null,super.dispose()}}class Kz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-tool.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n flex-wrap: wrap;\r\n align-content: center;\r\n overflow: auto;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > text {\r\n font-family: \'ravie\';\r\n font-size: 60px;\r\n }\r\n\r\n html[data-bs-theme=light] div[m-id="{{d.mId}}"] {\r\n background-color: #ffffff;\r\n }\r\n\r\n html[data-bs-theme=dark] div[m-id="{{d.mId}}"] {\r\n background-color: #1e1e1e;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <text>Teachable Machine</text>\r\n</div>')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["tool"],Kz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"tool",id:"tool",name:Ve.Msg.PYTHON_PYODIDE_TOOL,title:Ve.Msg.PYTHON_PYODIDE_TOOL}),e.changeTo("output"),e.get("tool")}}constructor(){super();const e=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-tool.html").render());this.setContent(e)}init(){super.init(),this.hideCloseBtn()}onMounted(){}onUnmounted(){}resize(){}}class Zz extends ze.PageBase{static{ze.HTMLTemplate.add("html/statusbar/statusbar-game.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n flex-wrap: nowrap;\r\n overflow: auto;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .game-info {\r\n margin-bottom: 20px;\r\n color: #666;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .grid {\r\n display: grid;\r\n grid-template-columns: repeat(10, 30px);\r\n grid-template-rows: repeat(10, 30px);\r\n gap: 1px;\r\n margin: 20px auto;\r\n width: fit-content;\r\n background-color: #ddd;\r\n border: 2px solid #333;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .cell {\r\n width: 30px;\r\n height: 30px;\r\n background-color: white;\r\n border: 1px solid #ccc;\r\n cursor: pointer;\r\n transition: background-color 0.2s;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .cell.alive {\r\n background-color: #4CAF50;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .cell:hover {\r\n background-color: #e0e0e0;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .cell.alive:hover {\r\n background-color: #45a049;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .controls {\r\n margin: 20px 0;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] button {\r\n padding: 10px 20px;\r\n margin: 0 5px;\r\n border: none;\r\n border-radius: 5px;\r\n cursor: pointer;\r\n font-size: 14px;\r\n transition: background-color 0.3s;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .start-btn {\r\n background-color: #4CAF50;\r\n color: white;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .pause-btn {\r\n background-color: #ff9800;\r\n color: white;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .reset-btn {\r\n background-color: #f44336;\r\n color: white;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .random-btn {\r\n background-color: #9C27B0;\r\n color: white;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] button:hover {\r\n opacity: 0.8;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] button:disabled {\r\n background-color: #cccccc;\r\n cursor: not-allowed;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] .generation-counter {\r\n font-size: 18px;\r\n font-weight: bold;\r\n margin: 10px 0;\r\n padding-top: 10px;\r\n color: #333;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}" class="page-item">\r\n <div class="generation-counter">{{d.epoch}}: <span class="generation">0</span></div>\r\n <div class="grid"></div>\r\n <div class="controls">\r\n <button class="start-btn">{{d.start}}</button>\r\n <button class="pause-btn" disabled>{{d.pause}}</button>\r\n <button class="random-btn">{{d.random}}</button>\r\n <button class="reset-btn">{{d.reset}}</button>\r\n </div>\r\n</div>')),this.init=function(){ze.StatusBarsManager.typesRegistry.register(["game"],Zz);const e=ze.Workspace.getMain().getStatusBarsManager();return e.add({type:"game",id:"game",name:Ve.Msg.PYTHON_PYODIDE_GAME,title:Ve.Msg.PYTHON_PYODIDE_GAME}),e.changeTo("output"),e.get("game")}}#m=null;#g=null;#_=null;#y=null;#v=null;#b=null;#T=10;#x=500;#E=[];#w=!1;#I=0;#A=null;constructor(){super();const e=Dx()(ze.HTMLTemplate.get("html/statusbar/statusbar-game.html").render({epoch:Ve.Msg.PYTHON_PYODIDE_GAME_EPOCH,start:Ve.Msg.PYTHON_PYODIDE_GAME_START,pause:Ve.Msg.PYTHON_PYODIDE_GAME_PAUSE,random:Ve.Msg.PYTHON_PYODIDE_GAME_RANDOM,reset:Ve.Msg.PYTHON_PYODIDE_GAME_RESET}));this.setContent(e),this.#m=e.find(".start-btn"),this.#g=e.find(".pause-btn"),this.#_=e.find(".random-btn"),this.#y=e.find(".reset-btn"),this.#v=e.find(".generation"),this.#b=e.find(".grid"),this.#S()}#S(){this.#m.click(()=>this.startGame()),this.#g.click(()=>this.pauseGame()),this.#_.click(()=>this.randomInitialize()),this.#y.click(()=>this.resetGame())}initializeGrid(){this.#b.empty(),this.#E=[];for(let e=0;e<this.#T;e++){this.#E[e]=[];for(let t=0;t<this.#T;t++){this.#E[e][t]=0;const n=document.createElement("div");n.className="cell",n.dataset.row=e,n.dataset.col=t,n.addEventListener("click",()=>this.toggleCell(e,t)),this.#b.append(n)}}this.updateGridDisplay()}toggleCell(e,t){this.#w||(this.#E[e][t]=0===this.#E[e][t]?1:0,this.updateGridDisplay())}updateGridDisplay(){const e=this.#b.children(".cell");for(let t=0;t<e.length;t++){const n=e[t],i=parseInt(n.dataset.row),r=parseInt(n.dataset.col);1===this.#E[i][r]?n.classList.add("alive"):n.classList.remove("alive")}}nextGeneration(){const e=[];for(let t=0;t<this.#T;t++){e[t]=[];for(let n=0;n<this.#T;n++){const i=this.countNeighbors(t,n);1===this.#E[t][n]?e[t][n]=2===i||3===i?1:0:e[t][n]=3===i?1:0}}this.#E=e,this.#I++,this.#v.text(this.#I),this.updateGridDisplay()}countNeighbors(e,t){let n=0;for(let i=-1;i<=1;i++)for(let r=-1;r<=1;r++){if(0===i&&0===r)continue;const s=e+i,o=t+r;s>=0&&s<this.#T&&o>=0&&o<this.#T&&(n+=this.#E[s][o])}return n}startGame(){this.#w||(this.#w=!0,this.#I=0,this.#v.text(this.#I),this.#A=setInterval(()=>this.nextGeneration(),this.#x),this.updateButtons())}pauseGame(){this.#w&&(this.#w=!1,clearInterval(this.#A),this.updateButtons())}randomInitialize(){if(!this.#w){for(let e=0;e<this.#T;e++)for(let t=0;t<this.#T;t++)this.#E[e][t]=Math.random()<.25?1:0;this.updateGridDisplay()}}resetGame(){this.#w=!1,clearInterval(this.#A),this.#I=0,this.#v.text(this.#I),this.initializeGrid(),this.updateButtons()}updateButtons(){this.#m.attr("disabled",this.#w),this.#g.attr("disabled",!this.#w),this.#_.attr("disabled",this.#w),this.#y.attr("disabled",!1)}init(){super.init(),this.hideCloseBtn(),this.initializeGrid(),this.updateButtons()}onMounted(){}onUnmounted(){}resize(){}}const Qz=Symbol(),Jz="el",ej=(e,t,n,i,r)=>{let s=`${e}-${t}`;return n&&(s+=`-${n}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},tj=Symbol("namespaceContextKey"),nj=e=>{const t=e||($M()?tO(tj,EI(Jz)):EI(Jz));return ak(()=>CI(t)||Jz)},ij=(e,t)=>{const n=nj(t);return{namespace:n,b:(t="")=>ej(n.value,e,t,"",""),e:t=>t?ej(n.value,e,"",t,""):"",m:t=>t?ej(n.value,e,"","",t):"",be:(t,i)=>t&&i?ej(n.value,e,t,i,""):"",em:(t,i)=>t&&i?ej(n.value,e,"",t,i):"",bm:(t,i)=>t&&i?ej(n.value,e,t,"",i):"",bem:(t,i,r)=>t&&i&&r?ej(n.value,e,t,i,r):"",is:(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`is-${e}`:""},cssVar:e=>{const t={};for(const i in e)e[i]&&(t[`--${n.value}-${i}`]=e[i]);return t},cssVarName:e=>`--${n.value}-${e}`,cssVarBlock:t=>{const i={};for(const r in t)t[r]&&(i[`--${n.value}-${e}-${r}`]=t[r]);return i},cssVarBlockName:t=>`--${n.value}-${e}-${t}`}},rj=e=>void 0===e,sj=e=>"boolean"==typeof e,oj=e=>"number"==typeof e,aj=e=>"undefined"!=typeof Element&&e instanceof Element;var lj,uj=Object.defineProperty,cj=Object.defineProperties,dj=Object.getOwnPropertyDescriptors,hj=Object.getOwnPropertySymbols,pj=Object.prototype.hasOwnProperty,fj=Object.prototype.propertyIsEnumerable,mj=(e,t,n)=>t in e?uj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function gj(e,t){var n;const i=wI();var r,s;return kO(()=>{i.value=e()},(r=((e,t)=>{for(var n in t||(t={}))pj.call(t,n)&&mj(e,n,t[n]);if(hj)for(var n of hj(t))fj.call(t,n)&&mj(e,n,t[n]);return e})({},t),s={flush:null!=(n=null==t?void 0:t.flush)?n:"sync"},cj(r,dj(s)))),dI(i)}const _j="undefined"!=typeof window,yj=(Object.prototype.toString,e=>"function"==typeof e),vj=()=>{},bj=_j&&(null==(lj=null==window?void 0:window.navigator)?void 0:lj.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Tj(e){return"function"==typeof e?e():CI(e)}function xj(e,t){return function(...n){return new Promise((i,r)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(i).catch(r)})}}function Ej(e,t=!0,n=!0,i=!1){let r,s,o=0,a=!0,l=vj;const u=()=>{r&&(clearTimeout(r),r=void 0,l(),l=vj)};return c=>{const d=Tj(e),h=Date.now()-o,p=()=>s=c();return u(),d<=0?(o=Date.now(),p()):(h>d&&(n||!a)?(o=Date.now(),p()):t&&(s=new Promise((e,t)=>{l=i?t:e,r=setTimeout(()=>{o=Date.now(),a=!0,e(p()),u()},Math.max(0,d-h))})),n||r||(r=setTimeout(()=>a=!0,d)),a=!1,s)}}function wj(e){return!!QE()&&(JE(e),!0)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ij(e,t=200,n=!1,i=!0,r=!1){return xj(Ej(t,n,i,r),e)}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Aj(e,t,n={}){const{immediate:i=!0}=n,r=EI(!1);let s=null;function o(){s&&(clearTimeout(s),s=null)}function a(){r.value=!1,o()}function l(...n){o(),r.value=!0,s=setTimeout(()=>{r.value=!1,s=null,e(...n)},Tj(t))}return i&&(r.value=!0,_j&&l()),wj(a),{isPending:dI(r),start:l,stop:a}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const Sj={current:0},Cj=EI(0),Oj=Symbol("elZIndexContextKey"),Mj=Symbol("zIndexContextKey"),kj=e=>{const t=$M()?tO(Oj,Sj):Sj,n=e||($M()?tO(Mj,void 0):void 0),i=ak(()=>{const e=CI(n);return oj(e)?e:2e3}),r=ak(()=>i.value+Cj.value);return!_j&&tO(Oj),{initialZIndex:i,currentZIndex:r,nextZIndex:()=>(t.current++,Cj.value=t.current,r.value)}};const Rj=Array.isArray;const Nj="object"==typeof global&&global&&global.Object===Object&&global;var Dj="object"==typeof self&&self&&self.Object===Object&&self;const Fj=Nj||Dj||Function("return this")();const Lj=Fj.Symbol;var Pj=Object.prototype,Bj=Pj.hasOwnProperty,$j=Pj.toString,Uj=Lj?Lj.toStringTag:void 0;const Vj=function(e){var t=Bj.call(e,Uj),n=e[Uj];try{e[Uj]=void 0;var i=!0}catch(e){}var r=$j.call(e);return i&&(t?e[Uj]=n:delete e[Uj]),r};var zj=Object.prototype.toString;const jj=function(e){return zj.call(e)};var Yj=Lj?Lj.toStringTag:void 0;const Gj=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yj&&Yj in Object(e)?Vj(e):jj(e)};const Hj=function(e){return null!=e&&"object"==typeof e};const Wj=function(e){return"symbol"==typeof e||Hj(e)&&"[object Symbol]"==Gj(e)};var Xj=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qj=/^\w*$/;const Kj=function(e,t){if(Rj(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Wj(e))||(qj.test(e)||!Xj.test(e)||null!=t&&e in Object(t))};const Zj=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Qj=function(e){if(!Zj(e))return!1;var t=Gj(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Jj=Fj["__core-js_shared__"];var eY=function(){var e=/[^.]+$/.exec(Jj&&Jj.keys&&Jj.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();const tY=function(e){return!!eY&&eY in e};var nY=Function.prototype.toString;const iY=function(e){if(null!=e){try{return nY.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var rY=/^\[object .+?Constructor\]$/,sY=Function.prototype,oY=Object.prototype,aY=sY.toString,lY=oY.hasOwnProperty,uY=RegExp("^"+aY.call(lY).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const cY=function(e){return!(!Zj(e)||tY(e))&&(Qj(e)?uY:rY).test(iY(e))};const dY=function(e,t){return null==e?void 0:e[t]};const hY=function(e,t){var n=dY(e,t);return cY(n)?n:void 0};const pY=hY(Object,"create");const fY=function(){this.__data__=pY?pY(null):{},this.size=0};const mY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var gY=Object.prototype.hasOwnProperty;const _Y=function(e){var t=this.__data__;if(pY){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return gY.call(t,e)?t[e]:void 0};var yY=Object.prototype.hasOwnProperty;const vY=function(e){var t=this.__data__;return pY?void 0!==t[e]:yY.call(t,e)};const bY=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=pY&&void 0===t?"__lodash_hash_undefined__":t,this};function TY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}TY.prototype.clear=fY,TY.prototype.delete=mY,TY.prototype.get=_Y,TY.prototype.has=vY,TY.prototype.set=bY;const xY=TY;const EY=function(){this.__data__=[],this.size=0};const wY=function(e,t){return e===t||e!=e&&t!=t};const IY=function(e,t){for(var n=e.length;n--;)if(wY(e[n][0],t))return n;return-1};var AY=Array.prototype.splice;const SY=function(e){var t=this.__data__,n=IY(t,e);return!(n<0)&&(n==t.length-1?t.pop():AY.call(t,n,1),--this.size,!0)};const CY=function(e){var t=this.__data__,n=IY(t,e);return n<0?void 0:t[n][1]};const OY=function(e){return IY(this.__data__,e)>-1};const MY=function(e,t){var n=this.__data__,i=IY(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};function kY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}kY.prototype.clear=EY,kY.prototype.delete=SY,kY.prototype.get=CY,kY.prototype.has=OY,kY.prototype.set=MY;const RY=kY;const NY=hY(Fj,"Map");const DY=function(){this.size=0,this.__data__={hash:new xY,map:new(NY||RY),string:new xY}};const FY=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const LY=function(e,t){var n=e.__data__;return FY(t)?n["string"==typeof t?"string":"hash"]:n.map};const PY=function(e){var t=LY(this,e).delete(e);return this.size-=t?1:0,t};const BY=function(e){return LY(this,e).get(e)};const $Y=function(e){return LY(this,e).has(e)};const UY=function(e,t){var n=LY(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function VY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}VY.prototype.clear=DY,VY.prototype.delete=PY,VY.prototype.get=BY,VY.prototype.has=$Y,VY.prototype.set=UY;const zY=VY;function jY(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=e.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(jY.Cache||zY),n}jY.Cache=zY;const YY=jY;const GY=function(e){var t=YY(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t};var HY=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WY=/\\(\\)?/g;const XY=GY(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(HY,function(e,n,i,r){t.push(i?r.replace(WY,"$1"):n||e)}),t});const qY=function(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r};var KY=Lj?Lj.prototype:void 0,ZY=KY?KY.toString:void 0;const QY=function e(t){if("string"==typeof t)return t;if(Rj(t))return qY(t,e)+"";if(Wj(t))return ZY?ZY.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};const JY=function(e){return null==e?"":QY(e)};const eG=function(e,t){return Rj(e)?e:Kj(e,t)?[e]:XY(JY(e))};const tG=function(e){if("string"==typeof e||Wj(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const nG=function(e,t){for(var n=0,i=(t=eG(t,e)).length;null!=e&&n<i;)e=e[tG(t[n++])];return n&&n==i?e:void 0};const iG=function(e,t,n){var i=null==e?void 0:nG(e,t);return void 0===i?n:i};var rG={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish",close:"Close this dialog"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const sG=e=>(t,n)=>oG(t,n,CI(e)),oG=(e,t,n)=>iG(n,e,e).replace(/\{(\w+)\}/g,(e,n)=>{var i;return`${null!=(i=null==t?void 0:t[n])?i:`{${n}}`}`}),aG=Symbol("localeContextKey"),lG=e=>{const t=e||tO(aG,EI());return(e=>({lang:ak(()=>CI(e).name),locale:xI(e)?e:EI(e),t:sG(e)}))(ak(()=>t.value||rG))};const uG=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i},cG="__epPropKey",dG=(e,t)=>{if(!Jx(e)||Jx(n=e)&&n[cG])return e;var n;const{values:i,required:r,default:s,type:o,validator:a}=e,l=i||a?n=>{let r=!1,o=[];if(i&&(o=Array.from(i),Gx(e,"default")&&o.push(s),r||(r=o.includes(n))),a&&(r||(r=a(n))),!r&&o.length>0){const e=[...new Set(o)].map(e=>JSON.stringify(e)).join(", ");pk(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(n)}.`)}return r}:void 0,u={type:o,required:!!r,validator:l,[cG]:!0};return Gx(e,"default")&&(u.default=s),u},hG=e=>uG(Object.entries(e).map(([e,t])=>[e,dG(t,e)])),pG=["","default","small","large"],fG=dG({type:String,values:pG,required:!1}),mG=Symbol("size"),gG=Symbol("emptyValuesContextKey"),_G=hG({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>(e=Kx(e)?e():e,Hx(e)?e.every(e=>!e):!e)}}),yG=e=>Object.keys(e),vG=EI();function bG(e,t=void 0){const n=$M()?tO(Qz,vG):vG;return e?ak(()=>{var i,r;return null!=(r=null==(i=n.value)?void 0:i[e])?r:t}):n}const TG=(e,t,n=!1)=>{var i;const r=!!$M(),s=r?bG():void 0,o=null!=(i=null==t?void 0:t.provide)?i:r?eO:void 0;if(!o)return;const a=ak(()=>{const t=CI(e);return(null==s?void 0:s.value)?xG(s.value,t):t});return o(Qz,a),o(aG,ak(()=>a.value.locale)),o(tj,ak(()=>a.value.namespace)),o(Mj,ak(()=>a.value.zIndex)),o(mG,{size:ak(()=>a.value.size||"")}),o(gG,ak(()=>({emptyValues:a.value.emptyValues,valueOnClear:a.value.valueOnClear}))),!n&&vG.value||(vG.value=a.value),a},xG=(e,t)=>{const n=[...new Set([...yG(e),...yG(t)])],i={};for(const r of n)i[r]=void 0!==t[r]?t[r]:e[r];return i},EG=hG({a11y:{type:Boolean,default:!0},locale:{type:Object},size:fG,button:{type:Object},card:{type:Object},dialog:{type:Object},link:{type:Object},experimentalFeatures:{type:Object},keyboardNavigation:{type:Boolean,default:!0},message:{type:Object},zIndex:Number,namespace:{type:String,default:"el"},..._G}),wG={placement:"top"},IG=dS({name:"ElConfigProvider",props:EG,setup(e,{slots:t}){const n=TG(e);return DO(()=>e.message,e=>{var t,i;Object.assign(wG,null!=(i=null==(t=null==n?void 0:n.value)?void 0:t.message)?i:{},null!=e?e:{})},{immediate:!0,deep:!0}),()=>mC(t,"default",{config:null==n?void 0:n.value})}}),AG=(e,t)=>{if(e.install=n=>{for(const i of[e,...Object.values(null!=t?t:{})])n.component(i.name,i)},t)for(const[n,i]of Object.entries(t))e[n]=i;return e},SG=e=>(e.install=Bx,e),CG=AG(IG);
/*! Element Plus Icons Vue v2.3.2 */
var OG=dS({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),MG=OG,kG=dS({name:"ArrowLeft",__name:"arrow-left",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}),RG=kG,NG=dS({name:"ArrowRight",__name:"arrow-right",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}),DG=NG,FG=dS({name:"ArrowUp",__name:"arrow-up",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}),LG=FG,PG=dS({name:"Camera",__name:"camera",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"})]))}),BG=PG,$G=dS({name:"Check",__name:"check",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"})]))}),UG=$G,VG=dS({name:"CircleCheck",__name:"circle-check",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),xM("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}),zG=VG,jG=dS({name:"CircleCloseFilled",__name:"circle-close-filled",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}),YG=jG,GG=dS({name:"CircleClose",__name:"circle-close",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),xM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),HG=GG,WG=dS({name:"CirclePlusFilled",__name:"circle-plus-filled",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0z"})]))}),XG=WG,qG=dS({name:"CirclePlus",__name:"circle-plus",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"}),xM("path",{fill:"currentColor",d:"M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"}),xM("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}),KG=qG,ZG=dS({name:"Close",__name:"close",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),QG=ZG,JG=dS({name:"Delete",__name:"delete",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}),eH=JG,tH=dS({name:"Document",__name:"document",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"})]))}),nH=tH,iH=dS({name:"EditPen",__name:"edit-pen",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}),rH=iH,sH=dS({name:"FullScreen",__name:"full-screen",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}),oH=sH,aH=dS({name:"Hide",__name:"hide",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),xM("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}),lH=aH,uH=dS({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),cH=uH,dH=dS({name:"Loading",__name:"loading",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}),hH=dH,pH=dS({name:"More",__name:"more",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"})]))}),fH=pH,mH=dS({name:"RefreshLeft",__name:"refresh-left",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"})]))}),gH=dS({name:"RefreshRight",__name:"refresh-right",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"})]))}),_H=dS({name:"ScaleToOriginal",__name:"scale-to-original",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"})]))}),yH=dS({name:"SuccessFilled",__name:"success-filled",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}),vH=dS({name:"View",__name:"view",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),bH=dS({name:"WarningFilled",__name:"warning-filled",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}),TH=dS({name:"Warning",__name:"warning",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}),xH=dS({name:"ZoomIn",__name:"zoom-in",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}),EH=dS({name:"ZoomOut",__name:"zoom-out",setup:e=>(e,t)=>(uM(),mM("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[xM("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))});function wH(e){var t;const n=Tj(e);return null!=(t=null==n?void 0:n.$el)?t:n}const IH=_j?window:void 0;_j&&window.document,_j&&window.navigator,_j&&window.location;function AH(...e){let t,n,i,r;if("string"==typeof e[0]||Array.isArray(e[0])?([n,i,r]=e,t=IH):[t,n,i,r]=e,!t)return vj;Array.isArray(n)||(n=[n]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(e=>e()),s.length=0},a=DO(()=>[wH(t),Tj(r)],([e,t])=>{o(),e&&s.push(...n.flatMap(n=>i.map(i=>((e,t,n,i)=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)))(e,n,i,t))))},{immediate:!0,flush:"post"}),l=()=>{a(),o()};return wj(l),l}let SH=!1;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function CH(e,t=!1){const n=EI(),i=()=>n.value=Boolean(e());return i(),function(e,t=!0){$M()?KS(e):t?e():hA(e)}(i,t),n}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function OH(e){return JSON.parse(JSON.stringify(e))}const MH="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},kH="__vueuse_ssr_handlers__";MH[kH]=MH[kH]||{};MH[kH];Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var RH=Object.getOwnPropertySymbols,NH=Object.prototype.hasOwnProperty,DH=Object.prototype.propertyIsEnumerable;function FH(e,t,n={}){const i=n,{window:r=IH}=i,s=((e,t)=>{var n={};for(var i in e)NH.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&RH)for(var i of RH(e))t.indexOf(i)<0&&DH.call(e,i)&&(n[i]=e[i]);return n})(i,["window"]);let o;const a=CH(()=>r&&"ResizeObserver"in r),l=()=>{o&&(o.disconnect(),o=void 0)},u=DO(()=>wH(e),e=>{l(),a.value&&r&&e&&(o=new ResizeObserver(t),o.observe(e,s))},{immediate:!0,flush:"post"}),c=()=>{l(),u()};return wj(c),{isSupported:a,stop:c}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function LH(e,t={width:0,height:0},n={}){const{window:i=IH,box:r="content-box"}=n,s=ak(()=>{var t,n;return null==(n=null==(t=wH(e))?void 0:t.namespaceURI)?void 0:n.includes("svg")}),o=EI(t.width),a=EI(t.height);return FH(e,([t])=>{const n="border-box"===r?t.borderBoxSize:"content-box"===r?t.contentBoxSize:t.devicePixelContentBoxSize;if(i&&s.value){const t=wH(e);if(t){const e=i.getComputedStyle(t);o.value=parseFloat(e.width),a.value=parseFloat(e.height)}}else if(n){const e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),a.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,a.value=t.contentRect.height},n),DO(()=>wH(e),e=>{o.value=e?t.width:0,a.value=e?t.height:0}),{width:o,height:a}}new Map;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var PH,BH;(BH=PH||(PH={})).UP="UP",BH.RIGHT="RIGHT",BH.DOWN="DOWN",BH.LEFT="LEFT",BH.NONE="NONE";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var $H=Object.defineProperty,UH=Object.getOwnPropertySymbols,VH=Object.prototype.hasOwnProperty,zH=Object.prototype.propertyIsEnumerable,jH=(e,t,n)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;((e,t)=>{for(var n in t||(t={}))VH.call(t,n)&&jH(e,n,t[n]);if(UH)for(var n of UH(t))zH.call(t,n)&&jH(e,n,t[n])})({linear:function(e){return e}},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function YH(e,t,n,i={}){var r,s,o;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d}=i,h=$M(),p=n||(null==h?void 0:h.emit)||(null==(r=null==h?void 0:h.$emit)?void 0:r.bind(h))||(null==(o=null==(s=null==h?void 0:h.proxy)?void 0:s.$emit)?void 0:o.bind(null==h?void 0:h.proxy));let f=u;t||(t="modelValue"),f=u||f||`update:${t.toString()}`;const m=e=>a?yj(a)?a(e):OH(e):e,g=()=>void 0!==e[t]?m(e[t]):d;if(l){const n=EI(g());return DO(()=>e[t],e=>n.value=m(e)),DO(n,n=>{(n!==e[t]||c)&&p(f,n)},{deep:c}),n}return ak({get:()=>g(),set(e){p(f,e)}})}const GH=hG({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:[String,Object,Array]},offset:{type:Array,default:[0,0]},badgeClass:{type:String}});var HH=(e,t)=>{const n=e.__vccOpts||e;for(const[e,i]of t)n[e]=i;return n};function WH(e,t="px"){return e?oj(e)||Zx(n=e)&&!Number.isNaN(Number(n))?`${e}${t}`:Zx(e)?e:void 0:"";var n}const XH=dS({name:"ElBadge"}),qH=dS({...XH,props:GH,setup(e,{expose:t}){const n=e,i=ij("badge"),r=ak(()=>n.isDot?"":oj(n.value)&&oj(n.max)&&n.max<n.value?`${n.max}+`:`${n.value}`),s=ak(()=>{var e,t,i,r,s;return[{backgroundColor:n.color,marginRight:WH(-(null!=(t=null==(e=n.offset)?void 0:e[0])?t:0)),marginTop:WH(null!=(r=null==(i=n.offset)?void 0:i[1])?r:0)},null!=(s=n.badgeStyle)?s:{}]});return t({content:r}),(e,t)=>(uM(),mM("div",{class:CE(CI(i).b())},[mC(e.$slots,"default"),EM(Rk,{name:`${CI(i).namespace.value}-zoom-in-center`,persisted:""},{default:LA(()=>[PA(xM("sup",{class:CE([CI(i).e("content"),CI(i).em("content",e.type),CI(i).is("fixed",!!e.$slots.default),CI(i).is("dot",e.isDot),CI(i).is("hide-zero",!e.showZero&&0===n.value),e.badgeClass]),style:EE(CI(s))},[mC(e.$slots,"content",{value:CI(r)},()=>[SM(GE(CI(r)),1)])],6),[[Xk,!e.hidden&&(CI(r)||e.isDot||e.$slots.content)]])]),_:3},8,["name"])],2))}});const KH=AG(HH(qH,[["__file","badge.vue"]])),ZH=hG({size:{type:[Number,String]},color:{type:String}}),QH=dS({name:"ElIcon",inheritAttrs:!1});const JH=AG(HH(dS({...QH,props:ZH,setup(e){const t=e,n=ij("icon"),i=ak(()=>{const{size:e,color:n}=t;return e||n?{fontSize:rj(e)?void 0:WH(e),"--color":n}:{}});return(e,t)=>(uM(),mM("i",NM({class:CI(n).b(),style:CI(i)},e.$attrs),[mC(e.$slots,"default")],16))}}),[["__file","icon.vue"]])),eW=[String,Object,Function],tW={Close:QG,SuccessFilled:yH,InfoFilled:cH,WarningFilled:bH,CircleCloseFilled:YG},nW={primary:cH,success:yH,warning:bH,error:YG,info:cH},iW={validating:hH,success:zG,error:HG},rW=["primary","success","info","warning","error"],sW=["top","top-left","top-right","bottom","bottom-left","bottom-right"],oW="top",aW={customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,placement:void 0,zIndex:0,grouping:!1,repeatNum:1,appendTo:_j?document.body:void 0},lW=hG({customClass:{type:String,default:aW.customClass},dangerouslyUseHTMLString:{type:Boolean,default:aW.dangerouslyUseHTMLString},duration:{type:Number,default:aW.duration},icon:{type:eW,default:aW.icon},id:{type:String,default:aW.id},message:{type:[String,Object,Function],default:aW.message},onClose:{type:Function,default:aW.onClose},showClose:{type:Boolean,default:aW.showClose},type:{type:String,values:rW,default:aW.type},plain:{type:Boolean,default:aW.plain},offset:{type:Number,default:aW.offset},placement:{type:String,values:sW,default:aW.placement},zIndex:{type:Number,default:aW.zIndex},grouping:{type:Boolean,default:aW.grouping},repeatNum:{type:Number,default:aW.repeatNum}}),uW=cI({}),cW=(e,t)=>{const{prev:n}=((e,t)=>{const n=uW[t]||[],i=n.findIndex(t=>t.id===e),r=n[i];let s;return i>0&&(s=n[i-1]),{current:r,prev:s}})(e,t);return n?n.vm.exposed.bottom.value:0},dW={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},hW=dS({name:"ElMessage"}),pW=dS({...hW,props:lW,emits:{destroy:()=>!0},setup(e,{expose:t,emit:n}){const i=e,{Close:r}=tW,s=EI(!1),{ns:o,zIndex:a}=function(e,t){const n=bG(),i=ij(e,ak(()=>{var e;return(null==(e=n.value)?void 0:e.namespace)||Jz})),r=lG(ak(()=>{var e;return null==(e=n.value)?void 0:e.locale})),s=kj(ak(()=>{var e;return(null==(e=n.value)?void 0:e.zIndex)||2e3})),o=ak(()=>{var e;return CI(t)||(null==(e=n.value)?void 0:e.size)||""});return TG(ak(()=>CI(n)||{})),{ns:i,locale:r,zIndex:s,size:o}}("message"),{currentZIndex:l,nextZIndex:u}=a,c=EI(),d=EI(!1),h=EI(0);let p;const f=ak(()=>i.type?"error"===i.type?"danger":i.type:"info"),m=ak(()=>{const e=i.type;return{[o.bm("icon",e)]:e&&nW[e]}}),g=ak(()=>i.icon||nW[i.type]||""),_=ak(()=>i.placement||oW),y=ak(()=>cW(i.id,_.value)),v=ak(()=>((e,t,n)=>(uW[n]||[]).findIndex(t=>t.id===e)>0?16:t)(i.id,i.offset,_.value)+y.value),b=ak(()=>h.value+v.value),T=ak(()=>_.value.includes("left")?o.is("left"):_.value.includes("right")?o.is("right"):o.is("center")),x=ak(()=>_.value.startsWith("top")?"top":"bottom"),E=ak(()=>({[x.value]:`${v.value}px`,zIndex:l.value}));function w(){0!==i.duration&&({stop:p}=Aj(()=>{A()},i.duration))}function I(){null==p||p()}function A(){d.value=!1,hA(()=>{var e;s.value||(null==(e=i.onClose)||e.call(i),n("destroy"))})}return KS(()=>{w(),u(),d.value=!0}),DO(()=>i.repeatNum,()=>{I(),w()}),AH(document,"keydown",function({code:e}){e===dW.esc&&A()}),FH(c,()=>{h.value=c.value.getBoundingClientRect().height}),t({visible:d,bottom:b,close:A}),(e,t)=>(uM(),gM(Rk,{name:CI(o).b("fade"),onBeforeEnter:e=>s.value=!0,onBeforeLeave:e.onClose,onAfterLeave:t=>e.$emit("destroy"),persisted:""},{default:LA(()=>[PA(xM("div",{id:e.id,ref_key:"messageRef",ref:c,class:CE([CI(o).b(),{[CI(o).m(e.type)]:e.type},CI(o).is("closable",e.showClose),CI(o).is("plain",e.plain),CI(o).is("bottom","bottom"===CI(x)),CI(T),e.customClass]),style:EE(CI(E)),role:"alert",onMouseenter:I,onMouseleave:w},[e.repeatNum>1?(uM(),gM(CI(KH),{key:0,value:e.repeatNum,type:CI(f),class:CE(CI(o).e("badge"))},null,8,["value","type","class"])):OM("v-if",!0),CI(g)?(uM(),gM(CI(JH),{key:1,class:CE([CI(o).e("icon"),CI(m)])},{default:LA(()=>[(uM(),gM(uC(CI(g))))]),_:1},8,["class"])):OM("v-if",!0),mC(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(uM(),mM(iM,{key:1},[OM(" Caution here, message could've been compromised, never use user's input as message "),xM("p",{class:CE(CI(o).e("content")),innerHTML:e.message},null,10,["innerHTML"])],2112)):(uM(),mM("p",{key:0,class:CE(CI(o).e("content"))},GE(e.message),3))]),e.showClose?(uM(),gM(CI(JH),{key:2,class:CE(CI(o).e("closeBtn")),onClick:KR(A,["stop"])},{default:LA(()=>[EM(CI(r))]),_:1},8,["class","onClick"])):OM("v-if",!0)],46,["id"]),[[Xk,d.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var fW=HH(pW,[["__file","message.vue"]]);class mW extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function gW(e,t){throw new mW(`[${e}] ${t}`)}let _W=1;const yW=e=>{const t=!e||Zx(e)||_M(e)||Kx(e)?{message:e}:e,n={...aW,...t};return(e=>{if(e.appendTo){if(Zx(e.appendTo)){let t=document.querySelector(e.appendTo);aj(t)||(t=document.body),e.appendTo=t}}else e.appendTo=document.body})(n),(e=>{!e.placement&&Zx(wG.placement)&&wG.placement&&(e.placement=wG.placement),e.placement||(e.placement=oW),sW.includes(e.placement)||(e.placement,e.placement=oW)})(n),sj(wG.grouping)&&!n.grouping&&(n.grouping=wG.grouping),oj(wG.duration)&&3e3===n.duration&&(n.duration=wG.duration),oj(wG.offset)&&16===n.offset&&(n.offset=wG.offset),sj(wG.showClose)&&!n.showClose&&(n.showClose=wG.showClose),sj(wG.plain)&&!n.plain&&(n.plain=wG.plain),n},vW=({appendTo:e,...t},n)=>{const i="message_"+_W++,r=t.onClose,s=document.createElement("div"),o={...t,id:i,onClose:()=>{null==r||r(),(e=>{const t=e.props.placement||oW,n=uW[t],i=n.indexOf(e);if(-1===i)return;n.splice(i,1);const{handler:r}=e;r.close()})(c)},onDestroy:()=>{rN(null,s)}},a=EM(fW,o,Kx(o.message)||_M(o.message)?{default:Kx(o.message)?o.message:()=>o.message}:null);a.appContext=n||bW._context,rN(a,s),e.appendChild(s.firstElementChild);const l=a.component,u={close:()=>{l.exposed.close()}},c={id:i,vnode:a,vm:l,handler:u,props:a.component.props};return c},bW=(e={},t)=>{if(!_j)return{close:()=>{}};const n=yW(e),i=(r=n.placement||oW,uW[r]||(uW[r]=cI([])),uW[r]);var r;if(n.grouping&&i.length){const e=i.find(({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===n.message});if(e)return e.props.repeatNum+=1,e.props.type=n.type,e.handler}if(oj(wG.max)&&i.length>=wG.max)return{close:()=>{}};const s=vW(n,t);return i.push(s),s.handler};rW.forEach(e=>{bW[e]=(t={},n)=>{const i=yW(t);return bW({...i,type:e},n)}}),bW.closeAll=function(e){for(const t in uW)if(Gx(uW,t)){const n=[...uW[t]];for(const t of n)e&&e!==t.props.type||t.handler.close()}},bW.closeAllByPlacement=function(e){if(!uW[e])return;[...uW[e]].forEach(e=>e.handler.close())},bW._context=null;const TW=((e,t)=>(e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e))(bW,"$message"),xW=hG({layout:{type:String,default:"horizontal",values:["horizontal","vertical"]},lazy:Boolean}),EW=Symbol("splitterRootContextKey");function wW(e){return Number(e.slice(0,-1))/100}function IW(e){return Number(e.slice(0,-2))}function AW(e){return Zx(e)&&e.endsWith("%")}function SW(e){return Zx(e)&&e.endsWith("px")}function CW(e,t,n,i){function r(e,n){return AW(e)?wW(e)*t.value||0:SW(e)?IW(e):null!=e?e:n}const s=EI(0),o=EI(null);let a=[],l=Bx;const u=ak(()=>e.value.map(e=>[e.min,e.max]));DO(i,()=>{if(s.value){const e=new MouseEvent("mouseup",{bubbles:!0});window.dispatchEvent(e)}});const c=[];return{lazyOffset:s,onMoveStart:e=>{s.value=0,o.value={index:e,confirmed:!1},a=n.value},onMoving:(n,c)=>{var d,h;let p=null;if(!(o.value&&o.value.confirmed||0===c))if(c>0)p=n,o.value={index:n,confirmed:!0};else for(let e=n;e>=0;e-=1)if(a[e]>0){p=e,o.value={index:e,confirmed:!0};break}const f=null!=(h=null!=p?p:null==(d=o.value)?void 0:d.index)?h:n,m=[...a],g=f+1,_=r(u.value[f][0],0),y=r(u.value[g][0],0),v=r(u.value[f][1],t.value||0),b=r(u.value[g][1],t.value||0);let T=c;m[f]+T<_&&(T=_-m[f]),m[g]-T<y&&(T=m[g]-y),m[f]+T>v&&(T=v-m[f]),m[g]-T>b&&(T=m[g]-b),m[f]+=T,m[g]-=T,s.value=T,l=()=>{e.value.forEach((e,t)=>{e.size=m[t]}),l=Bx},i.value||l()},onMoveEnd:()=>{i.value&&l(),s.value=0,o.value=null,a=[]},movingIndex:o,onCollapse:(t,i)=>{c.length||c.push(...n.value);const r=n.value,s="start"===i?t:t+1,o="start"===i?t+1:t,a=r[s],l=r[o];if(0!==a&&0!==l)r[s]=0,r[o]+=a,c[t]=a;else{const e=a+l,n=c[t],i=e-n;r[o]=n,r[s]=i}e.value.forEach((e,t)=>{e.size=r[t]})}}}const OW=e=>{const t=Hx(e)?e:[e],n=[];return t.forEach(e=>{var t;Hx(e)?n.push(...OW(e)):_M(e)&&(null==(t=e.component)?void 0:t.subTree)?n.push(e,...OW(e.component.subTree)):_M(e)&&Hx(e.children)?n.push(...OW(e.children)):_M(e)&&2===e.shapeFlag?n.push(...OW(e.type())):n.push(e)}),n},MW=(e,t)=>{const n=wI({}),i=wI([]),r=new WeakMap,s=()=>{i.value=((e,t,n)=>{const i=OW(e.subTree).filter(e=>{var n;return _M(e)&&(null==(n=e.type)?void 0:n.name)===t&&!!e.component});return i.map(e=>e.component.uid).map(e=>n[e]).filter(e=>!!e)})(e,t,n.value)},o=e=>e.render(),a=dS({setup:(e,{slots:t})=>()=>(s(),t.default?lk(o,{render:t.default}):null)});return{children:i,addChild:e=>{n.value[e.uid]=e,SI(n),KS(()=>{const t=e.getVnode().el,i=t.parentNode;if(!r.has(i)){r.set(i,[]);const e=i.insertBefore.bind(i);i.insertBefore=(t,s)=>(r.get(i).some(e=>t===e||s===e)&&SI(n),e(t,s))}r.get(i).push(t)})},removeChild:e=>{delete n.value[e.uid],SI(n);const t=e.getVnode().el,i=t.parentNode,s=r.get(i),o=s.indexOf(t);s.splice(o,1)},ChildrenSorter:a}},kW=dS({name:"ElSplitter"}),RW=dS({...kW,props:xW,emits:["resizeStart","resize","resizeEnd","collapse"],setup(e,{emit:t}){const n=e,i=ij("splitter"),r=PI(n,"layout"),s=PI(n,"lazy"),{containerEl:o,containerSize:a}=function(e){const t=EI(),{width:n,height:i}=LH(t);return{containerEl:t,containerSize:ak(()=>"horizontal"===e.value?n.value:i.value)}}(r),{removeChild:l,children:u,addChild:c,ChildrenSorter:d}=MW($M(),"ElSplitterPanel");DO(u,()=>{u.value.forEach((e,t)=>{e.setIndex(t)})});const{percentSizes:h,pxSizes:p}=function(e,t){const n=ak(()=>e.value.map(e=>e.size)),i=ak(()=>e.value.length),r=EI([]);DO([n,i,t],()=>{var n;let s=[],o=0;for(let r=0;r<i.value;r+=1){const i=null==(n=e.value[r])?void 0:n.size;if(AW(i))s[r]=wW(i);else if(SW(i))s[r]=IW(i)/t.value;else if(i||0===i){const e=Number(i);Number.isNaN(e)||(s[r]=e/t.value)}else o+=1,s[r]=void 0}const a=s.reduce((e,t)=>e+(t||0),0);if(a>1||!o){const e=1/a;s=s.map(t=>void 0===t?0:t*e)}else{const e=(1-a)/o;s=s.map(t=>void 0===t?e:t)}r.value=s});const s=e=>e*t.value,o=ak(()=>r.value.map(s));return{percentSizes:r,pxSizes:o}}(u,a),{lazyOffset:f,movingIndex:m,onMoveStart:g,onMoving:_,onMoveEnd:y,onCollapse:v}=CW(u,a,p,s),b=ak(()=>({[`--${i.b()}-bar-offset`]:s.value?`${f.value}px`:void 0}));return eO(EW,uI({panels:u,percentSizes:h,pxSizes:p,layout:r,lazy:s,movingIndex:m,containerSize:a,onMoveStart:e=>{g(e),t("resizeStart",e,p.value)},onMoving:(e,n)=>{_(e,n),s.value||t("resize",e,p.value)},onMoveEnd:async e=>{y(),await hA(),t("resizeEnd",e,p.value)},onCollapse:(e,n)=>{v(e,n),t("collapse",e,n,p.value)},registerPanel:c,unregisterPanel:l})),(e,t)=>(uM(),mM("div",{ref_key:"containerEl",ref:o,class:CE([CI(i).b(),CI(i).e(CI(r))]),style:EE(CI(b))},[mC(e.$slots,"default"),EM(CI(d)),OM(" Prevent iframe touch events from breaking "),CI(m)?(uM(),mM("div",{key:0,class:CE([CI(i).e("mask"),CI(i).e(`mask-${CI(r)}`)])},null,2)):OM("v-if",!0)],6))}});var NW=HH(RW,[["__file","splitter.vue"]]);function DW(e,t,n,i){return!!((null==e?void 0:e.collapsible.end)&&t>0)||!!((null==n?void 0:n.collapsible.start)&&0===i&&t>0)}const FW=dS({name:"ElSplitterBar"}),LW=dS({...FW,props:{index:{type:Number,required:!0},layout:{type:String,values:["horizontal","vertical"],default:"horizontal"},resizable:{type:Boolean,default:!0},lazy:Boolean,startCollapsible:Boolean,endCollapsible:Boolean},emits:["moveStart","moving","moveEnd","collapse"],setup(e,{emit:t}){const n=e,i=ij("splitter-bar"),r=ak(()=>"horizontal"===n.layout),s=ak(()=>r.value?{width:0}:{height:0}),o=ak(()=>({width:r.value?"16px":"100%",height:r.value?"100%":"16px",cursor:n.resizable?r.value?"ew-resize":"ns-resize":"auto",touchAction:"none"})),a=ak(()=>{const e=i.e("dragger");return{[`${e}-horizontal`]:r.value,[`${e}-vertical`]:!r.value,[`${e}-active`]:!!l.value}}),l=EI(null),u=e=>{n.resizable&&(l.value=[e.pageX,e.pageY],t("moveStart",n.index),window.addEventListener("mouseup",p),window.addEventListener("mousemove",d))},c=e=>{if(n.resizable&&1===e.touches.length){e.preventDefault();const i=e.touches[0];l.value=[i.pageX,i.pageY],t("moveStart",n.index),window.addEventListener("touchend",f),window.addEventListener("touchmove",h)}},d=e=>{const{pageX:i,pageY:s}=e,o=i-l.value[0],a=s-l.value[1],u=r.value?o:a;t("moving",n.index,u)},h=e=>{if(1===e.touches.length){e.preventDefault();const i=e.touches[0],s=i.pageX-l.value[0],o=i.pageY-l.value[1],a=r.value?s:o;t("moving",n.index,a)}},p=()=>{l.value=null,window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),t("moveEnd",n.index)},f=()=>{l.value=null,window.removeEventListener("touchend",f),window.removeEventListener("touchmove",h),t("moveEnd",n.index)},m=ak(()=>r.value?RG:LG),g=ak(()=>r.value?DG:MG);return(n,r)=>(uM(),mM("div",{class:CE([CI(i).b()]),style:EE(CI(s))},[e.startCollapsible?(uM(),mM("div",{key:0,class:CE([CI(i).e("collapse-icon"),CI(i).e(`${e.layout}-collapse-icon-start`)]),onClick:n=>t("collapse",e.index,"start")},[mC(n.$slots,"start-collapsible",{},()=>[(uM(),gM(uC(CI(m)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):OM("v-if",!0),xM("div",{class:CE([CI(i).e("dragger"),CI(a),CI(i).is("disabled",!e.resizable),CI(i).is("lazy",e.resizable&&e.lazy)]),style:EE(CI(o)),onMousedown:u,onTouchstart:c},null,38),e.endCollapsible?(uM(),mM("div",{key:1,class:CE([CI(i).e("collapse-icon"),CI(i).e(`${e.layout}-collapse-icon-end`)]),onClick:n=>t("collapse",e.index,"end")},[mC(n.$slots,"end-collapsible",{},()=>[(uM(),gM(uC(CI(g)),{style:{width:"12px",height:"12px"}}))])],10,["onClick"])):OM("v-if",!0)],6))}});var PW=HH(LW,[["__file","split-bar.vue"]]);const BW=hG({min:{type:[String,Number]},max:{type:[String,Number]},size:{type:[String,Number]},resizable:{type:Boolean,default:!0},collapsible:Boolean}),$W="ElSplitterPanel",UW=dS({name:$W}),VW=dS({...UW,props:BW,emits:["update:size"],setup(e,{emit:t}){const n=e,i=ij("splitter-panel"),r=tO(EW);r||gW($W,"usage: <el-splitter><el-splitter-panel /></el-splitter/>");const{panels:s,layout:o,lazy:a,containerSize:l,pxSizes:u}=DI(r),{registerPanel:c,unregisterPanel:d,onCollapse:h,onMoveEnd:p,onMoveStart:f,onMoving:m}=r,g=EI(),_=$M(),y=_.uid,v=EI(0),b=ak(()=>s.value[v.value]),T=ak(()=>{var e;return b.value&&null!=(e=u.value[v.value])?e:0}),x=ak(()=>{var e;return b.value&&null!=(e=u.value[v.value+1])?e:0}),E=ak(()=>b.value?s.value[v.value+1]:null),w=ak(()=>{var e;return!!E.value&&(n.resizable&&(null==(e=E.value)?void 0:e.resizable)&&(0!==T.value||!n.min)&&(0!==x.value||!E.value.min))}),I=ak(()=>!!b.value&&v.value!==s.value.length-1),A=ak(()=>DW(b.value,T.value,E.value,x.value)),S=ak(()=>DW(E.value,x.value,b.value,T.value));function C(e){return AW(e)?wW(e)*l.value||0:SW(e)?IW(e):null!=e?e:0}let O=!1;DO(()=>n.size,()=>{if(!O&&b.value){if(!l.value)return void(b.value.size=n.size);const e=C(n.size),i=C(n.max),r=C(n.min),s=Math.min(Math.max(e,r||0),i||e);s!==e&&t("update:size",s),b.value.size=s}}),DO(()=>{var e;return null==(e=b.value)?void 0:e.size},e=>{e!==n.size&&(O=!0,t("update:size",e),hA(()=>O=!1))}),DO(()=>n.resizable,e=>{b.value&&(b.value.resizable=e)});const M=uI({el:g.value,uid:y,getVnode:()=>_.vnode,setIndex:e=>{v.value=e},...n,collapsible:ak(()=>{return(e=n.collapsible)&&Jx(e)?e:{start:!!e,end:!!e};var e})});return c(M),JS(()=>d(M)),(e,t)=>(uM(),mM(iM,null,[xM("div",NM({ref_key:"panelEl",ref:g,class:[CI(i).b()],style:{flexBasis:`${CI(T)}px`}},e.$attrs),[mC(e.$slots,"default")],16),CI(I)?(uM(),gM(PW,{key:0,index:v.value,layout:CI(o),lazy:CI(a),resizable:CI(w),"start-collapsible":CI(A),"end-collapsible":CI(S),onMoveStart:CI(f),onMoving:CI(m),onMoveEnd:CI(p),onCollapse:CI(h)},{"start-collapsible":LA(()=>[mC(e.$slots,"start-collapsible")]),"end-collapsible":LA(()=>[mC(e.$slots,"end-collapsible")]),_:3},8,["index","layout","lazy","resizable","start-collapsible","end-collapsible","onMoveStart","onMoving","onMoveEnd","onCollapse"])):OM("v-if",!0)],64))}});var zW=HH(VW,[["__file","split-panel.vue"]]);const jW=AG(NW,{SplitPanel:zW}),YW=SG(zW),GW=Symbol("buttonGroupContextKey"),HW={prefix:Math.floor(1e4*Math.random()),current:0},WW=Symbol("elIdInjection"),XW=()=>$M()?tO(WW,HW):HW,qW=e=>{const t=XW(),n=nj();return gj(()=>CI(e)||`${n.value}-id-${t.prefix}-${t.current++}`)},KW=Symbol("formContextKey"),ZW=Symbol("formItemContextKey"),QW=()=>({form:tO(KW,void 0),formItem:tO(ZW,void 0)}),JW=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:i})=>{n||(n=EI(!1)),i||(i=EI(!1));const r=$M(),s=EI();let o;const a=ak(()=>{var n;return!!(!e.label&&!e.ariaLabel&&t&&t.inputIds&&(null==(n=t.inputIds)?void 0:n.length)<=1)});return KS(()=>{o=DO([PI(e,"id"),n],([e,n])=>{const o=null!=e?e:n?void 0:qW().value;o!==s.value&&((null==t?void 0:t.removeInputId)&&!(()=>{let e=null==r?void 0:r.parent;for(;e;){if("ElFormItem"===e.type.name)return!1;if("ElLabelWrap"===e.type.name)return!0;e=e.parent}return!1})()&&(s.value&&t.removeInputId(s.value),(null==i?void 0:i.value)||n||!o||t.addInputId(o)),s.value=o)},{immediate:!0})}),eC(()=>{o&&o(),(null==t?void 0:t.removeInputId)&&s.value&&t.removeInputId(s.value)}),{isLabeledByFormItem:a,inputId:s}},eX=e=>{const t=$M();return ak(()=>{var n,i;return null==(i=null==(n=null==t?void 0:t.proxy)?void 0:n.$props)?void 0:i[e]})},tX=(e,t={})=>{const n=EI(void 0),i=t.prop?n:eX("size"),r=t.global?n:(()=>{const e=tO(mG,{});return ak(()=>CI(e.size)||"")})(),s=t.form?{size:void 0}:tO(KW,void 0),o=t.formItem?{size:void 0}:tO(ZW,void 0);return ak(()=>i.value||CI(e)||(null==o?void 0:o.size)||(null==s?void 0:s.size)||r.value||"")},nX=e=>{const t=eX("disabled"),n=tO(KW,void 0);return ak(()=>t.value||CI(e)||(null==n?void 0:n.disabled)||!1)},iX=(e,t)=>{(({from:e,replacement:t,scope:n,version:i,ref:r,type:s="API"},o)=>{DO(()=>CI(o),e=>{},{immediate:!0})})({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},ak(()=>"text"===e.type));const n=tO(GW,void 0),i=bG("button"),{form:r}=QW(),s=tX(ak(()=>null==n?void 0:n.size)),o=nX(),a=EI(),l=MC(),u=ak(()=>{var t;return e.type||(null==n?void 0:n.type)||(null==(t=i.value)?void 0:t.type)||""}),c=ak(()=>{var t,n,r;return null!=(r=null!=(n=e.autoInsertSpace)?n:null==(t=i.value)?void 0:t.autoInsertSpace)&&r}),d=ak(()=>{var t,n,r;return null!=(r=null!=(n=e.plain)?n:null==(t=i.value)?void 0:t.plain)&&r}),h=ak(()=>{var t,n,r;return null!=(r=null!=(n=e.round)?n:null==(t=i.value)?void 0:t.round)&&r}),p=ak(()=>{var t,n,r;return null!=(r=null!=(n=e.text)?n:null==(t=i.value)?void 0:t.text)&&r}),f=ak(()=>"button"===e.tag?{ariaDisabled:o.value||e.loading,disabled:o.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),m=ak(()=>{var e;const t=null==(e=l.default)?void 0:e.call(l);if(c.value&&1===(null==t?void 0:t.length)){const e=t[0];if((null==e?void 0:e.type)===rM){const t=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(t.trim())}}return!1});return{_disabled:o,_size:s,_type:u,_ref:a,_props:f,_plain:d,_round:h,_text:p,shouldAddSpace:m,handleClick:n=>{o.value||e.loading?n.stopPropagation():("reset"===e.nativeType&&(null==r||r.resetFields()),t("click",n))}}},rX=hG({size:fG,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:eW},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:eW,default:()=>hH},plain:{type:Boolean,default:void 0},text:{type:Boolean,default:void 0},link:Boolean,bg:Boolean,autofocus:Boolean,round:{type:Boolean,default:void 0},circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:[String,Object],default:"button"}}),sX={click:e=>e instanceof MouseEvent};function oX(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=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function aX(e){return Math.min(1,Math.max(0,e))}function lX(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function uX(e){return e<=1?"".concat(100*Number(e),"%"):e}function cX(e){return 1===e.length?"0"+e:String(e)}function dX(e,t,n){e=oX(e,255),t=oX(t,255),n=oX(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=0,a=(i+r)/2;if(i===r)o=0,s=0;else{var l=i-r;switch(o=a>.5?l/(2-i-r):l/(i+r),i){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return{h:s,s:o,l:a}}function hX(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function pX(e,t,n){e=oX(e,255),t=oX(t,255),n=oX(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),s=0,o=i,a=i-r,l=0===i?0:a/i;if(i===r)s=0;else{switch(i){case e:s=(t-n)/a+(t<n?6:0);break;case t:s=(n-e)/a+2;break;case n:s=(e-t)/a+4}s/=6}return{h:s,s:l,v:o}}function fX(e,t,n,i){var r=[cX(Math.round(e).toString(16)),cX(Math.round(t).toString(16)),cX(Math.round(n).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function mX(e){return Math.round(255*parseFloat(e)).toString(16)}function gX(e){return _X(e)/255}function _X(e){return parseInt(e,16)}var yX={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function vX(e){var t,n,i,r={r:0,g:0,b:0},s=1,o=null,a=null,l=null,u=!1,c=!1;return"string"==typeof e&&(e=function(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(yX[e])e=yX[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=EX.rgb.exec(e);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=EX.rgba.exec(e),n)return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=EX.hsl.exec(e),n)return{h:n[1],s:n[2],l:n[3]};if(n=EX.hsla.exec(e),n)return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=EX.hsv.exec(e),n)return{h:n[1],s:n[2],v:n[3]};if(n=EX.hsva.exec(e),n)return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=EX.hex8.exec(e),n)return{r:_X(n[1]),g:_X(n[2]),b:_X(n[3]),a:gX(n[4]),format:t?"name":"hex8"};if(n=EX.hex6.exec(e),n)return{r:_X(n[1]),g:_X(n[2]),b:_X(n[3]),format:t?"name":"hex"};if(n=EX.hex4.exec(e),n)return{r:_X(n[1]+n[1]),g:_X(n[2]+n[2]),b:_X(n[3]+n[3]),a:gX(n[4]+n[4]),format:t?"name":"hex8"};if(n=EX.hex3.exec(e),n)return{r:_X(n[1]+n[1]),g:_X(n[2]+n[2]),b:_X(n[3]+n[3]),format:t?"name":"hex"};return!1}(e)),"object"==typeof e&&(wX(e.r)&&wX(e.g)&&wX(e.b)?(t=e.r,n=e.g,i=e.b,r={r:255*oX(t,255),g:255*oX(n,255),b:255*oX(i,255)},u=!0,c="%"===String(e.r).substr(-1)?"prgb":"rgb"):wX(e.h)&&wX(e.s)&&wX(e.v)?(o=uX(e.s),a=uX(e.v),r=function(e,t,n){e=6*oX(e,360),t=oX(t,100),n=oX(n,100);var i=Math.floor(e),r=e-i,s=n*(1-t),o=n*(1-r*t),a=n*(1-(1-r)*t),l=i%6;return{r:255*[n,o,s,s,a,n][l],g:255*[a,n,n,o,s,s][l],b:255*[s,s,a,n,n,o][l]}}(e.h,o,a),u=!0,c="hsv"):wX(e.h)&&wX(e.s)&&wX(e.l)&&(o=uX(e.s),l=uX(e.l),r=function(e,t,n){var i,r,s;if(e=oX(e,360),t=oX(t,100),n=oX(n,100),0===t)r=n,s=n,i=n;else{var o=n<.5?n*(1+t):n+t-n*t,a=2*n-o;i=hX(a,o,e+1/3),r=hX(a,o,e),s=hX(a,o,e-1/3)}return{r:255*i,g:255*r,b:255*s}}(e.h,o,l),u=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(s=e.a)),s=lX(s),{ok:u,format:e.format||c,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:s}}var bX="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),TX="[\\s|\\(]+(".concat(bX,")[,|\\s]+(").concat(bX,")[,|\\s]+(").concat(bX,")\\s*\\)?"),xX="[\\s|\\(]+(".concat(bX,")[,|\\s]+(").concat(bX,")[,|\\s]+(").concat(bX,")[,|\\s]+(").concat(bX,")\\s*\\)?"),EX={CSS_UNIT:new RegExp(bX),rgb:new RegExp("rgb"+TX),rgba:new RegExp("rgba"+xX),hsl:new RegExp("hsl"+TX),hsla:new RegExp("hsla"+xX),hsv:new RegExp("hsv"+TX),hsva:new RegExp("hsva"+xX),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 wX(e){return Boolean(EX.CSS_UNIT.exec(String(e)))}var IX=function(){function e(t,n){var i;if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"==typeof t&&(t=function(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var r=vX(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(i=n.format)&&void 0!==i?i:r.format,this.gradientType=n.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.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,i=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=lX(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=pX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=pX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=dX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=dX(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),i=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),fX(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,i,r){var s=[cX(Math.round(e).toString(16)),cX(Math.round(t).toString(16)),cX(Math.round(n).toString(16)),cX(mX(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*oX(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*oX(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+fX(this.r,this.g,this.b,!1),t=0,n=Object.entries(yX);t<n.length;t++){var i=n[t],r=i[0];if(e===i[1])return r}return!1},e.prototype.toString=function(e){var t=Boolean(e);e=null!=e?e:this.format;var n=!1,i=this.a<1&&this.a>=0;return t||!i||!e.startsWith("hex")&&"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()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=aX(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=aX(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=aX(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=aX(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),i=(n.h+t)%360;return n.h=i<0?360+i:i,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var i=this.toRgb(),r=new e(t).toRgb(),s=n/100;return new e({r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var i=this.toHsl(),r=360/n,s=[this];for(i.h=(i.h-(r*t>>1)+720)%360;--t;)i.h=(i.h+r)%360,s.push(new e(i));return s},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),i=n.h,r=n.s,s=n.v,o=[],a=1/t;t--;)o.push(new e({h:i,s:r,v:s})),s=(s+a)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),i=new e(t).toRgb(),r=n.a+i.a*(1-n.a);return new e({r:(n.r*n.a+i.r*i.a*(1-n.a))/r,g:(n.g*n.a+i.g*i.a*(1-n.a))/r,b:(n.b*n.a+i.b*i.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),i=n.h,r=[this],s=360/t,o=1;o<t;o++)r.push(new e({h:(i+o*s)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function AX(e,t=20){return e.mix("#141414",t).toString()}const SX=dS({name:"ElButton"}),CX=dS({...SX,props:rX,emits:sX,setup(e,{expose:t,emit:n}){const i=e,r=function(e){const t=nX(),n=ij("button");return ak(()=>{let i={},r=e.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new IX(r),a=e.dark?o.tint(20).toString():AX(o,20);if(e.plain)i=n.cssVarBlock({"bg-color":e.dark?AX(o,90):o.tint(90).toString(),"text-color":r,"border-color":e.dark?AX(o,50):o.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":a,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":a}),t.value&&(i[n.cssVarBlockName("disabled-bg-color")]=e.dark?AX(o,90):o.tint(90).toString(),i[n.cssVarBlockName("disabled-text-color")]=e.dark?AX(o,50):o.tint(50).toString(),i[n.cssVarBlockName("disabled-border-color")]=e.dark?AX(o,80):o.tint(80).toString());else{const s=e.dark?AX(o,30):o.tint(30).toString(),l=o.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(i=n.cssVarBlock({"bg-color":r,"text-color":l,"border-color":r,"hover-bg-color":s,"hover-text-color":l,"hover-border-color":s,"active-bg-color":a,"active-border-color":a}),t.value){const t=e.dark?AX(o,50):o.tint(50).toString();i[n.cssVarBlockName("disabled-bg-color")]=t,i[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,i[n.cssVarBlockName("disabled-border-color")]=t}}}return i})}(i),s=ij("button"),{_ref:o,_size:a,_type:l,_disabled:u,_props:c,_plain:d,_round:h,_text:p,shouldAddSpace:f,handleClick:m}=iX(i,n),g=ak(()=>[s.b(),s.m(l.value),s.m(a.value),s.is("disabled",u.value),s.is("loading",i.loading),s.is("plain",d.value),s.is("round",h.value),s.is("circle",i.circle),s.is("text",p.value),s.is("link",i.link),s.is("has-bg",i.bg)]);return t({ref:o,size:a,type:l,disabled:u,shouldAddSpace:f}),(e,t)=>(uM(),gM(uC(e.tag),NM({ref_key:"_ref",ref:o},CI(c),{class:CI(g),style:CI(r),onClick:CI(m)}),{default:LA(()=>[e.loading?(uM(),mM(iM,{key:0},[e.$slots.loading?mC(e.$slots,"loading",{key:0}):(uM(),gM(CI(JH),{key:1,class:CE(CI(s).is("loading"))},{default:LA(()=>[(uM(),gM(uC(e.loadingIcon)))]),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?(uM(),gM(CI(JH),{key:1},{default:LA(()=>[e.icon?(uM(),gM(uC(e.icon),{key:0})):mC(e.$slots,"icon",{key:1})]),_:3})):OM("v-if",!0),e.$slots.default?(uM(),mM("span",{key:2,class:CE({[CI(s).em("text","expand")]:CI(f)})},[mC(e.$slots,"default")],2)):OM("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var OX=HH(CX,[["__file","button.vue"]]);const MX={size:rX.size,type:rX.type},kX=dS({name:"ElButtonGroup"});var RX=HH(dS({...kX,props:MX,setup(e){const t=e;eO(GW,uI({size:PI(t,"size"),type:PI(t,"type")}));const n=ij("button");return(e,t)=>(uM(),mM("div",{class:CE(CI(n).b("group"))},[mC(e.$slots,"default")],2))}}),[["__file","button-group.vue"]]);const NX=AG(OX,{ButtonGroup:RX}),DX=(SG(RX),hG({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:[String,Object,Array],default:""},headerClass:String,bodyClass:String,footerClass:String,shadow:{type:String,values:["always","hover","never"],default:void 0}})),FX=(Symbol("cardContextKey"),dS({name:"ElCard"})),LX=dS({...FX,props:DX,setup(e){const t=bG("card"),n=ij("card");return(e,i)=>{var r;return uM(),mM("div",{class:CE([CI(n).b(),CI(n).is(`${e.shadow||(null==(r=CI(t))?void 0:r.shadow)||"always"}-shadow`)])},[e.$slots.header||e.header?(uM(),mM("div",{key:0,class:CE([CI(n).e("header"),e.headerClass])},[mC(e.$slots,"header",{},()=>[SM(GE(e.header),1)])],2)):OM("v-if",!0),xM("div",{class:CE([CI(n).e("body"),e.bodyClass]),style:EE(e.bodyStyle)},[mC(e.$slots,"default")],6),e.$slots.footer||e.footer?(uM(),mM("div",{key:1,class:CE([CI(n).e("footer"),e.footerClass])},[mC(e.$slots,"footer",{},()=>[SM(GE(e.footer),1)])],2)):OM("v-if",!0)],2)}}});const PX=AG(HH(LX,[["__file","card.vue"]]));var BX=__webpack_require__(4213),$X=__webpack_require__(71710),UX=__webpack_require__.n($X);const VX=function(e){return null==e};let zX;const jX={height:"0",visibility:"hidden",overflow:_j&&/firefox/i.test(window.navigator.userAgent)?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},YX=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"];function GX(e,t=1,n){var i,r;zX||(zX=document.createElement("textarea"),(null!=(i=e.parentNode)?i:document.body).appendChild(zX));const{paddingSize:s,borderSize:o,boxSizing:a,contextStyle:l}=function(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),i=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:YX.map(e=>[e,t.getPropertyValue(e)]),paddingSize:i,borderSize:r,boxSizing:n}}(e);l.forEach(([e,t])=>null==zX?void 0:zX.style.setProperty(e,t)),Object.entries(jX).forEach(([e,t])=>null==zX?void 0:zX.style.setProperty(e,t,"important")),zX.value=e.value||e.placeholder||"";let u=zX.scrollHeight;const c={};"border-box"===a?u+=o:"content-box"===a&&(u-=s),zX.value="";const d=zX.scrollHeight-s;if(oj(t)){let e=d*t;"border-box"===a&&(e=e+s+o),u=Math.max(e,u),c.minHeight=`${e}px`}if(oj(n)){let e=d*n;"border-box"===a&&(e=e+s+o),u=Math.min(e,u)}return c.height=`${u}px`,null==(r=zX.parentNode)||r.removeChild(zX),zX=void 0,c}var HX=function(){try{var e=hY(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const WX=HX;const XX=function(e,t,n){"__proto__"==t&&WX?WX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var qX=Object.prototype.hasOwnProperty;const KX=function(e,t,n){var i=e[t];qX.call(e,t)&&wY(i,n)&&(void 0!==n||t in e)||XX(e,t,n)};var ZX=/^(?:0|[1-9]\d*)$/;const QX=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ZX.test(e))&&e>-1&&e%1==0&&e<t};const JX=function(e,t,n,i){if(!Zj(e))return e;for(var r=-1,s=(t=eG(t,e)).length,o=s-1,a=e;null!=a&&++r<s;){var l=tG(t[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(r!=o){var c=a[l];void 0===(u=i?i(c,l,a):void 0)&&(u=Zj(c)?c:QX(t[r+1])?[]:{})}KX(a,l,u),a=a[l]}return e};const eq=function(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var o=t[i],a=nG(e,o);n(a,o)&&JX(s,eG(o,e),a)}return s};const tq=function(e,t){return null!=e&&t in Object(e)};const nq=function(e){return Hj(e)&&"[object Arguments]"==Gj(e)};var iq=Object.prototype,rq=iq.hasOwnProperty,sq=iq.propertyIsEnumerable;const oq=nq(function(){return arguments}())?nq:function(e){return Hj(e)&&rq.call(e,"callee")&&!sq.call(e,"callee")};const aq=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};const lq=function(e,t,n){for(var i=-1,r=(t=eG(t,e)).length,s=!1;++i<r;){var o=tG(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=r?s:!!(r=null==e?0:e.length)&&aq(r)&&QX(o,r)&&(Rj(e)||oq(e))};const uq=function(e,t){return null!=e&&lq(e,t,tq)};const cq=function(e,t){return eq(e,t,function(t,n){return uq(e,n)})};const dq=function(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e};var hq=Lj?Lj.isConcatSpreadable:void 0;const pq=function(e){return Rj(e)||oq(e)||!!(hq&&e&&e[hq])};const fq=function e(t,n,i,r,s){var o=-1,a=t.length;for(i||(i=pq),s||(s=[]);++o<a;){var l=t[o];n>0&&i(l)?n>1?e(l,n-1,i,r,s):dq(s,l):r||(s[s.length]=l)}return s};const mq=function(e){return(null==e?0:e.length)?fq(e,1):[]};const gq=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var _q=Math.max;const yq=function(e,t,n){return t=_q(void 0===t?e.length-1:t,0),function(){for(var i=arguments,r=-1,s=_q(i.length-t,0),o=Array(s);++r<s;)o[r]=i[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=i[r];return a[t]=n(o),gq(e,this,a)}};const vq=function(e){return function(){return e}};var bq=WX?function(e,t){return WX(e,"toString",{configurable:!0,enumerable:!1,value:vq(t),writable:!0})}:function(e){return e};const Tq=bq;var xq=Date.now;const Eq=function(e){var t=0,n=0;return function(){var i=xq(),r=16-(i-n);if(n=i,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};const wq=Eq(Tq);const Iq=function(e){return wq(yq(e,void 0,mq),e+"")};var Aq=Iq(function(e,t){return null==e?{}:cq(e,t)});const Sq=Aq,Cq=hG({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Oq=e=>Sq(Cq,e),Mq="update:modelValue",kq="change",Rq="input",Nq=hG({id:{type:String,default:void 0},size:fG,disabled:Boolean,modelValue:{type:[String,Number,Object],default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,clearIcon:{type:eW,default:HG},showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:eW},prefixIcon:{type:eW},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Object,Array,String],default:()=>({})},autofocus:Boolean,rows:{type:Number,default:2},...Oq(["ariaLabel"]),inputmode:{type:String,default:void 0},name:String}),Dq={[Mq]:e=>Zx(e),input:e=>Zx(e),change:e=>Zx(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},Fq=["class","style"],Lq=/^on[A-Z]/,Pq=(e={})=>{const{excludeListeners:t=!1,excludeKeys:n}=e,i=ak(()=>((null==n?void 0:n.value)||[]).concat(Fq)),r=$M();return ak(r?()=>{var e;return uG(Object.entries(null==(e=r.proxy)?void 0:e.$attrs).filter(([e])=>!(i.value.includes(e)||t&&Lq.test(e))))}:()=>({}))},Bq=e=>"undefined"!=typeof Element&&e instanceof Element,$q=e=>{if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return!("hidden"===e.type||"file"===e.type);case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Uq=(e,t)=>{if(!e||!e.focus)return;let n=!1;!Bq(e)||$q(e)||e.getAttribute("tabindex")||(e.setAttribute("tabindex","-1"),n=!0),e.focus(t),Bq(e)&&n&&e.removeAttribute("tabindex")};const Vq=dS({name:"ElInput",inheritAttrs:!1}),zq=dS({...Vq,props:Nq,emits:Dq,setup(e,{expose:t,emit:n}){const i=e,r=kC(),s=Pq(),o=MC(),a=ak(()=>["textarea"===i.type?m.b():f.b(),f.m(h.value),f.is("disabled",p.value),f.is("exceed",B.value),{[f.b("group")]:o.prepend||o.append,[f.m("prefix")]:o.prefix||i.prefixIcon,[f.m("suffix")]:o.suffix||i.suffixIcon||i.clearable||i.showPassword,[f.bm("suffix","password-clear")]:D.value&&F.value,[f.b("hidden")]:"hidden"===i.type},r.class]),l=ak(()=>[f.e("wrapper"),f.is("focus",w.value)]),{form:u,formItem:c}=QW(),{inputId:d}=JW(i,{formItemContext:c}),h=tX(),p=nX(),f=ij("input"),m=ij("textarea"),g=wI(),_=wI(),y=EI(!1),v=EI(!1),b=EI(),T=wI(i.inputStyle),x=ak(()=>g.value||_.value),{wrapperRef:E,isFocused:w,handleFocus:I,handleBlur:A}=function(e,{disabled:t,beforeFocus:n,afterFocus:i,beforeBlur:r,afterBlur:s}={}){const o=$M(),{emit:a}=o,l=wI(),u=EI(!1),c=e=>{const r=!!Kx(n)&&n(e);CI(t)||u.value||r||(u.value=!0,a("focus",e),null==i||i())},d=e=>{var n;const i=!!Kx(r)&&r(e);CI(t)||e.relatedTarget&&(null==(n=l.value)?void 0:n.contains(e.relatedTarget))||i||(u.value=!1,a("blur",e),null==s||s())};return DO([l,()=>CI(t)],([e,t])=>{e&&(t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1"))}),AH(l,"focus",c,!0),AH(l,"blur",d,!0),AH(l,"click",n=>{var i,r;CI(t)||$q(n.target)||(null==(i=l.value)?void 0:i.contains(document.activeElement))&&l.value!==document.activeElement||null==(r=e.value)||r.focus()},!0),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:d}}(x,{disabled:p,afterBlur(){var e;i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"blur").catch(e=>{}))}}),S=ak(()=>{var e;return null!=(e=null==u?void 0:u.statusIcon)&&e}),C=ak(()=>(null==c?void 0:c.validateState)||""),O=ak(()=>C.value&&iW[C.value]),M=ak(()=>v.value?vH:lH),k=ak(()=>[r.style]),R=ak(()=>[i.inputStyle,T.value,{resize:i.resize}]),N=ak(()=>VX(i.modelValue)?"":String(i.modelValue)),D=ak(()=>i.clearable&&!p.value&&!i.readonly&&!!N.value&&(w.value||y.value)),F=ak(()=>i.showPassword&&!p.value&&!!N.value),L=ak(()=>i.showWordLimit&&!!i.maxlength&&("text"===i.type||"textarea"===i.type)&&!p.value&&!i.readonly&&!i.showPassword),P=ak(()=>N.value.length),B=ak(()=>!!L.value&&P.value>Number(i.maxlength)),$=ak(()=>!!o.suffix||!!i.suffixIcon||D.value||i.showPassword||L.value||!!C.value&&S.value),[U,V]=function(e){let t;return[function(){if(null==e.value)return;const{selectionStart:n,selectionEnd:i,value:r}=e.value;if(null==n||null==i)return;const s=r.slice(0,Math.max(0,n)),o=r.slice(Math.max(0,i));t={selectionStart:n,selectionEnd:i,value:r,beforeTxt:s,afterTxt:o}},function(){if(null==e.value||null==t)return;const{value:n}=e.value,{beforeTxt:i,afterTxt:r,selectionStart:s}=t;if(null==i||null==r||null==s)return;let o=n.length;if(n.endsWith(r))o=n.length-r.length;else if(n.startsWith(i))o=i.length;else{const e=i[s-1],t=n.indexOf(e,s-1);-1!==t&&(o=t+1)}e.value.setSelectionRange(o,o)}]}(g);FH(_,e=>{if(j(),!L.value||"both"!==i.resize)return;const t=e[0],{width:n}=t.contentRect;b.value={right:`calc(100% - ${n+15+6}px)`}});const z=()=>{const{type:e,autosize:t}=i;if(_j&&"textarea"===e&&_.value)if(t){const e=Jx(t)?t.minRows:void 0,n=Jx(t)?t.maxRows:void 0,i=GX(_.value,e,n);T.value={overflowY:"hidden",...i},hA(()=>{_.value.offsetHeight,T.value=i})}else T.value={minHeight:GX(_.value).minHeight}},j=(e=>{let t=!1;return()=>{var n;if(t||!i.autosize)return;null===(null==(n=_.value)?void 0:n.offsetParent)||(setTimeout(e),t=!0)}})(z),Y=()=>{const e=x.value,t=i.formatter?i.formatter(N.value):N.value;e&&e.value!==t&&(e.value=t)},G=async e=>{U();let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),W.value||(t!==N.value?(n(Mq,t),n(Rq,t),await hA(),Y(),V()):Y())},H=e=>{let{value:t}=e.target;i.formatter&&i.parser&&(t=i.parser(t)),n(kq,t)},{isComposing:W,handleCompositionStart:X,handleCompositionUpdate:q,handleCompositionEnd:K}=function({afterComposition:e,emit:t}){const n=EI(!1),i=e=>{var i;null==t||t("compositionupdate",e);const r=null==(i=e.target)?void 0:i.value,s=r[r.length-1]||"";n.value=!(e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e))(s)},r=i=>{null==t||t("compositionend",i),n.value&&(n.value=!1,hA(()=>e(i)))};return{isComposing:n,handleComposition:e=>{"compositionend"===e.type?r(e):i(e)},handleCompositionStart:e=>{null==t||t("compositionstart",e),n.value=!0},handleCompositionUpdate:i,handleCompositionEnd:r}}({emit:n,afterComposition:G}),Z=()=>{U(),v.value=!v.value,setTimeout(V)},Q=e=>{y.value=!1,n("mouseleave",e)},J=e=>{y.value=!0,n("mouseenter",e)},ee=e=>{n("keydown",e)},te=()=>{n(Mq,""),n(kq,""),n("clear"),n(Rq,"")};return DO(()=>i.modelValue,()=>{var e;hA(()=>z()),i.validateEvent&&(null==(e=null==c?void 0:c.validate)||e.call(c,"change").catch(e=>{}))}),DO(N,()=>Y()),DO(()=>i.type,async()=>{await hA(),Y(),z()}),KS(()=>{!i.formatter&&i.parser,Y(),hA(z)}),t({input:g,textarea:_,ref:x,textareaStyle:R,autosize:PI(i,"autosize"),isComposing:W,focus:()=>{var e;return null==(e=x.value)?void 0:e.focus()},blur:()=>{var e;return null==(e=x.value)?void 0:e.blur()},select:()=>{var e;null==(e=x.value)||e.select()},clear:te,resizeTextarea:z}),(e,t)=>(uM(),mM("div",{class:CE([CI(a),{[CI(f).bm("group","append")]:e.$slots.append,[CI(f).bm("group","prepend")]:e.$slots.prepend}]),style:EE(CI(k)),onMouseenter:J,onMouseleave:Q},[OM(" input "),"textarea"!==e.type?(uM(),mM(iM,{key:0},[OM(" prepend slot "),e.$slots.prepend?(uM(),mM("div",{key:0,class:CE(CI(f).be("group","prepend"))},[mC(e.$slots,"prepend")],2)):OM("v-if",!0),xM("div",{ref_key:"wrapperRef",ref:E,class:CE(CI(l))},[OM(" prefix slot "),e.$slots.prefix||e.prefixIcon?(uM(),mM("span",{key:0,class:CE(CI(f).e("prefix"))},[xM("span",{class:CE(CI(f).e("prefix-inner"))},[mC(e.$slots,"prefix"),e.prefixIcon?(uM(),gM(CI(JH),{key:0,class:CE(CI(f).e("icon"))},{default:LA(()=>[(uM(),gM(uC(e.prefixIcon)))]),_:1},8,["class"])):OM("v-if",!0)],2)],2)):OM("v-if",!0),xM("input",NM({id:CI(d),ref_key:"input",ref:g,class:CI(f).e("inner")},CI(s),{name:e.name,minlength:e.minlength,maxlength:e.maxlength,type:e.showPassword?v.value?"text":"password":e.type,disabled:CI(p),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.ariaLabel,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,role:e.containerRole,inputmode:e.inputmode,onCompositionstart:CI(X),onCompositionupdate:CI(q),onCompositionend:CI(K),onInput:G,onChange:H,onKeydown:ee}),null,16,["id","name","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","inputmode","onCompositionstart","onCompositionupdate","onCompositionend"]),OM(" suffix slot "),CI($)?(uM(),mM("span",{key:1,class:CE(CI(f).e("suffix"))},[xM("span",{class:CE(CI(f).e("suffix-inner"))},[CI(D)&&CI(F)&&CI(L)?OM("v-if",!0):(uM(),mM(iM,{key:0},[mC(e.$slots,"suffix"),e.suffixIcon?(uM(),gM(CI(JH),{key:0,class:CE(CI(f).e("icon"))},{default:LA(()=>[(uM(),gM(uC(e.suffixIcon)))]),_:1},8,["class"])):OM("v-if",!0)],64)),CI(D)?(uM(),gM(CI(JH),{key:1,class:CE([CI(f).e("icon"),CI(f).e("clear")]),onMousedown:KR(CI(Bx),["prevent"]),onClick:te},{default:LA(()=>[(uM(),gM(uC(e.clearIcon)))]),_:1},8,["class","onMousedown"])):OM("v-if",!0),CI(F)?(uM(),gM(CI(JH),{key:2,class:CE([CI(f).e("icon"),CI(f).e("password")]),onClick:Z},{default:LA(()=>[(uM(),gM(uC(CI(M))))]),_:1},8,["class"])):OM("v-if",!0),CI(L)?(uM(),mM("span",{key:3,class:CE(CI(f).e("count"))},[xM("span",{class:CE(CI(f).e("count-inner"))},GE(CI(P))+" / "+GE(e.maxlength),3)],2)):OM("v-if",!0),CI(C)&&CI(O)&&CI(S)?(uM(),gM(CI(JH),{key:4,class:CE([CI(f).e("icon"),CI(f).e("validateIcon"),CI(f).is("loading","validating"===CI(C))])},{default:LA(()=>[(uM(),gM(uC(CI(O))))]),_:1},8,["class"])):OM("v-if",!0)],2)],2)):OM("v-if",!0)],2),OM(" append slot "),e.$slots.append?(uM(),mM("div",{key:1,class:CE(CI(f).be("group","append"))},[mC(e.$slots,"append")],2)):OM("v-if",!0)],64)):(uM(),mM(iM,{key:1},[OM(" textarea "),xM("textarea",NM({id:CI(d),ref_key:"textarea",ref:_,class:[CI(m).e("inner"),CI(f).is("focus",CI(w))]},CI(s),{minlength:e.minlength,maxlength:e.maxlength,tabindex:e.tabindex,disabled:CI(p),readonly:e.readonly,autocomplete:e.autocomplete,style:CI(R),"aria-label":e.ariaLabel,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,rows:e.rows,role:e.containerRole,onCompositionstart:CI(X),onCompositionupdate:CI(q),onCompositionend:CI(K),onInput:G,onFocus:CI(I),onBlur:CI(A),onChange:H,onKeydown:ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),CI(L)?(uM(),mM("span",{key:0,style:EE(b.value),class:CE(CI(f).e("count"))},GE(CI(P))+" / "+GE(e.maxlength),7)):OM("v-if",!0)],64))],38))}});const jq=AG(HH(zq,[["__file","input.vue"]])),Yq=Symbol("popper"),Gq=Symbol("popperContent"),Hq=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],Wq=hG({role:{type:String,values:Hq,default:"tooltip"}}),Xq=dS({name:"ElPopper",inheritAttrs:!1});const qq=AG(HH(dS({...Xq,props:Wq,setup(e,{expose:t}){const n=e,i={triggerRef:EI(),popperInstanceRef:EI(),contentRef:EI(),referenceRef:EI(),role:ak(()=>n.role)};return t(i),eO(Yq,i),(e,t)=>mC(e.$slots,"default")}}),[["__file","popper.vue"]])),Kq=Symbol("elTooltip");var Zq="top",Qq="bottom",Jq="right",eK="left",tK="auto",nK=[Zq,Qq,Jq,eK],iK="start",rK="end",sK="viewport",oK="popper",aK=nK.reduce(function(e,t){return e.concat([t+"-"+iK,t+"-"+rK])},[]),lK=[].concat(nK,[tK]).reduce(function(e,t){return e.concat([t,t+"-"+iK,t+"-"+rK])},[]),uK=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function cK(e){return e?(e.nodeName||"").toLowerCase():null}function dK(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function hK(e){return e instanceof dK(e).Element||e instanceof Element}function pK(e){return e instanceof dK(e).HTMLElement||e instanceof HTMLElement}function fK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof dK(e).ShadowRoot||e instanceof ShadowRoot)}var mK={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];!pK(r)||!cK(r)||(Object.assign(r.style,n),Object.keys(i).forEach(function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var i=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]="",e},{});!pK(i)||!cK(i)||(Object.assign(i.style,s),Object.keys(r).forEach(function(e){i.removeAttribute(e)}))})}},requires:["computeStyles"]};function gK(e){return e.split("-")[0]}var _K=Math.max,yK=Math.min,vK=Math.round;function bK(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),i=1,r=1;if(pK(e)&&t){var s=e.offsetHeight,o=e.offsetWidth;o>0&&(i=vK(n.width)/o||1),s>0&&(r=vK(n.height)/s||1)}return{width:n.width/i,height:n.height/r,top:n.top/r,right:n.right/i,bottom:n.bottom/r,left:n.left/i,x:n.left/i,y:n.top/r}}function TK(e){var t=bK(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function xK(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&fK(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function EK(e){return dK(e).getComputedStyle(e)}function wK(e){return["table","td","th"].indexOf(cK(e))>=0}function IK(e){return((hK(e)?e.ownerDocument:e.document)||window.document).documentElement}function AK(e){return"html"===cK(e)?e:e.assignedSlot||e.parentNode||(fK(e)?e.host:null)||IK(e)}function SK(e){return pK(e)&&"fixed"!==EK(e).position?e.offsetParent:null}function CK(e){for(var t=dK(e),n=SK(e);n&&wK(n)&&"static"===EK(n).position;)n=SK(n);return n&&("html"===cK(n)||"body"===cK(n)&&"static"===EK(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&pK(e)&&"fixed"===EK(e).position)return null;var n=AK(e);for(fK(n)&&(n=n.host);pK(n)&&["html","body"].indexOf(cK(n))<0;){var i=EK(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function OK(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function MK(e,t,n){return _K(e,yK(t,n))}function kK(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function RK(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var NK={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=gK(n.placement),l=OK(a),u=[eK,Jq].indexOf(a)>=0?"height":"width";if(s&&o){var c=function(e,t){return kK("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:RK(e,nK))}(r.padding,n),d=TK(s),h="y"===l?Zq:eK,p="y"===l?Qq:Jq,f=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],m=o[l]-n.rects.reference[l],g=CK(s),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=f/2-m/2,v=c[h],b=_-d[u]-c[p],T=_/2-d[u]/2+y,x=MK(v,T,b),E=l;n.modifiersData[i]=((t={})[E]=x,t.centerOffset=x-T,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"==typeof i&&!(i=t.elements.popper.querySelector(i))||!xK(t.elements.popper,i)||(t.elements.arrow=i))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function DK(e){return e.split("-")[1]}var FK={top:"auto",right:"auto",bottom:"auto",left:"auto"};function LK(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,o=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,h=o.x,p=void 0===h?0:h,f=o.y,m=void 0===f?0:f,g="function"==typeof c?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var _=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),v=eK,b=Zq,T=window;if(u){var x=CK(n),E="clientHeight",w="clientWidth";if(x===dK(n)&&("static"!==EK(x=IK(n)).position&&"absolute"===a&&(E="scrollHeight",w="scrollWidth")),r===Zq||(r===eK||r===Jq)&&s===rK)b=Qq,m-=(d&&x===T&&T.visualViewport?T.visualViewport.height:x[E])-i.height,m*=l?1:-1;if(r===eK||(r===Zq||r===Qq)&&s===rK)v=Jq,p-=(d&&x===T&&T.visualViewport?T.visualViewport.width:x[w])-i.width,p*=l?1:-1}var I,A=Object.assign({position:a},u&&FK),S=!0===c?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:vK(t*i)/i||0,y:vK(n*i)/i||0}}({x:p,y:m}):{x:p,y:m};return p=S.x,m=S.y,l?Object.assign({},A,((I={})[b]=y?"0":"",I[v]=_?"0":"",I.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",I)):Object.assign({},A,((t={})[b]=y?m+"px":"",t[v]=_?p+"px":"",t.transform="",t))}var PK={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,l=void 0===a||a,u={placement:gK(t.placement),variation:DK(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,LK(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,LK(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},BK={passive:!0};var $K={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=void 0===r||r,o=i.resize,a=void 0===o||o,l=dK(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach(function(e){e.addEventListener("scroll",n.update,BK)}),a&&l.addEventListener("resize",n.update,BK),function(){s&&u.forEach(function(e){e.removeEventListener("scroll",n.update,BK)}),a&&l.removeEventListener("resize",n.update,BK)}},data:{}},UK={left:"right",right:"left",bottom:"top",top:"bottom"};function VK(e){return e.replace(/left|right|bottom|top/g,function(e){return UK[e]})}var zK={start:"end",end:"start"};function jK(e){return e.replace(/start|end/g,function(e){return zK[e]})}function YK(e){var t=dK(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function GK(e){return bK(IK(e)).left+YK(e).scrollLeft}function HK(e){var t=EK(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function WK(e){return["html","body","#document"].indexOf(cK(e))>=0?e.ownerDocument.body:pK(e)&&HK(e)?e:WK(AK(e))}function XK(e,t){var n;void 0===t&&(t=[]);var i=WK(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),s=dK(i),o=r?[s].concat(s.visualViewport||[],HK(i)?i:[]):i,a=t.concat(o);return r?a:a.concat(XK(AK(o)))}function qK(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function KK(e,t){return t===sK?qK(function(e){var t=dK(e),n=IK(e),i=t.visualViewport,r=n.clientWidth,s=n.clientHeight,o=0,a=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:r,height:s,x:o+GK(e),y:a}}(e)):hK(t)?function(e){var t=bK(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):qK(function(e){var t,n=IK(e),i=YK(e),r=null==(t=e.ownerDocument)?void 0:t.body,s=_K(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=_K(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+GK(e),l=-i.scrollTop;return"rtl"===EK(r||n).direction&&(a+=_K(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(IK(e)))}function ZK(e,t,n){var i="clippingParents"===t?function(e){var t=XK(AK(e)),n=["absolute","fixed"].indexOf(EK(e).position)>=0&&pK(e)?CK(e):e;return hK(n)?t.filter(function(e){return hK(e)&&xK(e,n)&&"body"!==cK(e)}):[]}(e):[].concat(t),r=[].concat(i,[n]),s=r[0],o=r.reduce(function(t,n){var i=KK(e,n);return t.top=_K(i.top,t.top),t.right=yK(i.right,t.right),t.bottom=yK(i.bottom,t.bottom),t.left=_K(i.left,t.left),t},KK(e,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function QK(e){var t,n=e.reference,i=e.element,r=e.placement,s=r?gK(r):null,o=r?DK(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(s){case Zq:t={x:a,y:n.y-i.height};break;case Qq:t={x:a,y:n.y+n.height};break;case Jq:t={x:n.x+n.width,y:l};break;case eK:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var u=s?OK(s):null;if(null!=u){var c="y"===u?"height":"width";switch(o){case iK:t[u]=t[u]-(n[c]/2-i[c]/2);break;case rK:t[u]=t[u]+(n[c]/2-i[c]/2)}}return t}function JK(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,l=void 0===a?sK:a,u=n.elementContext,c=void 0===u?oK:u,d=n.altBoundary,h=void 0!==d&&d,p=n.padding,f=void 0===p?0:p,m=kK("number"!=typeof f?f:RK(f,nK)),g=c===oK?"reference":oK,_=e.rects.popper,y=e.elements[h?g:c],v=ZK(hK(y)?y:y.contextElement||IK(e.elements.popper),o,l),b=bK(e.elements.reference),T=QK({reference:b,element:_,strategy:"absolute",placement:r}),x=qK(Object.assign({},_,T)),E=c===oK?x:b,w={top:v.top-E.top+m.top,bottom:E.bottom-v.bottom+m.bottom,left:v.left-E.left+m.left,right:E.right-v.right+m.right},I=e.modifiersData.offset;if(c===oK&&I){var A=I[r];Object.keys(w).forEach(function(e){var t=[Jq,Qq].indexOf(e)>=0?1:-1,n=[Zq,Qq].indexOf(e)>=0?"y":"x";w[e]+=A[n]*t})}return w}var eZ={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0===o||o,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,f=void 0===p||p,m=n.allowedAutoPlacements,g=t.options.placement,_=gK(g),y=l||(_===g||!f?[VK(g)]:function(e){if(gK(e)===tK)return[];var t=VK(e);return[jK(e),t,jK(t)]}(g)),v=[g].concat(y).reduce(function(e,n){return e.concat(gK(n)===tK?function(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?lK:l,c=DK(i),d=c?a?aK:aK.filter(function(e){return DK(e)===c}):nK,h=d.filter(function(e){return u.indexOf(e)>=0});0===h.length&&(h=d);var p=h.reduce(function(t,n){return t[n]=JK(e,{placement:n,boundary:r,rootBoundary:s,padding:o})[gK(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):n)},[]),b=t.rects.reference,T=t.rects.popper,x=new Map,E=!0,w=v[0],I=0;I<v.length;I++){var A=v[I],S=gK(A),C=DK(A)===iK,O=[Zq,Qq].indexOf(S)>=0,M=O?"width":"height",k=JK(t,{placement:A,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),R=O?C?Jq:eK:C?Qq:Zq;b[M]>T[M]&&(R=VK(R));var N=VK(R),D=[];if(s&&D.push(k[S]<=0),a&&D.push(k[R]<=0,k[N]<=0),D.every(function(e){return e})){w=A,E=!1;break}x.set(A,D)}if(E)for(var F=function(e){var t=v.find(function(t){var n=x.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,"break"},L=f?3:1;L>0;L--){if("break"===F(L))break}t.placement!==w&&(t.modifiersData[i]._skip=!0,t.placement=w,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function tZ(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function nZ(e){return[Zq,Jq,Qq,eK].some(function(t){return e[t]>=0})}var iZ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=JK(t,{elementContext:"reference"}),a=JK(t,{altBoundary:!0}),l=tZ(o,i),u=tZ(a,r,s),c=nZ(l),d=nZ(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var rZ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=void 0===r?[0,0]:r,o=lK.reduce(function(e,n){return e[n]=function(e,t,n){var i=gK(e),r=[eK,Zq].indexOf(i)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[eK,Jq].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,s),e},{}),a=o[t.placement],l=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=o}};var sZ={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=QK({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var oZ={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0!==o&&o,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,h=n.tether,p=void 0===h||h,f=n.tetherOffset,m=void 0===f?0:f,g=JK(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),_=gK(t.placement),y=DK(t.placement),v=!y,b=OK(_),T=function(e){return"x"===e?"y":"x"}(b),x=t.modifiersData.popperOffsets,E=t.rects.reference,w=t.rects.popper,I="function"==typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,A="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(x){if(s){var O,M="y"===b?Zq:eK,k="y"===b?Qq:Jq,R="y"===b?"height":"width",N=x[b],D=N+g[M],F=N-g[k],L=p?-w[R]/2:0,P=y===iK?E[R]:w[R],B=y===iK?-w[R]:-E[R],$=t.elements.arrow,U=p&&$?TK($):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=V[M],j=V[k],Y=MK(0,E[R],U[R]),G=v?E[R]/2-L-Y-z-A.mainAxis:P-Y-z-A.mainAxis,H=v?-E[R]/2+L+Y+j+A.mainAxis:B+Y+j+A.mainAxis,W=t.elements.arrow&&CK(t.elements.arrow),X=W?"y"===b?W.clientTop||0:W.clientLeft||0:0,q=null!=(O=null==S?void 0:S[b])?O:0,K=N+H-q,Z=MK(p?yK(D,N+G-q-X):D,N,p?_K(F,K):F);x[b]=Z,C[b]=Z-N}if(a){var Q,J="x"===b?Zq:eK,ee="x"===b?Qq:Jq,te=x[T],ne="y"===T?"height":"width",ie=te+g[J],re=te-g[ee],se=-1!==[Zq,eK].indexOf(_),oe=null!=(Q=null==S?void 0:S[T])?Q:0,ae=se?ie:te-E[ne]-w[ne]-oe+A.altAxis,le=se?te+E[ne]+w[ne]-oe-A.altAxis:re,ue=p&&se?function(e,t,n){var i=MK(e,t,n);return i>n?n:i}(ae,te,le):MK(p?ae:ie,te,p?le:re);x[T]=ue,C[T]=ue-te}t.modifiersData[i]=C}},requiresIfExists:["offset"]};function aZ(e,t,n){void 0===n&&(n=!1);var i=pK(t),r=pK(t)&&function(e){var t=e.getBoundingClientRect(),n=vK(t.width)/e.offsetWidth||1,i=vK(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),s=IK(t),o=bK(e,r),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!n)&&(("body"!==cK(t)||HK(s))&&(a=function(e){return e!==dK(e)&&pK(e)?function(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}(e):YK(e)}(t)),pK(t)?((l=bK(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=GK(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function lZ(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}}),i.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){n.has(e.name)||r(e)}),i}function uZ(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}var cZ={placement:"bottom",modifiers:[],strategy:"absolute"};function dZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function hZ(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,r=t.defaultOptions,s=void 0===r?cZ:r;return function(e,t,n){void 0===n&&(n=s);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},cZ,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],a=!1,l={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;u(),r.options=Object.assign({},s,r.options,a),r.scrollParents={reference:hK(e)?XK(e):e.contextElement?XK(e.contextElement):[],popper:XK(t)};var c=function(e){var t=lZ(e);return uK.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}(function(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}([].concat(i,r.options.modifiers)));return r.orderedModifiers=c.filter(function(e){return e.enabled}),r.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,i=void 0===n?{}:n,s=e.effect;if("function"==typeof s){var a=s({state:r,name:t,instance:l,options:i}),u=function(){};o.push(a||u)}}),l.update()},forceUpdate:function(){if(!a){var e=r.elements,t=e.reference,n=e.popper;if(dZ(t,n)){r.rects={reference:aZ(t,CK(n),"fixed"===r.options.strategy),popper:TK(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(e){return r.modifiersData[e.name]=Object.assign({},e.data)});for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var s=r.orderedModifiers[i],o=s.fn,u=s.options,c=void 0===u?{}:u,d=s.name;"function"==typeof o&&(r=o({state:r,options:c,name:d,instance:l})||r)}else r.reset=!1,i=-1}}},update:uZ(function(){return new Promise(function(e){l.forceUpdate(),e(r)})}),destroy:function(){u(),a=!0}};if(!dZ(e,t))return l;function u(){o.forEach(function(e){return e()}),o=[]}return l.setOptions(n).then(function(e){!a&&n.onFirstUpdate&&n.onFirstUpdate(e)}),l}}hZ(),hZ({defaultModifiers:[$K,sZ,PK,mK]});var pZ=hZ({defaultModifiers:[$K,sZ,PK,mK,rZ,eZ,oZ,NK,iZ]});const fZ=hG({arrowOffset:{type:Number,default:5}}),mZ=hG({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Array,default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:lK,default:"bottom"},popperOptions:{type:Object,default:()=>({})},strategy:{type:String,values:["fixed","absolute"],default:"absolute"}}),gZ=hG({...mZ,...fZ,id:String,style:{type:[String,Array,Object]},className:{type:[String,Array,Object]},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:[String,Array,Object]},popperStyle:{type:[String,Array,Object]},referenceEl:{type:Object},triggerTargetEl:{type:Object},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Oq(["ariaLabel"])}),_Z={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},yZ=hG({to:{type:[String,Object],required:!0},disabled:Boolean});function vZ(){let e;const t=()=>window.clearTimeout(e);return wj(()=>t()),{registerTimeout:(n,i)=>{t(),e=window.setTimeout(n,i)},cancelTimeout:t}}const bZ=hG({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),TZ=hG({...bZ,...gZ,appendTo:{type:yZ.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Boolean,default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Oq(["ariaLabel"])}),xZ=hG({virtualRef:{type:Object},virtualTriggering:Boolean,onMouseenter:{type:Function},onMouseleave:{type:Function},onClick:{type:Function},onKeydown:{type:Function},onFocus:{type:Function},onBlur:{type:Function},onContextmenu:{type:Function},id:String,open:Boolean}),EZ=hG({...xZ,disabled:Boolean,trigger:{type:[String,Array],default:"hover"},triggerKeys:{type:Array,default:()=>[dW.enter,dW.numpadEnter,dW.space]},focusOnTarget:Boolean}),wZ=dG({type:Boolean,default:null}),IZ=dG({type:Function}),AZ=e=>{const t=`update:${e}`,n=`onUpdate:${e}`,i=[t];return{useModelToggle:({indicator:i,toggleReason:r,shouldHideWhenRouteChanges:s,shouldProceed:o,onShow:a,onHide:l})=>{const u=$M(),{emit:c}=u,d=u.props,h=ak(()=>Kx(d[n])),p=ak(()=>null===d[e]),f=e=>{!0!==i.value&&(i.value=!0,r&&(r.value=e),Kx(a)&&a(e))},m=e=>{!1!==i.value&&(i.value=!1,r&&(r.value=e),Kx(l)&&l(e))},g=e=>{if(!0===d.disabled||Kx(o)&&!o())return;const n=h.value&&_j;n&&c(t,!0),!p.value&&n||f(e)},_=e=>{if(!0===d.disabled||!_j)return;const n=h.value&&_j;n&&c(t,!1),!p.value&&n||m(e)},y=e=>{sj(e)&&(d.disabled&&e?h.value&&c(t,!1):i.value!==e&&(e?f():m()))};return DO(()=>d[e],y),s&&void 0!==u.appContext.config.globalProperties.$route&&DO(()=>({...u.proxy.$route}),()=>{s.value&&i.value&&_()}),KS(()=>{y(d[e])}),{hide:_,show:g,toggle:()=>{i.value?_():g()},hasUpdateHandler:h}},useModelToggleProps:{[e]:wZ,[n]:IZ},useModelToggleEmits:i}},{useModelToggle:SZ,useModelToggleProps:CZ,useModelToggleEmits:OZ}=AZ("modelValue"),{useModelToggleProps:MZ,useModelToggleEmits:kZ,useModelToggle:RZ}=AZ("visible"),NZ=hG({...Wq,...MZ,...TZ,...EZ,...fZ,showArrow:{type:Boolean,default:!0}}),DZ=[...kZ,"before-show","before-hide","show","hide","open","close"],FZ=(e,t,n)=>i=>{((e,t)=>Hx(e)?e.includes(t):e===t)(CI(e),t)&&n(i)},LZ=Symbol("elForwardRef"),PZ=dS({name:"ElOnlyChild",setup(e,{slots:t,attrs:n}){var i;const r=tO(LZ),s=(o=null!=(i=null==r?void 0:r.setForwardRef)?i:Bx,{mounted(e){o(e)},updated(e){o(e)},unmounted(){o(null)}});var o;return()=>{var e;const i=null==(e=t.default)?void 0:e.call(t,n);if(!i)return null;const[r,o]=BZ(i);return r?PA(AM(r,n),[[s]]):null}}});function BZ(e){if(!e)return[null,0];const t=e,n=t.filter(e=>e.type!==sM).length;for(const e of t){if(Jx(e))switch(e.type){case sM:continue;case rM:case"svg":return[$Z(e),n];case iM:return BZ(e.children);default:return[e,n]}return[$Z(e),n]}return[null,0]}function $Z(e){const t=ij("only-child");return EM("span",{class:t.e("content")},[e])}const UZ=dS({name:"ElPopperTrigger",inheritAttrs:!1}),VZ=dS({...UZ,props:xZ,setup(e,{expose:t}){const n=e,{role:i,triggerRef:r}=tO(Yq,void 0);var s;s=r,eO(LZ,{setForwardRef:e=>{s.value=e}});const o=ak(()=>l.value?n.id:void 0),a=ak(()=>{if(i&&"tooltip"===i.value)return n.open&&n.id?n.id:void 0}),l=ak(()=>{if(i&&"tooltip"!==i.value)return i.value}),u=ak(()=>l.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return KS(()=>{DO(()=>n.virtualRef,e=>{e&&(r.value=wH(e))},{immediate:!0}),DO(r,(e,t)=>{null==c||c(),c=void 0,aj(e)&&(d.forEach(i=>{var r;const s=n[i];s&&(e.addEventListener(i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)),null==(r=null==t?void 0:t.removeEventListener)||r.call(t,i.slice(2).toLowerCase(),s,["onFocus","onBlur"].includes(i)))}),$q(e)&&(c=DO([o,a,l,u],t=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((n,i)=>{VX(t[i])?e.removeAttribute(n):e.setAttribute(n,t[i])})},{immediate:!0}))),aj(t)&&$q(t)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(e=>t.removeAttribute(e))},{immediate:!0})}),JS(()=>{if(null==c||c(),c=void 0,r.value&&aj(r.value)){const e=r.value;d.forEach(t=>{const i=n[t];i&&e.removeEventListener(t.slice(2).toLowerCase(),i,["onFocus","onBlur"].includes(t))}),r.value=void 0}}),t({triggerRef:r}),(e,t)=>e.virtualTriggering?OM("v-if",!0):(uM(),gM(CI(PZ),NM({key:0},e.$attrs,{"aria-controls":CI(o),"aria-describedby":CI(a),"aria-expanded":CI(u),"aria-haspopup":CI(l)}),{default:LA(()=>[mC(e.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var zZ=HH(VZ,[["__file","trigger.vue"]]);const jZ=(e,t,{checkForDefaultPrevented:n=!0}={})=>i=>{const r=null==e?void 0:e(i);if(!1===n||!r)return null==t?void 0:t(i)},YZ=e=>t=>"mouse"===t.pointerType?e(t):void 0,GZ=dS({name:"ElTooltipTrigger"}),HZ=dS({...GZ,props:EZ,setup(e,{expose:t}){const n=e,i=ij("tooltip"),{controlled:r,id:s,open:o,onOpen:a,onClose:l,onToggle:u}=tO(Kq,void 0),c=EI(null),d=()=>{if(CI(r)||n.disabled)return!0},h=PI(n,"trigger"),p=jZ(d,FZ(h,"hover",e=>{a(e),n.focusOnTarget&&e.target&&hA(()=>{Uq(e.target,{preventScroll:!0})})})),f=jZ(d,FZ(h,"hover",l)),m=jZ(d,FZ(h,"click",e=>{0===e.button&&u(e)})),g=jZ(d,FZ(h,"focus",a)),_=jZ(d,FZ(h,"focus",l)),y=jZ(d,FZ(h,"contextmenu",e=>{e.preventDefault(),u(e)})),v=jZ(d,e=>{const{code:t}=e;n.triggerKeys.includes(t)&&(e.preventDefault(),u(e))});return t({triggerRef:c}),(e,t)=>(uM(),gM(CI(zZ),{id:CI(s),"virtual-ref":e.virtualRef,open:CI(o),"virtual-triggering":e.virtualTriggering,class:CE(CI(i).e("trigger")),onBlur:CI(_),onClick:CI(m),onContextmenu:CI(y),onFocus:CI(g),onMouseenter:CI(p),onMouseleave:CI(f),onKeydown:CI(v)},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var WZ=HH(HZ,[["__file","trigger.vue"]]);const XZ=AG(HH(dS({__name:"teleport",props:yZ,setup:e=>(e,t)=>e.disabled?mC(e.$slots,"default",{key:0}):(uM(),gM(XA,{key:1,to:e.to},[mC(e.$slots,"default")],8,["to"]))}),[["__file","teleport.vue"]])),qZ=()=>{const e=nj(),t=XW(),n=ak(()=>`${e.value}-popper-container-${t.prefix}`),i=ak(()=>`#${n.value}`);return{id:n,selector:i}},KZ=()=>{const{id:e,selector:t}=qZ();return qS(()=>{_j&&(document.body.querySelector(t.value)||(e=>{const t=document.createElement("div");t.id=e,document.body.appendChild(t)})(e.value))}),{id:e,selector:t}},ZZ="focus-trap.focus-after-trapped",QZ="focus-trap.focus-after-released",JZ={cancelable:!0,bubbles:!1},eQ={cancelable:!0,bubbles:!1},tQ="focusAfterTrapped",nQ="focusAfterReleased",iQ=Symbol("elFocusTrap"),rQ=EI(),sQ=EI(0),oQ=EI(0);let aQ=0;const lQ=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},uQ=(e,t)=>{for(const n of e)if(!cQ(n,t))return n},cQ=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},dQ=(e,t)=>{if(e){const n=document.activeElement;Uq(e,{preventScroll:!0}),oQ.value=window.performance.now(),e!==n&&(e=>e instanceof HTMLInputElement&&"select"in e)(e)&&t&&e.select()}};function hQ(e,t){const n=[...e],i=e.indexOf(t);return-1!==i&&n.splice(i,1),n}const pQ=(()=>{let e=[];return{push:t=>{const n=e[0];n&&t!==n&&n.pause(),e=hQ(e,t),e.unshift(t)},remove:t=>{var n,i;e=hQ(e,t),null==(i=null==(n=e[0])?void 0:n.resume)||i.call(n)}}})(),fQ=()=>{rQ.value="pointer",sQ.value=window.performance.now()},mQ=()=>{rQ.value="keyboard",sQ.value=window.performance.now()},gQ=()=>(KS(()=>{0===aQ&&(document.addEventListener("mousedown",fQ),document.addEventListener("touchstart",fQ),document.addEventListener("keydown",mQ)),aQ++}),JS(()=>{aQ--,aQ<=0&&(document.removeEventListener("mousedown",fQ),document.removeEventListener("touchstart",fQ),document.removeEventListener("keydown",mQ))}),{focusReason:rQ,lastUserFocusTimestamp:sQ,lastAutomatedFocusTimestamp:oQ}),_Q=e=>new CustomEvent("focus-trap.focusout-prevented",{...eQ,detail:e});let yQ=[];const vQ=e=>{e.code===dW.esc&&yQ.forEach(t=>t(e))},bQ=dS({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[tQ,nQ,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=EI();let i,r;const{focusReason:s}=gQ();var o;o=n=>{e.trapped&&!a.paused&&t("release-requested",n)},KS(()=>{0===yQ.length&&document.addEventListener("keydown",vQ),_j&&yQ.push(o)}),JS(()=>{yQ=yQ.filter(e=>e!==o),0===yQ.length&&_j&&document.removeEventListener("keydown",vQ)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{code:i,altKey:r,ctrlKey:o,metaKey:l,currentTarget:u,shiftKey:c}=n,{loop:d}=e,h=i===dW.tab&&!r&&!o&&!l,p=document.activeElement;if(h&&p){const e=u,[i,r]=(e=>{const t=lQ(e);return[uQ(t,e),uQ(t.reverse(),e)]})(e);if(i&&r)if(c||p!==r){if(c&&[i,e].includes(p)){const e=_Q({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&dQ(r,!0))}}else{const e=_Q({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&dQ(i,!0))}else if(p===e){const e=_Q({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};eO(iQ,{focusTrapRef:n,onKeydown:l}),DO(()=>e.focusTrapEl,e=>{e&&(n.value=e)},{immediate:!0}),DO([n],([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",d),e.addEventListener("focusout",h)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",d),t.removeEventListener("focusout",h))});const u=e=>{t(tQ,e)},c=e=>t(nQ,e),d=s=>{const o=CI(n);if(!o)return;const l=s.target,u=s.relatedTarget,c=l&&o.contains(l);if(!e.trapped){u&&o.contains(u)||(i=u)}c&&t("focusin",s),a.paused||e.trapped&&(c?r=l:dQ(r,!0))},h=i=>{const o=CI(n);if(!a.paused&&o)if(e.trapped){const n=i.relatedTarget;VX(n)||o.contains(n)||setTimeout(()=>{if(!a.paused&&e.trapped){const e=_Q({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||dQ(r,!0)}},0)}else{const e=i.target;e&&o.contains(e)||t("focusout",i)}};async function p(){await hA();const t=CI(n);if(t){pQ.push(a);const n=t.contains(document.activeElement)?i:document.activeElement;i=n;if(!t.contains(n)){const i=new Event(ZZ,JZ);t.addEventListener(ZZ,u),t.dispatchEvent(i),i.defaultPrevented||hA(()=>{let i=e.focusStartEl;Zx(i)||(dQ(i),document.activeElement!==i&&(i="first")),"first"===i&&((e,t=!1)=>{const n=document.activeElement;for(const i of e)if(dQ(i,t),document.activeElement!==n)return})(lQ(t),!0),document.activeElement!==n&&"container"!==i||dQ(t)})}}}function f(){const e=CI(n);if(e){e.removeEventListener(ZZ,u);const t=new CustomEvent(QZ,{...JZ,detail:{focusReason:s.value}});e.addEventListener(QZ,c),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=s.value&&sQ.value>oQ.value&&!e.contains(document.activeElement)||dQ(null!=i?i:document.body),e.removeEventListener(QZ,c),pQ.remove(a),i=null,r=null}}return KS(()=>{e.trapped&&p(),DO(()=>e.trapped,e=>{e?p():f()})}),JS(()=>{e.trapped&&f(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",h),n.value=void 0)}),{onKeydown:l}}});var TQ=HH(bQ,[["render",function(e,t,n,i,r,s){return mC(e.$slots,"default",{handleKeydown:e.onKeydown})}],["__file","focus-trap.vue"]]);const xQ=function(e){return void 0===e},EQ=(e,t=[])=>{const{placement:n,strategy:i,popperOptions:r}=e,s={placement:n,strategy:i,...r,modifiers:[...wQ(e),...t]};return function(e,t){t&&(e.modifiers=[...e.modifiers,...null!=t?t:[]])}(s,null==r?void 0:r.modifiers),s};function wQ(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:i}=e;return[{name:"offset",options:{offset:[0,null!=t?t:12]}},{name:"preventOverflow",options:{padding:{top:0,bottom:0,left:0,right:0}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:n}}]}const IQ=(e,t,n={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:e})=>{const t=function(e){const t=Object.keys(e.elements),n=uG(t.map(t=>[t,e.styles[t]||{}])),i=uG(t.map(t=>[t,e.attributes[t]]));return{styles:n,attributes:i}}(e);Object.assign(o.value,t)},requires:["computeStyles"]},r=ak(()=>{const{onFirstUpdate:e,placement:t,strategy:r,modifiers:s}=CI(n);return{onFirstUpdate:e,placement:t||"bottom",strategy:r||"absolute",modifiers:[...s||[],i,{name:"applyStyles",enabled:!1}]}}),s=wI(),o=EI({styles:{popper:{position:CI(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return DO(r,e=>{const t=CI(s);t&&t.setOptions(e)},{deep:!0}),DO([e,t],([e,t])=>{a(),e&&t&&(s.value=pZ(e,t,CI(r)))}),JS(()=>{a()}),{state:ak(()=>{var e;return{...(null==(e=CI(s))?void 0:e.state)||{}}}),styles:ak(()=>CI(o).styles),attributes:ak(()=>CI(o).attributes),update:()=>{var e;return null==(e=CI(s))?void 0:e.update()},forceUpdate:()=>{var e;return null==(e=CI(s))?void 0:e.forceUpdate()},instanceRef:ak(()=>CI(s))}};const AQ=e=>{const{popperInstanceRef:t,contentRef:n,triggerRef:i,role:r}=tO(Yq,void 0),s=EI(),o=ak(()=>e.arrowOffset),a=ak(()=>({name:"eventListeners",enabled:!!e.visible})),l=ak(()=>{var e;const t=CI(s),n=null!=(e=CI(o))?e:0;return{name:"arrow",enabled:!xQ(t),options:{element:t,padding:n}}}),u=ak(()=>({onFirstUpdate:()=>{f()},...EQ(e,[CI(l),CI(a)])})),c=ak(()=>(e=>{if(_j)return wH(e)})(e.referenceEl)||CI(i)),{attributes:d,state:h,styles:p,update:f,forceUpdate:m,instanceRef:g}=IQ(c,n,u);return DO(g,e=>t.value=e,{flush:"sync"}),KS(()=>{DO(()=>{var e,t;return null==(t=null==(e=CI(c))?void 0:e.getBoundingClientRect)?void 0:t.call(e)},()=>{f()})}),{attributes:d,arrowRef:s,contentRef:n,instanceRef:g,state:h,styles:p,role:r,forceUpdate:m,update:f}},SQ=dS({name:"ElPopperContent"}),CQ=dS({...SQ,props:gZ,emits:_Z,setup(e,{expose:t,emit:n}){const i=e,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:a,onFocusInTrap:l,onFocusoutPrevented:u,onReleaseRequested:c}=((e,t)=>{const n=EI(!1),i=EI();return{focusStartRef:i,trapped:n,onFocusAfterReleased:e=>{var n;"pointer"!==(null==(n=e.detail)?void 0:n.focusReason)&&(i.value="first",t("blur"))},onFocusAfterTrapped:()=>{t("focus")},onFocusInTrap:t=>{e.visible&&!n.value&&(t.target&&(i.value=t.target),n.value=!0)},onFocusoutPrevented:t=>{e.trapping||("pointer"===t.detail.focusReason&&t.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,t("close")}}})(i,n),{attributes:d,arrowRef:h,contentRef:p,styles:f,instanceRef:m,role:g,update:_}=AQ(i),{ariaModal:y,arrowStyle:v,contentAttrs:b,contentClass:T,contentStyle:x,updateZIndex:E}=((e,{attributes:t,styles:n,role:i})=>{const{nextZIndex:r}=kj(),s=ij("popper"),o=ak(()=>CI(t).popper),a=EI(oj(e.zIndex)?e.zIndex:r()),l=ak(()=>[s.b(),s.is("pure",e.pure),s.is(e.effect),e.popperClass]),u=ak(()=>[{zIndex:CI(a)},CI(n).popper,e.popperStyle||{}]);return{ariaModal:ak(()=>"dialog"===i.value?"false":void 0),arrowStyle:ak(()=>CI(n).arrow||{}),contentAttrs:o,contentClass:l,contentStyle:u,contentZIndex:a,updateZIndex:()=>{a.value=oj(e.zIndex)?e.zIndex:r()}}})(i,{styles:f,attributes:d,role:g}),w=tO(ZW,void 0);let I;eO(Gq,{arrowStyle:v,arrowRef:h}),w&&eO(ZW,{...w,addInputId:Bx,removeInputId:Bx});const A=(e=!0)=>{_(),e&&E()},S=()=>{A(!1),i.visible&&i.focusOnShow?s.value=!0:!1===i.visible&&(s.value=!1)};return KS(()=>{DO(()=>i.triggerTargetEl,(e,t)=>{null==I||I(),I=void 0;const n=CI(e||p.value),r=CI(t||p.value);aj(n)&&(I=DO([g,()=>i.ariaLabel,y,()=>i.id],e=>{["role","aria-label","aria-modal","id"].forEach((t,i)=>{VX(e[i])?n.removeAttribute(t):n.setAttribute(t,e[i])})},{immediate:!0})),r!==n&&aj(r)&&["role","aria-label","aria-modal","id"].forEach(e=>{r.removeAttribute(e)})},{immediate:!0}),DO(()=>i.visible,S,{immediate:!0})}),JS(()=>{null==I||I(),I=void 0}),t({popperContentRef:p,popperInstanceRef:m,updatePopper:A,contentStyle:x}),(e,t)=>(uM(),mM("div",NM({ref_key:"contentRef",ref:p},CI(b),{style:CI(x),class:CI(T),tabindex:"-1",onMouseenter:t=>e.$emit("mouseenter",t),onMouseleave:t=>e.$emit("mouseleave",t)}),[EM(CI(TQ),{trapped:CI(s),"trap-on-focus-in":!0,"focus-trap-el":CI(p),"focus-start-el":CI(r),onFocusAfterTrapped:CI(a),onFocusAfterReleased:CI(o),onFocusin:CI(l),onFocusoutPrevented:CI(u),onReleaseRequested:CI(c)},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var OQ=HH(CQ,[["__file","content.vue"]]);const MQ=dS({name:"ElTooltipContent",inheritAttrs:!1}),kQ=dS({...MQ,props:TZ,setup(e,{expose:t}){const n=e,{selector:i}=qZ(),r=ij("tooltip"),s=EI(),o=gj(()=>{var e;return null==(e=s.value)?void 0:e.popperContentRef});let a;const{controlled:l,id:u,open:c,trigger:d,onClose:h,onOpen:p,onShow:f,onHide:m,onBeforeShow:g,onBeforeHide:_}=tO(Kq,void 0),y=ak(()=>n.transition||`${r.namespace.value}-fade-in-linear`),v=ak(()=>n.persistent);JS(()=>{null==a||a()});const b=ak(()=>!!CI(v)||CI(c)),T=ak(()=>!n.disabled&&CI(c)),x=ak(()=>n.appendTo||i.value),E=ak(()=>{var e;return null!=(e=n.style)?e:{}}),w=EI(!0),I=()=>{m(),N()&&Uq(document.body,{preventScroll:!0}),w.value=!0},A=()=>{if(CI(l))return!0},S=jZ(A,()=>{n.enterable&&"hover"===CI(d)&&p()}),C=jZ(A,()=>{"hover"===CI(d)&&h()}),O=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e),null==g||g()},M=()=>{null==_||_()},k=()=>{f()},R=()=>{n.virtualTriggering||h()},N=e=>{var t;const n=null==(t=s.value)?void 0:t.popperContentRef,i=(null==e?void 0:e.relatedTarget)||document.activeElement;return null==n?void 0:n.contains(i)};return DO(()=>CI(c),e=>{e?(w.value=!1,a=function(e,t,n={}){const{window:i=IH,ignore:r=[],capture:s=!0,detectIframe:o=!1}=n;if(!i)return;bj&&!SH&&(SH=!0,Array.from(i.document.body.children).forEach(e=>e.addEventListener("click",vj)));let a=!0;const l=e=>r.some(t=>{if("string"==typeof t)return Array.from(i.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{const n=wH(t);return n&&(e.target===n||e.composedPath().includes(n))}}),u=[AH(i,"click",n=>{const i=wH(e);i&&i!==n.target&&!n.composedPath().includes(i)&&(0===n.detail&&(a=!l(n)),a?t(n):a=!0)},{passive:!0,capture:s}),AH(i,"pointerdown",t=>{const n=wH(e);n&&(a=!t.composedPath().includes(n)&&!l(t))},{passive:!0}),o&&AH(i,"blur",n=>{var r;const s=wH(e);"IFRAME"!==(null==(r=i.document.activeElement)?void 0:r.tagName)||(null==s?void 0:s.contains(i.document.activeElement))||t(n)})].filter(Boolean);return()=>u.forEach(e=>e())}(o,()=>{if(CI(l))return;var e;(e=CI(d),e||0===e?Hx(e)?e:[e]:[]).every(e=>"hover"!==e&&"focus"!==e)&&h()})):null==a||a()},{flush:"post"}),DO(()=>n.content,()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e)}),t({contentRef:s,isFocusInsideContent:N}),(e,t)=>(uM(),gM(CI(XZ),{disabled:!e.teleported,to:CI(x)},{default:LA(()=>[CI(b)||!w.value?(uM(),gM(Rk,{key:0,name:CI(y),appear:!CI(v),onAfterLeave:I,onBeforeEnter:O,onAfterEnter:k,onBeforeLeave:M,persisted:""},{default:LA(()=>[PA(EM(CI(OQ),NM({id:CI(u),ref_key:"contentRef",ref:s},e.$attrs,{"aria-label":e.ariaLabel,"aria-hidden":w.value,"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,CI(E)],"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,visible:CI(T),"z-index":e.zIndex,onMouseenter:CI(S),onMouseleave:CI(C),onBlur:R,onClose:CI(h)}),{default:LA(()=>[mC(e.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"]),[[Xk,CI(T)]])]),_:3},8,["name","appear"])):OM("v-if",!0)]),_:3},8,["disabled","to"]))}});var RQ=HH(kQ,[["__file","content.vue"]]);const NQ=dS({name:"ElPopperArrow",inheritAttrs:!1});var DQ=HH(dS({...NQ,setup(e,{expose:t}){const n=ij("popper"),{arrowRef:i,arrowStyle:r}=tO(Gq,void 0);return JS(()=>{i.value=void 0}),t({arrowRef:i}),(e,t)=>(uM(),mM("span",{ref_key:"arrowRef",ref:i,class:CE(CI(n).e("arrow")),style:EE(CI(r)),"data-popper-arrow":""},null,6))}}),[["__file","arrow.vue"]]);const FQ=dS({name:"ElTooltip"}),LQ=dS({...FQ,props:NZ,emits:DZ,setup(e,{expose:t,emit:n}){const i=e;KZ();const r=ij("tooltip"),s=qW(),o=EI(),a=EI(),l=()=>{var e;const t=CI(o);t&&(null==(e=t.popperInstanceRef)||e.update())},u=EI(!1),c=EI(),{show:d,hide:h,hasUpdateHandler:p}=RZ({indicator:u,toggleReason:c}),{onOpen:f,onClose:m}=(({showAfter:e,hideAfter:t,autoClose:n,open:i,close:r})=>{const{registerTimeout:s}=vZ(),{registerTimeout:o,cancelTimeout:a}=vZ();return{onOpen:(t,a=CI(e))=>{s(()=>{i(t);const e=CI(n);oj(e)&&e>0&&o(()=>{r(t)},e)},a)},onClose:(e,n=CI(t))=>{a(),s(()=>{r(e)},n)}}})({showAfter:PI(i,"showAfter"),hideAfter:PI(i,"hideAfter"),autoClose:PI(i,"autoClose"),open:d,close:h}),g=ak(()=>sj(i.visible)&&!p.value),_=ak(()=>[r.b(),i.popperClass]);eO(Kq,{controlled:g,id:s,open:dI(u),trigger:PI(i,"trigger"),onOpen:f,onClose:m,onToggle:e=>{CI(u)?m(e):f(e)},onShow:()=>{n("show",c.value)},onHide:()=>{n("hide",c.value)},onBeforeShow:()=>{n("before-show",c.value)},onBeforeHide:()=>{n("before-hide",c.value)},updatePopper:l}),DO(()=>i.disabled,e=>{e&&u.value&&(u.value=!1)});return zS(()=>u.value&&h()),t({popperRef:o,contentRef:a,isFocusInsideContent:e=>{var t;return null==(t=a.value)?void 0:t.isFocusInsideContent(e)},updatePopper:l,onOpen:f,onClose:m,hide:h}),(e,t)=>(uM(),gM(CI(qq),{ref_key:"popperRef",ref:o,role:e.role},{default:LA(()=>[EM(WZ,{disabled:e.disabled,trigger:e.trigger,"trigger-keys":e.triggerKeys,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering,"focus-on-target":e.focusOnTarget},{default:LA(()=>[e.$slots.default?mC(e.$slots,"default",{key:0}):OM("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering","focus-on-target"]),EM(RQ,{ref_key:"contentRef",ref:a,"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":CI(_),"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,"arrow-offset":e.arrowOffset,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,"show-after":e.showAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"virtual-triggering":e.virtualTriggering,"z-index":e.zIndex,"append-to":e.appendTo},{default:LA(()=>[mC(e.$slots,"content",{},()=>[e.rawContent?(uM(),mM("span",{key:0,innerHTML:e.content},null,8,["innerHTML"])):(uM(),mM("span",{key:1},GE(e.content),1))]),e.showArrow?(uM(),gM(CI(DQ),{key:0})):OM("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});const PQ=AG(HH(LQ,[["__file","tooltip.vue"]])),BQ={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},$Q=Symbol("scrollbarContextKey"),UQ=hG({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),VQ=dS({__name:"thumb",props:UQ,setup(e){const t=e,n=tO($Q),i=ij("scrollbar");n||gW("Thumb","can not inject scrollbar context");const r=EI(),s=EI(),o=EI({}),a=EI(!1);let l=!1,u=!1,c=0,d=0,h=_j?document.onselectstart:null;const p=ak(()=>BQ[t.vertical?"vertical":"horizontal"]),f=ak(()=>(({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}))({size:t.size,move:t.move,bar:p.value})),m=ak(()=>r.value[p.value.offset]**2/n.wrapElement[p.value.scrollSize]/t.ratio/s.value[p.value.offset]),g=e=>{var t;if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;null==(t=window.getSelection())||t.removeAllRanges(),y(e);const n=e.currentTarget;n&&(o.value[p.value.axis]=n[p.value.offset]-(e[p.value.client]-n.getBoundingClientRect()[p.value.direction]))},_=e=>{if(!s.value||!r.value||!n.wrapElement)return;const t=100*(Math.abs(e.target.getBoundingClientRect()[p.value.direction]-e[p.value.client])-s.value[p.value.offset]/2)*m.value/r.value[p.value.offset];n.wrapElement[p.value.scroll]=t*n.wrapElement[p.value.scrollSize]/100},y=e=>{e.stopImmediatePropagation(),l=!0,c=n.wrapElement.scrollHeight,d=n.wrapElement.scrollWidth,document.addEventListener("mousemove",v),document.addEventListener("mouseup",b),h=document.onselectstart,document.onselectstart=()=>!1},v=e=>{if(!r.value||!s.value)return;if(!1===l)return;const t=o.value[p.value.axis];if(!t)return;const i=100*(-1*(r.value.getBoundingClientRect()[p.value.direction]-e[p.value.client])-(s.value[p.value.offset]-t))*m.value/r.value[p.value.offset];"scrollLeft"===p.value.scroll?n.wrapElement[p.value.scroll]=i*d/100:n.wrapElement[p.value.scroll]=i*c/100},b=()=>{l=!1,o.value[p.value.axis]=0,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b),T(),u&&(a.value=!1)};JS(()=>{T(),document.removeEventListener("mouseup",b)});const T=()=>{document.onselectstart!==h&&(document.onselectstart=h)};return AH(PI(n,"scrollbarElement"),"mousemove",()=>{u=!1,a.value=!!t.size}),AH(PI(n,"scrollbarElement"),"mouseleave",()=>{u=!0,a.value=l}),(e,t)=>(uM(),gM(Rk,{name:CI(i).b("fade"),persisted:""},{default:LA(()=>[PA(xM("div",{ref_key:"instance",ref:r,class:CE([CI(i).e("bar"),CI(i).is(CI(p).key)]),onMousedown:_,onClick:KR(()=>{},["stop"])},[xM("div",{ref_key:"thumb",ref:s,class:CE(CI(i).e("thumb")),style:EE(CI(f)),onMousedown:g},null,38)],42,["onClick"]),[[Xk,e.always||a.value]])]),_:1},8,["name"]))}});var zQ=HH(VQ,[["__file","thumb.vue"]]);const jQ=dS({__name:"bar",props:hG({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),setup(e,{expose:t}){const n=e,i=tO($Q),r=EI(0),s=EI(0),o=EI(""),a=EI(""),l=EI(1),u=EI(1);return t({handleScroll:e=>{if(e){const t=e.offsetHeight-4,n=e.offsetWidth-4;s.value=100*e.scrollTop/t*l.value,r.value=100*e.scrollLeft/n*u.value}},update:()=>{const e=null==i?void 0:i.wrapElement;if(!e)return;const t=e.offsetHeight-4,r=e.offsetWidth-4,s=t**2/e.scrollHeight,c=r**2/e.scrollWidth,d=Math.max(s,n.minSize),h=Math.max(c,n.minSize);l.value=s/(t-s)/(d/(t-d)),u.value=c/(r-c)/(h/(r-h)),a.value=d+4<t?`${d}px`:"",o.value=h+4<r?`${h}px`:""}}),(e,t)=>(uM(),mM(iM,null,[EM(zQ,{move:r.value,ratio:u.value,size:o.value,always:e.always},null,8,["move","ratio","size","always"]),EM(zQ,{move:s.value,ratio:l.value,size:a.value,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64))}});var YQ=HH(jQ,[["__file","bar.vue"]]);const GQ=hG({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:[String,Object,Array],default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Oq(["ariaLabel","ariaOrientation"])}),HQ={"end-reached":e=>["left","right","top","bottom"].includes(e),scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(oj)},WQ=dS({name:"ElScrollbar"}),XQ=dS({...WQ,props:GQ,emits:HQ,setup(e,{expose:t,emit:n}){const i=e,r=ij("scrollbar");let s,o,a,l=0,u=0,c="";const d={bottom:!1,top:!1,right:!1,left:!1},h=EI(),p=EI(),f=EI(),m=EI(),g=ak(()=>{const e={};return i.height&&(e.height=WH(i.height)),i.maxHeight&&(e.maxHeight=WH(i.maxHeight)),[i.wrapStyle,e]}),_=ak(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),y=ak(()=>[r.e("view"),i.viewClass]),v={top:"bottom",bottom:"top",left:"right",right:"left"},b=()=>{var e;if(p.value){null==(e=m.value)||e.handleScroll(p.value);const t=l,r=u;l=p.value.scrollTop,u=p.value.scrollLeft;const s={bottom:l+p.value.clientHeight>=p.value.scrollHeight-i.distance,top:l<=i.distance&&0!==t,right:u+p.value.clientWidth>=p.value.scrollWidth-i.distance&&r!==u,left:u<=i.distance&&0!==r};if(n("scroll",{scrollTop:l,scrollLeft:u}),t!==l&&(c=l>t?"bottom":"top"),r!==u&&(c=u>r?"right":"left"),i.distance>0){if((e=>{var t;return null!=(t=d[e])&&t})(c))return;(e=>{const t=v[c];if(!t)return;const n=e[c],i=e[t];n&&!d[c]&&(d[c]=!0),!i&&d[t]&&(d[t]=!1)})(s)}s[c]&&n("end-reached",c)}};const T=()=>{var e;null==(e=m.value)||e.update(),d[c]=!1};return DO(()=>i.noresize,e=>{e?(null==s||s(),null==o||o(),null==a||a()):(({stop:s}=FH(f,T)),({stop:o}=FH(p,T)),a=AH("resize",T))},{immediate:!0}),DO(()=>[i.maxHeight,i.height],()=>{i.native||hA(()=>{var e;T(),p.value&&(null==(e=m.value)||e.handleScroll(p.value))})}),eO($Q,uI({scrollbarElement:h,wrapElement:p})),VS(()=>{p.value&&(p.value.scrollTop=l,p.value.scrollLeft=u)}),KS(()=>{i.native||hA(()=>{T()})}),QS(()=>T()),t({wrapRef:p,update:T,scrollTo:function(e,t){Jx(e)?p.value.scrollTo(e):oj(e)&&oj(t)&&p.value.scrollTo(e,t)},setScrollTop:e=>{oj(e)&&(p.value.scrollTop=e)},setScrollLeft:e=>{oj(e)&&(p.value.scrollLeft=e)},handleScroll:b}),(e,t)=>(uM(),mM("div",{ref_key:"scrollbarRef",ref:h,class:CE(CI(r).b())},[xM("div",{ref_key:"wrapRef",ref:p,class:CE(CI(_)),style:EE(CI(g)),tabindex:e.tabindex,onScroll:b},[(uM(),gM(uC(e.tag),{id:e.id,ref_key:"resizeRef",ref:f,class:CE(CI(y)),style:EE(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),e.native?OM("v-if",!0):(uM(),gM(YQ,{key:0,ref_key:"barRef",ref:m,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});const qQ=AG(HH(XQ,[["__file","scrollbar.vue"]]));var KQ=HH(dS({inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return mC(e.$slots,"default")}],["__file","collection.vue"]]);var ZQ=HH(dS({name:"ElCollectionItem",inheritAttrs:!1}),[["render",function(e,t,n,i,r,s){return mC(e.$slots,"default")}],["__file","collection-item.vue"]]);const QQ="data-el-collection-item",JQ=e=>{const t=`El${e}Collection`,n=`${t}Item`,i=Symbol(t),r=Symbol(n),s={...KQ,name:t,setup(){const e=EI(),t=new Map;eO(i,{itemMap:t,getItems:()=>{const n=CI(e);if(!n)return[];const i=Array.from(n.querySelectorAll(`[${QQ}]`));return[...t.values()].sort((e,t)=>i.indexOf(e.ref)-i.indexOf(t.ref))},collectionRef:e})}},o={...ZQ,name:n,setup(e,{attrs:t}){const n=EI(),s=tO(i,void 0);eO(r,{collectionItemRef:n}),KS(()=>{const e=CI(n);e&&s.itemMap.set(e,{ref:e,...t})}),JS(()=>{const e=CI(n);s.itemMap.delete(e)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},eJ=hG({style:{type:[String,Array,Object]},currentTabId:{type:String},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:String},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:tJ,ElCollectionItem:nJ,COLLECTION_INJECTION_KEY:iJ,COLLECTION_ITEM_INJECTION_KEY:rJ}=JQ("RovingFocusGroup"),sJ=Symbol("elRovingFocusGroup"),oJ=Symbol("elRovingFocusGroupItem"),aJ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},lJ=(e,t,n)=>{const i=((e,t)=>{if("rtl"!==t)return e;switch(e){case dW.right:return dW.left;case dW.left:return dW.right;default:return e}})(e.code,n);if(!("vertical"===t&&[dW.left,dW.right].includes(i)||"horizontal"===t&&[dW.up,dW.down].includes(i)))return aJ[i]},uJ=e=>{const{activeElement:t}=document;for(const n of e){if(n===t)return;if(n.focus(),t!==document.activeElement)return}},cJ="currentTabIdChange",dJ="rovingFocusGroup.entryFocus",hJ={bubbles:!1,cancelable:!0},pJ=dS({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:eJ,emits:[cJ,"entryFocus"],setup(e,{emit:t}){var n;const i=EI(null!=(n=e.currentTabId||e.defaultCurrentTabId)?n:null),r=EI(!1),s=EI(!1),o=EI(),{getItems:a}=tO(iJ,void 0),l=ak(()=>[{outline:"none"},e.style]),u=jZ(t=>{var n;null==(n=e.onMousedown)||n.call(e,t)},()=>{s.value=!0}),c=jZ(t=>{var n;null==(n=e.onFocus)||n.call(e,t)},e=>{const t=!CI(s),{target:n,currentTarget:o}=e;if(n===o&&t&&!CI(r)){const e=new Event(dJ,hJ);if(null==o||o.dispatchEvent(e),!e.defaultPrevented){const e=a().filter(e=>e.focusable),t=[e.find(e=>e.active),e.find(e=>e.id===CI(i)),...e].filter(Boolean).map(e=>e.ref);uJ(t)}}s.value=!1}),d=jZ(t=>{var n;null==(n=e.onBlur)||n.call(e,t)},()=>{r.value=!1});eO(sJ,{currentTabbedId:dI(i),loop:PI(e,"loop"),tabIndex:ak(()=>CI(r)?-1:0),rovingFocusGroupRef:o,rovingFocusGroupRootStyle:l,orientation:PI(e,"orientation"),dir:PI(e,"dir"),onItemFocus:e=>{t(cJ,e)},onItemShiftTab:()=>{r.value=!0},onBlur:d,onFocus:c,onMousedown:u}),DO(()=>e.currentTabId,e=>{i.value=null!=e?e:null}),AH(o,dJ,(...e)=>{t("entryFocus",...e)})}});var fJ=HH(dS({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:tJ,ElRovingFocusGroupImpl:HH(pJ,[["render",function(e,t,n,i,r,s){return mC(e.$slots,"default")}],["__file","roving-focus-group-impl.vue"]])}}),[["render",function(e,t,n,i,r,s){const o=aC("el-roving-focus-group-impl"),a=aC("el-focus-group-collection");return uM(),gM(a,null,{default:LA(()=>[EM(o,OE(IM(e.$attrs)),{default:LA(()=>[mC(e.$slots,"default")]),_:3},16)]),_:3})}],["__file","roving-focus-group.vue"]]);const mJ=hG({trigger:EZ.trigger,triggerKeys:{type:Array,default:()=>[dW.enter,dW.numpadEnter,dW.space,dW.down]},virtualTriggering:EZ.virtualTriggering,virtualRef:EZ.virtualRef,effect:{...TZ.effect,default:"light"},type:{type:String},placement:{type:String,default:"bottom"},popperOptions:{type:Object,default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showArrow:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:[Number,String],default:0},maxHeight:{type:[Number,String],default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,values:Hq,default:"menu"},buttonProps:{type:Object},teleported:TZ.teleported,persistent:{type:Boolean,default:!0}}),gJ=hG({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:eW}}),_J=hG({onKeydown:{type:Function}}),yJ=[dW.down,dW.pageDown,dW.home],vJ=[dW.up,dW.pageUp,dW.end],bJ=[...yJ,...vJ],{ElCollection:TJ,ElCollectionItem:xJ,COLLECTION_INJECTION_KEY:EJ,COLLECTION_ITEM_INJECTION_KEY:wJ}=JQ("Dropdown"),IJ=Symbol("elDropdown"),AJ="elDropdown";const SJ=function(){if(!arguments.length)return[];var e=arguments[0];return Rj(e)?e:[e]},{ButtonGroup:CJ}=NX,OJ=dS({name:"ElDropdown",components:{ElButton:NX,ElButtonGroup:CJ,ElScrollbar:qQ,ElDropdownCollection:TJ,ElTooltip:PQ,ElRovingFocusGroup:fJ,ElOnlyChild:PZ,ElIcon:JH,ArrowDown:MG},props:mJ,emits:["visible-change","click","command"],setup(e,{emit:t}){const n=$M(),i=ij("dropdown"),{t:r}=lG(),s=EI(),o=EI(),a=EI(),l=EI(),u=EI(null),c=EI(null),d=EI(!1),h=ak(()=>({maxHeight:WH(e.maxHeight)})),p=ak(()=>[i.m(_.value)]),f=ak(()=>SJ(e.trigger)),m=qW().value,g=ak(()=>e.id||m);const _=tX();eO(IJ,{contentRef:l,role:ak(()=>e.role),triggerId:g,isUsingKeyboard:d,onItemEnter:function(){},onItemLeave:function(){const e=CI(l);f.value.includes("hover")&&(null==e||e.focus({preventScroll:!0})),c.value=null}}),eO(AJ,{instance:n,dropdownSize:_,handleClick:function(){var e;null==(e=a.value)||e.onClose(void 0,0)},commandHandler:function(...e){t("command",...e)},trigger:PI(e,"trigger"),hideOnClick:PI(e,"hideOnClick")});return{t:r,ns:i,scrollbar:u,wrapStyle:h,dropdownTriggerKls:p,dropdownSize:_,triggerId:g,currentTabId:c,handleCurrentTabIdChange:function(e){c.value=e},handlerMainButtonClick:e=>{t("click",e)},handleEntryFocus:function(e){d.value||(e.preventDefault(),e.stopImmediatePropagation())},handleClose:function(){var e;null==(e=a.value)||e.onClose()},handleOpen:function(){var e;null==(e=a.value)||e.onOpen()},handleBeforeShowTooltip:function(){t("visible-change",!0)},handleShowTooltip:function(e){var t;"keydown"===(null==e?void 0:e.type)&&(null==(t=l.value)||t.focus())},handleBeforeHideTooltip:function(){t("visible-change",!1)},onFocusAfterTrapped:e=>{var t,n;e.preventDefault(),null==(n=null==(t=l.value)?void 0:t.focus)||n.call(t,{preventScroll:!0})},popperRef:a,contentRef:l,triggeringElementRef:s,referenceElementRef:o}}});var MJ=HH(OJ,[["render",function(e,t,n,i,r,s){var o,a;const l=aC("el-dropdown-collection"),u=aC("el-roving-focus-group"),c=aC("el-scrollbar"),d=aC("el-only-child"),h=aC("el-tooltip"),p=aC("el-button"),f=aC("arrow-down"),m=aC("el-icon"),g=aC("el-button-group");return uM(),mM("div",{class:CE([e.ns.b(),e.ns.is("disabled",e.disabled)])},[EM(h,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":null==(o=e.referenceElementRef)?void 0:o.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-arrow":e.showArrow,"show-after":"hover"===e.trigger?e.showTimeout:0,"hide-after":"hover"===e.trigger?e.hideTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":null!=(a=e.virtualRef)?a:e.triggeringElementRef,"virtual-triggering":e.virtualTriggering||e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"","focus-on-target":"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},fC({content:LA(()=>[EM(c,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:LA(()=>[EM(u,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:LA(()=>[EM(l,null,{default:LA(()=>[mC(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:LA(()=>[EM(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(uM(),gM(g,{key:0},{default:LA(()=>[EM(p,NM({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:LA(()=>[mC(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),EM(p,NM({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:LA(()=>[EM(m,{class:CE(e.ns.e("icon"))},{default:LA(()=>[EM(f)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):OM("v-if",!0)],2)}],["__file","dropdown.vue"]]);const kJ=dS({components:{ElRovingFocusCollectionItem:nJ},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:n,loop:i,onItemFocus:r,onItemShiftTab:s}=tO(sJ,void 0),{getItems:o}=tO(iJ,void 0),a=qW(),l=EI(),u=jZ(e=>{t("mousedown",e)},t=>{e.focusable?r(CI(a)):t.preventDefault()}),c=jZ(e=>{t("focus",e)},()=>{r(CI(a))}),d=jZ(e=>{t("keydown",e)},e=>{const{code:t,shiftKey:n,target:r,currentTarget:a}=e;if(t===dW.tab&&n)return void s();if(r!==a)return;const l=lJ(e);if(l){e.preventDefault();let t=o().filter(e=>e.focusable).map(e=>e.ref);switch(l){case"last":t.reverse();break;case"prev":case"next":{"prev"===l&&t.reverse();const e=t.indexOf(a);t=i.value?((e,t)=>e.map((n,i)=>e[(i+t)%e.length]))(t,e+1):t.slice(e+1);break}}hA(()=>{uJ(t)})}}),h=ak(()=>n.value===CI(a));return eO(oJ,{rovingFocusGroupItemRef:l,tabIndex:ak(()=>CI(h)?0:-1),handleMousedown:u,handleFocus:c,handleKeydown:d}),{id:a,handleKeydown:d,handleFocus:c,handleMousedown:u}}});var RJ=HH(kJ,[["render",function(e,t,n,i,r,s){const o=aC("el-roving-focus-collection-item");return uM(),gM(o,{id:e.id,focusable:e.focusable,active:e.active},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["id","focusable","active"])}],["__file","roving-focus-item.vue"]]);const NJ=(...e)=>t=>{e.forEach(e=>{Kx(e)?e(t):e.value=t})},DJ=dS({name:"DropdownItemImpl",components:{ElIcon:JH},props:gJ,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const n=ij("dropdown"),{role:i}=tO(IJ,void 0),{collectionItemRef:r}=tO(wJ,void 0),{collectionItemRef:s}=tO(rJ,void 0),{rovingFocusGroupItemRef:o,tabIndex:a,handleFocus:l,handleKeydown:u,handleMousedown:c}=tO(oJ,void 0),d=NJ(r,s,o),h=ak(()=>"menu"===i.value?"menuitem":"navigation"===i.value?"link":"button"),p=jZ(e=>{if([dW.enter,dW.numpadEnter,dW.space].includes(e.code))return e.preventDefault(),e.stopImmediatePropagation(),t("clickimpl",e),!0},u);return{ns:n,itemRef:d,dataset:{[QQ]:""},role:h,tabIndex:a,handleFocus:l,handleKeydown:p,handleMousedown:c}}});const FJ=()=>{const e=tO(AJ,{}),t=ak(()=>null==e?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:t}},LJ=dS({name:"ElDropdownItem",components:{ElDropdownCollectionItem:xJ,ElRovingFocusItem:RJ,ElDropdownItemImpl:HH(DJ,[["render",function(e,t,n,i,r,s){const o=aC("el-icon");return uM(),mM(iM,null,[e.divided?(uM(),mM("li",{key:0,role:"separator",class:CE(e.ns.bem("menu","item","divided"))},null,2)):OM("v-if",!0),xM("li",NM({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t=>e.$emit("clickimpl",t),onFocus:e.handleFocus,onKeydown:KR(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:t=>e.$emit("pointermove",t),onPointerleave:t=>e.$emit("pointerleave",t)}),[e.icon?(uM(),gM(o,{key:0},{default:LA(()=>[(uM(),gM(uC(e.icon)))]),_:1})):OM("v-if",!0),mC(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}],["__file","dropdown-item-impl.vue"]])},inheritAttrs:!1,props:gJ,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:n}){const{elDropdown:i}=FJ(),r=$M(),s=EI(null),o=ak(()=>{var e,t;return null!=(t=null==(e=CI(s))?void 0:e.textContent)?t:""}),{onItemEnter:a,onItemLeave:l}=tO(IJ,void 0),u=jZ(e=>(t("pointermove",e),e.defaultPrevented),YZ(t=>{if(e.disabled)return void l(t);const n=t.currentTarget;n===document.activeElement||n.contains(document.activeElement)||(a(t),t.defaultPrevented||null==n||n.focus({preventScroll:!0}))})),c=jZ(e=>(t("pointerleave",e),e.defaultPrevented),YZ(l)),d=jZ(n=>{if(!e.disabled)return t("click",n),"keydown"!==n.type&&n.defaultPrevented},t=>{var n,s,o;e.disabled?t.stopImmediatePropagation():((null==(n=null==i?void 0:i.hideOnClick)?void 0:n.value)&&(null==(s=i.handleClick)||s.call(i)),null==(o=i.commandHandler)||o.call(i,e.command,r,t))});return{handleClick:d,handlePointerMove:u,handlePointerLeave:c,textContent:o,propsAndAttrs:ak(()=>({...e,...n}))}}});var PJ=HH(LJ,[["render",function(e,t,n,i,r,s){var o;const a=aC("el-dropdown-item-impl"),l=aC("el-roving-focus-item"),u=aC("el-dropdown-collection-item");return uM(),gM(u,{disabled:e.disabled,"text-value":null!=(o=e.textValue)?o:e.textContent},{default:LA(()=>[EM(l,{focusable:!e.disabled},{default:LA(()=>[EM(a,NM(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:LA(()=>[mC(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}],["__file","dropdown-item.vue"]]);const BJ=dS({name:"ElDropdownMenu",props:_J,setup(e){const t=ij("dropdown"),{_elDropdownSize:n}=FJ(),i=n.value,{focusTrapRef:r,onKeydown:s}=tO(iQ,void 0),{contentRef:o,role:a,triggerId:l}=tO(IJ,void 0),{collectionRef:u,getItems:c}=tO(EJ,void 0),{rovingFocusGroupRef:d,rovingFocusGroupRootStyle:h,tabIndex:p,onBlur:f,onFocus:m,onMousedown:g}=tO(sJ,void 0),{collectionRef:_}=tO(iJ,void 0),y=ak(()=>[t.b("menu"),t.bm("menu",null==i?void 0:i.value)]),v=NJ(o,u,r,d,_),b=jZ(t=>{var n;null==(n=e.onKeydown)||n.call(e,t)},e=>{const{currentTarget:t,code:n,target:i}=e;if(t.contains(i),dW.tab===n&&e.stopImmediatePropagation(),e.preventDefault(),i!==CI(o)||!bJ.includes(n))return;const r=c().filter(e=>!e.disabled).map(e=>e.ref);vJ.includes(n)&&r.reverse(),uJ(r)});return{size:i,rovingFocusGroupRootStyle:h,tabIndex:p,dropdownKls:y,role:a,triggerId:l,dropdownListWrapperRef:v,handleKeydown:e=>{b(e),s(e)},onBlur:f,onFocus:m,onMousedown:g}}});var $J=HH(BJ,[["render",function(e,t,n,i,r,s){return uM(),mM("ul",{ref:e.dropdownListWrapperRef,class:CE(e.dropdownKls),style:EE(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:KR(e.handleKeydown,["self"]),onMousedown:KR(e.onMousedown,["self"])},[mC(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}],["__file","dropdown-menu.vue"]]);const UJ=AG(MJ,{DropdownItem:PJ,DropdownMenu:$J}),VJ=SG(PJ),zJ=SG($J),jJ=Symbol("uploadContextKey"),YJ=hG({type:{type:String,default:"line",values:["line","circle","dashboard"]},percentage:{type:Number,default:0,validator:e=>e>=0&&e<=100},status:{type:String,default:"",values:["","success","exception","warning"]},indeterminate:Boolean,duration:{type:Number,default:3},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:Boolean,width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},striped:Boolean,stripedFlow:Boolean,format:{type:Function,default:e=>`${e}%`}}),GJ=dS({name:"ElProgress"}),HJ=dS({...GJ,props:YJ,setup(e){const t=e,n={success:"#13ce66",exception:"#ff4949",warning:"#e6a23c",default:"#20a0ff"},i=ij("progress"),r=ak(()=>{const e={width:`${t.percentage}%`,animationDuration:`${t.duration}s`},n=_(t.percentage);return n.includes("gradient")?e.background=n:e.backgroundColor=n,e}),s=ak(()=>(t.strokeWidth/t.width*100).toFixed(1)),o=ak(()=>["circle","dashboard"].includes(t.type)?Number.parseInt(""+(50-Number.parseFloat(s.value)/2),10):0),a=ak(()=>{const e=o.value,n="dashboard"===t.type;return`\n M 50 50\n m 0 ${n?"":"-"}${e}\n a ${e} ${e} 0 1 1 0 ${n?"-":""}${2*e}\n a ${e} ${e} 0 1 1 0 ${n?"":"-"}${2*e}\n `}),l=ak(()=>2*Math.PI*o.value),u=ak(()=>"dashboard"===t.type?.75:1),c=ak(()=>`${-1*l.value*(1-u.value)/2}px`),d=ak(()=>({strokeDasharray:`${l.value*u.value}px, ${l.value}px`,strokeDashoffset:c.value})),h=ak(()=>({strokeDasharray:`${l.value*u.value*(t.percentage/100)}px, ${l.value}px`,strokeDashoffset:c.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),p=ak(()=>{let e;return e=t.color?_(t.percentage):n[t.status]||n.default,e}),f=ak(()=>"warning"===t.status?bH:"line"===t.type?"success"===t.status?zG:HG:"success"===t.status?UG:QG),m=ak(()=>"line"===t.type?12+.4*t.strokeWidth:.111111*t.width+2),g=ak(()=>t.format(t.percentage));const _=e=>{var n;const{color:i}=t;if(Kx(i))return i(e);if(Zx(i))return i;{const t=function(e){const t=100/e.length;return e.map((e,n)=>Zx(e)?{color:e,percentage:(n+1)*t}:e).sort((e,t)=>e.percentage-t.percentage)}(i);for(const n of t)if(n.percentage>e)return n.color;return null==(n=t[t.length-1])?void 0:n.color}};return(e,t)=>(uM(),mM("div",{class:CE([CI(i).b(),CI(i).m(e.type),CI(i).is(e.status),{[CI(i).m("without-text")]:!e.showText,[CI(i).m("text-inside")]:e.textInside}]),role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"},["line"===e.type?(uM(),mM("div",{key:0,class:CE(CI(i).b("bar"))},[xM("div",{class:CE(CI(i).be("bar","outer")),style:EE({height:`${e.strokeWidth}px`})},[xM("div",{class:CE([CI(i).be("bar","inner"),{[CI(i).bem("bar","inner","indeterminate")]:e.indeterminate},{[CI(i).bem("bar","inner","striped")]:e.striped},{[CI(i).bem("bar","inner","striped-flow")]:e.stripedFlow}]),style:EE(CI(r))},[(e.showText||e.$slots.default)&&e.textInside?(uM(),mM("div",{key:0,class:CE(CI(i).be("bar","innerText"))},[mC(e.$slots,"default",{percentage:e.percentage},()=>[xM("span",null,GE(CI(g)),1)])],2)):OM("v-if",!0)],6)],6)],2)):(uM(),mM("div",{key:1,class:CE(CI(i).b("circle")),style:EE({height:`${e.width}px`,width:`${e.width}px`})},[(uM(),mM("svg",{viewBox:"0 0 100 100"},[xM("path",{class:CE(CI(i).be("circle","track")),d:CI(a),stroke:`var(${CI(i).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":e.strokeLinecap,"stroke-width":CI(s),fill:"none",style:EE(CI(d))},null,14,["d","stroke","stroke-linecap","stroke-width"]),xM("path",{class:CE(CI(i).be("circle","path")),d:CI(a),stroke:CI(p),fill:"none",opacity:e.percentage?1:0,"stroke-linecap":e.strokeLinecap,"stroke-width":CI(s),style:EE(CI(h))},null,14,["d","stroke","opacity","stroke-linecap","stroke-width"])]))],6)),!e.showText&&!e.$slots.default||e.textInside?OM("v-if",!0):(uM(),mM("div",{key:2,class:CE(CI(i).e("text")),style:EE({fontSize:`${CI(m)}px`})},[mC(e.$slots,"default",{percentage:e.percentage},()=>[e.status?(uM(),gM(CI(JH),{key:1},{default:LA(()=>[(uM(),gM(uC(CI(f))))]),_:1})):(uM(),mM("span",{key:0},GE(CI(g)),1))])],6))],10,["aria-valuenow"]))}});const WJ=AG(HH(HJ,[["__file","progress.vue"]]));class XJ extends Error{constructor(e,t,n,i){super(e),this.name="UploadAjaxError",this.status=t,this.method=n,this.url=i}}function qJ(e,t,n){let i;return i=n.response?`${n.response.error||n.response}`:n.responseText?`${n.responseText}`:`fail to ${t.method} ${e} ${n.status}`,new XJ(i,n.status,t.method,e)}const KJ=["text","picture","picture-card"];let ZJ=1;const QJ=()=>Date.now()+ZJ++,JJ=hG({action:{type:String,default:"#"},headers:{type:Object},method:{type:String,default:"post"},data:{type:[Object,Function,Promise],default:()=>({})},multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:{type:String,default:""},fileList:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!0},listType:{type:String,values:KJ,default:"text"},httpRequest:{type:Function,default:e=>{"undefined"==typeof XMLHttpRequest&&gW("ElUpload","XMLHttpRequest is undefined");const t=new XMLHttpRequest,n=e.action;t.upload&&t.upload.addEventListener("progress",t=>{const n=t;n.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(n)});const i=new FormData;if(e.data)for(const[t,n]of Object.entries(e.data))Hx(n)&&n.length?i.append(t,...n):i.append(t,n);i.append(e.filename,e.file,e.file.name),t.addEventListener("error",()=>{e.onError(qJ(n,e,t))}),t.addEventListener("load",()=>{if(t.status<200||t.status>=300)return e.onError(qJ(n,e,t));e.onSuccess(function(e){const t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}(t))}),t.open(e.method,n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);const r=e.headers||{};if(r instanceof Headers)r.forEach((e,n)=>t.setRequestHeader(n,e));else for(const[e,n]of Object.entries(r))VX(n)||t.setRequestHeader(e,String(n));return t.send(i),t}},disabled:Boolean,limit:Number}),e0=hG({...JJ,beforeUpload:{type:Function,default:Bx},beforeRemove:{type:Function},onRemove:{type:Function,default:Bx},onChange:{type:Function,default:Bx},onPreview:{type:Function,default:Bx},onSuccess:{type:Function,default:Bx},onProgress:{type:Function,default:Bx},onError:{type:Function,default:Bx},onExceed:{type:Function,default:Bx},crossorigin:{type:String}}),t0=hG({files:{type:Array,default:()=>[]},disabled:Boolean,handlePreview:{type:Function,default:Bx},listType:{type:String,values:KJ,default:"text"},crossorigin:{type:String}}),n0=dS({name:"ElUploadList"}),i0=dS({...n0,props:t0,emits:{remove:e=>!!e},setup(e,{emit:t}){const n=e,{t:i}=lG(),r=ij("upload"),s=ij("icon"),o=ij("list"),a=nX(),l=EI(!1),u=ak(()=>[r.b("list"),r.bm("list",n.listType),r.is("disabled",n.disabled)]),c=e=>{t("remove",e)};return(e,t)=>(uM(),gM(OR,{tag:"ul",class:CE(CI(u)),name:CI(o).b()},{default:LA(()=>[(uM(!0),mM(iM,null,pC(e.files,(t,n)=>(uM(),mM("li",{key:t.uid||t.name,class:CE([CI(r).be("list","item"),CI(r).is(t.status),{focusing:l.value}]),tabindex:"0",onKeydown:QR(e=>!CI(a)&&c(t),["delete"]),onFocus:e=>l.value=!0,onBlur:e=>l.value=!1,onClick:e=>l.value=!1},[mC(e.$slots,"default",{file:t,index:n},()=>["picture"===e.listType||"uploading"!==t.status&&"picture-card"===e.listType?(uM(),mM("img",{key:0,class:CE(CI(r).be("list","item-thumbnail")),src:t.url,crossorigin:e.crossorigin,alt:""},null,10,["src","crossorigin"])):OM("v-if",!0),"uploading"===t.status||"picture-card"!==e.listType?(uM(),mM("div",{key:1,class:CE(CI(r).be("list","item-info"))},[xM("a",{class:CE(CI(r).be("list","item-name")),onClick:KR(n=>e.handlePreview(t),["prevent"])},[EM(CI(JH),{class:CE(CI(s).m("document"))},{default:LA(()=>[EM(CI(nH))]),_:1},8,["class"]),xM("span",{class:CE(CI(r).be("list","item-file-name")),title:t.name},GE(t.name),11,["title"])],10,["onClick"]),"uploading"===t.status?(uM(),gM(CI(WJ),{key:0,type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:Number(t.percentage),style:EE("picture-card"===e.listType?"":"margin-top: 0.5rem")},null,8,["type","stroke-width","percentage","style"])):OM("v-if",!0)],2)):OM("v-if",!0),xM("label",{class:CE(CI(r).be("list","item-status-label"))},["text"===e.listType?(uM(),gM(CI(JH),{key:0,class:CE([CI(s).m("upload-success"),CI(s).m("circle-check")])},{default:LA(()=>[EM(CI(zG))]),_:1},8,["class"])):["picture-card","picture"].includes(e.listType)?(uM(),gM(CI(JH),{key:1,class:CE([CI(s).m("upload-success"),CI(s).m("check")])},{default:LA(()=>[EM(CI(UG))]),_:1},8,["class"])):OM("v-if",!0)],2),CI(a)?OM("v-if",!0):(uM(),gM(CI(JH),{key:2,class:CE(CI(s).m("close")),onClick:e=>c(t)},{default:LA(()=>[EM(CI(QG))]),_:2},1032,["class","onClick"])),OM(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),OM(" This is a bug which needs to be fixed "),OM(" TODO: Fix the incorrect navigation interaction "),CI(a)?OM("v-if",!0):(uM(),mM("i",{key:3,class:CE(CI(s).m("close-tip"))},GE(CI(i)("el.upload.deleteTip")),3)),"picture-card"===e.listType?(uM(),mM("span",{key:4,class:CE(CI(r).be("list","item-actions"))},[xM("span",{class:CE(CI(r).be("list","item-preview")),onClick:n=>e.handlePreview(t)},[EM(CI(JH),{class:CE(CI(s).m("zoom-in"))},{default:LA(()=>[EM(CI(xH))]),_:1},8,["class"])],10,["onClick"]),CI(a)?OM("v-if",!0):(uM(),mM("span",{key:0,class:CE(CI(r).be("list","item-delete")),onClick:e=>c(t)},[EM(CI(JH),{class:CE(CI(s).m("delete"))},{default:LA(()=>[EM(CI(eH))]),_:1},8,["class"])],10,["onClick"]))],2)):OM("v-if",!0)])],42,["onKeydown","onFocus","onBlur","onClick"]))),128)),mC(e.$slots,"append")]),_:3},8,["class","name"]))}});var r0=HH(i0,[["__file","upload-list.vue"]]);const s0=function(){this.__data__=new RY,this.size=0};const o0=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const a0=function(e){return this.__data__.get(e)};const l0=function(e){return this.__data__.has(e)};const u0=function(e,t){var n=this.__data__;if(n instanceof RY){var i=n.__data__;if(!NY||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new zY(i)}return n.set(e,t),this.size=n.size,this};function c0(e){var t=this.__data__=new RY(e);this.size=t.size}c0.prototype.clear=s0,c0.prototype.delete=o0,c0.prototype.get=a0,c0.prototype.has=l0,c0.prototype.set=u0;const d0=c0;const h0=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e};const p0=function(e,t,n,i){var r=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=i?i(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),r?XX(n,a,l):KX(n,a,l)}return n};const f0=function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i};const m0=function(){return!1};var g0="object"==typeof exports&&exports&&!exports.nodeType&&exports,_0=g0&&"object"==typeof module&&module&&!module.nodeType&&module,y0=_0&&_0.exports===g0?Fj.Buffer:void 0;const v0=(y0?y0.isBuffer:void 0)||m0;var b0={};b0["[object Float32Array]"]=b0["[object Float64Array]"]=b0["[object Int8Array]"]=b0["[object Int16Array]"]=b0["[object Int32Array]"]=b0["[object Uint8Array]"]=b0["[object Uint8ClampedArray]"]=b0["[object Uint16Array]"]=b0["[object Uint32Array]"]=!0,b0["[object Arguments]"]=b0["[object Array]"]=b0["[object ArrayBuffer]"]=b0["[object Boolean]"]=b0["[object DataView]"]=b0["[object Date]"]=b0["[object Error]"]=b0["[object Function]"]=b0["[object Map]"]=b0["[object Number]"]=b0["[object Object]"]=b0["[object RegExp]"]=b0["[object Set]"]=b0["[object String]"]=b0["[object WeakMap]"]=!1;const T0=function(e){return Hj(e)&&aq(e.length)&&!!b0[Gj(e)]};const x0=function(e){return function(t){return e(t)}};var E0="object"==typeof exports&&exports&&!exports.nodeType&&exports,w0=E0&&"object"==typeof module&&module&&!module.nodeType&&module,I0=w0&&w0.exports===E0&&Nj.process,A0=function(){try{var e=w0&&w0.require&&w0.require("util").types;return e||I0&&I0.binding&&I0.binding("util")}catch(e){}}();const S0=A0;var C0=S0&&S0.isTypedArray;const O0=C0?x0(C0):T0;var M0=Object.prototype.hasOwnProperty;const k0=function(e,t){var n=Rj(e),i=!n&&oq(e),r=!n&&!i&&v0(e),s=!n&&!i&&!r&&O0(e),o=n||i||r||s,a=o?f0(e.length,String):[],l=a.length;for(var u in e)!t&&!M0.call(e,u)||o&&("length"==u||r&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||QX(u,l))||a.push(u);return a};var R0=Object.prototype;const N0=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||R0)};const D0=function(e,t){return function(n){return e(t(n))}};const F0=D0(Object.keys,Object);var L0=Object.prototype.hasOwnProperty;const P0=function(e){if(!N0(e))return F0(e);var t=[];for(var n in Object(e))L0.call(e,n)&&"constructor"!=n&&t.push(n);return t};const B0=function(e){return null!=e&&aq(e.length)&&!Qj(e)};const $0=function(e){return B0(e)?k0(e):P0(e)};const U0=function(e,t){return e&&p0(t,$0(t),e)};const V0=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var z0=Object.prototype.hasOwnProperty;const j0=function(e){if(!Zj(e))return V0(e);var t=N0(e),n=[];for(var i in e)("constructor"!=i||!t&&z0.call(e,i))&&n.push(i);return n};const Y0=function(e){return B0(e)?k0(e,!0):j0(e)};const G0=function(e,t){return e&&p0(t,Y0(t),e)};var H0="object"==typeof exports&&exports&&!exports.nodeType&&exports,W0=H0&&"object"==typeof module&&module&&!module.nodeType&&module,X0=W0&&W0.exports===H0?Fj.Buffer:void 0,q0=X0?X0.allocUnsafe:void 0;const K0=function(e,t){if(t)return e.slice();var n=e.length,i=q0?q0(n):new e.constructor(n);return e.copy(i),i};const Z0=function(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t};const Q0=function(e,t){for(var n=-1,i=null==e?0:e.length,r=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[r++]=o)}return s};const J0=function(){return[]};var e1=Object.prototype.propertyIsEnumerable,t1=Object.getOwnPropertySymbols;const n1=t1?function(e){return null==e?[]:(e=Object(e),Q0(t1(e),function(t){return e1.call(e,t)}))}:J0;const i1=function(e,t){return p0(e,n1(e),t)};const r1=D0(Object.getPrototypeOf,Object);const s1=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)dq(t,n1(e)),e=r1(e);return t}:J0;const o1=function(e,t){return p0(e,s1(e),t)};const a1=function(e,t,n){var i=t(e);return Rj(e)?i:dq(i,n(e))};const l1=function(e){return a1(e,$0,n1)};const u1=function(e){return a1(e,Y0,s1)};const c1=hY(Fj,"DataView");const d1=hY(Fj,"Promise");const h1=hY(Fj,"Set");const p1=hY(Fj,"WeakMap");var f1="[object Map]",m1="[object Promise]",g1="[object Set]",_1="[object WeakMap]",y1="[object DataView]",v1=iY(c1),b1=iY(NY),T1=iY(d1),x1=iY(h1),E1=iY(p1),w1=Gj;(c1&&w1(new c1(new ArrayBuffer(1)))!=y1||NY&&w1(new NY)!=f1||d1&&w1(d1.resolve())!=m1||h1&&w1(new h1)!=g1||p1&&w1(new p1)!=_1)&&(w1=function(e){var t=Gj(e),n="[object Object]"==t?e.constructor:void 0,i=n?iY(n):"";if(i)switch(i){case v1:return y1;case b1:return f1;case T1:return m1;case x1:return g1;case E1:return _1}return t});const I1=w1;var A1=Object.prototype.hasOwnProperty;const S1=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&A1.call(e,"index")&&(n.index=e.index,n.input=e.input),n};const C1=Fj.Uint8Array;const O1=function(e){var t=new e.constructor(e.byteLength);return new C1(t).set(new C1(e)),t};const M1=function(e,t){var n=t?O1(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var k1=/\w*$/;const R1=function(e){var t=new e.constructor(e.source,k1.exec(e));return t.lastIndex=e.lastIndex,t};var N1=Lj?Lj.prototype:void 0,D1=N1?N1.valueOf:void 0;const F1=function(e){return D1?Object(D1.call(e)):{}};const L1=function(e,t){var n=t?O1(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};const P1=function(e,t,n){var i=e.constructor;switch(t){case"[object ArrayBuffer]":return O1(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return M1(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return L1(e,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return R1(e);case"[object Symbol]":return F1(e)}};var B1=Object.create;const $1=function(){function e(){}return function(t){if(!Zj(t))return{};if(B1)return B1(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const U1=function(e){return"function"!=typeof e.constructor||N0(e)?{}:$1(r1(e))};const V1=function(e){return Hj(e)&&"[object Map]"==I1(e)};var z1=S0&&S0.isMap;const j1=z1?x0(z1):V1;const Y1=function(e){return Hj(e)&&"[object Set]"==I1(e)};var G1=S0&&S0.isSet;const H1=G1?x0(G1):Y1;var W1="[object Arguments]",X1="[object Function]",q1="[object Object]",K1={};K1[W1]=K1["[object Array]"]=K1["[object ArrayBuffer]"]=K1["[object DataView]"]=K1["[object Boolean]"]=K1["[object Date]"]=K1["[object Float32Array]"]=K1["[object Float64Array]"]=K1["[object Int8Array]"]=K1["[object Int16Array]"]=K1["[object Int32Array]"]=K1["[object Map]"]=K1["[object Number]"]=K1[q1]=K1["[object RegExp]"]=K1["[object Set]"]=K1["[object String]"]=K1["[object Symbol]"]=K1["[object Uint8Array]"]=K1["[object Uint8ClampedArray]"]=K1["[object Uint16Array]"]=K1["[object Uint32Array]"]=!0,K1["[object Error]"]=K1[X1]=K1["[object WeakMap]"]=!1;const Z1=function e(t,n,i,r,s,o){var a,l=1&n,u=2&n,c=4&n;if(i&&(a=s?i(t,r,s,o):i(t)),void 0!==a)return a;if(!Zj(t))return t;var d=Rj(t);if(d){if(a=S1(t),!l)return Z0(t,a)}else{var h=I1(t),p=h==X1||"[object GeneratorFunction]"==h;if(v0(t))return K0(t,l);if(h==q1||h==W1||p&&!s){if(a=u||p?{}:U1(t),!l)return u?o1(t,G0(a,t)):i1(t,U0(a,t))}else{if(!K1[h])return s?t:{};a=P1(t,h,l)}}o||(o=new d0);var f=o.get(t);if(f)return f;o.set(t,a),H1(t)?t.forEach(function(r){a.add(e(r,n,i,r,t,o))}):j1(t)&&t.forEach(function(r,s){a.set(s,e(r,n,i,s,t,o))});var m=d?void 0:(c?u?u1:l1:u?Y0:$0)(t);return h0(m||t,function(r,s){m&&(r=t[s=r]),KX(a,s,e(r,n,i,s,t,o))}),a};const Q1=function(e){return Z1(e,5)};const J1=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const e2=function(e){return this.__data__.has(e)};function t2(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new zY;++t<n;)this.add(e[t])}t2.prototype.add=t2.prototype.push=J1,t2.prototype.has=e2;const n2=t2;const i2=function(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1};const r2=function(e,t){return e.has(t)};const s2=function(e,t,n,i,r,s){var o=1&n,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var u=s.get(e),c=s.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,p=2&n?new n2:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var f=e[d],m=t[d];if(i)var g=o?i(m,f,d,t,e,s):i(f,m,d,e,t,s);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!i2(t,function(e,t){if(!r2(p,t)&&(f===e||r(f,e,n,i,s)))return p.push(t)})){h=!1;break}}else if(f!==m&&!r(f,m,n,i,s)){h=!1;break}}return s.delete(e),s.delete(t),h};const o2=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n};const a2=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var l2=Lj?Lj.prototype:void 0,u2=l2?l2.valueOf:void 0;const c2=function(e,t,n,i,r,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new C1(e),new C1(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return wY(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=o2;case"[object Set]":var l=1&i;if(a||(a=a2),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;i|=2,o.set(e,t);var c=s2(a(e),a(t),i,r,s,o);return o.delete(e),c;case"[object Symbol]":if(u2)return u2.call(e)==u2.call(t)}return!1};var d2=Object.prototype.hasOwnProperty;const h2=function(e,t,n,i,r,s){var o=1&n,a=l1(e),l=a.length;if(l!=l1(t).length&&!o)return!1;for(var u=l;u--;){var c=a[u];if(!(o?c in t:d2.call(t,c)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var f=o;++u<l;){var m=e[c=a[u]],g=t[c];if(i)var _=o?i(g,m,c,t,e,s):i(m,g,c,e,t,s);if(!(void 0===_?m===g||r(m,g,n,i,s):_)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var y=e.constructor,v=t.constructor;y==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(p=!1)}return s.delete(e),s.delete(t),p};var p2="[object Arguments]",f2="[object Array]",m2="[object Object]",g2=Object.prototype.hasOwnProperty;const _2=function(e,t,n,i,r,s){var o=Rj(e),a=Rj(t),l=o?f2:I1(e),u=a?f2:I1(t),c=(l=l==p2?m2:l)==m2,d=(u=u==p2?m2:u)==m2,h=l==u;if(h&&v0(e)){if(!v0(t))return!1;o=!0,c=!1}if(h&&!c)return s||(s=new d0),o||O0(e)?s2(e,t,n,i,r,s):c2(e,t,l,n,i,r,s);if(!(1&n)){var p=c&&g2.call(e,"__wrapped__"),f=d&&g2.call(t,"__wrapped__");if(p||f){var m=p?e.value():e,g=f?t.value():t;return s||(s=new d0),r(m,g,n,i,s)}}return!!h&&(s||(s=new d0),h2(e,t,n,i,r,s))};const y2=function e(t,n,i,r,s){return t===n||(null==t||null==n||!Hj(t)&&!Hj(n)?t!=t&&n!=n:_2(t,n,i,r,e,s))};const v2=function(e,t){return y2(e,t)},b2=hG({disabled:Boolean}),T2={file:e=>Hx(e)},x2="ElUploadDrag",E2=dS({name:x2}),w2=dS({...E2,props:b2,emits:T2,setup(e,{emit:t}){tO(jJ)||gW(x2,"usage: <el-upload><el-upload-dragger /></el-upload>");const n=ij("upload"),i=EI(!1),r=nX(),s=e=>{if(r.value)return;i.value=!1,e.stopPropagation();const n=Array.from(e.dataTransfer.files),s=e.dataTransfer.items||[];n.forEach((e,t)=>{var n;const i=s[t],r=null==(n=null==i?void 0:i.webkitGetAsEntry)?void 0:n.call(i);r&&(e.isDirectory=r.isDirectory)}),t("file",n)},o=()=>{r.value||(i.value=!0)},a=e=>{e.currentTarget.contains(e.relatedTarget)||(i.value=!1)};return(e,t)=>(uM(),mM("div",{class:CE([CI(n).b("dragger"),CI(n).is("dragover",i.value)]),onDrop:KR(s,["prevent"]),onDragover:KR(o,["prevent"]),onDragleave:KR(a,["prevent"])},[mC(e.$slots,"default")],42,["onDrop","onDragover","onDragleave"]))}});var I2=HH(w2,[["__file","upload-dragger.vue"]]);const A2=hG({...JJ,beforeUpload:{type:Function,default:Bx},onRemove:{type:Function,default:Bx},onStart:{type:Function,default:Bx},onSuccess:{type:Function,default:Bx},onProgress:{type:Function,default:Bx},onError:{type:Function,default:Bx},onExceed:{type:Function,default:Bx}}),S2=dS({name:"ElUploadContent",inheritAttrs:!1}),C2=dS({...S2,props:A2,setup(e,{expose:t}){const n=e,i=ij("upload"),r=nX(),s=wI({}),o=wI(),a=e=>{if(0===e.length)return;const{autoUpload:t,limit:i,fileList:r,multiple:s,onStart:o,onExceed:a}=n;if(i&&r.length+e.length>i)a(e,r);else{s||(e=e.slice(0,1));for(const n of e){const e=n;e.uid=QJ(),o(e),t&&l(e)}}},l=async e=>{if(o.value.value="",!n.beforeUpload)return u(e);let t,i={};try{const r=n.data,s=n.beforeUpload(e);i=rE(n.data)?Q1(n.data):n.data,t=await s,rE(n.data)&&v2(r,i)&&(i=Q1(n.data))}catch(e){t=!1}if(!1===t)return void n.onRemove(e);let r=e;t instanceof Blob&&(r=t instanceof File?t:new File([t],e.name,{type:e.type})),u(Object.assign(r,{uid:e.uid}),i)},u=async(e,t)=>{const{headers:i,data:r,method:o,withCredentials:a,name:l,action:u,onProgress:c,onSuccess:d,onError:h,httpRequest:p}=n;try{t=await(async(e,t)=>Kx(e)?e(t):e)(null!=t?t:r,e)}catch(t){return void n.onRemove(e)}const{uid:f}=e,m={headers:i||{},withCredentials:a,file:e,data:t,method:o,filename:l,action:u,onProgress:t=>{c(t,e)},onSuccess:t=>{d(t,e),delete s.value[f]},onError:t=>{h(t,e),delete s.value[f]}},g=p(m);s.value[f]=g,g instanceof Promise&&g.then(m.onSuccess,m.onError)},c=e=>{const t=e.target.files;t&&a(Array.from(t))},d=()=>{r.value||(o.value.value="",o.value.click())},h=()=>{d()};return t({abort:e=>{const t=(n=s.value,Object.entries(n)).filter(e?([t])=>String(e.uid)===t:()=>!0);var n;t.forEach(([e,t])=>{t instanceof XMLHttpRequest&&t.abort(),delete s.value[e]})},upload:l}),(e,t)=>(uM(),mM("div",{class:CE([CI(i).b(),CI(i).m(e.listType),CI(i).is("drag",e.drag),CI(i).is("disabled",CI(r))]),tabindex:CI(r)?"-1":"0",onClick:d,onKeydown:QR(KR(h,["self"]),["enter","space"])},[e.drag?(uM(),gM(I2,{key:0,disabled:CI(r),onFile:a},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["disabled"])):mC(e.$slots,"default",{key:1}),xM("input",{ref_key:"inputRef",ref:o,class:CE(CI(i).e("input")),name:e.name,disabled:CI(r),multiple:e.multiple,accept:e.accept,type:"file",onChange:c,onClick:KR(()=>{},["stop"])},null,42,["name","disabled","multiple","accept","onClick"])],42,["tabindex","onKeydown"]))}});var O2=HH(C2,[["__file","upload-content.vue"]]);const M2="ElUpload",k2=e=>{var t;(null==(t=e.url)?void 0:t.startsWith("blob:"))&&URL.revokeObjectURL(e.url)},R2=(e,t)=>{const n=YH(e,"fileList",void 0,{passive:!0}),i=e=>n.value.find(t=>t.uid===e.uid);function r(e){var n;null==(n=t.value)||n.abort(e)}function s(e){n.value=n.value.filter(t=>t.uid!==e.uid)}return DO(()=>e.listType,t=>{"picture-card"!==t&&"picture"!==t||(n.value=n.value.map(t=>{const{raw:i,url:r}=t;if(!r&&i)try{t.url=URL.createObjectURL(i)}catch(i){e.onError(i,t,n.value)}return t}))}),DO(n,e=>{for(const t of e)t.uid||(t.uid=QJ()),t.status||(t.status="success")},{immediate:!0,deep:!0}),{uploadFiles:n,abort:r,clearFiles:function(e=["ready","uploading","success","fail"]){n.value=n.value.filter(t=>!e.includes(t.status))},handleError:(t,r)=>{const o=i(r);o&&(console.error(t),o.status="fail",s(o),e.onError(t,o,n.value),e.onChange(o,n.value))},handleProgress:(t,r)=>{const s=i(r);s&&(e.onProgress(t,s,n.value),s.status="uploading",s.percentage=Math.round(t.percent))},handleStart:t=>{VX(t.uid)&&(t.uid=QJ());const i={name:t.name,percentage:0,status:"ready",size:t.size,raw:t,uid:t.uid};if("picture-card"===e.listType||"picture"===e.listType)try{i.url=URL.createObjectURL(t)}catch(t){t.message,e.onError(t,i,n.value)}n.value=[...n.value,i],e.onChange(i,n.value)},handleSuccess:(t,r)=>{const s=i(r);s&&(s.status="success",s.response=t,e.onSuccess(t,s,n.value),e.onChange(s,n.value))},handleRemove:async t=>{const o=t instanceof File?i(t):t;o||gW(M2,"file to be removed not found");const a=t=>{r(t),s(t),e.onRemove(t,n.value),k2(t)};if(e.beforeRemove){!1!==await e.beforeRemove(o,n.value)&&a(o)}else a(o)},submit:function(){n.value.filter(({status:e})=>"ready"===e).forEach(({raw:e})=>{var n;return e&&(null==(n=t.value)?void 0:n.upload(e))})},revokeFileObjectURL:k2}},N2=dS({name:"ElUpload"}),D2=dS({...N2,props:e0,setup(e,{expose:t}){const n=e,i=nX(),r=wI(),{abort:s,submit:o,clearFiles:a,uploadFiles:l,handleStart:u,handleError:c,handleRemove:d,handleSuccess:h,handleProgress:p,revokeFileObjectURL:f}=R2(n,r),m=ak(()=>"picture-card"===n.listType),g=ak(()=>({...n,fileList:l.value,onStart:u,onProgress:p,onSuccess:h,onError:c,onRemove:d}));return JS(()=>{l.value.forEach(f)}),eO(jJ,{accept:PI(n,"accept")}),t({abort:s,submit:o,clearFiles:a,handleStart:u,handleRemove:d}),(e,t)=>(uM(),mM("div",null,[CI(m)&&e.showFileList?(uM(),gM(r0,{key:0,disabled:CI(i),"list-type":e.listType,files:CI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:CI(d)},fC({append:LA(()=>[EM(O2,NM({ref_key:"uploadRef",ref:r},CI(g)),{default:LA(()=>[e.$slots.trigger?mC(e.$slots,"trigger",{key:0}):OM("v-if",!0),!e.$slots.trigger&&e.$slots.default?mC(e.$slots,"default",{key:1}):OM("v-if",!0)]),_:3},16)]),_:2},[e.$slots.file?{name:"default",fn:LA(({file:t,index:n})=>[mC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):OM("v-if",!0),!CI(m)||CI(m)&&!e.showFileList?(uM(),gM(O2,NM({key:1,ref_key:"uploadRef",ref:r},CI(g)),{default:LA(()=>[e.$slots.trigger?mC(e.$slots,"trigger",{key:0}):OM("v-if",!0),!e.$slots.trigger&&e.$slots.default?mC(e.$slots,"default",{key:1}):OM("v-if",!0)]),_:3},16)):OM("v-if",!0),e.$slots.trigger?mC(e.$slots,"default",{key:2}):OM("v-if",!0),mC(e.$slots,"tip"),!CI(m)&&e.showFileList?(uM(),gM(r0,{key:3,disabled:CI(i),"list-type":e.listType,files:CI(l),crossorigin:e.crossorigin,"handle-preview":e.onPreview,onRemove:CI(d)},fC({_:2},[e.$slots.file?{name:"default",fn:LA(({file:t,index:n})=>[mC(e.$slots,"file",{file:t,index:n})])}:void 0]),1032,["disabled","list-type","files","crossorigin","handle-preview","onRemove"])):OM("v-if",!0)]))}});const F2=AG(HH(D2,[["__file","upload.vue"]]));const L2=function(){return Fj.Date.now()};var P2=/\s/;const B2=function(e){for(var t=e.length;t--&&P2.test(e.charAt(t)););return t};var $2=/^\s+/;const U2=function(e){return e?e.slice(0,B2(e)+1).replace($2,""):e};var V2=/^[-+]0x[0-9a-f]+$/i,z2=/^0b[01]+$/i,j2=/^0o[0-7]+$/i,Y2=parseInt;const G2=function(e){if("number"==typeof e)return e;if(Wj(e))return NaN;if(Zj(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Zj(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=U2(e);var n=z2.test(e);return n||j2.test(e)?Y2(e.slice(2),n?2:8):V2.test(e)?NaN:+e};var H2=Math.max,W2=Math.min;const X2=function(e,t,n){var i,r,s,o,a,l,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,s=r;return i=r=void 0,u=t,o=e.apply(s,n)}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=s}function m(){var e=L2();if(f(e))return g(e);a=setTimeout(m,function(e){var n=t-(e-l);return d?W2(n,s-(e-u)):n}(e))}function g(e){return a=void 0,h&&i?p(e):(i=r=void 0,o)}function _(){var e=L2(),n=f(e);if(i=arguments,r=this,l=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(m,t),c?p(e):o}(l);if(d)return clearTimeout(a),a=setTimeout(m,t),p(l)}return void 0===a&&(a=setTimeout(m,t)),o}return t=G2(t)||0,Zj(n)&&(c=!!n.leading,s=(d="maxWait"in n)?H2(G2(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,i=l=r=a=void 0},_.flush=function(){return void 0===a?o:g(L2())},_};const q2=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Zj(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),X2(e,t,{leading:i,maxWait:t,trailing:r})},K2=hG({urlList:{type:Array,default:()=>[]},zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},hideOnClickModal:Boolean,teleported:Boolean,closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),Z2={close:()=>!0,error:e=>e instanceof Event,switch:e=>oj(e),rotate:e=>oj(e)},Q2=dS({name:"ElImageViewer"}),J2=dS({...Q2,props:K2,emits:Z2,setup(e,{expose:t,emit:n}){var i;const r=e,s={CONTAIN:{name:"contain",icon:vI(oH)},ORIGINAL:{name:"original",icon:vI(_H)}};let o,a="";const{t:l}=lG(),u=ij("image-viewer"),{nextZIndex:c}=kj(),d=EI(),h=EI(),p=ZE(),f=ak(()=>{const{scale:e,minScale:t,maxScale:n}=r;return((e,t,n)=>Math.min(n,Math.max(t,e)))(e,t,n)}),m=EI(!0),g=EI(!1),_=EI(r.initialIndex),y=wI(s.CONTAIN),v=EI({scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),b=EI(null!=(i=r.zIndex)?i:c()),T=ak(()=>{const{urlList:e}=r;return e.length<=1}),x=ak(()=>0===_.value),E=ak(()=>_.value===r.urlList.length-1),w=ak(()=>r.urlList[_.value]),I=ak(()=>[u.e("btn"),u.e("prev"),u.is("disabled",!r.infinite&&x.value)]),A=ak(()=>[u.e("btn"),u.e("next"),u.is("disabled",!r.infinite&&E.value)]),S=ak(()=>{const{scale:e,deg:t,offsetX:n,offsetY:i,enableTransition:r}=v.value;let o=n/e,a=i/e;const l=t*Math.PI/180,u=Math.cos(l),c=Math.sin(l);o=o*u+a*c,a=a*u-n/e*c;const d={transform:`scale(${e}) rotate(${t}deg) translate(${o}px, ${a}px)`,transition:r?"transform .3s":""};return y.value.name===s.CONTAIN.name&&(d.maxWidth=d.maxHeight="100%"),d}),C=ak(()=>`${_.value+1} / ${r.urlList.length}`);function O(){p.stop(),null==o||o(),document.body.style.overflow=a,n("close")}function M(){m.value=!1}function k(e){g.value=!0,m.value=!1,n("error",e),e.target.alt=l("el.image.error")}function R(e){if(m.value||0!==e.button||!d.value)return;v.value.enableTransition=!1;const{offsetX:t,offsetY:n}=v.value,i=e.pageX,r=e.pageY,s=q2(e=>{v.value={...v.value,offsetX:t+e.pageX-i,offsetY:n+e.pageY-r}}),o=AH(document,"mousemove",s);AH(document,"mouseup",()=>{o()}),e.preventDefault()}function N(){v.value={scale:f.value,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}function D(){if(m.value||g.value)return;const e=yG(s),t=Object.values(s),n=y.value.name,i=(t.findIndex(e=>e.name===n)+1)%e.length;y.value=s[e[i]],N()}function F(e){g.value=!1;const t=r.urlList.length;_.value=(e+t)%t}function L(){x.value&&!r.infinite||F(_.value-1)}function P(){E.value&&!r.infinite||F(_.value+1)}function B(e,t={}){if(m.value||g.value)return;const{minScale:i,maxScale:s}=r,{zoomRate:o,rotateDeg:a,enableTransition:l}={zoomRate:r.zoomRate,rotateDeg:90,enableTransition:!0,...t};switch(e){case"zoomOut":v.value.scale>i&&(v.value.scale=Number.parseFloat((v.value.scale/o).toFixed(3)));break;case"zoomIn":v.value.scale<s&&(v.value.scale=Number.parseFloat((v.value.scale*o).toFixed(3)));break;case"clockwise":v.value.deg+=a,n("rotate",v.value.deg);break;case"anticlockwise":v.value.deg-=a,n("rotate",v.value.deg)}v.value.enableTransition=l}function $(e){var t;"pointer"===(null==(t=e.detail)?void 0:t.focusReason)&&e.preventDefault()}function U(){r.closeOnPressEscape&&O()}function V(e){if(e.ctrlKey)return e.deltaY<0||e.deltaY>0?(e.preventDefault(),!1):void 0}return DO(()=>f.value,e=>{v.value.scale=e}),DO(w,()=>{hA(()=>{const e=h.value;(null==e?void 0:e.complete)||(m.value=!0)})}),DO(_,e=>{N(),n("switch",e)}),KS(()=>{!function(){const e=q2(e=>{switch(e.code){case dW.esc:r.closeOnPressEscape&&O();break;case dW.space:D();break;case dW.left:L();break;case dW.up:B("zoomIn");break;case dW.right:P();break;case dW.down:B("zoomOut")}}),t=q2(e=>{B((e.deltaY||e.deltaX)<0?"zoomIn":"zoomOut",{zoomRate:r.zoomRate,enableTransition:!1})});p.run(()=>{AH(document,"keydown",e),AH(document,"wheel",t)})}(),o=AH("wheel",V,{passive:!1}),a=document.body.style.overflow,document.body.style.overflow="hidden"}),t({setActiveItem:F}),(e,t)=>(uM(),gM(CI(XZ),{to:"body",disabled:!e.teleported},{default:LA(()=>[EM(Rk,{name:"viewer-fade",appear:""},{default:LA(()=>[xM("div",{ref_key:"wrapper",ref:d,tabindex:-1,class:CE(CI(u).e("wrapper")),style:EE({zIndex:b.value})},[EM(CI(TQ),{loop:"",trapped:"","focus-trap-el":d.value,"focus-start-el":"container",onFocusoutPrevented:$,onReleaseRequested:U},{default:LA(()=>[xM("div",{class:CE(CI(u).e("mask")),onClick:KR(t=>e.hideOnClickModal&&O(),["self"])},null,10,["onClick"]),OM(" CLOSE "),xM("span",{class:CE([CI(u).e("btn"),CI(u).e("close")]),onClick:O},[EM(CI(JH),null,{default:LA(()=>[EM(CI(QG))]),_:1})],2),OM(" ARROW "),CI(T)?OM("v-if",!0):(uM(),mM(iM,{key:0},[xM("span",{class:CE(CI(I)),onClick:L},[EM(CI(JH),null,{default:LA(()=>[EM(CI(RG))]),_:1})],2),xM("span",{class:CE(CI(A)),onClick:P},[EM(CI(JH),null,{default:LA(()=>[EM(CI(DG))]),_:1})],2)],64)),e.$slots.progress||e.showProgress?(uM(),mM("div",{key:1,class:CE([CI(u).e("btn"),CI(u).e("progress")])},[mC(e.$slots,"progress",{activeIndex:_.value,total:e.urlList.length},()=>[SM(GE(CI(C)),1)])],2)):OM("v-if",!0),OM(" ACTIONS "),xM("div",{class:CE([CI(u).e("btn"),CI(u).e("actions")])},[xM("div",{class:CE(CI(u).e("actions__inner"))},[mC(e.$slots,"toolbar",{actions:B,prev:L,next:P,reset:D,activeIndex:_.value,setActiveItem:F},()=>[EM(CI(JH),{onClick:e=>B("zoomOut")},{default:LA(()=>[EM(CI(EH))]),_:1},8,["onClick"]),EM(CI(JH),{onClick:e=>B("zoomIn")},{default:LA(()=>[EM(CI(xH))]),_:1},8,["onClick"]),xM("i",{class:CE(CI(u).e("actions__divider"))},null,2),EM(CI(JH),{onClick:D},{default:LA(()=>[(uM(),gM(uC(CI(y).icon)))]),_:1}),xM("i",{class:CE(CI(u).e("actions__divider"))},null,2),EM(CI(JH),{onClick:e=>B("anticlockwise")},{default:LA(()=>[EM(CI(mH))]),_:1},8,["onClick"]),EM(CI(JH),{onClick:e=>B("clockwise")},{default:LA(()=>[EM(CI(gH))]),_:1},8,["onClick"])])],2)],2),OM(" CANVAS "),xM("div",{class:CE(CI(u).e("canvas"))},[g.value&&e.$slots["viewer-error"]?mC(e.$slots,"viewer-error",{key:0,activeIndex:_.value,src:CI(w)}):(uM(),mM("img",{ref_key:"imgRef",ref:h,key:CI(w),src:CI(w),style:EE(CI(S)),class:CE(CI(u).e("img")),crossorigin:e.crossorigin,onLoad:M,onError:k,onMousedown:R},null,46,["src","crossorigin"]))],2),mC(e.$slots,"default")]),_:3},8,["focus-trap-el"])],6)]),_:3})]),_:3},8,["disabled"]))}});const e3=AG(HH(J2,[["__file","image-viewer.vue"]])),t3=hG({hideOnClickModal:Boolean,src:{type:String,default:""},fit:{type:String,values:["","contain","cover","fill","none","scale-down"],default:""},loading:{type:String,values:["eager","lazy"]},lazy:Boolean,scrollContainer:{type:[String,Object]},previewSrcList:{type:Array,default:()=>[]},previewTeleported:Boolean,zIndex:{type:Number},initialIndex:{type:Number,default:0},infinite:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},zoomRate:{type:Number,default:1.2},scale:{type:Number,default:1},minScale:{type:Number,default:.2},maxScale:{type:Number,default:7},showProgress:Boolean,crossorigin:{type:String}}),n3={load:e=>e instanceof Event,error:e=>e instanceof Event,switch:e=>oj(e),close:()=>!0,show:()=>!0},i3=(e,t)=>{if(!_j)return!1;const n=((e,t)=>{var n;if(!_j||!e||!t)return"";let i=cE(t);"float"===i&&(i="cssFloat");try{const t=e.style[i];if(t)return t;const r=null==(n=document.defaultView)?void 0:n.getComputedStyle(e,"");return r?r[i]:""}catch(t){return e.style[i]}})(e,{undefined:"overflow",true:"overflow-y",false:"overflow-x"}[String(t)]);return["scroll","auto","overlay"].some(e=>n.includes(e))};const r3=dS({name:"ElImage",inheritAttrs:!1}),s3=dS({...r3,props:t3,emits:n3,setup(e,{expose:t,emit:n}){const i=e,{t:r}=lG(),s=ij("image"),o=kC(),a=ak(()=>uG(Object.entries(o).filter(([e])=>/^(data-|on[A-Z])/i.test(e)||["id","style"].includes(e)))),l=Pq({excludeListeners:!0,excludeKeys:ak(()=>Object.keys(a.value))}),u=EI(),c=EI(!1),d=EI(!0),h=EI(!1),p=EI(),f=EI(),m=_j&&"loading"in HTMLImageElement.prototype;let g;const _=ak(()=>[s.e("inner"),v.value&&s.e("preview"),d.value&&s.is("loading")]),y=ak(()=>{const{fit:e}=i;return _j&&e?{objectFit:e}:{}}),v=ak(()=>{const{previewSrcList:e}=i;return Hx(e)&&e.length>0}),b=ak(()=>{const{previewSrcList:e,initialIndex:t}=i;let n=t;return t>e.length-1&&(n=0),n}),T=ak(()=>"eager"!==i.loading&&(!m&&"lazy"===i.loading||i.lazy)),x=()=>{_j&&(d.value=!0,c.value=!1,u.value=i.src)};function E(e){d.value=!1,c.value=!1,n("load",e)}function w(e){d.value=!1,c.value=!0,n("error",e)}const I=Ij(function(e){e&&(x(),S())},200,!0);async function A(){var e;if(!_j)return;await hA();const{scrollContainer:t}=i;if(aj(t))f.value=t;else if(Zx(t)&&""!==t)f.value=null!=(e=document.querySelector(t))?e:void 0;else if(p.value){const e=((e,t)=>{if(!_j)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(i3(n,t))return n;n=n.parentNode}return n})(p.value);f.value=e===window?void 0:e}const{stop:n}=function(e,t,n={}){const{root:i,rootMargin:r="0px",threshold:s=.1,window:o=IH}=n,a=CH(()=>o&&"IntersectionObserver"in o);let l=vj;const u=a.value?DO(()=>({el:wH(e),root:wH(i)}),({el:e,root:n})=>{if(l(),!e)return;const i=new IntersectionObserver(t,{root:n,rootMargin:r,threshold:s});i.observe(e),l=()=>{i.disconnect(),l=vj}},{immediate:!0,flush:"post"}):vj,c=()=>{l(),u()};return wj(c),{isSupported:a,stop:c}}(p,([e])=>{I(e.isIntersecting)},{root:f});g=n}function S(){_j&&I&&(null==g||g(),f.value=void 0,g=void 0)}function C(){v.value&&(h.value=!0,n("show"))}function O(){h.value=!1,n("close")}function M(e){n("switch",e)}return DO(()=>i.src,()=>{T.value?(d.value=!0,c.value=!1,S(),A()):x()}),KS(()=>{T.value?A():x()}),t({showPreview:C}),(e,t)=>(uM(),mM("div",NM({ref_key:"container",ref:p},CI(a),{class:[CI(s).b(),e.$attrs.class]}),[c.value?mC(e.$slots,"error",{key:0},()=>[xM("div",{class:CE(CI(s).e("error"))},GE(CI(r)("el.image.error")),3)]):(uM(),mM(iM,{key:1},[void 0!==u.value?(uM(),mM("img",NM({key:0},CI(l),{src:u.value,loading:e.loading,style:CI(y),class:CI(_),crossorigin:e.crossorigin,onClick:C,onLoad:E,onError:w}),null,16,["src","loading","crossorigin"])):OM("v-if",!0),d.value?(uM(),mM("div",{key:1,class:CE(CI(s).e("wrapper"))},[mC(e.$slots,"placeholder",{},()=>[xM("div",{class:CE(CI(s).e("placeholder"))},null,2)])],2)):OM("v-if",!0)],64)),CI(v)?(uM(),mM(iM,{key:2},[h.value?(uM(),gM(CI(e3),{key:0,"z-index":e.zIndex,"initial-index":CI(b),infinite:e.infinite,"zoom-rate":e.zoomRate,"min-scale":e.minScale,"max-scale":e.maxScale,"show-progress":e.showProgress,"url-list":e.previewSrcList,scale:e.scale,crossorigin:e.crossorigin,"hide-on-click-modal":e.hideOnClickModal,teleported:e.previewTeleported,"close-on-press-escape":e.closeOnPressEscape,onClose:O,onSwitch:M},fC({toolbar:LA(t=>[mC(e.$slots,"toolbar",OE(IM(t)))]),default:LA(()=>[e.$slots.viewer?(uM(),mM("div",{key:0},[mC(e.$slots,"viewer")])):OM("v-if",!0)]),_:2},[e.$slots.progress?{name:"progress",fn:LA(t=>[mC(e.$slots,"progress",OE(IM(t)))])}:void 0,e.$slots["viewer-error"]?{name:"viewer-error",fn:LA(t=>[mC(e.$slots,"viewer-error",OE(IM(t)))])}:void 0]),1032,["z-index","initial-index","infinite","zoom-rate","min-scale","max-scale","show-progress","url-list","scale","crossorigin","hide-on-click-modal","teleported","close-on-press-escape"])):OM("v-if",!0)],64)):OM("v-if",!0)],16))}});const o3=AG(HH(s3,[["__file","image.vue"]])),a3={class:"card-header"},l3={key:0,class:"disabled-tag",style:{color:"#f56c6c","margin-left":"8px","font-size":"13px"}},u3={class:"el-dropdown-link"},c3={class:"card-content",style:{"flex-direction":"column",display:"flex"}},d3={class:"card-content-info"},h3={style:{display:"flex",gap:"4px"}},p3={__name:"ClassBox",props:{title:{type:String,default:"类别"},picList:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["add-sample","delete-sample","rename-class","delete-class","disable-class","clear-samples"],setup(e,{emit:t}){const n=e,i=t,r=EI(n.title),s=EI(!1),o=EI(r.value),a=EI(null),l=EI(null);function u(){s.value||(s.value=!0,o.value=r.value,hA(()=>{a.value&&a.value.input&&a.value.input.select()}))}function c(){o.value.trim()&&(r.value=o.value.trim(),i("rename-class",r.value)),s.value=!1}function d(){i("add-sample")}function h(){d(),l.value=setInterval(()=>{d()},200)}function p(){l.value&&(clearInterval(l.value),l.value=null)}function f(){i("delete-class")}function m(){i("disable-class")}function g(){i("clear-samples")}function _(){const e=new(UX());n.picList.forEach((t,n)=>{const i=t.split(",")[1];e.file(`sample_${n+1}.png`,i,{base64:!0})}),e.generateAsync({type:"blob"}).then(e=>{(0,BX.saveAs)(e,"samples.zip")})}function y(e){return new Promise((t,n)=>{if("application/zip"===e.type||e.name.endsWith(".zip")){const r=new(UX());r.loadAsync(e).then(e=>{const n=Object.values(e.files).filter(e=>!e.dir&&e.name.match(/\.(png|jpg|jpeg|gif|bmp)$/i));Promise.all(n.map(e=>r.file(e.name).async("blob").then(t=>{const n=new File([t],e.name,{type:t.type}),i=new FileReader;return i.readAsDataURL(n),new Promise(e=>i.onload=e)}))).then(e=>{e.forEach(e=>i("add-sample",e.target.result)),t(!1)})}).catch(n)}else{const r=new FileReader;r.onload=e=>{i("add-sample",e.target.result),t(!1)},r.onerror=n,r.readAsDataURL(e)}})}return DO(()=>n.title,e=>{r.value=e}),(e,t)=>(uM(),gM(CI(PX),{class:"class-box"},{header:LA(()=>[xM("div",a3,[xM("span",{class:"card-header-title",style:{cursor:"pointer"},onClick:u},[s.value?(uM(),gM(CI(jq),{key:1,ref_key:"inputRef",ref:a,modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),style:{width:"120px"},onKeyup:QR(c,["enter"]),onBlur:c},null,8,["modelValue"])):(uM(),mM(iM,{key:0},[SM(GE(r.value)+" ",1),EM(CI(JH),{onClick:KR(u,["stop"])},{default:LA(()=>[EM(CI(rH))]),_:1}),n.disabled?(uM(),mM("span",l3," 禁用 ")):OM("v-if",!0)],64))]),EM(CI(UJ),{class:"card-header-title"},{dropdown:LA(()=>[EM(CI(zJ),{class:"class-box-dropdown"},{default:LA(()=>[EM(CI(VJ),{class:"class-box-dropdown-item",onClick:f},{default:LA(()=>t[1]||(t[1]=[xM("span",{style:{color:"#f56c6c"}},"删除类别",-1)])),_:1}),EM(CI(VJ),{class:"class-box-dropdown-item",onClick:m},{default:LA(()=>[SM(GE(n.disabled?"启用":"禁用")+"类别 ",1)]),_:1}),EM(CI(VJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:g},{default:LA(()=>t[2]||(t[2]=[SM(" 清空样本 ")])),_:1},8,["disabled"]),EM(CI(VJ),{class:"class-box-dropdown-item",disabled:0===n.picList.length,onClick:_},{default:LA(()=>t[3]||(t[3]=[SM(" 导出样本 ")])),_:1},8,["disabled"])]),_:1})]),default:LA(()=>[xM("span",u3,[EM(CI(JH),null,{default:LA(()=>[EM(CI(fH))]),_:1})])]),_:1})])]),default:LA(()=>[xM("div",c3,[xM("div",d3,[SM(" 图像样本 "+GE(n.picList.length)+" ",1),xM("div",h3,[EM(CI(NX),{type:"primary",size:"small",disabled:n.disabled,onMousedown:h,onMouseup:p,onMouseleave:p},{default:LA(()=>[t[4]||(t[4]=SM(" 拍摄样本 ")),EM(CI(JH),null,{default:LA(()=>[EM(CI(BG))]),_:1})]),_:1},8,["disabled"]),EM(CI(F2),{"show-file-list":!1,"before-upload":y,accept:"image/*,.zip",disabled:n.disabled},{default:LA(()=>[EM(CI(NX),{plain:"",type:"primary",size:"small",disabled:n.disabled},{default:LA(()=>[t[5]||(t[5]=SM(" 上传样本 ")),EM(CI(JH),null,{default:LA(()=>[EM(CI(KG))]),_:1})]),_:1},8,["disabled"])]),_:1},8,["disabled"])])]),EM(OR,{name:"fade",tag:"div",class:"card-content-img"},{default:LA(()=>[(uM(!0),mM(iM,null,pC(n.picList.slice().reverse(),e=>(uM(),mM("div",{key:e,class:"card-content-img-wrapper",style:{position:"relative",display:"inline-block"}},[EM(CI(o3),{src:e,class:CE(["card-content-img-item",{"img-disabled":n.disabled}])},null,8,["src","class"]),EM(CI(JH),{class:"delete-icon",onClick:t=>function(e){i("delete-sample",e)}(e)},{default:LA(()=>[EM(CI(eH))]),_:2},1032,["onClick"])]))),128))]),_:1})])]),_:1}))}},f3=p3,m3={class:"camera-box"},g3={__name:"CameraBox",setup(e,{expose:t}){const n=EI(null),i=tO("shotList");return KS(()=>{navigator.mediaDevices.getUserMedia({video:!0}).then(e=>{n.value&&(n.value.srcObject=e)}).catch(e=>{console.error("无法访问摄像头:",e)})}),t({captureShot:function(){const e=n.value;if(!e)return;const t=e.videoWidth,r=e.videoHeight;let s=0,o=0,a=t,l=r;t>r?(s=(t-r)/2,a=r):r>t&&(o=(r-t)/2,l=t);const u=Math.min(a,l),c=document.createElement("canvas");return c.width=u,c.height=u,c.getContext("2d").drawImage(e,s,o,u,u,0,0,u,u),i.value.push(c.toDataURL("image/png")),c.toDataURL("image/png")}}),(e,t)=>(uM(),mM("div",m3,[xM("video",{id:"webcam",ref_key:"videoRef",ref:n,class:"video-crop",autoplay:"",playsinline:"",muted:"",height:"100%",width:"100%"},null,512)]))}};var _3=__webpack_require__(66262);const y3=(0,_3.A)(g3,[["__scopeId","data-v-da91b390"]]);var v3=__webpack_require__(15838),b3=__webpack_require__(15441),T3=__webpack_require__(29809),x3=__webpack_require__(9258),E3=__webpack_require__(10700);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const w3={kernelName:b3.ljI,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,E3.P)((0,T3.w)(n,"float32"),-1))}}};var I3=__webpack_require__(89359),A3=__webpack_require__(96522),S3=__webpack_require__(45702),C3=__webpack_require__(79348),O3=__webpack_require__(45793),M3=__webpack_require__(77126);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const k3={kernelName:b3.Vvy,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,O3.E)((0,T3.w)(n,"float32")),i=(0,C3.R)((0,M3.j)((0,S3.d)(1),t));return(0,A3.H)((0,I3.y)(e,i))}}}},R3={kernelName:b3.PH8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,C3.R)((0,M3.j)((0,O3.E)((0,T3.w)(n,"float32")),1));return(0,I3.y)(e,t)}}}};var N3=__webpack_require__(62198),D3=__webpack_require__(62302),F3=__webpack_require__(83791);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const L3={kernelName:b3.OMN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=N3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=N3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,F3.c)(t,i)),(0,D3.t)(t,n.shape)},b:()=>{let t=e;const n=N3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,F3.c)(t,n)),(0,D3.t)(t,i.shape)}}}},P3={kernelName:b3.EkD,saveAllInputs:!0,gradFunc:(e,t)=>{const n={};return t.forEach((t,i)=>{n[i]=()=>e.clone()}),n}};var B3=__webpack_require__(55537);
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const $3={kernelName:b3.Jp_,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,B3.P)(n)}}},U3={kernelName:b3.p_m,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,B3.P)(n)}}},V3={kernelName:b3.QKF,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,C3.R)((0,M3.j)((0,S3.d)(1),(0,O3.E)((0,T3.w)(n,"float32")))))}}};var z3=__webpack_require__(37523);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const j3={kernelName:b3.epO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,C3.R)((0,z3.W)((0,S3.d)(1),(0,O3.E)((0,T3.w)(n,"float32"))));return(0,I3.y)(e,t)}}}},Y3={kernelName:b3.lxb,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,N3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,z3.W)((0,O3.E)(n),(0,O3.E)(i));let s=(0,x3.l)(e,(0,I3.y)(i,t));const o=(0,N3.getReductionAxes)(n.shape,r);return o.length>0&&(s=(0,F3.c)(s,o)),(0,D3.t)(s,n.shape)},b:()=>{const t=(0,z3.W)((0,O3.E)(n),(0,O3.E)(i));let s=(0,A3.H)((0,x3.l)(e,(0,I3.y)(n,t)));const o=(0,N3.getReductionAxes)(i.shape,r);return o.length>0&&(s=(0,F3.c)(s,o)),(0,D3.t)(s,i.shape)}}}},G3={kernelName:b3.TyE,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,z3.W)((0,O3.E)((0,T3.w)(n,"float32")),1))}}},H3={kernelName:b3.zP9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,M3.j)((0,S3.d)(1),(0,O3.E)((0,T3.w)(n,"float32"))))}}};var W3=__webpack_require__(41585),X3=__webpack_require__(28189),q3=__webpack_require__(45119),K3=__webpack_require__(47195),Z3=__webpack_require__(70929);const Q3=(0,Z3.op)({avgPool3dGrad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s){const o=(0,X3.YT)(e,"dy","avgPool3dGrad"),a=(0,X3.YT)(t,"input","avgPool3dGrad");let l=o,u=a,c=!1;4===a.rank&&(c=!0,l=(0,D3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]]),u=(0,D3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),q3.vA(5===l.rank,()=>`Error in avgPool3dGrad: dy must be rank 5 but got rank ${l.rank}.`),q3.vA(5===u.rank,()=>`Error in avgPool3dGrad: input must be rank 5 but got rank ${u.rank}.`),(0,K3.s_)("avgPool3dGrad",r,s);const d={dy:l,input:u},h={filterSize:n,strides:i,pad:r,dimRoundingMode:s},p=W3.T2.runKernel(b3.wwC,d,h);return c?(0,D3.t)(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}}),J3={kernelName:b3.cS,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o,dimRoundingMode:a}=n;return{x:()=>Q3(e,i,r,s,o,a)}}};const e4=(0,Z3.op)({avgPoolGrad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r){const s=(0,X3.YT)(e,"dy","avgPoolGrad"),o=(0,X3.YT)(t,"input","avgPoolGrad");q3.vA(o.rank===s.rank,()=>`Rank of input (${o.rank}) does not match rank of dy (${s.rank})`);let a=o,l=s,u=!1;3===o.rank&&(u=!0,a=(0,D3.t)(o,[1,o.shape[0],o.shape[1],o.shape[2]]),l=(0,D3.t)(s,[1,s.shape[0],s.shape[1],s.shape[2]])),q3.vA(4===l.rank,()=>`Error in avgPoolGrad: dy must be rank 4 but got rank ${l.rank}.`),q3.vA(4===a.rank,()=>`Error in avgPoolGrad: input must be rank 4 but got rank ${a.rank}.`);const c={dy:l,input:a},d={filterSize:n,strides:i,pad:r},h=W3.T2.runKernel(b3.VCH,c,d);return u?(0,D3.t)(h,[h.shape[1],h.shape[2],h.shape[3]]):h}}),t4={kernelName:b3.ho8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{filterSize:r,strides:s,pad:o}=n;return{x:()=>e4(e,i,r,s,o)}}};var n4=__webpack_require__(65703);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const i4={kernelName:b3.jAQ,inputsToSave:["a","b"],gradFunc:(e,t,n)=>{const[i,r]=t,{transposeA:s,transposeB:o}=n;return s||o?!s&&o?{a:()=>(0,n4.N)(e,r,!1,!1),b:()=>(0,n4.N)(e,i,!0,!1)}:s&&!o?{a:()=>(0,n4.N)(r,e,!1,!0),b:()=>(0,n4.N)(i,e,!1,!1)}:{a:()=>(0,n4.N)(r,e,!0,!0),b:()=>(0,n4.N)(e,i,!0,!0)}:{a:()=>(0,n4.N)(e,r,!1,!0),b:()=>(0,n4.N)(i,e,!0,!1)}}};var r4=__webpack_require__(10776);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const s4={kernelName:b3.Ik2,gradFunc:(e,t,n)=>{const{blockShape:i,crops:r}=n;return{x:()=>(0,r4.e)(e,i,r)}}},o4={kernelName:b3.LB5,gradFunc:(e,t,n)=>{const i=n,r=i.inputShape,s=i.shape,o=Array.from(s);for(let e=r.length-1;e>=0;e--)if(r[e]===s[e])o[e]=1;else if(1!==r[e])throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${s}].`);const a=[];for(let e=0;e<o.length;e++)o[e]>1&&a.push(e);return{x:()=>(0,F3.c)(e,a,!0)}}},a4={kernelName:b3.KXH,gradFunc:e=>({x:()=>e.clone()})},l4={kernelName:b3.QDP,gradFunc:e=>({x:()=>(0,B3.P)(e)})};var u4=__webpack_require__(13337),c4=__webpack_require__(56508),d4=__webpack_require__(13789),h4=__webpack_require__(12151);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const p4={kernelName:b3.vaV,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{clipValueMin:r,clipValueMax:s}=n;return{x:()=>(0,h4._)((0,d4.n)((0,u4.D)(i,r),(0,c4.I)(i,s)),e,(0,B3.P)(e))}}},f4={kernelName:b3.$zE,inputsToSave:["x"],gradFunc:w3.gradFunc};var m4=__webpack_require__(66512);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const g4={kernelName:b3.$dB,saveAllInputs:!0,gradFunc:(e,t,n)=>{const i=t.map(e=>e.shape),{axis:r}=n,s=(0,q3.Y6)(r,t[0].shape)[0],o=i.map(e=>e[s]);return(0,m4.l)(e,o,s).map(e=>()=>e)}};var _4=__webpack_require__(25248),y4=__webpack_require__(80252);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const v4={kernelName:b3.p2J,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{dilations:s,strides:o,pad:a,dataFormat:l}=n;return q3.vA(K3.Dh(s),()=>`Error in gradient of conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`),{x:()=>(0,y4.v)(i.shape,e,r,o,a,l),filter:()=>(0,_4.H)(i,e,r.shape,o,a,l)}}};var b4=__webpack_require__(28794);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const T4={kernelName:b3.jfg,inputsToSave:["dy","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,{strides:s,pad:o,dataFormat:a,dimRoundingMode:l}=n;return{dy:()=>(0,b4.X)(e,r,s,o,a,1,l),filter:()=>(0,_4.H)(e,i,r.shape,s,o,a,l)}}};const x4=(0,Z3.op)({conv3DBackpropFilter_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r){let s=e;4===e.rank&&(s=(0,D3.t)(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]));let o=t;4===o.rank&&(o=(0,D3.t)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]])),q3.vA(5===s.rank,()=>`Error in conv3dDerFilter: input must be rank 5, but got shape ${s.shape}.`),q3.vA(5===o.rank,()=>`Error in conv3dDerFilter: dy must be rank 5, but got shape ${o.shape}.`),q3.vA(5===n.length,()=>`Error in conv3dDerFilter: filterShape must be length 5, but got ${n}.`),q3.vA(s.shape[4]===n[3],()=>`Error in conv3dDerFilter: depth of input ${s.shape[4]}) must match input depth in filter (${n[3]}.`),q3.vA(o.shape[4]===n[4],()=>`Error in conv3dDerFilter: depth of dy (${o.shape[4]}) must match output depth for filter (${n[4]}).`);const a={x:s,dy:o},l={strides:i,pad:r,filterShape:n};return W3.T2.runKernel(b3.iGz,a,l)}});var E4=__webpack_require__(31895);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const w4={kernelName:b3.A1h,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s}=n;q3.vA((0,K3.Dh)(i),()=>`Error in gradient of conv3D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const[o,a]=t;return{x:()=>(0,E4.c)(o.shape,e,a,r,s),filter:()=>x4(o,e,a.shape,r,s)}}};var I4=__webpack_require__(33726);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const A4={kernelName:b3.Mn0,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)((0,A3.H)((0,I4.F)((0,T3.w)(n,"float32"))),e)}}};var S4=__webpack_require__(58276);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const C4={kernelName:b3.MnK,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)((0,S4.L)((0,T3.w)(n,"float32")),e)}}};var O4=__webpack_require__(21078),M4=__webpack_require__(76808),k4=__webpack_require__(7703);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const R4={kernelName:b3.nY8,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r,exclusive:s,reverse:o}=n;return{x:()=>{const t=(0,O4.Em)([r],i.rank);let n=(0,M4.r)(e,r,s,!o);return null!=t&&(n=(0,k4.m)(n,t)),n}}}};var N4=__webpack_require__(41890),D4=__webpack_require__(83134);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const F4={kernelName:b3.tGH,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const{dilations:i,strides:r,pad:s,dimRoundingMode:o}=n,a=null==i?[1,1]:i;q3.vA(K3.Dh(a),()=>`Error in gradient of depthwiseConv2dNative: dilation rates greater than 1 are not yet supported. Got dilations '${a}'`);const[l,u]=t;return q3.vA(4===l.rank,()=>`Error in gradient of depthwiseConv2dNative: input must be rank 4, but got rank ${l.rank}.`),q3.vA(4===u.rank,()=>`Error in gradient of depthwiseConv2dNative: filter must be rank 4, but got rank ${u.rank}.`),q3.vA(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]}.`),q3.vA(K3.G0(r,a),()=>`Error in gradient of depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${a}'.`),K3.s_("depthwiseConv2d",s,o),{x:()=>(0,D4.l)(l.shape,e,u,r,s,a,o),filter:()=>(0,N4.x)(l,e,u.shape,r,s,a,o)}}},L4={kernelName:b3.jxD,inputsToSave:["x","filter"],gradFunc:(e,t,n)=>{const[i,r]=t,s={x:i,filter:r,dy:e},o={x:i,filter:r,dy:e};return{x:()=>W3.T2.runKernel(b3.bP9,s,n),filter:()=>W3.T2.runKernel(b3.pk0,o,n)}}},P4={kernelName:b3.Pah,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t,i={dy:e,y:n};return{x:()=>W3.T2.runKernel(b3.rsH,i)}}};var B4=__webpack_require__(8631);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const $4={kernelName:b3._s9,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,x3.l)((0,B4.o)((0,A3.H)((0,O3.E)(n))),2/Math.sqrt(Math.PI));return{x:()=>(0,x3.l)(e,i)}}},U4={kernelName:b3.ox3,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,n)}}},V4={kernelName:b3.ybN,inputsToSave:["input"],gradFunc:(e,t)=>{const[n]=t;return{input:()=>(0,D3.t)(e,n.shape)}}},z4={kernelName:b3.ybj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,B4.o)(n))}}},j4={kernelName:b3.ZgB,gradFunc:e=>({x:()=>(0,B3.P)(e)})},Y4={kernelName:b3.ElG,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,N3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,I3.y)(e,(0,T3.w)(i,"float32")),s=(0,N3.getReductionAxes)(n.shape,r);return s.length>0?(0,D3.t)((0,F3.c)(t,s),n.shape):t},b:()=>{let t=(0,x3.l)(e,(0,T3.w)(n,"float32"));const s=(0,N3.getReductionAxes)(i.shape,r);s.length>0&&(t=(0,D3.t)((0,F3.c)(t,s),i.shape));const o=(0,O3.E)(i);return(0,A3.H)((0,I3.y)(t,(0,T3.w)(o,"float32")))}}}};var G4=__webpack_require__(17820),H4=__webpack_require__(64826);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const W4={kernelName:b3.i5R,inputsToSave:["x","mean","variance","scale"],gradFunc:(e,t,n)=>{const{varianceEpsilon:i}=n,[r,s,o,a]=t,l=null==a?(0,S3.d)(1):a,u=(0,N3.getReductionAxes)(s.shape,r.shape),c=[];if(1===s.rank){for(let e=0;e<r.shape.length-1;++e)c.push(r.shape[e]);c.push(1)}const d=(0,M3.j)(r,s),h=(0,x3.l)(e,l),p=(0,G4.Z)((0,z3.W)(o,(0,S3.d)(i))),f=(0,x3.l)((0,x3.l)((0,x3.l)(p,p),p),(0,S3.d)(-.5));return{x:()=>1===s.rank?(0,D3.t)((0,x3.l)((0,x3.l)(e,(0,H4.V)((0,D3.t)(p,[1,1,1,s.shape[0]]),c)),l),r.shape):(0,D3.t)((0,x3.l)((0,x3.l)(e,p),l),r.shape),mean:()=>{let e=(0,x3.l)((0,x3.l)(p,(0,S3.d)(-1)),h);return 1===s.rank&&(e=(0,F3.c)(e,u)),(0,D3.t)(e,s.shape)},variance:()=>{let e=(0,x3.l)((0,x3.l)(f,d),h);return 1===s.rank&&(e=(0,F3.c)(e,u)),(0,D3.t)(e,s.shape)},scale:()=>{const t=(0,x3.l)(d,p);let n=(0,x3.l)(e,t);return 1===s.rank&&(n=(0,F3.c)(n,u)),(0,D3.t)(n,s.shape)},offset:()=>{let t=e;return 1===s.rank&&(t=(0,F3.c)(t,u)),(0,D3.t)(t,s.shape)}}}};var X4=__webpack_require__(54268),q4=__webpack_require__(97706);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const K4={kernelName:b3.mxL,inputsToSave:["x","indices"],gradFunc:(e,t,n)=>{const[i,r]=t,{axis:s,batchDims:o}=n,a=(0,q3.Y6)(s,i.shape)[0],l=(e,t,n)=>()=>{const i=e.shape,r=t.size,o=i.slice(0,a),l=o.length,u=i.slice(s,i.length).slice(1),c=u.length,d=Z4(0,l),h=Z4(l+1,l+1+c),p=Q4([o,[r],u]),f=(0,D3.t)(n,p),m=(0,D3.t)(t,[r]),g=Q4([[l],d,h]),_=(0,k4.m)(f,g);let y=(0,q4.z)(_,m,e.shape[a]);const v=(0,O4.gx)(g);return y=(0,k4.m)(y,v),y};if(1===o){const t=i.shape[0],n=i.split(t,0);return{x:()=>{const t=(0,X4.t)(n.map((t,n)=>l(t,r.slice(n,1),e.slice(n,1))()));return t.reshape(i.shape)},indices:()=>r}}return{x:l(i,r,e),indices:()=>r}}};function Z4(e,t){const n=[];for(let i=e;i<t;++i)n.push(i);return n}function Q4(e){const t=[];for(let n=0;n<e.length;++n)for(let i=0;i<e[n].length;++i)t.push(e[n][i]);return t}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const J4={kernelName:b3.lLS,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,B3.P)(n),b:()=>(0,B3.P)(i)}}},e5={kernelName:b3.lzr,gradFunc:e=>({x:()=>(0,T3.w)(e,"float32")})},t5={kernelName:b3.gIW,gradFunc:e=>({x:()=>(0,B3.P)(e)})},n5={kernelName:b3.E3$,gradFunc:e=>({x:()=>(0,B3.P)(e)})},i5={kernelName:b3.iPs,gradFunc:e=>({x:()=>(0,B3.P)(e)})};var r5=__webpack_require__(62058);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const s5={kernelName:b3.X0$,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{alpha:r}=n,s=(0,r5.r)(i,0);return{x:()=>(0,h4._)(s,e,(0,x3.l)(e,r))}}},o5={kernelName:b3.Cg$,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,z3.W)(n,1))}}},a5={kernelName:b3.tG8,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,T3.w)(n,"float32"))}}},l5={kernelName:b3.zfU,inputsToSave:[],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;return{logits:()=>{const t=(0,B4.o)(i);return(0,M3.j)(e,(0,x3.l)((0,F3.c)(e,r,!0),t))}}}};const u5=(0,Z3.op)({localResponseNormalizationBackprop_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i=5,r=1,s=1,o=.5){const a={x:e,y:t,dy:n},l={depthRadius:i,bias:r,alpha:s,beta:o};return W3.T2.runKernel(b3.ToN,a,l)}}),c5={kernelName:b3.jM4,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{depthRadius:s,bias:o,alpha:a,beta:l}=n;return{x:()=>u5(i,r,e,s,o,a,l)}}};var d5=__webpack_require__(13020);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function h5(e,t,n,i){return t.rank<n.rank&&(t=(0,D3.t)(t,O4.SM(t.shape,i))),e.rank<n.rank&&(e=(0,D3.t)(e,O4.SM(e.shape,i))),{x:()=>(0,x3.l)(e,(0,T3.w)((0,d5.L)(n,t),e.dtype))}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const p5={kernelName:b3.VAI,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const i=n,{reductionIndices:r}=i,s=t[0],o=h5(e,t[1],s,q3.Y6(r,s.shape));return{x:()=>o.x()}}};var f5=__webpack_require__(61303);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const m5={kernelName:b3.LDN,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,x3.l)(e,(0,T3.w)((0,u4.D)(n,i),"float32")),b:()=>(0,x3.l)(e,(0,T3.w)((0,f5.M)(n,i),"float32"))}}};const g5=(0,Z3.op)({maxPool3dGrad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s,o){const a=(0,X3.YT)(e,"dy","maxPool3dGrad"),l=(0,X3.YT)(t,"input","maxPool3dGrad"),u=(0,X3.YT)(n,"output","maxPool3dGrad");let c=a,d=l,h=u,p=!1;4===l.rank&&(p=!0,c=(0,D3.t)(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]]),d=(0,D3.t)(l,[1,l.shape[0],l.shape[1],l.shape[2],l.shape[3]]),h=(0,D3.t)(u,[1,u.shape[0],u.shape[1],u.shape[2],u.shape[3]])),q3.vA(5===c.rank,()=>`Error in maxPool3dGrad: dy must be rank 5 but got rank ${c.rank}.`),q3.vA(5===d.rank,()=>`Error in maxPool3dGrad: input must be rank 5 but got rank ${d.rank}.`),q3.vA(5===h.rank,()=>`Error in maxPool3dGrad: output must be rank 5 but got rank ${h.rank}.`),(0,K3.s_)("maxPool3dGrad",s,o);const f={dy:c,input:d,output:h},m={filterSize:i,strides:r,pad:s,dimRoundingMode:o},g=W3.T2.runKernel(b3.cHb,f,m);return p?(0,D3.t)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}}),_5={kernelName:b3.ySp,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=n;return{x:()=>g5(e,i,r,s,o,a,l)}}};const y5=(0,Z3.op)({maxPoolGrad_:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r,s,o){const a=(0,X3.YT)(e,"dy","maxPoolGrad"),l=(0,X3.YT)(t,"input","maxPoolGrad"),u=(0,X3.YT)(n,"output","maxPoolGrad");q3.vA(l.rank===a.rank,()=>`Rank of input (${l.rank}) does not match rank of dy (${a.rank})`),q3.vA(4===a.rank,()=>`Error in maxPoolGrad: dy must be rank 4 but got rank ${a.rank}.`),q3.vA(4===l.rank,()=>`Error in maxPoolGrad: input must be rank 4 but got rank ${l.rank}.`),K3.s_("maxPoolGrad",s,o);const c={dy:a,input:l,output:u},d={filterSize:i,strides:r,pad:s,dimRoundingMode:o};return W3.T2.runKernel(b3.RXX,c,d)}}),v5={kernelName:b3.t3d,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i,r]=t,{filterSize:s,strides:o,pad:a}=n;return{x:()=>y5(e,i,r,s,o,a)}}};var b5=__webpack_require__(61411);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const T5={kernelName:b3.g5A,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n,s=q3.Y6(r,i.shape),o=(0,O4.lb)(i.shape,s)[1],a=q3.Ze(o);return{x:()=>{const t=i.shape.slice();s.forEach(e=>{t[e]=1});const n=(0,D3.t)(e,t);return(0,I3.y)((0,x3.l)(n,(0,b5.S)(i.shape,"float32")),a)}}}},x5={kernelName:b3.lNG,inputsToSave:["x"],outputsToSave:[!0],gradFunc:(e,t,n)=>{const i=n,{axis:r}=i,[s,o]=t,a=h5(e,o,s,q3.Y6(r,s.shape));return{x:()=>a.x()}}},E5={kernelName:b3.LG0,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t;return{a:()=>(0,x3.l)(e,(0,T3.w)((0,c4.I)(n,i),"float32")),b:()=>(0,x3.l)(e,(0,T3.w)((0,r5.r)(n,i),"float32"))}}};var w5=__webpack_require__(17986);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const I5={kernelName:b3.x7F,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,w5.d)(e,s,i.shape)}}};var A5=__webpack_require__(15606);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const S5={kernelName:b3.BLA,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,N3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,N3.getReductionAxes)(n.shape,r);return t.length>0?(0,D3.t)((0,F3.c)(e,t),n.shape):e},b:()=>{const t=(0,x3.l)(e,(0,A3.H)((0,A5.R)((0,I3.y)(n,i)))),s=(0,N3.getReductionAxes)(i.shape,r);return s.length>0?(0,D3.t)((0,F3.c)(t,s),i.shape):t}}}},C5={kernelName:b3.xu7,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,N3.assertAndGetBroadcastShape)(n.shape,i.shape);return{a:()=>{const t=(0,x3.l)(e,(0,T3.w)(i,"float32")),s=(0,N3.getReductionAxes)(n.shape,r);return s.length>0?(0,D3.t)((0,F3.c)(t,s),n.shape):t},b:()=>{const t=(0,x3.l)(e,(0,T3.w)(n,"float32")),s=(0,N3.getReductionAxes)(i.shape,r);return s.length>0?(0,D3.t)((0,F3.c)(t,s),i.shape):t}}}},O5={kernelName:b3.l0G,gradFunc:e=>({x:()=>(0,A3.H)(e)})};var M5=__webpack_require__(42855);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const k5={kernelName:b3.urI,inputsToSave:["indices"],gradFunc:(e,t)=>{const n=t[0];return{indices:()=>(0,M5.U)(n.shape,"float32")}}},R5={kernelName:b3.LWX,gradFunc:e=>({x:()=>(0,B3.P)(e)})};var N5=__webpack_require__(67261);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const D5={kernelName:b3.mM$,saveAllInputs:!0,gradFunc:(e,t,n)=>{const{axis:i}=n;return(0,N5.K)(e,i).map(e=>()=>e)}},F5={kernelName:b3.ODT,inputsToSave:["x"],gradFunc:(e,t,n)=>{const i=t[0],{paddings:r}=n,s=r.map(e=>e[0]);return{x:()=>(0,w5.d)(e,s,i.shape)}}};var L5=__webpack_require__(44010),P5=__webpack_require__(98990);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const B5={kernelName:b3.pyJ,inputsToSave:["a","b"],outputsToSave:[!0],gradFunc:(e,t)=>{const[n,i,r]=t,s=n,o=i,a=N3.assertAndGetBroadcastShape(s.shape,o.shape);return{a:()=>{const t=(0,T3.w)(o,"float32");let n=(0,x3.l)(e,(0,x3.l)(t,(0,P5.n)(s,(0,M3.j)(t,(0,S3.d)(1)))));const i=N3.getReductionAxes(s.shape,a);return i.length>0&&(n=(0,F3.c)(n,i)),(0,D3.t)(n,s.shape)},b:()=>{const t=(0,r5.r)(s,0),n=(0,h4._)(t,(0,L5.R)(s),(0,B3.P)(s));let i=(0,x3.l)(e,(0,x3.l)(r,n));const l=N3.getReductionAxes(o.shape,a);return l.length>0&&(i=(0,F3.c)(i,l)),(0,D3.t)(i,o.shape)}}}},$5={kernelName:b3.Ncv,inputsToSave:["x","alpha"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,r5.r)(n,0);return{x:()=>(0,h4._)(r,e,(0,x3.l)(e,i)),alpha:()=>{let t=(0,h4._)(r,(0,B3.P)(e),(0,x3.l)(e,n));const s=(0,N3.getReductionAxes)(i.shape,e.shape);return s.length>0&&(t=(0,F3.c)(t,s)),(0,D3.t)(t,i.shape)}}}};var U5=__webpack_require__(10302);function V5(e,t,n){const i=e.shape.length,r=i-n.length,s=O4.Em(n,i);let o=e;null!=s&&(o=(0,k4.m)(e,s));const a=o.shape.slice(),l=a.splice(i-n.length,n.length).reduce((e,t)=>e*t,1);a.push(l);let u=
/**
* @license
* Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=e.shape.slice();i[n]=1;const r=(0,D3.t)(t,i),s=(0,U5.L)(e,n,!0,!1),o=(0,U5.L)(e,n,!0,!0),a=(0,x3.l)(s,o);return(0,x3.l)(r,a)}(o.reshape(a),t,r);if(u=u.reshape(o.shape),null!=s){const e=O4.gx(s);u=(0,k4.m)(u,e)}return u}const z5={kernelName:b3.kdj,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{axis:r}=n;let s=[];return s=null==r?i.shape.map((e,t)=>t):"number"==typeof r?[r]:r,{x:()=>V5(i,e,s)}}},j5={kernelName:b3.sDr,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=N3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{const t=(0,I3.y)(e,(0,T3.w)(i,"float32")),s=N3.getReductionAxes(n.shape,r);return s.length>0?(0,D3.t)((0,F3.c)(t,s),n.shape):t},b:()=>{let t=(0,x3.l)(e,(0,T3.w)(n,"float32"));const s=N3.getReductionAxes(i.shape,r);s.length>0&&(t=(0,D3.t)((0,F3.c)(t,s),i.shape));const o=(0,O3.E)(i);return(0,A3.H)((0,I3.y)(t,(0,T3.w)(o,"float32")))}}}},Y5={kernelName:b3.huO,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,A3.H)((0,O3.E)(n)))}}},G5={kernelName:b3.P_L,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t,i=(0,x3.l)((0,c4.I)(n,6),(0,E3.P)(n));return{x:()=>(0,x3.l)(e,(0,T3.w)(i,"float32"))}}},H5={kernelName:b3.fUj,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,T3.w)((0,E3.P)(n),"float32"))}}},W5={kernelName:b3.R23,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,D3.t)(e,n.shape)}}},X5={kernelName:b3.hgw,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>W3.T2.runKernel(b3.FCQ,r,n)}}},q5={kernelName:b3.jOE,inputsToSave:["images"],gradFunc:(e,t,n)=>{const[i]=t,r={dy:e,images:i};return{images:()=>W3.T2.runKernel(b3.XQy,r,n)}}};var K5=__webpack_require__(53262);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Z5={kernelName:b3.D7i,gradFunc:(e,t,n)=>{const{dims:i}=n,r=(0,q3.Y6)(i,e.shape);return{x:()=>(0,K5.B)(e,r)}}},Q5={kernelName:b3.hVg,gradFunc:e=>({x:()=>(0,B3.P)(e)})},J5={kernelName:b3.TOR,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,A3.H)((0,I3.y)(e,(0,x3.l)((0,P5.n)(n,1.5),2)))}}};var e6=__webpack_require__(89881);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const t6={kernelName:b3.l6P,inputsToSave:["condition"],gradFunc:(e,t)=>{const[n]=t;return{condition:()=>(0,T3.w)((0,B3.P)(n),"float32"),t:()=>(0,x3.l)(e,(0,T3.w)(n,e.dtype)),e:()=>(0,x3.l)(e,(0,T3.w)((0,e6.N)(n),e.dtype))}}};var n6=__webpack_require__(28576);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const i6={kernelName:b3.u$b,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>{const t=(0,r5.r)(n,(0,S3.d)(0)),i=(0,S3.d)(n6.j),r=(0,S3.d)(n6.X),s=(0,x3.l)(e,r),o=(0,x3.l)((0,x3.l)(e,i),(0,B4.o)((0,T3.w)(n,"float32")));return(0,h4._)(t,s,o)}}}},r6={kernelName:b3.vI1,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,x3.l)(n,(0,M3.j)((0,S3.d)(1),n)))}}},s6={kernelName:b3.YVe,gradFunc:e=>({x:()=>(0,B3.P)(e)})};var o6=__webpack_require__(99907);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const a6={kernelName:b3.hql,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)((0,o6.g)((0,T3.w)(n,"float32")),e)}}};var l6=__webpack_require__(27451);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const u6={kernelName:b3.J3C,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)((0,l6.y)((0,T3.w)(n,"float32")),e)}}};var c6=__webpack_require__(65661),d6=__webpack_require__(34969);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const h6={kernelName:b3.JiE,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{begin:r,size:s}=n,o=i.shape,[a,l]=(0,d6.parseSliceParams)(i,r,s),u=[];for(let t=0;t<e.rank;t++)u.push([a[t],o[t]-a[t]-l[t]]);return{x:()=>(0,c6.e)(e,u)}}},p6={kernelName:b3.rFG,outputsToSave:[!0],gradFunc:(e,t,n)=>{const[i]=t,{dim:r}=n,s=(0,x3.l)(e,i);return{logits:()=>(0,M3.j)(s,(0,x3.l)((0,F3.c)(s,[r],true),i))}}};var f6=__webpack_require__(28968);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const m6={kernelName:b3.Fin,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,f6.r)(n))}}};var g6=__webpack_require__(69772);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const _6={kernelName:b3.A8B,gradFunc:(e,t,n)=>{const{blockShape:i,paddings:r}=n;return{x:()=>(0,g6.G)(e,i,r)}}};var y6=__webpack_require__(25030);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const v6={kernelName:b3.Blb,gradFunc:(e,t,n)=>{const{axis:i}=n;return{x:()=>(0,y6.x)(e,i)}}},b6={kernelName:b3.dFH,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,x3.l)((0,C3.R)((0,T3.w)(n,"float32")),2))}}},T6={kernelName:b3.M6A,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)(e,(0,x3.l)((0,T3.w)(n,"float32"),2))}}},x6={kernelName:b3.Ddj,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=(0,S3.d)(2);return{a:()=>(0,x3.l)(e,(0,x3.l)(r,(0,M3.j)(n,i))),b:()=>(0,x3.l)(e,(0,x3.l)(r,(0,M3.j)(i,n)))}}},E6={kernelName:b3.pnw,gradFunc:e=>({x:()=>(0,B3.P)(e)})},w6={kernelName:b3.PbM,inputsToSave:["a","b"],gradFunc:(e,t)=>{const[n,i]=t,r=N3.assertAndGetBroadcastShape(n.shape,i.shape);return{a:()=>{let t=e;const i=N3.getReductionAxes(n.shape,r);return i.length>0&&(t=(0,F3.c)(t,i)),(0,D3.t)(t,n.shape)},b:()=>{let t=e;const n=N3.getReductionAxes(i.shape,r);return n.length>0&&(t=(0,F3.c)(t,n)),(0,D3.t)((0,A3.H)(t),i.shape)}}}},I6={kernelName:b3.WuN,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,r=i.shape.slice(),{axis:s}=n;(0,q3.Y6)(s,i.shape).forEach(e=>{r[e]=1});const o=(0,D3.t)(e,r),a=(0,x3.l)(o,(0,b5.S)(i.shape,"float32"));return{x:()=>a}}},A6={kernelName:b3.oFs,inputsToSave:["x"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,I3.y)(e,(0,O3.E)((0,o6.g)(n)))}}},S6={kernelName:b3.iuW,outputsToSave:[!0],gradFunc:(e,t)=>{const[n]=t;return{x:()=>(0,x3.l)((0,M3.j)((0,S3.d)(1),(0,O3.E)(n)),e)}}},C6={kernelName:b3.FAs,inputsToSave:["x"],gradFunc:(e,t,n)=>{const[i]=t,{reps:r}=n;return{x:()=>{let t=(0,B3.P)(i);if(1===i.rank)for(let n=0;n<r[0];++n)t=(0,z3.W)(t,(0,w5.d)(e,[n*i.shape[0]],[i.shape[0]]));else if(2===i.rank)for(let n=0;n<r[0];++n)for(let s=0;s<r[1];++s)t=(0,z3.W)(t,(0,w5.d)(e,[n*i.shape[0],s*i.shape[1]],[i.shape[0],i.shape[1]]));else if(3===i.rank)for(let n=0;n<r[0];++n)for(let s=0;s<r[1];++s)for(let o=0;o<r[2];++o)t=(0,z3.W)(t,(0,w5.d)(e,[n*i.shape[0],s*i.shape[1],o*i.shape[2]],[i.shape[0],i.shape[1],i.shape[2]]));else{if(4!==i.rank)throw new Error(`Gradient for tile operation is not implemented for rank-${i.rank} tensors yet.`);for(let n=0;n<r[0];++n)for(let s=0;s<r[1];++s)for(let o=0;o<r[2];++o)for(let a=0;a<r[3];++a)t=(0,z3.W)(t,(0,w5.d)(e,[n*i.shape[0],s*i.shape[1],o*i.shape[2],a*i.shape[3]],[i.shape[0],i.shape[1],i.shape[2],i.shape[3]]))}return t}}}},O6={kernelName:b3.wx0,gradFunc:(e,t,n)=>{const i=n,{perm:r}=i,s=O4.gx(r);return{x:()=>(0,k4.m)(e,s)}}},M6={kernelName:b3.dXR,gradFunc:(e,t,n)=>{const i=n,{axis:r}=i;return{value:()=>(0,X4.t)(e,r)}}};var k6=__webpack_require__(8710),R6=__webpack_require__(48229),N6=__webpack_require__(30178);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const D6={kernelName:b3.pPe,inputsToSave:["segmentIds"],gradFunc:(e,t)=>{const[n]=t;return{x:()=>function(e,t){const n=(0,N6.P)(t,(0,B3.P)(t)),i=(0,R6.k)(e,n);let r=(0,u4.D)(t,(0,S3.d)(0,"int32"));const s=i.rank-r.rank;for(let e=0;e<s;++e)r=(0,k6.U)(r,e+1);r=(0,d4.n)(r,(0,b5.S)(i.shape,"bool"));const o=(0,B3.P)(i);return(0,h4._)(r,i,o)}(e,n)}}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const F6={kernelName:b3.xJ3,gradFunc:e=>({x:()=>(0,B3.P)(e)})};var L6=__webpack_require__(37074);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const P6=[w3,k3,R3,L3,P3,$3,U3,V3,j3,Y3,G3,H3,J3,t4,i4,s4,o4,a4,l4,p4,f4,g4,T4,v4,w4,A4,C4,R4,F4,L4,j5,P4,$4,U4,V4,z4,Y4,j4,W4,K4,J4,e5,t5,n5,i5,s5,o5,a5,l5,c5,p5,p5,m5,_5,v5,T5,x5,E5,I5,S5,C5,O5,k5,R5,D5,F5,F5,B5,$5,z5,Y5,G5,H5,W5,X5,q5,Z5,Q5,J5,t6,i6,r6,s6,a6,u6,h6,p6,m6,_6,_6,v6,v6,b6,x6,T6,E6,w6,I6,A6,S6,C6,O6,M6,D6,F6];for(const e of P6)(0,L6.kr)(e);__webpack_require__(20455);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class B6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,B6.prototype)}}class $6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,$6.prototype)}}class U6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,U6.prototype)}}class V6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,V6.prototype)}}class z6 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,z6.prototype)}}Error;
/**
* @license
* Copyright 2022 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class j6{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;t<this.maxEntries-e;t++){const e=this.cache.keys().next().value;this.cache.delete(e)}this.maxEntries=e}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Y6(e,t){if(Array.isArray(e)){let n=[];for(let i=0;i<t;i++)n=n.concat(e);return n}{const n=new Array(t);return n.fill(e),n}}function G6(e,t){if(!e)throw new z6(t)}function H6(e,t){let n=0;for(const i of e)i===t&&n++;return n}function W6(e){return 1===e.length?e[0]:e}function X6(e){return Array.isArray(e)?e:[e]}function q6(e){const t=e.replace(/(.)([A-Z][a-z0-9]+)/g,"$1_$2").replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase();return"_"!==t[0]?t:"private"+t}function K6(e){return e.length<=1||-1===e.indexOf("_")?e:e.replace(/[_]+(\w|$)/g,(e,t)=>t.toUpperCase())}let Z6={};function Q6(e){if(null==e)return null;const t={};return t.className=e.getClassName(),t.config=e.getConfig(),t}function J6(e){if(null!=e&&"object"==typeof e)if(Array.isArray(e))e.forEach(e=>J6(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?J6(t):e[n]=t.value)}}}function e8(e,t={},n={},i="object",r=!1){if("string"==typeof e){const r=e;let s;if(r in n)s=n[r];else if(r in Z6)s=Z6[r];else if(s=t[r],null==s)throw new U6(`Unknown ${i}: ${e}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);return s}{const s=e;if(null==s.className||null==s.config)throw new U6(`${i}: Improper config format: ${JSON.stringify(s)}.\n'className' and 'config' must set.`);const o=s.className;let a,l;if(o in n?[a,l]=n[o]:o in Z6?[a,l]=Z6.className:o in t&&([a,l]=t[o]),null==a)throw new U6(`Unknown ${i}: ${o}. This may be due to one of the following reasons:\n1. The ${i} is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.\n2. The custom ${i} is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().`);if(null!=l){const e={};for(const t of Object.keys(Z6))e[t]=Z6[t];for(const t of Object.keys(n))e[t]=n[t];s.config.customObjects=e;const t=Object.assign({},Z6);for(const e of Object.keys(n))Z6[e]=n[e];J6(s.config);const i=l(a,s.config,n,r);return Z6=Object.assign({},t),i}{const e=Object.assign({},Z6);for(const e of Object.keys(n))Z6[e]=n[e];const t=new a(s.config);return Z6=Object.assign({},e),t}}}function t8(e,t){return-1*function(e,t){return e<t?-1:e>t?1:0}(e,t)}function n8(e){if(null==e)return e;const t=[];for(const n of e)-1===t.indexOf(n)&&t.push(n);return t}function i8(e){if(null==e)throw new U6(`Invalid value in obj: ${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function r8(e,t,n){if(null!=n&&e.indexOf(n)<0)throw new U6(`${n} is not a valid ${t}. Valid values are ${e} or null/undefined.`)}function s8(e,t,n=0,i=1/0){return G6(n>=0),G6(i>=n),Array.isArray(e)&&e.length>=n&&e.length<=i&&e.every(e=>typeof e===t)}function o8(e,t){Array.isArray(e)?(v3.util.assert(e.length>0,()=>`${t} is unexpectedly an empty array.`),e.forEach((e,n)=>o8(e,`element ${n+1} of ${t}`))):v3.util.assert(Number.isInteger(e)&&e>0,()=>`Expected ${t} to be a positive integer, but got ${a8(e)}.`)}function a8(e){return null===e?"null":Array.isArray(e)?"["+e.map(e=>a8(e)).join(",")+"]":"string"==typeof e?`"${e}"`:`${e}`}function l8(e){return"relu"===e?"relu":"linear"===e?"linear":"elu"===e?"elu":null}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
let u8=0;function c8(){return u8++}const d8={};function h8(e=""){return e in d8||(d8[e]=0),d8[e]+=1,e+d8[e].toString()}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const p8=["channelsFirst","channelsLast"],f8=["nearest","bilinear"],m8=["valid","same","causal"],g8=["max","avg"],_8=["sum","mul","concat","ave"],y8=new Map;function v8(e){r8(p8,"DataFormat",e)}function b8(e){r8(m8,"PaddingMode",e)}function T8(e){r8(g8,"PoolMode",e)}const x8=[];function E8(e,t){x8.push(e);try{const e=t();return x8.pop(),e}catch(e){throw x8.pop(),e}}function w8(e){if(!S8(e))throw new Error("Not a valid tensor name: '"+e+"'");return(0===x8.length?"":x8.join("/")+"/")+e}function I8(e){if(!S8(e))throw new Error("Not a valid tensor name: '"+e+"'");y8.has(e)||y8.set(e,0);const t=y8.get(e);if(y8.set(e,y8.get(e)+1),t>0){const n=`${e}_${t}`;return y8.set(n,1),n}return e}const A8=new RegExp(/^[A-Za-z0-9][-A-Za-z0-9\._\/]*$/);function S8(e){return!!e.match(A8)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function C8(e){return e===parseInt(e.toString(),10)}function O8(e,t,n){null==t&&(t=0),null==n&&(n=e.length);let i=1;for(let r=t;r<n;++r)i*=e[r];return i}function M8(e){if(0===e.length)return Number.NaN;let t=Number.POSITIVE_INFINITY;for(let n=0;n<e.length;n++){const i=e[n];i<t&&(t=i)}return t}function k8(e){if(0===e.length)return Number.NaN;let t=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const i=e[n];i>t&&(t=i)}return t}function R8(e,t){if(t<e)throw new U6(`end (${t}) < begin (${e}) is forbidden.`);const n=[];for(let i=e;i<t;++i)n.push(i);return n}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
let N8;function D8(){return null==N8&&(N8=(0,v3.backend)().epsilon()),N8}function F8(e,t){return v3.cast(e,t)}function L8(e,t=-1){const n=e.shape.slice();return t<0&&(t=n.length+t+1),n.splice(t,0,1),v3.reshape(e,n)}function P8(e,t,n){return(0,v3.tidy)(()=>{switch(e.rank){case 1:return v3.slice1d(e,t,n);case 2:return v3.slice2d(e,[t,0],[n,e.shape[1]]);case 3:return v3.slice3d(e,[t,0,0],[n,e.shape[1],e.shape[2]]);case 4:return v3.slice4d(e,[t,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3]]);case 5:return v3.slice(e,[t,0,0,0,0],[n,e.shape[1],e.shape[2],e.shape[3],e.shape[4]]);case 6:return v3.slice(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 U6(`sliceAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}})}function B8(e,t,n){return(0,v3.tidy)(()=>{switch(e.rank){case 1:return v3.slice1d(e,t,n);case 2:return v3.slice2d(e,[0,t],[e.shape[0],n]);case 3:return v3.slice3d(e,[0,0,t],[e.shape[0],e.shape[1],n]);case 4:return v3.slice4d(e,[0,0,0,t],[e.shape[0],e.shape[1],e.shape[2],n]);default:throw new U6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function $8(e,t,n,i){return(0,v3.tidy)(()=>{switch(e.rank){case 1:return v3.slice1d(e,t,n);case 2:switch(i){case 1:return P8(e,t,n);case 2:return B8(e,t,n);default:throw new U6(`The axis is not within the rank of the tensor ${i}`)}case 3:switch(i){case 1:return P8(e,t,n);case 2:return v3.slice3d(e,[0,t,0],[e.shape[0],n,e.shape[2]]);case 3:return B8(e,t,n);default:throw new U6(`The axis is not within the rank of the tensor ${i}`)}case 4:switch(i){case 1:return P8(e,t,n);case 2:return v3.slice4d(e,[0,t,0,0],[e.shape[0],n,e.shape[2],e.shape[3]]);case 3:return v3.slice4d(e,[0,0,t,0],[e.shape[0],e.shape[1],n,e.shape[3]]);case 4:return B8(e,t,n);default:throw new U6(`The axis is not within the rank of the tensor ${i}`)}default:throw new U6(`sliceAlongLastAxis() received an unsupported tensor rank: ${e.rank}`)}})}function U8(e,t=-1){let n;return t<0&&(n=e[0].rank,t=0!==n?n:0),t===e[0].rank&&(t=-1),v3.concat(e,t)}function V8(e,t){switch(e.rank){case 1:return v3.concat1d([e,t]);case 2:return v3.concat2d([e,t],0);case 3:return v3.concat3d([e,t],0);case 4:return v3.concat4d([e,t],0);default:throw new U6(`concatAlongFirstAxis() received an unsupported tensor rank: ${e.rank}`)}}function z8(e,t){if(Array.isArray(t)||(t=[t]),e.rank!==t.length)throw new U6(`The length of input n (${t.length}) does not match the number of dimensions in input x (${e.rank})`);return v3.tile(e,t)}function j8(e,t=0,n=1,i,r){return v3.randomNormal(e,t,n,i,r)}function Y8(e,t,n,i){if(e.rank<2||t.rank<2)throw new V6(`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 V6(`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){const r=!1,s=!1;return v3.fused.matMul({a:e,b:t,transposeA:r,transposeB:s,bias:i?W8(e.rank,i,"channelsLast"):null,activation:n})}{const r=e.shape.slice(),s=r.pop();e=v3.reshape(e,[-1,s]);const o=t.shape.slice(),a=o.pop(),l=o.pop(),u=[...o,a],c=Array.from({length:t.rank},(e,n)=>0===n?t.rank-2:n<=t.rank-2?n-1:n);t=v3.reshape(v3.transpose(t,c),[l,-1]);const d=[...r,...u],h=!1,p=!1;return v3.reshape(v3.fused.matMul({a:e,b:t,transposeA:h,transposeB:p,bias:i?W8(e.rank,i,"channelsLast"):null,activation:n}),d)}}function G8(e,t,n){return(0,v3.tidy)(()=>(t=Array.isArray(t)?(0,v3.tensor1d)(t,"int32"):v3.cast(t,"int32"),v3.gather(e,t,n)))}function H8(e){return v3.mul(e,e)}function W8(e,t,n){const i=t.shape;if(1!==t.rank&&t.rank!==e)throw new U6(`Unexpected bias dimensions: ${t.rank}; expected it to be 1 or ${e}`);if(5===e){if("channelsFirst"===n)return 1===i.length?v3.reshape(t,[1,i[0],1,1,1]):v3.reshape(t,[1,i[3],i[0],i[1],i[2]]);if("channelsLast"===n)return 1===i.length?v3.reshape(t,[1,1,1,1,i[0]]):v3.reshape(t,[1].concat(i))}else if(4===e){if("channelsFirst"===n)return 1===i.length?v3.reshape(t,[1,i[0],1,1]):v3.reshape(t,[1,i[2],i[0],i[1]]);if("channelsLast"===n)return 1===i.length?v3.reshape(t,[1,1,1,i[0]]):v3.reshape(t,[1].concat(i))}else if(3===e){if("channelsFirst"===n)return 1===i.length?v3.reshape(t,[1,i[0],1]):v3.reshape(t,[1,i[1],i[0]]);if("channelsLast"===n)return 1===i.length?v3.reshape(t,[1,1,i[0]]):v3.reshape(t,[1].concat(i))}else if(e<3)return t;throw new U6(`Unsupported input rank by biasAdd: ${t.rank}`)}function X8(e,t,n){return(0,v3.tidy)(()=>(null==n&&(n="channelsLast"),v8(n),v3.add(e,W8(e.rank,t,n))))}function q8(e,t,n,i){return(0,v3.tidy)(()=>v3.dropout(e,t,n,i))}function K8(e,t,n=!1){return n?e():t()}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const Z8=["fanIn","fanOut","fanAvg"],Q8=["normal","uniform","truncatedNormal"];class J8 extends v3.serialization.Serializable{fromConfigUsesCustomObjects(){return!1}getConfig(){return{}}}class e9 extends J8{apply(e,t){return(0,v3.zeros)(e,t)}}e9.className="Zeros",v3.serialization.registerClass(e9);class t9 extends J8{apply(e,t){return(0,v3.ones)(e,t)}}t9.className="Ones",v3.serialization.registerClass(t9);class n9 extends J8{constructor(e){if(super(),"object"!=typeof e)throw new U6(`Expected argument of type ConstantConfig but got ${e}`);if(void 0===e.value)throw new U6(`config must have value set but got ${e}`);this.value=e.value}apply(e,t){return(0,v3.tidy)(()=>(0,v3.mul)((0,v3.scalar)(this.value),(0,v3.ones)(e,t)))}getConfig(){return{value:this.value}}}n9.className="Constant",v3.serialization.registerClass(n9);class i9 extends J8{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(0,v3.randomUniform)(e,this.minval,this.maxval,t,this.seed)}getConfig(){return{minval:this.minval,maxval:this.maxval,seed:this.seed}}}i9.className="RandomUniform",v3.serialization.registerClass(i9);class r9 extends J8{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 V6(`randomNormal does not support dType ${t}.`);return j8(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}r9.className="RandomNormal",v3.serialization.registerClass(r9);class s9 extends J8{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 V6(`truncatedNormal does not support dType ${t}.`);return(0,v3.truncatedNormal)(e,this.mean,this.stddev,t,this.seed)}getConfig(){return{mean:this.mean,stddev:this.stddev,seed:this.seed}}}s9.className="TruncatedNormal",v3.serialization.registerClass(s9);class o9 extends J8{constructor(e){super(),this.gain=null!=e.gain?e.gain:1}apply(e,t){return(0,v3.tidy)(()=>{if(2!==e.length||e[0]!==e[1])throw new U6("Identity matrix initializer can only be used for 2D square matrices.");return(0,v3.mul)(this.gain,(0,v3.eye)(e[0]))})}getConfig(){return{gain:this.gain}}}o9.className="Identity",v3.serialization.registerClass(o9);class a9 extends J8{constructor(e){if(super(),e.scale<0)throw new U6(`scale must be a positive float. Got: ${e.scale}`);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
var t;this.scale=null==e.scale?1:e.scale,this.mode=null==e.mode?"fanIn":e.mode,t=this.mode,r8(Z8,"FanMode",t),this.distribution=null==e.distribution?"normal":e.distribution,function(e){r8(Q8,"Distribution",e)}(this.distribution),this.seed=e.seed}apply(e,t){const n=function(e,t="channelsLast"){let n,i;if(v8(t),2===e.length)n=e[0],i=e[1];else if(-1!==[3,4,5].indexOf(e.length)){if("channelsFirst"===t){const t=O8(e,2);n=e[1]*t,i=e[0]*t}else if("channelsLast"===t){const t=O8(e,0,e.length-2);n=e[e.length-2]*t,i=e[e.length-1]*t}}else{const t=O8(e);n=Math.sqrt(t),i=Math.sqrt(t)}return[n,i]}(e),i=n[0],r=n[1];let s=this.scale;if("fanIn"===this.mode?s/=Math.max(1,i):"fanOut"===this.mode?s/=Math.max(1,r):s/=Math.max(1,(i+r)/2),"normal"===this.distribution){const n=Math.sqrt(s);if("float32"!==(t=t||"float32")&&"int32"!==t)throw new V6(`${this.getClassName()} does not support dType ${t}.`);return(0,v3.truncatedNormal)(e,0,n,t,this.seed)}{const n=Math.sqrt(3*s);return(0,v3.randomUniform)(e,-n,n,t,this.seed)}}getConfig(){return{scale:this.scale,mode:this.mode,distribution:this.distribution,seed:this.seed}}}a9.className="VarianceScaling",v3.serialization.registerClass(a9);class l9 extends a9{constructor(e){super({scale:1,mode:"fanAvg",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return a9.className}}l9.className="GlorotUniform",v3.serialization.registerClass(l9);class u9 extends a9{constructor(e){super({scale:1,mode:"fanAvg",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return a9.className}}u9.className="GlorotNormal",v3.serialization.registerClass(u9);class c9 extends a9{constructor(e){super({scale:2,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return a9.className}}c9.className="HeNormal",v3.serialization.registerClass(c9);class d9 extends a9{constructor(e){super({scale:2,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return a9.className}}d9.className="HeUniform",v3.serialization.registerClass(d9);class h9 extends a9{constructor(e){super({scale:1,mode:"fanIn",distribution:"normal",seed:null==e?null:e.seed})}getClassName(){return a9.className}}h9.className="LeCunNormal",v3.serialization.registerClass(h9);class p9 extends a9{constructor(e){super({scale:1,mode:"fanIn",distribution:"uniform",seed:null==e?null:e.seed})}getClassName(){return a9.className}}p9.className="LeCunUniform",v3.serialization.registerClass(p9);class f9 extends J8{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(0,v3.tidy)(()=>{if(e.length<2)throw new V6("Shape must be at least 2D.");if("int32"!==t&&"float32"!==t&&void 0!==t)throw new TypeError(`Unsupported data type ${t}.`);const n=v3.util.sizeFromShape(e.slice(0,-1)),i=e[e.length-1],r=n*i;r>this.ELEMENTS_WARN_SLOW&&console.warn(`Orthogonal initializer is being called on a matrix with more than ${this.ELEMENTS_WARN_SLOW} (${r}) elements: Slowness may result.`);const s=j8([Math.max(i,n),Math.min(i,n)],0,1,t,this.seed),o=v3.linalg.qr(s,!1);let a=o[0];const l=o[1].flatten().stridedSlice([0],[Math.min(i,n)*Math.min(i,n)],[Math.min(i,n)+1]);return a=(0,v3.mul)(a,l.sign()),n<i&&(a=a.transpose()),(0,v3.mul)((0,v3.scalar)(this.gain),a.reshape(e))})}getConfig(){return{gain:this.gain,seed:this.seed}}}f9.className="Orthogonal",v3.serialization.registerClass(f9);const m9={constant:"Constant",glorotNormal:"GlorotNormal",glorotUniform:"GlorotUniform",heNormal:"HeNormal",heUniform:"HeUniform",identity:"Identity",leCunNormal:"LeCunNormal",leCunUniform:"LeCunUniform",ones:"Ones",orthogonal:"Orthogonal",randomNormal:"RandomNormal",randomUniform:"RandomUniform",truncatedNormal:"TruncatedNormal",varianceScaling:"VarianceScaling",zeros:"Zeros"};function g9(e,t={}){return e8(e,v3.serialization.SerializationMap.getMap().classNameMap,t,"initializer")}function _9(e){return Q6(e)}function y9(e){if("string"==typeof e){const t=e in m9?m9[e]:e;if("GlorotNormal"===t)return new u9;if("GlorotUniform"===t)return new l9;if("HeNormal"===t)return new c9;if("HeUniform"===t)return new d9;if("LeCunNormal"===t)return new h9;if("LeCunUniform"===t)return new p9;{const e={};return e.className=t,e.config={},g9(e)}}return e instanceof J8?e:g9(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function v9(e){return Array.isArray(e)&&Array.isArray(e[0])}function b9(e){return 0===e.length?[]:Array.isArray(e[0])?e:[e]}function T9(e){let t;if(Array.isArray(e)){if(1!==e.length)throw new U6(`Expected Tensor length to be 1; got ${e.length}`);t=e[0]}else t=e;return t}function x9(e){if(Array.isArray(e)&&Array.isArray(e[0])){if(1===e.length)return e[0];throw new U6(`Expected exactly 1 Shape; got ${e.length}`)}return e}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function E9(e){let t=0;for(const n of e)0===n.shape.length?t+=1:t+=n.shape.reduce((e,t)=>e*t);return t}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const w9="Variable";class I9{constructor(e,t="float32",n=w9,i=!0,r=null){this.dtype=null==t?"float32":t,this.shape=e.shape,this.id=c8(),n=null==n?w9:n,this.originalName=w8(n),this.name=I8(this.originalName),this.trainable_=i,this.constraint=r,this.val=v3.variable(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 A9(e){return e.map(e=>e.read())}function S9(e){e.forEach(e=>{e[0].write(e[1])})}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class C9{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 O9{constructor(e,t,n,i,r,s,o){this.dtype=e,this.shape=t,this.sourceLayer=n,this.inputs=i,this.callArgs=r,this.outputTensorIndex=o,this.id=c8(),null!=s&&(this.originalName=w8(s),this.name=I8(this.originalName)),this.rank=t.length}}let M9=0;class k9{constructor(e,t){this.callArgs=t,this.id=M9++,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 R9=0;class N9 extends v3.serialization.Serializable{constructor(e={}){super(),this._callHook=null,this._addedWeightNames=[],this._stateful=!1,this.id=R9++,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=q6(e)+"_"+h8(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 $6(`The layer has never been called and thus has no defined ${t}.`);if(this.inboundNodes.length<=e)throw new U6(`Asked to get ${t} at node ${e}, but the layer has only ${this.inboundNodes.length} inbound nodes.`);return this.inboundNodes[e]}getInputAt(e){return W6(this.getNodeAtIndex(e,"input").inputTensors)}getOutputAt(e){return W6(this.getNodeAtIndex(e,"output").outputTensors)}get input(){if(this.inboundNodes.length>1)throw new B6(`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 B6(`Layer ${this.name} is not connected, no input to return.`);return W6(this.getNodeAtIndex(0,"input").inputTensors)}get output(){if(0===this.inboundNodes.length)throw new B6(`Layer ${this.name} has no inbound nodes.`);if(this.inboundNodes.length>1)throw new B6(`Layer ${this.name} has multiple inbound nodes, hence the notion of "layer output" is ill-defined. Use \`getOutputAt(nodeIndex)\` instead.`);return W6(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=X6(e);if(null==this.inputSpec||0===this.inputSpec.length)return;const n=X6(this.inputSpec);if(t.length!==n.length)throw new U6(`Layer ${this.name} expects ${n.length} inputs, but it received ${t.length} input tensors. Input received: ${e}`);for(let e=0;e<t.length;e++){const i=t[e],r=n[e];if(null==r)continue;const s=i.rank;if(null!=r.ndim&&s!==r.ndim)throw new U6(`Input ${e} is incompatible with layer ${this.name}: expected ndim=${r.ndim}, found ndim=${s}`);if(null!=r.maxNDim&&s>r.maxNDim)throw new U6(`Input ${e} is incompatible with layer ${this.name}: expected max_ndim=${r.maxNDim}, found ndim=${s}`);if(null!=r.minNDim&&s<r.minNDim)throw new U6(`Input ${e} is incompatible with layer ${this.name}: expected min_ndim=${r.minNDim}, found ndim=${s}.`);if(null!=r.dtype&&i.dtype!==r.dtype)throw new U6(`Input ${e} is incompatible with layer ${this.name} : expected dtype=${r.dtype}, found dtype=${i.dtype}.`);if(r.axes){const t=i.shape;for(const n in r.axes){const i=Number(n),s=r.axes[n],o=i>=0?t[i]:t[t.length+i];if(null!=s&&-1===[s,null].indexOf(o))throw new U6(`Input ${e} is incompatible with layer ${this.name}: expected axis ${i} of input shape to have value ${s} but got shape ${t}.`)}}if(null!=r.shape)for(let t=0;t<r.shape.length;++t){const n=r.shape[t],s=i.shape[t];if(null!=n&&null!=s&&n!==s)throw new U6(`Input ${e} is incompatible with layer ${this.name}: expected shape=${r.shape}, found shape=${i.shape}.`)}}}call(e,t){return e}invokeCallHook(e,t){null!=this._callHook&&this._callHook(e,t)}setCallHook(e){this._callHook=e}clearCallHook(){this._callHook=null}apply(e,t){t=t||{},this.assertNotDisposed();const n=X6(e),i=function(e){let t=!0;for(const n of X6(e))if(!(n instanceof O9)){t=!1;break}return t}(e),r=function(e){let t=!0;for(const n of X6(e))if(n instanceof O9){t=!1;break}return t}(e);if(i===r)throw new U6("Arguments to apply() must be all SymbolicTensors or all Tensors");return E8(this.name,()=>{if(!this.built){this.assertInputCompatibility(e);const t=[];for(const n of X6(e))t.push(n.shape);this.build(W6(t)),this.built=!0,this.initialWeights&&this.setWeights(this.initialWeights),null===this._refCount&&r&&(this._refCount=1)}if(this.assertInputCompatibility(e),r){let i=this.call(e,t);this.supportsMasking&&this.setMaskMetadata(e,i);const r=X6(i),s=[];for(let e of r)-1!==n.indexOf(e)&&(e=e.clone()),s.push(e);if(i=W6(s),null!=this.activityRegularizer)throw new V6("Layer invocation in the presence of activity regularizer(s) is not supported yet.");return i}{const n=function(e){e=X6(e);const t=[];for(const n of e)t.push(n.shape);return W6(t)}(e),i=this.computeOutputShape(n);let r;const s="float32";if(this.warnOnIncompatibleInputShape(Array.isArray(e)?n[0]:n),r=null!=i&&i.length>0&&Array.isArray(i[0])?i.map((n,i)=>new O9(s,n,this,X6(e),t,this.name,i)):new O9(s,i,this,X6(e),t,this.name),this.addInboundNode(e,r,null,null,n,i,t),this._refCount++,null!=this.activityRegularizer)throw new V6("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)console.warn(`The rank of the input tensor provided (shape: ${JSON.stringify(e)}) does not match that of the batchInputShape (${JSON.stringify(this.batchInputShape)}) of the layer ${this.name}`);else{let t=!1;this.batchInputShape.forEach((n,i)=>{null!=n&&null!=e[i]&&e[i]!==n&&(t=!0)}),t&&console.warn(`The shape of the input tensor (${JSON.stringify(e)}) does not match the expectation of layer ${this.name}: ${JSON.stringify(this.batchInputShape)}`)}}get outputShape(){if(null==this.inboundNodes||0===this.inboundNodes.length)throw new B6(`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 B6(`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 $6(`You tried to call countParams() on ${this.name}, but the layer is not built yet. Build it first by calling build(batchInputShape).`);return E9(this.weights)}build(e){this.built=!0}getWeights(e=!1){return A9(e?this.trainableWeights:this.weights)}setWeights(e){(0,v3.tidy)(()=>{const t=this.weights;if(t.length!==e.length)throw new U6(`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=[],i=A9(t);for(let r=0;r<i.length;++r){const s=i[r],o=t[r],a=e[r];if(!v3.util.arraysEqual(s.shape,a.shape))throw new U6(`Layer weight shape ${s.shape} not compatible with provided weight shape ${a.shape}`);n.push([o,a])}S9(n)})}addWeight(e,t,n,i,r,s,o,a){if(-1!==this._addedWeightNames.indexOf(e))throw new U6(`Duplicate weight name ${e} for layer ${this.name}`);this._addedWeightNames.push(e),null==n&&(n="float32"),this.fastWeightInitDuringBuild&&(i=null!=a?a():y9("zeros"));const l=i.apply(t,n),u=new I9(l,n,e,s,o);return l.dispose(),null!=r&&this.addLoss(()=>r.apply(u.read())),null==s&&(s=!0),s?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=X6(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 i=this.computeMask(e,n),r=X6(t),s=X6(i);if(r.length!==s.length)throw new Error(`${this.name} outputs ${r.length} tensors but ${r.length} masks for those tensors`);for(let e=0;e<r.length;e++)r[e].kerasMask=s[e]}addInboundNode(e,t,n,i,r,s,o=null){const a=X6(e);t=X6(t),n=X6(n),i=X6(i),r=b9(r),s=b9(s);const l=[],u=[],c=[];for(const e of a)l.push(e.sourceLayer),u.push(e.nodeIndex),c.push(e.tensorIndex);new k9({outboundLayer:this,inboundLayers:l,nodeIndices:u,tensorIndices:c,inputTensors:a,outputTensors:t,inputMasks:n,outputMasks:i,inputShapes:r,outputShapes:s},o);for(let e=0;e<t.length;e++)t[e].sourceLayer=this,t[e].nodeIndex=this.inboundNodes.length-1,t[e].tensorIndex=e}getConfig(){const e={name:this.name,trainable:this.trainable};return null!=this.batchInputShape&&(e.batchInputShape=this.batchInputShape),null!=this.dtype&&(e.dtype=this.dtype),e}disposeWeights(){return this.weights.forEach(e=>e.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 D9(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;n<e.inboundLayers.length;n++){const i=D9(e.inputTensors[n],e.inboundLayers[n],e.nodeIndices[n]);for(const e of i)-1===t.indexOf(e)&&t.push(e)}return t}}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class F9 extends N9{constructor(e){if(super({dtype:e.dtype,name:null!=e.name?e.name:h8("input").toString()}),null==e.batchSize&&(e.batchSize=null),null==e.sparse&&(e.sparse=!1),this.trainable=!1,this.built=!0,this.sparse=e.sparse,null!=e.inputShape&&null!=e.batchInputShape)throw new U6("Only provide the inputShape OR batchInputShape argument to inputLayer, not both at the same time.");let t=e.batchInputShape;if(null==t){if(null==e.inputShape)throw new U6("An InputLayer should be passed either a `batchInputShape` or an `inputShape`.");t=[e.batchSize].concat(e.inputShape)}else if(null!=e.batchSize)throw new U6("Cannot specify batchSize if batchInputShape is specified when creating an InputLayer.");const n=e.dtype||"float32";this.batchInputShape=t,this.dtype=n,this.inputSpec=[{shape:t}];const i=new O9(this.dtype,this.batchInputShape,this,[],{},this.name);i.nodeIndex=0,i.tensorIndex=0,new k9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:[i],outputTensors:[i],inputMasks:[null],outputMasks:[null],inputShapes:[t],outputShapes:[t]})}apply(e,t){throw new U6(`Cannot pass any input to an InputLayer's apply() method. InputLayer name: ${this.name}`)}dispose(){return{refCountAfterDispose:this._refCount,numDisposedVariables:0}}getConfig(){return{batchInputShape:this.batchInputShape,dtype:this.dtype,sparse:this.sparse,name:this.name}}}function L9(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 U6("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;null==n&&(n="float32");return new F9({batchInputShape:t,name:e.name,dtype:n,sparse:e.sparse}).inboundNodes[0].outputTensors[0]}F9.className="InputLayer",v3.serialization.registerClass(F9);class P9{constructor(e){if(this.id2Value={},this.id2Mask={},this.name2Id={},e instanceof P9)for(const t in e.id2Value)this.id2Value[t]=e.id2Value[t],t in e.id2Mask&&(this.id2Mask[t]=e.id2Mask[t]);else{if(null==e)return;for(const t of e)this.add(t.key,t.value)}}add(e,t,n){if(null!=this.id2Value[e.id])throw new U6(`Duplicate key: name=${e.name}, id=${e.id}`);return this.id2Value[e.id]=
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function(e,t){if(null==e.dtype||e.dtype===t.dtype)return t;try{return(0,v3.cast)(t,e.dtype)}catch(n){throw new U6(`The dtype of the feed (${t.dtype}) can not be cast to the dtype of the key '${e.name}' (${e.dtype}).`)}}(e,t),this.name2Id[e.name]=e.id,null!=n&&(this.id2Mask[e.id]=n),this}addFeed(e){this.add(e.key,e.value)}hasKey(e){return null!=this.id2Value[e.id]}names(){return Object.keys(this.name2Id)}getValue(e){if(e instanceof O9){if(null==this.id2Value[e.id])throw new U6(`Nonexistent key: ${e.name}`);return this.id2Value[e.id]}{const t=this.name2Id[e];if(null==t)throw new U6(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Value[t]}}getMask(e){if(e instanceof O9){if(null==this.id2Value[e.id])throw new U6(`Nonexistent key: ${e.name}`);return this.id2Mask[e.id]}{const t=this.name2Id[e];if(null==t)throw new U6(`Feed dict has no SymbolicTensor name: ${e}`);return this.id2Mask[t]}}disposeMasks(){null!=this.id2Mask&&(0,v3.dispose)(this.id2Mask)}}const B9=new j6,$9=new j6;function U9(e,t,n,i){const r=null!=n&&n.training,s=Array.isArray(e),o=s?e:[e],a=o.map(e=>e.name),l=[],u=t.names();for(const e of a)-1!==u.indexOf(e)?l.push(t.getValue(e)):l.push(null);null!=i&&(i.maxNumTensors=-1/0,i.minNumTensors=1/0);const c=a.join(",")+"|"+t.names().sort().join(",");let d,h=B9.get(c);if(null==h){const e=function(e,t){v3.util.assert(null!=e&&e.length>0,()=>"Expected at least one fetch, got none");let n=[],i={};if(1===e.length){const r=z9(e[0],t);n=r.sorted,i=r.recipientMap}else{const r=new Set;for(const s of e){const{sorted:e,recipientMap:o}=z9(s,t);for(const t of e)r.has(t.name)||(n.push(t),r.add(t.name));for(const e in o)null==i[e]&&(i[e]=new Set),o[e].forEach(t=>i[e].add(t))}}return{sorted:n,recipientCounts:V9(i)}}(o,t);h=e.sorted,d=e.recipientCounts,B9.put(c,h),$9.put(c,d)}d={},r||Object.assign(d,$9.get(c));const p=new P9(t);for(let e=0;e<h.length;++e){if(null!=i){const e=(0,v3.memory)().numTensors;e>i.maxNumTensors&&(i.maxNumTensors=e),e<i.minNumTensors&&(i.minNumTensors=e)}const s=h[e],o=s.sourceLayer;if(o instanceof F9)continue;const u=[],c=[],f=[];let m=!1;for(const e of s.inputs){const n=p.getValue(e),i=p.getMask(e);u.push(n),c.push(i),null!=i&&(m=!0),r||(d[e.name]--,0!==d[e.name]||t.hasKey(e)||-1!==a.indexOf(e.name)||n.isDisposed||!0===e.sourceLayer.stateful||f.push(n))}m&&((n=n||{}).mask=c[0]);const g=X6(o.apply(u,n));let _=null;o.supportsMasking&&(_=o.computeMask(u,c));const y=j9(s),v=Array.isArray(y)?y:[y];for(let e=0;e<v.length;++e){p.hasKey(v[e])||p.add(v[e],g[e],Array.isArray(_)?_[0]:_);const t=a.indexOf(v[e].name);-1!==t&&(l[t]=g[e])}r||(0,v3.dispose)(f)}return p.disposeMasks(),s?l:l[0]}function V9(e){const t={};for(const n in e)t[n]=e[n].size;return t}function z9(e,t){const n=new Set,i=[],r={};for(const e of t.names())n.add(e);const s=[],o=[];for(s.push(e);s.length>0;){const e=s[s.length-1];if(n.has(e.name)){s.pop();continue}const t=o[o.length-1]===s.length-1;if(0===e.inputs.length||t)s.pop(),i.push(e),n.add(e.name),t&&o.pop();else{o.push(s.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)||s.push(t)}}return{sorted:i,recipientMap:r}}function j9(e){let t;if(1===e.sourceLayer.inboundNodes.length)t=e.sourceLayer.output;else{let n=null;for(let t=0;t<e.sourceLayer.inboundNodes.length;++t)for(const i of e.sourceLayer.inboundNodes[t].outputTensors)if(i.id===e.id){n=t;break}t=e.sourceLayer.getOutputAt(n)}return t}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Y9(e,t){return(0,v3.tidy)(()=>v3.sqrt(v3.sum(v3.mul(e,e),t,!0)))}(0,v3.env)().registerFlag("TOPOLOGICAL_SORT_CACHE_MAX_ENTRIES",()=>100,function(e){null!=B9&&B9.setMaxEntries(e),null!=$9&&$9.setMaxEntries(e)});class G9 extends v3.serialization.Serializable{getConfig(){return{}}}class H9 extends G9{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(0,v3.tidy)(()=>{const t=Y9(e,this.axis),n=v3.clipByValue(t,0,this.maxValue);return v3.mul(e,v3.div(n,v3.add(D8(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}H9.className="MaxNorm",v3.serialization.registerClass(H9);class W9 extends G9{constructor(e){super(),this.defaultAxis=0,this.axis=null!=e.axis?e.axis:this.defaultAxis}apply(e){return(0,v3.tidy)(()=>v3.div(e,v3.add(D8(),Y9(e,this.axis))))}getConfig(){return{axis:this.axis}}}W9.className="UnitNorm",v3.serialization.registerClass(W9);class X9 extends G9{apply(e){return v3.relu(e)}}X9.className="NonNeg",v3.serialization.registerClass(X9);class q9 extends G9{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(0,v3.tidy)(()=>{const t=Y9(e,this.axis),n=v3.add(v3.mul(this.rate,v3.clipByValue(t,this.minValue,this.maxValue)),v3.mul(1-this.rate,t));return v3.mul(e,v3.div(n,v3.add(D8(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}q9.className="MinMaxNorm",v3.serialization.registerClass(q9);const K9={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function Z9(e){return Q6(e)}function Q9(e,t={}){return e8(e,v3.serialization.SerializationMap.getMap().classNameMap,t,"constraint")}function J9(e){if(null==e)return null;if("string"==typeof e){return Q9({className:e in K9?K9[e]:e,config:{}})}return e instanceof G9?e:Q9(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function e7(e){return new H9(e)}function t7(e){return new W9(e)}function n7(){return new X9}function i7(e){return new q9(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function r7(){return new e9}function s7(){return new t9}function o7(e){return new n9(e)}function a7(e){return new i9(e)}function l7(e){return new r9(e)}function u7(e){return new s9(e)}function c7(e){return new o9(e)}function d7(e){return new a9(e)}function h7(e){return new l9(e)}function p7(e){return new u9(e)}function f7(e){return new c9(e)}function m7(e){return new d9(e)}function g7(e){return new h9(e)}function _7(e){return new p9(e)}function y7(e){return new f9(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
async function v7(e){if(null==e)return;const t=[],n=[],i=[];for(const r in e){const s=e[r];if("number"!=typeof s){const e=s;t.push(e.data()),n.push(r),i.push(e)}}if(t.length>0){const r=await Promise.all(t);for(let t=0;t<r.length;++t)e[n[t]]=r[t][0];(0,v3.dispose)(i)}}function b7(e){if(null!=e)for(const t in e){const n=e[t];"number"!=typeof n&&n.dispose()}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
var T7;!function(e){e[e.SILENT=0]="SILENT",e[e.VERBOSE=1]="VERBOSE"}(T7||(T7={}));class x7{constructor(){this.validationData=null}setParams(e){this.params=e}async onEpochBegin(e,t){}async onEpochEnd(e,t){}async onBatchBegin(e,t){}async onBatchEnd(e,t){}async onTrainBegin(e){}async onTrainEnd(e){}setModel(e){}}class E7{constructor(e,t=10){null==e&&(e=[]),this.callbacks=e,this.queueLength=t}append(e){this.callbacks.push(e)}setParams(e){for(const t of this.callbacks)t.setParams(e)}setModel(e){for(const t of this.callbacks)t.setModel(e)}async onEpochBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochBegin(e,t)}async onEpochEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onEpochEnd(e,t)}async onBatchBegin(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchBegin(e,t)}async onBatchEnd(e,t){null==t&&(t={});for(const n of this.callbacks)await n.onBatchEnd(e,t)}async onTrainBegin(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainBegin(e)}async onTrainEnd(e){null==e&&(e={});for(const t of this.callbacks)await t.onTrainEnd(e)}}class w7 extends x7{constructor(){super()}async onEpochBegin(e){this.seen=0,this.totals={}}async onBatchEnd(e,t){null==t&&(t={});const n=null==t.size?0:t.size;this.seen+=n;for(const e in t){const i=t[e];if("number"==typeof i)this.totals.hasOwnProperty(e)||(this.totals[e]=0),this.totals[e]=this.totals[e]+i*n;else{let t;e in this.totals?t=this.totals[e]:this.totals[e]=0;const r=(0,v3.tidy)(()=>(0,v3.add)(this.totals[e],(0,v3.mul)(i,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:(0,v3.tidy)(()=>{const n=(0,v3.mul)((0,v3.div)(1,this.seen),this.totals[e]);t[e]=n,this.totals[e].dispose(),(0,v3.keep)(t[e])}))}}class I7 extends x7{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 i in this.history){const r=this.history[i];for(let s=0;s<r.length;++s)if("number"!=typeof r[s]){const o=r[s];e.push(o.data()),t.push(i),n.push(s)}}const i=await Promise.all(e);for(let e=0;e<i.length;++e){this.history[t[e]][n[e]].dispose(),this.history[t[e]][n[e]]=i[e][0]}}}class A7 extends x7{constructor(e,t){if(super(),this.currentEpoch=0,this.nowFunc=e.nowFunc,this.nextFrameFunc=e.nextFrameFunc||v3.nextFrame,this.yieldEvery=t||"auto","auto"===this.yieldEvery&&(this.yieldEvery=125),"never"===this.yieldEvery&&null!=e.onYield)throw new Error("yieldEvery is `never` but you provided an `onYield` callback. Either change `yieldEvery` or remove the callback");v3.util.isNumber(this.yieldEvery)&&(this.maybeWait=function(e,t,n){let i,r=null!=n?n():v3.util.now();return(...s)=>{const o=null!=n?n():v3.util.now();return o-r<t||(r=o,i=e(...s)),i}}(this.maybeWait.bind(this),this.yieldEvery,this.nowFunc)),this.trainBegin=e.onTrainBegin,this.trainEnd=e.onTrainEnd,this.epochBegin=e.onEpochBegin,this.epochEnd=e.onEpochEnd,this.batchBegin=e.onBatchBegin,this.batchEnd=e.onBatchEnd,this.yield=e.onYield}async maybeWait(e,t,n){const i=[];null!=this.yield&&(await v7(n),i.push(this.yield(e,t,n))),i.push(this.nextFrameFunc()),await Promise.all(i)}async onEpochBegin(e,t){this.currentEpoch=e,null!=this.epochBegin&&(await v7(t),await this.epochBegin(e,t))}async onEpochEnd(e,t){const n=[];null!=this.epochEnd&&(await v7(t),n.push(this.epochEnd(e,t))),"epoch"===this.yieldEvery&&n.push(this.nextFrameFunc()),await Promise.all(n)}async onBatchBegin(e,t){null!=this.batchBegin&&(await v7(t),await this.batchBegin(e,t))}async onBatchEnd(e,t){const n=[];null!=this.batchEnd&&(await v7(t),n.push(this.batchEnd(e,t))),"batch"===this.yieldEvery?n.push(this.nextFrameFunc()):v3.util.isNumber(this.yieldEvery)&&n.push(this.maybeWait(this.currentEpoch,e,t)),await Promise.all(n)}async onTrainBegin(e){null!=this.trainBegin&&(await v7(e),await this.trainBegin(e))}async onTrainEnd(e){null!=this.trainEnd&&(await v7(e),await this.trainEnd(e))}}function S7(e,t){if(null==e&&(e={}),e instanceof x7)return[e];if(Array.isArray(e)&&e[0]instanceof x7)return e;return X6(e).map(e=>new A7(e,t))}class C7{constructor(){}static registerCallbackConstructor(e,t){v3.util.assert(e>=0&&Number.isInteger(e),()=>`Verbosity level is expected to be an integer >= 0, but got ${e}`),C7.checkForDuplicate(t),null==C7.constructors[e]&&(C7.constructors[e]=[]),C7.constructors[e].push(t)}static checkForDuplicate(e){for(const t in C7.constructors){C7.constructors[+t].forEach(t=>{if(t===e)throw new U6("Duplicate callback constructor.")})}}static clear(){C7.constructors={}}static createCallbacks(e){const t=[];for(const n in C7.constructors){const i=+n;e>=i&&t.push(...C7.constructors[i])}return t.map(e=>new e)}}function O7(e,t,n,i,r,s,o,a,l){const u=new I7,c=[new w7,...C7.createCallbacks(t)];null!=e&&c.push(...e),c.push(u);const d=new E7(c);return d.setParams({epochs:n,initialEpoch:i,samples:r,steps:s,batchSize:o,verbose:t,doValidation:a,metrics:l}),{callbackList:d,history:u}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function M7(e,t={},n=!1){return e8(e,v3.serialization.SerializationMap.getMap().classNameMap,t,"layer",n)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function k7(e,t){return(0,v3.tidy)(()=>{"float32"!==e.dtype&&(e=v3.cast(e,"float32"));const n=v3.sum(H8(e),t,!0),i=v3.fill(n.shape,D8()),r=v3.sqrt(v3.maximum(n,i));return v3.div(e,r)})}function R7(e,t){return(0,v3.tidy)(()=>v3.mean(H8(v3.sub(t,e)),-1))}function N7(e,t){return(0,v3.tidy)(()=>v3.mean(v3.abs(v3.sub(t,e)),-1))}function D7(e,t){return(0,v3.tidy)(()=>{const n=v3.sub(e,t),i=v3.clipByValue(v3.abs(e),D8(),Number.MAX_VALUE),r=v3.abs(v3.div(n,i));return v3.mul(100,v3.mean(r,-1))})}function F7(e,t){return(0,v3.tidy)(()=>{const n=v3.clipByValue(t,D8(),Number.MAX_VALUE),i=v3.log(v3.add(1,n)),r=v3.clipByValue(e,D8(),Number.MAX_VALUE),s=v3.log(v3.add(1,r));return v3.mean(H8(v3.sub(i,s)),-1)})}function L7(e,t,n=!1){return(0,v3.tidy)(()=>{if(n)t=v3.softmax(t);else{const e=v3.sum(t,t.shape.length-1,!0);t=v3.div(t,e)}return t=v3.clipByValue(t,D8(),1-D8()),v3.neg(v3.sum(v3.mul(v3.cast(e,"float32"),v3.log(t)),t.shape.length-1))})}function P7(e,t,n=!1){return(0,v3.tidy)(()=>{const i=v3.cast(v3.floor(function(e){const t=[O8(e.shape)];return v3.reshape(e,t)}(e)),"int32"),r=(t=v3.clipByValue(t,D8(),1-D8())).shape;return L7(v3.reshape(v3.oneHot(i,r[r.length-1]),r),t,n)})}function B7(e,t){return(0,v3.tidy)(()=>{let n;return n=v3.clipByValue(t,D8(),1-D8()),n=v3.log(v3.div(n,v3.sub(1,n))),v3.mean(function(e,t){if(!v3.util.arraysEqual(e.shape,t.shape))throw new U6(`logits and labels must have the same shape, but got shapes ${JSON.stringify(e.shape)} and ${JSON.stringify(t.shape)}`);return(0,v3.tidy)(()=>{const n=v3.relu(t),i=v3.neg(v3.abs(t));return v3.add(v3.sub(n,v3.mul(t,e)),v3.log1p(v3.exp(i)))})}(e,n),-1)})}function $7(e,t){return(0,v3.tidy)(()=>{const n=v3.clipByValue(e,D8(),1),i=v3.clipByValue(t,D8(),1);return v3.sum(v3.mul(e,v3.log(v3.div(n,i))),-1)})}function U7(e,t){return(0,v3.tidy)(()=>{const n=k7(e,-1),i=k7(t,-1),r=v3.mul(n,i);return v3.neg(v3.sum(r,-1))})}C7.constructors={};const V7={meanSquaredError:R7,meanAbsoluteError:N7,meanAbsolutePercentageError:D7,meanSquaredLogarithmicError:F7,squaredHinge:function(e,t){return(0,v3.tidy)(()=>{const n=v3.maximum(0,v3.sub(1,v3.mul(e,t)));return v3.mean(H8(n),-1)})},hinge:function(e,t){return(0,v3.tidy)(()=>{const n=v3.maximum(0,v3.sub(1,v3.mul(e,t)));return v3.mean(n,-1)})},categoricalHinge:function(e,t){return(0,v3.tidy)(()=>{const n=v3.sum(v3.mul(e,t),-1),i=v3.max(v3.mul(v3.sub(1,e),t),-1);return v3.maximum(0,v3.add(1,v3.sub(i,n)))})},logcosh:function(e,t){return(0,v3.tidy)(()=>{const n=Math.log(2),i=v3.sub(t,e),r=v3.sub(v3.add(i,v3.softplus(v3.mul(-2,i))),n);return v3.mean(r,-1)})},categoricalCrossentropy:L7,sparseCategoricalCrossentropy:P7,binaryCrossentropy:B7,kullbackLeiblerDivergence:$7,poisson:function(e,t){return(0,v3.tidy)(()=>{const n=v3.log(v3.add(D8(),t));return v3.mean(v3.sub(t,v3.mul(e,n)),-1)})},cosineProximity:U7};function z7(e){if("string"==typeof e){if(e in V7)return V7[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 U6(t)}return e}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function j7(e,t){return(0,v3.tidy)(()=>{const n=v3.mul(.5,v3.onesLike(t)),i=F8(v3.greater(t,n),e.dtype);return v3.mean(v3.equal(e,i),-1)})}function Y7(e,t){return(0,v3.tidy)(()=>F8(v3.equal(v3.argMax(e,-1),v3.argMax(t,-1)),"float32"))}function G7(e,t){return(0,v3.tidy)(()=>v3.cast(v3.sum(v3.logicalAnd(v3.equal(e,1),v3.equal(t,1))),"float32"))}function H7(e,t){return(0,v3.tidy)(()=>{const n=G7(e,t),i=function(e,t){return(0,v3.tidy)(()=>v3.cast(v3.sum(v3.logicalAnd(v3.equal(e,0),v3.equal(t,1))),"float32"))}(e,t),r=v3.add(n,i);return v3.cast(v3.where(v3.greater(r,0),v3.div(n,r),0),"float32")})}function W7(e,t){return(0,v3.tidy)(()=>{const n=G7(e,t),i=function(e,t){return(0,v3.tidy)(()=>v3.cast(v3.sum(v3.logicalAnd(v3.equal(e,1),v3.equal(t,0))),"float32"))}(e,t),r=v3.add(n,i);return v3.cast(v3.where(v3.greater(r,0),v3.div(n,r),0),"float32")})}function X7(e,t){return B7(e,t)}function q7(e,t){return e.rank===t.rank&&(e=v3.squeeze(e,[e.rank-1])),(t=v3.argMax(t,-1)).dtype!==e.dtype&&(t=v3.cast(t,e.dtype)),v3.cast(v3.equal(e,t),"float32")}const K7=L7,Z7=P7,Q7={binaryAccuracy:j7,categoricalAccuracy:Y7,precision:H7,categoricalCrossentropy:K7,sparseCategoricalCrossentropy:Z7,mse:R7,MSE:R7,mae:N7,MAE:N7,mape:D7,MAPE:D7,cosine:U7};function J7(e){if("string"==typeof e&&e in Q7)return Q7[e];if("string"!=typeof e&&null!=e)return e;throw new U6(`Unknown metric ${e}`)}function eee(e){if(G6(null!==e,`Unknown LossOrMetricFn ${e}`),"string"==typeof e)return e;{let t;for(const n of Object.keys(V7))if(V7[n]===e){t=n;break}if(void 0!==t)return t;for(const n of Object.keys(Q7))if(Q7[n]===e){t=n;break}return void 0!==t?t:e.name}}
/**
* @license
* Copyright 2019 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const tee=1048576;function nee(e,t,n=!1){if(null==e||"object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype||!iee(e))throw new Error("User-defined metadata is expected to be a JSON object, but is not.");if(n){const n=JSON.stringify(e);n.length>tee&&console.warn(`User-defined metadata of model "${t}" is too large in size (length=${n.length} when serialized). It is not recommended to store such large objects in user-defined metadata. Please make sure its serialized length is <= 1048576.`)}}function iee(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(!iee(e[n]))return!1}return!0}if(Array.isArray(e)){for(const t of e)if(!iee(t))return!1;return!0}return!1}{const t=typeof e;return"string"===t||"number"===t||"boolean"===t}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function ree(e,t,n,i=console.log){const r=function(e){let t=!0;const n=[],i=[];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}i.push(...e)}if(t)for(const n of e.layers){let e=!1;for(const r of n.inboundNodes)if(-1!==i.indexOf(r)){if(e){t=!1;break}e=!0}if(!t)break}return t}(e),s=["Layer (type)","Input Shape","Output shape","Param #"];let o;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){s.push("Receives inputs"),o=[];for(const t in e.nodesByDepth)o.push(...e.nodesByDepth[t])}i("_".repeat(t)),see(s,n,i),i("=".repeat(t));const a=e.layers;for(let e=0;e<a.length;++e)r?oee(a[e],n,i):aee(a[e],n,o,i),i((e===a.length-1?"=":"_").repeat(t));e.checkTrainableWeightsConsistency();const l=function(e){let t;t=null!=e.collectedTrainableWeights?E9(e.collectedTrainableWeights):E9(e.trainableWeights);return t}(e),u=E9(e.nonTrainableWeights);i(`Total params: ${l+u}`),i(`Trainable params: ${l}`),i(`Non-trainable params: ${u}`),i("_".repeat(t))}function see(e,t,n=console.log){let i="";for(let n=0;n<e.length;++n)n>0&&(i=i.slice(0,i.length-1)+" "),i+=e[n],i=i.slice(0,t[n]),i+=" ".repeat(t[n]-i.length);n(i)}function oee(e,t,n){let i,r;try{r=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){r="multiple"}try{i=JSON.stringify(e.outputShape)}catch(e){i="multiple"}see([`${e.name} (${e.getClassName()})`,r,i,e.countParams().toString()],t,n)}function aee(e,t,n,i){let r,s;try{s=e.inboundNodes.map(e=>JSON.stringify(e.inputShapes)).join(",")}catch(e){s="multiple"}try{r=JSON.stringify(e.outputShape)}catch(e){r="multiple"}const o=[];for(const t of e.inboundNodes)if(!(null!=n&&n.length>0&&-1===n.indexOf(t)))for(let e=0;e<t.inboundLayers.length;++e){const n=t.inboundLayers[e].name,i=t.nodeIndices[e],r=t.tensorIndices[e];o.push(`${n}[${i}][${r}]`)}const a=e.name,l=e.getClassName(),u=0===o.length?"":o[0];see([`${a} (${l})`,s,r,e.countParams().toString(),u],t,i);for(let e=1;e<o.length;++e)see(["","","","",o[e]],t,i)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function lee(e,t,n){return("inboundNodes"===e||"outputLayers"===e||"inputLayers"===e)&&0===t&&"string"==typeof n}function uee(e,t){if(null===e)return null;if("string"==typeof e)return K6(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const n=[],i=e.length;for(let r=0;r<i;++r){const i=e[r];lee(t,r,i)?n.push(i):n.push(uee(i,t))}return n}{const t={};for(const n of Object.keys(e)){const i=e[n];if("name"===n&&"string"==typeof i)t[n]=i;else{const e=K6(n);t[e]=uee(i,e)}}return t}}function cee(e,t){if(null==e)return null;if("string"==typeof e)return q6(e);if("number"==typeof e||"boolean"==typeof e)return e;if(e instanceof Array){const n=[],i=e.length;for(let r=0;r<i;++r){const i=e[r];lee(t,r,i)?n.push(i):n.push(cee(i,t))}return n}{const t={};for(const n of Object.keys(e)){const i=e[n],r=q6(n);t[r]="name"!==n&&"className"!==n||"string"!=typeof i?cee(i,n):i}return t}}
/** @license See the LICENSE file. */
const dee="4.22.0";class hee extends N9{constructor(e){if(super({}),this.containerNodes=new Set,this.name=e.name,null==this.name){const e=this.getClassName().toLowerCase();this.name=h8(e)}if(this.supportsMasking=!1,this.trainable_=!0,Array.isArray(e.inputs)?this.inputs=e.inputs.slice():this.inputs=[e.inputs],Array.isArray(e.outputs)?this.outputs=e.outputs.slice():this.outputs=[e.outputs],n8(this.inputs).length!==this.inputs.length)throw new U6(`The list of inputs passed to the model is redundant. All inputs should only appear once. Found: ${this.inputs.map(e=>e.name)}`);n8(this.outputs).length!==this.outputs.length&&console.warn(`The list of outputs passed to the model is redundant. All outputs should only appear once. Found: ${this.outputs.map(e=>e.name)}`),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,i=e.tensorIndex;this.outputLayers.push(t),this.outputLayersNodeIndices.push(n),this.outputLayersTensorIndices.push(i)}for(const e of this.inputs){const t=e.sourceLayer,n=e.nodeIndex,i=e.tensorIndex;G6(0===n,"input layer has >1 nodes"),G6(0===i,"input layer has >1 tensors"),this.inputLayers.push(t),this.inputLayersNodeIndices.push(n),this.inputLayersTensorIndices.push(i)}this.inputNames=[],this.outputNames=[],this.feedInputShapes=[],this.feedInputNames=[],this.feedOutputNames=[];for(let t=0;t<this.inputLayers.length;t++){const n=this.inputLayers[t];if(!(n instanceof F9))throw new TypeError(`Input layers to a LayersModel must be InputLayer objects. Received inputs: ${e.inputs}. Input ${t} (0-based) originates from layer type ${n.getClassName()}.`);this.inputNames.push(n.name),this.feedInputShapes.push(n.batchInputShape),this.feedInputNames.push(n.name)}for(const e of this.outputLayers)this.outputNames.push(e.name);this.internalInputShapes=this.inputs.map(e=>e.shape),this.internalOutputShapes=this.outputs.map(e=>e.shape);const t={},n={},i={},r={},s={},o=[],a=(e,t,n,i,r,l)=>{null!=i&&null!=r&&null!=l||(i=e.sourceLayer,r=e.nodeIndex,l=e.tensorIndex);const u=i.inboundNodes[r];if(-1!==n.indexOf(u))throw new $6(`The tensor ${e.name} at layer "${i.name}" is part of a cycle.`);if(-1!==t.indexOf(u))return;this.containerNodes.add(hee.nodeKey(i,r)),i.id in s||(s[i.id]=Object.keys(s).length),-1===n.indexOf(u)&&n.push(u);const c=u.inboundLayers.length;for(let e=0;e<c;e++){const i=u.inputTensors[e],r=u.inboundLayers[e],s=u.nodeIndices[e],o=u.tensorIndices[e];a(i,t,n,r,s,o)}for(t.push(u);n.indexOf(u)>=0;)n.splice(n.indexOf(u),1);o.push(u)},l=[],u=[];for(const e of this.outputs)a(e,l,u);const c=o.slice().reverse();for(const e of c){n[e.id]=e,e.id in t||(t[e.id]=0);let s=t[e.id];const o=null==i[e.outboundLayer.id]?0:i[e.outboundLayer.id];s=Math.max(s,o),i[e.outboundLayer.id]=s,r[e.outboundLayer.id]=e.outboundLayer,t[e.id]=s;for(let i=0;i<e.inboundLayers.length;i++){const r=e.inboundLayers[i],o=e.nodeIndices[i],a=r.inboundNodes[o],l=null==t[a.id]?0:t[a.id];t[a.id]=Math.max(s+1,l),n[a.id]=a}}const d={};for(const e in t){const i=t[e];i in d||(d[i]=[]),d[i].push(n[e])}const h={};for(const e in i){const t=i[e];t in h||(h[t]=[]),h[t].push(r[e])}let p=Object.keys(h).map(e=>parseInt(e,10)).sort(t8);this.layers=[];for(const e of p){const t=h[e];t.sort((e,t)=>{const n=s[e.id],i=s[t.id];return n<i?-1:n>i?1:0});for(const e of t)e instanceof hee&&this.internalContainerRefs.push(e),this.layers.push(e)}this.layersByDepth=h,p=Object.keys(d).map(e=>parseInt(e,10)).sort(t8);const f=this.inputs.slice(),m=[];for(const e of p)for(const t of d[e]){const e=t.outboundLayer;if(null!=e){for(const n of t.inputTensors)if(-1===f.indexOf(n))throw new $6(`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=d;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 $6(`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 k9({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 U6("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 i=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,s]of e.weights.entries()){const e=r?`${s.name.split("/").slice(0,-1).join("/")+"/"}${t}`:s.originalName;if(null!=n[e])throw new U6(`Duplicate weight name: ${e}`);n[e]=s,i++}const s=[];for(const i in e){let r=i;if(null==n[i]){const e=i.split("/");r=e.slice(0,-2).concat([e[e.length-1]]).join("/")}if(null!=n[r])s.push([n[r],e[i]]);else if(t)throw new U6(`Provided weight data has no target variable: ${i}`);delete n[r]}if(t){const e=[];for(const t in n)e.push(t);if(e.length>0)throw new U6(`${e.length} of ${i} weights are not set: ${e}`)}S9(s)}parseWeights(e){for(const t in Object.keys(e)){const n=t.split("/"),i=["vars","layer_checkpoint_dependencies"],r=n.map(e=>e.startsWith("_")?e.slice(1):e).filter(e=>!i.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 ${dee}`,t.backend="TensorFlow.js",t}toJSON(e,t=!0){const n=cee(this.updatedConfig());return t?JSON.stringify(n):n}call(e,t){return(0,v3.tidy)(()=>{e=X6(e);const n=new P9;for(let t=0;t<this.inputs.length;++t)n.add(this.inputs[t],e[t]);return U9(this.outputs,n,t)})}computeMask(e,t){return(0,v3.tidy)(()=>{let n;return e=X6(e),n=null==t?Y6(null,e.length):X6(t),this.runInternalGraph(e,n)[1]})}computeOutputShape(e){const t=b9(e);if(t.length!==this.inputLayers.length)throw new U6(`Invalid inputShape argument ${e}: model has ${this.inputLayers.length} tensor inputs.`);const n={};for(let e=0;e<t.length;e++){const i=this.inputLayers[e],r=t[e];n[i.name+"_0_0"]=r}const i=Object.keys(this.nodesByDepth).map(e=>parseInt(e,10)).sort(t8);if(i.length>1)for(const e of i){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 i=[];for(let t=0;t<e.inboundLayers.length;t++){const r=e.inboundLayers[t],s=e.nodeIndices[t],o=e.tensorIndices[t],a=n[`${r.name}_${s}_${o}`];i.push(a)}const r=b9(t.computeOutputShape(W6(i))),s=t.inboundNodes.indexOf(e);for(let e=0;e<r.length;e++){n[`${t.name}_${s}_${e}`]=r[e]}}}const r=[],s=[];for(let e=0;e<this.outputLayers.length;e++){const t=this.outputLayers[e],n=this.outputLayersNodeIndices[e],i=this.outputLayersTensorIndices[e],r=`${t.name}_${n}_${i}`;s.push(r)}for(let e=0;e<s.length;e++){const t=s[e];G6(t in n),r.push(n[t])}return W6(r)}runInternalGraph(e,t){null==t&&(t=Y6(null,e.length));const n={};for(let i=0;i<this.inputs.length;++i){const r=this.inputs[i],s=e[i],o=t[i];n[r.id]=[s,o]}const i=Object.keys(this.nodesByDepth).map(e=>parseInt(e,10)).sort(t8);for(const e of i){const t=this.nodesByDepth[e];for(const e of t){const t=e.outboundLayer,i=e.inputTensors,r=e.outputTensors,s=new Array;for(const e of i)e.id in n&&s.push(n[e.id]);if(s.length===i.length){let i,o,a,l,u={};if(null!=e.callArgs&&(u=e.callArgs),1===s.length){const[e,n]=s[0];null==u.mask&&(u.mask=n),a=X6(t.call(e,u)),l=X6(t.computeMask(e,n)),i=[e],o=[n]}else i=s.map(e=>e[0]),o=s.map(e=>e[1]),null==u.mask&&(u.mask=o),a=X6(t.call(i,u)),l=X6(t.computeMask(i,o));if(t.activityRegularizer)throw new V6("LayersModel invocation with concrete Tensor value(s) in the presence of activity regularizer(s) is not supported yet.");for(let e=0;e<r.length;++e){const t=r[e],i=a[e],s=l[e];n[t.id]=[i,s]}}}}const r=[],s=[],o=[];for(const e of this.outputs){G6(e.id in n,`Could not compute output ${e.name} : ${e.id}`);const[t,i]=n[e.id];o.push(t.shape),r.push(t),s.push(i)}return[r,s,o]}buildNodeConversionMap(e){const t={};let n;for(const e of this.layers){n=e instanceof hee?1:0;for(let i=0;i<e.inboundNodes.length;i++){const r=hee.nodeKey(e,i);this.containerNodes.has(r)&&(t[r]=n,n+=1)}}return t}getLayer(e,t){if(null!=t)return this.findLayer(t);if(null==e)throw new U6("Provide either a layer name or layer index");if("number"==typeof e)return this.findLayer(e);for(const t of this.layers)if(t.name===e)return t;throw new U6(`No such layer: ${e}`)}findLayer(e){if(this.layers.length<=e)throw new U6(`Was asked to retrieve layer at index ${e}, but model only has ${this.layers.length} layer(s).`);return this.layers[e]}calculateLosses(){return(0,v3.tidy)(()=>{const e=[];for(const t of this.layers)for(let n=0;n<t.inboundNodes.length;++n){const i=hee.nodeKey(t,n);this.containerNodes.has(i)&&e.push(...t.calculateLosses())}return e})}getConfig(){const e={name:this.name},t=this.buildNodeConversionMap(this.layers),n=[];for(const e of this.layers){const i=e.getClassName(),r=e.getConfig(),s=[];for(let n=0;n<e.inboundNodes.length;n++){const i=e.inboundNodes[n],r=hee.nodeKey(e,n);let o={};if(this.containerNodes.has(r)){if(i.callArgs)try{JSON.stringify(i.callArgs),o=i.callArgs}catch(t){console.warn(`Layer ${e.name} was passed non-serializable keyword arguments: ${i.callArgs}. They will not be included in the serialized model (and thus will be missing at deserialization time).`),o={}}if(i.inboundLayers.length>0){const e=[];for(let n=0;n<i.inboundLayers.length;n++){const r=i.inboundLayers[n],s=i.nodeIndices[n],a=i.tensorIndices[n];let l=t[hee.nodeKey(r,s)];null==l&&(l=0),e.push([r.name,l,a,o])}s.push(e)}}}const o={};o.name=e.name,o.className=i,o.config=r,o.inboundNodes=s,n.push(o)}e.layers=n;const i=[];for(let e=0;e<this.inputLayers.length;e++){const n=this.inputLayers[e],r=this.inputLayersNodeIndices[e],s=hee.nodeKey(n,r);if(!this.containerNodes.has(s))continue;let o=t[s];null==o&&(o=0);const a=this.inputLayersTensorIndices[e];i.push([n.name,o,a])}e.inputLayers=i;const r=[];for(let e=0;e<this.outputLayers.length;e++){const n=this.outputLayers[e],i=this.outputLayersNodeIndices[e],s=hee.nodeKey(n,i);if(!this.containerNodes.has(s))continue;let o=t[s];null==o&&(o=0);const a=this.outputLayersTensorIndices[e];r.push([n.name,o,a])}return e.outputLayers=r,e}static fromConfig(e,t,n={},i=!1){const r={},s={};function o(e,t){e.name in s?s[e.name].push(t):s[e.name]=[t]}function a(e,t){const n=[];let i;for(const s of t){const a=s[0],l=s[1],u=s[2];if(i=null==s[3]?{}:s[3],!(a in r))return void o(e,t);const c=r[a];if(c.inboundNodes.length<=l)return void o(e,t);const d=c.inboundNodes[l];n.push(d.outputTensors[u])}n.length>0&&e.apply(W6(n),i)}function l(e){const n=e.name,s=M7(e,null!=t.customObjects?t.customObjects:{});s.setFastWeightInitDuringBuild(i),r[n]=s;e.inboundNodes.forEach(e=>{if(!(e instanceof Array))throw new U6(`Corrupted configuration, expected array for nodeData: ${e}`);o(s,e)})}const u=t.name,c=t.layers;for(const e of c)l(e);for(;!i8(s);)for(const e of c){const t=r[e.name];if(t.name in s){const e=s[t.name];delete s[t.name];for(const n of e)a(t,n)}}const d=[],h=[],p=t.inputLayers;for(const e of p){const t=e[0],n=e[1],i=e[2];G6(t in r);const s=r[t].inboundNodes[n].outputTensors;d.push(s[i])}const f=t.outputLayers;for(const e of f){const t=e[0],n=e[1],i=e[2];G6(t in r);const s=r[t].inboundNodes[n].outputTensors;h.push(s[i])}return new e({inputs:d,outputs:h,name:u})}get stateful(){if(this._stateful)throw new U6("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(){(0,v3.tidy)(()=>{this.layers.forEach(e=>{e.stateful&&e.resetStates()})})}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function pee(e,t,n){const i=t.length;if(null==e||Array.isArray(e)&&0===e.length)return t.map(e=>null);if(1===i)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!==i)throw new Error(`Provided ${n} is an array of ${e.length} element(s), but the model has ${i} 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 (${i}) outputs, so ${n} must be either an array with ${i} elements or an object with ${t} keys. Provided ${n} not understood: ${JSON.stringify(e)}`)}function fee(e,t){return pee(e,t,"classWeight")}async function mee(e,t,n,i){if(null!=t||null!=i)throw new Error("Support sampleWeight is not implemented yet");if(null!=n){const t=(0,v3.tidy)(()=>{if(1===e.shape.length)return(0,v3.clone)(e);if(2===e.shape.length){if(e.shape[1]>1){const t=1;return(0,v3.argMax)(e,t)}if(1===e.shape[1])return(0,v3.reshape)(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.`)}),i=Array.from(await t.data());(0,v3.dispose)(t);const r=[];return i.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])}),(0,v3.tensor1d)(r,"float32")}return null}function gee(e,t){return(0,v3.mul)(e,t)}function _ee(e,t){let n,i;const r=t;n=r.xs,i=r.ys,v3.util.assert(null!=n&&null!=i,()=>`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 s=yee("input",e.inputNames,n),o=yee("output",e.outputNames,i),a=s[0].shape[0];v3.util.assert(s.length===e.inputs.length,()=>`LayersModel has ${e.inputs.length} inputs, but the dataset provides ${s.length} inputs. (Expected input keys: ${JSON.stringify(e.inputNames)})`),v3.util.assert(o.length===e.outputs.length,()=>`LayersModel has ${e.outputs.length} outputs, but the dataset provides ${o.length} outputs. (Expected output keys: ${JSON.stringify(e.outputNames)})`);for(let t=0;t<s.length;t++)v3.util.assert(s[t].shape[0]===a,()=>`Batch size mismatch: input ${e.inputNames[t]} has ${s[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);for(let t=0;t<o.length;t++)v3.util.assert(o[t].shape[0]===a,()=>`Batch size mismatch: output ${e.outputNames[t]} has ${o[t].shape[0]}; expected ${a} based on input ${e.inputNames[0]}.`);return{xs:s,ys:o}}function yee(e,t,n){if(n instanceof v3.Tensor)return[n];if(Array.isArray(n))return v3.util.assert(n.length===t.length,()=>`Received an array of ${n.length} Tensors, but expected ${t.length} to match the ${e} keys ${t}.`),n;{const i=[];for(const r of t){if(null==n[r])throw new U6(`The feature data generated by the dataset lacks the required ${e} key '${r}'.`);i.push(n[r])}return i}}async function vee(e,t,n){const i=null!=n.batchesPerEpoch;if(v3.util.assert(null!=e.optimizer,()=>"You must compile a model before training/testing. Use LayersModel.compile(modelCompileConfig)."),v3.util.assert(null!=n,()=>"For fitDataset(), the 2nd argument (config) is required, but it is not provided in this call."),v3.util.assert(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}`),v3.util.assert(!i||n.batchesPerEpoch>0&&Number.isInteger(n.batchesPerEpoch),()=>`For fitDataset(), config.batchesPerEpoch is expected to be a positive integer if specified, but got ${n.batchesPerEpoch}`),v3.util.assert(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 s,o;if(r)if(bee(n.validationData))v3.util.assert(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 V6("Validation with sample weights is not implemented yet.");return{xs:e[0],ys:e[1]}}(n.validationData);s=e.xs,o=e.ys}const a=e.makeTrainFunction(),l=e.getDedupedMetricsNames();let u;u=r?l.slice().concat(l.map(e=>"val_"+e)):l.slice();const c=S7(n.callbacks,n.yieldEvery),d=null==n.verbose?1:n.verbose,{callbackList:h,history:p}=O7(c,d,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);h.setModel(e),e.history=p,await h.onTrainBegin(),e.stopTraining_=!1;let f=null==n.initialEpoch?0:n.initialEpoch,m=await t.iterator();for(;f<n.epochs;){const u={};await h.onEpochBegin(f);let c=0,d=0;for(i||(m=await t.iterator());!i||c<n.batchesPerEpoch;){const t=await m.next();if(i&&t.done){console.warn(`You provided \`batchesPerEpoch\` as ${n.batchesPerEpoch}, but your dataset iterator ran out of data after ${c} batches; interrupting training. Make sure that your dataset can generate at least \`batchesPerEpoch * epochs\` batches (in this case, `+n.batchesPerEpoch*n.epochs+" batches). You may need to use the repeat() function when building your dataset.");break}if(null!=t.value){const{xs:i,ys:r}=_ee(e,t.value),s={};s.batch=d,s.size=i[0].shape[0],await h.onBatchBegin(d,s);const o=[];if(null!=n.classWeight){const t=fee(n.classWeight,e.outputNames);for(let e=0;e<t.length;++e)o.push(await mee(r[e],null,t[e]))}const u=i.concat(r).concat(o),p=a(u);v3.dispose(u);for(let e=0;e<l.length;++e){const t=l[e],n=p[e];s[t]=n,v3.keep(n)}await h.onBatchEnd(d,s),b7(s),d++,c++}if(i?c>=n.batchesPerEpoch:t.done){if(r){let t;t=bee(n.validationData)?X6(await e.evaluateDataset(n.validationData,{batches:n.validationBatches})):X6(e.evaluate(s,o,{batchSize:null==n.validationBatchSize?32:n.validationBatchSize,verbose:0}));for(let n=0;n<e.metricsNames.length;++n)u[`val_${e.metricsNames[n]}`]=t[n]}break}if(e.stopTraining_)break}if(await h.onEpochEnd(f,u),f++,e.stopTraining_)break}return await h.onTrainEnd(),await e.history.syncData(),e.history}finally{e.isTraining=!1}}function bee(e){return"function"==typeof e.iterator}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Tee(e){v3.util.assert(e>0&&Number.isInteger(e),()=>`batchSize is required to be a positive integer, but got ${e}`)}function xee(e,t,n){return null==e?[null]:Array.isArray(e)?e.map(e=>P8(e,t,n-t)):P8(e,t,n-t)}function Eee(e,t){return v3.tidy(()=>null==e?null:Array.isArray(e)?e.map(e=>Eee(e,t)):G8(e,"int32"===t.dtype?t:v3.cast(t,"int32")))}function wee(e,t){const n=[];let i=0,r=null;for(;i<e;)r=i+t,r>=e&&(r=e),n.push([i,r]),i=r;return n}function Iee(e){const t=[];e instanceof v3.Tensor&&(e=[e]);for(let n=0;n<e.length;++n){const i=e[n];if(1===i.rank)t.push(L8(i,1));else{if(0===i.rank)throw new Error("Expected tensor to be at least 1D, but received a 0D tensor (scalar).");t.push(i)}}return t}function Aee(e,t){if(null==e)return;const n=[];if(t instanceof v3.Tensor)n.push(t.id);else if(Array.isArray(t))t.forEach(e=>n.push(e.id));else if(null!=t)for(const e in t){const i=t[e];n.push(i.id)}const i=[];if(e instanceof v3.Tensor)-1===n.indexOf(e.id)&&i.push(e);else if(Array.isArray(e))e.forEach(e=>{-1===n.indexOf(e.id)&&i.push(e)});else if(null!=e)for(const t in e){const r=e[t];-1===n.indexOf(r.id)&&i.push(r)}i.forEach(e=>{e.isDisposed||e.dispose()})}function See(e){return Array.isArray(e)}function Cee(e){return!
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function(e){return e instanceof v3.Tensor}(e)&&!See(e)}function Oee(e,t,n,i=!0,r=""){if(null==t||0===t.length){if(null!=e){let t=!1;if(See(e)&&e.length>0)t=!0;else if(Cee(e)){for(const n in e)if(e.hasOwnProperty(n)){t=!0;break}}else t=!0;if(t)throw new U6(`Error when checking model ${r} expected no data, but got ${e}`)}return[]}if(null==e)return t.map(e=>null);let s;if(Cee(e)){s=[];for(const n of t){if(null==e[n])throw new U6(`No data provided for "${n}". Need data for each key in: ${t}`);s.push(e[n])}}else if(See(e)){if(e.length!==t.length)throw new U6(`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}`);s=e}else{if(t.length>1)throw new U6(`The model ${r} expects ${t.length} Tensor(s), but only received one Tensor. Found: Tensor with shape ${e.shape}`);s=[e]}if(s=Iee(s),null!=n)for(let e=0;e<t.length;++e){if(null==n[e])continue;const o=s[e];if(o.shape.length!==n[e].length)throw new U6(`Error when checking ${r}: expected ${t[e]} to have ${n[e].length} dimension(s). but got array with shape ${o.shape}`);for(let t=0;t<n[e].length;++t){if(0===t&&!i)continue;const s=o.shape[t],a=n[e][t];if(null!=a&&a>=0&&s!==a)throw new U6(`${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 ${o.shape[0]} examples, each with shape [${o.shape.slice(1,o.shape.length)}] (tensor shape [${o.shape}])`)}}return s}function Mee(e,t,n,i=!0,r=""){let s;if(Array.isArray(e)){if(e.length!==t.length)throw new U6(`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).`);s=e}else{if(t.length>1)throw new U6(`The model expects ${t.length} ${r} Tensors, but only received one Tensor. Found: array with shape ${JSON.stringify(e.shape)}.`);s=[e]}if(null!=n)for(let e=0;e<t.length;++e){if(null==n[e])continue;const o=s[e];if(o.shape.length!==n[e].length)throw new U6(`Error when checking ${r}: expected ${t[e]} to have ${n[e].length} dimension(s), but got array with shape ${JSON.stringify(o.shape)}`);for(let s=0;s<n[e].length;++s){if(0===s&&!i)continue;const a=o.shape[s],l=n[e][s];if(null!=l&&l!==a)throw new U6(`Error when checking ${r}: expected ${t[e]} to have shape ${JSON.stringify(n[e])} but got array with shape ${JSON.stringify(o.shape)}.`)}}}class kee extends hee{constructor(e){super(e),this.isTraining=!1}summary(e,t,n=console.log){if(!this.built)throw new U6("This model has never been called, thus its weights have not been created yet. So no summary can be displayed. Build the model first (e.g., by calling it on some test data).");ree(this,e,t,n)}compile(e){if(null==e.loss&&(e.loss=[]),this.loss=e.loss,"string"==typeof e.optimizer)this.optimizer_=
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function(e){const t={Adagrad:()=>v3.train.adagrad(.01),Adadelta:()=>v3.train.adadelta(1,.95,D8()),Adam:()=>v3.train.adam(.001,.9,.999,D8()),Adamax:()=>v3.train.adamax(.002,.9,.999,D8(),0),RMSProp:()=>v3.train.rmsprop(.001,.9,0,D8()),SGD:()=>v3.train.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 U6(`Unknown Optimizer ${e}`)}(e.optimizer),this.isOptimizerOwned=!0;else{if(!(e.optimizer instanceof v3.Optimizer))throw new U6("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 U6(`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=>z7(e))}else{const n=z7(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 U6(`Unknown entry in loss dictionary: "${t}". Only expected the following keys: ${this.outputNames}`);for(const n of this.outputNames)null==e.loss[n]&&console.warn(`Output "${n}" is missing from loss dictionary. We assume this was done on purpose, and we will not be expecting data to be passed to ${n} during training`),t.push(z7(e.loss[n]))}this.lossFunctions=t,this.feedOutputNames=[],this.feedOutputShapes=[],this.feedLossFns=[];for(let e=0;e<this.outputs.length;++e){const t=this.internalOutputShapes[e],n=this.outputNames[e];this.feedOutputNames.push(n),this.feedOutputShapes.push(t),this.feedLossFns.push(this.lossFunctions[e])}const n=[];this.metrics=e.metrics,this.metricsNames=["loss"],this.metricsTensors=[],E8("loss",()=>{for(let e=0;e<this.outputs.length;++e){if(-1!==n.indexOf(e))continue;const t=this.lossFunctions[e];this.outputs.length>1&&(this.metricsTensors.push([t,e]),this.metricsNames.push(this.outputNames[e]+"_loss"))}});const i=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 i of t){let t=n.hasOwnProperty(i)?n[i]:[];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])};E8("metric",()=>{for(let e=0;e<this.outputs.length;++e){if(-1!==n.indexOf(e))continue;(t=>{let n,i,s;for(const o of t){if("string"==typeof o&&-1!==["accuracy","acc","crossentropy","ce"].indexOf(o)){const t=this.internalOutputShapes[e];let r;1===t[t.length-1]||this.lossFunctions[e]===B7?-1!==["accuracy","acc"].indexOf(o)?i=j7:-1!==["crossentropy","ce"].indexOf(o)&&(i=X7):this.lossFunctions[e]===P7?-1!==["accuracy","acc"].indexOf(o)?i=q7:-1!==["crossentropy","ce"].indexOf(o)&&(i=Z7):-1!==["accuracy","acc"].indexOf(o)?i=Y7:-1!==["crossentropy","ce"].indexOf(o)&&(i=K7),-1!==["accuracy","acc"].indexOf(o)?r="acc":-1!==["crossentropy","ce"].indexOf(o)&&(r="ce"),s=i,n=""+r}else{const e=J7(o);s=e,n=""+eee(o)}let t;E8(n,()=>{t=s}),r(e,n,t)}})(i[e])}}),this.collectedTrainableWeights=this.trainableWeights}checkTrainableWeightsConsistency(){null!=this.collectedTrainableWeights&&this.trainableWeights.length!==this.collectedTrainableWeights.length&&console.warn("Discrepancy between trainableweights and collected trainable weights. Did you set `model.trainable` without calling `model.compile()` afterwards?")}evaluate(e,t,n={}){const i=null==n.batchSize?32:n.batchSize;Tee(i);const r=this.standardizeUserDataXY(e,t,!0,i);try{const e=r[0].concat(r[1]);this.makeTestFunction();const t=this.testFunction;return W6(this.testLoop(t,e,i,n.verbose,n.steps))}finally{Aee(r[0],e),Aee(r[1],t)}}async evaluateDataset(e,t){return this.makeTestFunction(),async function(e,t,n){const i=null!=(n=n||{}).batches,r=e.testFunction;let s=[];if(n.verbose>0)throw new V6("Verbose mode is not implemented yet.");v3.util.assert(!i||n.batches>0&&Number.isInteger(n.batches),()=>`Test loop expects \`batches\` to be a positive integer, but received ${JSON.stringify(n.batches)}`);const o=function(e){return"function"==typeof e.next}(t)?t:await t.iterator();let a=0,l=0;for(;!i||l<n.batches;){const t=await o.next();if(s=v3.tidy(()=>{if(t.value){const{xs:n,ys:i}=_ee(e,t.value),o=n.concat(i),u=v3.tidy(()=>r(o));if(v3.dispose(o),0===l)for(let e=0;e<u.length;++e)s.push((0,v3.scalar)(0));const c=o[0].shape[0];for(let e=0;e<u.length;++e){const t=u[e],n=s[e];s[e]=v3.tidy(()=>v3.add(s[e],v3.mul(c,t))),l>0&&v3.dispose(n)}v3.dispose(u),a+=c,++l}return s}),t.done){i&&console.warn(`Your dataset iterator ran out of data during evaluateDataset(). Interrupting evalution. Make sure that your dataset can generate at least \`batches\` batches (in this case, ${n.batches} batches). You may need to use the repeat() function when building your dataset.`);break}}for(let e=0;e<s.length;++e){const t=s[e];s[e]=v3.div(s[e],a),v3.dispose(t)}return W6(s)}(this,e,t)}checkNumSamples(e,t,n,i="steps"){let r;if(null!=n){if(r=null,null!=t)throw new U6(`If ${i} is set, batchSize must be null or undefined.Got batchSize = ${t}`)}else{if(null==e)throw new U6(`Either the input data should have a defined shape, or ${i} shoud be specified.`);r=Array.isArray(e)?e[0].shape[0]:e.shape[0]}return r}execute(e,t){if(Array.isArray(t)&&0===t.length)throw new U6("`outputs` is an empty Array, which is not allowed.");const n=Array.isArray(t),i=n?t:[t],r=this.retrieveSymbolicTensors(i),s=new P9;if(e instanceof v3.Tensor&&(e=[e]),Array.isArray(e)){if(e.length!==this.inputs.length)throw new U6(`The number of inputs provided (${e.length}) does not match the number of inputs of this model (${this.inputs.length}).`);for(let t=0;t<this.inputs.length;++t)s.add(this.inputs[t],e[t])}else for(const t of this.inputs){const n=e[t.name];if(null==n)throw new U6(`No value is provided for the model's input ${t.name}`);s.add(t,n)}const o=U9(r,s);return n?o:o[0]}retrieveSymbolicTensors(e){const t=Y6(null,e.length);let n=e.length;for(const i of this.layers){const r=Array.isArray(i.output)?i.output:[i.output],s=r.map(e=>e.name);for(let i=0;i<e.length;++i){const o=s.indexOf(e[i]);if(-1!==o&&(t[i]=r[o],n--),0===n)break}if(0===n)break}if(n>0){const n=[];throw t.forEach((t,i)=>{null==t&&n.push(e[i])}),new U6(`Cannot find SymbolicTensors for output name(s): ${JSON.stringify(n)}`)}return t}predictLoop(e,t=32,n=!1){return v3.tidy(()=>{const i=this.checkNumSamples(e);if(n)throw new V6("Verbose predictLoop() is not implemented yet.");const r=wee(i,t),s=this.outputs.map(e=>[]);for(let t=0;t<r.length;++t){v3.tidy(()=>{const n=r[t][0],i=r[t][1],s=xee(e,n,i),o=[];if(Array.isArray(s))for(let e=0;e<s.length;++e)o.push({key:this.inputs[e],value:s[e]});else o.push({key:this.inputs[0],value:s});const a=new P9(o);return U9(this.outputs,a)}).forEach((e,t)=>s[t].push(e))}return W6(s.map(e=>v3.concat(e,0)))})}predict(e,t={}){const n=Iee(e);Mee(n,this.inputNames,this.feedInputShapes,!1);try{const e=null==t.batchSize?32:t.batchSize;return Tee(e),this.predictLoop(n,e)}finally{Aee(n,e)}}predictOnBatch(e){Mee(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,i){if(null==this.optimizer_)throw new $6("You must compile a model before training/testing. Use LayersModel.compile(modelCompileArgs).");const r=[];for(let e=0;e<this.feedOutputShapes.length;++e){const t=this.feedOutputShapes[e];this.feedLossFns[e]===P7?r.push(t.slice(0,t.length-1).concat([1])):r.push(t)}if(function(e,t){const n=n8(e.map(e=>e.shape[0]));n.sort();const i=n8(t.map(e=>e.shape[0]));if(i.sort(),n.length>1)throw new U6(`All input Tensors (x) should have the same number of samples. Got array shapes: ${JSON.stringify(e.map(e=>e.shape))}`);if(i.length>1)throw new U6(`All target Tensors (y) should have the same number of samples. Got array shapes: ${JSON.stringify(t.map(e=>e.shape))}`);if(n.length>0&&i.length>0&&!v3.util.arraysEqual(n,i))throw new U6(`Input Tensors should have the same number of samples as target Tensors. Found ${n[0]} input sample(s) and ${i[0]} target sample(s).`)}(e=Oee(e,this.feedInputNames,this.feedInputShapes,!1,"input"),t=Oee(t,this.feedOutputNames,r,!1,"target")),function(e,t,n){const i=[R7,B7,L7];for(let r=0;r<e.length;++r){const s=e[r],o=t[r],a=n[r];if(null!=o){if(o===L7&&1===s.shape[s.shape.length-1])throw new U6(`You are passing a target array of shape ${s.shape} while using a loss 'categorical_crossentropy'. 'categorical_crossentropy'expects targets to be binary matrices (1s and 0s) of shape [samples, classes].`);if(-1!==i.indexOf(o)){const e=s.shape.slice(1),t=a.slice(1);for(let n=0;n<e.length;++n){const i=e[n],r=t[n];if(null!=r&&i!==r)throw new U6(`A target Tensor with shape ${s.shape} was passed for an output of shape ${a}, while using a loss function that expects targets to have the same shape as the output.`)}}}}}(t,this.feedLossFns,this.feedOutputShapes),this.stateful&&null!=i&&i>0&&e[0].shape[0]%i!==0)throw new U6(`In a stateful network, you should only pass inputs with a number of samples that is divisible by the batch size ${i}. Found: ${e[0].shape[0]} sample(s).`);return[e,t]}async standardizeUserData(e,t,n,i,r=!0,s){const[o,a]=this.standardizeUserDataXY(e,t,r,s);if(null!=n)throw new Error("sample weight is not supported yet.");let l=null;if(null!=i){const e=fee(i,this.outputNames);l=[];for(let t=0;t<e.length;++t)l.push(await mee(a[t],null,e[t]))}return[o,a,l]}testLoop(e,t,n,i=0,r){return v3.tidy(()=>{const s=this.checkNumSamples(t,n,r,"steps"),o=[];if(i>0)throw new V6("Verbose mode is not implemented yet.");if(null!=r)throw new V6("steps mode in testLoop() is not implemented yet");{const i=wee(s,n),r=(0,v3.tensor1d)(R8(0,s));for(let n=0;n<i.length;++n){const s=i[n][0],a=i[n][1],l=P8(r,s,a-s),u=Eee(t,l),c=e(u);if(0===n)for(let e=0;e<c.length;++e)o.push((0,v3.scalar)(0));for(let e=0;e<c.length;++e){const t=c[e];o[e]=v3.add(o[e],v3.mul(a-s,t))}}for(let e=0;e<o.length;++e)o[e]=v3.div(o[e],s)}return o})}getDedupedMetricsNames(){const e=this.metricsNames,t=[];for(let n=0;n<e.length;++n){const i=e[n];let r=i;if(H6(e,i)>1){r+=`_${H6(e.slice(0,n),i)}`}t.push(r)}return t}makeTrainFunction(){return e=>{const t=[],n=e.slice(0,this.inputs.length),i=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),s=[],o=this.collectedTrainableWeights.map(e=>e.read());return[this.optimizer_.minimize(()=>{const e=[];for(let t=0;t<this.inputs.length;++t)e.push({key:this.inputs[t],value:n[t]});const o=new P9(e),a=U9(this.outputs,o,{training:!0});let l;for(let e=0;e<this.lossFunctions.length;++e){let n=(0,this.lossFunctions[e])(i[e],a[e]);null!=r[e]&&(n=gee(n,r[e]));const s=v3.mean(n);t.push(s),l=0===e?n:v3.add(l,n)}for(let e=0;e<this.metricsTensors.length;++e){let n;if(this.outputs.length>1&&e<this.outputs.length)n=t[e];else{const t=this.metricsTensors[e][0],r=this.metricsTensors[e][1];n=v3.mean(t(i[r],a[r]))}v3.keep(n),s.push(n)}return l=v3.mean(l),this.calculateLosses().forEach(e=>{l=v3.add(l,e)}),l},!0,o)].concat(s)}}makeTestFunction(){this.testFunction=e=>v3.tidy(()=>{const t=[];let n;const i=e.slice(0,this.inputs.length),r=e.slice(this.inputs.length,this.inputs.length+this.outputs.length),s=[];for(let e=0;e<this.inputs.length;++e)s.push({key:this.inputs[e],value:i[e]});const o=new P9(s),a=U9(this.outputs,o);for(let e=0;e<this.lossFunctions.length;++e){const i=this.lossFunctions[e],s=v3.mean(i(r[e],a[e]));n=0===e?s:v3.add(n,s),t.push(n)}for(let e=0;e<this.metricsTensors.length;++e){const n=this.metricsTensors[e][0],i=this.metricsTensors[e][1],s=v3.mean(n(r[i],a[i]));t.push(s)}return t})}async fit(e,t,n={}){if(this.isTraining)throw new Error("Cannot start training because another fit() call is ongoing.");let i,r,s,o,a,l,u,c,d;this.isTraining=!0;try{const h=null==n.batchSize?32:n.batchSize;Tee(h);const p=!1,f=await this.standardizeUserData(e,t,n.sampleWeight,n.classWeight,p,h);i=f[0],r=f[1],d=f[2];let m,g=!1;if(null!=n.validationData&&n.validationData.length>0){if(g=!0,2!==n.validationData.length)throw 3===n.validationData.length?new V6("validationData including sample weights is not supported yet."):new U6(`When passing validation data, it must contain 2 (valX, valY) or 3 (valX, valY, valSampleWeight) items; ${n.validationData} is invalid.`);a=n.validationData[0],l=n.validationData[1];const e=!0,t=await this.standardizeUserData(a,l,null,null,e,h);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(i[0].shape[0]*(1-n.validationSplit)),t=i[0].shape[0];u=xee(i,e,t),s=i,i=xee(i,0,e),c=xee(r,e,t),o=r,r=xee(r,0,e),m=u.concat(c)}else null!=n.validationSteps&&(g=!0);const _=i.concat(r).concat(d);this.checkTrainableWeightsConsistency();const y=this.makeTrainFunction(),v=this.getDedupedMetricsNames();let b,T;g?(this.makeTestFunction(),b=this.testFunction,T=v.slice().concat(v.map(e=>"val_"+e))):(b=null,m=[],T=v.slice());const x=S7(n.callbacks,n.yieldEvery);return await this.fitLoop(y,_,v,h,n.epochs,n.verbose,x,b,m,n.shuffle,T,n.initialEpoch,null,null)}finally{this.isTraining=!1,Aee(i,e),Aee(r,t),Aee(s,e),Aee(o,t),Aee(u,a),Aee(c,l),null!=d&&v3.dispose(d)}}async fitLoop(e,t,n,i,r,s,o,a,l,u,c,d,h,p){null==i&&(i=32),null==r&&(r=1),null==u&&(u=!0),null==d&&(d=0);let f=!1;if(null!=a&&null!=l&&(f=!0),null!=p&&(f=!0,null==h))throw new U6("Can only use `validationSteps` when doing step-wise training, i.e., `stepsPerEpoch` must be set.");const m=this.checkNumSamples(t,i,h,"steps_per_epoch");let g;null!=m&&(g=R8(0,m)),null==s&&(s=1);const{callbackList:_,history:y}=O7(o,s,r,d,m,h,i,f,c);_.setModel(this),this.history=y,await _.onTrainBegin(),this.stopTraining_=!1;for(let s=d;s<r;++s){await _.onEpochBegin(s);const r={};if(null!=h)throw new V6("stepsPerEpoch mode is not implemented yet.");{if("batch"===u)throw new V6("batch shuffling is not implemneted yet");u&&v3.util.shuffle(g);const s=(0,v3.tensor1d)(g),o=wee(m,i);for(let u=0;u<o.length;++u){const c={};if(await _.onBatchBegin(u,c),v3.tidy(()=>{const d=o[u][0],h=o[u][1],p=P8(s,d,h-d);c.batch=u,c.size=h-d;const m=Eee(t,p),g=e(m);for(let e=0;e<n.length;++e){const t=n[e],i=g[e];c[t]=i,v3.keep(i)}if(u===o.length-1&&f){const e=this.testLoop(a,l,i);for(let t=0;t<n.length;++t){const i=n[t],s=e[t];v3.keep(s),r["val_"+i]=s}}}),await _.onBatchEnd(u,c),b7(c),this.stopTraining_)break}s.dispose()}if(await _.onEpochEnd(s,r),this.stopTraining_)break}return await _.onTrainEnd(),await this.history.syncData(),this.history}async fitDataset(e,t){return vee(this,e,t)}async trainOnBatch(e,t){const n=await this.standardizeUserData(e,t),i=n[0],r=n[1],s=this.makeTrainFunction()(i.concat(r)),o=[];for(const e of s){const t=await e.data();o.push(t[0])}return v3.dispose(s),Aee(n[0],e),Aee(n[1],t),W6(o)}getNamedWeights(e){const t=[],n=null!=e&&e.trainableOnly,i=n?this.trainableWeights:this.weights,r=this.getWeights(n);for(let e=0;e<i.length;++e)n&&!i[e].trainable||t.push({name:i[e].originalName,tensor:r[e]});return t}set stopTraining(e){this.stopTraining_=e}get stopTraining(){return this.stopTraining_}get optimizer(){return this.optimizer_}set optimizer(e){this.optimizer_!==e&&(this.optimizer_=e,this.isOptimizerOwned=!1)}dispose(){const e=super.dispose();if(0===e.refCountAfterDispose&&null!=this.optimizer&&this.isOptimizerOwned){const t=v3.memory().numTensors;this.optimizer_.dispose(),e.numDisposedVariables+=t-v3.memory().numTensors}return e}getLossIdentifiers(){let e;if("string"==typeof this.loss)e=q6(this.loss);else if(Array.isArray(this.loss)){for(const e of this.loss)if("string"!=typeof e)throw new Error("Serialization of non-string loss is not supported.");e=this.loss.map(e=>q6(e))}else{const t=Object.keys(this.loss);e={};const n=this.loss;for(const i of t){if("string"!=typeof n[i])throw new Error("Serialization of non-string loss is not supported.");e[i]=q6(n[i])}}return e}getMetricIdentifiers(){if("string"==typeof this.metrics||"function"==typeof this.metrics)return[q6(eee(this.metrics))];if(Array.isArray(this.metrics))return this.metrics.map(e=>q6(eee(e)));{const e={};for(const t in this.metrics)e[t]=q6(eee(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=M7(uee(e.optimizer_config));let n,i;if("string"==typeof e.loss)n=K6(e.loss);else if(Array.isArray(e.loss))n=e.loss.map(e=>K6(e));else if(null!=e.loss){n={};for(const t in e.loss)n[t]=K6(e.loss[t])}if(Array.isArray(e.metrics))i=e.metrics.map(e=>K6(e));else if(null!=e.metrics){i={};for(const t in e.metrics)i[t]=K6(e.metrics[t])}this.compile({loss:n,metrics:i,optimizer:t})}async save(e,t){if("string"==typeof e){const t=v3.io.getSaveHandlers(e);if(0===t.length)throw new U6(`Cannot find any save handlers for URL '${e}'`);if(t.length>1)throw new U6(`Found more than one (${t.length}) save handlers for URL '${e}'`);e=t[0]}if(null==e.save)throw new U6("LayersModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");const n=await v3.io.encodeWeights(this.getNamedWeights(t)),i={modelTopology:this.toJSON(null,!1),format:"layers-model",generatedBy:`TensorFlow.js tfjs-layers v${dee}`,convertedBy:null};if(null!=t&&t.includeOptimizer&&null!=this.optimizer){i.trainingConfig=this.getTrainingConfig();const e="optimizer",{data:t,specs:r}=await v3.io.encodeWeights(await this.optimizer.getWeights(),e);n.specs.push(...r),n.data=v3.io.concatenateArrayBuffers([n.data,t])}if(null!=this.userDefinedMetadata){const e=!0;nee(this.userDefinedMetadata,this.name,e),i.userDefinedMetadata=this.userDefinedMetadata}return i.weightData=n.data,i.weightSpecs=n.specs,e.save(i)}setUserDefinedMetadata(e){nee(e,this.name),this.userDefinedMetadata=e}getUserDefinedMetadata(){return this.userDefinedMetadata}}kee.className="Model",v3.serialization.registerClass(kee);class Ree extends kee{}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
async function Nee(e,t){"modelTopology"in e||(e={modelTopology:e});let n=e.modelTopology;null!=n.model_config&&(n=n.model_config);const i=M7(uee(n),t);if(null!=e.weightsManifest){const t=await v3.io.loadWeights(e.weightsManifest,e.pathPrefix,i.weights.map(e=>e.originalName)),n={};for(const e of i.weights)n[e.originalName]=t[e.originalName];i.loadWeights(n),(0,v3.dispose)(t)}return i}async function Dee(e,t){if(null==t&&(t={}),"string"==typeof e){const n=v3.io.getLoadHandlers(e,t);if(0===n.length)n.push(v3.io.browserHTTPRequest(e,t));else if(n.length>1)throw new U6(`Found more than one (${n.length}) load handlers for URL '${e}'`);e=n[0]}return async function(e,t,n){null==n&&(n={});if(null==e.load)throw new U6("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const i=await e.load();let r=i.modelTopology;null!=r.model_config&&(r=r.model_config);const s=null==n.strict||n.strict,o=null!=i.weightData&&null!=i.weightSpecs&&s,a=M7(uee(r),t,o),l=i.trainingConfig;null!=l&&a.loadTrainingConfig(l);null!=i.userDefinedMetadata&&a.setUserDefinedMetadata(i.userDefinedMetadata);if(null!=i.weightData){if(null==i.weightSpecs)throw new U6("LayersModel artifacts contains weight data, but not weight specs. Therefore loading of weights cannot proceed.");const{modelWeights:e,optimizerWeights:t}=function(e,t){const n=v3.io.decodeWeights(e,t),i={},r=[];return t.forEach(e=>{"optimizer"===e.group?r.push({name:e.name,tensor:n[e.name]}):i[e.name]=n[e.name]}),{modelWeights:i,optimizerWeights:r}}(i.weightData,i.weightSpecs);a.loadWeights(e,s),null!=a.optimizer&&t.length>0&&await a.optimizer.setWeights(t),(0,v3.dispose)(e),(0,v3.dispose)(t.map(e=>e.tensor))}return a}(e,void 0,t)}Ree.className="Functional",v3.serialization.registerClass(Ree);class Fee extends kee{constructor(e){if(super({inputs:[],outputs:[]}),e=e||{},this.trainable=!0,this.built=!1,this.name=null!=e.name?e.name:h8("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 U6(`Negative dimension size caused by adding layer ${e.name} with input shape [${e.inboundNodes[0].inputTensors[0].shape}]`)}add(e){const t=e instanceof Fee||e instanceof kee;let n;if(t){if(n=e,1!==n.outputs.length)throw new U6("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 U6("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 U6("The first layer in a Sequential model must get an `inputShape` or `batchInputShape` argument.");const t=L9({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 U6(`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 U6("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=D9(this.outputs[0])}this.inboundNodes=[],new k9({outboundLayer:this,inboundLayers:[],nodeIndices:[],tensorIndices:[],inputTensors:this.inputs,outputTensors:this.outputs,inputMasks:Y6(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(x9(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 kee({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 $6("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 $6("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 $6("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 $6("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={},i=!1){let r,s={};if(t instanceof Array){if(null==t[0].className||"Merge"===t[0].className)throw new U6("Legacy serialization format not supported yet.");r=t}else v3.util.assert(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,s=t;const o=new e(s);if(!(o instanceof Fee))throw new V6(`Sequential.fromConfig called on non-Sequential input: ${o}`);for(const e of r){const t=M7(e,void 0,i);i&&t.setFastWeightInitDuringBuild(!0),o.add(t)}return o}set stopTraining(e){if(null==this.model)throw new U6("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 U6("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}}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Lee(e){return new kee(e)}function Pee(e){return new Fee(e)}function Bee(e){return L9(e)}function $ee(e,t){C7.registerCallbackConstructor(e,t)}Fee.className="Sequential",v3.serialization.registerClass(Fee);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class Uee extends v3.serialization.Serializable{getConfig(){return{}}}class Vee extends Uee{apply(e,t=1){return function(e,t=1){if(1!==t)throw new V6(`Support for alpha values other than 1 (${t}) is not implemented yet.`);return v3.elu(e)}(e,t)}}Vee.className="elu",v3.serialization.registerClass(Vee);class zee extends Uee{apply(e){return v3.selu(e)}}zee.className="selu",v3.serialization.registerClass(zee);class jee extends Uee{apply(e){return v3.relu(e)}}jee.className="relu",v3.serialization.registerClass(jee);class Yee extends Uee{apply(e){return(0,v3.tidy)(()=>v3.minimum(6,v3.relu(e)))}}Yee.className="relu6",v3.serialization.registerClass(Yee);class Gee extends Uee{apply(e){return e}}Gee.className="linear",v3.serialization.registerClass(Gee);class Hee extends Uee{apply(e){return v3.sigmoid(e)}}Hee.className="sigmoid",v3.serialization.registerClass(Hee);class Wee extends Uee{apply(e){return function(e){return(0,v3.tidy)(()=>{const t=v3.add(.5,v3.mul(.2,e));return v3.clipByValue(t,0,1)})}(e)}}Wee.className="hardSigmoid",v3.serialization.registerClass(Wee);class Xee extends Uee{apply(e){return v3.softplus(e)}}Xee.className="softplus",v3.serialization.registerClass(Xee);class qee extends Uee{apply(e){return function(e){return(0,v3.tidy)(()=>v3.div(e,v3.add(v3.abs(e),1)))}(e)}}qee.className="softsign",v3.serialization.registerClass(qee);class Kee extends Uee{apply(e){return v3.tanh(e)}}Kee.className="tanh",v3.serialization.registerClass(Kee);class Zee extends Uee{apply(e,t=-1){return v3.softmax(e,t)}}Zee.className="softmax",v3.serialization.registerClass(Zee);class Qee extends Uee{apply(e,t=-1){return v3.logSoftmax(e,t)}}Qee.className="logSoftmax",v3.serialization.registerClass(Qee);class Jee extends Uee{apply(e){return(0,v3.tidy)(()=>v3.tidy(()=>{const t=Math.sqrt(2),n=v3.mul(.5,v3.add(1,v3.erf(v3.div(e,t))));return v3.mul(e,n)}))}}Jee.className="gelu",v3.serialization.registerClass(Jee);class ete extends Uee{apply(e){return(0,v3.tidy)(()=>v3.mul(.5,v3.mul(e,v3.add(1,v3.tanh(v3.mul(v3.sqrt(v3.div(2,Math.PI)),v3.add(e,v3.mul(.044715,v3.pow(e,3)))))))))}}ete.className="gelu_new",v3.serialization.registerClass(ete);class tte extends Uee{apply(e){return(0,v3.tidy)(()=>v3.mul(e,v3.tanh(v3.softplus(e))))}}tte.className="mish",v3.serialization.registerClass(tte);class nte extends Uee{apply(e,t=1){return(0,v3.tidy)(()=>v3.mul(v3.sigmoid(v3.mul(e,t)),e))}}function ite(e){return e.getClassName()}function rte(e,t={}){return e8(e,v3.serialization.SerializationMap.getMap().classNameMap,t,"activation")}function ste(e){if(null==e){const e={className:"linear",config:{}};return rte(e)}if("string"==typeof e){const t={};return t.className=e,t.config={},rte(t)}return e instanceof Uee?e:rte(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function ote(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}`)}nte.className="swish",v3.serialization.registerClass(nte);class ate extends v3.serialization.Serializable{}class lte extends ate{constructor(e){super(),ote(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(0,v3.tidy)(()=>{let t=(0,v3.zeros)([1]);return this.hasL1&&(t=(0,v3.add)(t,(0,v3.sum)(v3.mul(this.l1,(0,v3.abs)(e))))),this.hasL2&&(t=(0,v3.add)(t,(0,v3.sum)(v3.mul(this.l2,H8(e))))),v3.reshape(t,[])})}getConfig(){return{l1:this.l1,l2:this.l2}}static fromConfig(e,t){return new e({l1:t.l1,l2:t.l2})}}lte.className="L1L2",v3.serialization.registerClass(lte);const ute={l1l2:"L1L2"};function cte(e){return Q6(e)}function dte(e,t={}){return e8(e,v3.serialization.SerializationMap.getMap().classNameMap,t,"regularizer")}function hte(e){if(null==e)return null;if("string"==typeof e){return dte({className:e in ute?ute[e]:e,config:{}})}return e instanceof ate?e:dte(e)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class pte extends N9{constructor(e){super(null==e?{}:e),this.supportsMasking=!0,null!=e&&(this.maxValue=e.maxValue)}call(e,t){e=T9(e);let n=(0,v3.relu)(e);return null!=this.maxValue&&(n=(0,v3.clipByValue)(n,0,this.maxValue)),n}computeOutputShape(e){return e}getConfig(){const e={maxValue:this.maxValue},t=super.getConfig();return Object.assign(e,t),e}}pte.className="ReLU",v3.serialization.registerClass(pte);class fte extends N9{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=T9(e);return(0,v3.leakyRelu)(n,this.alpha)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}fte.className="LeakyReLU",v3.serialization.registerClass(fte);class mte extends N9{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA_INITIALIZER="zeros",null==e&&(e={}),this.supportsMasking=!0,this.alphaInitializer=y9(e.alphaInitializer||this.DEFAULT_ALPHA_INITIALIZER),this.alphaRegularizer=hte(e.alphaRegularizer),this.alphaConstraint=J9(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 U6(`Expected sharedAxes to be a number or an array of numbers, but got ${e.sharedAxes}`);this.sharedAxes=[e.sharedAxes]}}build(e){const t=(e=x9(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<e.length;++t)n[t]=e[t];this.inputSpec=[new C9({ndim:e.length,axes:n})],this.built=!0}call(e,t){return e=T9(e),(0,v3.prelu)(e,this.alpha.read())}getConfig(){const e={alphaInitializer:_9(this.alphaInitializer),alphaRegularizer:cte(this.alphaRegularizer),alphaConstraint:Z9(this.alphaConstraint),sharedAxes:this.sharedAxes},t=super.getConfig();return Object.assign(e,t),e}}mte.className="PReLU",v3.serialization.registerClass(mte);class gte extends N9{constructor(e){if(super(null==e?{}:e),this.DEFAULT_ALPHA=1,null==e&&(e={}),null!=e.alpha&&e.alpha!==this.DEFAULT_ALPHA)throw new V6(`Non-default alpha value (${e.alpha}) is not supported by the ELU layer yet.`);this.alpha=null==e.alpha?this.DEFAULT_ALPHA:e.alpha}call(e,t){const n=T9(e);return(0,v3.elu)(n)}computeOutputShape(e){return e}getConfig(){const e={alpha:this.alpha},t=super.getConfig();return Object.assign(e,t),e}}gte.className="ELU",v3.serialization.registerClass(gte);class _te extends N9{constructor(e){super(null==e?{}:e),this.DEFAULT_THETA=1,null==e&&(e={}),this.theta=null==e.theta?this.DEFAULT_THETA:e.theta}call(e,t){const n=T9(e);return(0,v3.mul)(n,(0,v3.cast)((0,v3.greater)(n,this.theta),"float32"))}computeOutputShape(e){return e}getConfig(){const e={theta:this.theta},t=super.getConfig();return Object.assign(e,t),e}}_te.className="ThresholdedReLU",v3.serialization.registerClass(_te);class yte extends N9{constructor(e){super(null==e?{}:e),this.DEFAULT_AXIS=1,null==e&&(e={}),this.softmax=(new Zee).apply,this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis}call(e,t){return(0,v3.tidy)(()=>{let n=T9(e);const i=t.mask;if(null!=i){const e=(0,v3.mul)((0,v3.sub)((0,v3.ones)(n.shape),(0,v3.cast)(i,n.dtype)),(0,v3.scalar)(-1e9));n=(0,v3.add)(n,e)}return this.axis instanceof Array?this.axis.length>1?(0,v3.exp)((0,v3.sub)(n,(0,v3.logSumExp)(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}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function vte(e,t,n){if("number"==typeof e)return Y6(e,t);if(e.length!==t)throw new U6(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${e.length} elements.`);for(let i=0;i<t;++i){const r=e[i];if(!C8(r))throw new U6(`The ${n} argument must be an integer or tuple of ${t} integers. Received: ${JSON.stringify(e)} including a non-integer number ${r}`)}return e}function bte(e,t,n,i,r=1){if(null==e)return e;let s;return s="same"===n?e:e-(t+(t-1)*(r-1))+1,Math.floor((s+i-1)/i)}function Tte(e,t,n,i){if(null==e)return null;if("valid"===i)e=e*t+k8([n-t,0]);else{if("same"!==i)throw new U6(`Unsupport padding mode: ${i}.`);e*=t}return e}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function xte(e,t){return(0,v3.tidy)(()=>(v8(t),"channelsFirst"===t?v3.transpose(e,[0,2,3,1]):e))}function Ete(e,t){return(0,v3.tidy)(()=>(v8(t),"channelsFirst"===t?v3.transpose(e,[0,2,3,4,1]):e))}function wte(e,t,n,i=1,r="valid",s,o=1){return(0,v3.tidy)(()=>{if(null==s&&(s="channelsLast"),v8(s),3!==e.shape.length)throw new U6(`The input of a conv1dWithBias operation should be 3, but is ${e.shape.length} instead.`);if(3!==t.shape.length)throw new U6(`The kernel for a conv1dWithBias operation should be 3, but is ${t.shape.length} instead`);if(null!=n&&1!==n.shape.length)throw new U6(`The bias for a conv1dWithBias operation should be 1, but is ${n.shape.length} instead`);if("channelsFirst"===s&&(e=v3.transpose(e,[0,2,1])),"causal"===r)throw new V6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");let a=v3.conv1d(e,t,i,"same"===r?"same":"valid","NWC",o);return null!=n&&(a=X8(a,n)),a})}function Ite(e,t,n,i=[1,1],r="valid",s,o,a=null){return(0,v3.tidy)(()=>{if(null==s&&(s="channelsLast"),v8(s),3!==e.rank&&4!==e.rank)throw new U6(`conv2dWithBiasActivation expects input to be of rank 3 or 4, but received ${e.rank}.`);if(3!==t.rank&&4!==t.rank)throw new U6(`conv2dWithBiasActivation expects kernel to be of rank 3 or 4, but received ${e.rank}.`);let l=xte(e,s);if("causal"===r)throw new V6("The support for CAUSAL padding mode in conv1dWithBias is not implemented yet.");return l=v3.fused.conv2d({x:l,filter:t,strides:i,pad:"same"===r?"same":"valid",dilations:o,dataFormat:"NHWC",bias:n,activation:a}),"channelsFirst"===s&&(l=v3.transpose(l,[0,3,1,2])),l})}function Ate(e,t,n,i=[1,1,1],r="valid",s,o){return(0,v3.tidy)(()=>{if(null==s&&(s="channelsLast"),v8(s),4!==e.rank&&5!==e.rank)throw new U6(`conv3dWithBias expects input to be of rank 4 or 5, but received ${e.rank}.`);if(4!==t.rank&&5!==t.rank)throw new U6(`conv3dWithBias expects kernel to be of rank 4 or 5, but received ${e.rank}.`);let a=Ete(e,s);if("causal"===r)throw new V6("The support for CAUSAL padding mode in conv3dWithBias is not implemented yet.");return a=v3.conv3d(a,t,i,"same"===r?"same":"valid","NDHWC",o),null!=n&&(a=X8(a,n)),"channelsFirst"===s&&(a=v3.transpose(a,[0,4,1,2,3])),a})}yte.className="Softmax",v3.serialization.registerClass(yte);class Ste extends N9{constructor(e,t){if(super(t),this.bias=null,this.DEFAULT_KERNEL_INITIALIZER="glorotNormal",this.DEFAULT_BIAS_INITIALIZER="zeros",Ste.verifyArgs(t),this.rank=e,o8(this.rank,"rank"),1!==this.rank&&2!==this.rank&&3!==this.rank)throw new V6(`Convolution layer for rank other than 1, 2, or 3 (${this.rank}) is not implemented yet.`);if(this.kernelSize=vte(t.kernelSize,e,"kernelSize"),this.strides=vte(null==t.strides?1:t.strides,e,"strides"),this.padding=null==t.padding?"valid":t.padding,b8(this.padding),this.dataFormat=null==t.dataFormat?"channelsLast":t.dataFormat,v8(this.dataFormat),this.activation=ste(t.activation),this.useBias=null==t.useBias||t.useBias,this.biasInitializer=y9(t.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.biasConstraint=J9(t.biasConstraint),this.biasRegularizer=hte(t.biasRegularizer),this.activityRegularizer=hte(t.activityRegularizer),this.dilationRate=vte(null==t.dilationRate?1:t.dilationRate,e,"dilationRate"),1===this.rank&&Array.isArray(this.dilationRate)&&1!==this.dilationRate.length)throw new U6(`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 U6(`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 U6(`dilationRate must be a number or array of three numbers for 3D convolution, but received ${JSON.stringify(this.dilationRate)}`)}static verifyArgs(e){if(G6("kernelSize"in e,"required key 'kernelSize' not in config"),"number"!=typeof e.kernelSize&&!s8(e.kernelSize,"number",1,3))throw new U6(`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:ite(this.activation),useBias:this.useBias,biasInitializer:_9(this.biasInitializer),biasRegularizer:cte(this.biasRegularizer),activityRegularizer:cte(this.activityRegularizer),biasConstraint:Z9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}class Cte extends Ste{constructor(e,t){super(e,t),this.kernel=null,Cte.verifyArgs(t),this.filters=t.filters,o8(this.filters,"filters"),this.kernelInitializer=y9(t.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.kernelConstraint=J9(t.kernelConstraint),this.kernelRegularizer=hte(t.kernelRegularizer)}build(e){e=x9(e);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t])throw new U6(`The channel dimension of the input should be defined. Found ${e[t]}`);const n=e[t],i=this.kernelSize.concat([n,this.filters]);this.kernel=this.addWeight("kernel",i,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(0,v3.tidy)(()=>{let t;e=T9(e);const n=null==this.bias?null:this.bias.read(),i=l8(this.activation.getClassName());if(null!=i&&2===this.rank)t=Ite(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate,i);else{if(1===this.rank)t=wte(e,this.kernel.read(),n,this.strides[0],this.padding,this.dataFormat,this.dilationRate[0]);else if(2===this.rank)t=Ite(e,this.kernel.read(),n,this.strides,this.padding,this.dataFormat,this.dilationRate);else{if(3!==this.rank)throw new V6("convolutions greater than 3D are not implemented yet.");t=Ate(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=x9(e);const t=[],n="channelsLast"===this.dataFormat?e.slice(1,e.length-1):e.slice(2);for(let e=0;e<n.length;++e){const i=bte(n[e],this.kernelSize[e],this.padding,this.strides[e],"number"==typeof this.dilationRate?this.dilationRate:this.dilationRate[e]);t.push(i)}let i=[e[0]];return"channelsLast"===this.dataFormat?(i=i.concat(t),i.push(this.filters)):(i.push(this.filters),i=i.concat(t)),i}getConfig(){const e={filters:this.filters,kernelInitializer:_9(this.kernelInitializer),kernelRegularizer:cte(this.kernelRegularizer),kernelConstraint:Z9(this.kernelConstraint)},t=super.getConfig();return Object.assign(e,t),e}static verifyArgs(e){if(!("filters"in e)||"number"!=typeof e.filters||e.filters<1)throw new U6(`Convolution layer expected config.filters to be a 'number' > 0 but got ${JSON.stringify(e.filters)}`)}}class Ote extends Cte{constructor(e){super(2,e),Ote.verifyArgs(e)}getConfig(){const e=super.getConfig();return delete e.rank,e}static verifyArgs(e){if("number"!=typeof e.kernelSize&&!s8(e.kernelSize,"number",1,2))throw new U6(`Conv2D expects config.kernelSize to be number or number[] with length 1 or 2, but received ${JSON.stringify(e.kernelSize)}.`)}}Ote.className="Conv2D",v3.serialization.registerClass(Ote);class Mte extends Cte{constructor(e){super(3,e),Mte.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 U6(`Conv3D expects config.kernelSize to be number or [number, number, number], but received ${JSON.stringify(e.kernelSize)}.`)}}Mte.className="Conv3D",v3.serialization.registerClass(Mte);class kte extends Ote{constructor(e){if(super(e),this.inputSpec=[new C9({ndim:4})],"same"!==this.padding&&"valid"!==this.padding)throw new U6(`Conv2DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(4!==(e=x9(e)).length)throw new U6("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 U6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"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 C9({ndim:4,axes:{[t]:n}})],this.built=!0}call(e,t){return v3.tidy(()=>{let t=T9(e);if(4!==t.shape.length)throw new U6(`Conv2DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s;"channelsFirst"===this.dataFormat?(r=2,s=3):(r=1,s=2);const o=n[r],a=n[s],l=this.kernelSize[0],u=this.kernelSize[1],c=this.strides[0],d=this.strides[1],h=[i,Tte(o,c,l,this.padding),Tte(a,d,u,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=v3.transpose(t,[0,2,3,1]));let p=v3.conv2dTranspose(t,this.kernel.read(),h,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(p=v3.transpose(p,[0,3,1,2])),null!=this.bias&&(p=X8(p,this.bias.read(),this.dataFormat)),null!=this.activation&&(p=this.activation.apply(p)),p})}computeOutputShape(e){const t=(e=x9(e)).slice();let n,i,r;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3):(n=3,i=1,r=2);const s=this.kernelSize[0],o=this.kernelSize[1],a=this.strides[0],l=this.strides[1];return t[n]=this.filters,t[i]=Tte(t[i],a,s,this.padding),t[r]=Tte(t[r],l,o,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}kte.className="Conv2DTranspose",v3.serialization.registerClass(kte);class Rte extends Mte{constructor(e){if(super(e),this.inputSpec=[new C9({ndim:5})],"same"!==this.padding&&"valid"!==this.padding)throw new U6(`Conv3DTranspose currently supports only padding modes 'same' and 'valid', but received padding mode ${this.padding}`)}build(e){if(5!==(e=x9(e)).length)throw new U6("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 U6("The channel dimension of the inputs should be defined. Found `None`.");const n=e[t],i=this.kernelSize.concat([this.filters,n]);this.kernel=this.addWeight("kernel",i,"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 C9({ndim:5,axes:{[t]:n}})],this.built=!0}call(e,t){return v3.tidy(()=>{let t=T9(e);if(5!==t.shape.length)throw new U6(`Conv3DTranspose.call() expects input tensor to be rank-4, but received a tensor of rank-${t.shape.length}`);const n=t.shape,i=n[0];let r,s,o;"channelsFirst"===this.dataFormat?(o=2,r=3,s=4):(o=1,r=2,s=3);const a=n[o],l=n[r],u=n[s],c=this.kernelSize[0],d=this.kernelSize[1],h=this.kernelSize[2],p=this.strides[0],f=this.strides[1],m=this.strides[2],g=[i,Tte(a,p,c,this.padding),Tte(l,f,d,this.padding),Tte(u,m,h,this.padding),this.filters];"channelsLast"!==this.dataFormat&&(t=v3.transpose(t,[0,2,3,4,1]));let _=v3.conv3dTranspose(t,this.kernel.read(),g,this.strides,this.padding);return"channelsLast"!==this.dataFormat&&(_=v3.transpose(_,[0,4,1,2,3])),null!==this.bias&&(_=X8(_,this.bias.read(),this.dataFormat)),null!==this.activation&&(_=this.activation.apply(_)),_})}computeOutputShape(e){const t=(e=x9(e)).slice();let n,i,r,s;"channelsFirst"===this.dataFormat?(n=1,i=2,r=3,s=4):(n=4,i=1,r=2,s=3);const o=this.kernelSize[0],a=this.kernelSize[1],l=this.kernelSize[2],u=this.strides[0],c=this.strides[1],d=this.strides[2];return t[n]=this.filters,t[i]=Tte(t[i],u,o,this.padding),t[r]=Tte(t[r],c,a,this.padding),t[s]=Tte(t[s],d,l,this.padding),t}getConfig(){const e=super.getConfig();return delete e.dilationRate,e}}Rte.className="Conv3DTranspose",v3.serialization.registerClass(Rte);class Nte extends Cte{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 U6("The `filters` configuration field is required by SeparableConv, but is unspecified.");if(null!=t.kernelInitializer||null!=t.kernelRegularizer||null!=t.kernelConstraint)throw new U6("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 U6(`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=y9(t.depthwiseInitializer||this.DEFAULT_DEPTHWISE_INITIALIZER),this.depthwiseRegularizer=hte(t.depthwiseRegularizer),this.depthwiseConstraint=J9(t.depthwiseConstraint),this.pointwiseInitializer=y9(t.depthwiseInitializer||this.DEFAULT_POINTWISE_INITIALIZER),this.pointwiseRegularizer=hte(t.pointwiseRegularizer),this.pointwiseConstraint=J9(t.pointwiseConstraint)}build(e){if((e=x9(e)).length<this.rank+2)throw new U6(`Inputs to SeparableConv${this.rank}D should have rank ${this.rank+2}, but received input shape: ${JSON.stringify(e)}`);const t="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[t]||e[t]<0)throw new U6(`The channel dimension of the inputs should be defined, but found ${JSON.stringify(e[t])}`);const n=e[t],i=this.kernelSize.concat([n,this.depthMultiplier]),r=[];for(let e=0;e<this.rank;++e)r.push(1);r.push(n*this.depthMultiplier,this.filters);const s=!0;this.depthwiseKernel=this.addWeight("depthwise_kernel",i,"float32",this.depthwiseInitializer,this.depthwiseRegularizer,s,this.depthwiseConstraint),this.pointwiseKernel=this.addWeight("pointwise_kernel",r,"float32",this.pointwiseInitializer,this.pointwiseRegularizer,s,this.pointwiseConstraint),this.useBias?this.bias=this.addWeight("bias",[this.filters],"float32",this.biasInitializer,this.biasRegularizer,s,this.biasConstraint):this.bias=null,this.inputSpec=[new C9({ndim:this.rank+2,axes:{[t]:n}})],this.built=!0}call(e,t){return(0,v3.tidy)(()=>{let t;if(e=T9(e),1===this.rank)throw new V6("1D separable convolution is not implemented yet.");return 2===this.rank&&("channelsFirst"===this.dataFormat&&(e=v3.transpose(e,[0,2,3,1])),t=v3.separableConv2d(e,this.depthwiseKernel.read(),this.pointwiseKernel.read(),this.strides,this.padding,this.dilationRate,"NHWC")),this.useBias&&(t=X8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),"channelsFirst"===this.dataFormat&&(t=v3.transpose(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=_9(this.depthwiseInitializer),e.pointwiseInitializer=_9(this.pointwiseInitializer),e.depthwiseRegularizer=cte(this.depthwiseRegularizer),e.pointwiseRegularizer=cte(this.pointwiseRegularizer),e.depthwiseConstraint=Z9(this.depthwiseConstraint),e.pointwiseConstraint=Z9(this.pointwiseConstraint),e}}Nte.className="SeparableConv";class Dte extends Nte{constructor(e){super(2,e)}}Dte.className="SeparableConv2D",v3.serialization.registerClass(Dte);class Fte extends Cte{constructor(e){super(1,e),Fte.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&&!s8(e.kernelSize,"number",1,1))throw new U6(`Conv1D expects config.kernelSize to be number or number[] with length 1, but received ${JSON.stringify(e.kernelSize)}.`)}}Fte.className="Conv1D",v3.serialization.registerClass(Fte);class Lte extends N9{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(0,v3.tidy)(()=>{if(e=T9(e),"channelsLast"===this.dataFormat){const t=$8(e,this.cropping[0][0],e.shape[1]-this.cropping[0][0]-this.cropping[0][1],2);return $8(t,this.cropping[1][0],e.shape[2]-this.cropping[1][1]-this.cropping[1][0],3)}{const t=$8(e,this.cropping[0][0],e.shape[2]-this.cropping[0][0]-this.cropping[0][1],3);return $8(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}}Lte.className="Cropping2D",v3.serialization.registerClass(Lte);class Pte extends N9{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,v8(this.dataFormat),this.interpolation=null==e.interpolation?"nearest":e.interpolation,t=this.interpolation,r8(f8,"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 v3.tidy(()=>{let t=T9(e);const n=t.shape;if("channelsFirst"===this.dataFormat){t=v3.transpose(t,[0,2,3,1]);const e=this.size[0]*n[2],i=this.size[1]*n[3],r="nearest"===this.interpolation?v3.image.resizeNearestNeighbor(t,[e,i]):v3.image.resizeBilinear(t,[e,i]);return v3.transpose(r,[0,3,1,2])}{const e=this.size[0]*n[1],i=this.size[1]*n[2];return"nearest"===this.interpolation?v3.image.resizeNearestNeighbor(t,[e,i]):v3.image.resizeBilinear(t,[e,i])}})}getConfig(){const e={size:this.size,dataFormat:this.dataFormat,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}}Pte.className="UpSampling2D",v3.serialization.registerClass(Pte);class Bte extends Ste{constructor(e){super(2,e),this.depthwiseKernel=null,this.depthMultiplier=null==e.depthMultiplier?1:e.depthMultiplier,this.depthwiseInitializer=y9(e.depthwiseInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.depthwiseConstraint=J9(e.depthwiseConstraint),this.depthwiseRegularizer=hte(e.depthwiseRegularizer)}build(e){if((e=x9(e)).length<4)throw new U6(`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 U6(`The channel dimension of the inputs to DepthwiseConv2D should be defined, but is not (${e[t]}).`);const n=e[t],i=[this.kernelSize[0],this.kernelSize[1],n,this.depthMultiplier];this.depthwiseKernel=this.addWeight("depthwise_kernel",i,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(0,v3.tidy)(()=>{let t=
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function(e,t,n=[1,1],i="valid",r,s){return(0,v3.tidy)(()=>{null==r&&(r="channelsLast"),v8(r);let o=xte(e,r);if(4!==e.rank)throw new U6(`Input for depthwiseConv2d is required to be 4-D, but is instead ${e.rank}-D`);if(4!==t.rank)throw new U6(`depthwiseKernel is required to be 4-D, but is instead ${t.rank}-D`);return o=v3.depthwiseConv2d(o,t,n,"same"===i?"same":"valid","NHWC",s),"channelsFirst"===r&&(o=v3.transpose(o,[0,3,1,2])),o})}(e=T9(e),this.depthwiseKernel.read(),this.strides,this.padding,this.dataFormat,null);return this.useBias&&(t=X8(t,this.bias.read(),this.dataFormat)),null!=this.activation&&(t=this.activation.apply(t)),t})}computeOutputShape(e){e=x9(e);const t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[1]*this.depthMultiplier:e[3]*this.depthMultiplier,r=bte(t,this.kernelSize[0],this.padding,this.strides[0]),s=bte(n,this.kernelSize[1],this.padding,this.strides[1]);return"channelsFirst"===this.dataFormat?[e[0],i,r,s]:[e[0],r,s,i]}getConfig(){const e=super.getConfig();return e.depthMultiplier=this.depthMultiplier,e.depthwiseInitializer=_9(this.depthwiseInitializer),e.depthwiseRegularizer=cte(this.depthwiseRegularizer),e.depthwiseConstraint=Z9(this.depthwiseRegularizer),e}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function $te(e,t,n,i){if(Array.isArray(e)){if(null!=t||null!=n)throw new U6("When inputs is an array, neither initialState or constants should be provided");null!=i&&(n=e.slice(e.length-i,e.length),e=e.slice(0,e.length-i)),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 Ute(e,t,n,i=!1,r,s,o=!1,a=!1){return v3.tidy(()=>{const l=t.shape.length;if(l<3)throw new U6(`Input should be at least 3D, but is ${l}D.`);const u=[1,0].concat(R8(2,l));if(t=v3.transpose(t,u),null!=s)throw new V6("The rnn() functoin of the deeplearn.js backend does not support constants yet.");o&&console.warn("Backend rnn(): the unroll = true option is not applicable to the imperative deeplearn.js backend."),null!=r&&((r=v3.cast(v3.cast(r,"bool"),"float32")).rank===l-1&&(r=v3.expandDims(r,-1)),r=v3.transpose(r,u)),i&&(t=v3.reverse(t,0),null!=r&&(r=v3.reverse(r,0)));const c=[];let d,h=n;const p=t.shape[0],f=v3.unstack(t);let m,g;null!=r&&(m=v3.unstack(r));for(let t=0;t<p;++t){const n=f[t],i=v3.tidy(()=>e(n,h));if(null==r)d=i[0],h=i[1];else{const e=v3.tidy(()=>{const e=m[t],n=v3.sub(v3.onesLike(e),e);return{output:v3.add(v3.mul(i[0],e),v3.mul(h[0],n)),newStates:h.map((t,r)=>v3.add(v3.mul(i[1][r],e),v3.mul(t,n)))}});d=e.output,h=e.newStates}a&&c.push(d)}if(a){const e=1;g=v3.stack(c,e)}return[d,g,h]})}Bte.className="DepthwiseConv2D",v3.serialization.registerClass(Bte);class Vte extends N9{constructor(e){let t;if(super(e),null==e.cell)throw new U6("cell property is missing for the constructor of RNN.");if(t=Array.isArray(e.cell)?new qte({cells:e.cell}):e.cell,null==t.stateSize)throw new U6("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 C9({ndim:3})],this.stateSpec=null,this.states_=null,this.numConstants=null,this.keptStates=[]}getStates(){if(null==this.states_){return R8(0,Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1).map(e=>null)}return this.states_}setStates(e){this.states_=e}computeOutputShape(e){v9(e)&&(e=e[0]);let t=this.cell.stateSize;Array.isArray(t)||(t=[t]);const n=t[0];let i;if(i=this.returnSequences?[e[0],e[1],n]:[e[0],n],this.returnState){const n=[];for(const i of t)n.push([e[0],i]);return[i].concat(n)}return i}computeMask(e,t){return v3.tidy(()=>{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;n<e;++n)t.push(null);return t}return this.states_}set states(e){this.states_=e}build(e){if(null!=this.numConstants)throw new V6("Constants support is not implemented in RNN yet.");v9(e)&&(e=e[0]);const t=this.stateful?e[0]:null,n=e.slice(2);this.inputSpec[0]=new C9({shape:[t,null,...n]});const i=[e[0]].concat(e.slice(2));let r;if(this.cell.build(i),r=Array.isArray(this.cell.stateSize)?this.cell.stateSize:[this.cell.stateSize],null!=this.stateSpec){if(!v3.util.arraysEqual(this.stateSpec.map(e=>e.shape[e.shape.length-1]),r))throw new U6(`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 C9({shape:[null,e]}));this.stateful&&this.resetStates()}resetStates(e,t=!1){(0,v3.tidy)(()=>{if(!this.stateful)throw new B6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape[0];if(null==n)throw new U6("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=>v3.zeros([n,e])):this.states_=[v3.zeros([n,this.cell.stateSize])];else if(null==e)v3.dispose(this.states_),null!=this.keptStates&&(v3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(e=>v3.zeros([n,e])):this.states_[0]=v3.zeros([n,this.cell.stateSize]);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U6(`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()):v3.dispose(this.states_);for(let t=0;t<this.states_.length;++t){const i=e[t],r=Array.isArray(this.cell.stateSize)?this.cell.stateSize[t]:this.cell.stateSize,s=[n,r];if(!v3.util.arraysEqual(i.shape,s))throw new U6(`State ${t} is incompatible with layer ${this.name}: expected shape=${s}, received shape=${i.shape}`);this.states_[t]=i}}this.states_=this.states_.map(e=>v3.keep(e.clone()))})}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=$te(e,n,i,this.numConstants);e=r.inputs,n=r.initialState,i=r.constants;let s=[],o=[];if(null!=n){t.initialState=n,s=s.concat(n),this.stateSpec=[];for(const e of n)this.stateSpec.push(new C9({shape:e.shape}));o=o.concat(this.stateSpec)}null!=i&&(t.constants=i,s=s.concat(i),this.numConstants=i.length);if(s[0]instanceof O9){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,v3.tidy)(()=>{const n=null==t?null:t.mask,i=null==t?null:t.training;let r=null==t?null:t.initialState;e=T9(e),null==r&&(r=this.stateful?this.states_:this.getInitialState(e));const s=Array.isArray(this.cell.stateSize)?this.cell.stateSize.length:1;if(r.length!==s)throw new U6(`RNN Layer has ${s} state(s) but was passed ${r.length} initial state(s).`);this.unroll&&console.warn("Ignoring unroll = true for RNN layer, due to imperative backend.");const o={training:i},a=Ute((e,t)=>{const n=this.cell.call([e].concat(t),o);return[n[0],n.slice(1)]},e,r,this.goBackwards,n,null,this.unroll,this.returnSequences),l=a[0],u=a[1],c=a[2];this.stateful&&this.resetStates(c,i);const d=this.returnSequences?u:l;return this.returnState?[d].concat(c):d})}getInitialState(e){return(0,v3.tidy)(()=>{let t=v3.zeros(e.shape);return t=v3.sum(t,[1,2]),t=L8(t),Array.isArray(this.cell.stateSize)?this.cell.stateSize.map(e=>e>1?z8(t,[1,e]):t):this.cell.stateSize>1?[z8(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()===Vte.className&&(t.cell={className:this.cell.getClassName(),config:n}),Object.assign(Object.assign(Object.assign({},n),e),t)}static fromConfig(e,t,n={}){const i=M7(t.cell,n);return new e(Object.assign(t,{cell:i}))}}Vte.className="RNN",v3.serialization.registerClass(Vte);class zte extends N9{}class jte extends zte{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,o8(this.units,"units"),this.activation=ste(null==e.activation?this.DEFAULT_ACTIVATION:e.activation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=y9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=y9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=y9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=hte(e.kernelRegularizer),this.recurrentRegularizer=hte(e.recurrentRegularizer),this.biasRegularizer=hte(e.biasRegularizer),this.kernelConstraint=J9(e.kernelConstraint),this.recurrentConstraint=J9(e.recurrentConstraint),this.biasConstraint=J9(e.biasConstraint),this.dropout=M8([1,k8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=M8([1,k8([0,null==e.recurrentDropout?0:e.recurrentDropout])]),this.dropoutFunc=e.dropoutFunc,this.stateSize=this.units,this.dropoutMask=null,this.recurrentDropoutMask=null}build(e){e=x9(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(0,v3.tidy)(()=>{if(2!==e.length)throw new U6(`SimpleRNNCell expects 2 input Tensors, got ${e.length}.`);let n=e[1];e=e[0];const i=null!=t.training&&t.training;let r;0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Kte({ones:()=>v3.onesLike(e),rate:this.dropout,training:i,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Kte({ones:()=>v3.onesLike(n),rate:this.recurrentDropout,training:i,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;r=Y8(null!=s?v3.mul(e,s):e,this.kernel.read()),null!=this.bias&&(r=X8(r,this.bias.read())),null!=o&&(n=v3.mul(n,o));let a=v3.add(r,Y8(n,this.recurrentKernel.read()));return null!=this.activation&&(a=this.activation.apply(a)),[a,a]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ite(this.activation),useBias:this.useBias,kernelInitializer:_9(this.kernelInitializer),recurrentInitializer:_9(this.recurrentInitializer),biasInitializer:_9(this.biasInitializer),kernelRegularizer:cte(this.kernelRegularizer),recurrentRegularizer:cte(this.recurrentRegularizer),biasRegularizer:cte(this.biasRegularizer),activityRegularizer:cte(this.activityRegularizer),kernelConstraint:Z9(this.kernelConstraint),recurrentConstraint:Z9(this.recurrentConstraint),biasConstraint:Z9(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout};return Object.assign(Object.assign({},e),t)}}jte.className="SimpleRNNCell",v3.serialization.registerClass(jte);class Yte extends Vte{constructor(e){e.cell=new jte(e),super(e)}call(e,t){return(0,v3.tidy)(()=>{null!=this.cell.dropoutMask&&(v3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(v3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return new e(t)}}Yte.className="SimpleRNN",v3.serialization.registerClass(Yte);class Gte extends zte{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 U6("GRUCell does not support reset_after parameter set to true.");this.units=e.units,o8(this.units,"units"),this.activation=ste(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ste(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=y9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=y9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=y9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelRegularizer=hte(e.kernelRegularizer),this.recurrentRegularizer=hte(e.recurrentRegularizer),this.biasRegularizer=hte(e.biasRegularizer),this.kernelConstraint=J9(e.kernelConstraint),this.recurrentConstraint=J9(e.recurrentConstraint),this.biasConstraint=J9(e.biasConstraint),this.dropout=M8([1,k8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=M8([1,k8([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=x9(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(0,v3.tidy)(()=>{if(2!==e.length)throw new U6(`GRUCell expects 2 input Tensors (inputs, h, c), got ${e.length}.`);const n=null!=t.training&&t.training;let i=e[1];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Kte({ones:()=>v3.onesLike(e),rate:this.dropout,training:n,count:3,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Kte({ones:()=>v3.onesLike(i),rate:this.recurrentDropout,training:n,count:3,dropoutFunc:this.dropoutFunc}));const r=this.dropoutMask,s=this.recurrentDropoutMask;let o,a,l;0<this.dropout&&this.dropout<1&&(e=v3.mul(e,r[0]));let u=Y8(e,this.kernel.read());this.useBias&&(u=X8(u,this.bias.read())),0<this.recurrentDropout&&this.recurrentDropout<1&&(i=v3.mul(i,s[0]));const c=this.recurrentKernel.read(),[d,h]=v3.split(c,[2*this.units,this.units],c.rank-1),p=Y8(i,d),[f,m,g]=v3.split(u,3,u.rank-1),[_,y]=v3.split(p,2,p.rank-1);o=this.recurrentActivation.apply(v3.add(f,_)),a=this.recurrentActivation.apply(v3.add(m,y));const v=Y8(v3.mul(a,i),h);l=this.activation.apply(v3.add(g,v));const b=v3.add(v3.mul(o,i),v3.mul(v3.add(1,v3.neg(o)),l));return[b,b]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ite(this.activation),recurrentActivation:ite(this.recurrentActivation),useBias:this.useBias,kernelInitializer:_9(this.kernelInitializer),recurrentInitializer:_9(this.recurrentInitializer),biasInitializer:_9(this.biasInitializer),kernelRegularizer:cte(this.kernelRegularizer),recurrentRegularizer:cte(this.recurrentRegularizer),biasRegularizer:cte(this.biasRegularizer),activityRegularizer:cte(this.activityRegularizer),kernelConstraint:Z9(this.kernelConstraint),recurrentConstraint:Z9(this.recurrentConstraint),biasConstraint:Z9(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation,resetAfter:!1};return Object.assign(Object.assign({},e),t)}}Gte.className="GRUCell",v3.serialization.registerClass(Gte);class Hte extends Vte{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new Gte(e),super(e)}call(e,t){return(0,v3.tidy)(()=>{null!=this.cell.dropoutMask&&(v3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(v3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Hte.className="GRU",v3.serialization.registerClass(Hte);class Wte extends zte{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,o8(this.units,"units"),this.activation=ste(void 0===e.activation?this.DEFAULT_ACTIVATION:e.activation),this.recurrentActivation=ste(void 0===e.recurrentActivation?this.DEFAULT_RECURRENT_ACTIVATION:e.recurrentActivation),this.useBias=null==e.useBias||e.useBias,this.kernelInitializer=y9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.recurrentInitializer=y9(e.recurrentInitializer||this.DEFAULT_RECURRENT_INITIALIZER),this.biasInitializer=y9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.unitForgetBias=e.unitForgetBias,this.kernelRegularizer=hte(e.kernelRegularizer),this.recurrentRegularizer=hte(e.recurrentRegularizer),this.biasRegularizer=hte(e.biasRegularizer),this.kernelConstraint=J9(e.kernelConstraint),this.recurrentConstraint=J9(e.recurrentConstraint),this.biasConstraint=J9(e.biasConstraint),this.dropout=M8([1,k8([0,null==e.dropout?0:e.dropout])]),this.recurrentDropout=M8([1,k8([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=x9(e))[e.length-1];let i;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;i=new((t=class extends J8{apply(t,i){const r=e.apply([n]),s=(new t9).apply([n]),o=e.apply([2*n]);return V8(V8(r,s),o)}}).className="CustomInit",t)}else i=this.biasInitializer;this.bias=this.addWeight("bias",[4*this.units],null,i,this.biasRegularizer,!0,this.biasConstraint)}else this.bias=null;this.built=!0}call(e,t){return(0,v3.tidy)(()=>{const n=null!=t.training&&t.training;if(3!==e.length)throw new U6(`LSTMCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);let i=e[1];const r=e[2];e=e[0],0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Kte({ones:()=>v3.onesLike(e),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc})),0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Kte({ones:()=>v3.onesLike(i),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const s=this.dropoutMask,o=this.recurrentDropoutMask;let a,l,u,c;0<this.dropout&&this.dropout<1&&(e=v3.mul(e,s[0]));let d=Y8(e,this.kernel.read());0<this.recurrentDropout&&this.recurrentDropout<1&&(i=v3.mul(i,o[0])),d=v3.add(d,Y8(i,this.recurrentKernel.read())),this.useBias&&(d=X8(d,this.bias.read()));const[h,p,f,m]=v3.split(d,4,d.rank-1);a=this.recurrentActivation.apply(h),l=this.recurrentActivation.apply(p),u=v3.add(v3.mul(l,r),v3.mul(a,this.activation.apply(f))),c=this.recurrentActivation.apply(m);const g=v3.mul(c,this.activation.apply(u));return[g,g,u]})}getConfig(){const e=super.getConfig(),t={units:this.units,activation:ite(this.activation),recurrentActivation:ite(this.recurrentActivation),useBias:this.useBias,kernelInitializer:_9(this.kernelInitializer),recurrentInitializer:_9(this.recurrentInitializer),biasInitializer:_9(this.biasInitializer),unitForgetBias:this.unitForgetBias,kernelRegularizer:cte(this.kernelRegularizer),recurrentRegularizer:cte(this.recurrentRegularizer),biasRegularizer:cte(this.biasRegularizer),activityRegularizer:cte(this.activityRegularizer),kernelConstraint:Z9(this.kernelConstraint),recurrentConstraint:Z9(this.recurrentConstraint),biasConstraint:Z9(this.biasConstraint),dropout:this.dropout,recurrentDropout:this.recurrentDropout,implementation:this.implementation};return Object.assign(Object.assign({},e),t)}}Wte.className="LSTMCell",v3.serialization.registerClass(Wte);class Xte extends Vte{constructor(e){0===e.implementation&&console.warn("`implementation=0` has been deprecated, and now defaults to `implementation=1`. Please update your layer call."),e.cell=new Wte(e),super(e)}call(e,t){return(0,v3.tidy)(()=>{null!=this.cell.dropoutMask&&(v3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(v3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null);const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,initialState:r})})}static fromConfig(e,t){return 0===t.implmentation&&(t.implementation=1),new e(t)}}Xte.className="LSTM",v3.serialization.registerClass(Xte);class qte extends zte{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(0,v3.tidy)(()=>{let n=e.slice(1);const i=[];for(const e of this.cells.slice().reverse())Array.isArray(e.stateSize)?i.push(n.splice(0,e.stateSize.length)):i.push(n.splice(0,1));i.reverse();const r=[];let s;for(let o=0;o<this.cells.length;++o){const a=this.cells[o];n=i[o],s=0===o?[e[0]].concat(n):[s[0]].concat(n),s=a.call(s,t),r.push(s.slice(1))}n=[];for(const e of r.slice().reverse())n.push(...e);return[s[0]].concat(n)})}build(e){let t;v9(e)&&(e=e[0]),this.cells.forEach((n,i)=>{E8(`RNNCell_${i}`,()=>{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 i=[];for(const e of t.cells)i.push(M7(e,n));return new e({cells:i})}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 A9(e)}setWeights(e){const t=[];for(const n of this.cells){const i=n.weights.length,r=e.splice(i);for(let e=0;e<n.weights.length;++e)t.push([n.weights[e],r[e]])}S9(t)}}function Kte(e){const{ones:t,rate:n,training:i=!1,count:r=1,dropoutFunc:s}=e,o=()=>null!=s?s(t(),n):q8(t(),n),a=()=>K8(o,t,i);if(!r||r<=1)return v3.keep(a().clone());return Array(r).fill(void 0).map(a).map(e=>v3.keep(e.clone()))}qte.className="StackedRNNCells",v3.serialization.registerClass(qte);
/**
* @license
* Copyright 2020 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
var Zte=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};class Qte extends Vte{constructor(e){if(e.unroll)throw new V6("Unrolling is not possible with convolutional RNNs.");if(Array.isArray(e.cell))throw new V6("It is not possible at the moment to stack convolutional cells.");super(e),this.inputSpec=[new C9({ndim:5})]}call(e,t){return v3.tidy(()=>{if(null!=this.cell.dropoutMask&&(v3.dispose(this.cell.dropoutMask),this.cell.dropoutMask=null),null!=this.cell.recurrentDropoutMask&&(v3.dispose(this.cell.recurrentDropoutMask),this.cell.recurrentDropoutMask=null),t&&t.constants)throw new U6("ConvRNN2D cell does not support constants");const n=null==t?null:t.mask,i=null==t?null:t.training,r=null==t?null:t.initialState;return super.call(e,{mask:n,training:i,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 v3.tidy(()=>{const{stateSize:t}=this.cell,n=e.shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)],s=v3.zeros(r);return Array.isArray(t)?Array(t.length).fill(s):[s]})}resetStates(e,t=!1){v3.tidy(()=>{if(!this.stateful)throw new B6("Cannot call resetStates() on an RNN Layer that is not stateful.");const n=this.inputSpec[0].shape,i=this.computeSingleOutputShape(n),r=[i[0],...i.slice(2)];if(null==n[0])throw new U6("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(()=>v3.zeros(r)):this.states_=[v3.zeros(r)];else if(null==e)v3.dispose(this.states_),null!=this.keptStates&&(v3.dispose(this.keptStates),this.keptStates=[]),Array.isArray(this.cell.stateSize)?this.states_=this.cell.stateSize.map(()=>v3.zeros(r)):this.states_[0]=v3.zeros(r);else{if(Array.isArray(e)||(e=[e]),e.length!==this.states_.length)throw new U6(`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()):v3.dispose(this.states_);for(let t=0;t<this.states_.length;++t){const n=e[t],i=r;if(!v3.util.arraysEqual(n.shape,i))throw new U6(`State ${t} is incompatible with layer ${this.name}: expected shape=${i}, received shape=${n.shape}`);this.states_[t]=n}}this.states_=this.states_.map(e=>v3.keep(e.clone()))})}computeSingleOutputShape(e){const{dataFormat:t,filters:n,kernelSize:i,padding:r,strides:s,dilationRate:o}=this.cell,a="channelsFirst"===t,l=e[a?3:2],u=e[a?4:3],c=bte(l,i[0],r,s[0],o[0]),d=bte(u,i[1],r,s[1],o[1]);return[...e.slice(0,2),...a?[n,c,d]:[c,d,n]]}}Qte.className="ConvRNN2D";class Jte extends Wte{constructor(e){const{filters:t,kernelSize:n,strides:i,padding:r,dataFormat:s,dilationRate:o}=e;super(Object.assign(Object.assign({},e),{units:t})),this.filters=t,o8(this.filters,"filters"),this.kernelSize=vte(n,2,"kernelSize"),this.kernelSize.forEach(e=>o8(e,"kernelSize")),this.strides=vte(i||1,2,"strides"),this.strides.forEach(e=>o8(e,"strides")),this.padding=r||"valid",b8(this.padding),this.dataFormat=s||"channelsLast",v8(this.dataFormat),this.dilationRate=vte(o||1,2,"dilationRate"),this.dilationRate.forEach(e=>o8(e,"dilationRate"))}build(e){var t;e=x9(e);const n="channelsFirst"===this.dataFormat?1:e.length-1;if(null==e[n])throw new U6(`The channel dimension of the input should be defined. Found ${e[n]}`);const i=e[n],r=this.kernelSize.concat([i,4*this.filters]);this.kernel=this.addWeight("kernel",r,null,this.kernelInitializer,this.kernelRegularizer,!0,this.kernelConstraint);const s=this.kernelSize.concat([this.filters,4*this.filters]);if(this.recurrentKernel=this.addWeight("recurrent_kernel",s,null,this.recurrentInitializer,this.recurrentRegularizer,!0,this.recurrentConstraint),this.useBias){let e;if(this.unitForgetBias){const n=this.biasInitializer,i=this.filters;e=new((t=class extends J8{apply(e,t){return U8([n.apply([i]),v3.ones([i]),n.apply([2*i])])}}).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 v3.tidy(()=>{if(3!==e.length)throw new U6(`ConvLSTM2DCell expects 3 input Tensors (inputs, h, c), got ${e.length}.`);const n=t.training||!1,i=e[0],r=e[1],s=e[2];0<this.dropout&&this.dropout<1&&null==this.dropoutMask&&(this.dropoutMask=Kte({ones:()=>v3.onesLike(i),rate:this.dropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const o=this.dropoutMask,a=(e,t,n)=>t&&t[n]?v3.mul(t[n],e):e;let l=a(i,o,0),u=a(i,o,1),c=a(i,o,2),d=a(i,o,3);0<this.recurrentDropout&&this.recurrentDropout<1&&null==this.recurrentDropoutMask&&(this.recurrentDropoutMask=Kte({ones:()=>v3.onesLike(r),rate:this.recurrentDropout,training:n,count:4,dropoutFunc:this.dropoutFunc}));const h=this.recurrentDropoutMask;let p=a(r,h,0),f=a(r,h,1),m=a(r,h,2),g=a(r,h,3);const[_,y,v,b]=v3.split(this.kernel.read(),4,3),[T,x,E,w]=this.useBias?v3.split(this.bias.read(),4):[null,null,null,null];l=this.inputConv(l,_,T,this.padding),u=this.inputConv(u,y,x,this.padding),c=this.inputConv(c,v,E,this.padding),d=this.inputConv(d,b,w,this.padding);const[I,A,S,C]=v3.split(this.recurrentKernel.read(),4,3);p=this.recurrentConv(p,I),f=this.recurrentConv(f,A),m=this.recurrentConv(m,S),g=this.recurrentConv(g,C);const O=this.recurrentActivation.apply(v3.add(l,p)),M=this.recurrentActivation.apply(v3.add(u,f)),k=v3.add(v3.mul(M,s),v3.mul(O,this.activation.apply(v3.add(c,m)))),R=v3.mul(this.recurrentActivation.apply(v3.add(d,g)),this.activation.apply(k));return[R,R,k]})}getConfig(){const e=super.getConfig(),{units:t}=e,n=Zte(e,["units"]),i={filters:this.filters,kernelSize:this.kernelSize,padding:this.padding,dataFormat:this.dataFormat,dilationRate:this.dilationRate,strides:this.strides};return Object.assign(Object.assign({},n),i)}inputConv(e,t,n,i){const r=v3.conv2d(e,t,this.strides,i||"valid","channelsFirst"===this.dataFormat?"NCHW":"NHWC",this.dilationRate);return n?X8(r,n,this.dataFormat):r}recurrentConv(e,t){return v3.conv2d(e,t,1,"same","channelsFirst"===this.dataFormat?"NCHW":"NHWC")}}Jte.className="ConvLSTM2DCell",v3.serialization.registerClass(Jte);class ene extends Qte{constructor(e){const t=new Jte(e);super(Object.assign(Object.assign({},e),{cell:t}))}static fromConfig(e,t){return new e(t)}}ene.className="ConvLSTM2D",v3.serialization.registerClass(ene);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class tne extends N9{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.noiseShape.length;++e)n.push(null==this.noiseShape[e]?t[e]:this.noiseShape[e]);return n}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e);if(0<this.rate&&this.rate<1){const e=null!=t.training&&t.training,i=this.getNoiseShape(n);return K8(()=>q8(n,this.rate,i,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()}}tne.className="Dropout",v3.serialization.registerClass(tne);class nne extends tne{constructor(e){super(e),this.inputSpec=[{ndim:3}]}getNoiseShape(e){const t=e.shape;return[t[0],1,t[2]]}}nne.className="SpatialDropout1D",v3.serialization.registerClass(nne);class ine extends N9{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,o8(this.units,"units"),this.activation=ste(e.activation),null!=e.useBias&&(this.useBias=e.useBias),this.kernelInitializer=y9(e.kernelInitializer||this.DEFAULT_KERNEL_INITIALIZER),this.biasInitializer=y9(e.biasInitializer||this.DEFAULT_BIAS_INITIALIZER),this.kernelConstraint=J9(e.kernelConstraint),this.biasConstraint=J9(e.biasConstraint),this.kernelRegularizer=hte(e.kernelRegularizer),this.biasRegularizer=hte(e.biasRegularizer),this.activityRegularizer=hte(e.activityRegularizer),this.supportsMasking=!0,this.inputSpec=[{minNDim:2}]}build(e){const t=(e=x9(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=x9(e)).slice();return t[t.length-1]=this.units,t}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e),i=l8(this.activation.getClassName());let r;return null!=i?r=Y8(n,this.kernel.read(),i,this.bias?this.bias.read():null):(r=Y8(n,this.kernel.read()),null!=this.bias&&(r=X8(r,this.bias.read())),null!=this.activation&&(r=this.activation.apply(r))),r})}getConfig(){const e={units:this.units,activation:ite(this.activation),useBias:this.useBias,kernelInitializer:_9(this.kernelInitializer),biasInitializer:_9(this.biasInitializer),kernelRegularizer:cte(this.kernelRegularizer),biasRegularizer:cte(this.biasRegularizer),activityRegularizer:cte(this.activityRegularizer),kernelConstraint:Z9(this.kernelConstraint),biasConstraint:Z9(this.biasConstraint)},t=super.getConfig();return Object.assign(e,t),e}}ine.className="Dense",v3.serialization.registerClass(ine);class rne extends N9{constructor(e){super(e=e||{}),this.inputSpec=[{minNDim:3}],this.dataFormat=e.dataFormat}computeOutputShape(e){e=x9(e);for(const t of e.slice(1))if(null==t)throw new U6(`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],O8(e,1)]}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);let n=T9(e);if("channelsFirst"===this.dataFormat&&n.rank>1){const e=[0];for(let t=2;t<n.rank;++t)e.push(t);e.push(1),n=(0,v3.transpose)(n,e)}return function(e){if(e.rank<=1)throw new U6(`batchFlatten requires a minimum rank of 2. Got rank: ${e.rank}.`);const t=[e.shape[0],O8(e.shape,1)];return v3.reshape(e,t)}(n)})}getConfig(){const e={};null!=this.dataFormat&&(e.dataFormat=this.dataFormat);const t=super.getConfig();return Object.assign(e,t),e}}rne.className="Flatten",v3.serialization.registerClass(rne);class sne extends N9{constructor(e){super(e),this.supportsMasking=!0,this.activation=ste(e.activation)}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e);return this.activation.apply(n)})}getConfig(){const e={activation:ite(this.activation)},t=super.getConfig();return Object.assign(e,t),e}}sne.className="Activation",v3.serialization.registerClass(sne);class one extends N9{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(0,v3.tidy)(()=>{return e=T9(e),t=e,n=this.n,(0,v3.tidy)(()=>{if(2!==t.shape.length)throw new U6(`repeat() expects a rank-2 tensor, but received a rank-${t.shape.length} tensor.`);return z8(L8(t,1),[1,n,1])});var t,n})}getConfig(){const e={n:this.n},t=super.getConfig();return Object.assign(e,t),e}}one.className="RepeatVector",v3.serialization.registerClass(one);class ane extends N9{constructor(e){super(e),this.targetShape=e.targetShape;for(let e=0;e<this.targetShape.length;++e)this.isUnknown(this.targetShape[e])&&(this.targetShape[e]=null)}isUnknown(e){return e<0||null==e}fixUnknownDimension(e,t){const n="Total size of new array must be unchanged.",i=t.slice();let r=1,s=null;for(let e=0;e<i.length;++e){const t=i[e];if(this.isUnknown(t)){if(null!==s)throw new U6("Can only specifiy one unknown dimension.");s=e}else r*=t}const o=O8(e);if(null!==s){if(0===r||o%r!==0)throw new U6(n);i[s]=o/r}else if(o!==r)throw new U6(n);return i}computeOutputShape(e){let t=!1;for(let n=0;n<e.length;++n)if(this.isUnknown(e[n])){t=!0;break}return t?e.slice(0,1).concat(this.targetShape):e.slice(0,1).concat(this.fixUnknownDimension(e.slice(1),this.targetShape))}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e),i=n.shape,r=i.slice(0,1).concat(this.fixUnknownDimension(i.slice(1),this.targetShape));return(0,v3.reshape)(n,r)})}getConfig(){const e={targetShape:this.targetShape},t=super.getConfig();return Object.assign(e,t),e}}ane.className="Reshape",v3.serialization.registerClass(ane);class lne extends N9{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=R8(1,e.dims.length+1);if(!v3.util.arraysEqual(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 C9({ndim:this.dims.length+1})]}computeOutputShape(e){const t=(e=x9(e)).slice();return this.dims.forEach((n,i)=>{t[i+1]=e[n]}),t}call(e,t){return(0,v3.transpose)(T9(e),this.dimsIncludingBatch)}getConfig(){const e={dims:this.dims},t=super.getConfig();return Object.assign(e,t),e}}lne.className="Permute",v3.serialization.registerClass(lne);class une extends N9{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=T9(e);return(0,v3.any)((0,v3.notEqual)(n,this.maskValue),-1)}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e),i=(0,v3.any)((0,v3.notEqual)(n,this.maskValue),-1,!0);return(0,v3.mul)(n,(0,v3.cast)(i,n.dtype))})}}une.className="Masking",v3.serialization.registerClass(une);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class cne extends N9{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(X6(e.inputLength))}this.inputDim=e.inputDim,o8(this.inputDim,"inputDim"),this.outputDim=e.outputDim,o8(this.outputDim,"outputDim"),this.embeddingsInitializer=y9(e.embeddingsInitializer||this.DEFAULT_EMBEDDINGS_INITIALIZER),this.embeddingsRegularizer=hte(e.embeddingsRegularizer),this.activityRegularizer=hte(e.activityRegularizer),this.embeddingsConstraint=J9(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(0,v3.tidy)(()=>this.maskZero?(e=T9(e),(0,v3.notEqual)(e,(0,v3.zerosLike)(e))):null)}computeOutputShape(e){if(e=x9(e),null==this.inputLength)return[...e,this.outputDim];const t=X6(this.inputLength);if(t.length!==e.length-1)throw new U6(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);{let n=0;for(let i=0;i<t.length;++i){const r=t[i],s=e[i+1];if(null!=r&&null!=s&&r!==s)throw new U6(`"inputLength" is ${this.inputLength}, but received input shape has shape ${e}`);null==r&&(t[n]=s),n++}}return[e[0],...t,this.outputDim]}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t);let n=T9(e);"int32"!==n.dtype&&(n=F8(n,"int32"));const i=G8(this.embeddings.read(),(0,v3.reshape)(n,[n.size]));return(0,v3.reshape)(i,x9(this.computeOutputShape(n.shape)))})}getConfig(){const e={inputDim:this.inputDim,outputDim:this.outputDim,embeddingsInitializer:_9(this.embeddingsInitializer),embeddingsRegularizer:cte(this.embeddingsRegularizer),activityRegularizer:cte(this.activityRegularizer),embeddingsConstraint:Z9(this.embeddingsConstraint),maskZero:this.maskZero,inputLength:this.inputLength},t=super.getConfig();return Object.assign(e,t),e}}cne.className="Embedding",v3.serialization.registerClass(cne);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class dne extends N9{constructor(e){super(e||{}),this.supportsMasking=!0}mergeFunction(e){throw new V6}computeElementwiseOpOutputShape(e,t){if(null==e||null==t)return null;if(e.length<t.length)return this.computeElementwiseOpOutputShape(t,e);if(0===t.length)return e;const n=e.slice(0,e.length-t.length);for(let i=0;i<t.length;++i){const r=e[e.length-t.length+i],s=t[i];if(null==r||null==s||r<0||s<0)n.push(null);else if(1===r)n.push(s);else if(1===s)n.push(r);else{if(r!==s)throw new U6("Operands could not be broadcast together with shapes "+JSON.stringify(e)+" "+JSON.stringify(t));n.push(r)}}return n}build(e){if(Array.isArray(e)&&!Array.isArray(e[0])&&(e=[x9(e)]),e.length<2)throw new U6(`A merge layer should be called on an Array of at least 2 inputs. Got ${e.length} input(s).`);let t=[];for(const n of e)null!=n&&null!==n[0]&&t.push(n[0]);if(t=n8(t),t.length>1)throw new U6(`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;t<e.length;++t){const i=null==e[t]?null:e[t].slice(1);n=this.computeElementwiseOpOutputShape(n,i)}const i=e.map(e=>e.length);-1===e.indexOf(null)&&1===n8(i).length?this.reshapeRequired=!1:this.reshapeRequired=!0}call(e,t){return(0,v3.tidy)(()=>{if(this.reshapeRequired){const t=[],n=e.map(e=>e.rank);if(-1===n.indexOf(null)){const i=k8(n);for(let n of e){const e=n.rank;for(let t=0;t<i-e;++t)n=L8(n,1);t.push(n)}return this.mergeFunction(t)}{let n=!1;for(const i of e){const e=i.rank;if(null==e){const e=i.shape,r=e[0],s=e.slice(1).concat([r]);let o=v3.reshape(i,[r].concat(O8(e.slice(1))));o=v3.transpose(o,[1,0]),o=v3.reshape(o,s),t.push(o),n=!0}else if(e>1){const r=R8(1,e).concat([0]);t.push(v3.transpose(i,r)),n=!0}else t.push(i)}let i=this.mergeFunction(t);const r=i.rank;if(n)if(null==r){const e=i.shape,t=e[e.length-1],n=[t].concat(e.slice(0,e.length-1));i=v3.reshape(v3.transpose(v3.reshape(i,[-1,t]),[1,0]),n)}else if(r>1){const e=[r-1].concat(R8(0,r-1));i=v3.transpose(i,e)}return i}}return this.mergeFunction(e)})}computeOutputShape(e){let t;t=null==e[0]?null:e[0].slice(1);for(let n=1;n<e.length;++n){const i=null==e[n]?null:e[n].slice(1);t=this.computeElementwiseOpOutputShape(t,i)}let n=[];for(const t of e)null!=t&&null!==t[0]&&n.push(t[0]);return n=n8(n),t=1===n.length?n.concat(t):[null].concat(t),t}computeMask(e,t){return v3.tidy(()=>{if(null==t)return null;if(!Array.isArray(t))throw new U6("`mask` should be an Array");if(!Array.isArray(e))throw new U6("`inputs` should be an Array");if(t.length!==e.length)throw new U6(`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:v3.expandDims(e,0)))[0];for(let e=1;e<t.length-1;++e)n=v3.logicalAnd(n,t[e]);return n})}}class hne extends dne{constructor(e){super(e)}mergeFunction(e){return(0,v3.tidy)(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=v3.add(t,e[n]);return t})}}hne.className="Add",v3.serialization.registerClass(hne);class pne extends dne{constructor(e){super(e)}mergeFunction(e){return(0,v3.tidy)(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=v3.mul(t,e[n]);return t})}}pne.className="Multiply",v3.serialization.registerClass(pne);class fne extends dne{constructor(e){super(e)}mergeFunction(e){return(0,v3.tidy)(()=>{let t=e[0].clone();for(let n=1;n<e.length;++n)t=v3.add(t,e[n]);return v3.mul(1/e.length,t)})}}fne.className="Average",v3.serialization.registerClass(fne);class mne extends dne{constructor(e){super(e)}mergeFunction(e){return(0,v3.tidy)(()=>{let t=e[0];for(let n=1;n<e.length;++n)t=v3.maximum(t,e[n]);return t})}}mne.className="Maximum",v3.serialization.registerClass(mne);class gne extends dne{constructor(e){super(e)}mergeFunction(e){return(0,v3.tidy)(()=>{let t=e[0];for(let n=1;n<e.length;++n)t=v3.minimum(t,e[n]);return t})}}gne.className="Minimum",v3.serialization.registerClass(gne);class _ne extends dne{constructor(e){super(e),this.DEFAULT_AXIS=-1,null==e&&(e={}),this.axis=null==e.axis?this.DEFAULT_AXIS:e.axis,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){if(!Array.isArray(e)||!Array.isArray(e[0])||1===e.length)throw new U6("A `Concatenate` layer should be called on a list of at least 2 inputs");let t=!0;for(const n of e)if(null!=n){t=!1;break}if(t)return;const n=[];for(let t=0;t<e.length;++t){const i=e[t].slice();i.splice(this.axis,1);let r=!1;for(const e of n)if(v3.util.arraysEqual(e,i)){r=!0;break}r||n.push(i)}if(n.length>1)throw new U6("A `Concatenate` layer requires inputs with matching shapes except for the concat axis. Got input shapes: "+JSON.stringify(e))}mergeFunction(e){return(0,v3.tidy)(()=>U8(e,this.axis))}computeOutputShape(e){if(!Array.isArray(e)||!Array.isArray(e[0]))throw new U6("A `Concatenate` layer should be called on a list of inputs.");const t=e,n=t[0].slice(),i=this.axis<0?n.length+this.axis:this.axis;for(const e of t.slice(1)){if(null==n[i]||null==e[i]){n[i]=null;break}n[i]+=e[i]}return n}computeMask(e,t){if(null==t)return null;if(!Array.isArray(t))throw new U6("`mask` should be an array for Concatenate");if(!Array.isArray(e))throw new U6("`inputs` should be an array for Concatenate");if(t.length!==e.length)throw new U6(`Mismatch in the length of mask (${t.length}) and the legnth of inputs (${e.length})`);return v3.tidy(()=>{let n=!0;if(t.forEach(e=>{null==e||(n=!1)}),n)return null;const i=[];for(let n=0;n<e.length;++n)null==t[n]?i.push(v3.cast(v3.onesLike(e[n]),"bool")):t[n].rank<e[n].rank?i.push(v3.expandDims(t[n],-1)):i.push(t[n]);const r=v3.concat(i,this.axis);return v3.all(r,-1,!1)})}getConfig(){const e={axis:this.axis},t=super.getConfig();return Object.assign(e,t),e}}function yne(e,t){for(;e<0;)e+=t;return e}_ne.className="Concatenate",v3.serialization.registerClass(_ne);class vne extends dne{constructor(e){super(e),this.axes=e.axes,this.normalize=null!=e.normalize&&e.normalize,this.supportsMasking=!0,this.reshapeRequired=!1}build(e){v3.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"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 V6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);if(t[i[0]]!==n[i[1]])throw new U6(`Dimension incompatibility: ${t[i[0]]} !== ${n[i[1]]}`)}mergeFunction(e){if(2!==e.length)throw new U6(`A \`Dot\` layer must be called on exactly 2 inputs, but received ${e.length} input(s).`);let t,n=e[0],i=e[1];return t=Array.isArray(this.axes)?this.axes.map((t,n)=>yne(t,e[n].shape.length)):[yne(this.axes,n.shape.length),yne(this.axes,i.shape.length)],this.normalize&&(n=k7(n,t[0]),i=k7(i,t[1])),function(e,t,n){if(e.shape.length>3||t.shape.length>3)throw new V6("batchDot is not implemented for tensors of 4D or higher rank yet");if(v3.util.assert(e.shape.length>=2,()=>`batchDot requires the rank of x to be >= 2, but got ${e.shape.length}`),v3.util.assert(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 V6("batchDot is not implemented for complex64-type Tensors yet.");const i=e.shape.length,r=t.shape.length;null==n&&(n=[i-1,r-2]);const s=n;return v3.tidy(()=>{let n,o;if(i>r){n=i-r;const e=[];for(let t=0;t<n;++t)e.push(1);t=v3.reshape(t,t.shape.concat(e))}else if(r>i){n=r-i;const t=[];for(let e=0;e<n;++e)t.push(1);e=v3.reshape(e,e.shape.concat(t))}else n=0;if(2===e.shape.length&&2===t.shape.length)o=s[0]===s[1]?v3.sum(v3.mul(e,t),s[0]):v3.sum(v3.mul(v3.transpose(e,[1,0]),t),s[1]);else{const n=s[0]!==e.shape.length-1,i=s[1]===t.shape.length-1;o=v3.matMul(e,t,n,i)}if(n>0){let e;e=i>r?i+r-3:i-1;const t=[];for(let i=e;i<e+n;++i)t.push(i);o=v3.squeeze(o,t)}return 1===o.shape.length&&(o=v3.expandDims(o,1)),o})}(n,i,t)}interpretAxes(e,t){let n;return n=Array.isArray(this.axes)?this.axes:[yne(this.axes,e.length),yne(this.axes,t.length)],n}computeOutputShape(e){v3.util.assert(Array.isArray(e)&&2===e.length&&Array.isArray(e[0])&&Array.isArray(e[1]),()=>"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 V6("Dot layer does not support tensors of 4D or higher rank yet.");const i=this.interpretAxes(t,n);t.splice(i[0],1),n.splice(i[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}}vne.className="Dot",v3.serialization.registerClass(vne);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class bne extends N9{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(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e);return K8(()=>(0,v3.add)(j8(n.shape,0,this.stddev),n),()=>n,t.training||!1)})}}bne.className="GaussianNoise",v3.serialization.registerClass(bne);class Tne extends N9{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(0,v3.tidy)(()=>{this.invokeCallHook(e,t);const n=T9(e);if(this.rate>0&&this.rate<1){return K8(()=>{const e=Math.sqrt(this.rate/(1-this.rate));return(0,v3.mul)(n,j8(n.shape,1,e))},()=>n,t.training||!1)}return n})}}Tne.className="GaussianDropout",v3.serialization.registerClass(Tne);class xne extends N9{constructor(e){super(e),this.supportsMasking=!0,this.rate=e.rate,this.noiseShape=e.noiseShape}_getNoiseShape(e){return this.noiseShape||T9(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(0,v3.tidy)(()=>{if(this.rate<1&&this.rate>0){const n=this._getNoiseShape(e),i=()=>{const t=T9(e),i=-1.7580993408473766;let r=(0,v3.greaterEqual)((0,v3.randomUniform)(n),this.rate);r=F8(r,"float32");const s=((1-this.rate)*(1+this.rate*i**2))**-.5,o=-s*i*this.rate,a=(0,v3.add)((0,v3.mul)(t,r),(0,v3.mul)((0,v3.add)(r,-1),i));return(0,v3.add)((0,v3.mul)(a,s),o)};return K8(i,()=>T9(e),t.training||!1)}return e})}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Ene(e,t,n,i,r,s=.001){let o;if(2===e.rank)o=v3.batchNorm2d(e,t,n,i,r,s);else if(3===e.rank)o=v3.batchNorm3d(e,t,n,i,r,s);else{if(4!==e.rank)throw new V6(`batchNormalization is not implemented for array of rank ${e.rank} yet`);o=v3.batchNorm4d(e,t,n,i,r,s)}return o}function wne(e,t,n,i,r=.001){return v3.util.arraysEqual(i.slice().sort(),R8(0,e.rank-1))?function(e,t,n,i,r=.001){return(0,v3.tidy)(()=>{const s=v3.moments(e,i),o=s.mean,a=s.variance;return[Ene(e,o,a,n,t,r),o,a]})}(e,t,n,i,r):function(e,t,n,i,r=.001){return(0,v3.tidy)(()=>{const s=v3.moments(e,i),o=s.mean,a=s.variance,l=[];for(const t of R8(0,e.rank))-1!==i.indexOf(t)?l.push(1):l.push(e.shape[t]);const u=(0,v3.reshape)(o,l),c=(0,v3.reshape)(a,l),d=null==t?null:(0,v3.reshape)(t,l),h=null==n?null:(0,v3.reshape)(n,l);return[Ene(e,u,c,h,d,r),o,a]})}(e,t,n,i,r)}xne.className="AlphaDropout",v3.serialization.registerClass(xne);class Ine extends N9{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=y9(e.betaInitializer||"zeros"),this.gammaInitializer=y9(e.gammaInitializer||"ones"),this.movingMeanInitializer=y9(e.movingMeanInitializer||"zeros"),this.movingVarianceInitializer=y9(e.movingVarianceInitializer||"ones"),this.betaConstraint=J9(e.betaConstraint),this.gammaConstraint=J9(e.gammaConstraint),this.betaRegularizer=hte(e.betaRegularizer),this.gammaRegularizer=hte(e.gammaRegularizer)}build(e){e=x9(e);const t=this.axis>=0?this.axis:this.axis+e.length,n=e[t];if(null==n)throw new U6(`Axis ${t} of input tensor should have a defined dimension but the layer received an input with shape ${JSON.stringify(e)}.`);this.inputSpec=[new C9({ndim:e.length,axes:{[t]:n}})];const i=[n];this.scale&&(this.gamma=this.addWeight("gamma",i,null,this.gammaInitializer,this.gammaRegularizer,!0,this.gammaConstraint)),this.center&&(this.beta=this.addWeight("beta",i,null,this.betaInitializer,this.betaRegularizer,!0,this.betaConstraint)),this.movingMean=this.addWeight("moving_mean",i,null,this.movingMeanInitializer,null,!1),this.movingVariance=this.addWeight("moving_variance",i,null,this.movingVarianceInitializer,null,!1),this.built=!0}call(e,t){return(0,v3.tidy)(()=>{const n=null!=t.training&&t.training,i=T9(e),r=i.shape,s=r.length,o=R8(0,s),a=this.axis>=0?this.axis:this.axis+s;o.splice(a,1);const l=Y6(1,s);l[a]=r[a];const u=o.slice();u.sort();const c=!v3.util.arraysEqual(u,R8(0,s).slice(0,s-1));if(!n)return(()=>{if(c){const e=(0,v3.reshape)(this.movingMean.read(),l),t=(0,v3.reshape)(this.movingVariance.read(),l),n=this.center?(0,v3.reshape)(this.beta.read(),l):null,r=this.scale?(0,v3.reshape)(this.gamma.read(),l):null;return Ene(i,e,t,n,r,this.epsilon)}return Ene(i,this.movingMean.read(),this.movingVariance.read(),null==this.beta?null:this.beta.read(),null==this.gamma?null:this.gamma.read(),this.epsilon)})();const[d,h,p]=wne(i,this.gamma.read(),this.beta.read(),o,this.epsilon),f=(e,t,n)=>{v3.tidy(()=>{const i=1-n,r=e.read(),s=v3.mul(v3.sub(r,t),i);e.write(v3.sub(r,s))})};return(()=>{f(this.movingMean,h,this.momentum),f(this.movingVariance,p,this.momentum)})(),d})}getConfig(){const e={axis:this.axis,momentum:this.momentum,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:_9(this.betaInitializer),gammaInitializer:_9(this.gammaInitializer),movingMeanInitializer:_9(this.movingMeanInitializer),movingVarianceInitializer:_9(this.movingVarianceInitializer),betaRegularizer:cte(this.betaRegularizer),gammaRegularizer:cte(this.gammaRegularizer),betaConstraint:Z9(this.betaConstraint),gammaConstraint:Z9(this.gammaConstraint)},t=super.getConfig();return Object.assign(e,t),e}}Ine.className="BatchNormalization",v3.serialization.registerClass(Ine);class Ane extends N9{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=y9(e.betaInitializer||"zeros"),this.gammaInitializer=y9(e.gammaInitializer||"ones"),this.betaRegularizer=hte(e.betaRegularizer),this.gammaRegularizer=hte(e.gammaRegularizer),this.supportsMasking=!0}build(e){const t=(e=x9(e)).length;"number"==typeof this.axis&&(this.axis=[this.axis]);for(let e=0;e<this.axis.length;++e)this.axis[e]<0&&(this.axis[e]+=t);for(const e of this.axis)if(e<0||e>=t)throw new Error(`Invalid axis: ${e}`);if(this.axis.length!==n8(this.axis).length)throw new Error(`Found duplicate axes in: ${this.axis}`);const n=this.axis.map(t=>e[t]),i=!0;this.scale?this.gamma=this.addWeight("gamma",n,"float32",this.gammaInitializer,this.gammaRegularizer,i):this.gamma=null,this.center?this.beta=this.addWeight("beta",n,"float32",this.betaInitializer,this.betaRegularizer,i):this.beta=null,this.built=!0}call(e,t){const n=T9(e),i=n.shape,r=i.length;return(0,v3.tidy)(()=>{let{mean:e,variance:t}=(0,v3.moments)(n,this.axis,!0);const s=Y6(1,r);for(const e of this.axis)s[e]=i[e];const o=e=>null!=e&&e.shape.length!==r?v3.reshape(e,s):e;let a=this.scale?o(this.gamma.read()):null,l=this.center?o(this.beta.read()):null;const u=[],c=[];for(let e=0;e<r;++e)-1!==this.axis.indexOf(e)?(u.push(i[e]),c.push(1)):(u.push(1),c.push(i[e]));return e=v3.tile(e,u),t=v3.tile(t,u),null!=a&&(a=v3.tile(a,c)),null!=l&&(l=v3.tile(l,c)),Ene(n,e,t,l,a,this.epsilon)})}getConfig(){const e={axis:this.axis,epsilon:this.epsilon,center:this.center,scale:this.scale,betaInitializer:_9(this.betaInitializer),gammaInitializer:_9(this.gammaInitializer),betaRegularizer:cte(this.betaRegularizer),gammaRegularizer:cte(this.gammaRegularizer)},t=super.getConfig();return Object.assign(e,t),e}}Ane.className="LayerNormalization",v3.serialization.registerClass(Ane);class Sne extends N9{constructor(e){if(null==e&&(e={}),super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,null==e.padding)this.padding=[[1,1],[1,1]];else if("number"==typeof e.padding)this.padding=[[e.padding,e.padding],[e.padding,e.padding]];else{if(e.padding=e.padding,2!==e.padding.length)throw new U6(`ZeroPadding2D expects padding to be a length-2 array, but received a length-${e.padding.length} array.`);let t,n;if("number"==typeof e.padding[0])t=[e.padding[0],e.padding[0]],n=[e.padding[1],e.padding[1]];else{if(e.padding=e.padding,2!==e.padding[0].length)throw new U6(`ZeroPadding2D expects height padding to be a length-2 array, but received a length-${e.padding[0].length} array.`);if(t=e.padding[0],2!==e.padding[1].length)throw new U6(`ZeroPadding2D expects width padding to be a length-2 array, but received a length-${e.padding[1].length} array.`);n=e.padding[1]}this.padding=[t,n]}this.inputSpec=[new C9({ndim:4})]}computeOutputShape(e){let t,n;return e=x9(e),"channelsFirst"===this.dataFormat?(t=null!=e[2]&&e[2]>=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(0,v3.tidy)(()=>{return t=T9(e),n=this.padding,i=this.dataFormat,(0,v3.tidy)(()=>{if(4!==t.rank)throw new U6(`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 U6("spatial2dPadding expects `padding` to be an Array of two Arrays, each of which is an Array of two integers.");if(null==i&&(i="channelsLast"),"channelsLast"!==i&&"channelsFirst"!==i)throw new U6(`Unknown data format: ${i}. Supported data formats are 'channelsLast' and 'channelsFirst.`);let e;return e="channelsFirst"===i?[[0,0],[0,0],n[0],n[1]]:[[0,0],n[0],n[1],[0,0]],v3.pad(t,e)});var t,n,i})}getConfig(){const e={padding:this.padding,dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function Cne(e,t,n,i,r,s){return(0,v3.tidy)(()=>{let o;v8(r),T8(s),b8(i),null==n&&(n=[1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=xte(e,r);const a="same"===i?"same":"valid";return o="max"===s?v3.maxPool(e,t,n,a):v3.avgPool(e,t,n,a),"channelsFirst"===r&&(o=v3.transpose(o,[0,3,1,2])),o})}function One(e,t,n,i,r,s){return(0,v3.tidy)(()=>{let o;v8(r),T8(s),b8(i),null==n&&(n=[1,1,1]),null==i&&(i="valid"),null==r&&(r="channelsLast"),null==s&&(s="max"),e=Ete(e,r);const a="same"===i?"same":"valid";return o="max"===s?v3.maxPool3d(e,t,n,a):v3.avgPool3d(e,t,n,a),"channelsFirst"===r&&(o=v3.transpose(o,[0,4,1,2,3])),o})}Sne.className="ZeroPadding2D",v3.serialization.registerClass(Sne);class Mne extends N9{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 U6(`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(o8(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 U6(`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}o8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,b8(this.padding),this.inputSpec=[new C9({ndim:3})]}computeOutputShape(e){const t=bte((e=x9(e))[1],this.poolSize[0],this.padding,this.strides[0]);return[e[0],t,e[2]]}call(e,t){return(0,v3.tidy)(()=>{this.invokeCallHook(e,t),e=L8(T9(e),2);const n=this.poolingFunction(T9(e),[this.poolSize[0],1],[this.strides[0],1],this.padding,"channelsLast");return v3.squeeze(n,[2])})}getConfig(){const e={poolSize:this.poolSize,padding:this.padding,strides:this.strides},t=super.getConfig();return Object.assign(e,t),e}}class kne extends Mne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),Cne(e,t,n,i,r,"max")}}kne.className="MaxPooling1D",v3.serialization.registerClass(kne);class Rne extends Mne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),Cne(e,t,n,i,r,"avg")}}Rne.className="AveragePooling1D",v3.serialization.registerClass(Rne);class Nne extends N9{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 U6(`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];o8(this.poolSize,"poolSize"),o8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,v8(this.dataFormat),b8(this.padding),this.inputSpec=[new C9({ndim:4})]}computeOutputShape(e){e=x9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2];return t=bte(t,this.poolSize[0],this.padding,this.strides[0]),n=bte(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(0,v3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(T9(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 Dne extends Nne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),Cne(e,t,n,i,r,"max")}}Dne.className="MaxPooling2D",v3.serialization.registerClass(Dne);class Fne extends Nne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),Cne(e,t,n,i,r,"avg")}}Fne.className="AveragePooling2D",v3.serialization.registerClass(Fne);class Lne extends N9{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 U6(`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];o8(this.poolSize,"poolSize"),o8(this.strides,"strides"),this.padding=null==e.padding?"valid":e.padding,this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,v8(this.dataFormat),b8(this.padding),this.inputSpec=[new C9({ndim:5})]}computeOutputShape(e){e=x9(e);let t="channelsFirst"===this.dataFormat?e[2]:e[1],n="channelsFirst"===this.dataFormat?e[3]:e[2],i="channelsFirst"===this.dataFormat?e[4]:e[3];return t=bte(t,this.poolSize[0],this.padding,this.strides[0]),n=bte(n,this.poolSize[1],this.padding,this.strides[1]),i=bte(i,this.poolSize[2],this.padding,this.strides[2]),"channelsFirst"===this.dataFormat?[e[0],e[1],t,n,i]:[e[0],t,n,i,e[4]]}call(e,t){return(0,v3.tidy)(()=>(this.invokeCallHook(e,t),this.poolingFunction(T9(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 Pne extends Lne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),One(e,t,n,i,r,"max")}}Pne.className="MaxPooling3D",v3.serialization.registerClass(Pne);class Bne extends Lne{constructor(e){super(e)}poolingFunction(e,t,n,i,r){return v8(r),b8(i),One(e,t,n,i,r,"avg")}}Bne.className="AveragePooling3D",v3.serialization.registerClass(Bne);class $ne extends N9{constructor(e){super(e),this.inputSpec=[new C9({ndim:3})]}computeOutputShape(e){return[e[0],e[2]]}call(e,t){throw new V6}}class Une extends $ne{constructor(e){super(e||{})}call(e,t){return(0,v3.tidy)(()=>{const t=T9(e);return v3.mean(t,1)})}}Une.className="GlobalAveragePooling1D",v3.serialization.registerClass(Une);class Vne extends $ne{constructor(e){super(e||{})}call(e,t){return(0,v3.tidy)(()=>{const t=T9(e);return v3.max(t,1)})}}Vne.className="GlobalMaxPooling1D",v3.serialization.registerClass(Vne);class zne extends N9{constructor(e){super(e),this.dataFormat=null==e.dataFormat?"channelsLast":e.dataFormat,v8(this.dataFormat),this.inputSpec=[new C9({ndim:4})]}computeOutputShape(e){return"channelsLast"===this.dataFormat?[e[0],e[3]]:[e[0],e[1]]}call(e,t){throw new V6}getConfig(){const e={dataFormat:this.dataFormat},t=super.getConfig();return Object.assign(e,t),e}}class jne extends zne{call(e,t){return(0,v3.tidy)(()=>{const t=T9(e);return"channelsLast"===this.dataFormat?v3.mean(t,[1,2]):v3.mean(t,[2,3])})}}jne.className="GlobalAveragePooling2D",v3.serialization.registerClass(jne);class Yne extends zne{call(e,t){return(0,v3.tidy)(()=>{const t=T9(e);return"channelsLast"===this.dataFormat?v3.max(t,[1,2]):v3.max(t,[2,3])})}}Yne.className="GlobalMaxPooling2D",v3.serialization.registerClass(Yne);
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class Gne extends N9{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 i=M7(t.layer,n);delete t.layer;const r={layer:i};return Object.assign(r,t),new e(r)}}class Hne extends Gne{constructor(e){super(e),this.supportsMasking=!0}build(e){if((e=x9(e)).length<3)throw new U6(`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=x9(e))[0]].concat(e.slice(2)),n=this.layer.computeOutputShape(t),i=e[1];return[n[0],i].concat(n.slice(1))}call(e,t){return(0,v3.tidy)(()=>Ute((e,n)=>[T9(this.layer.call(e,t)),[]],e=T9(e),[],!1,null,null,!1,!0)[1])}}Hne.className="TimeDistributed",v3.serialization.registerClass(Hne);class Wne extends Gne{constructor(e){super(e);const t=e.layer.getConfig(),n={};n.className=e.layer.getClassName(),n.config=t,this.forwardLayer=M7(n),t.goBackwards=!0!==t.goBackwards;const i={};var r;if(i.className=e.layer.getClassName(),i.config=t,this.backwardLayer=M7(i),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,r8(_8,"BidirectionalMergeMode",r),e.weights)throw new V6("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,i,r=this.forwardLayer.computeOutputShape(e);return Array.isArray(r)&&Array.isArray(r[0])||(r=[r]),this.returnState?(i=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(i).concat(i.slice()):[t].concat(i).concat(i.slice()):W6(n)}apply(e,t){let n=null==t?null:t.initialState,i=null==t?null:t.constants;null==t&&(t={});const r=$te(e,n,i,this.numConstants);if(e=r.inputs,n=r.initialState,i=r.constants,Array.isArray(e)&&(n=e.slice(1),e=e[0]),(null==n||0===n.length)&&null==i)return super.apply(e,t);const s=[],o=[];if(null!=n){const e=n.length;if(e%2>0)throw new U6("When passing `initialState` to a Bidrectional RNN, the state should be an Array containing the states of the underlying RNNs.");t.initialState=n,s.push(...n);const i=n.map(e=>new C9({shape:e.shape}));this.forwardLayer.stateSpec=i.slice(0,e/2),this.backwardLayer.stateSpec=i.slice(e/2),o.push(...i)}if(null!=i)throw new V6("Support for constants in Bidirectional layers is not implemented yet.");const a=s[0]instanceof O9;for(const e of s)if(e instanceof O9!==a)throw new U6("The initial state of a Bidirectional layer cannot be specified as a mix of symbolic and non-symbolic tensors");if(a){const n=[e].concat(s),i=this.inputSpec.concat(o),r=this.inputSpec;this.inputSpec=i;const a=super.apply(n,t);return this.inputSpec=r,a}return super.apply(e,t)}call(e,t){return(0,v3.tidy)(()=>{const n=t.initialState;let i,r,s,o;if(null==n)i=this.forwardLayer.call(e,t),r=this.backwardLayer.call(e,t);else{const s=n.slice(0,n.length/2),o=n.slice(n.length/2);i=this.forwardLayer.call(e,Object.assign(t,{initialState:s})),r=this.backwardLayer.call(e,Object.assign(t,{initialState:o}))}return this.returnState&&(Array.isArray(i)&&(s=i.slice(1).concat(r.slice(1))),i=i[0],r=r[0]),this.returnSequences&&(r=v3.reverse(r,1)),"concat"===this.mergeMode?o=U8([i,r]):"sum"===this.mergeMode?o=v3.add(i,r):"ave"===this.mergeMode?o=v3.mul(.5,v3.add(i,r)):"mul"===this.mergeMode?o=v3.mul(i,r):null==this.mergeMode&&(o=[i,r]),this.returnState?null==this.mergeMode?o.concat(s):[o].concat(s):o})}resetStates(e){this.forwardLayer.resetStates(),this.backwardLayer.resetStates()}build(e){E8(this.forwardLayer.name,()=>{this.forwardLayer.build(e)}),E8(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=M7(t.layer);if(delete t.layer,null!=t.numConstants)throw new V6("Deserialization of a Bidirectional layer with numConstants present is not supported yet.");const i=t;return i.layer=n,new e(i)}}Wne.className="Bidirectional",v3.serialization.registerClass(Wne);
/**
* @license
* Copyright 2022 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class Xne extends N9{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(0,v3.tidy)(()=>("float32"!==(e=T9(e)).dtype&&(e=F8(e,"float32")),(0,v3.add)((0,v3.mul)(e,this.scale),this.offset)))}}Xne.className="Rescaling",v3.serialization.registerClass(Xne);
/**
* @license
* Copyright 2022 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const{resizeBilinear:qne,cropAndResize:Kne}=v3.image;class Zne extends N9{constructor(e){super(e),this.height=e.height,this.width=e.width}centerCrop(e,t,n,i,r,s,o,a){return(0,v3.tidy)(()=>{let l,u=!1;const c=[t/s,n/o,(i+t)/s,(r+n)/o],d=[];3===e.rank?(u=!0,l=(0,v3.stack)([e])):l=e;for(let e=0;e<l.shape[0];e++)d.push(c);const h=(0,v3.tensor)(d,[d.length,4]),p=(0,v3.range)(0,d.length,1,"int32"),f=Kne(l,h,p,[i,r],"nearest");return F8(u?T9((0,v3.unstack)(f)):f,a)})}upsize(e,t,n,i){return(0,v3.tidy)(()=>F8(qne(e,[t,n]),i))}call(e,t){return(0,v3.tidy)(()=>{const t=T9(e),n=t.dtype,i=t.shape,r=i[i.length-3],s=i[i.length-2];let o=0;r!==this.height&&(o=Math.floor((r-this.height)/2));let a=0;return s!==this.width&&(a=Math.floor((s-this.width)/2),0===a&&(a=1)),o>=0&&a>=0?this.centerCrop(t,o,a,this.height,this.width,r,s,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=x9(e)).length-3,n=e.length-2;return e[t]=this.height,e[n]=this.width,e}}Zne.className="CenterCrop",v3.serialization.registerClass(Zne);
/**
* @license
* Copyright 2022 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class Qne extends N9{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=x9(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(0,v3.tidy)(()=>{let n;if("int32"!==(e=T9(e)).dtype&&(e=F8(e,"int32")),void 0!==t.countWeights){if("count"!==this.outputMode)throw new U6(`countWeights is not used when outputMode !== count.\n Received countWeights=${t.countWeights}`);n=T9(t.countWeights)}const i=(0,v3.max)(e),r=(0,v3.min)(e),s=(0,v3.greater)(this.numTokens,i).bufferSync().get(0),o=(0,v3.greaterEqual)(r,0).bufferSync().get(0);if(!s||!o)throw new U6(`Input values must be between 0 < values <= numTokens with numTokens=${this.numTokens}`);
/**
* @license
* Copyright 2022 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
return function(e,t,n,i){let r=T9(e);if("int32"!==r.dtype&&(r=F8(r,"int32")),"int"===t)return r;const s=r.shape;if(0===r.rank&&(r=(0,v3.expandDims)(r,-1)),"oneHot"===t&&1!==r.shape[r.shape.length-1]&&(r=(0,v3.expandDims)(r,-1)),r.rank>2)throw new U6(`When outputMode is not int, maximum output rank is 2 Received outputMode ${t} and input shape ${s} which would result in output rank ${r.rank}.`);const o=["multiHot","oneHot"].includes(t),a=r;let l;if(l=void 0!==i&&"count"===t?(0,v3.denseBincount)(a,i,n,o):(0,v3.denseBincount)(a,[],n,o),"tfIdf"!==t)return l;if(i)return(0,v3.mul)(l,i);throw new U6("When outputMode is 'tfIdf', weights must be provided.")}(e,this.outputMode,this.numTokens,n)})}}Qne.className="CategoryEncoding",v3.serialization.registerClass(Qne);
/**
* @license
* Copyright 2022 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const Jne=new Set(["bilinear","nearest"]);class eie extends N9{constructor(e){if(super(e),this.height=e.height,this.width=e.width,e.interpolation){if(!Jne.has(e.interpolation))throw new U6(`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=x9(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(0,v3.tidy)(()=>{const t=[this.height,this.width];if("bilinear"===this.interpolation)return v3.image.resizeBilinear(e,t,!this.cropToAspectRatio);if("nearest"===this.interpolation)return v3.image.resizeNearestNeighbor(e,t,!this.cropToAspectRatio);throw new Error(`Interpolation is ${this.interpolation} but only ${[...Jne]} are supported`)})}}eie.className="Resizing",v3.serialization.registerClass(eie);
/**
* @license
* Copyright 2023 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class tie{constructor(e){this.seed=e}next(){if(void 0!==this.seed)return this.seed++}}tie.className="RandomSeed";
/**
* @license
* Copyright 2023 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class nie extends N9{constructor(e){super(e),this.randomGenerator=new tie(e.seed)}getConfig(){const e={seed:this.randomGenerator.seed},t=super.getConfig();return Object.assign(e,t),e}}nie.className="BaseRandomLayer";
/**
* @license
* Copyright 2023 CodeSmith LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
const iie=new Set(["bilinear","nearest"]);class rie extends nie{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 U6(`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 U6(`factor must have values larger than -1. Got: ${this.factor}`);if(this.widthUpper<this.widthLower)throw new U6(`factor cannot have upper bound less than lower bound.\n Got upper bound: ${this.widthUpper}.\n Got lower bound: ${this.widthLower}\n `);if(n){if(!iie.has(n))throw new U6(`Invalid interpolation parameter: ${n} is not implemented`);this.interpolation=n}}getConfig(){const e={factor:this.factor,interpolation:this.interpolation},t=super.getConfig();return Object.assign(e,t),e}computeOutputShape(e){const t=(e=x9(e))[2];return[this.imgHeight,-1,t]}call(e,t){return(0,v3.tidy)(()=>{const t=T9(e);this.imgHeight=t.shape[t.shape.length-3];const n=t.shape[t.shape.length-2];this.widthFactor=(0,v3.randomUniform)([1],1+this.widthLower,1+this.widthUpper,"float32",this.randomGenerator.next());let i=this.widthFactor.dataSync()[0]*n;i=Math.round(i);const r=[this.imgHeight,i];switch(this.interpolation){case"bilinear":return v3.image.resizeBilinear(e,r);case"nearest":return v3.image.resizeNearestNeighbor(e,r);default:throw new Error(`Interpolation is ${this.interpolation}\n but only ${[...iie]} are supported`)}})}}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function sie(e){return new F9(e)}function oie(e){return new gte(e)}function aie(e){return new pte(e)}function lie(e){return new fte(e)}function uie(e){return new mte(e)}function cie(e){return new yte(e)}function die(e){return new _te(e)}function hie(e){return new Fte(e)}function pie(e){return new Ote(e)}function fie(e){return new kte(e)}function mie(e){return new Mte(e)}function gie(e){return new Rte(e)}function _ie(e){return new Dte(e)}function yie(e){return new Lte(e)}function vie(e){return new Pte(e)}function bie(e){return new Bte(e)}function Tie(e){return new sne(e)}function xie(e){return new ine(e)}function Eie(e){return new tne(e)}function wie(e){return new nne(e)}function Iie(e){return new rne(e)}function Aie(e){return new one(e)}function Sie(e){return new ane(e)}function Cie(e){return new lne(e)}function Oie(e){return new cne(e)}function Mie(e){return new hne(e)}function kie(e){return new fne(e)}function Rie(e){return new _ne(e)}function Nie(e){return new mne(e)}function Die(e){return new gne(e)}function Fie(e){return new pne(e)}function Lie(e){return new vne(e)}function Pie(e){return new Ine(e)}function Bie(e){return new Ane(e)}function $ie(e){return new Sne(e)}function Uie(e){return new Rne(e)}function Vie(e){return Uie(e)}function zie(e){return Uie(e)}function jie(e){return new Fne(e)}function Yie(e){return jie(e)}function Gie(e){return jie(e)}function Hie(e){return new Bne(e)}function Wie(e){return Hie(e)}function Xie(e){return Hie(e)}function qie(e){return new Une(e)}function Kie(e){return new jne(e)}function Zie(e){return new Vne(e)}function Qie(e){return new Yne(e)}function Jie(e){return new kne(e)}function ere(e){return new Dne(e)}function tre(e){return new Pne(e)}function nre(e){return new Hte(e)}function ire(e){return new Gte(e)}function rre(e){return new Xte(e)}function sre(e){return new Wte(e)}function ore(e){return new Yte(e)}function are(e){return new jte(e)}function lre(e){return new ene(e)}function ure(e){return new Jte(e)}function cre(e){return new Vte(e)}function dre(e){return new qte(e)}function hre(e){return new Wne(e)}function pre(e){return new Hne(e)}rie.className="RandomWidth",v3.serialization.registerClass(rie);const fre=Zie,mre=Qie,gre=Jie,_re=ere;function yre(e){return new bne(e)}function vre(e){return new Tne(e)}function bre(e){return new xne(e)}function Tre(e){return new une(e)}function xre(e){return new Xne(e)}function Ere(e){return new Zne(e)}function wre(e){return new eie(e)}function Ire(e){return new Qne(e)}function Are(e){return new rie(e)}function Sre(e,t){return j7(e,t)}function Cre(e,t){return X7(e,t)}function Ore(e,t){return q7(e,t)}function Mre(e,t){return Y7(e,t)}function kre(e,t){return K7(e,t)}function Rre(e,t){return H7(e,t)}function Nre(e,t){return W7(e,t)}function Dre(e,t){return U7(e,t)}function Fre(e,t){return N7(e,t)}function Lre(e,t){return D7(e,t)}function Pre(e,t){return D7(e,t)}function Bre(e,t){return D7(e,t)}function $re(e,t){return R7(e,t)}function Ure(e,t){return R7(e,t)}function Vre(e,t){return R7(e,t)}function zre(e,t){return function(e,t){return(0,v3.tidy)(()=>{const n=e.sub(t).square().sum(),i=e.sub(e.mean()).square().sum();return v3.scalar(1).sub(n.div(i))})}(e,t)}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
function jre(e){return new lte(e)}function Yre(e){return ote(t=e),new lte({l1:null!=t?t.l1:null,l2:0});var t}function Gre(e){return ote(t=e),new lte({l2:null!=t?t.l2:null,l1:0});var t}
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
class Hre extends x7{constructor(){super(...arguments),this.model=null}setModel(e){if(!(e instanceof kee))throw new Error("model must be a LayersModel, not some other Container");this.model=e}}function Wre(e,t){return e<t}function Xre(e,t){return e>t}class qre extends Hre{constructor(e){if(super(),null==e&&(e={}),e.restoreBestWeights)throw new V6("restoreBestWeights = True is not implemented in EarlyStopping yet.");this.monitor=e.monitor||"val_loss",this.minDelta=Math.abs(e.minDelta||0),this.patience=e.patience||0,this.verbose=e.verbose||0,this.mode=e.mode||"auto",this.baseline=e.baseline,-1===["auto","min","max"].indexOf(this.mode)&&(console.warn(`EarlyStopping mode '${this.mode}' is invalid. Falling back to mode 'auto'.`),this.mode="auto"),"min"===this.mode?this.monitorFunc=Wre:"max"===this.mode||-1!==this.monitor.indexOf("acc")?this.monitorFunc=Xre:this.monitorFunc=Wre,this.monitorFunc===Wre&&(this.minDelta*=-1)}async onTrainBegin(e){this.wait=0,this.stoppedEpoch=0,null!=this.baseline?this.best=this.baseline:this.best=this.monitorFunc===Wre?1/0:-1/0}async onEpochEnd(e,t){await v7(t);const n=this.getMonitorValue(t);null!=n&&(this.monitorFunc(n-this.minDelta,this.best)?(this.best=n,this.wait=0):(this.wait++,this.wait>=this.patience&&(this.stoppedEpoch=e,this.model.stopTraining=!0)))}async onTrainEnd(e){this.stoppedEpoch>0&&this.verbose&&console.log(`Epoch ${this.stoppedEpoch}: early stopping.`)}getMonitorValue(e){null==e&&(e={});const t=e[this.monitor];return null==t&&console.warn(`Metric for EarlyStopping ${this.monitor} is not available. Available metrics are: ${Object.keys(e)}`),t}}const Kre={earlyStopping:function(e){return new qre(e)}};
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
var Zre,Qre;(0,v3.env)().registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")}),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"}(Zre||(Zre={})),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={}))}(Qre||(Qre={}));
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Jre={};function ese(e,t){const n={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};Jre[e]=n}function tse(e){return Jre[e]}function nse(e){delete Jre[e]}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ise(e,t,n,i,r){const s=t.inputParams[e];if(s&&void 0!==s.inputIndexStart){const e=s.inputIndexStart,o=0===s.inputIndexEnd?void 0:void 0===s.inputIndexEnd?e+1:s.inputIndexEnd,a=e<0?t.inputNames.length+e:e;if("tensor"===s.type)return rse(t.inputNames[a],n,i,r);if("tensors"===s.type){const s=t.inputs.slice(e,o),a=t.inputNames.slice(e,o).filter((e,t)=>{var n;return"NoOp"!==(null===(n=s[t])||void 0===n?void 0:n.op)});return a.map(e=>rse(e,n,i,r))}const l=rse(t.inputNames[a],n,i,r),u=l.dataSync();return"number"===s.type?u[0]:v3.util.toNestedArray(l.shape,u)}const o=t.attrParams[e];return o&&o.value}function rse(e,t,n,i){const[r,s]=lse(e,n);if(null!=i){const e=i.getHashTableHandleByName(r);if(null!=e)return e}const o=n.currentContextIds.find(e=>!!t[ase(r,e)]);return void 0!==o?t[ase(r,o)][s]:void 0}function sse(e,t,n){return t[ase(e,n.currentContextId)]}function ose(e,t){const[n,i,r]=lse(e,t);return[ase(n,t&&t.currentContextId),i,r]}function ase(e,t){return t?`${e}-${t}`:e}function lse(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 i=e.split(":");let r;if(1===i.length)r=[e,0,void 0];else{const e=i[0],t=3===i.length?i[1]:void 0;r=[e,Number(i[i.length-1]),t]}return n&&t.parseNodeNameCache.set(e,r),r}function use(e,t,n){let i=ise("pad",e,t,n);if("explicit"===i){i=ise("explicitPaddings",e,t,n);const r=[[0,0],[0,0],[0,0],[0,0]];for(let e=0;e<4;e++)r[e][0]=i[2*e],r[e][1]=i[2*e+1];return r}return i}function cse(e){return e.kept?e:(0,v3.clone)(e)}
/**
* @license
* Copyright 2023 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const dse=[{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}]}],hse=[{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}]}],pse=[{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"}]}],fse=[{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"}]}],mse=[{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"}]}],gse=[{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}]}],_se=[{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"}]}],yse=[{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"}]}],vse=[{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"}]}],bse=[{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"}]}],Tse=[{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"}]}],xse=[{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"}]}],Ese=[{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"}]}],wse=[{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"}]}],Ise=[{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"}]}],Ase=[{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"}]}],Sse=[{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}]}],Cse=[{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"}]}],Ose=[{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:[]}];
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Mse{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[].concat(...[ge,_e,ye,ve,be,Te,xe,Ee,we,Ie,Ae,Se,Ce,Oe,Me,ke,Re,Ne,De].map(e=>e.json));this.opMappers=e.reduce((e,t)=>(e[t.tfOpName]=t,e),{})}transformGraph(e,t={}){const n=e.node,i=[],r=[],s=[],o=n.reduce((e,t)=>(e[t.name]=this.mapNode(t),t.op.startsWith("Placeholder")?i.push(e[t.name]):"Const"===t.op?r.push(e[t.name]):null!=t.input&&0!==t.input.length||s.push(e[t.name]),e),{});let a=[];const l=[];let u={},c={};null!=t&&(u=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));const d=Object.keys(o);d.forEach(e=>{const t=o[e];t.inputNames.forEach((e,n)=>{const[i,,r]=ose(e),s=o[i];if(null!=s.outputs){const e=s.outputs.indexOf(r);if(-1!==e){const r=`${i}:${e}`;t.inputNames[n]=r}}t.inputs.push(s),s.children.push(t)})}),0===Object.keys(c).length?d.forEach(e=>{const t=o[e];0===t.children.length&&l.push(t)}):Object.keys(c).forEach(e=>{const[t]=ose(e),n=o[t];null!=n&&(n.signatureKey=c[e],l.push(n))}),Object.keys(u).length>0?Object.keys(u).forEach(e=>{const[t]=ose(e),n=o[t];n&&(n.signatureKey=u[e],a.push(n))}):a=i;let h={};null!=e.library&&null!=e.library.function&&(h=e.library.function.reduce((e,t)=>(e[t.signature.name]=this.mapFunction(t),e),{}));const p={nodes:o,inputs:a,outputs:l,weights:r,placeholders:i,signature:t,functions:h};return s.length>0&&(p.initNodes=s),p}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,n)=>(t[e[n].name]=n,t),{})}mapNode(e){const t=tse(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 i=n.type;let r;switch(n.type){case"string":r=Rse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Rse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"string[]":r=zse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=zse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number":r=Dse(e.attr,n.tfName,n.defaultValue||0),void 0===r&&n.tfDeprecatedName&&(r=Dse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"number[]":r=Vse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Vse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool":r=Nse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Nse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"bool[]":r=Yse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Yse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape":r=Use(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Use(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"shape[]":r=jse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=jse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype":r=Pse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Pse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"dtype[]":r=Bse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Bse(e.attr,n.tfDeprecatedName,n.defaultValue));break;case"func":r=Lse(e.attr,n.tfName,n.defaultValue),void 0===r&&n.tfDeprecatedName&&(r=Lse(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:i},t},{})),n}mapFunction(e){const t=e.nodeDef,n=[];let i={};null!=t&&(i=t.reduce((e,t)=>(e[t.name]=this.mapNode(t),"Const"===t.op&&n.push(e[t.name]),e),{}));const r=[],s=[];e.signature.inputArg.forEach(e=>{const[t]=ose(e.name),n={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:Fse(e.type),type:"dtype"}},children:[]};n.signatureKey=e.name,r.push(n),i[t]=n});Object.keys(i).forEach(e=>{const t=i[e];t.inputNames.forEach((e,n)=>{const[r,,s]=ose(e),o=i[r];if(null!=o.outputs){const e=o.outputs.indexOf(s);if(-1!==e){const i=`${r}:${e}`;t.inputNames[n]=i}}t.inputs.push(o),o.children.push(t)})});const o=e.ret;e.signature.outputArg.forEach(e=>{const[t,n]=ose(o[e.name]),r=i[t];null!=r&&(r.defaultOutput=n,s.push(r))});const a=this.mapArgsToSignature(e);return{nodes:i,inputs:r,outputs:s,weights:n,placeholders:[],signature:a}}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 kse(e,t){const n=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){const t=(0,v3.env)().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 Rse(e,t,n,i=!1){const r=e[t];return null!=r?kse(r.s,i):n}function Nse(e,t,n){const i=e[t];return i?i.b:n}function Dse(e,t,n){const i=e[t]||{},r=null!=i.i?i.i:null!=i.f?i.f:n;return"number"==typeof r?r:parseInt(r,10)}function Fse(e){switch("string"==typeof e&&(e=Zre[e]),e){case Zre.DT_FLOAT:case Zre.DT_HALF:return"float32";case Zre.DT_INT32:case Zre.DT_INT64:case Zre.DT_INT8:case Zre.DT_UINT8:return"int32";case Zre.DT_BOOL:return"bool";case Zre.DT_DOUBLE:return"float32";case Zre.DT_STRING:return"string";case Zre.DT_COMPLEX64:case Zre.DT_COMPLEX128:return"complex64";default:return null}}function Lse(e,t,n){const i=e[t];return i&&i.func?i.func.name:n}function Pse(e,t,n){const i=e[t];return i&&i.type?Fse(i.type):n}function Bse(e,t,n){const i=e[t];return i&&i.list&&i.list.type?i.list.type.map(e=>Fse(e)):n}function $se(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(e=>"number"==typeof e.size?e.size:parseInt(e.size,10)):[]}function Use(e,t,n){const i=e[t];return i&&i.shape?$se(i.shape):n}function Vse(e,t,n){const i=e[t];return i?((i.list.f&&i.list.f.length?i.list.f:i.list.i)||[]).map(e=>"number"==typeof e?e:parseInt(e,10)):n}function zse(e,t,n,i=!1){const r=e[t];return r&&r.list&&r.list.s?r.list.s.map(e=>kse(e,i)):n}function jse(e,t,n){const i=e[t];return i&&i.list&&i.list.shape?i.list.shape.map(e=>$se(e)):n}function Yse(e,t,n){const i=e[t];return i&&i.list&&i.list.b?i.list.b:n}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Gse{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 rse(e,this.tensorMap,this.context)}getAttr(e,t){const n=this.node.rawAttrs[e];if(null!=n.tensor)return rse(e,this.tensorMap,this.context);if(null!=n.i||null!=n.f)return Dse(this.node.rawAttrs,e,t);if(null!=n.s)return Rse(this.node.rawAttrs,e,t);if(null!=n.b)return Nse(this.node.rawAttrs,e,t);if(null!=n.shape)return Use(this.node.rawAttrs,e,t);if(null!=n.type)return Pse(this.node.rawAttrs,e,t);if(null!=n.list){if(null!=n.list.i||null!=n.list.f)return Vse(this.node.rawAttrs,e,t);if(null!=n.list.s)return zse(this.node.rawAttrs,e,t);if(null!=n.list.shape)return jse(this.node.rawAttrs,e,t);if(null!=n.list.b)return Yse(this.node.rawAttrs,e,t);if(null!=n.list.type)return Bse(this.node.rawAttrs,e,t)}return t}}var Hse=__webpack_require__(67270);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Wse(e,t,n=""){if("number"!=typeof e&&"number"!=typeof t){v3.util.assert(e.length===t.length,()=>n+` Shapes ${e} and ${t} must match`);for(let i=0;i<e.length;i++){const r=e[i],s=t[i];v3.util.assert(r<0||s<0||r===s,()=>n+` Shapes ${e} and ${t} must match`)}}}function Xse(e){return"number"!=typeof e&&!e.some(e=>e<0)}function qse(e,t,n){let i=Kse(e,n);const r=!Xse(i);if(r&&0===t.length)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${i}`);if(r&&t.forEach(e=>{i=Kse(e.shape,i)}),!Xse(i))throw new Error(`Non-fully-defined elementShape: ${i}`);return i}function Kse(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 i=0;i<e.length;++i){const r=e[i],s=t[i];if(r>=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);n[i]=r>=0?r:s}return n}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Zse{constructor(e,t,n,i,r,s,o){this.name=e,this.dtype=t,this.maxSize=n,this.elementShape=i,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=o,this.tensors=[],this.closed_=!1,this.idTensor=(0,v3.scalar)(0),(0,v3.keep)(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),Wse(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,(0,v3.keep)(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.size();t++)e.push(t)}if(0===e.length)return(0,v3.tensor)([],[0].concat(this.elementShape));const n=this.readMany(e);return Wse(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),(0,v3.stack)(n,0)}concat(e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`);if(0===this.size())return(0,v3.tensor)([],[0].concat(this.elementShape));const t=[];for(let e=0;e<this.size();e++)t.push(e);const n=this.readMany(t);return Wse(this.elementShape,n[0].shape,`TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${n[0].shape})`),(0,v3.concat)(n,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const n=Math.max(...e);if(!this.dynamicSize&&n>=this.maxSize)throw new Error(`Max index must be < array size (${n} vs. ${this.maxSize})`);this.writeMany(e,(0,v3.unstack)(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 i=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,s=[];(0,v3.tidy)(()=>{t=(0,v3.reshape)(t,[1,n,r]);for(let n=0;n<e.length;++n){const o=[0,0===n?0:i[n-1],0],a=[1,e[n],r];s[n]=(0,v3.reshape)((0,v3.slice)(t,o,a),this.elementShape)}return s});const o=[];for(let t=0;t<e.length;t++)o[t]=t;this.writeMany(o,s)}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Qse{get id(){return this.idTensor.id}constructor(e,t,n,i=-1){this.tensors=e,this.elementShape=t,this.elementDtype=n,null!=e&&e.forEach(e=>{if(n!==e.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${e.dtype}`);Wse(t,e.shape,"TensorList shape mismatch: "),(0,v3.keep)(e)}),this.idTensor=(0,v3.scalar)(0),this.maxNumElements=i,(0,v3.keep)(this.idTensor)}copy(){return new Qse([...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.`);Wse(e,this.elementShape,"TensorList shape mismatch: ");const i=qse(this.elementShape,this.tensors,e);return(0,v3.tidy)(()=>{const e=this.tensors.map(e=>(0,v3.reshape)(e,i));return(0,v3.stack)(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=qse(this.elementShape,this.tensors,e),i=this.tensors.pop();return i.kept=!1,Wse(i.shape,e,"TensorList shape mismatch: "),(0,v3.reshape)(i,n)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Wse(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");(0,v3.keep)(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 Qse([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let n=0;n<Math.min(this.tensors.length,e);++n)t.tensors[n]=this.tensors[n];return t}getItem(e,t,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(e<0||e>this.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.`);Wse(this.tensors[e].shape,t,"TensorList shape mismatch: ");const i=qse(this.elementShape,this.tensors,t);return(0,v3.reshape)(this.tensors[e],i)}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.`);Wse(this.elementShape,t.shape,"TensorList shape mismatch: "),(0,v3.keep)(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}`);Wse(this.elementShape,n,"TensorList shape mismatch: "),e=e.slice(0,this.size());const i=qse(this.elementShape,this.tensors,n);return 0===e.length?(0,v3.tensor)([],[0].concat(i)):(0,v3.tidy)(()=>{const t=e.map(e=>(0,v3.reshape)(this.tensors[e],i));return(0,v3.stack)(t,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Wse(this.elementShape,t,"TensorList shape mismatch: ");const n=qse(this.elementShape,this.tensors,t);return 0===this.size()?(0,v3.tensor)([],[0].concat(n)):(0,v3.tidy)(()=>{const e=this.tensors.map(e=>(0,v3.reshape)(e,n));return(0,v3.concat)(e,0)})}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Jse=async(e,t,n)=>{switch(e.op){case"If":case"StatelessIf":{const i=ise("thenBranch",e,t,n),r=ise("elseBranch",e,t,n),s=ise("cond",e,t,n),o=ise("args",e,t,n);return(await s.data())[0]?n.functionMap[i].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap):n.functionMap[r].executeFunctionAsync(o,n.tensorArrayMap,n.tensorListMap)}case"While":case"StatelessWhile":{const i=ise("body",e,t,n),r=ise("cond",e,t,n),s=ise("args",e,t,n),o=await n.functionMap[r].executeFunctionAsync(s,n.tensorArrayMap,n.tensorListMap),a=s.map(e=>e.id);let l=await o[0].data();o.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||e.dispose()});let u=s;for(;l[0];){const e=u;u=await n.functionMap[i].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);const t=u.map(e=>e.id);e.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()});const s=await n.functionMap[r].executeFunctionAsync(u,n.tensorArrayMap,n.tensorListMap);l=await s[0].data(),s.forEach(e=>{e.kept||-1!==a.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})}return u}case"LoopCond":return[cse(ise("pred",e,t,n))];case"Switch":{const i=ise("pred",e,t,n);let r=ise("data",e,t,n);return r.kept||(r=cse(r)),(await i.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{const i=e.inputNames.find(e=>void 0!==rse(e,t,n));if(i){return[cse(rse(i,t,n))]}return}case"Enter":{const i=ise("frameName",e,t,n),r=ise("tensor",e,t,n);return n.enterFrame(i),[cse(r)]}case"Exit":{const i=ise("tensor",e,t,n);return n.exitFrame(),[cse(i)]}case"NextIteration":{const i=ise("tensor",e,t,n);return n.nextIteration(),[cse(i)]}case"TensorArrayV3":{const i=ise("size",e,t,n),r=ise("dtype",e,t,n),s=ise("elementShape",e,t,n),o=ise("dynamicSize",e,t,n),a=ise("clearAfterRead",e,t,n),l=ise("identicalElementShapes",e,t,n),u=ise("name",e,t,n),c=new Zse(u,r,i,s,l,o,a);return n.addTensorArray(c),[c.idTensor,(0,v3.scalar)(1)]}case"TensorArrayWriteV3":{const i=ise("tensorArrayId",e,t,n),r=ise("index",e,t,n),s=ise("tensor",e,t,n),o=n.getTensorArray(i.id);return o.write(r,s),[o.idTensor]}case"TensorArrayReadV3":{const i=ise("tensorArrayId",e,t,n),r=ise("index",e,t,n);return[n.getTensorArray(i.id).read(r)]}case"TensorArrayGatherV3":{const i=ise("tensorArrayId",e,t,n),r=ise("indices",e,t,n),s=ise("dtype",e,t,n);return[n.getTensorArray(i.id).gather(r,s)]}case"TensorArrayScatterV3":{const i=ise("tensorArrayId",e,t,n),r=ise("indices",e,t,n),s=ise("tensor",e,t,n),o=n.getTensorArray(i.id);return o.scatter(r,s),[o.idTensor]}case"TensorArrayConcatV3":{const i=ise("tensorArrayId",e,t,n),r=n.getTensorArray(i.id),s=ise("dtype",e,t,n);return[r.concat(s)]}case"TensorArraySplitV3":{const i=ise("tensorArrayId",e,t,n),r=ise("tensor",e,t,n),s=ise("lengths",e,t,n),o=n.getTensorArray(i.id);return o.split(s,r),[o.idTensor]}case"TensorArraySizeV3":{const i=ise("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return[(0,v3.scalar)(r.size(),"int32")]}case"TensorArrayCloseV3":{const i=ise("tensorArrayId",e,t,n),r=n.getTensorArray(i.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{const i=ise("tensorListId",e,t,n),r=ise("index",e,t,n),s=ise("tensor",e,t,n),o=n.getTensorList(i.id);return o.setItem(r,s),[o.idTensor]}case"TensorListGetItem":{const i=ise("tensorListId",e,t,n),r=ise("index",e,t,n),s=ise("elementShape",e,t,n),o=ise("elementDType",e,t,n);return[n.getTensorList(i.id).getItem(r,s,o)]}case"TensorListScatterV2":case"TensorListScatter":{const i=ise("indices",e,t,n),r=function(e,t,n,i){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!=i&&-1!==i&&r>=i)throw new Error(`Max index must be < array size (${r} vs. ${i})`);const s=new Qse([],n,e.dtype,i),o=(0,v3.unstack)(e,0);return t.forEach((e,t)=>{s.setItem(e,o[t])}),s}(ise("tensor",e,t,n),i,ise("elementShape",e,t,n),ise("numElements",e,t,n));return n.addTensorList(r),[r.idTensor]}case"TensorListReserve":case"EmptyTensorList":{const i=ise("elementShape",e,t,n),r=ise("elementDType",e,t,n);let s;s="TensorListReserve"===e.op?"numElements":"maxNumElements";const o=ise(s,e,t,n),a=function(e,t,n,i){return new Qse([],e,t,i)}(i,r,0,"TensorListReserve"===e.op?-1:o);return n.addTensorList(a),[a.idTensor]}case"TensorListGather":{const i=ise("tensorListId",e,t,n),r=ise("indices",e,t,n),s=ise("elementShape",e,t,n),o=ise("elementDType",e,t,n);return[n.getTensorList(i.id).gather(r,o,s)]}case"TensorListStack":{const i=ise("tensorListId",e,t,n),r=ise("elementShape",e,t,n),s=ise("elementDType",e,t,n),o=ise("numElements",e,t,n);return[n.getTensorList(i.id).stack(r,s,o)]}case"TensorListFromTensor":{const i=function(e,t,n){const i=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}`);Wse(e.shape.slice(1),t,"TensorList shape mismatch: ");const r=(0,v3.unstack)(e);return new Qse(r,t,i)}(ise("tensor",e,t,n),ise("elementShape",e,t,n),ise("elementDType",e,t,n));return n.addTensorList(i),[i.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{const i=ise("tensorListId",e,t,n),r=n.getTensorList(i.id),s=ise("dtype",e,t,n),o=ise("elementShape",e,t,n);return[r.concat(s,o)]}case"TensorListPushBack":{const i=ise("tensorListId",e,t,n),r=ise("tensor",e,t,n),s=n.getTensorList(i.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{const i=ise("tensorListId",e,t,n),r=ise("elementShape",e,t,n),s=ise("elementDType",e,t,n);return[n.getTensorList(i.id).popBack(r,s)]}case"TensorListSplit":{const i=ise("tensor",e,t,n),r=ise("elementShape",e,t,n),s=function(e,t,n){let i=0;const r=t.map(e=>(i+=e,i));if(i!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${i}, and tensor's shape is: ${e.shape}`);const s=Kse(e.shape.slice(1),n),o=0===i?0:e.size/i,a=(0,v3.tidy)(()=>{const n=[];e=(0,v3.reshape)(e,[1,i,o]);for(let i=0;i<t.length;++i){const a=[0,0===i?0:r[i-1],0],l=[1,t[i],o];n[i]=(0,v3.reshape)((0,v3.slice)(e,a,l),s)}return e.dispose(),n}),l=new Qse([],n,e.dtype,t.length);for(let e=0;e<a.length;e++)l.setItem(e,a[e]);return l}(i,ise("lengths",e,t,n),r);return n.addTensorList(s),[s.idTensor]}case"TensorListLength":{const i=ise("tensorListId",e,t,n),r=n.getTensorList(i.id);return[(0,v3.scalar)(r.size(),"int32")]}case"TensorListResize":{const i=ise("tensorListId",e,t,n),r=ise("size",e,t,n),s=n.getTensorList(i.id).resize(r);return n.addTensorList(s),[s.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function eoe(e,t,n){const[i,r]=ise("fusedOps",e,t,n),s="biasadd"===i,o=!s,a="prelu"===r,l="fusedbatchnorm"===i,u=ise("numArgs",e,t,n);if(s){if(a&&2!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&s&&1!==u)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const c=ise("strides",e,t,n),d=use(e,t,n),h=ise("dataFormat",e,t,n).toUpperCase(),p=ise("dilations",e,t,n);let[f,m]=ise("args",e,t,n);o&&(m=f,f=void 0);return{stride:c,pad:d,dataFormat:h,dilations:p,biasArg:f,preluArg:m,activationFunc:r,leakyreluAlpha:ise("leakyreluAlpha",e,t,n)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function toe(e,t,n){return{boxes:ise("boxes",e,t,n),scores:ise("scores",e,t,n),maxOutputSize:ise("maxOutputSize",e,t,n),iouThreshold:ise("iouThreshold",e,t,n),scoreThreshold:ise("scoreThreshold",e,t,n),softNmsSigma:ise("softNmsSigma",e,t,n)}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class noe{get id(){return this.handle.id}constructor(e,t){this.keyDType=e,this.valueDType=t,this.handle=(0,v3.scalar)(0),this.tensorMap=new Map,(0,v3.keep)(this.handle)}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return S3.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(),(0,v3.tidy)(()=>{const e=(0,v3.unstack)(t),i=n.length,r=e.length;v3.util.assert(i===r,()=>`The number of elements doesn't match, keys has ${i} elements, the values has ${r} elements.`);for(let t=0;t<i;t++){const i=n[t],r=e[t];(0,v3.keep)(r),this.tensorMap.set(i,r)}return this.handle})}async find(e,t){this.checkKeyAndValueTensor(e,t);const n=await e.data();return(0,v3.tidy)(()=>{const e=[];for(let i=0;i<n.length;i++){const r=n[i],s=this.findWithDefault(r,t);e.push(s)}return(0,v3.stack)(e)})}findWithDefault(e,t){const n=this.tensorMap.get(e);return null!=n?n:t}checkKeyAndValueTensor(e,t){if(e.dtype!==this.keyDType)throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`);if(t.dtype!==this.valueDType)throw new Error(`Expect value dtype ${this.valueDType}, but got ${t.dtype}`)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ioe(e,t,n,i,r=v3.tidy){const s=((e,t,n)=>{switch(e.category){case"arithmetic":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[i.add(ise("a",e,t,n),ise("b",e,t,n))];case"AddN":return[i.addN(ise("tensors",e,t,n))];case"FloorMod":case"Mod":return[i.mod(ise("a",e,t,n),ise("b",e,t,n))];case"Mul":return[i.mul(ise("a",e,t,n),ise("b",e,t,n))];case"RealDiv":case"Div":return[i.div(ise("a",e,t,n),ise("b",e,t,n))];case"DivNoNan":return[i.divNoNan(ise("a",e,t,n),ise("b",e,t,n))];case"FloorDiv":return[i.floorDiv(ise("a",e,t,n),ise("b",e,t,n))];case"Sub":return[i.sub(ise("a",e,t,n),ise("b",e,t,n))];case"Minimum":return[i.minimum(ise("a",e,t,n),ise("b",e,t,n))];case"Maximum":return[i.maximum(ise("a",e,t,n),ise("b",e,t,n))];case"Pow":return[i.pow(ise("a",e,t,n),ise("b",e,t,n))];case"SquaredDifference":return[i.squaredDifference(ise("a",e,t,n),ise("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,i=Fe)=>{switch(e.op){case"Abs":case"ComplexAbs":return[i.abs(ise("x",e,t,n))];case"Acos":return[i.acos(ise("x",e,t,n))];case"Acosh":return[i.acosh(ise("x",e,t,n))];case"Asin":return[i.asin(ise("x",e,t,n))];case"Asinh":return[i.asinh(ise("x",e,t,n))];case"Atan":return[i.atan(ise("x",e,t,n))];case"Atan2":return[i.atan2(ise("x",e,t,n),ise("y",e,t,n))];case"Atanh":return[i.atanh(ise("x",e,t,n))];case"Ceil":return[i.ceil(ise("x",e,t,n))];case"Complex":return[i.complex(ise("real",e,t,n),ise("imag",e,t,n))];case"Cos":return[i.cos(ise("x",e,t,n))];case"Cosh":return[i.cosh(ise("x",e,t,n))];case"Elu":return[i.elu(ise("x",e,t,n))];case"Erf":return[i.erf(ise("x",e,t,n))];case"Exp":return[i.exp(ise("x",e,t,n))];case"Expm1":return[i.expm1(ise("x",e,t,n))];case"Floor":return[i.floor(ise("x",e,t,n))];case"Log":return[i.log(ise("x",e,t,n))];case"Log1p":return[i.log1p(ise("x",e,t,n))];case"Imag":return[i.imag(ise("x",e,t,n))];case"Neg":return[i.neg(ise("x",e,t,n))];case"Reciprocal":return[i.reciprocal(ise("x",e,t,n))];case"Real":return[i.real(ise("x",e,t,n))];case"Relu":return[i.relu(ise("x",e,t,n))];case"Round":return[i.round(ise("x",e,t,n))];case"Selu":return[i.selu(ise("x",e,t,n))];case"Sigmoid":return[i.sigmoid(ise("x",e,t,n))];case"Sin":return[i.sin(ise("x",e,t,n))];case"Sign":return[i.sign(ise("x",e,t,n))];case"Sinh":return[i.sinh(ise("x",e,t,n))];case"Softplus":return[i.softplus(ise("x",e,t,n))];case"Sqrt":return[i.sqrt(ise("x",e,t,n))];case"Square":return[i.square(ise("x",e,t,n))];case"Tanh":return[i.tanh(ise("x",e,t,n))];case"Tan":return[i.tan(ise("x",e,t,n))];case"ClipByValue":return[i.clipByValue(ise("x",e,t,n),ise("clipValueMin",e,t,n),ise("clipValueMax",e,t,n))];case"Relu6":return[i.relu6(ise("x",e,t,n))];case"Rsqrt":return[i.rsqrt(rse(e.inputNames[0],t,n))];case"LeakyRelu":return[i.leakyRelu(ise("x",e,t,n),ise("alpha",e,t,n))];case"Prelu":return[i.prelu(ise("x",e,t,n),ise("alpha",e,t,n))];case"IsNan":return[i.isNaN(rse(e.inputNames[0],t,n))];case"IsInf":return[i.isInf(rse(e.inputNames[0],t,n))];case"IsFinite":return[i.isFinite(rse(e.inputNames[0],t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"control":return Jse(e,t,n);case"convolution":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Conv1D":{const r=ise("stride",e,t,n),s=ise("pad",e,t,n),o=ise("dataFormat",e,t,n).toUpperCase(),a=ise("dilation",e,t,n);return[i.conv1d(ise("x",e,t,n),ise("filter",e,t,n),r,s,o,a)]}case"Conv2D":{const r=ise("strides",e,t,n),s=use(e,t,n),o=ise("dataFormat",e,t,n).toUpperCase(),a=ise("dilations",e,t,n);return[i.conv2d(ise("x",e,t,n),ise("filter",e,t,n),[r[1],r[2]],s,o,[a[1],a[2]])]}case"_FusedConv2D":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=eoe(e,t,n);return[i.fused.conv2d({x:ise("x",e,t,n),filter:ise("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:r,pad:s,dataFormat:o,dilations:a,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=eoe(e,t,n);return[i.fused.depthwiseConv2d({x:ise("x",e,t,n),filter:ise("filter",e,t,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[a[1],a[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const r=ise("outputShape",e,t,n),s=ise("strides",e,t,n),o=use(e,t,n);return[i.conv2dTranspose(ise("x",e,t,n),ise("filter",e,t,n),r,[s[1],s[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const r=ise("strides",e,t,n),s=use(e,t,n),o=ise("dilations",e,t,n),a=ise("dataFormat",e,t,n).toUpperCase();return[i.depthwiseConv2d(ise("input",e,t,n),ise("filter",e,t,n),[r[1],r[2]],s,a,[o[1],o[2]])]}case"Conv3D":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("dataFormat",e,t,n).toUpperCase(),a=ise("dilations",e,t,n);return[i.conv3d(ise("x",e,t,n),ise("filter",e,t,n),[r[1],r[2],r[3]],s,o,[a[1],a[2],a[3]])]}case"AvgPool":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("kernelSize",e,t,n);return[i.avgPool(ise("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPool":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("kernelSize",e,t,n);return[i.maxPool(ise("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s)]}case"MaxPoolWithArgmax":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("kernelSize",e,t,n),a=ise("includeBatchInIndex",e,t,n),{result:l,indexes:u}=i.maxPoolWithArgmax(ise("x",e,t,n),[o[1],o[2]],[r[1],r[2]],s,a);return[l,u]}case"AvgPool3D":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("kernelSize",e,t,n);return[i.avgPool3d(ise("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"MaxPool3D":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("kernelSize",e,t,n);return[i.maxPool3d(ise("x",e,t,n),[o[1],o[2],o[3]],[r[1],r[2],r[3]],s)]}case"Dilation2D":{const r=ise("strides",e,t,n),s=ise("pad",e,t,n),o=ise("dilations",e,t,n),a=r[1],l=r[2],u=o[1],c=o[2];return[i.dilation2d(ise("x",e,t,n),ise("filter",e,t,n),[a,l],s,[u,c],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"creation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Fill":{const r=ise("shape",e,t,n),s=ise("dtype",e,t,n),o=ise("value",e,t,n);return[i.fill(r,o,s)]}case"LinSpace":{const r=ise("start",e,t,n),s=ise("stop",e,t,n),o=ise("num",e,t,n);return[i.linspace(r,s,o)]}case"Multinomial":{const r=ise("logits",e,t,n),s=ise("numSamples",e,t,n),o=ise("seed",e,t,n);return[i.multinomial(r,s,o)]}case"OneHot":{const r=ise("indices",e,t,n),s=ise("depth",e,t,n),o=ise("onValue",e,t,n),a=ise("offValue",e,t,n),l=ise("dtype",e,t,n);return[i.oneHot(r,s,o,a,l)]}case"Ones":return[i.ones(ise("shape",e,t,n),ise("dtype",e,t,n))];case"OnesLike":return[i.onesLike(ise("x",e,t,n))];case"RandomStandardNormal":return[i.randomStandardNormal(ise("shape",e,t,n),ise("dtype",e,t,n),ise("seed",e,t,n))];case"RandomUniform":return[i.randomUniform(ise("shape",e,t,n),ise("minval",e,t,n),ise("maxval",e,t,n),ise("dtype",e,t,n))];case"RandomUniformInt":return[i.randomUniformInt(ise("shape",e,t,n),ise("minval",e,t,n),ise("maxval",e,t,n),ise("seed",e,t,n))];case"Range":{const r=ise("start",e,t,n),s=ise("stop",e,t,n),o=ise("step",e,t,n);return[i.range(r,s,o,ise("dtype",e,t,n))]}case"TruncatedNormal":{const r=ise("shape",e,t,n),s=ise("mean",e,t,n),o=ise("stdDev",e,t,n),a=ise("seed",e,t,n);return[i.truncatedNormal(r,s,o,ise("dtype",e,t,n),a)]}case"Zeros":return[i.zeros(ise("shape",e,t,n),ise("dtype",e,t,n))];case"ZerosLike":return[i.zerosLike(ise("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"dynamic":return(async(e,t,n,i,r=Fe)=>{switch(e.op){case"NonMaxSuppressionV5":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=toe(e,t,n),c=await r.image.nonMaxSuppressionWithScoreAsync(i,s,o,a,l,u);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=toe(e,t,n),u=ise("padToMaxOutputSize",e,t,n),c=await r.image.nonMaxSuppressionPaddedAsync(i,s,o,a,l,u);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{const{boxes:i,scores:s,maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=toe(e,t,n);return[await r.image.nonMaxSuppressionAsync(i,s,o,a,l)]}case"Where":{const i=r.cast(ise("condition",e,t,n),"bool"),s=[await r.whereAsync(i)];return i.dispose(),s}case"ListDiff":return r.setdiff1dAsync(ise("x",e,t,n),ise("y",e,t,n));default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n);case"evaluation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"LowerBound":{const r=ise("sortedSequence",e,t,n),s=ise("values",e,t,n);return[i.lowerBound(r,s)]}case"TopKV2":{const r=ise("x",e,t,n),s=ise("k",e,t,n),o=ise("sorted",e,t,n),a=i.topk(r,s,o);return[a.values,a.indices]}case"UpperBound":{const r=ise("sortedSequence",e,t,n),s=ise("values",e,t,n);return[i.upperBound(r,s)]}case"Unique":{const r=ise("x",e,t,n),s=i.unique(r);return[s.values,s.indices]}case"UniqueV2":{const r=ise("x",e,t,n),s=ise("axis",e,t,n),o=i.unique(r,s);return[o.values,o.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"image":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ResizeBilinear":{const r=ise("images",e,t,n),s=ise("size",e,t,n),o=ise("alignCorners",e,t,n),a=ise("halfPixelCenters",e,t,n);return[i.image.resizeBilinear(r,[s[0],s[1]],o,a)]}case"ResizeNearestNeighbor":{const r=ise("images",e,t,n),s=ise("size",e,t,n),o=ise("alignCorners",e,t,n),a=ise("halfPixelCenters",e,t,n);return[i.image.resizeNearestNeighbor(r,[s[0],s[1]],o,a)]}case"CropAndResize":{const r=ise("image",e,t,n),s=ise("boxes",e,t,n),o=ise("boxInd",e,t,n),a=ise("cropSize",e,t,n),l=ise("method",e,t,n),u=ise("extrapolationValue",e,t,n);return[i.image.cropAndResize(r,s,o,a,l,u)]}case"ImageProjectiveTransformV3":{const r=ise("images",e,t,n),s=ise("transforms",e,t,n),o=ise("outputShape",e,t,n),a=ise("fillValue",e,t,n),l=ise("interpolation",e,t,n),u=ise("fillMode",e,t,n);return[i.image.transform(r,s,l.toLowerCase(),u.toLowerCase(),a,o)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"graph":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":const r=ise("default",e,t,n);return[rse(e.name,t,n)||r];case"Placeholder":return[rse(e.name,t,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":case"Snapshot":return[cse(ise("x",e,t,n))];case"IdentityN":return ise("x",e,t,n).map(e=>cse(e));case"Shape":return[i.tensor1d(ise("x",e,t,n).shape,"int32")];case"ShapeN":return ise("x",e,t,n).map(e=>i.tensor1d(e.shape));case"Size":return[i.scalar(ise("x",e,t,n).size,"int32")];case"Rank":return[i.scalar(ise("x",e,t,n).rank,"int32")];case"NoOp":return[i.scalar(1)];case"Print":const s=ise("x",e,t,n),o=ise("data",e,t,n),a=ise("message",e,t,n),l=ise("summarize",e,t,n);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(a);for(let e=0;e<o.length;e++)console.log(Array.prototype.slice.call(o[e].dataSync()).slice(0,l));return[s];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"logical":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Equal":return[i.equal(ise("a",e,t,n),ise("b",e,t,n))];case"NotEqual":return[i.notEqual(ise("a",e,t,n),ise("b",e,t,n))];case"Greater":return[i.greater(ise("a",e,t,n),ise("b",e,t,n))];case"GreaterEqual":return[i.greaterEqual(ise("a",e,t,n),ise("b",e,t,n))];case"Less":return[i.less(ise("a",e,t,n),ise("b",e,t,n))];case"LessEqual":return[i.lessEqual(ise("a",e,t,n),ise("b",e,t,n))];case"LogicalAnd":return[i.logicalAnd(ise("a",e,t,n),ise("b",e,t,n))];case"LogicalNot":return[i.logicalNot(ise("a",e,t,n))];case"LogicalOr":return[i.logicalOr(ise("a",e,t,n),ise("b",e,t,n))];case"Select":case"SelectV2":return[i.where(ise("condition",e,t,n),ise("a",e,t,n),ise("b",e,t,n))];case"BitwiseAnd":return[i.bitwiseAnd(ise("a",e,t,n),ise("b",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"matrices":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[i.matMul(ise("a",e,t,n),ise("b",e,t,n),ise("transposeA",e,t,n),ise("transposeB",e,t,n))];case"Einsum":return[i.einsum(ise("equation",e,t,n),...ise("tensors",e,t,n))];case"Transpose":return[i.transpose(ise("x",e,t,n),ise("perm",e,t,n))];case"_FusedMatMul":const[r,s]=ise("fusedOps",e,t,n),o="biasadd"===r,a="prelu"===s,l=ise("numArgs",e,t,n),u=ise("leakyreluAlpha",e,t,n);if(o){if(a&&2!==l)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!a&&1!==l)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}const[c,d]=ise("args",e,t,n);return[i.fused.matMul({a:ise("a",e,t,n),b:ise("b",e,t,n),transposeA:ise("transposeA",e,t,n),transposeB:ise("transposeB",e,t,n),bias:c,activation:s,preluActivationWeights:d,leakyreluAlpha:u})];case"MatrixBandPart":return[i.linalg.bandPart(ise("a",e,t,n),ise("numLower",e,t,n),ise("numUpper",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"normalization":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"EuclideanNorm":return[i.euclideanNorm(ise("x",e,t,n),ise("axis",e,t,n),ise("keepDims",e,t,n))];case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[i.batchNorm(ise("x",e,t,n),ise("mean",e,t,n),ise("variance",e,t,n),ise("offset",e,t,n),ise("scale",e,t,n),ise("epsilon",e,t,n))];case"LRN":return[i.localResponseNormalization(ise("x",e,t,n),ise("radius",e,t,n),ise("bias",e,t,n),ise("alpha",e,t,n),ise("beta",e,t,n))];case"Softmax":return[i.softmax(ise("x",e,t,n))];case"LogSoftmax":return[i.logSoftmax(ise("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"ragged":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"RaggedGather":{const{outputNestedSplits:r,outputDenseValues:s}=i.raggedGather(ise("paramsNestedSplits",e,t,n),ise("paramsDenseValues",e,t,n),ise("indices",e,t,n),ise("outputRaggedRank",e,t,n));return r.concat(s)}case"RaggedRange":{const{rtNestedSplits:r,rtDenseValues:s}=i.raggedRange(ise("starts",e,t,n),ise("limits",e,t,n),ise("splits",e,t,n));return[r,s]}case"RaggedTensorToTensor":return[i.raggedTensorToTensor(ise("shape",e,t,n),ise("values",e,t,n),ise("defaultValue",e,t,n),ise("rowPartitionTensors",e,t,n),ise("rowPartitionTypes",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"reduction":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Max":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.max(ise("x",e,t,n),r,s)]}case"Mean":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.mean(ise("x",e,t,n),r,s)]}case"Min":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.min(ise("x",e,t,n),r,s)]}case"Sum":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.sum(ise("x",e,t,n),r,s)]}case"All":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.all(ise("x",e,t,n),r,s)]}case"Any":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.any(ise("x",e,t,n),r,s)]}case"ArgMax":{const r=ise("axis",e,t,n);return[i.argMax(ise("x",e,t,n),r)]}case"ArgMin":{const r=ise("axis",e,t,n);return[i.argMin(ise("x",e,t,n),r)]}case"Prod":{const r=ise("axis",e,t,n),s=ise("keepDims",e,t,n);return[i.prod(ise("x",e,t,n),r,s)]}case"Cumprod":{const r=ise("axis",e,t,n),s=ise("exclusive",e,t,n),o=ise("reverse",e,t,n);return[i.cumprod(ise("x",e,t,n),r,s,o)]}case"Cumsum":{const r=ise("axis",e,t,n),s=ise("exclusive",e,t,n),o=ise("reverse",e,t,n);return[i.cumsum(ise("x",e,t,n),r,s,o)]}case"Bincount":const r=ise("x",e,t,n),s=ise("weights",e,t,n),o=ise("size",e,t,n);return[i.bincount(r,s,o)];case"DenseBincount":{const r=ise("x",e,t,n),s=ise("weights",e,t,n),o=ise("size",e,t,n),a=ise("binaryOutput",e,t,n);return[i.denseBincount(r,s,o,a)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"slice_join":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"ConcatV2":case"Concat":{const r=ise("n",e,t,n),s=ise("axis",e,t,n);let o=ise("tensors",e,t,n);return o=o.slice(0,r),[i.concat(o,s)]}case"Gather":{const r=ise("x",e,t,n),s=ise("indices",e,t,n);return[i.gather(r,i.cast(s,"int32"),0)]}case"GatherV2":{const r=ise("axis",e,t,n),s=ise("batchDims",e,t,n),o=ise("x",e,t,n),a=ise("indices",e,t,n);return[i.gather(o,i.cast(a,"int32"),r,s)]}case"Reverse":{const r=ise("dims",e,t,n),s=[];for(let e=0;e<r.length;e++)r[e]&&s.push(e);const o=ise("x",e,t,n);return[i.reverse(o,s)]}case"ReverseV2":{const r=ise("axis",e,t,n),s=ise("x",e,t,n);return[i.reverse(s,r)]}case"Slice":{const r=ise("begin",e,t,n),s=ise("size",e,t,n);return[i.slice(ise("x",e,t,n),r,s)]}case"StridedSlice":{const r=ise("begin",e,t,n),s=ise("end",e,t,n),o=ise("strides",e,t,n),a=ise("beginMask",e,t,n),l=ise("endMask",e,t,n),u=ise("ellipsisMask",e,t,n),c=ise("newAxisMask",e,t,n),d=ise("shrinkAxisMask",e,t,n),h=ise("x",e,t,n);return[i.stridedSlice(h,r,s,o,a,l,u,c,d)]}case"Pack":return(0,v3.tidy)(()=>{const r=ise("axis",e,t,n),s=ise("tensors",e,t,n),o=s[0].shape,a=i.squeeze(s[0]).shape,l=s.map(e=>{const t=v3.util.arraysEqual(e.shape,o);if(!t&&!v3.util.arraysEqual(i.squeeze(e).shape,a))throw new Error("the input tensors shape does not match");return t?e:i.reshape(e,o)});return[i.stack(l,r)]});case"Unpack":{const r=ise("axis",e,t,n),s=ise("tensor",e,t,n);return i.unstack(s,r)}case"Tile":{const r=ise("reps",e,t,n);return[i.tile(ise("x",e,t,n),r)]}case"Split":case"SplitV":{const r=ise("axis",e,t,n),s=ise("numOrSizeSplits",e,t,n),o=ise("x",e,t,n);return i.split(o,s,r)}case"ScatterNd":{const r=ise("indices",e,t,n),s=ise("values",e,t,n),o=ise("shape",e,t,n);return[i.scatterND(r,s,o)]}case"GatherNd":{const r=ise("x",e,t,n),s=ise("indices",e,t,n);return[i.gatherND(r,s)]}case"SparseToDense":{const r=ise("sparseIndices",e,t,n),s=ise("outputShape",e,t,n),o=ise("sparseValues",e,t,n),a=ise("defaultValue",e,t,n);return[i.sparseToDense(r,o,s,o.dtype===a.dtype?a:i.cast(a,o.dtype))]}case"TensorScatterUpdate":{const r=ise("indices",e,t,n),s=ise("values",e,t,n),o=ise("tensor",e,t,n);return[i.tensorScatterUpdate(o,r,s)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"sparse":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"SparseFillEmptyRows":{const{outputIndices:r,outputValues:s,emptyRowIndicator:o,reverseIndexMap:a}=i.sparse.sparseFillEmptyRows(ise("indices",e,t,n),ise("values",e,t,n),ise("denseShape",e,t,n),ise("defaultValue",e,t,n));return[r,s,o,a]}case"SparseReshape":{const{outputIndices:r,outputShape:s}=i.sparse.sparseReshape(ise("inputIndices",e,t,n),ise("inputShape",e,t,n),ise("newShape",e,t,n));return[r,s]}case"SparseSegmentMean":return[i.sparse.sparseSegmentMean(ise("data",e,t,n),ise("indices",e,t,n),ise("segmentIds",e,t,n))];case"SparseSegmentSum":return[i.sparse.sparseSegmentSum(ise("data",e,t,n),ise("indices",e,t,n),ise("segmentIds",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"spectral":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"FFT":return[i.fft(ise("x",e,t,n))];case"IFFT":return[i.ifft(ise("x",e,t,n))];case"RFFT":return[i.rfft(ise("x",e,t,n))];case"IRFFT":return[i.irfft(ise("x",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"string":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"StaticRegexReplace":return[i.string.staticRegexReplace(ise("input",e,t,n),ise("pattern",e,t,n),ise("rewrite",e,t,n),ise("replaceGlobal",e,t,n))];case"StringNGrams":{const{nGrams:r,nGramsSplits:s}=i.string.stringNGrams(ise("data",e,t,n),ise("dataSplits",e,t,n),ise("separator",e,t,n),ise("nGramWidths",e,t,n),ise("leftPad",e,t,n),ise("rightPad",e,t,n),ise("padWidth",e,t,n),ise("preserveShortSequences",e,t,n));return[r,s]}case"StringSplit":{const{indices:r,values:s,shape:o}=i.string.stringSplit(ise("input",e,t,n),ise("delimiter",e,t,n),ise("skipEmpty",e,t,n));return[r,s,o]}case"StringToHashBucketFast":return[i.string.stringToHashBucketFast(ise("input",e,t,n),ise("numBuckets",e,t,n))];default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n));case"transformation":return r(()=>((e,t,n,i=Fe)=>{switch(e.op){case"Cast":return[i.cast(ise("x",e,t,n),ise("dtype",e,t,n))];case"ExpandDims":{const r=ise("axis",e,t,n);return[i.expandDims(ise("x",e,t,n),r)]}case"Squeeze":{const r=ise("axis",e,t,n);return[i.squeeze(ise("x",e,t,n),r)]}case"Reshape":return[i.reshape(ise("x",e,t,n),ise("shape",e,t,n))];case"EnsureShape":return[i.ensureShape(ise("x",e,t,n),ise("shape",e,t,n))];case"MirrorPad":return[i.mirrorPad(ise("x",e,t,n),ise("padding",e,t,n),ise("mode",e,t,n))];case"PadV2":case"Pad":return[i.pad(ise("x",e,t,n),ise("padding",e,t,n),ise("constantValue",e,t,n))];case"SpaceToBatchND":{const r=ise("blockShape",e,t,n),s=ise("paddings",e,t,n);return[i.spaceToBatchND(ise("x",e,t,n),r,s)]}case"BatchToSpaceND":{const r=ise("blockShape",e,t,n),s=ise("crops",e,t,n);return[i.batchToSpaceND(ise("x",e,t,n),r,s)]}case"DepthToSpace":{const r=ise("blockSize",e,t,n),s=ise("dataFormat",e,t,n).toUpperCase();return[i.depthToSpace(ise("x",e,t,n),r,s)]}case"BroadcastTo":return[i.broadcastTo(ise("x",e,t,n),ise("shape",e,t,n))];case"BroadcastArgs":return[i.broadcastArgs(ise("s0",e,t,n),ise("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,i)=>{switch(e.op){case"HashTable":case"HashTableV2":{const r=i.getHashTableHandleByName(e.name);if(null!=r)return[r];{const r=ise("keyDType",e,t,n),s=ise("valueDType",e,t,n),o=new noe(r,s);return i.addHashTable(e.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{const r=ise("tableHandle",e,t,n,i),s=ise("keys",e,t,n),o=ise("values",e,t,n),a=i.getHashTableById(r.id);return[await a.import(s,o)]}case"LookupTableFind":case"LookupTableFindV2":{const r=ise("tableHandle",e,t,n,i),s=ise("keys",e,t,n),o=ise("defaultValue",e,t,n),a=i.getHashTableById(r.id);return[await a.find(s,o)]}case"LookupTableSize":case"LookupTableSizeV2":{const r=ise("tableHandle",e,t,n,i);return[i.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}})(e,t,n,i);case"custom":const s=tse(e.op);if(s&&s.customExecutor)return s.customExecutor(new Gse(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 v3.util.isPromise(s)?s.then(e=>[].concat(e)):[].concat(s)}class roe{constructor(e={},t={},n={},i={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=n,this.functionMap=i,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;t<this.contexts.length-1;t++){const n=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(n))}e.push(""),this._currentContextIds=e}contextIdforContexts(e){return e?e.map(e=>0===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)}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function soe(e,t,n,i){const r=new Set,s=[];let o=null,a=null;const l=new Set,u=new Set(Object.keys(e).map(e=>lse(e)[0]));i=i||[];const c=new Set(i.map(e=>lse(e.name)[0])),d=[...t];for(;d.length>0;){const e=d.pop();(doe(e)||hoe(e)||poe(e))&&null==o&&(o=e,a=o.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),d.push(e))}):s.push(e.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:o,syncInputs:a}}function ooe(e,t){const{usedNodes:n,inputs:i}=t,r=Object.keys(i).map(e=>lse(e)[0]).map(t=>e.nodes[t]),s=e.initNodes||[],o=e=>n.has("string"==typeof e?e:e.name);function a(e){return[...new Map(e.map(e=>[e.name,e])).values()]}const l=a([...r,...e.weights,...s]).filter(o),u=a([...l,...Object.values(e.nodes)]).filter(o),c=new Map(u.map(e=>[e.name,e])),d={};for(const e of u){d[e.name]=d[e.name]||0;for(const t of e.children)o(t)||(d[t.name]=Number.POSITIVE_INFINITY),d[t.name]=(d[t.name]||0)+1}const h=Object.entries(d).filter(([,e])=>0===e).map(([e])=>e),p=[...h];for(;h.length>0;){const e=h.pop(),t=c.get(e);for(const e of t.children.filter(o))0===--d[e.name]&&(p.push(e.name),h.push(e.name))}const f=function(e,t){const n=new Map(e.map(e=>[e.name,e])),i=t.map(e=>e.name),r=new Set(i);for(;i.length>0;){const e=i.pop(),t=n.get(e);for(const e of t.children)n.has(e.name)&&!r.has(e.name)&&(r.add(e.name),i.push(e.name))}const s=e.filter(e=>r.has(e.name));return s}(p.map(e=>c.get(e)),l);return function(e,t){const n=new Map(e.map((e,t)=>[e.name,t])),i=new Set(t.map(e=>e.name)),r=e=>i.has("string"==typeof e?e:e.name),s=new Set(e.map(e=>e.name)),o=e=>s.has("string"==typeof e?e:e.name);for(const t of e){for(const e of t.children.filter(o)){if(!n.has(e.name))throw new aoe(`Child ${e.name} of node ${t.name} is unreachable.`);if(n.get(t.name)>n.get(e.name))throw new aoe(`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 aoe(`Input ${e.name} of node ${t.name} is unreachable.`);if(n.get(e.name)>n.get(t.name))throw new aoe(`Node ${t.name} is scheduled to run before its input ${e.name}.`)}}}(f,l),f}class aoe extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}}const loe=new Set(["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"]),uoe=new Set(["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"]),coe=new Set(["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"]);function doe(e){return loe.has(e.op)}function hoe(e){return uoe.has(e.op)}function poe(e){return coe.has(e.op)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class foe{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 foe(e.functions[t],this)})}getCompilationKey(e,t){const n=e.map(e=>e.name).sort(),i=t.map(e=>e.name).sort();return n.join(this.SEPARATOR)+"--"+i.join(this.SEPARATOR)}compile(e,t){const n=soe(e,t,this.weightMap,this._initNodes),{missingInputs:i,dynamicNode:r,syncInputs:s}=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 [${s}]`);if(i.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: [${i}]`)}const o=ooe(this.graph,n),a=function(e){const t=new Map(e.map((e,t)=>[e.name,t])),n=Number.MAX_SAFE_INTEGER,i=e.map((e,t)=>doe(e)?n:t),r=e=>{const n=i[t.get(e.name)];return null==n?-1:n},s=e.map((e,t)=>e.children.map(r).reduce((e,t)=>Math.max(e,t),i[t])),o=new Map;for(let t=0;t<e.length;++t){const i=s[t];if(i===n)continue;const r=e[t],a=e[i];o.has(a.name)||o.set(a.name,[]),o.get(a.name).push(r)}return o}(o);return{orderedNodes:o,nodeLiveUntilMap:a}}cloneAndKeepTensor(e){if(null==e)return null;const t=e.clone();return(0,v3.keep)(t),t}cloneTensorList(e){if(!e)return null;return e.map(e=>this.cloneAndKeepTensor(e))}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 i=n.map(e=>this.graph.nodes[lse(e)[0]]),r=t.map(e=>lse(e)[0]),s=new Set(r);let o=r.map(e=>this.graph.nodes[e]);0===o.length&&(o=this._outputs);const a=this.getCompilationKey(i,o);let l=this.compiledMap.get(a);null==l&&(l=this.compile(e,o),this.compiledMap.set(a,l));try{this.keepIntermediateTensors=(0,v3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const u={},c={};return(0,v3.tidy)(()=>{const n=new roe(this.weightMap,u,c,this.functionExecutorMap,this.parseNodeNameCache),i=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(t=>{const[r,s]=lse(t,n),o=[];o[s]=e[t],i[r]=o,this.keepIntermediateTensors&&(this.clonedTensorsMap[r]=this.cloneTensorList(o))});const r=this.getFrozenTensorIds(i),{orderedNodes:o,nodeLiveUntilMap:a}=l;for(const e of o){if(i[e.name])continue;const t=ioe(e,i,n,this._resourceManager);if(v3.util.isPromise(t))throw new Error(`The execution of the op '${e.op}' returned a promise. Please use model.executeAsync() instead.`);i[e.name]=t,this.keepIntermediateTensors&&(this.clonedTensorsMap[e.name]=this.cloneTensorList(t)),this.checkTensorForDisposalWithNodeLiveUntilInfo(e,i,n,r,s,a.get(e.name))}return null==this.parent&&n.dispose(r),t.map(e=>rse(e,i,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,i,r,s,o){if(!doe(t)&&!s.has(e)){for(const i of n[e])null!=i&&(o[i.id]=(o[i.id]||0)+t.children.length);for(const e of t.inputs){if(doe(e))continue;const t=sse(e.name,n,i);if(null!=t)for(const e of t){if(!e||e.kept||r.has(e.id))continue;const t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,n,i,r,s){function o(e){return doe(e)||r.has(e.name)}if(!doe(e)&&null!=s)for(const e of s){if(o(e))continue;const r=sse(e.name,t,n);for(const e of r)!e||e.kept||i.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,i={},r={}){this.disposeIntermediateTensors(),n||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=(0,v3.env)().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(e){this.keepIntermediateTensors=!1,console.warn(e.message)}const s=new roe(this.weightMap,i,r,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));const o=await this.executeWithControlFlow(e,s,t,n),a=t.map(e=>rse(e,o,s)),l=a.map(e=>e.id),u=Object.keys(e).map(t=>e[t].id),c=new Set([...l,...u,...this.weightIds]);return Object.values(o).forEach(e=>{e.forEach(e=>{!e||e.isDisposed||c.has(e.id)||e.dispose()})}),null==this.parent&&s.dispose(c),a}async executeFunctionAsync(e,t,n){const i=e.reduce((e,t,n)=>(e[this.inputs[n].name]=t,e),{});return this._executeAsync(i,this.outputNodes,!0,t,n)}async executeWithControlFlow(e,t,n,i){const r=Object.keys(e),s=r.map(e=>this.graph.nodes[lse(e)[0]]),o=n.map(e=>lse(e)[0]),a=new Set(o);let l=o.map(e=>this.graph.nodes[e]);0===l.length&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:d,syncInputs:h}=soe(e,l,this.weightMap,this._initNodes),p=[...s,...this.graph.weights,...this._initNodes||[]].map(e=>({node:e,contexts:t.currentContext})),f=Object.assign({},this.weightMap);Object.keys(e).forEach(t=>{const[n,i]=lse(t),r=[];r[i]=e[t],f[n]=r});const m={},g=this.getFrozenTensorIds(f),_={};for(;p.length>0;){const e=this.processStack(s,p,t,f,_,g,a,m,u);await Promise.all(e)}null!=d||i||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const y=l.filter(e=>!doe(e)&&!rse(e.name,f,t)).map(e=>e.name);if(y.length>0){let e="";throw null!=d&&(e=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${y}] from the provided inputs [${r}]. Consider providing the following inputs: [${c}]. ${e}`)}return f}processStack(e,t,n,i,r,s,o,a,l){const u=[];for(;t.length>0;){const e=t.pop();n.currentContext=e.contexts;let c="";if("Enter"===e.node.op&&ise("isConstant",e.node,i,n)&&([c]=ose(e.node.name,n)),null==i[e.node.name]){const d=ioe(e.node,i,n,this._resourceManager);c||([c]=ose(e.node.name,n));const h=n.currentContext;v3.util.isPromise(d)?u.push(d.then(u=>(i[c]=u,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(u)),n.currentContext=h,this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l),u))):(i[c]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[c]=this.cloneTensorList(d)),this.checkTensorForDisposal(c,e.node,i,n,s,o,a),this.processChildNodes(e.node,t,n,i,r,l))}else this.processChildNodes(e.node,t,n,i,r,l)}return u}processChildNodes(e,t,n,i,r,s){e.children.forEach(e=>{const[o]=ose(e.name,n);!r[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some(e=>!!rse(e,i,n))&&(r[o]=!0,t.push({contexts:n.currentContext,node:e})):e.inputNames.every(e=>!!rse(e,i,n))&&(r[o]=!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],[i]=lse(t),r=this.graph.nodes[i];if(r.attrParams.shape&&r.attrParams.shape.value){const e=r.attrParams.shape.value,t=e.length===n.shape.length&&n.shape.every((t,n)=>-1===e[n]||e[n]===t);v3.util.assert(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&&v3.util.assert(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 i={};for(const r in e){const s=null===(n=null===(t=this._signature)||void 0===t?void 0:t.inputs)||void 0===n?void 0:n[r];null!=s?i[s.name]=e[r]:i[r]=e[r]}return i}checkInputs(e){const t=Object.keys(e).filter(e=>{const[t]=lse(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 i=null===(n=null===(t=this._signature)||void 0===t?void 0:t.outputs)||void 0===n?void 0:n[e];return null!=i?i.name:e},{})}checkOutputs(e){e.forEach(e=>{const[t]=lse(e);if(!this.graph.nodes[t])throw new Error(`The output '${e}' is not found in the graph`)})}}class moe{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]}}var goe=__webpack_require__(77084);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const _oe="?tfjs-format=file",yoe="model.json";class voe{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(e,t={},n=v3.io){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=n,null==t&&(this.loadOptions={}),this.resourceManager=new moe}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 v3.util.isPromise(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(0,goe.s5)(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;const n=this.artifacts.modelTopology;let i=this.artifacts.signature;if(null!=this.artifacts.userDefinedMetadata){const e=this.artifacts.userDefinedMetadata;null!=e.signature&&(i=e.signature),null!=e.structuredOutputKeys&&(this.structuredOutputKeys=e.structuredOutputKeys)}if(this.signature=i,this.version=`${n.versions.producer}.${n.versions.minConsumer}`,this.executor=new foe(Mse.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=Mse.Instance.transformGraph(e.modelInitializer);this.initializer=new foe(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=e instanceof v3.Tensor?[e]:e,n={};return t.forEach((e,t)=>n[this.structuredOutputKeys[t]]=e),n}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 v3.Tensor||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 i=n[t];null!=i.resourceId&&(e[t]=this.resourceIdToCapturedInput[i.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 i=0;return this.inputNodes.reduce((t,n)=>{var r,s,o;const a=null===(o=null===(s=null===(r=this.signature)||void 0===r?void 0:r.inputs)||void 0===s?void 0:s[n])||void 0===o?void 0:o.resourceId;return t[n]=null!=a?this.resourceIdToCapturedInput[a]:e[i++],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 i=0;i<n.length;i++){const r=t[n[i]];this.resourceIdToCapturedInput[r.resourceId]=e[i]}}}execute(e,t){null==this.resourceIdToCapturedInput&&this.setResourceIdToCapturedInput(this.executeInitializerGraph()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);const n=this.executor.execute(e,t);return n.length>1?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&&(0,v3.dispose)(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}}async function boe(e,t={},n=v3.io){if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");null==t&&(t={}),t.fromTFHub&&"string"==typeof e&&(e=function(e){e.endsWith("/")||(e+="/");return`${e}${yoe}${_oe}`}(e));const i=new voe(e,t,n);return await i.load(),i}function Toe(e){if(null==e)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){const[n,i]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!(i&&i instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");const r=v3.io.getWeightSpecs(n.weightsManifest),s=v3.io.getModelArtifactsForJSONSync(n,r,i);t=v3.io.fromMemorySync(s)}else if("load"in e)t=e;else{if(!("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e))throw new Error("Unknown model format");t=v3.io.fromMemorySync(e)}const n=new voe(t);return n.load(),n}
/** @license See the LICENSE file. */
const xoe="4.22.0";
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var Eoe,woe=__webpack_require__(7391);function Ioe(e,t,n=new Map,i=new Set){if(null==e)return null;if("function"==typeof Blob&&e instanceof Blob)return e.slice();if(i.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(Moe(e)){const r=Array.isArray(e)?[]:{};i.add(e);for(const s in e){const o=Ioe(e[s],t,n,i);r[s]=o}return i.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 Aoe(e,t=Coe){return Soe(e,t)}function Soe(e,t,n=new Set){const i=e[0];if(n.has(i))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(Moe(i)){const r=Array.isArray(i)?[]:{};n.add(i);for(const s in i){const i=Soe(e.map(e=>e[s]),t,n);r[s]=i}return n.delete(i),r}throw new Error(`Can't recurse into non-iterable type: ${i}`)}return r.value}function Coe(e){return null===e?null:Moe(e[0])?{value:null,recurse:!0}:{value:e,recurse:!1}}async function Ooe(e,t){const n=new Map;Ioe(e,t,n);for(const e of Array.from(n.keys())){const t=n.get(e);if(v3.util.isPromise(t)){const i=await t;n.set(e,i)}}return Ioe(e,t,n)}function Moe(e){let t=!1;if(v3.env().get("IS_BROWSER"))t=e instanceof TextDecoder;else{const{StringDecoder:n}=__webpack_require__(80551);t=e instanceof n}return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof v3.Tensor)&&!(e instanceof Promise)&&!t)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
function koe(e){
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
return function(e,t){return Ioe(e,t)}(e,Roe)}function Roe(e){return e instanceof v3.Tensor?{value:e.clone(),recurse:!1}:Moe(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class Noe{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}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class Doe extends Noe{constructor(){super(Doe.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<n;e++)t[e]=this.get(this.wrap(this.begin+e));this.data=t,this.capacity=e,this.doubledCapacity=2*this.capacity,this.begin=0,this.end=n}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
function Foe(e){return new $oe(e)}function Loe(e){return new Uoe(e)}function Poe(e,t){return new Zoe(e,t)}Doe.INITIAL_CAPACITY=32;class Boe{async toArray(){const e=[];let t=await this.next();for(;!t.done;)e.push(t.value),t=await this.next();return e}async toArrayForTest(){const e=this.prefetch(100),t=[];let n=await e.next();for(;!n.done;)t.push(n.value),n=await e.next();return t}async resolveFully(){let e=await this.next();for(;!e.done;)e=await this.next()}async resolveWhile(e){let t=await this.next(),n=e(t.value);for(;!t.done&&n;)t=await this.next(),n=e(t.value)}handleErrors(e){return new Woe(this,e)}filter(e){return new Goe(this,e)}map(e){return new Hoe(this,e)}mapAsync(e){return new Xoe(this,e)}serialMapAsync(e){return new Xoe(this,e).serial()}flatmap(e){return new Koe(this,e)}async forEachAsync(e){return this.map(e).resolveFully()}async serialForEach(e){return this.serialMapAsync(e).resolveWhile(e=>!0===e)}rowMajorBatch(e,t=!0){return new Yoe(this,e,t)}columnMajorBatch(e,t=!0,n=Coe){return this.rowMajorBatch(e,t).map(e=>Aoe(e,n))}concatenate(e,t){return new Zoe(Foe([this,e]),t)}take(e){return e<0||null==e?this:new joe(this,e)}skip(e){return e<0||null==e?this:new zoe(this,e)}prefetch(e){return new Joe(this,e)}shuffle(e,t){return new eae(this,e,t)}serial(){return new Voe(this)}}class $oe extends Boe{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:koe(e),done:!1}}}class Uoe extends Boe{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 Voe extends Boe{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 zoe extends Boe{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++<this.maxCount;){const e=await this.upstream.next();if(e.done)return e;v3.dispose(e.value)}return this.upstream.next()}}class joe extends Boe{constructor(e,t){super(),this.upstream=e,this.maxCount=t,this.count=0}summary(){return`${this.upstream.summary()} -> Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class Yoe extends Boe{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.length<this.batchSize;){const t=await this.upstream.next();if(t.done)return this.enableSmallLastBatch&&e.length>0?{value:e,done:!1}:{value:null,done:!0};e.push(t.value)}return{value:e,done:!1}}}class Goe extends Boe{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;v3.dispose(e.value)}}}class Hoe extends Boe{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=v3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=v3.tensor_util.getTensorsInContainer(n);for(const e of t)v3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class Woe extends Boe{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 Xoe extends Boe{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=v3.tensor_util.getTensorsInContainer(e.value),n=await this.transform(e.value),i=v3.tensor_util.getTensorsInContainer(n);for(const e of t)v3.tensor_util.isTensorInList(e,i)||e.dispose();return{value:n,done:!1}}}class qoe extends Boe{constructor(){super(),this.outputQueue=new Doe,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 Koe extends qoe{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=v3.tensor_util.getTensorsInContainer(e.value),n=this.transform(e.value),i=v3.tensor_util.getTensorsInContainer(n);this.outputQueue.pushAll(n);for(const e of t)v3.tensor_util.isTensorInList(e,i)||e.dispose();return!0}}class Zoe extends Boe{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}}!function(e){e[e.FAIL=0]="FAIL",e[e.SHORTEST=1]="SHORTEST",e[e.LONGEST=2]="LONGEST"}(Eoe||(Eoe={}));class Qoe extends Boe{constructor(e,t=Eoe.FAIL){super(),this.iterators=e,this.mismatchMode=t,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(e){await e;let t=0,n=0;const i=await Ooe(this.iterators,function(e){if(e instanceof Boe){return{value:e.next().then(e=>(t++,e.done&&n++,e.value)),recurse:!1}}return{value:null,recurse:!0}});if(t===n)return{value:null,done:!0};if(n>0)switch(this.mismatchMode){case Eoe.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case Eoe.SHORTEST:return{value:null,done:!0};case Eoe.LONGEST:}return this.count++,{value:i,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class Joe extends Boe{constructor(e,t){super(),this.upstream=e,this.bufferSize=t,this.buffer=new Noe(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 eae extends Joe{constructor(e,t,n){super(e,t),this.upstream=e,this.windowSize=t,this.upstreamExhausted=!1,this.random=woe.alea(n||v3.util.now().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}}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class tae{constructor(){this.size=null}batch(e,t=!0){const n=this;let i;return v3.util.assert(e>0,()=>`batchSize needs to be positive, but it is\n ${e}`),i=this.size===1/0||null==this.size?this.size:t?Math.ceil(this.size/e):Math.floor(this.size/e),nae(async()=>(await n.iterator()).columnMajorBatch(e,t,sae),i)}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,nae(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,nae(async()=>(await t.iterator()).filter(t=>v3.tidy(()=>e(t))),n)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return nae(async()=>(await t.iterator()).map(t=>v3.tidy(()=>e(t))),this.size)}mapAsync(e){const t=this;return nae(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 nae(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,nae(async()=>Poe(Loe(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<e||void 0===e||e<0)?0:null,nae(async()=>(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 i=this,r=woe.alea(t||v3.util.now().toString());return nae(async()=>{let t=r.int32();return n&&(t+=r.int32()),(await i.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,nae(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 nae(e,t=null){return new class extends tae{constructor(){super(...arguments),this.size=t}async iterator(){return e()}}}function iae(e){return nae(async()=>Foe(e),e.length)}function rae(e){if(!Moe(e))throw new Error("The argument to zip() must be an object or array.");let t;if(Array.isArray(e))for(let n=0;n<e.length;n++)t=null==t?e[n].size:Math.min(t,e[n].size);else if(e instanceof Object)for(const n in e)t=null==t?e[n].size:Math.min(t,e[n].size);return nae(async()=>function(e,t=Eoe.FAIL){return new Qoe(e,t)}(await Ooe(e,e=>{if(e instanceof tae)return{value:e.iterator(),recurse:!1};if(Moe(e))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")}),Eoe.SHORTEST),t)}function sae(e){if(null===e)return null;const t=e[0];if(null==(n=t)||null===(i=n)||"object"!=typeof i&&"function"!=typeof i||Array.isArray(n)||"object"==typeof n&&n instanceof v3.Tensor||v3.util.isTypedArray(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof v3.Tensor?v3.stack(e):v3.tensor(e)}(e),recurse:!1}}var n,i;return{value:null,recurse:!0}}tae.MAX_BUFFER_SIZE=1e4;
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class oae extends tae{constructor(e){super(),this.input=e}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map(e=>(e.endsWith("\r")&&(e=e.slice(0,-1)),e))}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
const aae='"',lae=Symbol("out"),uae=Symbol("field"),cae=Symbol("quote"),dae=Symbol("quoteafterquote"),hae=Symbol("quoteinquote");class pae extends tae{async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&v3.util.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);const t=this.fullColumnNames.reduce((e,t)=>(e[t]=e[t]+1||1,e),{}),n=Object.keys(t).filter(e=>t[e]>1);if(v3.util.assert(0===n.length,()=>"Duplicate column names found: "+n.toString()),this.columnConfigs)for(const e of Object.keys(this.columnConfigs)){if(-1===this.fullColumnNames.indexOf(e))throw new Error('The key "'+e+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const e=await this.base.iterator(),t=await e.next();if(t.done)throw new Error("No data was found for CSV parsing.");const n=t.value;return this.parseRow(n,!1)}return null}constructor(e,t){super(),this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new oae(e),t||(t={}),this.hasHeader=!1!==t.hasHeader,this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(v3.util.assert(null==t.delimiter,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(e=>this.makeDataElement(e))}makeDataElement(e){const t=this.parseRow(e),n={},i={};for(let r=0;r<this.fullColumnNames.length;r++){const s=this.fullColumnNames[r],o=this.columnConfigs?this.columnConfigs[s]:null;if(!this.configuredColumnsOnly||o){const a=t[r];let l=null;if(""===a)if(o&&void 0!==o.default)l=o.default;else{if(o&&(o.required||o.isLabel))throw new Error(`Required column ${s} is empty in this line: ${e}`);l=void 0}else{const e=Number(a);if(isNaN(e))l=o&&"bool"===o.dtype?this.getBoolean(a):a;else if(o&&o.dtype)switch(o.dtype){case"float32":default:l=e;break;case"int32":l=Math.floor(e);break;case"bool":l=this.getBoolean(a)}else l=e}o&&o.isLabel?i[s]=l:n[s]=l}}return 0===Object.keys(i).length?n:{xs:n,ys:i}}getBoolean(e){return"1"===e||"true"===e.toLowerCase()?1:0}parseRow(e,t=!0){const n=[];let i=0;const r=e.length;let s=lae;for(let t=0;t<r;t++)switch(s){case lae:switch(e.charAt(t)){case aae:i=t+1,s=cae;break;case this.delimiter:if(i=t+1," "===this.delimiter&&this.delimWhitespace)break;n.push(""),s=lae;break;default:s=uae,i=t}break;case uae:if(e.charAt(t)===this.delimiter)n.push(e.substring(i,t)),s=lae,i=t+1;break;case cae:if(e.charAt(t)===aae)s=dae;break;case dae:switch(e.charAt(t)){case this.delimiter:n.push(e.substring(i,t-1)),s=lae,i=t+1;break;case aae:s=cae;break;default:s=hae}break;case hae:if(e.charAt(t)===aae)s=cae}if(s===dae?n.push(e.substring(i,r-1)):n.push(e.substring(i)),t&&n.length!==this.fullColumnNames.length)throw new Error(`Invalid row in csv file. Should have ${this.fullColumnNames.length} elements in a row, but got ${n}`);return n}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class fae extends Boe{constructor(e){super(),this.microphoneConfig=e,this.isClosed=!1,this.fftSize=e.fftSize||1024;const t=Math.log2(this.fftSize);if(this.fftSize<0||t<4||t>14||!Number.isInteger(t))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=e.numFramesPerSpectrogram||43,this.sampleRateHz=e.sampleRateHz,this.columnTruncateLength=e.columnTruncateLength||this.fftSize,this.audioTrackConstraints=e.audioTrackConstraints,this.smoothingTimeConstant=e.smoothingTimeConstant||0,this.includeSpectrogram=!1!==e.includeSpectrogram,this.includeWaveform=!0===e.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(e={}){if(!(0,v3.env)().get("IS_BROWSER"))throw new Error("microphone API is only supported in browser environment.");const t=new fae(e);return await t.start(),t}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(e){throw new Error(`Error thrown while initializing video stream: ${e.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const e=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new e,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const t=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,t.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let e,t;const n=await this.getAudioData();if(this.includeSpectrogram){const t=this.flattenQueue(n.freqDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const e=this.flattenQueue(n.timeDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:e,waveform:t},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const e=[],t=[];let n=0;return new Promise(i=>{const r=setInterval(()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&i({freqDataQueue:e,timeDataQueue:t}),e.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),t.push(this.timeData.slice())),++n===this.numFrames&&(clearInterval(r),i({freqDataQueue:e,timeDataQueue:t}))},this.fftSize/this.sampleRateHz*1e3)})}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(e){const t=e[0].length,n=new Float32Array(e.length*t);return e.forEach((e,i)=>n.set(e,i*t)),n}getTensorFromAudioDataArray(e,t){const n=new Float32Array(v3.util.sizeFromShape(t));return n.set(e,n.length-e.length),(0,v3.tensor)(n,t)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class mae extends Boe{constructor(e,t){if(super(),this.webcamVideoElement=e,this.webcamConfig=t,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=(0,v3.tensor1d)([0],"int32"),this.webcamConfig.centerCrop){const e=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,t=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,n=(1-e)/2,i=(1-t)/2,r=n+e,s=t+i;this.cropBox=(0,v3.tensor2d)([i,n,s,r],[1,4])}else this.cropBox=(0,v3.tensor2d)([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(e,t={}){if(!(0,v3.env)().get("IS_BROWSER"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!e){if(e=document.createElement("video"),!t.resizeWidth||!t.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");e.width=t.resizeWidth,e.height=t.resizeHeight}const n=new mae(e,t);return await n.start(),n}async start(){this.webcamConfig.facingMode&&v3.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(e){throw e.message=`Error thrown while initializing video stream: ${e.message}`,e}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(e){console.log(e),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise(e=>{this.webcamVideoElement.onloadedmetadata=()=>{e()}})}async next(){if(this.isClosed)return{value:null,done:!0};let e;try{e=v3.browser.fromPixels(this.webcamVideoElement)}catch(e){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`)}if(!this.resize)return{value:e,done:!1};try{return{value:this.cropAndResizeFrame(e),done:!1}}catch(e){throw new Error(`Error thrown cropping the video: ${e.message}`)}finally{e.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(e){return(0,v3.tidy)(()=>{const t=(0,v3.expandDims)((0,v3.cast)(e,"float32"),0);let n;n=v3.image.cropAndResize(t,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const i=n.shape;return(0,v3.reshape)(n,i.slice(1))})}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach(e=>e.stop());try{this.webcamVideoElement.srcObject=null}catch(e){console.log(e),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class gae{}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class _ae extends Boe{split(e){return new yae(this,e)}}class yae extends _ae{constructor(e,t){super(),this.upstream=e,this.impl=new vae(e,t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class vae extends qoe{constructor(e,t){super(),this.upstream=e,this.separator=t,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const e=await this.upstream.next();if(e.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const t=e.value.split(this.separator);t[0]=this.carryover+t[0];for(const e of t.slice(0,-1))this.outputQueue.push(e);return this.carryover=t[t.length-1],!0}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class bae extends Boe{decodeUTF8(){return new Tae(this)}}class Tae extends _ae{constructor(e){super(),this.upstream=e,this.impl=new xae(e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class xae extends qoe{constructor(e){if(super(),this.upstream=e,(0,v3.env)().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:e}=__webpack_require__(4530);this.decoder=new e("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const e=await this.upstream.next();let t,n;return!e.done&&(t=e.value,n=(0,v3.env)().get("IS_BROWSER")?this.decoder.decode(t,{stream:!0}):this.decoder.write(Buffer.from(t.buffer)),this.outputQueue.push(n),!0)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class Eae extends bae{constructor(e,t={}){super(),this.file=e,this.options=t,v3.util.assert(e instanceof Uint8Array||!!(0,v3.env)().get("IS_BROWSER")&&(e instanceof File||e instanceof Blob),()=>"FileChunkIterator only supports File, Blob and Uint8Array right now."),this.offset=t.offset||0,this.chunkSize=t.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const e=new Promise((e,t)=>{const n=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)e(new Uint8Array(this.file.slice(this.offset,n)));else{const i=new FileReader;i.onload=n=>{let r=i.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return t(new TypeError("FileReader returned unknown type."));e(r)},i.onabort=e=>t(new Error("Aborted")),i.onerror=e=>t(new Error(e.type));const r=this.file.slice(this.offset,n);i.readAsArrayBuffer(r)}this.offset=n});return{value:await e,done:!1}}}const wae=e=>({method:e.method,headers:e.headers,body:e.body,mode:e.mode,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity});
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
function Iae(e){return"string"==typeof e&&"file://"===e.slice(0,7)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class Aae extends gae{constructor(e,t={}){super(),this.input=e,this.options=t}async iterator(){if(Iae(this.input)&&(0,v3.env)().get("IS_NODE")){const e=__webpack_require__(8108);this.input=e.readFileSync(this.input.slice(7))}return new Eae(this.input,this.options)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
class Sae extends gae{constructor(e,t={}){super(),this.url=e,this.fileOptions=t}async iterator(){return Iae(this.url)?new Aae(this.url,this.fileOptions).iterator():
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
async function(e,t={},n){let i,r;"string"==typeof e?i=e:(i=e.url,r=wae(e));const s=await(n||v3.util.fetch)(i,r);if(s.ok){const e=new Uint8Array(await s.arrayBuffer());return new Eae(e,t)}throw new Error(s.statusText)}(this.url,this.fileOptions)}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
function Cae(e,t={}){return new pae(new Sae(e),t)}function Oae(e){const t=Loe(e);return nae(async()=>t)}function Mae(e){return nae(async()=>{const t=await e();return Loe(()=>t.next())})}async function kae(e,t){return mae.create(e,t)}async function Rae(e){return fae.create(e)}
/** @license See the LICENSE file. */
const Nae="4.22.0";
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Dae(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&v3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the CPU backend.`)})}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Fae=v3.kernel_impls.whereImpl;class Lae extends v3.KernelBackend{nextDataId(){return Lae.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new v3.DataStorage(this,(0,v3.engine)())}write(e,t,n){this.firstUse&&(this.firstUse=!1,(0,v3.env)().get("IS_NODE")&&v3.backend_util.warn("\n============================\nHi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. \n============================"));const i={id:this.nextDataId()};return this.data.set(i,{values:e,dtype:n,refCount:1}),i}makeTensorInfo(e,t,n){let i;if("string"===t&&null!=n&&n.length>0&&v3.util.isString(n[0])){const r=n.map(e=>v3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return{dataId:i,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,i,r){this.data.set(e,{values:t,dtype:i,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){const e=this.readSync(n.real.dataId),t=this.readSync(n.imag.dataId);return v3.backend_util.mergeRealAndImagArrays(e,t)}return v3.util.convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>v3.util.decodeString(e));return(0,v3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,v3.buffer)(e.shape,e.dtype,t)}makeOutput(e,t,n){return(0,v3.engine)().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=v3.util.now();e();return{kernelMs:v3.util.now()-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){Dae([e],"where");const t=this.readSync(e.dataId);return Fae(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Pae(e){const t=new Float32Array(e.length);for(let n=0;n<e.length;++n)t[n]=Math.abs(e[n]);return t}Lae.nextDataId=0;const Bae={kernelName:v3.Abs,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,n=e.backend;Dae(t,"abs");let i=new Float32Array(v3.util.sizeFromShape(t.shape));return i=Pae(n.data.get(t.dataId).values),n.makeOutput(i,t.shape,t.dtype)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function $ae(e){return(t,n,i,r,s)=>{const o=v3.backend_util.assertAndGetBroadcastShape(t,n),a=o.length,l=v3.util.computeStrides(o),u=v3.util.sizeFromShape(o),c=v3.util.getTypedArrayFromDType(s,u),d=t.length,h=n.length,p=v3.util.computeStrides(t),f=v3.util.computeStrides(n),m=v3.backend_util.getBroadcastDims(t,o),g=v3.backend_util.getBroadcastDims(n,o);if(m.length+g.length===0)for(let t=0;t<c.length;++t)c[t]=e(i[t%i.length],r[t%r.length]);else for(let t=0;t<c.length;++t){const n=v3.util.indexToLoc(t,a,l),s=n.slice(-d);m.forEach(e=>s[e]=0);const o=v3.util.locToIndex(s,d,p),u=n.slice(-h);g.forEach(e=>u[e]=0);const _=v3.util.locToIndex(u,h,f);c[t]=e(i[o],r[_])}return[c,o]}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Uae(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,a=n.makeTensorInfo(i.shape,"complex64");return n.data.get(a.dataId).complexTensorInfos={real:n.makeTensorInfo(i.shape,"float32",s),imag:n.makeTensorInfo(r.shape,"float32",o)},a}const Vae={kernelName:v3.Complex,backendName:"cpu",kernelFunc:Uae};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function zae(e,t,n="float32"){if("complex64"===n){return Uae({inputs:{real:zae(e,t,"float32"),imag:zae(e,t,"float32")},backend:e})}const i=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(t),n);return e.makeTensorInfo(t,n,i)}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function jae(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const Yae={kernelName:v3.Identity,backendName:"cpu",kernelFunc:jae};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Gae(e){const{inputs:t,backend:n}=e,{input:i}=t,r=n.data.get(i.dataId).complexTensorInfos.real,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}const Hae={kernelName:v3.Real,backendName:"cpu",kernelFunc:Gae};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Wae(e,t,n,i){if("int32"===i){return[t,"int32",Int32Array.from(e)]}if("bool"===i){const i=v3.util.toTypedArray([0],n),[r,s]=$ae((e,t)=>e!==t?1:0)(t,[],e,i,"bool");return[s,"bool",r]}throw new Error(`Error in Cast: failed to cast ${n} to ${i}`)}function Xae(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dtype:s}=i;if("complex64"===s){if("complex64"===r.dtype)return jae({inputs:{x:r},backend:n});const e=zae(n,r.shape,r.dtype),t=Xae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}}),i=Uae({inputs:{real:t,imag:e},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),i}if("complex64"===r.dtype){const e=Gae({inputs:{input:r},backend:n}),t=Xae({inputs:{x:e},backend:n,attrs:{dtype:s}});return n.disposeIntermediateTensorInfo(e),t}if(!v3.util.hasEncodingLoss(r.dtype,s)){const e=jae({inputs:{x:r},backend:n});return{dataId:e.dataId,shape:e.shape,dtype:s}}const o=n.data.get(r.dataId).values,[a,l,u]=Wae(o,r.shape,r.dtype,s);return n.makeTensorInfo(a,l,u)}const qae={kernelName:v3.Cast,backendName:"cpu",kernelFunc:Xae};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Kae(e,t,n,i){return null==n?({inputs:n,backend:r})=>{const{a:s,b:o}=n,a=r;Dae([s,o],e);const l=a.data.get(s.dataId).values,u=a.data.get(o.dataId).values,c="string"===s.dtype?v3.backend_util.fromUint8ToStringArray(l):l,d="string"===s.dtype?v3.backend_util.fromUint8ToStringArray(u):u,h=i||s.dtype,[p,f]=t(s.shape,o.shape,c,d,h);return a.makeTensorInfo(f,h,p)}:({inputs:e,backend:r})=>{const{a:s,b:o}=e,a=r;if("complex64"===s.dtype||"complex64"===o.dtype){const e=Xae({inputs:{x:s},backend:a,attrs:{dtype:"complex64"}}),t=a.data.get(e.dataId),i=t.complexTensorInfos.real,r=t.complexTensorInfos.imag,l=a.data.get(i.dataId).values,u=a.data.get(r.dataId).values,c=Xae({inputs:{x:o},backend:a,attrs:{dtype:"complex64"}}),d=a.data.get(c.dataId),h=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,f=a.data.get(h.dataId).values,m=a.data.get(p.dataId).values,[g,_,y]=n(s.shape,o.shape,l,u,f,m),v=a.makeTensorInfo(y,"float32",g),b=a.makeTensorInfo(y,"float32",_),T=Uae({inputs:{real:v,imag:b},backend:a});return a.disposeIntermediateTensorInfo(e),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(v),a.disposeIntermediateTensorInfo(b),T}{const e=a.data.get(s.dataId).values,n=a.data.get(o.dataId).values,r=i||s.dtype,[l,u]=t(s.shape,o.shape,e,n,r);return a.makeTensorInfo(u,r,l)}}}function Zae(e){return(t,n,i,r,s,o)=>{const a=v3.backend_util.assertAndGetBroadcastShape(t,n),l=v3.util.sizeFromShape(a),u=a.length,c=v3.util.computeStrides(a),d=v3.util.getTypedArrayFromDType("float32",l),h=v3.util.getTypedArrayFromDType("float32",l),p=v3.backend_util.getBroadcastDims(t,a),f=v3.backend_util.getBroadcastDims(n,a),m=v3.backend_util.mergeRealAndImagArrays(i,r),g=v3.backend_util.mergeRealAndImagArrays(s,o),_=t.length,y=v3.util.computeStrides(t),v=n.length,b=v3.util.computeStrides(n);if(p.length+f.length===0)for(let t=0;t<d.length;t++){const n=t%m.length,i=t%g.length,r=e(m[2*n],m[2*n+1],g[2*i],g[2*i+1]);d[t]=r.real,h[t]=r.imag}else for(let t=0;t<d.length;t++){const n=v3.util.indexToLoc(t,u,c),i=n.slice(-_);p.forEach(e=>i[e]=0);const r=v3.util.locToIndex(i,_,y),s=n.slice(-v);f.forEach(e=>s[e]=0);const o=v3.util.locToIndex(s,v,b),a=e(m[2*r],m[2*r+1],g[2*o],g[2*o+1]);d[t]=a.real,h[t]=a.imag}return[d,h,a]}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Qae=$ae((e,t)=>e+t),Jae=Zae((e,t,n,i)=>({real:e+n,imag:t+i})),ele=Kae(v3.Add,Qae,Jae),tle={kernelName:v3.Add,backendName:"cpu",kernelFunc:ele};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function nle(e,t,n,i,r){const s=v3.util.sizeFromShape(i),o=v3.util.makeZerosTypedArray(r,n);for(let n=0;n<e.length;n++){const i=e[n];if(i<0)throw new Error("Input x must be non-negative!");i>=r||(o[i]+=s>0?t[n]:1)}return o}function ile(e,t,n,i=!1){const r=e.shape[0],s=e.shape[1],o=(0,v3.buffer)([r,n],t.dtype);for(let a=0;a<r;a++)for(let r=0;r<s;r++){const s=e.get(a,r);if(s<0)throw new Error("Input x must be non-negative!");s>=n||(i?o.set(1,a,s):t.size>0?o.set(o.get(a,s)+t.get(a,r),a,s):o.set(o.get(a,s)+1,a,s))}return o}
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const rle=$ae((e,t)=>e&t),sle=Kae(v3.BitwiseAnd,rle),ole={kernelName:v3.BitwiseAnd,backendName:"cpu",kernelFunc:sle};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ale(e){return(t,n,i)=>{const r=v3.util.getArrayFromDType(n,t.length);for(let n=0;n<t.length;++n)r[n]=e(t[n],i);return r}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function lle(e,t,n){return ule(e,ale(t),n)}function ule(e,t,n){return({inputs:i,attrs:r,backend:s})=>{const{x:o}=i;Dae(o,e);const a=s,l=a.data.get(o.dataId).values;let u;if("string"===o.dtype){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=v3.backend_util.fromUint8ToStringArray(l)}else u=l;const c=n||o.dtype,d=t(u,c,r);return a.makeTensorInfo(o.shape,c,d)}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const cle=ale(e=>Math.ceil(e)),dle=ule(v3.Ceil,cle),hle={kernelName:v3.Ceil,backendName:"cpu",kernelFunc:dle};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ple(e,t,n,i){const r=v3.util.getArrayFromDType(n,v3.util.sizeFromShape(t));if(i&&"string"!==n){let t=0;e.forEach(e=>{const n=v3.util.sizeFromShape(e.shape);r.set(e.vals,t),t+=n})}else{let i=0;e.forEach(e=>{const s="string"===n?v3.backend_util.fromUint8ToStringArray(e.vals):e.vals;let o=0;for(let n=0;n<e.shape[0];++n){const a=n*t[1]+i;for(let t=0;t<e.shape[1];++t)r[a+t]=s[o++]}i+=e.shape[1]})}return r}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const fle=$ae((e,t)=>e===t?1:0),mle=Kae(v3.Equal,fle,null,"bool"),gle={kernelName:v3.Equal,backendName:"cpu",kernelFunc:mle},_le=ale(e=>Math.exp(e)),yle=ule(v3.Exp,_le,"float32"),vle={kernelName:v3.Exp,backendName:"cpu",kernelFunc:yle},ble=ale(e=>Math.expm1(e)),Tle=ule(v3.Expm1,ble),xle={kernelName:v3.Expm1,backendName:"cpu",kernelFunc:Tle},Ele=ale(e=>Math.floor(e)),wle=ule(v3.Floor,Ele),Ile={kernelName:v3.Floor,backendName:"cpu",kernelFunc:wle},Ale=$ae((e,t)=>Math.floor(e/t)),Sle=Kae(v3.FloorDiv,Ale,null,"int32"),Cle={kernelName:v3.FloorDiv,backendName:"cpu",kernelFunc:Sle};
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ole(e,t,n,i,r,s,o,a,l){const u=(0,v3.buffer)([i,s],n);for(let n=0;n<i;n++){const i=[];let c=0;for(let t=0;t<r;t++){const s=e[n*r+t];c+=s*o[t],i.push(s)}if(c<0||c>=l/s)throw new Error(`Invalid indices: ${i} does not index into ${a}`);for(let e=0;e<s;e++)u.values[n*s+e]=t.get(...t.indexToLoc(c*s+e))}return u}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Mle(e,t,n){const i=(0,v3.buffer)(n,e.dtype);for(let n=0;n<i.size;++n){const r=i.indexToLoc(n).slice(),s=r[0],o=r[2],a=t.locToIndex([s,o]);r[2]=t.values[a];const l=e.locToIndex(r);0<=l&&l<e.values.length&&(i.values[n]=e.values[l])}return i}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const kle=$ae((e,t)=>e>t?1:0),Rle=Kae(v3.Greater,kle,null,"bool"),Nle={kernelName:v3.Greater,backendName:"cpu",kernelFunc:Rle},Dle=$ae((e,t)=>e>=t?1:0),Fle=Kae(v3.GreaterEqual,Dle,null,"bool"),Lle={kernelName:v3.GreaterEqual,backendName:"cpu",kernelFunc:Fle},Ple=$ae((e,t)=>e<t?1:0),Ble=Kae(v3.Less,Ple,null,"bool"),$le={kernelName:v3.Less,backendName:"cpu",kernelFunc:Ble},Ule=$ae((e,t)=>e<=t?1:0),Vle=Kae(v3.LessEqual,Ule,null,"bool"),zle={kernelName:v3.LessEqual,backendName:"cpu",kernelFunc:Vle};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function jle(e,t,n){const i=(t-e)/(n-1),r=v3.util.makeZerosTypedArray(n,"float32");r[0]=e;for(let e=1;e<r.length;e++)r[e]=r[e-1]+i;return r}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Yle=ale(e=>Math.log(e)),Gle=ule(v3.Log,Yle),Hle={kernelName:v3.Log,backendName:"cpu",kernelFunc:Gle};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Wle(e,t,n,i){const r=v3.util.getTypedArrayFromDType(i,v3.util.sizeFromShape(n));for(let n=0;n<r.length;++n){const i=n*t;let s=e[i];for(let n=0;n<t;++n){const t=e[i+n];(Number.isNaN(t)||t>s)&&(s=t)}r[n]=s}return r}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Xle=$ae((e,t)=>Math.max(e,t)),qle=Kae(v3.Maximum,Xle),Kle={kernelName:v3.Maximum,backendName:"cpu",kernelFunc:qle},Zle=$ae((e,t)=>Math.min(e,t)),Qle=Kae(v3.Minimum,Zle),Jle={kernelName:v3.Minimum,backendName:"cpu",kernelFunc:Qle},eue=$ae((e,t)=>e*t),tue=Zae((e,t,n,i)=>({real:e*n-t*i,imag:e*i+t*n})),nue=Kae(v3.Multiply,eue,tue),iue={kernelName:v3.Multiply,backendName:"cpu",kernelFunc:nue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function rue(e,t,n){const i=v3.util.createScalarValue(-1,n);return eue([],t,i,e,n)}const sue={kernelName:v3.Neg,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;Dae(i,"neg");const r=n.data.get(i.dataId).values,[s,o]=rue(r,i.shape,i.dtype);return n.makeTensorInfo(o,i.dtype,s)}},oue=$ae((e,t)=>e!==t?1:0),aue=Kae(v3.NotEqual,oue,null,"bool"),lue={kernelName:v3.NotEqual,backendName:"cpu",kernelFunc:aue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function uue(e,t,n,i,r){const s=t.length,o=v3.util.sizeFromShape(t),a=v3.util.computeStrides(t),l=v3.util.computeStrides(r),u=v3.util.getTypedArrayFromDType(n,v3.util.sizeFromShape(r));for(let t=0;t<o;++t){const n=v3.util.indexToLoc(t,s,a),r=new Array(n.length);for(let e=0;e<r.length;e++)r[e]=n[i[e]];u[v3.util.locToIndex(r,s,l)]=e[t]}return u}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function cue(e){const{inputs:t,attrs:n,backend:i}=e,{x:r}=t,{perm:s}=n;Dae(r,"transpose");const o=r.shape.length,a=new Array(o);for(let e=0;e<a.length;e++)a[e]=r.shape[s[e]];const l=uue(i.data.get(r.dataId).values,r.shape,r.dtype,s,a);return{dataId:i.write(l,a,r.dtype),shape:a,dtype:r.dtype}}const due={kernelName:v3.Transpose,backendName:"cpu",kernelFunc:cue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function hue(e,t,n,i){const[r,s]=v3.backend_util.computeOutAndReduceShapes(e,i),o=(0,v3.upcastType)(t,"int32"),a=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(r),o),l=v3.util.sizeFromShape(s);for(let e=0;e<a.length;++e){const t=e*l;let i=1;for(let e=0;e<l;++e)i*=n[t+e];a[e]=i}return{outVals:a,outShape:r,outDtype:o}}const pue={kernelName:v3.Prod,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;Dae(r,"prod");const a=r.shape.length,l=v3.util.parseAxisParam(s,r.shape),u=v3.backend_util.getAxesPermutation(l,a);let c=l,d=r;const h=[];null!=u&&(d=cue({inputs:{x:r},backend:n,attrs:{perm:u}}),h.push(d),c=v3.backend_util.getInnerMostAxes(c.length,a));const p=n.data.get(d.dataId).values,{outVals:f,outShape:m,outDtype:g}=hue(d.shape,d.dtype,p,c);let _=m;return o&&(_=v3.backend_util.expandShapeToKeepDim(m,l)),h.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(_,g,f)}};function fue(e,t,n,i){const r=[];let s=0;const o=t.length-1+n.length,a=new Array(o).fill(null).map(()=>[0]);!function(e,t){for(let n=0;n<e.length;++n){const i=e[n],r=n===e.length-1?t:e[n+1].length;if(0===i.length)throw new Error("Ragged splits may not be empty");if(i[0]<0)throw new Error("Ragged splits must be non-negative");if(i[i.length-1]>r)throw new Error("Ragged splits must not point past values");for(let e=1;e<i.length;++e)if(i[e-1]>i[e])throw new Error("Ragged splits must be sorted in ascending order")}}(n,i);let l=1;for(let e=0;e<t.length-1;++e){l*=t[e];const n=t[e+1];for(let t=1;t<l+1;++t)a[e].push(t*n)}for(let i=0;i<e.length;++i){let o=e[i],l=e[i]+1;for(let e=0;e<n.length;++e){const i=n[e],r=e+t.length-1;if(r>=0){const e=a[r],t=e[e.length-1]-i[o];for(let e=o;e<l;++e)a[r].push(i[e+1]+t)}o=i[o],l=i[l]}l!==o&&(r.push([o,l]),s+=l-o)}return{outSplits:a,valueSlices:r,numValues:s}}function mue(e,t){const n=e.slice(0,t);for(;n.length<t;)n.push(1);for(let i=t;i<e.length;i++)n[t-1]*=e[i];return n}function gue(e,t,n,i,r){const s=t.slice();s[0]=r;const o=v3.util.getArrayFromDType(n,v3.util.sizeFromShape(s)),a=e.length;return function(e,t,n,i,r,s){const o=mue(t,2)[1],a=mue(s,2)[1];let l=0;for(const t of n)for(let n=t[0];n<t[1];++n){for(let t=0;t<i;++t)r[l*a+t]=e[n*o+t];++l}}(e,t,i,0===a?0:a/t[0],o,s),[o,s]}function _ue(e,t,n,i,r,s,o,a){if(0===e.length)throw new Error("paramsNestedSplits must be non empty");if(0===t[0].length)throw new Error("Split tensors must not be scalars");if(
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){e.forEach((e,i)=>{if(e<0||e>=n){const r=v3.util.indexToLoc(i,t.length,v3.util.computeStrides(t)).join(",");throw new Error(`indices[${r}] = ${e} is not in [0, ${n})`)}})}(s,o,t[0][0]-1),0===i.length)throw new Error("params.rank must be nonzero");const l=i[0],{outSplits:u,valueSlices:c,numValues:d}=fue(s,o,e,l),h=function(e){const t=[];for(let n=0;n<e.length;++n){const i=e[n].length,r=v3.util.getArrayFromDType("int32",i);t.push(r),e[n].forEach((e,t)=>r[t]=e)}return t}(u),p=gue(n,i,r,c,d);return[h,p[0],p[1]]}
/**
* @license
* Copyright 2022 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const yue=2147483647;function vue(e,t,n,i,r,s,o){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(o.length>1)throw new Error("deltas must be a scalar or vector");const a=0===t.length,l=0===r.length,u=0===o.length,c=[];a||c.push(t[0]),l||c.push(r[0]),u||c.push(o[0]);for(let e=1;e<c.length;++e)if(c[e]!==c[e-1])throw new Error("starts, limits, and deltas must have the same shape");const d=0===c.length?1:c[0],h=v3.util.getArrayFromDType("int32",d+1);h[0]=0;for(let t=0;t<d;++t){const n=a?e[0]:e[t],r=l?i[0]:i[t],o=u?s[0]:s[t];if(0===o)throw new Error("Requires delta != 0");let c;if(o>0&&r<n||o<0&&r>n)c=0;else if(c=Math.ceil(Math.abs((r-n)/o)),c>yue)throw new Error(`Requires ((limit - start) / delta) <= ${yue}`);h[t+1]=h[t]+c}const p=h[d],f=v3.util.getArrayFromDType(n,p);let m=0;for(let t=0;t<d;++t){const n=h[t+1]-h[t];let i=a?e[0]:e[t];const r=u?s[0]:s[t];for(let e=0;e<n;++e)f[m++]=i,i+=r}return[h,f]}
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var bue=v3.backend_util.RowPartitionType;class Tue{constructor(e,t,n,i,r,s,o,a,l,u){this.shape=e,this.shapeShape=t,this.values=n,this.valuesShape=i,this.valuesDType=r,this.defaultValue=s,this.defaultValueShape=o,this.rowPartitionValues=a,this.rowPartitionValuesShapes=l,this.rowPartitionTypes=v3.backend_util.getRowPartitionTypesHelper(u),this.raggedRank=v3.backend_util.getRaggedRank(this.rowPartitionTypes)}getRowPartitionTypeByDimension(e){return this.rowPartitionTypes[0]===bue.FIRST_DIM_SIZE?this.rowPartitionTypes[e+1]:this.rowPartitionTypes[e]}getRowPartitionTensor(e){return this.rowPartitionTypes[0]===bue.FIRST_DIM_SIZE?this.rowPartitionValues[e+1]:this.rowPartitionValues[e]}getMaxWidth(e){const t=this.getRowPartitionTensor(e-1);switch(this.getRowPartitionTypeByDimension(e-1)){case bue.VALUE_ROWIDS:return Tue.getMaxWidthValueRowID(t);case bue.ROW_SPLITS:return Tue.getMaxWidthRowSplit(t);default:throw new Error(`Cannot handle partition type ${bue[this.getRowPartitionTypeByDimension(e-1)]}`)}}static getMaxWidthRowSplit(e){const t=e.length;if(0===t||1===t)return 0;let n=0;for(let i=0;i<t-1;++i){const t=e[i+1]-e[i];t>n&&(n=t)}return n}static getMaxWidthValueRowID(e){const t=e.length;if(0===t)return 0;let n=0,i=e[0],r=0;for(let s=1;s<t;++s){const t=e[s];t!==i&&(i=t,r=Math.max(s-n,r),n=s)}return Math.max(t-n,r)}tensorShapeFromTensor(e,t,n=!0){if(0===t.length){if(-1===e[0])return[];throw new Error("The only valid scalar shape tensor is the fully unknown shape specified as -1.")}return Eue(e,n)}calculateOutputSize(e){const t=this.valuesShape,n=this.defaultValueShape;v3.backend_util.validateDefaultValueShape(n,t);const i=this.tensorShapeFromTensor(this.shape,this.shapeShape),r=v3.backend_util.combineRaggedTensorToTensorShapes(this.raggedRank,i,t);r[0]<0&&(r[0]=e);for(let e=1;e<=this.raggedRank;++e)r[e]<0&&(r[e]=this.getMaxWidth(e));return r}calculateFirstParentOutputIndex(e,t,n){const i=Math.min(e,n),r=[];let s=0;for(let e=0;e<i;++e,s+=t)r.push(s);for(let t=i;t<e;++t)r.push(-1);return v3.util.assert(r.length===e,()=>"Final length of result must be equal to firstDimension."),r}calculateOutputIndexRowSplit(e,t,n,i){const r=e.length,s=[];for(let o=0;o<r-1;++o){const r=e[o+1]-e[o];let a=Math.min(i,r),l=t[o];-1===l&&(a=0);for(let e=0;e<a;++e)s.push(l),l+=n;for(let e=0;e<r-a;++e)s.push(-1)}if(r>0&&s.length!==e[r-1])throw new Error("Invalid row split size.");return s}calculateOutputIndexValueRowID(e,t,n,i){const r=e.length,s=[];if(0===r)return[];let o=0,a=e[0];if(a>=t.length)throw new Error(`Got currentValueRowId=${a}, which is not less than ${t.length}`);let l=t[a];s.push(l);for(let u=1;u<r;++u){const r=e[u];if(r===a)l>=0&&(++o,o<i?l+=n:l=-1);else{if(o=0,a=r,r>=t.length)throw new Error(`Got nextValueRowId=${r} which is not less than ${t.length}`);l=t[r]}s.push(l)}if(s.length!==e.length)throw new Error("Invalid row ids.");return s}calculateOutputIndex(e,t,n,i){const r=this.getRowPartitionTensor(e),s=this.getRowPartitionTypeByDimension(e);switch(s){case bue.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(r,t,n,i);case bue.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,i);default:throw new Error(`Unsupported partition type: ${bue[s]}`)}}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 bue.FIRST_DIM_SIZE:return e[0];case bue.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case bue.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${bue[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 i=Eue(t,!1),r=v3.util.getArrayFromDType(this.valuesDType,v3.util.sizeFromShape(i));if(n[0]*t[0]>0){let s=this.calculateFirstParentOutputIndex(e,n[0],t[0]);for(let e=1;e<=this.raggedRank;++e){s=this.calculateOutputIndex(e-1,s,n[e],t[e])}this.setOutput(this.raggedRank,s,r,i)}return[i,r]}setOutput(e,t,n,i){if(0===n.length)return;const r=this.values,s=n;let o=i.slice();o=o.slice(e+1);const a=v3.util.sizeFromShape(o),l=t.length;let u=this.defaultValue;if(u.length!==a&&1!==u.length){const e=this.defaultValueShape;(0,v3.tidy)(()=>{const t=(0,v3.reshape)(u,e),n=(0,v3.broadcastTo)(t,o);u=n.dataSync()})}let c=0,d=0,h=0;for(let e=0;e<=l;++e){let i=e<l?t[e]:-1;if(i!==h){if(d<h){const e=r.subarray(c*a);xue(s.subarray(d*a),e,(h-d)*a)}if(e>=l){const e=n.length;i=Math.floor(e/a)}if(i>h)if(1===this.defaultValue.length)s.subarray(h*a,i*a).fill(this.defaultValue[0]),h=i;else for(;i>h;){xue(s.slice(h*a),u,a),++h}i<0?(c=e+1,d=h):(c=e,d=h,h=d+1)}else++h}}}function xue(e,t,n){for(let i=0;i<n;i++)e[i]=t[i]}function Eue(e,t){const n=[];for(let i of e){if(i<0){if(!t)throw new Error(`Dimension ${i} must be >= 0`);if(i<-1)throw new Error(`Dimension ${i} must be >= -1`);i=-1}n.push(i)}return n}function wue(e,t,n,i,r,s,o,a,l,u){return new Tue(e,t,n,i,r,s,o,a,l,u).compute()}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Iue(e,t,n,i){if(e===t||e<t&&n<0||t<e&&n>1)return v3.util.makeZerosTypedArray(0,i);const r=Math.abs(Math.ceil((t-e)/n)),s=v3.util.makeZerosTypedArray(r,i);t<e&&1===n&&(n=-1),s[0]=e;for(let e=1;e<s.length;e++)s[e]=s[e-1]+n;return s}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Aue=ale(e=>1/Math.sqrt(e)),Sue=ule(v3.Rsqrt,Aue),Cue={kernelName:v3.Rsqrt,backendName:"cpu",kernelFunc:Sue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Oue(e,t,n,i,r,s,o,a,l,u){const c=[i/r,r],d=e.values,h=t.values;if(0===i)return(0,v3.buffer)(n,t.dtype);const p=l instanceof v3.TensorBuffer?l:(0,v3.buffer)(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;e++){const s=[];let l=0;for(let t=0;t<o;t++){const n=d[e*o+t];s.push(n),l+=n*a[t]}if(l<0||l>=i/r)throw new Error(`Invalid indices: ${s} does not index into ${n}`);for(let n=0;n<r;n++)u?p.values[l*r+n]+=h[e*r+n]:p.values[l*r+n]=0===t.rank?h[0]:h[e*r+n]}return p}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Mue=ale(e=>1/(1+Math.exp(-e))),kue=lle(v3.Sigmoid,e=>1/(1+Math.exp(-e))),Rue={kernelName:v3.Sigmoid,backendName:"cpu",kernelFunc:kue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Nue(e,t,n,i,r){const s=v3.slice_util.isSliceContinous(i,t,n),o=v3.util.sizeFromShape(n),a=v3.util.computeStrides(i);if(s){const n=v3.slice_util.computeFlatOffset(t,a);return"string"===r?e.slice(n,n+o):e.subarray(n,n+o)}const l="string"===r?v3.backend_util.fromUint8ToStringArray(e):e,u=(0,v3.buffer)(i,r,l),c=(0,v3.buffer)(n,r);for(let e=0;e<c.size;++e){const n=c.indexToLoc(e),i=n.map((e,n)=>e+t[n]);c.set(u.get(...i),...n)}return"string"===r?v3.backend_util.fromStringArrayToUint8(c.values):c.values}function Due(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i;Dae(r,"slice");const[a,l]=v3.slice_util.parseSliceParams(r,s,o);v3.slice_util.assertParamsValid(r,a,l);const u=Nue(n.data.get(r.dataId).values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,u)}const Fue={kernelName:v3.Slice,backendName:"cpu",kernelFunc:Due};
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Lue(e,t,n,i,r,s,o){const a=t[0],l=s[0],u=new Array(l),c=new Array(a),d=t[1];if(0===l){if(0!==a)throw new Error(v3.backend_util.getSparseFillEmptyRowsIndicesDenseShapeMismatch(a));return[v3.util.getArrayFromDType(n,0),[0,d],v3.util.getArrayFromDType(r,0),u,c]}let h=!0,p=0;const f=new Array(l).fill(0);for(let t=0;t<a;++t){const n=e[t*d];if(n<0)throw new Error(v3.backend_util.getSparseFillEmptyRowsNegativeIndexErrorMessage(t,n));if(n>=l)throw new Error(v3.backend_util.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(t,n,l));++f[n],h=h&&n>=p,p=n}let m=!0;for(let e=0;e<l;++e){const t=0===f[e];u[e]=t,m=m&&!t,f[e]=Math.max(f[e],1),e>0&&(f[e]+=f[e-1])}if(m&&h){const t=e,n=i;for(let e=0;e<a;++e)c[e]=e;return[t,[a,d],n,u,c]}{const t=f[l-1],s=v3.util.getArrayFromDType(n,t*d),h=v3.util.getArrayFromDType(r,t),p=new Array(l).fill(0);for(let t=0;t<a;++t){const n=e[t*d],r=p[n],o=(0===n?0:f[n-1])+r;p[n]++;for(let n=0;n<d;++n)s[o*d+n]=e[t*d+n];h[o]=i[t],c[t]=o}for(let e=0;e<l;++e){if(0===p[e]){const t=0===e?0:f[e-1];s[t*d+0]=e;for(let e=1;e<d;++e)s[t*d+e]=0;h[t]=o}}return[s,[t,d],h,u,c]}}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Pue(e,t,n,i,r){const s=v3.util.sizeFromShape(i),o=t[0],a=r.length,l=[];let u=1,c=-1;for(let e=0;e<a;++e){const t=r[e];if(-1===t){if(-1!==c)throw new Error(v3.backend_util.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(c,e));c=e,l.push(1)}else{if(t<0)throw new Error(v3.backend_util.getSparseReshapeNegativeOutputDimErrorMessage(e,t));u*=t,l.push(t)}}if(-1!==c){if(u<=0)throw new Error(v3.backend_util.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage());const e=Math.trunc(s/u);if(u*e!==s)throw new Error(v3.backend_util.getSparseReshapeInputOutputMultipleErrorMessage(i,l));l[c]=e}if(v3.util.sizeFromShape(l)!==s)throw new Error(v3.backend_util.getSparseReshapeInputOutputMismatchErrorMessage(i,l));const d=i.length,h=[];if(d>0){h[d-1]=1;for(let e=d-2;e>=0;--e)h[e]=h[e+1]*i[e+1]}const p=[];if(a>0){p[a-1]=1;for(let e=a-2;e>=0;--e)p[e]=p[e+1]*l[e+1]}const f=v3.util.getArrayFromDType(n,o*a);for(let t=0;t<o;++t){let n=0;for(let i=0;i<d;++i)n+=e[t*d+i]*h[i];for(let e=0;e<a;++e)f[t*a+e]=Math.trunc(n/p[e]),n%=p[e]}return[f,[o,a],l]}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Bue(e,t,n,i,r,s=!1,o=0){const a=i.length,l=[t[0],e.length/t[0]],u=l[1],c=a>0?r[a-1]+1:0;if(c<0)throw new Error(v3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());const d=t.slice();d[0]=c;const h=d.reduce((e,t)=>e*t,1),p=v3.util.getArrayFromDType(n,h);if(0===a)return c>0&&p.fill(o),[p,d];if(c<=0)throw new Error(v3.backend_util.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let f=0,m=1,g=0,_=r[f];for(;;){let t=0;if(m<a){if(t=r[m],_===t){++m;continue}if(_>=t)throw new Error(v3.backend_util.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(_<0||_>=c)throw new Error(v3.backend_util.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(_,c));_>g&&p.fill(o,g*u,_*u);for(let t=f;t<m;++t){const n=i[t];if(n<0||n>=l[0])throw new Error(v3.backend_util.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(t,i[t],l[0]));for(let t=0;t<u;t++)p[_*u+t]+=e[n*u+t]}if(s)for(let e=0;e<u;e++)p[_*u+e]/=m-f;if(f=m,++m,g=_+1,_=t,m>a)break}return g<c&&p.fill(o,g*u,c*u),[p,d]}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const $ue=ale(e=>Math.sqrt(e)),Uue=lle(v3.Sqrt,e=>Math.sqrt(e)),Vue={kernelName:v3.Sqrt,backendName:"cpu",kernelFunc:Uue},zue=$ae((e,t)=>{const n=e-t;return n*n}),jue=Kae(v3.SquaredDifference,zue),Yue={kernelName:v3.SquaredDifference,backendName:"cpu",kernelFunc:jue},Gue=ale((e,t)=>{const{pattern:n,replaceGlobal:i,rewrite:r}=t;return e.replace(new RegExp(n,i?"g":""),r)}),Hue=ule(v3.StaticRegexReplace,Gue),Wue={kernelName:v3.StaticRegexReplace,backendName:"cpu",kernelFunc:Hue};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Xue(e,t,n,i){const r=(0,v3.buffer)(e,t.dtype);for(let e=0;e<r.size;e++){const s=r.indexToLoc(e),o=new Array(s.length);for(let e=0;e<o.length;e++)o[e]=s[e]*n[e]+i[e];r.set(t.get(...o),...s)}return r}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class que{constructor(e,t,n,i,r,s){this.separator=v3.util.encodeString(e),this.nGramWidths=t,this.leftPad=v3.util.encodeString(n),this.rightPad=v3.util.encodeString(i),this.padWidth=r,this.preserveShort=s}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,i,r,s){for(let o=0;o<r;++o){const a=this.getPadWidth(s),l=Math.max(0,a-o),u=Math.max(0,a-(r-(o+1))),c=s-(l+u),d=t+(l>0?0:o-a);let h=0;h+=l*this.leftPad.length;for(let t=0;t<c;++t)h+=e[d+t].length;h+=u*this.rightPad.length;h+=(l+u+c-1)*this.separator.length,n[i+o]=new Uint8Array(h);const p=n[i+o];let f=0;const m=e=>e.forEach(e=>p[f++]=e);for(let e=0;e<l;++e)m(this.leftPad),m(this.separator);for(let t=0;t<c-1;++t)m(e[d+t]),m(this.separator);if(c>0){m(e[d+c-1]);for(let e=0;e<u;++e)m(this.separator),m(this.rightPad)}else{for(let e=0;e<u-1;++e)m(this.rightPad),m(this.separator);m(this.rightPad)}}}compute(e,t){const n=e.length,i=t.length;if(i>0){let e=t[0];if(0!==e)throw new Error(`First split value must be 0, got ${e}`);for(let r=1;r<i;++r){let i=t[r]>=e;if(i=i&&t[r]<=n,!i)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=i-1,s=v3.util.getArrayFromDType("int32",i);if(0===n||0===i){const e=new Array(n);for(let e=0;e<=r;++e)s[e]=0;return[e,s]}s[0]=0;for(let e=1;e<=r;++e){const n=t[e]-t[e-1];let i=0;this.nGramWidths.forEach(e=>{i+=this.getNumNGrams(n,e)}),this.preserveShort&&n>0&&0===i&&(i=1),s[e]=s[e-1]+i}const o=new Array(s[r]);for(let n=0;n<r;++n){const i=t[n];let r=s[n];if(this.nGramWidths.forEach(s=>{const a=t[n+1]-t[n],l=this.getNumNGrams(a,s);this.createNGrams(e,i,o,r,l,s),r+=l}),this.preserveShort&&r===s[n]){const s=t[n+1]-t[n];if(0===s)continue;const a=s+2*this.padWidth,l=1;this.createNGrams(e,i,o,r,l,a)}}return[o,s]}}function Kue(e,t,n,i,r,s,o,a){return new que(n,i,r,s,o,a).compute(e,t)}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Zue(e,t,n,i){if(!e.length)return;if(0===t.length){for(let t=0;t<e.length;++t)i.push(e.subarray(t,t+1));return}if(1===t.length){const r=t[0];let s=e.indexOf(r);for(;-1!==s;){const t=e.subarray(0,s);n&&0===t.length||i.push(t),s=(e=e.subarray(s+1)).indexOf(r)}return void(n&&0===e.length||i.push(e))}let r=0;for(let s=0;s<e.length+1;s++)if(s===e.length||-1!==t.indexOf(e[s])){const t=e.subarray(r,s);n&&0===t.length||i.push(t),r=s+1}}function Que(e,t,n){const i=e.length,r=[];let s=0,o=0;const a=new Array(i);for(let l=0;l<i;++l){const i=r.length;Zue(e[l],t,n,r);const u=r.length-i;a[l]=u,s+=u,o=Math.max(o,u)}const l=v3.util.getArrayFromDType("int32",2*s),u=new Array(s),c=[i,o];let d=0;for(let e=0;e<i;++e)for(let t=0;t<a[e];++t)l[2*d]=e,l[2*d+1]=t,u[d]=r[d],++d;return[l,u,c]}
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Jue(e,t){const n=v3.util.getArrayFromDType("int32",e.length);for(let i=0;i<e.length;++i)n[i]=v3.util.fingerPrint64(e[i]).modulo(t).getLowBitsUnsigned();return n}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const ece=$ae((e,t)=>e-t),tce=Zae((e,t,n,i)=>({real:e-n,imag:t-i})),nce=Kae(v3.Sub,ece,tce),ice={kernelName:v3.Sub,backendName:"cpu",kernelFunc:nce};
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function rce(e,t){const n=new Array(e.rank);for(let i=0;i<n.length;i++)n[i]=e.shape[i]*t[i];const i=(0,v3.buffer)(n,e.dtype);for(let t=0;t<i.values.length;++t){const n=i.indexToLoc(t),r=new Array(e.rank);for(let t=0;t<r.length;t++)r[t]=n[t]%e.shape[t];const s=e.locToIndex(r);i.values[t]=e.values[s]}return i}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const sce=(e,t)=>{const n=t.value-e.value;return 0===n?e.index-t.index:n};function oce(e,t,n=0,i=e.length-1){for(;i>n;){if(i-n>600){const r=i-n+1,s=t-n+1,o=Math.log(r),a=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*a*(r-a)/r)*Math.sign(s-r/2);oce(e,t,Math.max(n,Math.floor(t-s*a/r+l)),Math.min(i,Math.floor(t+(r-s)*a/r+l)))}const r=e[t];let s=n,o=i;for(v3.util.swap(e,n,t),sce(e[i],r)>0&&v3.util.swap(e,n,i);s<o;){for(v3.util.swap(e,s,o),s++,o--;sce(e[s],r)<0;)s+=1;for(;sce(e[o],r)>0;)o-=1}0===sce(e[n],r)?v3.util.swap(e,n,o):(o+=1,v3.util.swap(e,o,i)),o<=t&&(n=o+1),t<=o&&(i=o-1)}}function ace(e,t,n,i,r){const s=t[t.length-1],[o,a]=[e.length/s,s],l=v3.util.getTypedArrayFromDType(n,o*i),u=v3.util.getTypedArrayFromDType("int32",o*i);for(let t=0;t<o;t++){const n=t*a,s=e.subarray(n,n+a);let o=new Array(s.length);s.forEach((e,t)=>o[t]={value:e,index:t}),i<o.length&&(oce(o,i),o=o.slice(0,i)),r&&o.sort(sce);const c=t*i,d=l.subarray(c,c+i),h=u.subarray(c,c+i);for(let e=0;e<i;e++)d[e]=o[e].value,h[e]=o[e].index}const c=t.slice();return c[c.length-1]=i,[(0,v3.buffer)(c,n,l),(0,v3.buffer)(c,"int32",u)]}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function lce(e,t,n,i){const r=v3.util.parseAxisParam(t,n)[0],s=[1,n[0],1];for(let e=0;e<r;e++)s[0]*=n[e];s[1]=n[r];for(let e=r+1;e<n.length;e++)s[2]*=n[e];const o=new Map,a=new Int32Array(n[r]),l=new v3.TensorBuffer(s,i,e),u=[],c=1===s[0]&&1===s[2];for(let t=0;t<n[r];t++){let n;if(c)n=e[t].toString();else{const e=[];for(let n=0;n<s[0];n++)for(let i=0;i<s[2];i++)e.push(l.get(n,t,i));n=e.join(",")}const i=o.get(n);if(null!=i)a[t]=i;else{const e=o.size;o.set(n,e),a[t]=e,u.push(t)}}const d=s.slice();d[1]=o.size;const h=new v3.TensorBuffer(d,i);u.forEach((e,t)=>{for(let n=0;n<s[0];n++)for(let i=0;i<s[2];i++)h.set(l.get(n,e,i),n,t,i)});const p=n.slice();return p[r]=d[1],{outputValues:h.values,outputShape:p,indices:a}}
/** @license See the LICENSE file. */
const uce="4.22.0";
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
(0,v3.registerBackend)("cpu",()=>new Lae,1);
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const cce=lle(v3.Elu,e=>e>=0?e:Math.exp(e)-1),dce={kernelName:v3.Elu,backendName:"cpu",kernelFunc:cce};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function hce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i;Dae([r],"leakyRelu");const o=v3.util.sizeFromShape(r.shape),a=n.data.get(r.dataId).values,l=v3.util.getTypedArrayFromDType("float32",o);for(let e=0;e<a.length;e++)l[e]=a[e]<0?s*a[e]:a[e];return n.makeTensorInfo(r.shape,"float32",l)}const pce={kernelName:v3.LeakyRelu,backendName:"cpu",kernelFunc:hce},fce=$ae((e,t)=>e<0?t*e:e);function mce(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t;Dae([i,r],"prelu");const s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,[a,l]=fce(i.shape,r.shape,s,o,"float32");return n.makeTensorInfo(l,"float32",a)}const gce={kernelName:v3.Prelu,backendName:"cpu",kernelFunc:mce},_ce=lle(v3.Relu,e=>Math.max(0,e)),yce={kernelName:v3.Relu,backendName:"cpu",kernelFunc:_ce},vce=lle(v3.Relu6,e=>Math.min(Math.max(0,e),6)),bce={kernelName:v3.Relu6,backendName:"cpu",kernelFunc:vce};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Tce(e,t,n,i,r){if("linear"===n)return jae({inputs:{x:t},backend:e});if("relu"===n)return _ce({inputs:{x:t},backend:e});if("elu"===n)return cce({inputs:{x:t},backend:e});if("relu6"===n)return vce({inputs:{x:t},backend:e});if("prelu"===n)return mce({inputs:{x:t,alpha:i},backend:e});if("leakyrelu"===n)return hce({inputs:{x:t},backend:e,attrs:{alpha:r}});if("sigmoid"===n)return kue({inputs:{x:t},backend:e});throw new Error(`Activation ${n} has not been implemented for the CPU backend.`)}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function xce(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=v3.util.sizeFromShape(r.shape),a=v3.util.inferFromImplicitShape(s,o),l=v3.util.sizeFromShape(a);v3.util.assert(o===l,()=>`The new shape (${a}) has ${l} elements and the old shape (${r.shape}) has ${o} 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=a,t.shape=a}return{dataId:r.dataId,shape:a,dtype:r.dtype}}const Ece={kernelName:v3.Reshape,backendName:"cpu",kernelFunc:xce};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function wce(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transposeB:a}=i;Dae([r,s],"matMul");const l=r.shape.length,u=s.shape.length,c=o?r.shape[l-2]:r.shape[l-1],d=a?s.shape[u-1]:s.shape[u-2],h=o?r.shape[l-1]:r.shape[l-2],p=a?s.shape[u-2]:s.shape[u-1],f=r.shape.slice(0,-2),m=s.shape.slice(0,-2),g=v3.util.sizeFromShape(f),_=v3.util.sizeFromShape(m),y=v3.broadcast_util.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([h,p]);v3.util.assert(c===d,()=>`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${o} and transposeB=${a} must match.`);const v=a?[_,p,d]:[_,d,p],b=xce({inputs:{x:r},backend:n,attrs:{shape:o?[g,c,h]:[g,h,c]}}),T=xce({inputs:{x:s},backend:n,attrs:{shape:v}}),x=o?b.shape[1]:b.shape[2],E=o?b.shape[2]:b.shape[1],w=a?T.shape[1]:T.shape[2],I=Math.max(g,_),A=n.data.get(b.dataId).values,S=n.data.get(T.dataId).values,C=v3.util.computeStrides(b.shape),O=v3.util.computeStrides(T.shape),[M,k,R]=o?[C[0],1,C[1]]:[C[0],C[1],1],[N,D,F]=a?[1,O[1],O[0]]:[O[1],1,O[0]],L=E*w,P=(0,v3.buffer)([I,E,w],b.dtype),B=P.values,$=n.blockSize;for(let e=0;e<I;e++){const t=e%g,n=e%_;for(let i=0;i<E;i+=$){const r=Math.min(i+$,E);for(let s=0;s<w;s+=$){const o=Math.min(s+$,w);for(let a=0;a<x;a+=$){const l=Math.min(a+$,x);for(let u=i;u<r;u++)for(let i=s;i<o;i++){let r=0;for(let e=a;e<l;e++){r+=A[t*M+u*k+e*R]*S[e*N+i*D+n*F]}B[e*L+(u*w+i)]+=r}}}}}return n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(T),n.makeTensorInfo(y,P.dtype,P.values)}const Ice={kernelName:v3.BatchMatMul,backendName:"cpu",kernelFunc:wce};const Ace={kernelName:v3._FusedMatMul,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationWeights:a}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:d}=i;let h,p,f;const m=[];h=wce({inputs:{a:r,b:s},attrs:{transposeA:l,transposeB:u},backend:n}),o&&(p=ele({inputs:{a:h,b:o},backend:n}),m.push(h),h=p),c&&(f=Tce(n,h,c,a,d),m.push(h),h=f);for(const e of m)n.disposeIntermediateTensorInfo(e);return h}},Sce=lle(v3.Acos,e=>Math.acos(e)),Cce={kernelName:v3.Acos,backendName:"cpu",kernelFunc:Sce},Oce=lle(v3.Acosh,e=>Math.acosh(e)),Mce={kernelName:v3.Acosh,backendName:"cpu",kernelFunc:Oce};const kce={kernelName:v3.AddN,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,i=t;Dae(t,"addN");const r=i.map(e=>n.data.get(e.dataId).values),s=(0,v3.buffer)(i[0].shape,i[0].dtype),o=s.values;for(let e=0;e<i.length;e++){const t=r[e];for(let e=0;e<o.length;e++)o[e]+=t[e]}return n.makeTensorInfo(s.shape,s.dtype,s.values)}};const Rce={kernelName:v3.All,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;Dae(r,"all");const a=v3.util.parseAxisParam(s,r.shape);let l=a;const u=v3.backend_util.getAxesPermutation(l,r.shape.length);let c=r;null!=u&&(c=cue({inputs:{x:r},backend:n,attrs:{perm:u}}),l=v3.backend_util.getInnerMostAxes(l.length,r.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("all",l,c.shape.length);const[d,h]=v3.backend_util.computeOutAndReduceShapes(c.shape,l),p=v3.util.sizeFromShape(h),f=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(d),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;e<f.length;++e){const t=e*p;let n=m[t];for(let e=0;e<p;++e){const i=m[t+e];n=n&&i}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(c);const g=n.makeTensorInfo(d,c.dtype,f);if(o){const e=xce({inputs:{x:g},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(d,a)}});return n.disposeIntermediateTensorInfo(g),e}return g}};const Nce={kernelName:v3.Any,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;Dae(r,"any");const a=v3.util.parseAxisParam(s,r.shape);let l=a;const u=v3.backend_util.getAxesPermutation(l,r.shape.length);let c=r;null!=u&&(c=cue({inputs:{x:r},backend:n,attrs:{perm:u}}),l=v3.backend_util.getInnerMostAxes(l.length,r.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("any",l,c.shape.length);const[d,h]=v3.backend_util.computeOutAndReduceShapes(c.shape,l),p=v3.util.sizeFromShape(h),f=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(d),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;e<f.length;++e){const t=e*p;let n=m[t];for(let e=0;e<p;++e){const i=m[t+e];n=n||i}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(c);const g=n.makeTensorInfo(d,c.dtype,f);if(o){const e=xce({inputs:{x:g},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(d,a)}});return n.disposeIntermediateTensorInfo(g),e}return g}};const Dce={kernelName:v3.ArgMax,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;Dae(r,"argMax");let o=v3.util.parseAxisParam(s,r.shape);const a=v3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=cue({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=v3.backend_util.getInnerMostAxes(o.length,l.shape.length)),o=[o[0]],v3.backend_util.assertAxesAreInnerMostDims("argMax",o,l.shape.length);const[c,d]=v3.backend_util.computeOutAndReduceShapes(l.shape,o),h=v3.util.sizeFromShape(c),p=v3.util.makeZerosTypedArray(h,"int32"),f=v3.util.sizeFromShape(d),m=n.data.get(l.dataId).values;for(let e=0;e<p.length;++e){const t=e*f;let n=m[t],i=0;for(let e=0;e<f;++e){const r=m[t+e];r>n&&(n=r,i=e)}p[e]=i}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}};const Fce={kernelName:v3.ArgMin,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;Dae(r,"argMin");let o=v3.util.parseAxisParam(s,r.shape);const a=v3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=cue({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=v3.backend_util.getInnerMostAxes(o.length,l.shape.length)),o=[o[0]],v3.backend_util.assertAxesAreInnerMostDims("argMin",o,l.shape.length);const[c,d]=v3.backend_util.computeOutAndReduceShapes(l.shape,o),h=v3.util.sizeFromShape(c),p=v3.util.makeZerosTypedArray(h,"int32"),f=v3.util.sizeFromShape(d),m=n.data.get(l.dataId).values;for(let e=0;e<p.length;++e){const t=e*f;let n=m[t],i=0;for(let e=0;e<f;++e){const r=m[t+e];r<n&&(n=r,i=e)}p[e]=i}return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(c,"int32",p)}},Lce=lle(v3.Asin,e=>Math.asin(e)),Pce={kernelName:v3.Asin,backendName:"cpu",kernelFunc:Lce},Bce=lle(v3.Asinh,e=>Math.asinh(e)),$ce={kernelName:v3.Asinh,backendName:"cpu",kernelFunc:Bce},Uce=lle(v3.Atan,e=>Math.atan(e)),Vce={kernelName:v3.Atan,backendName:"cpu",kernelFunc:Uce},zce=$ae((e,t)=>Math.atan2(e,t)),jce=Kae(v3.Atan2,zce),Yce={kernelName:v3.Atan2,backendName:"cpu",kernelFunc:jce},Gce=lle(v3.Atanh,e=>Math.atanh(e)),Hce={kernelName:v3.Atanh,backendName:"cpu",kernelFunc:Gce};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Wce(e,t,n,i,r,s){const o=r.strideHeight,a=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,c=r.effectiveFilterHeight,d=r.effectiveFilterWidth,h=r.padInfo.top,p=r.padInfo.left,f="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,m=(0,v3.buffer)(r.outShape,n),g=m.values,_=r.outShape[1]*r.outShape[2]*r.outShape[3],y=r.outShape[2]*r.outShape[3],v=r.outShape[3];for(let t=0;t<r.batchSize;++t){const n=t*_,m=t*i[0];for(let t=0;t<r.inChannels;++t)for(let _=0;_<r.outHeight;++_){const b=_*o-h,T=Math.max(0,b),x=Math.min(r.inHeight,c+b),E=n+_*y;for(let n=0;n<r.outWidth;++n){const o=n*a-p,c=Math.max(0,o),h=Math.min(r.inWidth,d+o);let _=f,y=0,b=0;for(let n=T;n<x;n+=l){const r=m+n*i[1];for(let n=c;n<h;n+=u){const o=e[r+n*i[2]+t];"max"===s&&o>_?_=o:"avg"===s&&(y+=o,b++)}if(isNaN(_))break}g[E+n*v+t]="avg"===s?y/b:_}}}return m}function Xce(e,t,n,i,r=!1,s=!1){const o=(0,v3.buffer)(i.outShape,"int32"),a=i.strideHeight,l=i.strideWidth,u=i.dilationHeight,c=i.dilationWidth,d=i.effectiveFilterHeight,h=i.effectiveFilterWidth,p=i.padInfo.top,f=i.padInfo.left,m=(0,v3.buffer)(t,n,e);for(let e=0;e<i.batchSize;++e)for(let t=0;t<i.inChannels;++t)for(let n=0;n<i.outHeight;++n){const g=n*a-p;let _=g;for(;_<0;)_+=u;const y=Math.min(i.inHeight,d+g);for(let a=0;a<i.outWidth;++a){const d=a*l-f;let p=d;for(;p<0;)p+=c;const v=Math.min(i.inWidth,h+d);let b=Number.NEGATIVE_INFINITY,T=-1;for(let n=_;n<y;n+=u){const o=n-g;for(let a=p;a<v;a+=c){const l=a-d,u=m.get(e,n,a,t);u>b&&(b=u,T=r?s?((e*i.inHeight+n)*i.inWidth+a)*i.inChannels+t:(n*i.inWidth+a)*i.inChannels+t:o*h+l)}}o.set(T,e,n,a,t)}}return o}function qce(e,t,n,i,r,s){const o=r.strideDepth,a=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,c=r.dilationHeight,d=r.dilationWidth,h=r.effectiveFilterDepth,p=r.effectiveFilterHeight,f=r.effectiveFilterWidth,m=r.padInfo.front,g=r.padInfo.top,_=r.padInfo.left,y="max"===s?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,v=(0,v3.buffer)(r.outShape,n),b=v.values,T=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],x=r.outShape[2]*r.outShape[3]*r.outShape[4],E=r.outShape[3]*r.outShape[4],w=r.outShape[4];for(let t=0;t<r.batchSize;++t){const n=t*T,v=t*i[0];for(let t=0;t<r.inChannels;++t)for(let T=0;T<r.outDepth;++T){const I=T*o-m;let A=I;for(;A<0;)A+=u;const S=Math.min(r.inDepth,h+I),C=n+T*x;for(let n=0;n<r.outHeight;++n){const o=n*a-g;let h=o;for(;h<0;)h+=c;const m=Math.min(r.inHeight,p+o),T=C+n*E;for(let n=0;n<r.outWidth;++n){const o=n*l-_;let a=o;for(;a<0;)a+=d;const p=Math.min(r.inWidth,f+o),g=T+n*w;let x=y,E=0,I=0;for(let n=A;n<S;n+=u){const r=v+n*i[1];for(let n=h;n<m;n+=c){const o=r+n*i[2];for(let n=a;n<p;n+=d){const r=e[o+n*i[3]+t];if("max"===s&&r>x?x=r:"avg"===s&&(E+=r,I++),isNaN(x))break}if(isNaN(x))break}if(isNaN(x))break}b[g+t]="avg"===s?E/Math.max(I,1):x}}}}return v}const Kce={kernelName:v3.AvgPool,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;Dae(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=v3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&v3.util.arraysEqual(u.inShape,u.outShape))c=jae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=v3.util.computeStrides(r.shape),i=Wce(e,r.shape,r.dtype,t,u,"avg");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const Zce={kernelName:v3.AvgPool3D,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;Dae(r,"avgPool3d");const c=v3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=qce(n.data.get(r.dataId).values,r.shape,r.dtype,v3.util.computeStrides(r.shape),c,"avg");return n.makeTensorInfo(d.shape,"float32",d.values)}};const Qce={kernelName:v3.AvgPool3DGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;Dae([r,s],"avgPool3DGrad");const c=v3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=c.strideDepth,h=c.strideHeight,p=c.strideWidth,f=c.filterDepth,m=c.filterHeight,g=c.filterWidth,_=c.dilationDepth,y=c.dilationHeight,v=c.dilationWidth,b=c.effectiveFilterDepth,T=c.effectiveFilterHeight,x=c.effectiveFilterWidth,E=b-1-c.padInfo.front,w=x-1-c.padInfo.left,I=T-1-c.padInfo.top,A=(0,v3.buffer)(s.shape,"float32"),S=1/(f*m*g),C=n.bufferSync(r);for(let e=0;e<c.batchSize;++e)for(let t=0;t<c.inChannels;++t)for(let n=0;n<c.inDepth;++n)for(let i=0;i<c.inHeight;++i)for(let r=0;r<c.inWidth;++r){const s=n-E,o=i-I,a=r-w;let l=0;for(let n=0;n<b;n+=_){const i=(s+n)/d;if(!(i<0||i>=c.outDepth||Math.floor(i)!==i))for(let n=0;n<T;n+=y){const r=(o+n)/h;if(!(r<0||r>=c.outHeight||Math.floor(r)!==r))for(let n=0;n<x;n+=v){const s=(a+n)/p;if(s<0||s>=c.outWidth||Math.floor(s)!==s)continue;l+=C.get(e,i,r,s,t)}}}A.set(l*S,e,n,i,r,t)}return n.makeTensorInfo(A.shape,A.dtype,A.values)}};const Jce={kernelName:v3.AvgPoolGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;Dae([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=v3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=c.strideHeight,h=c.strideWidth,p=c.filterHeight,f=c.filterWidth,m=c.dilationHeight,g=c.dilationWidth,_=c.effectiveFilterHeight,y=c.effectiveFilterWidth,v=y-1-c.padInfo.left,b=_-1-c.padInfo.top,T=(0,v3.buffer)(o.shape,"float32"),x=1/(p*f),E=n.data.get(r.dataId).values,w=(0,v3.buffer)(r.shape,"float32",E);for(let e=0;e<c.batchSize;++e)for(let t=0;t<c.inChannels;++t)for(let n=0;n<c.inHeight;++n)for(let i=0;i<c.inWidth;++i){const r=n-b,s=i-v;let o=0;for(let n=0;n<_;n+=m){const i=(r+n)/d;if(!(i<0||i>=c.outHeight||Math.floor(i)!==i))for(let n=0;n<y;n+=g){const r=(s+n)/h;if(r<0||r>=c.outWidth||Math.floor(r)!==r)continue;o+=w.get(e,i,r,t)}}T.set(o*x,e,n,i,t)}return n.makeTensorInfo(T.shape,T.dtype,T.values)}};const ede={kernelName:v3.FusedBatchNorm,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,scale:s,offset:o,mean:a,variance:l}=t;v3.util.assert(a.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v3.util.assert(null==o||a.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v3.util.assert(null==s||a.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Dae([r,a,l,s,o],"batchNorm");let{varianceEpsilon:u}=i;null==u&&(u=.001);const c=n.data.get(r.dataId).values,d=n.data.get(a.dataId).values,h=n.data.get(l.dataId).values,p=s?n.data.get(s.dataId).values:new Float32Array([1]),f=o?n.data.get(o.dataId).values:new Float32Array([0]),m=new Float32Array(c.length),g=f.length,_=p.length,y=h.length,v=d.length;let b=0,T=0,x=0,E=0;for(let e=0;e<c.length;++e)m[e]=f[b++]+(c[e]-d[T++])*p[x++]/Math.sqrt(h[E++]+u),b>=g&&(b=0),T>=v&&(T=0),x>=_&&(x=0),E>=y&&(E=0);return n.makeTensorInfo(r.shape,r.dtype,m)}};const tde={kernelName:v3.BatchToSpaceND,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;Dae([r],"batchToSpaceND");const a=s.reduce((e,t)=>e*t),l=v3.backend_util.getReshaped(r.shape,s,a),u=v3.backend_util.getPermuted(l.length,s.length),c=v3.backend_util.getReshapedPermuted(r.shape,s,a),d=v3.backend_util.getSliceBeginCoords(o,s.length),h=v3.backend_util.getSliceSize(c,o,s.length),p=xce({inputs:{x:r},backend:n,attrs:{shape:l}}),f=cue({inputs:{x:p},backend:n,attrs:{perm:u}}),m=xce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=Due({inputs:{x:m},backend:n,attrs:{begin:d,size:h}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}};const nde={kernelName:v3.Bincount,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=nle(n.data.get(r.dataId).values,n.data.get(s.dataId).values,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,a)}};const ide={kernelName:v3.BroadcastArgs,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.data.get(i.dataId).values,o=n.data.get(r.dataId).values,a=v3.backend_util.assertAndGetBroadcastShape(Array.from(s),Array.from(o));return n.makeTensorInfo([a.length],"int32",Int32Array.from(a))}},rde=lle(v3.ClipByValue,(e,t)=>{const n=t;return e>n.clipValueMax?n.clipValueMax:e<n.clipValueMin?n.clipValueMin:e}),sde={kernelName:v3.ClipByValue,backendName:"cpu",kernelFunc:rde},ode={kernelName:v3.ComplexAbs,backendName:"cpu",kernelFunc:e=>{const{x:t}=e.inputs,n=e.backend,i=new Float32Array(v3.util.sizeFromShape(t.shape)),r=n.data.get(t.dataId),s=r.complexTensorInfos.real,o=r.complexTensorInfos.imag,a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values;for(let e=0;e<a.length;e++){const t=a[e],n=l[e];i[e]=Math.hypot(t,n)}return n.makeOutput(i,t.shape,"float32")}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ade(e){const{inputs:t,backend:n}=e,{input:i}=t,r=n.data.get(i.dataId).complexTensorInfos.imag,s=n.data.get(r.dataId).values;return n.makeTensorInfo(r.shape,r.dtype,s)}const lde={kernelName:v3.Imag,backendName:"cpu",kernelFunc:ade};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ude(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=v3.util.parseAxisParam(r,t[0].shape)[0],o=t.map(e=>e.shape);v3.backend_util.assertParamsConsistent(o,s);let a=v3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===v3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>v3.util.sizeFromShape(e.shape)>0);if(1===l.length)return jae({inputs:{x:l[0]},backend:n});if("complex64"===l[0].dtype){const e=l.map(e=>Gae({inputs:{input:e},backend:n})),t=l.map(e=>ade({inputs:{input:e},backend:n})),i=ude({inputs:e,backend:n,attrs:{axis:s}}),r=ude({inputs:t,backend:n,attrs:{axis:s}}),o=Uae({inputs:{real:i,imag:r},backend:n});return e.forEach(e=>n.disposeIntermediateTensorInfo(e)),t.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(r),o}const u=l.map(e=>{const t=v3.util.sizeFromShape(e.shape.slice(s));return xce({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),c=u.map(e=>({vals:n.data.get(e.dataId).values,shape:e.shape}));a=v3.backend_util.computeOutShape(u.map(e=>e.shape),1);const d=1===u[0].shape[0],h=ple(c,a,t[0].dtype,d),p=v3.backend_util.computeOutShape(l.map(e=>e.shape),s),f=n.makeTensorInfo(p,t[0].dtype,h);return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}const cde={kernelName:v3.Concat,backendName:"cpu",kernelFunc:ude};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function dde(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dataFormat:l,dilations:u,dimRoundingMode:c}=i;Dae([r,s],"conv2d");const d=v3.backend_util.convertConv2DDataFormat(l),h=v3.backend_util.computeConv2DInfo(r.shape,s.shape,o,u,a,c,!1,d),p=h.filterHeight,f=h.filterWidth,m=h.dilationHeight,g=h.dilationWidth,_=h.padInfo.left,y=h.padInfo.top,v="channelsLast"===h.dataFormat,b=new v3.TensorBuffer(h.outShape,r.dtype),T=v3.util.computeStrides(r.shape),x=v3.util.computeStrides(s.shape),E=T[0],w=v?T[1]:T[2],I=v?T[2]:1,A=v?1:T[1],S=b.strides[0],C=v?b.strides[1]:b.strides[2],O=v?b.strides[2]:1,M=v?1:b.strides[1],k=n.data.get(r.dataId).values,R=n.data.get(s.dataId).values,N=b.values;for(let e=0;e<h.batchSize;++e){const t=e*E,n=e*S;for(let e=0;e<h.outHeight;++e){const i=n+e*C,r=e*h.strideHeight-y;for(let e=0;e<p;++e){const n=r+e*m;if(n<0||n>=h.inHeight)continue;const s=e*x[0],o=t+n*w;for(let e=0;e<h.outWidth;++e){const t=i+e*O,n=e*h.strideWidth-_;for(let e=0;e<f;++e){const i=n+e*g;if(i<0||i>=h.inWidth)continue;const r=o+i*I;let a=s+e*x[1];for(let e=0;e<h.inChannels;++e){const n=k[r+e*A];for(let e=0;e<h.outChannels;++e)N[t+e*M]+=n*R[a+e];a+=h.outChannels}}}}}}return n.makeTensorInfo(b.shape,b.dtype,N)}const hde={kernelName:v3.Conv2D,backendName:"cpu",kernelFunc:dde};const pde={kernelName:v3.Conv2DBackpropFilter,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,dataFormat:l,dimRoundingMode:u,filterShape:c}=i;Dae([r,s],"conv2dBackpropFilter");const d=v3.backend_util.convertConv2DDataFormat(l),h=v3.backend_util.computeConv2DInfo(r.shape,c,o,1,a,u,!1,d),{strideHeight:p,strideWidth:f,filterHeight:m,filterWidth:g}=h,_="channelsLast"===h.dataFormat,y=new v3.TensorBuffer(h.filterShape,"float32"),v=h.padInfo.left,b=h.padInfo.top,T=n.data.get(r.dataId).values,x=n.data.get(s.dataId).values,E=new v3.TensorBuffer(r.shape,r.dtype,T),w=new v3.TensorBuffer(s.shape,s.dtype,x);for(let e=0;e<m;++e){const t=Math.max(0,Math.ceil((b-e)/p)),n=Math.min(h.outHeight,(h.inHeight+b-e)/p);for(let i=0;i<g;++i){const r=Math.max(0,Math.ceil((v-i)/f)),s=Math.min(h.outWidth,(h.inWidth+v-i)/f);for(let o=0;o<h.inChannels;++o)for(let a=0;a<h.outChannels;++a){let l=0;for(let u=0;u<h.batchSize;++u)for(let c=t;c<n;++c){const t=e+c*p-b;for(let e=r;e<s;++e){const n=i+e*f-v;l+=_?E.get(u,t,n,o)*w.get(u,c,e,a):E.get(u,o,t,n)*w.get(u,a,c,e)}}y.set(l,e,i,o,a)}}}return n.makeTensorInfo(y.shape,y.dtype,y.values)}};const fde={kernelName:v3.Conv2DBackpropInput,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{inputShape:o,strides:a,pad:l,dataFormat:u,dimRoundingMode:c}=i;Dae([r,s],"conv2dBackpropInput");const d=v3.util.computeStrides(s.shape),h=v3.util.computeStrides(r.shape);let p=v3.backend_util.convertConv2DDataFormat(u);const f=v3.backend_util.computeConv2DInfo(o,s.shape,a,1,l,c,!1,p),m=new v3.TensorBuffer(f.inShape,"float32"),g=m.values,_=n.data.get(r.dataId).values,y=n.data.get(s.dataId).values,[v,b,T]=d,{batchSize:x,filterHeight:E,filterWidth:w,inChannels:I,inHeight:A,inWidth:S,outChannels:C,outHeight:O,outWidth:M,strideHeight:k,strideWidth:R}=f;p=f.dataFormat;const N=E-1-f.padInfo.top,D=w-1-f.padInfo.left,F="channelsLast"===p,L=m.strides[0],P=F?m.strides[1]:m.strides[2],B=F?m.strides[2]:1,$=F?1:m.strides[1],U=h[0],V=F?h[1]:h[2],z=F?h[2]:1,j=F?1:h[1];for(let e=0;e<x;++e)for(let t=0;t<I;++t)for(let n=0;n<A;++n){const i=n-N,r=Math.max(0,Math.ceil(i/k)),s=Math.min(O,(E+i)/k);for(let o=0;o<S;++o){const a=o-D,l=Math.max(0,Math.ceil(a/R)),u=Math.min(M,(w+a)/R);let c=0;for(let n=r;n<s;++n){const r=n*k-i;for(let i=l;i<u;++i){const s=U*e+V*n+z*i,o=v*(E-1-r)+b*(w-1-(i*R-a))+T*t;for(let e=0;e<C;++e){c+=_[s+j*e]*y[o+e]}}}g[L*e+P*n+B*o+$*t]=c}}return n.makeTensorInfo(m.shape,m.dtype,m.values)}};const mde={kernelName:v3.Conv3D,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i;Dae([r,s],"conv3d");const u=v3.backend_util.computeConv3DInfo(r.shape,s.shape,o,l,a),{filterDepth:c,filterHeight:d,filterWidth:h,dilationDepth:p,dilationHeight:f,dilationWidth:m,padInfo:g}=u,_=g.front,y=g.left,v=g.top,b=new v3.TensorBuffer(u.outShape,r.dtype),T=n.data.get(r.dataId).values,x=n.data.get(s.dataId).values,E=b.values,w=v3.util.computeStrides(r.shape),I=v3.util.computeStrides(s.shape);for(let e=0;e<u.batchSize;++e){const t=e*w[0],n=e*b.strides[0];for(let e=0;e<u.outDepth;++e){const i=n+e*b.strides[1],r=e*u.strideDepth-_;for(let e=0;e<c;++e){const n=r+e*p;if(n<0||n>=u.inDepth)continue;const s=e*I[0],o=t+n*w[1];for(let e=0;e<u.outHeight;++e){const t=i+e*b.strides[2],n=e*u.strideHeight-v;for(let e=0;e<d;++e){const i=n+e*f;if(i<0||i>=u.inHeight)continue;const r=s+e*I[1],a=o+i*w[2];for(let e=0;e<u.outWidth;++e){const n=t+e*u.outChannels,i=e*u.strideWidth-y;for(let e=0;e<h;++e){const t=i+e*m;if(t<0||t>=u.inWidth)continue;const s=r+e*I[2],o=a+t*u.inChannels;let l=s;for(let e=0;e<u.inChannels;++e){const t=T[o+e];for(let e=0;e<u.outChannels;++e)E[n+e]+=t*x[l+e];l+=u.outChannels}}}}}}}}return n.makeTensorInfo(b.shape,b.dtype,b.values)}};const gde={kernelName:v3.Conv3DBackpropFilterV2,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,filterShape:l}=i;Dae([r,s],"conv3dBackpropFilterV2");const u=v3.util.computeStrides(r.shape),c=v3.util.computeStrides(s.shape),d=v3.backend_util.computeConv3DInfo(r.shape,l,o,1,a),h=d.strideDepth,p=d.strideHeight,f=d.strideWidth,m=d.filterDepth,g=d.filterHeight,_=d.filterWidth,y=new v3.TensorBuffer(d.filterShape,"float32"),v=y.values,[b,T,x,E]=y.strides,w=n.data.get(s.dataId).values,[I,A,S,C]=c,O=n.data.get(r.dataId).values,[M,k,R,N]=u,D=d.padInfo.front,F=d.padInfo.left,L=d.padInfo.top;for(let e=0;e<m;++e){const t=Math.max(0,Math.ceil((D-e)/h)),n=Math.min(d.outDepth,(d.inDepth+D-e)/h),i=e*b;for(let r=0;r<g;++r){const s=Math.max(0,Math.ceil((L-r)/p)),o=Math.min(d.outHeight,(d.inHeight+L-r)/p),a=r*T+i;for(let i=0;i<_;++i){const l=Math.max(0,Math.ceil((F-i)/f)),u=Math.min(d.outWidth,(d.inWidth+F-i)/f),c=i*x+a;for(let a=0;a<d.inChannels;++a){const m=a*E+c;for(let c=0;c<d.outChannels;++c){let g=0;for(let m=0;m<d.batchSize;++m){const d=m*M,_=m*I;for(let m=t;m<n;++m){const t=(e+m*h-D)*k+d,n=m*A+_;for(let e=s;e<o;++e){const s=(r+e*p-L)*R+t,o=e*S+n;for(let e=l;e<u;++e){const t=e*C+o;g+=O[(i+e*f-F)*N+s+a]*w[t+c]}}}}v[m+c]=g}}}}}return n.makeTensorInfo(y.shape,y.dtype,y.values)}};const _de={kernelName:v3.Conv3DBackpropInputV2,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides:a,inputShape:l}=i;Dae([r],"conv3dBackpropInputV2");const u=v3.util.computeStrides(r.shape),c=v3.util.computeStrides(s.shape),d=v3.backend_util.computeConv3DInfo(l,s.shape,a,1,o),h=new v3.TensorBuffer(d.inShape,"float32"),p=h.values,[f,m,g,_]=h.strides,y=n.data.get(r.dataId).values,[v,b,T,x]=u,E=n.data.get(s.dataId).values,[w,I,A,S]=c,{batchSize:C,filterDepth:O,filterHeight:M,filterWidth:k,inChannels:R,inDepth:N,inHeight:D,inWidth:F,outChannels:L,outDepth:P,outHeight:B,outWidth:$,strideDepth:U,strideHeight:V,strideWidth:z}=d,j=O-1-d.padInfo.front,Y=M-1-d.padInfo.top,G=k-1-d.padInfo.left;for(let e=0;e<C;++e)for(let t=0;t<R;++t)for(let n=0;n<N;++n){const i=n-j,r=Math.max(0,Math.ceil(i/U)),s=Math.min(P,(O+i)/U);for(let o=0;o<D;++o){const a=o-Y,l=Math.max(0,Math.ceil(a/V)),u=Math.min(B,(M+a)/V);for(let c=0;c<F;++c){const d=c-G,h=Math.max(0,Math.ceil(d/z)),C=Math.min($,(k+d)/z);let R=0;for(let n=r;n<s;++n){const r=n*U-i;for(let i=l;i<u;++i){const s=i*V-a;for(let o=h;o<C;++o){const a=v*e+b*n+T*i+x*o,l=w*(O-1-r)+I*(M-1-s)+A*(k-1-(o*z-d))+S*t;for(let e=0;e<L;++e){R+=y[a+e]*E[l+e]}}}}p[f*e+m*n+g*o+_*c+t]=R}}}return n.makeTensorInfo(h.shape,h.dtype,h.values)}},yde=lle(v3.Cos,e=>Math.cos(e)),vde={kernelName:v3.Cos,backendName:"cpu",kernelFunc:yde},bde=lle(v3.Cosh,e=>Math.cosh(e)),Tde={kernelName:v3.Cosh,backendName:"cpu",kernelFunc:bde};const xde={kernelName:v3.CropAndResize,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,boxes:s,boxInd:o}=t,{cropSize:a,method:l,extrapolationValue:u}=i,[c,d,h,p]=r.shape,f=s.shape[0],[m,g]=a,_=(0,v3.buffer)([f,m,g,p],"float32"),y=n.data.get(s.dataId).values,v=n.data.get(o.dataId).values,b=n.data.get(r.dataId).values,T=v3.util.computeStrides(r.shape),x=v3.util.computeStrides(_.shape);for(let e=0;e<f;e++){const t=4*e,n=y[t],i=y[t+1],r=y[t+2],s=y[t+3],o=v[e];if(o>=c)continue;const a=m>1?(r-n)*(d-1)/(m-1):0,f=g>1?(s-i)*(h-1)/(g-1):0;for(let t=0;t<m;t++){const c=m>1?n*(d-1)+t*a:.5*(n+r)*(d-1);if(c<0||c>d-1)for(let n=0;n<g;n++)for(let i=0;i<p;i++){const r=i+n*x[2]+t*x[1]+e*x[0];_.values[r]=u}else if("bilinear"===l){const n=Math.floor(c),r=Math.ceil(c),a=c-n;for(let l=0;l<g;l++){const c=g>1?i*(h-1)+l*f:.5*(i+s)*(h-1);if(c<0||c>h-1){for(let n=0;n<p;n++){const i=n+l*x[2]+t*x[1]+e*x[0];_.values[i]=u}continue}const d=Math.floor(c),m=Math.ceil(c),y=c-d;for(let i=0;i<p;i++){let s=i+d*T[2]+n*T[1]+o*T[0];const u=b[s];s=i+m*T[2]+n*T[1]+o*T[0];const c=b[s];s=i+d*T[2]+r*T[1]+o*T[0];const h=b[s];s=i+m*T[2]+r*T[1]+o*T[0];const p=u+(c-u)*y,f=h+(b[s]-h)*y;s=i+l*x[2]+t*x[1]+e*x[0],_.values[s]=p+(f-p)*a}}}else for(let n=0;n<g;++n){const r=g>1?i*(h-1)+n*f:.5*(i+s)*(h-1);if(r<0||r>h-1){for(let i=0;i<p;i++){const r=i+n*x[2]+t*x[1]+e*x[0];_.values[r]=u}continue}const a=Math.round(r),l=Math.round(c);for(let i=0;i<p;i++){const r=i+a*T[2]+l*T[1]+o*T[0],s=i+n*x[2]+t*x[1]+e*x[0];_.values[s]=b[r]}}}}return n.makeTensorInfo(_.shape,_.dtype,_.values)}};const Ede={kernelName:v3.Cumprod,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;Dae(r,"cumprod");const l=v3.backend_util.getAxesPermutation([s],r.shape.length);let u=r;null!=l&&(u=cue({inputs:{x:r},backend:n,attrs:{perm:l}}));const c=v3.backend_util.getInnerMostAxes(1,r.shape.length)[0];if(c!==u.shape.length-1)throw new Error(`backend.cumprod in CPU expects an inner-most axis=${u.shape.length-1} but got axis=${c}`);const d=(0,v3.upcastType)(u.dtype,"int32"),h=v3.util.makeOnesTypedArray(v3.util.sizeFromShape(u.shape),d),p=n.data.get(u.dataId).values,f=u.shape[u.shape.length-1],m=a?(e,t)=>e+f-t-1:(e,t)=>e+t;for(let e=0;e<p.length;e+=f)for(let t=0;t<f;t++){const n=m(e,t);if(0===t)h[n]=o?1:p[n];else{const i=m(e,t-1);h[n]=o?p[i]*h[i]:p[n]*h[i]}}const g=n.makeTensorInfo(u.shape,d,h);if(null!=l){const e=cue({inputs:{x:g},backend:n,attrs:{perm:v3.backend_util.getUndoAxesPermutation(l)}});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(u),e}return g}};const wde={kernelName:v3.Cumsum,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;Dae(r,"cumsum");const l=v3.backend_util.getAxesPermutation([s],r.shape.length);let u=r;null!=l&&(u=cue({inputs:{x:r},backend:n,attrs:{perm:l}}));const c=v3.backend_util.getInnerMostAxes(1,r.shape.length)[0];if(c!==u.shape.length-1)throw new Error(`backend.cumsum in CPU expects an inner-most axis=${u.shape.length-1} but got axis=${c}`);const d=(0,v3.upcastType)(u.dtype,"int32"),h=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(u.shape),d),p=n.data.get(u.dataId).values,f=u.shape[u.shape.length-1],m=a?(e,t)=>e+f-t-1:(e,t)=>e+t;for(let e=0;e<p.length;e+=f)for(let t=0;t<f;t++){const n=m(e,t);if(0===t)h[n]=o?0:p[n];else{const i=m(e,t-1);h[n]=o?p[i]+h[i]:p[n]+h[i]}}const g=n.makeTensorInfo(u.shape,d,h);if(null!=l){const e=cue({inputs:{x:g},backend:n,attrs:{perm:v3.backend_util.getUndoAxesPermutation(l)}});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(u),e}return g}};const Ide={kernelName:v3.DenseBincount,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o,binaryOutput:a}=i;if(1===r.shape.length){const e=nle(n.data.get(r.dataId).values,n.data.get(s.dataId).values,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,e)}if(2===r.shape.length){const e=ile(n.bufferSync(r),n.bufferSync(s),o,a);return n.makeTensorInfo(e.shape,s.dtype,e.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};const Ade={kernelName:v3.DepthToSpace,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockSize:s,dataFormat:o}=i;v3.util.assert("NHWC"===o,()=>`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${o}`);const a=r.shape[0],l=r.shape[1],u=r.shape[2],c=r.shape[3],d=l*s,h=u*s,p=c/(s*s),f=n.data.get(r.dataId).values,m=new Float32Array(a*d*h*p);let g=0;for(let e=0;e<a;++e)for(let t=0;t<d;++t){const n=Math.floor(t/s),i=t%s;for(let t=0;t<h;++t){const r=Math.floor(t/s),o=(i*s+t%s)*p;for(let t=0;t<p;++t){const i=t+o+c*(r+u*(n+l*e));m[g++]=f[i]}}}return n.makeTensorInfo([a,d,h,p],r.dtype,m)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Sde(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l,dimRoundingMode:u}=i;Dae([r,s],"depthwiseConv2DNative");const c=v3.util.computeStrides(r.shape),d=v3.util.computeStrides(s.shape);let h=l;null==h&&(h=[1,1]),v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${h}'`);const p=v3.backend_util.computeConv2DInfo(r.shape,s.shape,o,h,a,u,!0),{filterHeight:f,filterWidth:m,dilationHeight:g,dilationWidth:_,padInfo:y}=p,v=y.left,b=y.top,T=p.outChannels/p.inChannels,x=new v3.TensorBuffer(p.outShape,r.dtype),E=n.data.get(r.dataId).values,w=n.data.get(s.dataId).values,I=x.values;for(let e=0;e<p.batchSize;++e){const t=e*c[0],n=e*x.strides[0];for(let e=0;e<p.outHeight;++e){const i=n+e*x.strides[1],r=e*p.strideHeight-b;for(let e=0;e<f;++e){const n=r+e*g;if(n<0||n>=p.inHeight)continue;const s=e*d[0],o=t+n*c[1];for(let e=0;e<p.outWidth;++e){const t=i+e*x.strides[2],n=e*p.strideWidth-v;for(let e=0;e<m;++e){const i=n+e*_;if(i<0||i>=p.inWidth)continue;const r=s+e*d[1],a=o+i*p.inChannels;let l=t,u=r;for(let e=0;e<p.inChannels;++e){const t=E[a+e];for(let e=0;e<T;++e)I[l+e]+=t*w[u+e];l+=T,u+=T}}}}}}return n.makeTensorInfo(x.shape,x.dtype,x.values)}const Cde={kernelName:v3.DepthwiseConv2dNative,backendName:"cpu",kernelFunc:Sde};const Ode={kernelName:v3.DepthwiseConv2dNativeBackpropFilter,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,filterShape:c}=i;Dae([r,s],"depthwiseConv2dNativeBackpropFilter");const d=v3.backend_util.computeConv2DInfo(r.shape,c,o,a,l,u,!0),{strideHeight:h,strideWidth:p,filterHeight:f,filterWidth:m}=d,g=new v3.TensorBuffer(d.filterShape,"float32"),_=d.padInfo.left,y=d.padInfo.top,v=d.outChannels/d.inChannels,b=n.data.get(r.dataId).values,T=new v3.TensorBuffer(r.shape,r.dtype,b),x=n.data.get(s.dataId).values,E=new v3.TensorBuffer(s.shape,s.dtype,x);for(let e=0;e<f;++e){const t=Math.max(0,Math.ceil((y-e)/h)),n=Math.min(d.outHeight,(d.inHeight+y-e)/h);for(let i=0;i<m;++i){const r=Math.max(0,Math.ceil((_-i)/p)),s=Math.min(d.outWidth,(d.inWidth+_-i)/p);for(let o=0;o<d.outChannels;++o){const a=Math.trunc(o/v),l=o%v;let u=0;for(let l=0;l<d.batchSize;++l)for(let c=t;c<n;++c){const t=e+c*h-y;for(let e=r;e<s;++e){const n=i+e*p-_;u+=T.get(l,t,n,a)*E.get(l,c,e,o)}}g.set(u,e,i,a,l)}}}return n.makeTensorInfo(g.shape,g.dtype,g.values)}};const Mde={kernelName:v3.DepthwiseConv2dNativeBackpropInput,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,inputShape:c}=i;Dae([r,s],"depthwiseConv2DNativeBackpropInput");const d=v3.util.computeStrides(r.shape),h=v3.util.computeStrides(s.shape),p=v3.backend_util.computeConv2DInfo(c,s.shape,o,a,l,u,!0),f=new v3.TensorBuffer(p.inShape,"float32"),m=f.values,[g,_,y]=f.strides,v=n.data.get(r.dataId).values,[b,T,x]=d,E=n.data.get(s.dataId).values,[w,I,A]=h,{batchSize:S,filterHeight:C,filterWidth:O,inChannels:M,inHeight:k,inWidth:R,outChannels:N,outHeight:D,outWidth:F,strideHeight:L,strideWidth:P}=p,B=C-1-p.padInfo.top,$=O-1-p.padInfo.left,U=N/M;for(let e=0;e<S;++e)for(let t=0;t<M;++t)for(let n=0;n<k;++n){const i=n-B,r=Math.max(0,Math.ceil(i/L)),s=Math.min(D,(C+i)/L);for(let o=0;o<R;++o){const a=o-$,l=Math.max(0,Math.ceil(a/P)),u=Math.min(F,(O+a)/P);let c=0;for(let n=r;n<s;++n){const r=n*L-i;for(let i=l;i<u;++i){const s=b*e+T*n+x*i,o=w*(C-1-r)+I*(O-1-(i*P-a))+A*t;for(let e=0;e<U;++e){c+=v[s+(t*U+e)]*E[o+e]}}}m[g*e+_*n+y*o+t]=c}}return n.makeTensorInfo(f.shape,f.dtype,f.values)}};const kde={kernelName:v3.Diag,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=v3.util.sizeFromShape(i.shape),s=n.data.get(i.dataId).values,o=(0,v3.buffer)([r,r],i.dtype),a=o.values;for(let e=0;e<s.length;e++)a[e*r+e]=s[e];const l=[...i.shape,...i.shape];return n.makeTensorInfo(l,o.dtype,o.values)}},Rde={kernelName:v3.Dilation2D,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r}=e,{strides:s,pad:o,dilations:a}=n,l=t,u=l.data.get(i.dataId).values,c=i.shape.length,d=l.data.get(r.dataId).values,h=r.shape.length,{batchSize:p,inHeight:f,inWidth:m,inChannels:g,outHeight:_,outWidth:y,padInfo:v,strideHeight:b,strideWidth:T,filterHeight:x,filterWidth:E,dilationHeight:w,dilationWidth:I,outShape:A}=v3.backend_util.computeDilation2DInfo(i.shape,r.shape,s,o,"NHWC",a),S=v3.util.sizeFromShape(A),C=A.length,O=v3.util.getArrayFromDType(i.dtype,S);for(let e=0;e<p;++e)for(let t=0;t<_;++t){const n=t*b-v.top;for(let s=0;s<y;++s){const o=s*T-v.left;for(let a=0;a<g;++a){let l=Number.MIN_SAFE_INTEGER;for(let t=0;t<x;++t){const s=n+t*w;if(s>=0&&s<f)for(let n=0;n<E;++n){const p=o+n*I;if(p>=0&&p<m){const o=v3.util.locToIndex([e,s,p,a],c,v3.util.computeStrides(i.shape)),f=v3.util.locToIndex([t,n,a],h,v3.util.computeStrides(r.shape)),m=u[o]+d[f];m>l&&(l=m)}}}O[v3.util.locToIndex([e,t,s,a],C,v3.util.computeStrides(A))]=l}}}return{dataId:l.write(v3.util.toTypedArray(O,i.dtype),A,i.dtype),shape:A,dtype:i.dtype}}},Nde={kernelName:v3.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=v3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=v3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=v3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);v3.util.assert(s.rank===I.length,()=>`Error in ${v3.Dilation2DBackpropFilter}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=v3.util.toNestedArray(I,u.data.get(s.dataId).values),S=v3.util.makeZerosNestedTypedArray(r.shape,r.dtype);for(let e=0;e<h;++e)for(let t=0;t<g;++t){const n=t*v-y.top;for(let i=0;i<_;++i){const r=i*b-y.left;for(let s=0;s<m;++s){let o=Number.MIN_SAFE_INTEGER,a=0,l=0;for(let t=0;t<T;++t){const i=n+t*E;if(i>=0&&i<p)for(let n=0;n<x;++n){const u=r+n*w;if(u>=0&&u<f){const r=c[e][i][u][s]+d[t][n][s];r>o&&(o=r,a=t,l=n)}}}S[a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(v3.util.toTypedArray(S,i.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},Dde={kernelName:v3.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,filter:r,dy:s}=e,{strides:o,pad:a,dilations:l}=n,u=t,c=v3.util.toNestedArray(i.shape,u.data.get(i.dataId).values),d=v3.util.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:h,inHeight:p,inWidth:f,inChannels:m,outHeight:g,outWidth:_,padInfo:y,strideHeight:v,strideWidth:b,filterHeight:T,filterWidth:x,dilationHeight:E,dilationWidth:w,outShape:I}=v3.backend_util.computeDilation2DInfo(i.shape,r.shape,o,a,"NHWC",l);v3.util.assert(s.rank===I.length,()=>`Error in ${v3.Dilation2DBackpropInput}, dy must have the same rank as output ${I.length}, but got ${s.rank}`);const A=v3.util.toNestedArray(I,u.data.get(s.dataId).values),S=v3.util.makeZerosNestedTypedArray(i.shape,i.dtype);for(let e=0;e<h;++e)for(let t=0;t<g;++t){const n=t*v-y.top;for(let i=0;i<_;++i){const r=i*b-y.left;for(let s=0;s<m;++s){let o=Number.MIN_SAFE_INTEGER,a=n<0?0:n,l=r<0?0:r;for(let t=0;t<T;++t){const i=n+t*E;if(i>=0&&i<p)for(let n=0;n<x;++n){const u=r+n*w;if(u>=0&&u<f){const r=c[e][i][u][s]+d[t][n][s];r>o&&(o=r,a=i,l=u)}}}S[e][a][l][s]+=A[e][t][i][s]}}}return{dataId:u.write(v3.util.toTypedArray(S,i.dtype),i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};const Fde={kernelName:v3.Draw,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r}=t,{canvas:s,options:o}=i,{contextOptions:a,imageOptions:l}=o||{},u=(null==l?void 0:l.alpha)||1,c=(null==a?void 0:a.contextType)||"2d";if("2d"!==c)throw new Error(`Context type ${a.contextType} is not supported by the CPU backend.`);const d=s.getContext(c,(null==a?void 0:a.contextAttributes)||{});if(null==d)throw new Error(`Could not get the context with ${c} type.`);const[h,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,_=new Uint8ClampedArray(p*h*4);for(let e=0;e<h*p;++e){const t=[0,0,0,255*u];for(let n=0;n<f;n++){const i=m[e*f+n];if("float32"===r.dtype){if(i<0||i>1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${i}.`)}else if("int32"===r.dtype&&(i<0||i>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${i}.`);1===f?(t[0]=i*g,t[1]=i*g,t[2]=i*g):t[n]=i*g}const n=4*e;_[n+0]=Math.round(t[0]),_[n+1]=Math.round(t[1]),_[n+2]=Math.round(t[2]),_[n+3]=Math.round(t[3])}s.width=p,s.height=h;const y=new ImageData(_,p,h);return d.putImageData(y,0,0),r}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Lde(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;let a;Dae(r,"sum"),a="bool"===r.dtype?Xae({inputs:{x:r},backend:n,attrs:{dtype:"int32"}}):jae({inputs:{x:r},backend:n});const l=a.shape.length,u=v3.util.parseAxisParam(s,a.shape),c=v3.backend_util.getAxesPermutation(u,l);let d=u,h=a;null!=c&&(h=cue({inputs:{x:a},backend:n,attrs:{perm:c}}),d=v3.backend_util.getInnerMostAxes(d.length,l)),v3.backend_util.assertAxesAreInnerMostDims("sum",d,h.shape.length);const[p,f]=v3.backend_util.computeOutAndReduceShapes(h.shape,d);let m=zae(n,p,v3.backend_util.upcastType(h.dtype,"int32"));const g=v3.util.sizeFromShape(f),_=n.data.get(m.dataId).values,y=n.data.get(h.dataId).values;for(let e=0;e<_.length;++e){const t=e*g;let n=0;for(let e=0;e<g;++e)n+=y[t+e];_[e]=n}if(o){const e=m;m=xce({inputs:{x:m},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(m.shape,u)}}),n.disposeIntermediateTensorInfo(e)}return n.disposeIntermediateTensorInfo(a),null!=c&&n.disposeIntermediateTensorInfo(h),m}const Pde={kernelName:v3.Sum,backendName:"cpu",kernelFunc:Lde};const Bde={kernelName:v3.Einsum,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,summedDims:a,idDims:l}=v3.backend_util.decodeEinsumEquation(r,s.length);v3.backend_util.checkEinsumDimSizes(o.length,l,s);const{path:u,steps:c}=v3.backend_util.getEinsumComputePath(a,l),d=c.length;let h=null,p=o.length;const f=[];for(let e=0;e<d;++e){for(const t of c[e]){const{permutationIndices:e,expandDims:i}=v3.backend_util.getEinsumPermutation(p,l[t]);let r;v3.backend_util.isIdentityPermutation(e)?r=s[t]:(r=cue({inputs:{x:s[t]},backend:n,attrs:{perm:e}}),f.push(r));const o=r.shape.slice();for(let e=0;e<i.length;++e)o.splice(i[e],0,1);v3.util.arraysEqual(r.shape,o)||(r=xce({inputs:{x:r},backend:n,attrs:{shape:o}}),f.push(r)),null===h?h=r:(h=nue({inputs:{a:r,b:h},backend:n}),f.push(h))}e<d-1&&(u[e]>=0&&(h=Lde({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}};const $de={kernelName:v3.EluGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{dy:i,y:r}=t;Dae([i,r],"eluGrad");const s=new Float32Array(v3.util.sizeFromShape(r.shape)),o=n.data.get(r.dataId).values,a=n.data.get(i.dataId).values;for(let e=0;e<o.length;++e){const t=o[e];s[e]=t>=0?a[e]:a[e]*(t+1)}return n.makeTensorInfo(r.shape,"float32",s)}},Ude=v3.backend_util.ERF_P,Vde=v3.backend_util.ERF_A1,zde=v3.backend_util.ERF_A2,jde=v3.backend_util.ERF_A3,Yde=v3.backend_util.ERF_A4,Gde=v3.backend_util.ERF_A5,Hde=lle(v3.Erf,e=>{const t=Math.sign(e),n=Math.abs(e),i=1/(1+Ude*n);return t*(1-((((Gde*i+Yde)*i+jde)*i+zde)*i+Vde)*i*Math.exp(-n*n))}),Wde={kernelName:v3.Erf,backendName:"cpu",kernelFunc:Hde};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Xde(e){const{inputs:t,backend:n,attrs:i}=e,{input:r}=t,{dim:s}=i,o=r.shape.length,a=r.shape.slice();let l=s;return s<0&&(v3.util.assert(-(o+1)<=s,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+s+1),a.splice(l,0,1),xce({inputs:{x:r},backend:n,attrs:{shape:a}})}const qde={kernelName:v3.ExpandDims,backendName:"cpu",kernelFunc:Xde},Kde=$ae((e,t)=>e/t),Zde=Kae(v3.RealDiv,Kde),Qde={kernelName:v3.RealDiv,backendName:"cpu",kernelFunc:Zde};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Jde(e,t,n){const i=e.shape,r=i[0],s=i[1],o=n.data.get(e.dataId),a=o.complexTensorInfos.real,l=o.complexTensorInfos.imag,u=[r,s],c=v3.util.sizeFromShape(u),d=v3.util.getTypedArrayFromDType("float32",c),h=v3.util.getTypedArrayFromDType("float32",c);for(let e=0;e<r;e++){const i=Due({inputs:{x:a},backend:n,attrs:{begin:[e,0],size:[1,s]}}),r=Due({inputs:{x:l},backend:n,attrs:{begin:[e,0],size:[1,s]}}),o=Uae({inputs:{real:i,imag:r},backend:n}),{real:u,imag:c}=ehe(o,t,n),p=v3.backend_util.mergeRealAndImagArrays(u,c);for(let t=0;t<s;t++){const n=v3.backend_util.getComplexWithIndex(p,t);d[e*s+t]=n.real,h[e*s+t]=n.imag}n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(o)}const p=n.makeTensorInfo(u,"float32",d),f=n.makeTensorInfo(u,"float32",h),m=Uae({inputs:{real:p,imag:f},backend:n});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),m}function ehe(e,t,n){const i=v3.util.sizeFromShape(e.shape),r=n.data.get(e.dataId),s=n.data.get(r.complexTensorInfos.real.dataId).values,o=n.data.get(r.complexTensorInfos.imag.dataId).values;if((a=i)&a-1){const e=function(e,t,n){const i=new Float32Array(2*t);for(let r=0;r<t;r++){let s=0,o=0;for(let i=0;i<t;i++){const a=v3.backend_util.exponent(r*i,t,n),l=v3.backend_util.getComplexWithIndex(e,i);s+=l.real*a.real-l.imag*a.imag,o+=l.real*a.imag+l.imag*a.real}n&&(s/=t,o/=t),v3.backend_util.assignToTypedArray(i,s,o,r)}return i}(v3.backend_util.mergeRealAndImagArrays(s,o),i,t);return v3.backend_util.splitRealAndImagArrays(e)}{const r=the(s,o,i,t,n),a=[e.shape[0],e.shape[1]];if(t){const e=n.makeTensorInfo(a,"float32",r.real),t=n.makeTensorInfo(a,"float32",r.imag),s=n.makeTensorInfo([],"float32",v3.util.createScalarValue(i,"float32")),o=jae({inputs:{x:s},backend:n}),l=Qde.kernelFunc({inputs:{a:e,b:s},backend:n}),u=Qde.kernelFunc({inputs:{a:t,b:o},backend:n}),c=n.data.get(l.dataId).values,d=n.data.get(u.dataId).values;return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(u),{real:c,imag:d}}return r}var a}function the(e,t,n,i,r){if(1===n)return{real:e,imag:t};const s=v3.backend_util.mergeRealAndImagArrays(e,t),o=n/2,a=v3.backend_util.complexWithEvenIndex(s),l=a.real,u=a.imag,c=[l.length],d=r.makeTensorInfo(c,"float32",l),h=r.makeTensorInfo(c,"float32",u),p=Uae({inputs:{real:d,imag:h},backend:r}),f=v3.backend_util.complexWithOddIndex(s),m=f.real,g=f.imag,_=[m.length],y=r.makeTensorInfo(_,"float32",m),v=r.makeTensorInfo(_,"float32",g),b=Uae({inputs:{real:y,imag:v},backend:r}),T=the(l,u,o,i,r),x=T.real,E=T.imag,w=[x.length],I=r.makeTensorInfo(w,"float32",x),A=r.makeTensorInfo(w,"float32",E),S=Uae({inputs:{real:I,imag:A},backend:r}),C=the(m,g,o,i,r),O=C.real,M=C.imag,k=[O.length],R=r.makeTensorInfo(k,"float32",O),N=r.makeTensorInfo(k,"float32",M),D=Uae({inputs:{real:R,imag:N},backend:r}),F=v3.backend_util.exponents(n,i),L=[F.real.length],P=r.makeTensorInfo(L,"float32",F.real),B=r.makeTensorInfo(L,"float32",F.imag),$=Uae({inputs:{real:P,imag:B},backend:r}),U=nue({inputs:{a:$,b:D},backend:r}),V=ele({inputs:{a:S,b:U},backend:r}),z=nce({inputs:{a:S,b:U},backend:r}),j=Gae({inputs:{input:V},backend:r}),Y=Gae({inputs:{input:z},backend:r}),G=ade({inputs:{input:V},backend:r}),H=ade({inputs:{input:z},backend:r}),W=ude({inputs:[j,Y],backend:r,attrs:{axis:0}}),X=ude({inputs:[G,H],backend:r,attrs:{axis:0}}),q=r.data.get(W.dataId).values,K=r.data.get(X.dataId).values;return r.disposeIntermediateTensorInfo(d),r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(b),r.disposeIntermediateTensorInfo(I),r.disposeIntermediateTensorInfo(A),r.disposeIntermediateTensorInfo(S),r.disposeIntermediateTensorInfo(R),r.disposeIntermediateTensorInfo(N),r.disposeIntermediateTensorInfo(D),r.disposeIntermediateTensorInfo(P),r.disposeIntermediateTensorInfo(B),r.disposeIntermediateTensorInfo($),r.disposeIntermediateTensorInfo(U),r.disposeIntermediateTensorInfo(V),r.disposeIntermediateTensorInfo(z),r.disposeIntermediateTensorInfo(j),r.disposeIntermediateTensorInfo(G),r.disposeIntermediateTensorInfo(Y),r.disposeIntermediateTensorInfo(H),r.disposeIntermediateTensorInfo(W),r.disposeIntermediateTensorInfo(X),{real:q,imag:K}}const nhe={kernelName:v3.FFT,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{input:i}=t,r=v3.util.sizeFromShape(i.shape),s=i.shape[i.shape.length-1],o=xce({inputs:{x:i},backend:n,attrs:{shape:[r/s,s]}}),a=Jde(o,!1,n),l=xce({inputs:{x:a},backend:n,attrs:{shape:i.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(a),l}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ihe(e){const{backend:t,attrs:n}=e,{shape:i,value:r,dtype:s}=n,o=s||v3.util.inferDtype(r),a=v3.util.getArrayFromDType(o,v3.util.sizeFromShape(i));return function(e,t){e.fill(t)}(a,r),t.makeTensorInfo(i,o,a)}const rhe={kernelName:v3.Fill,backendName:"cpu",kernelFunc:ihe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const she={kernelName:v3.FlipLeftRight,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,r=n,s=v3.util.getTypedArrayFromDType(i.dtype,v3.util.sizeFromShape(i.shape)),[o,a,l,u]=i.shape,c=r.data.get(i.dataId).values;for(let e=0;e<o;e++){const t=e*l*a*u;for(let e=0;e<a;e++){const n=e*(l*u);for(let e=0;e<l;e++){const i=e*u;for(let r=0;r<u;r++){const o=Math.round(l-e-1),a=t+n+i+r;let d=c[a];if(o>=0&&o<l){d=c[t+n+o*u+r]}s[a]=d}}}}return{dataId:r.write(s,i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}};const ohe={kernelName:v3.FusedConv2D,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h,activation:p,leakyreluAlpha:f}=i;let m=dde({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h}});if(o){const e=m;if("NCHW"===c&&1===o.shape.length&&1!==o.shape[0]){const e=xce({inputs:{x:o},backend:n,attrs:{shape:[o.shape[0],1,1]}});m=ele({inputs:{a:m,b:e},backend:n}),n.disposeIntermediateTensorInfo(e)}else m=ele({inputs:{a:m,b:o},backend:n});n.disposeIntermediateTensorInfo(e)}if(p){const e=m;if("NCHW"===c&&"prelu"===p&&1===a.shape.length&&1!==a.shape[0]){const e=xce({inputs:{x:a},backend:n,attrs:{shape:[a.shape[0],1,1]}});m=Tce(n,m,p,e,f),n.disposeIntermediateTensorInfo(e)}else m=Tce(n,m,p,a,f);n.disposeIntermediateTensorInfo(e)}return m}};const ahe={kernelName:v3.FusedDepthwiseConv2D,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h,activation:p,leakyreluAlpha:f}=i;let m=Sde({inputs:{x:r,filter:s},backend:n,attrs:{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h}});if(o){const e=m;m=ele({inputs:{a:m,b:o},backend:n}),n.disposeIntermediateTensorInfo(e)}if(p){const e=m;m=Tce(n,m,p,a,f),n.disposeIntermediateTensorInfo(e)}return m}};const lhe={kernelName:v3.GatherNd,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{params:i,indices:r}=t,s=v3.util.sizeFromShape(i.shape),o=r.shape,a=o[o.length-1],[l,u,c,d]=v3.backend_util.prepareAndValidate(i,r);if(0===u)return n.makeTensorInfo(l,i.dtype,[]);const h=Ole(n.data.get(r.dataId).values,n.bufferSync(i),i.dtype,u,a,c,d,i.shape,s);return n.makeTensorInfo(l,i.dtype,h.values)}};const uhe={kernelName:v3.GatherV2,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchDims:a}=i;Dae([r,s],"gatherV2");const l=v3.util.parseAxisParam(o,r.shape)[0],u=n.data.get(s.dataId).values,c=r.shape[l];for(let e=0;e<u.length;++e){const t=u[e];v3.util.assert(t<=c-1&&t>=0,()=>`GatherV2: the index value ${t} is not in [0, ${c-1}]`)}let d=a;null==a&&(d=0);const h=v3.util.sizeFromShape(s.shape),p=v3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,d),f=xce({inputs:{x:r},backend:n,attrs:{shape:[p.batchSize,p.outerSize,p.dimSize,p.sliceSize]}}),m=xce({inputs:{x:s},backend:n,attrs:{shape:[p.batchSize,h/p.batchSize]}}),g=[p.batchSize,p.outerSize,h/p.batchSize,p.sliceSize],_=n.bufferSync(m),y=Mle(n.bufferSync(f),_,g);return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.makeTensorInfo(p.outputShape,y.dtype,y.values)}};const che={kernelName:v3.IFFT,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{input:i}=t,r=v3.util.sizeFromShape(i.shape),s=i.shape[i.shape.length-1],o=xce({inputs:{x:i},backend:n,attrs:{shape:[r/s,s]}}),a=Jde(o,!0,n),l=xce({inputs:{x:a},backend:n,attrs:{shape:i.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(a),l}},dhe=lle(v3.IsFinite,e=>Number.isFinite(e)?1:0,"bool"),hhe={kernelName:v3.IsFinite,backendName:"cpu",kernelFunc:dhe},phe=lle(v3.IsInf,e=>Math.abs(e)===1/0?1:0,"bool"),fhe={kernelName:v3.IsInf,backendName:"cpu",kernelFunc:phe},mhe=lle(v3.IsNan,e=>Number.isNaN(e)?1:0,"bool"),ghe={kernelName:v3.IsNan,backendName:"cpu",kernelFunc:mhe};const _he={kernelName:v3.LinSpace,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=jle(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},yhe=lle(v3.Log1p,e=>Math.log1p(e)),vhe={kernelName:v3.Log1p,backendName:"cpu",kernelFunc:yhe},bhe=$ae((e,t)=>e&&t),The=Kae(v3.LogicalAnd,bhe,null,"bool"),xhe={kernelName:v3.LogicalAnd,backendName:"cpu",kernelFunc:The},Ehe=lle(v3.LogicalNot,e=>e?0:1,"bool"),whe={kernelName:v3.LogicalNot,backendName:"cpu",kernelFunc:Ehe},Ihe=$ae((e,t)=>e||t),Ahe=Kae(v3.LogicalOr,Ihe,null,"bool"),She={kernelName:v3.LogicalOr,backendName:"cpu",kernelFunc:Ahe};const Che={kernelName:v3.LRN,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{depthRadius:s,bias:o,alpha:a,beta:l}=i;Dae(r,"LRN");const u=r.shape[3],c=u-1,d=n.data.get(r.dataId).values,h=v3.util.sizeFromShape(r.shape),p=new Float32Array(h);function f(e){const t=e%u;let n=e-t+Math.max(0,t-s);const i=e-t+Math.min(t+s,c);let r=0;for(;n<=i;n++){const e=d[n];r+=e*e}return r}for(let e=0;e<h;e++){const t=f(e),n=d[e]*Math.pow(o+a*t,-l);p[e]=n}return n.makeTensorInfo(r.shape,r.dtype,p)}};const Ohe={kernelName:v3.LRNGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,y:s,dy:o}=t,{depthRadius:a,bias:l,alpha:u,beta:c}=i;Dae(o,"LRNGrad");const d=v3.util.sizeFromShape(o.shape),h=o.shape[3],p=n.data.get(o.dataId).values,f=n.data.get(r.dataId).values,m=n.data.get(s.dataId).values,g=new Float32Array(d),_=d;for(let e=0;e<_;e++){const t=e%h,n=e-t+Math.max(0,t-a),i=e-t+Math.min(h,t+a+1);let r=0;for(let e=n;e<i;e++)r+=Math.pow(f[e],2);r=u*r+l;for(let t=n;t<i;t++){let n=-2*u*c*f[t]*m[e]/r;e===t&&(n+=Math.pow(r,-c)),n*=p[e],g[t]+=n}}return n.makeTensorInfo(o.shape,r.dtype,g)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Mhe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reductionIndices:s,keepDims:o}=i,a=n;let l=r.shape;const u=l.length,c=v3.util.parseAxisParam(s,l);let d=c;const h=v3.backend_util.getAxesPermutation(d,u);let p=a.data.get(r.dataId).values;if(null!=h){const e=new Array(u);for(let t=0;t<e.length;t++)e[t]=l[h[t]];p=uue(p,l,r.dtype,h,e),d=v3.backend_util.getInnerMostAxes(d.length,u),l=e}Dae(r,"max"),v3.backend_util.assertAxesAreInnerMostDims("max",d,u);const[f,m]=v3.backend_util.computeOutAndReduceShapes(l,d),g=Wle(p,v3.util.sizeFromShape(m),f,r.dtype),_=a.write(g,f,r.dtype);let y=f;if(o){y=v3.backend_util.expandShapeToKeepDim(f,c)}return{dataId:_,shape:y,dtype:r.dtype}}const khe={kernelName:v3.Max,backendName:"cpu",kernelFunc:Mhe};const Rhe={kernelName:v3.MaxPool,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;Dae(r,"maxPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=v3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);let c;if(1===u.filterWidth&&1===u.filterHeight&&v3.util.arraysEqual(u.inShape,u.outShape))c=jae({inputs:{x:r},backend:n});else{const e=n.data.get(r.dataId).values,t=v3.util.computeStrides(r.shape),i=Wce(e,r.shape,r.dtype,t,u,"max");c=n.makeTensorInfo(u.outShape,r.dtype,i.values)}return c}};const Nhe={kernelName:v3.MaxPool3D,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i;Dae(r,"maxPool3d");const c=v3.backend_util.computePool3DInfo(r.shape,s,o,1,a,l,u),d=qce(n.data.get(r.dataId).values,r.shape,r.dtype,v3.util.computeStrides(r.shape),c,"max");return n.makeTensorInfo(d.shape,"float32",d.values)}};const Dhe={kernelName:v3.MaxPool3DGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,{filterSize:o,strides:a,pad:l,dimRoundingMode:u}=i;Dae([r,s],"maxPool3DGrad");const c=v3.backend_util.computePool3DInfo(s.shape,o,a,1,l,u),d=function(e,t){const n=(0,v3.buffer)(t.outShape,"int32"),i=t.strideDepth,r=t.strideHeight,s=t.strideWidth,o=t.dilationDepth,a=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,d=t.effectiveFilterWidth,h=t.padInfo.front,p=t.padInfo.top,f=t.padInfo.left;for(let m=0;m<t.batchSize;++m)for(let g=0;g<t.inChannels;++g)for(let _=0;_<t.outDepth;++_){const y=_*i-h;let v=y;for(;v<0;)v+=o;const b=Math.min(t.inDepth,u+y);for(let i=0;i<t.outHeight;++i){const u=i*r-p;let h=u;for(;h<0;)h+=a;const T=Math.min(t.inHeight,c+u);for(let r=0;r<t.outWidth;++r){const p=r*s-f;let x=p;for(;x<0;)x+=l;const E=Math.min(t.inWidth,d+p);let w=Number.NEGATIVE_INFINITY,I=-1;for(let t=v;t<b;t+=o){const n=t-y;for(let i=h;i<T;i+=a){const r=i-u;for(let s=x;s<E;s+=l){const o=s-p,a=e.get(m,t,i,s,g);a>=w&&(w=a,I=n*c*d+r*c+o)}}}n.set(I,m,_,i,r,g)}}}return n}(n.bufferSync(s),c),h=c.strideDepth,p=c.strideHeight,f=c.strideWidth,m=c.dilationDepth,g=c.dilationHeight,_=c.dilationWidth,y=c.effectiveFilterDepth,v=c.effectiveFilterHeight,b=c.effectiveFilterWidth,T=y-1-c.padInfo.front,x=b-1-c.padInfo.left,E=v-1-c.padInfo.top,w=(0,v3.buffer)(s.shape,"float32"),I=n.bufferSync(r);for(let e=0;e<c.batchSize;++e)for(let t=0;t<c.inChannels;++t)for(let n=0;n<c.inDepth;++n)for(let i=0;i<c.inHeight;++i)for(let r=0;r<c.inWidth;++r){const s=n-T,o=i-E,a=r-x;let l=0;for(let n=0;n<y;n+=m){const i=(s+n)/h;if(!(i<0||i>=c.outDepth||Math.floor(i)!==i))for(let r=0;r<v;r+=g){const s=(o+r)/p;if(!(s<0||s>=c.outHeight||Math.floor(s)!==s))for(let o=0;o<b;o+=_){const u=(a+o)/f;if(u<0||u>=c.outWidth||Math.floor(u)!==u)continue;const h=y*v*b-1-d.get(e,i,s,u,t)===n*v*b+r*b+o?1:0;if(0===h)continue;l+=I.get(e,i,s,u,t)*h}}}w.set(l,e,n,i,r,t)}return n.makeTensorInfo(w.shape,w.dtype,w.values)}};const Fhe={kernelName:v3.MaxPoolGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;Dae([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=v3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=n.data.get(a.dataId).values,f=(0,v3.buffer)(h.outShape,a.dtype,Xce(p,a.shape,a.dtype,h).values),m=h.strideHeight,g=h.strideWidth,_=h.dilationHeight,y=h.dilationWidth,v=h.effectiveFilterHeight,b=h.effectiveFilterWidth,T=b-1-h.padInfo.left,x=v-1-h.padInfo.top,E=(0,v3.buffer)(a.shape,"float32"),w=n.data.get(r.dataId).values,I=(0,v3.buffer)(r.shape,"float32",w);for(let e=0;e<h.batchSize;++e)for(let t=0;t<h.inChannels;++t)for(let n=0;n<h.inHeight;++n)for(let i=0;i<h.inWidth;++i){const r=n-x,s=i-T;let o=0;for(let n=0;n<v;n+=_){const i=(r+n)/m;if(!(i<0||i>=h.outHeight||Math.floor(i)!==i))for(let r=0;r<b;r+=y){const a=(s+r)/g;if(a<0||a>=h.outWidth||Math.floor(a)!==a)continue;const l=v*b-1-f.get(e,i,a,t)===n*b+r?1:0;if(0===l)continue;o+=I.get(e,i,a,t)*l}}E.set(o,e,n,i,t)}return n.makeTensorInfo(E.shape,E.dtype,E.values)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Lhe={kernelName:v3.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;Dae(i,"MaxPoolWithArgmax");const u=l.data.get(i.dataId).values,c=v3.backend_util.computePool2DInfo(i.shape,r,s,[1,1],o),[d,h]=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i,r){const s=Wce(e,0,n,v3.util.computeStrides(t),r,"max"),o=Xce(e,t,n,r,!0,i);return[s.values,o.values]}(u,i.shape,i.dtype,a,c),p=l.write(d,c.outShape,i.dtype),f=l.write(h,c.outShape,i.dtype);return[{dataId:p,shape:c.outShape,dtype:i.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};const Phe={kernelName:v3.Mean,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=v3.util.parseAxisParam(s,r.shape),l=v3.backend_util.computeOutAndReduceShapes(r.shape,a)[1],u=v3.util.sizeFromShape(l),c=[],d=n.makeTensorInfo([],"float32",new Float32Array([u]));c.push(d);const h=Xae({inputs:{x:r},backend:n,attrs:{dtype:"float32"}});c.push(h);const p=Zde({inputs:{a:h,b:d},backend:n});c.push(p);const f=Lde({inputs:{x:p},backend:n,attrs:{axis:s,keepDims:o}});return c.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}};const Bhe={kernelName:v3.Min,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;Dae(r,"min");const a=v3.util.parseAxisParam(s,r.shape);let l=a;const u=v3.backend_util.getAxesPermutation(l,r.shape.length);let c=r;null!=u&&(c=cue({inputs:{x:r},backend:n,attrs:{perm:u}}),l=v3.backend_util.getInnerMostAxes(l.length,r.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("min",l,c.shape.length);const[d,h]=v3.backend_util.computeOutAndReduceShapes(c.shape,l),p=v3.util.sizeFromShape(h),f=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(d),c.dtype),m=n.data.get(c.dataId).values;for(let e=0;e<f.length;++e){const t=e*p;let n=m[t];for(let e=0;e<p;++e){const i=m[t+e];(Number.isNaN(i)||i<n)&&(n=i)}f[e]=n}null!=u&&n.disposeIntermediateTensorInfo(c);const g=n.makeTensorInfo(d,c.dtype,f);if(o){const e=xce({inputs:{x:g},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(d,a)}});return n.disposeIntermediateTensorInfo(g),e}return g}};const $he={kernelName:v3.MirrorPad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,mode:o}=i;Dae(r,"mirrorPad");const a=s.map((e,t)=>e[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=s.map((e,t)=>e[0]+r.shape[t]),c="reflect"===o?0:1,d=n.data.get(r.dataId).values,h=r.shape.length,p=v3.util.computeStrides(r.shape),f=v3.util.sizeFromShape(a),m=a.length,g=v3.util.computeStrides(a),_=v3.util.getTypedArrayFromDType(r.dtype,f);for(let e=0;e<f;e++){let t=v3.util.indexToLoc(e,m,g);for(let e=0;e<m;e++)t[e]<l[e]?t[e]=2*l[e]-t[e]-c:t[e]>=u[e]&&(t[e]=2*(u[e]-1)-t[e]+c);t=t.map((e,t)=>e-l[t]);const n=v3.util.locToIndex(t,h,p);_[e]=d[n]}return{dataId:n.write(_,a,r.dtype),shape:a,dtype:r.dtype}}},Uhe=$ae((e,t)=>{const n=e%t;return e<0&&t<0||e>=0&&t>=0?n:(n+t)%t}),Vhe=Kae(v3.Mod,Uhe),zhe={kernelName:v3.Mod,backendName:"cpu",kernelFunc:Vhe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function jhe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=r.shape.length;let a=s;if(-1===a&&(a=o-1),a!==o-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${o} and dim was ${a}`);const l=v3.util.parseAxisParam([a],r.shape),u=Mhe({inputs:{x:r},backend:n,attrs:{reductionIndices:l,keepDims:!1}}),c=v3.backend_util.expandShapeToKeepDim(u.shape,l),d=xce({inputs:{x:u},backend:n,attrs:{shape:c}}),h=nce({inputs:{a:r,b:d},backend:n}),p=yle({inputs:{x:h},backend:n}),f=Lde({inputs:{x:p},backend:n,attrs:{axis:l,keepDims:!1}}),m=xce({inputs:{x:f},backend:n,attrs:{shape:c}}),g=Zde({inputs:{a:p,b:m},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),g}const Yhe={kernelName:v3.Softmax,backendName:"cpu",kernelFunc:jhe};const Ghe={kernelName:v3.Multinomial,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed:o,normalized:a}=i;Dae(r,"multinomial");const l=a?r:jhe({inputs:{logits:r},backend:n,attrs:{dim:-1}}),u=l.shape[0],c=l.shape[1],d=n.data.get(l.dataId).values,h=[u,s],p=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(h),"int32");for(let e=0;e<u;++e){const t=e*c,n=new Float32Array(c-1);n[0]=d[t];for(let e=1;e<n.length;++e)n[e]=n[e-1]+d[t+e];const i=woe.alea(o.toString()),r=e*s;for(let e=0;e<s;++e){const t=i();p[r+e]=n.length;for(let i=0;i<n.length;i++)if(t<n[i]){p[r+e]=i;break}}}return a||n.disposeIntermediateTensorInfo(l),n.makeTensorInfo(h,"int32",p)}},Hhe=v3.kernel_impls.nonMaxSuppressionV3Impl;const Whe={kernelName:v3.NonMaxSuppressionV3,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=i;Dae(r,"NonMaxSuppression");const u=n.data.get(r.dataId).values,c=n.data.get(s.dataId).values,{selectedIndices:d}=Hhe(u,c,o,a,l);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},Xhe=v3.kernel_impls.nonMaxSuppressionV4Impl;const qhe={kernelName:v3.NonMaxSuppressionV4,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,padToMaxOutputSize:u}=i;Dae(r,"NonMaxSuppressionPadded");const c=n.data.get(r.dataId).values,d=n.data.get(s.dataId).values,{selectedIndices:h,validOutputs:p}=Xhe(c,d,o,a,l,u);return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},Khe=v3.kernel_impls.nonMaxSuppressionV5Impl;const Zhe={kernelName:v3.NonMaxSuppressionV5,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=i;Dae(r,"NonMaxSuppressionWithScore");const c=n.data.get(r.dataId).values,d=n.data.get(s.dataId).values,h=o,p=a,f=l,m=u,{selectedIndices:g,selectedScores:_}=Khe(c,d,h,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([_.length],"float32",new Float32Array(_))]}};const Qhe={kernelName:v3.OneHot,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r}=t,{dtype:s,depth:o,onValue:a,offValue:l}=i;Dae(r,"oneHot");const u=v3.util.sizeFromShape(r.shape),c=new Float32Array(u*o);c.fill(l);const d=n.data.get(r.dataId).values;for(let e=0;e<u;++e)d[e]>=0&&d[e]<o&&(c[e*o+d[e]]=a);return n.makeTensorInfo([...r.shape,o],s,c)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Jhe(e){const{inputs:t,backend:n}=e,{x:i}=t;if("string"===i.dtype)throw new Error("zerosLike is not supported for string tensors");if("complex64"===i.dtype){const e=Gae({inputs:{input:i},backend:n}),t=Jhe({inputs:{x:e},backend:n}),r=ade({inputs:{input:i},backend:n}),s=Jhe({inputs:{x:r},backend:n}),o=Uae({inputs:{real:t,imag:s},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),o}return ihe({backend:n,attrs:{shape:i.shape,value:0,dtype:i.dtype}})}const epe={kernelName:v3.ZerosLike,backendName:"cpu",kernelFunc:Jhe};const tpe={kernelName:v3.OnesLike,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function e(t){const{inputs:n,backend:i}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported for string tensors");if("complex64"===r.dtype){const t=Gae({inputs:{input:r},backend:i}),n=e({inputs:{x:t},backend:i}),s=ade({inputs:{input:r},backend:i}),o=Jhe({inputs:{x:s},backend:i}),a=Uae({inputs:{real:n,imag:o},backend:i});return i.disposeIntermediateTensorInfo(t),i.disposeIntermediateTensorInfo(n),i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}return ihe({backend:i,attrs:{shape:r.shape,value:1,dtype:r.dtype}})}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function npe(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)return Xde({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const s=t[0].shape,o=t[0].dtype;t.forEach(e=>{v3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),v3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=ude({inputs:t.map(e=>{const t=Xde({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}const ipe={kernelName:v3.Pack,backendName:"cpu",kernelFunc:npe};const rpe={kernelName:v3.PadV2,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;Dae(r,"pad");const a=s.map((e,t)=>e[0]+r.shape[t]+e[1]),l=s.map(e=>e[0]),u=n.data.get(r.dataId).values,c=v3.util.sizeFromShape(r.shape),d=r.shape.length,h=v3.util.computeStrides(r.shape),p=v3.util.sizeFromShape(a),f=a.length,m=v3.util.computeStrides(a),g=v3.util.getTypedArrayFromDType(r.dtype,p);0!==o&&g.fill(o);for(let e=0;e<c;e++){const t=v3.util.indexToLoc(e,d,h).map((e,t)=>e+l[t]);g[v3.util.locToIndex(t,f,m)]=u[e]}return{dataId:n.write(g,a,r.dtype),shape:a,dtype:r.dtype}}},spe=$ae((e,t)=>Math.pow(e,t)),ope=Kae(v3.Pow,spe),ape={kernelName:v3.Pow,backendName:"cpu",kernelFunc:ope};const lpe={kernelName:v3.RaggedGather,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.data.get(e.dataId).values),u=r.map(e=>e.shape),c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,[h,p,f]=_ue(l,u,c,s.shape,s.dtype,d,o.shape),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const upe={kernelName:v3.RaggedRange,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=vue(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const cpe={kernelName:v3.RaggedTensorToTensor,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.data.get(r.dataId).values,c=n.data.get(s.dataId).values,d=n.data.get(o.dataId).values,h=a.map(e=>n.data.get(e.dataId).values),p=a.map(e=>e.shape),[f,m]=wue(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}};const dpe={kernelName:v3.Range,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,dtype:s,step:o}=n,a=Iue(i,r,o,s);return t.makeTensorInfo([a.length],s,a)}},hpe=lle(v3.Reciprocal,e=>1/e),ppe={kernelName:v3.Reciprocal,backendName:"cpu",kernelFunc:hpe};const fpe={kernelName:v3.ResizeBilinear,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i;Dae(r,"resizeBilinear");const l=v3.util.computeStrides(r.shape),[u,c]=a,[d,h,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(v3.util.sizeFromShape([d,u,c,f])),_=[s&&u>1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c];let v=0;const b=_[0]/y[0],T=_[1]/y[1];for(let e=0;e<d;e++)for(let t=0;t<u;t++){let n;n=o?b*(t+.5)-.5:b*t;const i=Math.max(0,Math.floor(n)),r=n-i,s=Math.min(h-1,Math.ceil(n)),a=e*l[0]+i*l[1],u=e*l[0]+s*l[1];for(let e=0;e<c;e++){let t;t=o?T*(e+.5)-.5:T*e;const n=Math.max(0,Math.floor(t)),i=t-n,s=Math.min(p-1,Math.ceil(t)),c=a+n*l[2],d=u+n*l[2],h=a+s*l[2],_=u+s*l[2];for(let e=0;e<f;e++){const t=m[c+e],n=m[d+e],s=t+(m[h+e]-t)*i,o=s+(n+(m[_+e]-n)*i-s)*r;g[v++]=o}}}return n.makeTensorInfo([d,u,c,f],"float32",g)}};const mpe={kernelName:v3.ResizeBilinearGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i;Dae([s,r],"resizeBilinearGrad");const a=v3.util.computeStrides(r.shape),[l,u,c,d]=r.shape,[,h,p]=s.shape,f=new Float32Array(l*u*c*d),m=[o&&h>1?u-1:u,o&&p>1?c-1:c],g=[o&&h>1?h-1:h,o&&p>1?p-1:p],_=m[0]/g[0],y=m[1]/g[1],v=n.data.get(s.dataId).values;let b=0;for(let e=0;e<l;e++){const t=e*a[0];for(let e=0;e<h;e++){const n=e*_,i=Math.floor(n),r=Math.min(Math.ceil(n),u-1),s=t+i*a[1],o=t+r*a[1],l=n-i,h=1-l;for(let e=0;e<p;e++){const t=e*y,n=Math.floor(t),i=Math.min(Math.ceil(t),c-1),r=t-n,u=1-r,p=s+n*a[2],m=s+i*a[2],g=o+n*a[2],_=o+i*a[2],T=h*u,x=h*r,E=l*u,w=l*r;for(let e=0;e<d;e++){const t=v[b++];f[p+e]+=t*T,f[m+e]+=t*x,f[g+e]+=t*E,f[_+e]+=t*w}}}}return n.makeTensorInfo([l,c,u,d],"float32",f)}};const gpe={kernelName:v3.ResizeNearestNeighbor,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i;Dae(r,"resizeNearestNeighbor");const l=v3.util.computeStrides(r.shape),[u,c]=a,[d,h,p,f]=r.shape,m=n.data.get(r.dataId).values,g=new Float32Array(d*u*c*f),_=[s&&u>1?h-1:h,s&&c>1?p-1:p],y=[s&&u>1?u-1:u,s&&c>1?c-1:c],v=_[0]/y[0],b=_[1]/y[1];let T=0;for(let e=0;e<d;e++){const t=e*l[0];for(let e=0;e<u;e++){const n=o?v*(e+.5):v*e;let i=Math.min(h-1,s?Math.round(n):Math.floor(n));o&&(i=Math.max(0,i));const r=t+i*l[1];for(let e=0;e<c;e++){const t=o?b*(e+.5):b*e;let n=Math.min(p-1,s?Math.round(t):Math.floor(t));o&&(n=Math.max(0,n));const i=r+n*l[2];for(let e=0;e<f;e++){const t=m[i+e];g[T++]=t}}}}return n.makeTensorInfo([d,u,c,f],r.dtype,g)}};const _pe={kernelName:v3.ResizeNearestNeighborGrad,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i;Dae([s,r],"resizeNearestNeighborGrad");const a=v3.util.computeStrides(r.shape),l=v3.util.computeStrides(s.shape),[u,c,d,h]=r.shape,[,p,f]=s.shape,m=new Float32Array(u*c*d*h),g=n.data.get(s.dataId).values,_=[o&&p>1?c-1:c,o&&f>1?d-1:d],y=[o&&p>1?p-1:p,o&&f>1?f-1:f],v=_[0]/y[0],b=_[1]/y[1],T=1/v,x=1/b,E=2*Math.ceil(T)+2,w=2*Math.ceil(x)+2;for(let e=0;e<u;e++){const t=e*a[0];for(let e=0;e<c;e++){const n=t+e*a[1],i=Math.floor(e*T),r=Math.floor(i-E/2);for(let i=0;i<d;i++){const s=n+i*a[2],u=Math.floor(i*x),_=Math.floor(u-w/2);for(let n=0;n<h;n++){let a=0;for(let s=0;s<E;s++){const u=s+r;if(u<0||u>=p)continue;const h=t+u*l[1],m=u*v;if(e===Math.min(c-1,o?Math.round(m):Math.floor(m)))for(let e=0;e<w;e++){const t=e+_;if(t<0||t>=f)continue;const r=h+t*l[2],s=t*b;i===Math.min(d-1,o?Math.round(s):Math.floor(s))&&(a+=g[r+n])}}m[s+n]=a}}}}return n.makeTensorInfo(r.shape,r.dtype,m)}};const ype={kernelName:v3.Reverse,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i;Dae(r,"reverse");const o=r.shape.length,a=v3.util.parseAxisParam(s,r.shape);if(0===o)return jae({inputs:{x:r},backend:n});const l=new v3.TensorBuffer(r.shape,r.dtype),u=n.bufferSync(r);for(let e=0;e<l.size;e++){const t=l.indexToLoc(e),n=t.slice();a.forEach(e=>n[e]=r.shape[e]-1-n[e]),l.set(u.get(...n),...t)}return n.makeTensorInfo(l.shape,l.dtype,l.values)}},vpe={kernelName:v3.RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=v3.util.getTypedArrayFromDType(i.dtype,v3.util.sizeFromShape(i.shape)),[u,c,d,h]=i.shape,[p,f]=v3.backend_util.getImageCenter(o,c,d),m=Math.sin(r),g=Math.cos(r),_=a.data.get(i.dataId).values;for(let e=0;e<u;e++){const t=e*d*c*h;for(let e=0;e<c;e++){const n=e*(d*h);for(let i=0;i<d;i++){const r=i*h;for(let o=0;o<h;o++){const a=[u,e,i,o],y=a[2],v=a[1];let b=(y-p)*g-(v-f)*m,T=(y-p)*m+(v-f)*g;b=Math.round(b+p),T=Math.round(T+f);let x=s;if("number"!=typeof s&&(x=3===o?255:s[o]),b>=0&&b<d&&T>=0&&T<c){x=_[t+T*(d*h)+b*h+o]}l[t+n+r+o]=x}}}}return{dataId:a.write(l,i.shape,i.dtype),shape:i.shape,dtype:i.dtype}}},bpe=lle(v3.Round,e=>{const t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),Tpe={kernelName:v3.Round,backendName:"cpu",kernelFunc:bpe};const xpe={kernelName:v3.ScatterNd,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=v3.backend_util.calculateShapes(s,r,o),h=Oue(n.bufferSync(r),n.bufferSync(s),o,d,u,l,a,c,0,!0);return n.makeTensorInfo(o,h.dtype,h.values)}};
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Epe(e,t){let n=0,i=e.length,r=0;for(;n<i;)r=Math.floor((n+i)/2),e[r]<t?n=r+1:i=r;return i}function wpe(e,t){let n=0,i=e.length,r=0;for(;n<i;)r=Math.floor((n+i)/2),e[r]<=t?n=r+1:i=r;return i}const Ipe={kernelName:v3.SearchSorted,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{sortedSequence:r,values:s}=t,{side:o}=i,a=function(e,t,n,i,r,s){const o=v3.util.getArrayFromDType("int32",n*r);for(let a=0;a<n;++a){const n=e.slice(a*i,(a+1)*i),l=a*r;for(let e=0;e<r;++e)o[l+e]="left"===s?Epe(n,t[e+l]):wpe(n,t[e+l])}return o}(n.data.get(r.dataId).values,n.data.get(s.dataId).values,r.shape[0],r.shape[1],s.shape[1],o);return n.makeTensorInfo(s.shape,"int32",a)}};const Ape={kernelName:v3.Select,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{condition:i,t:r,e:s}=t;Dae([i,r,s],"select");const o=i.shape.length,a=n.data.get(i.dataId).values,l=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,c=(0,v3.upcastType)(r.dtype,s.dtype),d=v3.util.makeZerosTypedArray(v3.util.sizeFromShape(r.shape),c);let h=0;const p=0===o||o>1||1===r.shape.length?1:v3.util.sizeFromShape(r.shape.slice(1));for(let e=0;e<a.length;e++)for(let t=0;t<p;t++)1===a[e]?d[h++]=l[e]:d[h++]=u[e];return n.makeTensorInfo(r.shape,c,d)}},Spe=v3.backend_util.SELU_SCALEALPHA,Cpe=v3.backend_util.SELU_SCALE,Ope=lle(v3.Selu,e=>e>=0?Cpe*e:Spe*(Math.exp(e)-1)),Mpe={kernelName:v3.Selu,backendName:"cpu",kernelFunc:Ope},kpe=lle(v3.Sign,e=>e<0?-1:e>0?1:0),Rpe={kernelName:v3.Sign,backendName:"cpu",kernelFunc:kpe},Npe=lle(v3.Sin,e=>Math.sin(e)),Dpe={kernelName:v3.Sin,backendName:"cpu",kernelFunc:Npe},Fpe=lle(v3.Sinh,e=>Math.sinh(e)),Lpe={kernelName:v3.Sinh,backendName:"cpu",kernelFunc:Fpe},Ppe=Math.log(1.1920928955078125e-7)+2,Bpe=lle(v3.Softplus,e=>{const t=e>-Ppe,n=e<Ppe,i=Math.exp(e);let r;return r=n?i:t?e:Math.log(1+i),r}),$pe={kernelName:v3.Softplus,backendName:"cpu",kernelFunc:Bpe};const Upe={kernelName:v3.SpaceToBatchND,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,paddings:o}=i;Dae([r],"spaceToBatchND");const a=v3.util.sizeFromShape(s),l=[[0,0]];l.push(...o);for(let e=1+s.length;e<r.shape.length;++e)l.push([0,0]);const u=rpe.kernelFunc({inputs:{x:r},backend:n,attrs:{paddings:l,constantValue:0}}),c=v3.backend_util.getReshaped(u.shape,s,a,!1),d=v3.backend_util.getPermuted(c.length,s.length,!1),h=v3.backend_util.getReshapedPermuted(u.shape,s,a,!1),p=xce({inputs:{x:u},backend:n,attrs:{shape:c}}),f=cue({inputs:{x:p},backend:n,attrs:{perm:d}}),m=xce({inputs:{x:f},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),m}};const Vpe={kernelName:v3.SparseFillEmptyRows,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,defaultValue:o}=t;if(1!==s.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(2!==i.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${o.shape}`);const a=n.data.get(i.dataId).values,l=n.data.get(r.dataId).values,u=n.data.get(s.dataId).values,c=n.data.get(o.dataId).values[0],[d,h,p,f,m]=Lue(a,i.shape,i.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(h,i.dtype,d),n.makeTensorInfo([h[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const zpe={kernelName:v3.SparseReshape,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape\n ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.data.get(r.dataId).values),a=n.data.get(i.dataId).values,l=Array.from(n.data.get(s.dataId).values),[u,c,d]=Pue(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const jpe={kernelName:v3.SparseSegmentMean,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.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!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Bue(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const Ype={kernelName:v3.SparseSegmentSum,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.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!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");const o=n.data.get(i.dataId).values,a=n.data.get(r.dataId).values,l=n.data.get(s.dataId).values,[u,c]=Bue(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const Gpe={kernelName:v3.SparseToDense,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=v3.backend_util.calculateShapes(s,r,a),p=!1,f=n.bufferSync(r);let m;switch(s.dtype){case"bool":m=Oue(f,n.bufferSync(s),a,h,c,u,l,d,Boolean(n.data.get(o.dataId).values[0]),p);break;case"float32":m=Oue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"int32":m=Oue(f,n.bufferSync(s),a,h,c,u,l,d,n.data.get(o.dataId).values[0],p);break;case"string":m=Oue(f,n.bufferSync(s),a,h,c,u,l,d,v3.util.decodeString(n.data.get(o.dataId).values[0]),p);break;default:throw new Error(`Unsupported type ${s.dtype}`)}return n.makeTensorInfo(a,m.dtype,m.values)}};const Hpe={kernelName:v3.SplitV,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=v3.util.parseAxisParam(o,r.shape)[0],l=v3.backend_util.prepareSplitSize(r,s,a),u=new Array(r.shape.length).fill(0),c=r.shape.slice();return l.map(e=>{const t=[...c];t[a]=e;const i=Due({inputs:{x:r},backend:n,attrs:{begin:u,size:t}});return u[a]+=e,i})}},Wpe={kernelName:v3.Square,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{const{x:n}=e,i=t;Dae(n,"square");const r=i.data.get(n.dataId).values,s=new Float32Array(r.length);for(let e=0;e<r.length;++e){const t=r[e];s[e]=t*t}return{dataId:i.write(s,n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}},Xpe=lle(v3.Step,(e,t)=>{const n=t;return isNaN(e)?NaN:e>0?1:n.alpha}),qpe={kernelName:v3.Step,backendName:"cpu",kernelFunc:Xpe};const Kpe={kernelName:v3.StridedSlice,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i;Dae(r,"stridedSlice");const{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=v3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=xce({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){v3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=v3.slice_util.computeOutShape(y,v,b),t=Due({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=xce({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{const e=Xue(p,n.bufferSync(r),b,y);T=n.makeTensorInfo(f,e.dtype,e.values)}return T}};const Zpe={kernelName:v3.StringNGrams,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.data.get(c.dataId).values,p=n.data.get(d.dataId).values,[f,m]=Kue(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const Qpe={kernelName:v3.StringSplit,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.data.get(s.dataId).values,l=n.data.get(o.dataId).values[0],[u,c,d]=Que(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const Jpe={kernelName:v3.StringToHashBucketFast,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.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 o=Jue(n.data.get(s.dataId).values,r);return n.makeTensorInfo(s.shape,"int32",o)}},efe=lle(v3.Tan,e=>Math.tan(e)),tfe={kernelName:v3.Tan,backendName:"cpu",kernelFunc:efe},nfe=lle(v3.Tanh,e=>Math.tanh(e)),ife={kernelName:v3.Tanh,backendName:"cpu",kernelFunc:nfe};const rfe={kernelName:v3.TensorScatterUpdate,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{tensor:i,indices:r,updates:s}=t,{sliceRank:o,numUpdates:a,sliceSize:l,strides:u,outputSize:c}=v3.backend_util.calculateShapes(s,r,i.shape),d=n.bufferSync(r),h=n.bufferSync(s),p=n.bufferSync(i),f=Oue(d,h,i.shape,c,l,a,o,u,p,!1);return n.makeTensorInfo(i.shape,f.dtype,f.values)}};const sfe={kernelName:v3.Tile,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;Dae(r,"tile");const o=rce(n.bufferSync(r),s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}};const ofe={kernelName:v3.TopK,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{k:s,sorted:o}=i;Dae(r,"topk");const a=n.data.get(r.dataId).values,[l,u]=ace(a,r.shape,r.dtype,s,o);return[n.makeTensorInfo(l.shape,l.dtype,l.values),n.makeTensorInfo(u.shape,u.dtype,u.values)]}};const afe={kernelName:v3.Transform,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,attrs:n,backend:i}=e,{image:r,transforms:s}=t,{interpolation:o,fillMode:a,fillValue:l,outputShape:u}=n,[c,d,h,p]=r.shape,[f,m]=null!=u?u:[d,h],g=[c,f,m,p],_=v3.util.computeStrides(r.shape),y=_[0],v=_[1],b=_[2],T=v3.util.computeStrides(g),x=T[0],E=T[1],w=T[2],I=v3.util.getTypedArrayFromDType(r.dtype,v3.util.sizeFromShape(g));I.fill(l);const A=i.data.get(r.dataId).values,S=i.data.get(s.dataId).values;for(let e=0;e<c;++e){const t=1===s.shape[0]?S:S.subarray(8*e,8*e+8);for(let n=0;n<f;++n)for(let i=0;i<m;++i)for(let r=0;r<p;++r){let s;const u=t[6]*i+t[7]*n+1;if(0===u)continue;const c=(t[0]*i+t[1]*n+t[2])/u,p=(t[3]*i+t[4]*n+t[5])/u,f=lfe(c,h,a),m=lfe(p,d,a);switch(o){case"nearest":s=cfe(A,d,h,y,v,b,e,m,f,r,l);break;case"bilinear":s=dfe(A,d,h,y,v,b,e,m,f,r,l);break;default:throw new Error(`Error in Transform: Expect 'nearest' or 'bilinear', but got ${o}`)}I[e*x+n*E+i*w+r]=s}return i.makeTensorInfo(g,r.dtype,I)}return{dataId:i.write(I,g,r.dtype),shape:r.shape,dtype:r.dtype}}};function lfe(e,t,n){switch(n){case"reflect":return function(e,t){let n=e;if(n<0)if(t<=1)n=0;else{const e=2*t;n<e&&(n=e*Math.trunc(-n/e)+n),n=n<-t?n+e:-n-1}else if(n>t-1)if(t<=1)n=0;else{const e=2*t;n-=e*Math.trunc(n/e),n>=t&&(n=e-n-1)}return v3.util.clamp(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 v3.util.clamp(0,n,t-1)}(e,t);case"nearest":return function(e,t){return v3.util.clamp(0,e,t-1)}(e,t);default:return function(e){return e}(e)}}function ufe(e,t,n,i,r,s,o,a,l,u,c){return 0<=a&&a<t&&0<=l&&l<n?e[o*i+a*r+l*s+u]:c}function cfe(e,t,n,i,r,s,o,a,l,u,c){return ufe(e,t,n,i,r,s,o,Math.round(a),Math.round(l),u,c)}function dfe(e,t,n,i,r,s,o,a,l,u,c){const d=Math.floor(a),h=Math.floor(l),p=d+1,f=h+1;return(p-a)*((f-l)*ufe(e,t,n,i,r,s,o,d,h,u,c)+(l-h)*ufe(e,t,n,i,r,s,o,d,f,u,c))+(a-d)*((f-l)*ufe(e,t,n,i,r,s,o,p,h,u,c)+(l-h)*ufe(e,t,n,i,r,s,o,p,f,u,c))}const hfe={kernelName:v3.Unique,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,attrs:n,backend:i}=e,{axis:r}=n,{x:s}=t;Dae(s,"unique");const o=i.data.get(s.dataId).values,{outputValues:a,outputShape:l,indices:u}=lce(o,r,s.shape,s.dtype);return[i.makeTensorInfo(l,s.dtype,a),i.makeTensorInfo([u.length],"int32",u)]}};const pfe={kernelName:v3.Unpack,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{value:r}=t;let{axis:s}=i;s<0&&(s+=r.shape.length);const o=r.shape.length,a=r.shape[s],l=new Array(o-1);let u=0;for(let e=0;e<o;e++)e!==s&&(l[u++]=r.shape[e]);const c=new Array(o).fill(0),d=r.shape.slice();d[s]=1;const h=new Array(a);for(let e=0;e<h.length;e++){c[s]=e;const t=Due({inputs:{x:r},backend:n,attrs:{begin:c,size:d}});h[e]=xce({inputs:{x:t},backend:n,attrs:{shape:l}}),n.disposeIntermediateTensorInfo(t)}return h}};const ffe={kernelName:v3.UnsortedSegmentSum,backendName:"cpu",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegments:o}=i;Dae(r,"unsortedSegmentSum");const a=[],l=[],u=r.shape.length-s.shape.length;let c=s;for(let e=0;e<u;++e){const t=Xde({inputs:{input:c},backend:n,attrs:{dim:e+1}});c=t,l.push(t)}for(let e=0;e<o;++e){const t=v3.util.createScalarValue(e,"int32"),i=n.makeTensorInfo([],"int32",t),s=mle({inputs:{a:i,b:c},backend:n}),o=Xae({inputs:{x:s},backend:n,attrs:{dtype:"float32"}}),u=nue({inputs:{a:o,b:r},backend:n}),d=Lde({inputs:{x:u},backend:n,attrs:{axis:0,keepDims:!1}});a.push(d),l.push(i),l.push(s),l.push(o),l.push(u),l.push(d)}const d=npe({inputs:a,backend:n,attrs:{axis:0}});return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),d}},mfe=[Ace,Bae,Cce,Mce,tle,kce,Rce,Nce,Dce,Fce,Pce,$ce,Vce,Yce,Hce,Kce,Zce,Qce,Jce,Ice,ede,tde,nde,ole,ide,qae,hle,sde,Vae,ode,cde,hde,pde,fde,mde,gde,_de,vde,Tde,xde,Ede,wde,Ide,Ade,Cde,Ode,Mde,kde,Rde,Nde,Dde,Fde,Bde,dce,$de,gle,Wde,vle,qde,xle,nhe,rhe,she,Ile,Cle,ohe,ahe,lhe,uhe,Nle,Lle,Yae,che,lde,hhe,fhe,ghe,pce,$le,zle,_he,Hle,vhe,xhe,whe,She,Che,Ohe,khe,Kle,Rhe,Nhe,Dhe,Fhe,Lhe,Phe,Bhe,Jle,$he,zhe,Ghe,iue,sue,Whe,qhe,Zhe,lue,Qhe,tpe,ipe,rpe,ape,gce,pue,lpe,upe,cpe,dpe,Hae,Qde,ppe,yce,bce,Ece,fpe,mpe,gpe,_pe,ype,vpe,Tpe,Cue,xpe,Ipe,Ape,Mpe,Rue,Rpe,Dpe,Lpe,Fue,Yhe,$pe,Upe,Vpe,zpe,jpe,Ype,Gpe,Hpe,Vue,Wpe,Yue,Wue,qpe,Kpe,Zpe,Qpe,Jpe,ice,Pde,tfe,ife,rfe,sfe,ofe,afe,due,hfe,pfe,ffe,epe];for(const e of mfe)(0,v3.registerKernel)(e);
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const gfe={},_fe={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function yfe(e,t){gfe[e]=t}function vfe(e,t){if(!(e in gfe)||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((0,v3.env)().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 gfe[e]},!1),(0,v3.env)().getBool("SOFTWARE_WEBGL_ENABLED")&&(_fe.failIfMajorPerformanceCaveat=!1);if(1===e)return n.getContext("webgl",_fe)||n.getContext("experimental-webgl",_fe);return n.getContext("webgl2",_fe)}(e,t);if(null===n)return console.log("Could not get context for WebGL version",e),null;gfe[e]=n}const n=gfe[e];return null==n||n.isContextLost()?(delete gfe[e],vfe(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),gfe[e])}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var bfe,Tfe,xfe;function Efe(e,t){return[t,e]}function wfe(e){const t=v3.util.sizeFromShape(e),n=Math.ceil(t/4);return v3.util.sizeToSquarishShape(n)}function Ife(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function Afe(e,t){const n=e;let i,r,s,o,a,l,u,c,d,h;return 2===(0,v3.env)().getNumber("WEBGL_VERSION")?(i=n.R32F,r=n.R16F,s=n.RGBA16F,o=n.RGBA32F,a=n.RED,u=4,c=1,d=n.HALF_FLOAT,h=n.FLOAT,l=n.RGBA8):(i=e.RGBA,r=e.RGBA,s=e.RGBA,o=n.RGBA,a=e.RGBA,u=4,c=4,d=null!=t?t.HALF_FLOAT_OES:null,h=e.FLOAT,l=e.RGBA),{internalFormatFloat:i,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:o,textureFormatFloat:a,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:d,textureTypeFloat:h}}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Sfe(e,t){const n=t();return(0,v3.env)().getBool("DEBUG")&&function(e){const t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+kfe(e,t))}(e),n}!function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"}(bfe||(bfe={})),function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"}(Tfe||(Tfe={})),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"}(xfe||(xfe={}));const Cfe=5.96e-8,Ofe=65504;function Mfe(e){return!!((0,v3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||Cfe<Math.abs(e)&&Math.abs(e)<Ofe)}function kfe(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}`}}function Rfe(e,t){return ime(e,()=>e.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function Nfe(e,t){const n=ime(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(Sfe(e,()=>e.shaderSource(n,t)),Sfe(e,()=>e.compileShader(n)),!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(n)),new Error("Failed to compile vertex shader.");return n}function Dfe(e,t){const n=ime(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(Sfe(e,()=>e.shaderSource(n,t)),Sfe(e,()=>e.compileShader(n)),(0,v3.env)().get("ENGINE_COMPILE_ONLY"))return n;if(!1===e.getShaderParameter(n,e.COMPILE_STATUS))throw Lfe(t,e.getShaderInfoLog(n)),new Error("Failed to compile fragment shader.");return n}const Ffe=/ERROR: [0-9]+:([0-9]+):/g;function Lfe(e,t){const n=Ffe.exec(t);if(null==n)return console.log(`Couldn't parse line number in error: ${t}`),void console.log(e);const i=+n[1],r=e.split("\n"),s=r.length.toString().length+2,o=r.map((e,t)=>v3.util.rightPad((t+1).toString(),s)+e);let a=0;for(let e=0;e<o.length;e++)a=Math.max(o[e].length,a);const l=o.slice(0,i-1),u=o.slice(i-1,i),c=o.slice(i);console.log(l.join("\n")),console.log(t.split("\n")[0]),console.log(`%c ${v3.util.rightPad(u[0],a)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(c.join("\n"))}function Pfe(e){return ime(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}function Bfe(e,t){if(Sfe(e,()=>e.linkProgram(t)),!(0,v3.env)().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function $fe(e,t){if(Sfe(e,()=>e.validateProgram(t)),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function Ufe(e,t){const n=ime(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return Sfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),Sfe(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function Vfe(e,t){const n=ime(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return Sfe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n)),Sfe(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),n}function zfe(){return 2===(0,v3.env)().getNumber("WEBGL_VERSION")?1:4}function jfe(e){return ime(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Yfe(e,t){const n=(0,v3.env)().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}]`+".")}}function Gfe(e){return ime(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function Hfe(e,t,n,i,r,s,o){const a=e.getAttribLocation(t,n);return-1!==a&&(Sfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,i)),Sfe(e,()=>e.vertexAttribPointer(a,r,e.FLOAT,!1,s,o)),Sfe(e,()=>e.enableVertexAttribArray(a)),!0)}function Wfe(e,t,n){rme(e,n),Sfe(e,()=>e.activeTexture(e.TEXTURE0+n)),Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function Xfe(e,t){rme(e,t),Sfe(e,()=>e.activeTexture(e.TEXTURE0+t)),Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function qfe(e,t,n){return ime(e,()=>e.getUniformLocation(t,n),'uniform "'+n+'" not present in program.')}function Kfe(e,t,n){return e.getUniformLocation(t,n)}function Zfe(e,t,n,i){Sfe(e,()=>Wfe(e,t,i)),Sfe(e,()=>e.uniform1i(n,i))}function Qfe(e){Sfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),Sfe(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),Sfe(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function Jfe(e,t,n){Sfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,n)),Sfe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function eme(e,t){Sfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),Sfe(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function tme(e){const t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+nme(e,t))}function nme(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}`}}function ime(e,t,n){const i=Sfe(e,()=>t());if(null==i)throw new Error(n);return i}function rme(e,t){const n=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,i=t+e.TEXTURE0;if(i<e.TEXTURE0||i>n){throw new Error(`textureUnit must be in ${`[gl.TEXTURE0, gl.TEXTURE${n}]`}.`)}}function sme(e,t=2){return v3.util.sizeFromShape(e.slice(0,e.length-t))}function ome(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 ame(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[sme(e),...ome(e)]),t}function lme(e,t=!1){let n=(0,v3.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE"),i=(0,v3.env)().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");if(i===1/0&&(0,v3.env)().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(i=n/2),t&&(n*=2,i*=2,1===(e=e.map((t,n)=>n>=e.length-2?v3.util.nearestLargerEven(e[n]):e[n])).length&&(e=[2,e[0]])),2!==e.length){const t=v3.util.squeezeShape(e);e=t.newShape}let r=v3.util.sizeFromShape(e),s=null;e.length<=1&&r<=n?s=[1,r]:2===e.length&&e[0]<=n&&e[1]<=n?s=e:3===e.length&&e[0]*e[1]<=n&&e[2]<=n?s=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=n&&e[1]*e[2]<=n?s=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=n&&e[3]<=n?s=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=n&&e[1]*e[2]*e[3]<=n&&(s=[e[0],e[1]*e[2]*e[3]]);const o=null!=s&&Math.max(...s)>i&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(null==s||o)if(t){const t=sme(e);let n=2,i=2;e.length&&([n,i]=ome(e)),r=t*(n/2)*(i/2),s=v3.util.sizeToSquarishShape(r).map(e=>2*e)}else s=v3.util.sizeToSquarishShape(r);return s}function ume(e){return e%2==0}function cme(e,t){if(e=e.slice(-2),t=t.slice(-2),v3.util.arraysEqual(e,t))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],i=t[t.length-1];if(n===i)return!0;if(ume(n)&&ume(i)&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&ume(e[0])&&ume(t[0])}let dme,hme;function pme(e){if(null==dme){const t=vfe(e);dme=t.getParameter(t.MAX_TEXTURE_SIZE)}return dme}function fme(){dme=null}function mme(){hme=null}function gme(e){if(null==hme){const t=vfe(e);hme=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,hme)}function _me(e){if(0===e)return 0;let t;const n=vfe(e);return t=yme(n,"EXT_disjoint_timer_query_webgl2")&&2===e?2:yme(n,"EXT_disjoint_timer_query")?1:0,t}function yme(e,t){return null!=e.getExtension(t)}function vme(e){try{if(null!=vfe(e))return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function bme(e){if(0===e)return!1;const t=vfe(e);if(1===e){if(!yme(t,"OES_texture_float"))return!1}else if(!yme(t,"EXT_color_buffer_float"))return!1;return xme(t)}function Tme(e){if(0===e)return!1;const t=vfe(e);if(1!==e){if(yme(t,"EXT_color_buffer_float"))return xme(t);const e="EXT_color_buffer_half_float";if(yme(t,e)){const n=t.getExtension(e);return function(e,t){const n=Afe(e,t),i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,n.internalFormatHalfFloat,r,s,0,n.textureFormatFloat,n.textureTypeHalfFloat,null);const o=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0);const a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(i),e.deleteFramebuffer(o),a}(t,n)}return!1}if(!yme(t,"OES_texture_float"))return!1;if(!yme(t,"WEBGL_color_buffer_float"))return!1;return xme(t)}function xme(e){const t=Afe(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 i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),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(i),r}function Eme(e){if(2!==e)return!1;return null!=vfe(e).fenceSync}function wme(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&v3.util.assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Ime=(0,v3.env)();
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ame(){let e,t,n,i,r,s,o,a,l,u;return 2===(0,v3.env)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",n="out",i="in",r="texture",s="outputColor",o="out vec4 outputColor;",a=(0,v3.env)().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",i="varying",r="texture2D",s="gl_FragColor",o="",a="\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:i,texture2D:r,output:s,defineOutput:o,defineSpecialNaN:a,defineSpecialInf:l,defineRound:u}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Sme(e,t,n="index"){const i=v3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${t}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${t}`:`index -= ${e[r]} * ${t}`};`).join("")}function Cme(e,t,n="index"){const i=v3.util.computeStrides(t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / outShapeStrides[${r}]`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * outShapeStrides[${r}]`:`index -= ${e[r]} * outShapeStrides[${r}]`};`).join("")}function Ome(e,t,n="index"){const i=function(e,t){const n=e.length,i=e.map(e=>`${t}[${e}]`),r=new Array(n-1);r[n-2]=i[n-1];for(let e=n-3;e>=0;--e)r[e]=`(${r[e+1]} * ${i[e+1]})`;return r}(e.map((e,t)=>t),t);return i.map((t,r)=>`${`int ${e[r]} = ${n} / ${i[r]}`}; ${r===i.length-1?`int ${e[r+1]} = ${n} - ${e[r]} * ${i[r]}`:`index -= ${e[r]} * ${i[r]}`};`).join("")}function Mme(e){const t=v3.util.computeStrides(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`}Ime.registerFlag("HAS_WEBGL",()=>Ime.getNumber("WEBGL_VERSION")>0),Ime.registerFlag("WEBGL_VERSION",()=>vme(2)?2:vme(1)?1:0),Ime.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),Ime.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===Ime.get("WEBGL_VERSION")),Ime.registerFlag("WEBGL_CPU_FORWARD",()=>!0),Ime.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),Ime.registerFlag("WEBGL_PACK",()=>Ime.getBool("HAS_WEBGL")),Ime.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_CLIP",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_REDUCE",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_LAZILY_UNPACK",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_CONV_IM2COL",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>Ime.getBool("WEBGL_PACK")),Ime.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>pme(Ime.getNumber("WEBGL_VERSION"))),Ime.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>gme(Ime.getNumber("WEBGL_VERSION"))),Ime.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{const e=Ime.getNumber("WEBGL_VERSION");return 0===e?0:_me(e)}),Ime.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Ime.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!v3.device_util.isMobile()),Ime.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>bme(Ime.getNumber("WEBGL_VERSION"))),Ime.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!Ime.getBool("WEBGL_FORCE_F16_TEXTURES")&&Ime.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),Ime.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>Tme(Ime.getNumber("WEBGL_VERSION"))),Ime.registerFlag("WEBGL_FENCE_API_ENABLED",()=>Eme(Ime.getNumber("WEBGL_VERSION"))),Ime.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Ime.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0),Ime.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}.`)}),Ime.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>v3.device_util.isMobile()?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}.`)}),Ime.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),Ime.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),Ime.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),Ime.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128),Ime.registerFlag("WEBGL_EXP_CONV",()=>!1),Ime.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>Ime.getBool("IS_TEST")),Ime.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0),Ime.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1),Ime.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1),Ime.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);const kme="\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:Rme}=v3.backend_util;function Nme(e,t,n){const i=[];if(e.forEach(e=>{const t=v3.util.sizeFromShape(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?i.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(i.push(`uniform sampler2D ${e.name};`),i.push(`uniform int offset${e.name};`)),n.enableShapeUniforms){const{uniformShape:t}=Yme(n.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:i.push(`uniform int ${e.name}Shape;`);break;case 2:i.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:i.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:i.push(`uniform ivec4 ${e.name}Shape;`)}i.push(`uniform ivec2 ${e.name}TexShape;`)}}),n.enableShapeUniforms){switch(t.logicalShape.length){case 1:i.push("uniform int outShape;");break;case 2:i.push("uniform ivec2 outShape;"),i.push("uniform int outShapeStrides;");break;case 3:i.push("uniform ivec3 outShape;"),i.push("uniform ivec2 outShapeStrides;");break;case 4:i.push("uniform ivec4 outShape;"),i.push("uniform ivec3 outShapeStrides;")}i.push("uniform ivec2 outTexShape;")}n.customUniforms&&n.customUniforms.forEach(e=>{i.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)});const r=i.join("\n"),s=e.map(e=>function(e,t,n=!1,i){let r="";r+=n?Fme(e,i):Dme(e,i);const s=e.shapeInfo.logicalShape,o=t.logicalShape;s.length<=o.length&&(r+=n?function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=e.shapeInfo.logicalShape.length,o=t.logicalShape.length,a=Rme(e.shapeInfo.logicalShape,t.logicalShape),l=jme(o),u=o-s;let c;const d=["x","y","z","w","u","v"];c=0===s?"":o<2&&a.length>=1?"coords = 0;":a.map(e=>`coords.${d[e+u]} = 0;`).join("\n");let h="";h=o<2&&s>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${d[t+u]}`).join(", ");let p="return outputValue;";const f=1===v3.util.sizeFromShape(e.shapeInfo.logicalShape),m=v3.util.sizeFromShape(t.logicalShape),g=1===m;if(1!==s||f||g){if(f&&!g)p=1===o?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(a.length){const e=s-2,t=s-1;a.indexOf(e)>-1&&a.indexOf(t)>-1?p="return vec4(outputValue.x);":a.indexOf(e)>-1?p="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":a.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${i}(${h});\n ${p}\n }\n `}(e,t):function(e,t){const n=e.name,i=n.charAt(0).toUpperCase()+n.slice(1),r="get"+i+"AtOutCoords",s=t.texShape,o=e.shapeInfo.texShape,a=e.shapeInfo.logicalShape.length,l=t.logicalShape.length;if(!e.shapeInfo.isUniform&&a===l&&null==e.shapeInfo.flatOffset&&v3.util.arraysEqual(o,s))return`\n float ${r}() {\n return sampleTexture(${n}, resultUV);\n }\n `;const u=jme(l),c=Rme(e.shapeInfo.logicalShape,t.logicalShape),d=l-a;let h;const p=["x","y","z","w","u","v"];h=0===a?"":l<2&&c.length>=1?"coords = 0;":c.map(e=>`coords.${p[e+d]} = 0;`).join("\n");let f="";f=l<2&&a>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${p[t+d]}`).join(", ");return`\n float ${r}() {\n ${u} coords = getOutputCoords();\n ${h}\n return get${i}(${f});\n }\n `}(e,t));return r}(e,t,n.packedInputs,n.enableShapeUniforms)).join("\n"),o=t.texShape,a=Ame(),l=function(e){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${e.texture2D}(textureSampler, uv).r;\n }\n `}(a);let u,c,d=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 ${Lme}\n ${Pme}\n ${Bme}\n `;return t}(a);t.isPacked?(u=function(e,t,n){switch(e.length){case 0:return Ume();case 1:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(1===i[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 * ${i[1]}.0);\n }\n `;if(1===i[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 * ${i[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(${i[0]}, ${i[1]}));\n return 2 * (resTexRC.x * ${i[1]} + resTexRC.y);\n }\n `}(0,t,n);case 2:return function(e,t,n){const i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(v3.util.arraysEqual(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(${i[0]}, ${i[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(${i[0]}, ${i[1]}));\n\n int index = resTexRC.x * ${i[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 i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[2]/2),s=r*Math.ceil(e[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n\n int b = index / ${s};\n index -= b * ${s};\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 i=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],r=Math.ceil(e[e.length-1]/2),s=r*Math.ceil(e[e.length-2]/2);let o=s,a="",l="b, r, c";for(let t=2;t<e.length-1;t++)o*=e[e.length-t-1],a=`\n int b${t} = index / ${o};\n index -= b${t} * ${o};\n `+a,l=`b${t}, `+l;return`\n ivec${e.length} getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${i[0]}, ${i[1]}));\n int index = resTexRC.x * ${i[1]} + resTexRC.y;\n\n ${a}\n\n int b = index / ${s};\n index -= b * ${s};\n\n int r = 2 * (index / ${r});\n int c = imod(index, ${r}) * 2;\n\n return ivec${e.length}(${l});\n }\n `}(e,t,n)}}(t.logicalShape,o,n.enableShapeUniforms),c=function(e){return`\n void setOutput(vec4 val) {\n ${e.output} = val;\n }\n `}(a)):(u=function(e,t,n){switch(e.length){case 0:return Ume();case 1:return function(e,t,n){if(1===t[0])return n?"\n int getOutputCoords() {\n return int(resultUV.x * float(outTexShape[1]));\n }\n ":`\n int getOutputCoords() {\n return int(resultUV.x * ${t[1]}.0);\n }\n `;if(1===t[1])return n?"\n int getOutputCoords() {\n return int(resultUV.y * float(outTexShape[0]));\n }\n ":`\n int getOutputCoords() {\n return int(resultUV.y * ${t[0]}.0);\n }\n `;if(n)return"\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n return resTexRC.x * outTexShape[1] + resTexRC.y;\n }\n ";return`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.x * ${t[1]} + resTexRC.y;\n }\n `}(0,t,n);case 2:return function(e,t,n){if(v3.util.arraysEqual(e,t))return n?"\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1]));\n }\n ":`\n ivec2 getOutputCoords() {\n return ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]}));\n }\n `;if(1===e[1])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(index, 0);\n }\n ":`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n return ivec2(index, 0);\n }\n `;if(1===e[0])return n?"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n return ivec2(0, index);\n }\n ":`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n return ivec2(0, index);\n }\n `;if(n)return"\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n int r = index / outShape[1];\n int c = index - r * outShape[1];\n return ivec2(r, c);\n }\n ";return`\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n int r = index / ${e[1]};\n int c = index - r * ${e[1]};\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 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${Cme(["r","c","d"],e)}\n return ivec3(r, c, d);\n }\n`}const i=Sme(["r","c","d"],e);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n ${i}\n return ivec3(r, c, d);\n }\n `}(e,t,n);case 4:return function(e,t,n){if(n){return`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${Cme(["r","c","d","d2"],e)}\n return ivec4(r, c, d, d2);\n }\n `}const i=Sme(["r","c","d","d2"],e);return`\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n ${i}\n return ivec4(r, c, d, d2);\n }\n `}(e,t,n);case 5:return function(e,t){const n=Sme(["r","c","d","d2","d3"],e);return`\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]},\n ${t[1]}));\n\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n ${n}\n\n ivec5 outShape = ivec5(r, c, d, d2, d3);\n return outShape;\n }\n `}(e,t);case 6:return function(e,t){const n=Sme(["r","c","d","d2","d3","d4"],e);return`\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n\n ${n}\n\n ivec6 result = ivec6(r, c, d, d2, d3, d4);\n return result;\n }\n `}(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}(t.logicalShape,o,n.enableShapeUniforms),c=function(e){return`\n void setOutput(float val) {\n ${e.output} = vec4(val, 0, 0, 0);\n }\n `}(a)),n.packedInputs&&(d+=$me);return[d,l,c,r,u,s,n.userCode].join("\n")}function Dme(e,t=!1){const n=e.shapeInfo.logicalShape;switch(n.length){case 0:return function(e,t){const n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return`float ${i}() {return ${n};}`;const[r,s]=e.shapeInfo.texShape;if(1===r&&1===s)return`\n float ${i}() {\n return sampleTexture(${n}, halfCR);\n }\n `;const o=Vme(n);if(t)return`\n float ${i}() {\n vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], ${o});\n return sampleTexture(${n}, uv);\n }\n `;const[a,l]=e.shapeInfo.texShape;return`\n float ${i}() {\n vec2 uv = uvFromFlat(${a}, ${l}, ${o});\n return sampleTexture(${n}, uv);\n }\n `}(e,t);case 1:return function(e,t){const n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1);if(e.shapeInfo.isUniform)return`\n float ${i}(int index) {\n ${zme(e)}\n }\n `;const r=e.shapeInfo.texShape,s=r[0],o=r[1];if(1===o&&1===s)return`\n float ${i}(int index) {\n return sampleTexture(${n}, halfCR);\n }\n `;const a=Vme(n);if(1===o)return t?`\n float ${i}(int index) {\n vec2 uv = vec2(0.5, (float(index + ${a}) + 0.5) / float(${n}TexShape[0]));\n return sampleTexture(${n}, uv);\n }\n `:`\n float ${i}(int index) {\n vec2 uv = vec2(0.5, (float(index + ${a}) + 0.5) / ${s}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(1===s)return t?`\n float ${i}(int index) {\n vec2 uv = vec2((float(index + ${a}) + 0.5) / float(${n}TexShape[1]), 0.5);\n return sampleTexture(${n}, uv);\n }\n `:`\n float ${i}(int index) {\n vec2 uv = vec2((float(index + ${a}) + 0.5) / ${o}.0, 0.5);\n return sampleTexture(${n}, uv);\n }\n `;if(t)return`\n float ${i}(int index) {\n vec2 uv = uvFromFlat(${n}TexShape[0], ${n}TexShape[1], index + ${a});\n return sampleTexture(${n}, uv);\n }\n `;return`\n float ${i}(int index) {\n vec2 uv = uvFromFlat(${s}, ${o}, index + ${a});\n return sampleTexture(${n}, uv);\n }\n `}(e,t);case 2:return function(e,t){const n=e.shapeInfo.logicalShape,i=e.name,r="get"+i.charAt(0).toUpperCase()+i.slice(1),s=e.shapeInfo.texShape;if(null!=s&&v3.util.arraysEqual(n,s)){if(t)return`\n float ${r}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${i}TexShape[1], ${i}TexShape[0]);\n return sampleTexture(${i}, uv);\n }\n `;const e=s[0];return`\n float ${r}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${s[1]}.0, ${e}.0);\n return sampleTexture(${i}, uv);\n }\n `}const{newShape:o,keptDims:a}=v3.util.squeezeShape(n),l=o;if(l.length<n.length){const n=["row","col"];return`\n ${Dme(Gme(e,l),t)}\n float ${r}(int row, int col) {\n return ${r}(${Hme(n,a)});\n }\n `}if(e.shapeInfo.isUniform)return`\n float ${r}(int row, int col) {\n int index = round(dot(vec2(row, col), vec2(${n[1]}, 1)));\n ${zme(e)}\n }\n `;const u=s[0],c=s[1],d=Vme(i);if(1===c)return t?`\n float ${r}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${i}Shape[1], 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / float(${i}TexShape[0]));\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${n[1]}, 1, 1));\n vec2 uv = vec2(0.5, (index + 0.5) / ${u}.0);\n return sampleTexture(${i}, uv);\n }\n `;if(1===u)return t?`\n float ${r}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${i}Shape[1], 1, 1));\n vec2 uv = vec2((index + 0.5) / float(${i}TexShape[1]), 0.5);\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col) {\n float index = dot(vec3(row, col, ${d}), vec3(${n[1]}, 1, 1));\n vec2 uv = vec2((index + 0.5) / ${c}.0, 0.5);\n return sampleTexture(${i}, uv);\n }\n `;if(t)return`\n float ${r}(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${i}Shape[1] + col + ${d};\n vec2 uv = uvFromFlat(${i}TexShape[0], ${i}TexShape[1], index);\n return sampleTexture(${i}, uv);\n }\n `;return`\n float ${r}(int row, int col) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${n[1]} + col + ${d};\n vec2 uv = uvFromFlat(${u}, ${c}, index);\n return sampleTexture(${i}, uv);\n }\n`}(e,t);case 3:return function(e,t){const n=e.shapeInfo.logicalShape,i=e.name,r="get"+i.charAt(0).toUpperCase()+i.slice(1),s=n[1]*n[2],o=n[2],{newShape:a,keptDims:l}=v3.util.squeezeShape(n),u=a;if(u.length<n.length){const n=["row","col","depth"];return`\n ${Dme(Gme(e,u),t)}\n float ${r}(int row, int col, int depth) {\n return ${r}(${Hme(n,l)});\n }\n `}if(e.shapeInfo.isUniform)return`\n float ${r}(int row, int col, int depth) {\n int index = round(dot(vec3(row, col, depth),\n vec3(${s}, ${o}, 1)));\n ${zme(e)}\n }\n `;const c=e.shapeInfo.texShape,d=c[0],h=c[1],p=e.shapeInfo.flatOffset;if(h===s&&null==p)return t?`\n float ${r}(int row, int col, int depth) {\n int stride1 = ${i}Shape[2];\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(stride1, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${i}TexShape[1], ${i}TexShape[0]);\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col, int depth) {\n float texR = float(row);\n float texC = dot(vec2(col, depth), vec2(${o}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${h}.0, ${d}.0);\n return sampleTexture(${i}, uv);\n }\n `;if(h===o&&null==p)return t?`\n float ${r}(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(${i}Shape[1], 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${i}TexShape[1], ${i}TexShape[0]);\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col, int depth) {\n float texR = dot(vec2(row, col), vec2(${n[1]}, 1));\n float texC = float(depth);\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${h}.0, ${d}.0);\n return sampleTexture(${i}, uv);\n }\n `;const f=Vme(i);if(t)return`\n float ${r}(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int stride0 = ${i}Shape[1] * ${i}Shape[2];\n int stride1 = ${i}Shape[2];\n int index = row * stride0 + col * stride1 + depth + ${f};\n vec2 uv = uvFromFlat(${i}TexShape[0], ${i}TexShape[1], index);\n return sampleTexture(${i}, uv);\n }\n `;return`\n float ${r}(int row, int col, int depth) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${s} + col * ${o} + depth + ${f};\n vec2 uv = uvFromFlat(${d}, ${h}, index);\n return sampleTexture(${i}, uv);\n }\n `}(e,t);case 4:return function(e,t){const n=e.shapeInfo.logicalShape,i=e.name,r="get"+i.charAt(0).toUpperCase()+i.slice(1),s=n[3],o=n[2]*s,a=n[1]*o,{newShape:l,keptDims:u}=v3.util.squeezeShape(n);if(l.length<n.length){const n=["row","col","depth","depth2"];return`\n ${Dme(Gme(e,l),t)}\n float ${r}(int row, int col, int depth, int depth2) {\n return ${r}(${Hme(n,u)});\n }\n `}if(e.shapeInfo.isUniform)return`\n float ${r}(int row, int col, int depth, int depth2) {\n int index = round(dot(vec4(row, col, depth, depth2),\n vec4(${a}, ${o}, ${s}, 1)));\n ${zme(e)}\n }\n `;const c=e.shapeInfo.flatOffset,d=e.shapeInfo.texShape,h=d[0],p=d[1],f=`int stride2 = ${i}Shape[3];`,m=`int stride1 = ${i}Shape[2] * stride2;`,g=`int stride0 = ${i}Shape[1] * stride1;`;if(p===a&&null==c)return t?`\n float ${r}(int row, int col, int depth, int depth2) {\n ${f}\n ${m}\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(stride1, stride2, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${i}TexShape[1], ${i}TexShape[0]);\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col, int depth, int depth2) {\n float texR = float(row);\n float texC =\n dot(vec3(col, depth, depth2),\n vec3(${o}, ${s}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${p}.0, ${h}.0);\n return sampleTexture(${i}, uv);\n }\n `;if(p===s&&null==c)return t?`\n float ${r}(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(${i}Shape[1] * ${i}Shape[2], ${i}Shape[2], 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${i}TexShape[1], ${i}TexShape[0]);\n return sampleTexture(${i}, uv);\n }\n `:`\n float ${r}(int row, int col, int depth, int depth2) {\n float texR = dot(vec3(row, col, depth),\n vec3(${n[1]*n[2]}, ${n[2]}, 1));\n float texC = float(depth2);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${p}.0, ${h}.0);\n return sampleTexture(${i}, uv);\n }\n `;const _=Vme(i);if(t)return`\n float ${r}(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n ${f}\n ${m}\n ${g}\n int index = row * stride0 + col * stride1 +\n depth * stride2 + depth2;\n vec2 uv = uvFromFlat(${i}TexShape[0], ${i}TexShape[1], index + ${_});\n return sampleTexture(${i}, uv);\n }\n `;return`\n float ${r}(int row, int col, int depth, int depth2) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${a} + col * ${o} +\n depth * ${s} + depth2;\n vec2 uv = uvFromFlat(${h}, ${p}, index + ${_});\n return sampleTexture(${i}, uv);\n }\n `}(e,t);case 5:return function(e){const t=e.shapeInfo.logicalShape,n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1),r=t[4],s=t[3]*r,o=t[2]*s,a=t[1]*o,{newShape:l,keptDims:u}=v3.util.squeezeShape(t);if(l.length<t.length){const t=["row","col","depth","depth2","depth3"];return`\n ${Dme(Gme(e,l))}\n float ${i}(int row, int col, int depth, int depth2, int depth3) {\n return ${i}(${Hme(t,u)});\n }\n `}if(e.shapeInfo.isUniform)return`\n float ${i}(int row, int col, int depth, int depth2, int depth3) {\n float index = dot(\n vec4(row, col, depth, depth2),\n vec4(${a}, ${o}, ${s}, ${r})) +\n depth3;\n ${zme(e)}\n }\n `;const c=e.shapeInfo.flatOffset,d=e.shapeInfo.texShape,h=d[0],p=d[1];if(p===a&&null==c)return`\n float ${i}(int row, int col, int depth, int depth2, int depth3) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(${o}, ${s}, ${r}, 1));\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${p}.0, ${h}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(p===r&&null==c)return`\n float ${i}(int row, int col, int depth, int depth2, int depth3) {\n float texR = dot(\n vec4(row, col, depth, depth2),\n vec4(${t[1]*t[2]*t[3]},\n ${t[2]*t[3]}, ${t[3]}, 1));\n int texC = depth3;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${p}.0, ${h}.0);\n return sampleTexture(${n}, uv);\n }\n `;const f=Vme(n);return`\n float ${i}(int row, int col, int depth, int depth2, int depth3) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${a} + col * ${o} + depth * ${s} +\n depth2 * ${r} + depth3 + ${f};\n vec2 uv = uvFromFlat(${h}, ${p}, index);\n return sampleTexture(${n}, uv);\n }\n `}(e);case 6:return function(e){const t=e.shapeInfo.logicalShape,n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1),{newShape:r,keptDims:s}=v3.util.squeezeShape(t);if(r.length<t.length){const t=["row","col","depth","depth2","depth3","depth4"];return`\n ${Dme(Gme(e,r))}\n float ${i}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n return ${i}(${Hme(t,s)});\n }\n `}const o=t[5],a=t[4]*o,l=t[3]*a,u=t[2]*l,c=t[1]*u;if(e.shapeInfo.isUniform)return`\n float ${i}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int index = round(dot(\n vec4(row, col, depth, depth2),\n vec4(${c}, ${u}, ${l}, ${a})) +\n dot(\n vec2(depth3, depth4),\n vec2(${o}, 1)));\n ${zme(e)}\n }\n `;const d=e.shapeInfo.flatOffset,h=e.shapeInfo.texShape,p=h[0],f=h[1];if(f===c&&null==d)return`\n float ${i}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n int texR = row;\n float texC = dot(vec4(col, depth, depth2, depth3),\n vec4(${u}, ${l}, ${a}, ${o})) +\n float(depth4);\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${n}, uv);\n }\n `;if(f===o&&null==d)return`\n float ${i}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n float texR = dot(vec4(row, col, depth, depth2),\n vec4(${t[1]*t[2]*t[3]*t[4]},\n ${t[2]*t[3]*t[4]},\n ${t[3]*t[4]},\n ${t[4]})) + float(depth3);\n int texC = depth4;\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${f}.0, ${p}.0);\n return sampleTexture(${n}, uv);\n }\n `;const m=Vme(n);return`\n float ${i}(int row, int col, int depth,\n int depth2, int depth3, int depth4) {\n // Explicitly use integer operations as dot() only works on floats.\n int index = row * ${c} + col * ${u} + depth * ${l} +\n depth2 * ${a} + depth3 * ${o} + depth4 + ${m};\n vec2 uv = uvFromFlat(${p}, ${f}, index);\n return sampleTexture(${n}, uv);\n }\n `}(e);default:throw new Error(`${n.length}-D input sampling is not yet supported`)}}function Fme(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return function(e){const t=e.name,n="get"+t.charAt(0).toUpperCase()+t.slice(1),i=Ame();return`\n vec4 ${n}() {\n return ${i.texture2D}(${t}, halfCR);\n }\n `}(e);case 1:return function(e,t){const n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1),r=e.shapeInfo.texShape,s=Ame();if(t)return`\n vec4 ${i}(int index) {\n ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n vec2 uv = packedUVfrom1D(\n packedTexShape[0], packedTexShape[1], index);\n return ${s.texture2D}(${n}, uv);\n }\n `;const o=[Math.ceil(r[0]/2),Math.ceil(r[1]/2)];return`\n vec4 ${i}(int index) {\n vec2 uv = packedUVfrom1D(\n ${o[0]}, ${o[1]}, index);\n return ${s.texture2D}(${n}, uv);\n }\n `}(e,t);case 2:return function(e,t){const n=e.shapeInfo.logicalShape,i=e.name,r="get"+i.charAt(0).toUpperCase()+i.slice(1),s=e.shapeInfo.texShape,o=s[0],a=s[1],l=Ame();if(null!=s&&v3.util.arraysEqual(n,s))return t?`\n vec4 ${r}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${i}TexShape[1], ${i}TexShape[0]);\n\n return ${l.texture2D}(${i}, uv);\n }\n `:`\n vec4 ${r}(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(${a}.0, ${o}.0);\n\n return ${l.texture2D}(${i}, uv);\n }\n `;if(t)return`\n vec4 ${r}(int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(${i}TexShape[0]) / 2.0), ceil(float(${i}TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(${i}Shape[1]) / 2.0));\n vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col);\n return ${l.texture2D}(${i}, uv);\n }\n `;const u=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],c=Math.ceil(n[1]/2);return`\n vec4 ${r}(int row, int col) {\n vec2 uv = packedUVfrom2D(${c}, ${u[0]}, ${u[1]}, row, col);\n return ${l.texture2D}(${i}, uv);\n }\n `}(e,t);case 3:return function(e,t){const n=e.shapeInfo.logicalShape,i=e.name,r="get"+i.charAt(0).toUpperCase()+i.slice(1),s=e.shapeInfo.texShape,o=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];if(1===n[0]){const i=[1,2],s=["b","row","col"];return`\n ${Fme(Gme(e,n.slice(1)),t)}\n vec4 ${r}(int b, int row, int col) {\n return ${r}(${Hme(s,i)});\n }\n `}const a=Ame();if(t)return`\n vec4 ${r}(int b, int row, int col) {\n ivec2 packedTexShape = ivec2(ceil(float(${i}TexShape[0]) / 2.0), ceil(float(${i}TexShape[1]) / 2.0));\n int valuesPerRow = int(ceil(float(${i}Shape[2]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(${i}Shape[1]) / 2.0));\n vec2 uv = packedUVfrom3D(\n packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col);\n return ${a.texture2D}(${i}, uv);\n }\n `;const l=o[0],u=o[1],c=Math.ceil(n[2]/2),d=c*Math.ceil(n[1]/2);return`\n vec4 ${r}(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ${l}, ${u}, ${d}, ${c}, b, row, col);\n return ${a.texture2D}(${i}, uv);\n }\n `}(e,t);default:return function(e,t){const n=e.name,i="get"+n.charAt(0).toUpperCase()+n.slice(1),r=Ame();if(t)return`\n vec4 ${i}(int b2, int b, int row, int col) {\n int valuesPerRow = int(ceil(float(${n}Shape[3]) / 2.0));\n int texelsInBatch = valuesPerRow * int(ceil(float(${n}Shape[2]) / 2.0));\n int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2);\n texelsInBatch *= ${n}Shape[1];\n index = b2 * texelsInBatch + index;\n ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0));\n int texR = index / packedTexShape[1];\n int texC = index - texR * packedTexShape[1];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${r.texture2D}(${n}, uv);\n }\n `;const s=e.shapeInfo.logicalShape,o=s.length,a=e.shapeInfo.texShape,l=[Math.ceil(a[0]/2),Math.ceil(a[1]/2)],u=l[0],c=l[1],d=Math.ceil(s[o-1]/2);let h=d*Math.ceil(s[o-2]/2),p="int b, int row, int col",f=`b * ${h} + (row / 2) * ${d} + (col / 2)`;for(let e=2;e<o-1;e++)p=`int b${e}, `+p,h*=s[o-e-1],f=`b${e} * ${h} + `+f;return`\n vec4 ${i}(${p}) {\n int index = ${f};\n int texR = index / ${c};\n int texC = index - texR * ${c};\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${c}, ${u});\n return ${r.texture2D}(${n}, uv);\n }\n `}(e,t)}}const Lme="\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Pme="\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",Bme="\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n",$me="\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n";function Ume(){return"\n int getOutputCoords() {\n return 0;\n }\n "}function Vme(e){return`offset${e}`}function zme(e){const t=e.name,n=v3.util.sizeFromShape(e.shapeInfo.logicalShape);return n<2?`return ${t};`:`\n for (int i = 0; i < ${n}; i++) {\n if (i == index) {\n return ${t}[i];\n }\n }\n `}function jme(e){if(e<=1)return"int";if(2===e)return"ivec2";if(3===e)return"ivec3";if(4===e)return"ivec4";if(5===e)return"ivec5";if(6===e)return"ivec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Yme(e,t,n){const{newShape:i,keptDims:r}=v3.util.squeezeShape(t),s=t.length,o=e&&3===s&&1===t[0],a=o?t.slice(1):i,l=!e&&s>1&&!v3.util.arraysEqual(t,n)&&i.length<s||o;return{useSqueezeShape:l,uniformShape:l?a:t,keptDims:r}}function Gme(e,t){const n=JSON.parse(JSON.stringify(e));return n.shapeInfo.logicalShape=t,n}function Hme(e,t){return t.map(t=>e[t]).join(", ")}function Wme(e,t,n){const i=[],r=[];let s,o,a,l=null,u=null;u=e.getUniformLocation(n,"NAN",!1),1===(0,v3.env)().getNumber("WEBGL_VERSION")&&(l=e.getUniformLocation(n,"INFINITY",!1));const c=!1;for(const r of t.variableNames){const s={name:r,uniform:e.getUniformLocation(n,r,c),offset:e.getUniformLocation(n,`offset${r}`,c)};t.enableShapeUniforms&&(s.shape=e.getUniformLocation(n,`${r}Shape`,c),s.texShape=e.getUniformLocation(n,`${r}TexShape`,c)),i.push(s)}if(t.enableShapeUniforms&&(s=e.getUniformLocation(n,"outShape",c),a=e.getUniformLocation(n,"outShapeStrides",c),o=e.getUniformLocation(n,"outTexShape",c)),t.customUniforms)for(const i of t.customUniforms)r.push(e.getUniformLocation(n,i.name,c));return{variablesLocations:i,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:a,outTexShapeLocation:o}}function Xme(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 i=e.logicalShape,r=t[n],s=r.shape;if(!v3.util.arraysEqual(i,s))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${i} and ${s} must match`);if(e.isUniform&&r.isUniform)return;const o=e.texShape,a=r.isUniform?null:r.texData.texShape;if(!v3.util.arraysEqual(o,a))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${a} must match`)})}function qme(e){return(0,v3.env)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Kme{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=bfe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=Ame();this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?Cme(["r","c","d"],e):Sme(["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 `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Zme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=bfe.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];const t=Ame();this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?Cme(["r","c","d"],e):Sme(["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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Qme{constructor(e){this.variableNames=["A"],this.outTexUsage=Tfe.DOWNLOAD;const t=Ame();this.outputShape=e,this.userCode=`\n ${kme}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Jme{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=Tfe.DOWNLOAD;const t=Ame();this.outputShape=e,this.userCode=`\n ${kme}\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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const ege={R:0,G:1,B:2,A:3};class tge{constructor(e,t=!1,n="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];const i=Ame();this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let s="";for(let e=0;e<n.length;e++){const t=n[e];s+=`\n if(offset == ${e}) {\n result = values[${ege[t]}];\n }`}this.userCode=`\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":Mme(e)}\n\n void main() {\n ivec3 coords = getOutputCoords();\n int flatIndex = getFlatIndex(coords);\n float result = 0.;\n int offset = imod(flatIndex, ${n.length});\n\n flatIndex = idiv(flatIndex, ${n.length}, 1.);\n\n int r = flatIndex / texShape[1];\n if (r < texShape[0]) {\n int c = imod(flatIndex, texShape[1]);\n vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n vec4 values = ${i.texture2D}(A, uv);\n ${s}\n }\n ${i.output} = vec4(${r}, 0., 0., 0.);\n }\n `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class nge{constructor(e,t=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];const n=Ame();this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length);let i="",r="result";t&&(r="floor(result * 255. + 0.5)");for(let t=0;t<=1;t++)for(let r=0;r<=1;r++){const s=2*t+r;i+=`\n localCoords = coords;\n if(localCoords[2] + ${r} < ${this.enableShapeUniforms?"outShape[2]":`${e[2]}`}) {\n localCoords[2] += ${r};\n if (localCoords[1] + ${t} < ${this.enableShapeUniforms?"outShape[1]":`${e[1]}`}) {\n localCoords[1] += ${t};\n\n flatIndex = getFlatIndex(localCoords);\n offset = imod(flatIndex, 4);\n\n flatIndex = idiv(flatIndex, 4, 1.);\n\n int r = flatIndex / texShape[1];\n int c = imod(flatIndex, texShape[1]);\n vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]);\n values = ${n.texture2D}(A, uv);\n\n if (offset == 0) {\n result[${s}] = values[0];\n } else if (offset == 1) {\n result[${s}] = values[1];\n } else if (offset == 2) {\n result[${s}] = values[2];\n } else {\n result[${s}] = values[3];\n }\n }\n }\n `}this.userCode=`\n ${this.enableShapeUniforms?"\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n":Mme(e)}\n\n void main() {\n ivec3 coords = getOutputCoords();\n\n vec4 result = vec4(0.);\n int flatIndex, r, c, offset;\n ivec3 localCoords;\n vec2 uv;\n vec4 values;\n\n ${i}\n\n ${n.output} = ${r};\n }\n `}}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ige(e){const t=Ame();return Nfe(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 rge(e){return Ufe(e,new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]))}function sge(e){return Vfe(e,new Uint16Array([0,1,2,2,1,3]))}function oge(e,t,n,i,r,s){Yfe(t,n);const o=jfe(e),a=e.TEXTURE_2D;return Sfe(e,()=>e.bindTexture(a,o)),Sfe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),Sfe(e,()=>e.texParameteri(a,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),Sfe(e,()=>e.texParameteri(a,e.TEXTURE_MIN_FILTER,e.NEAREST)),Sfe(e,()=>e.texParameteri(a,e.TEXTURE_MAG_FILTER,e.NEAREST)),1===(0,v3.env)().getNumber("WEBGL_VERSION")?Sfe(e,()=>e.texImage2D(a,0,i,t,n,0,r,s,null)):Sfe(e,()=>e.texStorage2D(a,1,i,t,n)),Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:o,texShape:[n,t]}}function age(e){return e.internalFormatFloat}function lge(e,t,n,i){const[r,s]=Efe(t,n);return oge(e,r,s,age(i),i.textureFormatFloat,e.FLOAT)}function uge(e){return e.internalFormatHalfFloat}function cge(e,t,n,i){const[r,s]=Efe(t,n);return oge(e,r,s,uge(i),i.textureFormatFloat,i.textureTypeHalfFloat)}function dge(e){return e.downloadTextureFormat}function hge(e,t,n,i){const[r,s]=Efe(t,n);return oge(e,r,s,dge(i),e.RGBA,e.UNSIGNED_BYTE)}function pge(e){return e.internalFormatPackedFloat}function fge(e,t,n,i){const[r,s]=Ife(t,n);return oge(e,r,s,pge(i),e.RGBA,e.FLOAT)}function mge(e){return e.internalFormatPackedHalfFloat}function gge(e,t,n,i){const[r,s]=Ife(t,n);return oge(e,r,s,mge(i),e.RGBA,i.textureTypeHalfFloat)}function _ge(e,t,n){Sfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n));return Hfe(e,t,"clipSpacePos",n,3,20,0)&&Hfe(e,t,"uv",n,2,20,12)}function yge(e,t,n,i,r,s){let o,a,l;Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),r instanceof Uint8Array?(o=new Uint8Array(n*i*4),a=e.UNSIGNED_BYTE,l=e.RGBA):(o=new Float32Array(n*i*4),a=e.FLOAT,l=s.internalFormatPackedFloat),o.set(r),2===(0,v3.env)().getNumber("WEBGL_VERSION")?Sfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n,i,e.RGBA,a,o)):Sfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,n,i,0,e.RGBA,a,o)),Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function vge(e,t,n){Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,t)),n.data instanceof Uint8Array?2===(0,v3.env)().getNumber("WEBGL_VERSION")?Sfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,n.width,n.height,e.RGBA,e.UNSIGNED_BYTE,n.data)):Sfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)):2===(0,v3.env)().getNumber("WEBGL_VERSION")?Sfe(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,n)):Sfe(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)),Sfe(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function bge(e,t,n,i){const r=e.createBuffer();Sfe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));const s=16*t*n;return Sfe(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),Sfe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,0)),Sfe(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function Tge(e,t,n){const i=e,r=new Float32Array(n);return i.bindBuffer(i.PIXEL_PACK_BUFFER,t),i.getBufferSubData(i.PIXEL_PACK_BUFFER,0,r),i.bindBuffer(i.PIXEL_PACK_BUFFER,null),r}function xge(e,t,n,i){const[r,s]=Efe(t,n),o=new Uint8Array(t*n*4);return Sfe(e,()=>e.readPixels(0,0,r,s,i.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function Ege(e,t,n,i,r,s,o,a){const l=e,u=new Float32Array(function(e,t){const[n,i]=Ife(e,t);return n*i*4}(s,o));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function wge(e,t,n){const i=new Float32Array(t*n*4);return Sfe(e,()=>e.readPixels(0,0,n,t,e.RGBA,e.FLOAT,i)),i}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Ige{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];const t=(0,v3.env)().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,yfe(t,e)):this.gl=vfe(t),e=this.gl,2===(0,v3.env)().getNumber("WEBGL_VERSION")){const t=e;this.createVertexArray=()=>Sfe(t,()=>t.createVertexArray()),this.bindVertexArray=e=>Sfe(t,()=>t.bindVertexArray(e)),this.deleteVertexArray=e=>Sfe(t,()=>t.deleteVertexArray(e)),this.getVertexArray=()=>Sfe(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=()=>Sfe(e,()=>t.createVertexArrayOES()),this.bindVertexArray=n=>Sfe(e,()=>t.bindVertexArrayOES(n)),this.deleteVertexArray=n=>Sfe(e,()=>t.deleteVertexArrayOES(n)),this.getVertexArray=()=>Sfe(e,()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES))}let n="WEBGL_color_buffer_float";const i="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===(0,v3.env)().getNumber("WEBGL_VERSION")){const e="OES_texture_float",t="OES_texture_half_float";if(this.textureFloatExtension=Rfe(this.gl,e),yme(this.gl,t))this.textureHalfFloatExtension=Rfe(this.gl,t);else if((0,v3.env)().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),yme(this.gl,i))this.colorBufferHalfFloatExtension=Rfe(this.gl,i);else if((0,v3.env)().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",yme(this.gl,n))this.colorBufferFloatExtension=this.gl.getExtension(n);else{if(!yme(this.gl,i))throw new Error("GL context does not support color renderable floats");this.colorBufferHalfFloatExtension=this.gl.getExtension(i)}this.vertexBuffer=rge(this.gl),this.indexBuffer=sge(this.gl),this.framebuffer=Gfe(this.gl),this.textureConfig=Afe(this.gl,this.textureHalfFloatExtension)}get debug(){return(0,v3.env)().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&console.warn("Disposing a GPGPUContext that still has a bound WebGLProgram. This is probably a resource leak, delete the program with GPGPUContext.deleteProgram before disposing."),null!=this.outputTexture&&console.warn("Disposing a GPGPUContext that still has a bound output matrix texture. This is probably a resource leak, delete the output matrix texture with GPGPUContext.deleteMatrixTexture before disposing.");const e=this.gl;Sfe(e,()=>e.finish()),Sfe(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),Sfe(e,()=>e.deleteFramebuffer(this.framebuffer)),Sfe(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),Sfe(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),Sfe(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),lge(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),cge(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),hge(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),vge(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,n,i){this.throwIfDisposed(),yge(this.gl,e,t,n,i,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),gge(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),fge(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(eme(this.gl,this.framebuffer),this.outputTexture=null),Sfe(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,n){return this.downloadMatrixDriver(e,()=>xge(this.gl,t,n,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,n,i,r,s){return Ege(this.gl,e,0,0,0,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return Tge(this.gl,e,t)}createBufferFromTexture(e,t,n){this.bindTextureToFrameBuffer(e);const i=bge(this.gl,t,n,this.textureConfig);return this.unbindTextureToFrameBuffer(),i}createAndWaitForFence(){const e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,n;if((0,v3.env)().getBool("WEBGL_FENCE_API_ENABLED")){const i=e,r=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),n=()=>{const e=i.clientWaitSync(r,0,0);return e===i.ALREADY_SIGNALED||e===i.CONDITION_SATISFIED},t=r}else(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),n=()=>this.isQueryAvailable(t,(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):n=()=>!0;return{query:t,isFencePassed:n}}downloadMatrixFromPackedTexture(e,t,n){return this.downloadMatrixDriver(e,()=>wge(this.gl,t,n))}createProgram(e){this.throwIfDisposed();const t=this.gl;null==this.vertexShader&&(this.vertexShader=ige(t));const n=Pfe(t);Sfe(t,()=>t.attachShader(n,this.vertexShader)),Sfe(t,()=>t.attachShader(n,e)),Bfe(t,n);const i=Object.assign(n,{vao:this.createVertexArray()});return this.debug&&$fe(t,i),i}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);const t=this.gl;Sfe(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),_ge(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(Sfe(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&$fe(this.gl,this.program),Sfe(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,n=!0){return this.throwIfDisposed(),n?qfe(this.gl,e,t):Kfe(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),Sfe(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(),Zfe(this.gl,e,t,n)}setOutputMatrixTexture(e,t,n){this.setOutputMatrixTextureDriver(e,n,t)}setOutputPackedMatrixTexture(e,t,n){this.throwIfDisposed();const[i,r]=Ife(t,n);this.setOutputMatrixTextureDriver(e,i,r)}setOutputMatrixWriteRegion(e,t,n,i){this.setOutputMatrixWriteRegionDriver(n,e,i,t)}setOutputPackedMatrixWriteRegion(e,t,n,i){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&$fe(this.gl,this.program),tme(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();const e=this.gl;if(this.debug){const e=this.getVertexArray();console.assert(e===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}Sfe(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),Sfe(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=Rfe(this.gl,2===(0,v3.env)().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===(0,v3.env)().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===(0,v3.env)().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 v3.util.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,(0,v3.env)().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(),i=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),i&&!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(;t<e.length;++t){if(!e[t]())break}return t-1}(this.itemsToPoll.map(e=>e.isDoneFn));for(let t=0;t<=e;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let n;"setTimeoutCustom"in(0,v3.env)().platform&&(n=(0,v3.env)().platform.setTimeoutCustom.bind((0,v3.env)().platform)),v3.util.repeatedTry(()=>(this.pollItems(),0===this.itemsToPoll.length),()=>0,null,n)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),Jfe(this.gl,e,this.framebuffer),this.debug&&tme(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(Jfe(this.gl,this.outputTexture,this.framebuffer),this.debug&&tme(this.gl)):eme(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);const n=t();return this.unbindTextureToFrameBuffer(),n}setOutputMatrixTextureDriver(e,t,n){this.throwIfDisposed();const i=this.gl;Jfe(i,e,this.framebuffer),this.debug&&tme(i),this.outputTexture=e,Sfe(i,()=>i.viewport(0,0,t,n)),Sfe(i,()=>i.scissor(0,0,t,n))}setOutputMatrixWriteRegionDriver(e,t,n,i){this.throwIfDisposed(),Sfe(this.gl,()=>this.gl.scissor(e,t,n,i))}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.")}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const{addImpl:Age,bincountImpl:Sge,bincountReduceImpl:Cge,bitwiseAndImpl:Oge,castImpl:Mge,ceilImpl:kge,concatImpl:Rge,equalImpl:Nge,expImpl:Dge,expm1Impl:Fge,floorImpl:Lge,gatherNdImpl:Pge,gatherV2Impl:Bge,greaterImpl:$ge,greaterEqualImpl:Uge,lessImpl:Vge,lessEqualImpl:zge,linSpaceImpl:jge,logImpl:Yge,maxImpl:Gge,maximumImpl:Hge,minimumImpl:Wge,multiplyImpl:Xge,negImpl:qge,notEqualImpl:Kge,prodImpl:Zge,raggedGatherImpl:Qge,raggedRangeImpl:Jge,raggedTensorToTensorImpl:e_e,rangeImpl:t_e,rsqrtImpl:n_e,scatterImpl:i_e,sigmoidImpl:r_e,simpleAbsImpl:s_e,sliceImpl:o_e,sparseFillEmptyRowsImpl:a_e,sparseReshapeImpl:l_e,sparseSegmentReductionImpl:u_e,sqrtImpl:c_e,staticRegexReplaceImpl:d_e,stridedSliceImpl:h_e,stringNGramsImpl:p_e,stringSplitImpl:f_e,stringToHashBucketFastImpl:m_e,subImpl:g_e,tileImpl:__e,topKImpl:y_e,transposeImpl:v_e,uniqueImpl:b_e}=Pe;
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function T_e(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`)}function x_e(e,t){return 1===t?[e]:T_e(e,t)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class E_e{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=qme(this.outputShape.length),0===this.rank)this.userCode="\n void main() {\n setOutput(vec4(getA(), 0., 0., 0.));\n }\n ";else{const e=x_e("rc",this.rank),t=jme(this.rank),n=this.getOutOfBoundsCondition(e),i=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 ${i}\n\n setOutput(vec4(${r}));\n }\n }\n `}}getSourceCoordsArr(e){const t=[];for(let n=0;n<=1;n++)for(let i=0;i<=1;i++){let r=`${0===n?"r":"rp1"}, ${0===i?"c":"cp1"}`;for(let t=2;t<this.rank;t++)r=`${e[e.length-1-t]},`+r;t.push(r)}return t}getOutOfBoundsCondition(e){if(1===this.rank)return`rc > ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let n=this.rank-2;n<this.rank;n++)t+=`${e[n]} >= ${this.enableShapeUniforms?`outShape[${n}]`:this.outputShape[n]}`,n<this.rank-1&&(t+="||");return t}getSetup(e){if(1===this.rank)return"";const t=e.slice(-2),n=this.enableShapeUniforms?`outShape[${this.rank} - 1]`:this.outputShape[this.rank-1],i=this.enableShapeUniforms?`outShape[${this.rank} - 2]`:this.outputShape[this.rank-2];return`\n int r = ${t[0]};\n int c = ${t[1]};\n int rp1 = r + 1;\n int cp1 = c + 1;\n\n bool cEdge = cp1 >= ${n};\n bool rEdge = rp1 >= ${i};\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]})`}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class w_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=qme(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 i,r;this.userCode=`\n ${i=t,r=this.enableShapeUniforms,`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${r?Ome(["r","c","d"],"inputShape"):Sme(["r","c","d"],i)}\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":Mme(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 `}}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class I_e{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 i=S_e(t,n),r=C_e(e,i,n);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);const s=A_e(e,i,this.gpgpu.gl,this.gpgpu.textureConfig,n);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();const e=this.freeTextures[r].pop();return this.usedTextures[r].push(e),e}let o;return i===xfe.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):i===xfe.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):i===xfe.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):i===xfe.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):i===xfe.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[r].push(o),this.numUsedTextures++,this._numBytesAllocated+=s,this.log(),o}releaseTexture(e,t,n,i){if(null==this.freeTextures)return;const r=S_e(n,i),s=C_e(t,r,i);s in this.freeTextures||(this.freeTextures[s]=[]);const o=A_e(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,i),a=(0,v3.env)().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==a&&this._numBytesAllocated>a?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=o):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[s],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;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*t)}%)`)}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 A_e(e,t,n,i,r){const s=function(e,t){switch(e){case xfe.PACKED_2X2_FLOAT32:return pge(t);case xfe.PACKED_2X2_FLOAT16:return mge(t);case xfe.UNPACKED_FLOAT32:return age(t);case xfe.UNPACKED_FLOAT16:return uge(t);case xfe.PACKED_4X1_UNSIGNED_BYTE:return dge(t);default:throw new Error(`Unknown physical texture type ${e}`)}}(t,i);let o;if(r){const[t,n]=Ife(e[0],e[1]);o=t*n}else{const[t,n]=Efe(e[0],e[1]);o=t*n}const a=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,s);return o*a}function S_e(e,t){if(e===Tfe.UPLOAD)return xfe.PACKED_2X2_FLOAT32;if(e===Tfe.RENDER||null==e)return function(e){return(0,v3.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?xfe.PACKED_2X2_FLOAT32:xfe.UNPACKED_FLOAT32:e?xfe.PACKED_2X2_FLOAT16:xfe.UNPACKED_FLOAT16}(t);if(e===Tfe.DOWNLOAD||e===Tfe.PIXELS)return xfe.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function C_e(e,t,n){return`${e[0]}_${e[1]}_${t}_${n}`}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class O_e{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=qme(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 M_e="if (isnan(x)) return x;",k_e="return abs(x);";const R_e=M_e+"\n return (x < 0.0) ? 0.0 : x;\n",N_e=M_e+"\n return (x < 0.0) ? 0.0 : min(6.0, x);\n",D_e="return x;";class F_e{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=qme(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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class L_e{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length);const t=e.length,n=x_e("rc",t),i=jme(t),r=function(e,t){if(1===e)return"rc";let n="";for(let i=0;i<e;i++)n+=t[i],i<e-1&&(n+=",");return n}(t,n),s=n.slice(-2),o=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 packedInput = getA(${r});\n\n setOutput(getChannel(packedInput, ${o}));\n }\n `}}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const P_e=v3.kernel_impls.whereImpl,B_e={};const $_e=(0,v3.env)().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");class U_e extends v3.KernelBackend{nextDataId(){return U_e.nextDataId++}constructor(e){if(super(),this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.lastGlFlushTime=0,this.warnedAboutMemory=!1,this.pendingDeletes=0,this.disposed=!1,!(0,v3.env)().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let t;if(null!=e){if(e instanceof Ige)t=e;else{const n=vfe((0,v3.env)().getNumber("WEBGL_VERSION"),e);t=new Ige(n)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{const e=vfe((0,v3.env)().getNumber("WEBGL_VERSION"));t=new Ige(e),this.binaryCache=((n=(0,v3.env)().getNumber("WEBGL_VERSION"))in B_e||(B_e[n]={}),B_e[n]),this.gpgpuCreatedLocally=!0}var n;this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new I_e(this.gpgpu),this.numMBBeforeWarning=null==(0,v3.env)().global.screen?1024:(0,v3.env)().global.screen.height*(0,v3.env)().global.screen.width*window.devicePixelRatio*600/1024/1024,this.texData=new v3.DataStorage(this,(0,v3.engine)())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,n,i,r,s){const o=this.makeTensorInfo(t,n),a=this.texData.get(o.dataId);a.isPacked=!1,a.texture={texture:e,texShape:[i,r]},a.texShape=[i,r];const l=ame(t),u=new tge(l,!1,s),c=this.runWebGLProgram(u,[o],n,[[i,r]]);return c.shape=t,a.texture=null,this.disposeIntermediateTensorInfo(o),c.dataId}write(e,t,n){if(((0,v3.env)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||(0,v3.env)().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===n&&null!=e)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const i={id:this.nextDataId()};return this.texData.set(i,{shape:t,dtype:n,values:e,usage:Tfe.UPLOAD,refCount:1}),i}refCount(e){if(this.texData.has(e)){return this.texData.get(e).refCount}return 0}incRef(e){this.texData.get(e).refCount++}decRef(e){if(this.texData.has(e)){this.texData.get(e).refCount--}}move(e,t,n,i,r){if((0,v3.env)().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===i)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:n,dtype:i,values:t,usage:Tfe.UPLOAD,refCount:r})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){const t=this.texData.get(e),{values:n,dtype:i,complexTensorInfos:r,slice:s,shape:o,isPacked:a}=t;if(null!=s){let t;t=a?new F_e(o,D_e):new O_e(o,D_e);const n=this.runWebGLProgram(t,[{dataId:e,shape:o,dtype:i}],i),r=this.readSync(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===i)return n;const l=null!=this.activeTimers;let u,c;if(l&&(u=v3.util.now()),"complex64"===i){const e=this.readSync(r.real.dataId),t=this.readSync(r.imag.dataId);c=v3.backend_util.mergeRealAndImagArrays(e,t)}else c=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=v3.util.now()-u),this.convertAndCacheOnCPU(e,c)}async read(e){if(this.pendingRead.has(e)){const t=this.pendingRead.get(e);return new Promise(e=>t.push(e))}const t=this.texData.get(e),{values:n,shape:i,slice:r,dtype:s,complexTensorInfos:o,isPacked:a}=t;if(null!=r){let t;t=a?new F_e(i,D_e):new O_e(i,D_e);const n=this.runWebGLProgram(t,[{dataId:e,shape:i,dtype:s}],s),r=this.read(n.dataId);return this.disposeIntermediateTensorInfo(n),r}if(null!=n)return this.convertAndCacheOnCPU(e);if((0,v3.env)().getBool("DEBUG")&&!(0,v3.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===(0,v3.env)().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"!==s&&(0,v3.env)().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);const t=this.texData.get(l.dataId);c=this.gpgpu.createBufferFromTexture(t.texture.texture,...wfe(i))}if(this.pendingRead.set(e,[]),"complex64"!==s&&await this.gpgpu.createAndWaitForFence(),"complex64"===s){const e=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),t=e[0],n=e[1];u=v3.backend_util.mergeRealAndImagArrays(t,n)}else if(null==c)u=this.getValuesFromTexture(e);else{const e=v3.util.sizeFromShape(i);u=this.gpgpu.downloadFloat32MatrixFromBuffer(c,e)}if(null!=l&&this.disposeIntermediateTensorInfo(l),null!=c){const e=this.gpgpu.gl;Sfe(e,()=>e.deleteBuffer(c))}const d=this.convertAndCacheOnCPU(e,u),h=this.pendingRead.get(e);return this.pendingRead.delete(e),h.forEach(e=>e(d)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&(0,v3.engine)().removeDataId(e,this),this.pendingDeletes--),d}readToGPU(e,t={}){const n=this.texData.get(e),{values:i,shape:r,slice:s,dtype:o,isPacked:a,texture:l}=n;if("complex64"===o)throw new Error("Does not support reading texture for complex64 dtype.");if(null!=s){let n;n=a?new F_e(r,D_e):new O_e(r,D_e);const i=this.runWebGLProgram(n,[{dataId:e,shape:r,dtype:o}],o),s=this.readToGPU(i,t);return this.disposeIntermediateTensorInfo(i),s}if(null==l)throw null!=i?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=(0,v3.engine)().makeTensorFromTensorInfo(u),d=this.texData.get(u.dataId);return Object.assign({tensorRef:c},d.texture)}bufferSync(e){const t=this.readSync(e.dataId);if("string"===e.dtype)try{const n=t.map(e=>v3.util.decodeString(e));return(0,v3.buffer)(e.shape,e.dtype,n)}catch(e){throw new Error("Failed to decode encoded string bytes into utf-8")}return(0,v3.buffer)(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t<e.length;t++){const n=e[t];if(!Mfe(n)){if((0,v3.env)().getBool("WEBGL_RENDER_FLOAT32_CAPABLE"))throw Error(`The value ${n} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`);throw Error(`The value ${n} cannot be represented on this device.`)}}}getValuesFromTexture(e){const{shape:t,dtype:n,isPacked:i}=this.texData.get(e),r=v3.util.sizeFromShape(t);if((0,v3.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")){const n=this.decode(e),i=this.texData.get(n.dataId),s=this.gpgpu.downloadMatrixFromPackedTexture(i.texture.texture,...wfe(t)).subarray(0,r);return this.disposeIntermediateTensorInfo(n),s}const s=(0,v3.env)().getBool("WEBGL_PACK")&&!0===i,o=s?ame(t):t,a=s?new Jme(o):new Qme(o),l=this.runWebGLProgram(a,[{shape:o,dtype:n,dataId:e}],"float32"),u=this.texData.get(l.dataId),c=this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(u.texture.texture,u.texShape[0],u.texShape[1]).subarray(0,r);return this.disposeIntermediateTensorInfo(l),c}timerAvailable(){return(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0}time(e){const t=this.activeTimers,n=[];let i=!1;null==this.programTimersStack?(this.programTimersStack=n,i=!0):this.activeTimers.push(n),this.activeTimers=n,e();const r=v3.util.flatten(this.activeTimers.map(e=>e.query)).filter(e=>null!=e),s=v3.util.flatten(this.activeTimers.map(e=>e.name)).filter(e=>null!=e);this.activeTimers=t,i&&(this.programTimersStack=null);const o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if((0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){const e=await Promise.all(r);o.kernelMs=v3.util.sum(e),o.getExtraProfileInfo=()=>e.map((e,t)=>({name:s[t],ms:e})).map(e=>`${e.name}: ${e.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:v3.util.now(),endMs:null}}endTimer(e){return(0,v3.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=v3.util.now(),e)}async getQueryTime(e){if((0,v3.env)().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:i,usage:r,isPacked:s,slice:o}=this.texData.get(e),a=o&&o.origDataId||e,l=this.dataRefCount.get(a);l>1?this.dataRefCount.set(a,l-1):(this.dataRefCount.delete(a),null!=t&&(this.numBytesInGPU-=this.computeBytes(i,n),this.textureManager.releaseTexture(t,i,r,s)));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=$_e){return(0,v3.env)().getBool("WEBGL_CPU_FORWARD")&&e.every(e=>null==this.texData.get(e.dataId).texture&&v3.util.sizeFromShape(e.shape)<t)}getGPGPUContext(){return this.gpgpu}where(e){v3.backend_util.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead");const t=e.dataSync();return P_e(e.shape,t)}packedUnaryOp(e,t,n){const i=new F_e(e.shape,t),r=this.compileAndRun(i,[e],n);return(0,v3.engine)().makeTensorFromTensorInfo(r)}abs(e){if(this.shouldExecuteOnCPU([e])&&"complex64"!==e.dtype){const t=s_e(this.texData.get(e.dataId).values);return this.makeOutput(e.shape,e.dtype,t)}if((0,v3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS"))return this.packedUnaryOp(e,k_e,e.dtype);const t=new O_e(e.shape,k_e),n=this.compileAndRun(t,[e]);return(0,v3.engine)().makeTensorFromTensorInfo(n)}makeTensorInfo(e,t,n){let i;if("string"===t&&null!=n&&n.length>0&&v3.util.isString(n[0])){const r=n.map(e=>v3.util.encodeString(e));i=this.write(r,e,t)}else i=this.write(n,e,t);return this.texData.get(i).usage=null,{dataId:i,shape:e,dtype:t}}makeOutput(e,t,n){return(0,v3.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,n),this)}unpackTensor(e){const t=new L_e(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){const t=new E_e(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){const n=[sme(e.shape),...ome(e.shape)],i={dtype:e.dtype,shape:n,dataId:e.dataId},r=[sme(t),...ome(t)],s=new w_e(r,n),o=[n],a=this.runWebGLProgram(s,[i],e.dtype,o,!0);return{dataId:a.dataId,shape:t,dtype:a.dtype}}decode(e,t){const n=this.texData.get(e),{isPacked:i,shape:r,dtype:s}=n;if(null!=t){const e=v3.util.sizeFromShape(r),n=t[0]*t[1]*4;v3.util.assert(e<=n,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}const o=ame(r);let a;a=i?new Zme(o):new Kme(o);const l=[null!=t?t:wfe(o)];return{dtype:s,shape:r,dataId:this.runWebGLProgram(a,[{shape:o,dtype:s,dataId:e}],s,l,!0,t).dataId}}runWebGLProgram(e,t,n,i,r=!1,s){const o=this.makeTensorInfo(e.outputShape,n),a=this.texData.get(o.dataId);if(e.packedOutput&&(a.isPacked=!0),e.outPackingScheme===bfe.DENSE){const t=null!=s?s:wfe(e.outputShape);a.texShape=t.map(e=>2*e)}if(null!=e.outTexUsage&&(a.usage=e.outTexUsage),0===v3.util.sizeFromShape(o.shape))return a.values=v3.util.getTypedArrayFromDType(o.dtype,0),o;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&&v3.util.sizeFromShape(t.shape)<=(0,v3.env)().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&&!cme(n.shape,t.shape)){const e=t,i=t.shape;t.shape=n.shape,t=this.packedReshape(t,i),l.push(t),n=this.texData.get(t.dataId),e.shape=i}return{shape:t.shape,texData:n,isUniform:!1}});this.uploadToGPU(o.dataId);const c={shape:o.shape,texData:a,isUniform:!1},d=function(e,t,n){let i="";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 s=t.texData.texShape,{useSqueezeShape:o,uniformShape:a,keptDims:l}=Yme(e.packedInputs,t.shape,s);let u="",c="",d="";if(1===a.length&&e.packedInputs){const e=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];u=`${e[0]>1}_${e[1]>1}`}else if(2!==a.length||e.packedInputs){if(a.length>2&&!e.packedInputs){const e=v3.util.computeStrides(a);d=`${e[0]===s[1]}_${e[e.length-1]===s[1]}`}}else c=`${a[0]>1}_${a[1]>1}`;const h=t.shape.length,p=2===a.length&&v3.util.arraysEqual(t.shape,s),f=1===v3.util.sizeFromShape(t.shape),m=v3.backend_util.getBroadcastDims(t.shape,n.shape),g=!e.packedInputs&&h===n.shape.length&&v3.util.arraysEqual(s,n.texData.texShape),_=e.packedInputs||a.length>2?"":`${s[0]>1}_${s[1]>1}`;i+=`${h}_${g}_${o?l:""}_${a.length}_${f}_${m}_${p}_${u}_${c}_${d}_${_}_${r}`}else{const e=t.isUniform?"uniform":t.texData.texShape;i+=`${t.shape}_${e}_${r}`}});const r=e.userCode;let s=e.constructor.name;return s+="_"+i+"_"+r+`${(0,v3.env)().getNumber("WEBGL_VERSION")}`,s}(e,u,c),h=this.getAndSaveBinary(d,()=>
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=n.map((e,n)=>{const i={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&&(i.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[n],shapeInfo:i}}),s=r.map(e=>e.shapeInfo),o={logicalShape:i.shape,texShape:i.texData.texShape,isUniform:!1,isPacked:i.texData.isPacked,flatOffset:null},a=Nme(r,o,t),l=Dfe(e.gl,a),u=e.createProgram(l);return(0,v3.env)().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:a,webGLProgram:u,inShapeInfos:s,outShapeInfo:o},Wme(e,t,u)))}(this.gpgpu,e,u,c)),p=null!=this.activeTimers;let f;p&&(f=this.startTimer()),(0,v3.env)().get("ENGINE_COMPILE_ONLY")||function(e,t,n,i,r){t.program.enableShapeUniforms||(Xme(t.inShapeInfos,n),Xme([t.outShapeInfo],[i]));const s=i.texData.texture,o=i.texData.texShape;i.texData.isPacked?e.setOutputPackedMatrixTexture(s.texture,o[0],o[1]):e.setOutputMatrixTexture(s.texture,o[0],o[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===(0,v3.env)().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let i=0;i<n.length;++i){const r=n[i],{uniform:s,offset:o,shape:a,texShape:l}=t.variablesLocations[i];if(a){const{uniformShape:n}=Yme(t.program.packedInputs,r.shape,r.texData.texShape);switch(n.length){case 1:e.gl.uniform1iv(a,new Int32Array(n));break;case 2:e.gl.uniform2iv(a,new Int32Array(n));break;case 3:e.gl.uniform3iv(a,new Int32Array(n));break;case 4:e.gl.uniform4iv(a,new Int32Array(n))}}if(l&&e.gl.uniform2i(l,r.texData.texShape[0],r.texData.texShape[1]),null!=s)if(r.isUniform)if(v3.util.sizeFromShape(r.shape)<2)e.gl.uniform1f(s,r.uniformValues[0]);else{let t=r.uniformValues;t instanceof Float32Array||(t=new Float32Array(t)),e.gl.uniform1fv(s,t)}else null!=r.texData.slice&&null!=o&&e.gl.uniform1i(o,r.texData.slice.flatOffset),e.setInputMatrixTexture(r.texData.texture.texture,s,i)}const a=t.outShapeLocation;if(a)switch(i.shape.length){case 1:e.gl.uniform1iv(a,new Int32Array(i.shape));break;case 2:e.gl.uniform2iv(a,new Int32Array(i.shape));break;case 3:e.gl.uniform3iv(a,new Int32Array(i.shape));break;case 4:e.gl.uniform4iv(a,new Int32Array(i.shape))}if(t.outShapeStridesLocation){const n=v3.util.computeStrides(i.shape);switch(i.shape.length){case 2:e.gl.uniform1iv(t.outShapeStridesLocation,new Int32Array(n));break;case 3:e.gl.uniform2iv(t.outShapeStridesLocation,new Int32Array(n));break;case 4:e.gl.uniform3iv(t.outShapeStridesLocation,new Int32Array(n))}}if(t.outTexShapeLocation&&e.gl.uniform2i(t.outTexShapeLocation,i.texData.texShape[0],i.texData.texShape[1]),t.program.customUniforms&&r)for(let n=0;n<t.program.customUniforms.length;++n){const i=t.program.customUniforms[n],s=t.customUniformLocations[n],o=r[n];if("float"===i.type)e.gl.uniform1fv(s,o);else if("vec2"===i.type)e.gl.uniform2fv(s,o);else if("vec3"===i.type)e.gl.uniform3fv(s,o);else if("vec4"===i.type)e.gl.uniform4fv(s,o);else if("int"===i.type)e.gl.uniform1iv(s,o);else if("ivec2"===i.type)e.gl.uniform2iv(s,o);else if("ivec3"===i.type)e.gl.uniform3iv(s,o);else{if("ivec4"!==i.type)throw Error(`uniform type ${i.type} is not supported yet.`);e.gl.uniform4iv(s,o)}}e.executeProgram()}(this.gpgpu,h,u,c,i),l.forEach(e=>this.disposeIntermediateTensorInfo(e)),p&&(f=this.endTimer(f),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(f)}));const m=(0,v3.env)().getNumber("WEBGL_FLUSH_THRESHOLD");if(m>0){const e=v3.util.now();e-this.lastGlFlushTime>m&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!(0,v3.env)().getBool("WEBGL_LAZILY_UNPACK")&&a.isPacked&&!1===r){const e=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),e}return o}compileAndRun(e,t,n,i,r=!1){n=n||t[0].dtype;return this.runWebGLProgram(e,t,n,i,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(!(0,v3.env)().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=(0,v3.tidy)(()=>{if(!(0,v3.env)().get("WEBGL_RENDER_FLOAT32_ENABLED")){const e=(0,v3.env)().getBool("DEBUG");(0,v3.env)().set("DEBUG",!1);const t=this.abs((0,v3.scalar)(1e-8)).dataSync()[0];if((0,v3.env)().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:i,values:r,texture:s,usage:o,isPacked:a}=t;if(null!=s)return;const l=null!=this.activeTimers;let u;l&&(u=v3.util.now());let c=t.texShape;if(null==c&&(c=lme(n,a),t.texShape=c),null!=r){const e=ame(n);let s,o=c[1],d=c[0];const h=r instanceof Uint8Array||r instanceof Uint8ClampedArray;!a&&h||([o,d]=Ife(c[0],c[1])),s=a?new nge(e,h):new tge(e,h);const p=h?[d,o]:c,f=this.makeTensorInfo(p,i),m=this.texData.get(f.dataId);m.usage=h?Tfe.PIXELS:Tfe.UPLOAD,m.texShape=p,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(f.dataId),o,d,r);const g=[[d,o]],_=!0,y=this.runWebGLProgram(s,[f],i,g,_),v=this.texData.get(y.dataId);t.texShape=v.texShape,t.isPacked=v.isPacked,t.usage=v.usage,(0,v3.env)().get("ENGINE_COMPILE_ONLY")?this.disposeData(y.dataId):(t.texture=v.texture,t.values=null,this.texData.delete(y.dataId)),this.disposeIntermediateTensorInfo(f),l&&(this.uploadWaitMs+=v3.util.now()-u)}else{const e=this.acquireTexture(c,o,i,a);t.texture=e}}convertAndCacheOnCPU(e,t){const n=this.texData.get(e),{dtype:i}=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;t<n.length;++t)n[t]=Math.round(e[t]);return n}throw new Error(`Unknown dtype ${t}`)}(t,i)),n.values}acquireTexture(e,t,n,i){if(this.numBytesInGPU+=this.computeBytes(e,n),!this.warnedAboutMemory&&this.numBytesInGPU>1024*this.numMBBeforeWarning*1024){const e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,i)}computeBytes(e,t){return e[0]*e[1]*v3.util.bytesPerElement(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(0,v3.nextFrame)(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw Lfe(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:i,nanLoc:r,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:a}=Wme(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=n,e.infLoc=i,e.nanLoc=r,e.outShapeLocation=s,e.outShapeStridesLocation=o,e.outTexShapeLocation=a}}createTensorFromGPUData(e,t,n){e.channels=e.channels||"RGBA";const{texture:i,height:r,width:s,channels:o}=e,a=(0,v3.engine)().backend;if(!a.gpgpu.gl.isTexture(i))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=a.writeTexture(i,t,n,r,s,o);return(0,v3.engine)().makeTensorFromDataId(l,t,n,a)}}U_e.nextDataId=0;
/** @license See the LICENSE file. */
const V_e="4.22.0";
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function z_e(){(0,v3.env)().set("WEBGL_FORCE_F16_TEXTURES",!0)}
/**
* @license
* Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
v3.device_util.isBrowser()&&(0,v3.registerBackend)("webgl",()=>new U_e,2);const j_e={forceHalfFloat:z_e},Y_e="\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n";class G_e{constructor(e,t,n){this.variableNames=["A","B"],this.outputShape=v3.backend_util.assertAndGetBroadcastShape(t,n),this.enableShapeUniforms=qme(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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const H_e="\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 W_e{constructor(e,t,n,i=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=v3.backend_util.assertAndGetBroadcastShape(t,n);const r=this.outputShape.length;this.enableShapeUniforms=qme(r);let s="";if(i)if(0===r||1===v3.util.sizeFromShape(this.outputShape))s="\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n ";else{if(s=`\n ${jme(r)} coords = getOutputCoords();\n `,1===r)this.enableShapeUniforms?s+="\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n ":s+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{const e=x_e("coords",r);this.enableShapeUniforms?s+=`\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 `:s+=`\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 ${s}\n\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function X_e(e){const{inputs:t,backend:n}=e,{x:i}=t;return n.incRef(i.dataId),{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}const q_e={kernelName:v3.Identity,backendName:"webgl",kernelFunc:X_e};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function K_e(e){const{inputs:t,backend:n}=e,{real:i,imag:r}=t,s=n.makeTensorInfo(i.shape,"complex64"),o=n.texData.get(s.dataId),a=X_e({inputs:{x:i},backend:n}),l=X_e({inputs:{x:r},backend:n});return o.complexTensorInfos={real:a,imag:l},s}const Z_e={kernelName:v3.Complex,backendName:"webgl",kernelFunc:K_e},Q_e="return (a < 0.) ? b * a : a;",J_e="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const eye={kernelName:v3.LeakyRelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{alpha:s}=i,o=n.makeTensorInfo([],"float32",v3.util.createScalarValue(s,"float32")),a=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new W_e(J_e,r.shape,o.shape):new G_e(Q_e,r.shape,o.shape),l=n.runWebGLProgram(a,[r,o],"float32");return n.disposeIntermediateTensorInfo(o),l}},tye="return (a < 0.) ? b * a : a;",nye="\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n";const iye={kernelName:v3.Prelu,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i,alpha:r}=t,s=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new W_e(nye,i.shape,r.shape):new G_e(tye,i.shape,r.shape);return n.runWebGLProgram(s,[i,r],"float32")}},rye="if (isnan(x)) return x;";function sye({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:n,dtype:i}){return({inputs:r,backend:s})=>{const{x:o}=r,a=s,l=i||o.dtype;if(a.shouldExecuteOnCPU([o])&&null!=n){const e=a.texData.get(o.dataId),t=n(e.values,l);return a.makeTensorInfo(o.shape,l,t)}let u;return u=(0,v3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new F_e(o.shape,t):new O_e(o.shape,e),a.runWebGLProgram(u,[o],l)}}function oye({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:n=!1,supportsComplex:i=!1,cpuKernelImpl:r,dtype:s}){return({inputs:o,backend:a})=>{const{a:l,b:u}=o,c=a;if(i&&"complex64"===l.dtype){const t=c.texData.get(l.dataId),n=c.texData.get(u.dataId),[i,r]=[[t.complexTensorInfos.real,n.complexTensorInfos.real],[t.complexTensorInfos.imag,n.complexTensorInfos.imag]].map(t=>{const[n,i]=t,r={dataId:n.dataId,dtype:n.dtype,shape:l.shape},s={dataId:i.dataId,dtype:i.dtype,shape:u.shape},o=new G_e(e,l.shape,u.shape);return c.runWebGLProgram(o,[r,s],(0,v3.upcastType)(n.dtype,i.dtype))}),s=K_e({inputs:{real:i,imag:r},backend:c});return c.disposeIntermediateTensorInfo(i),c.disposeIntermediateTensorInfo(r),s}const d=s||(0,v3.upcastType)(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?v3.backend_util.fromUint8ToStringArray(e):e,i="string"===l.dtype?v3.backend_util.fromUint8ToStringArray(t):t,[s,o]=r(l.shape,u.shape,n,i,d),a=c.makeTensorInfo(o,d);return c.texData.get(a.dataId).values=s,a}let h;return h=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new W_e(t,l.shape,u.shape,n):new G_e(e,l.shape,u.shape),c.runWebGLProgram(h,[l,u],d)}}function aye(e,t=!1){if("linear"===e)return"return x;";if("relu"===e)return t?"\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":R_e;if("elu"===e)return t?"\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":"return (x >= 0.0) ? x : (exp(x) - 1.0);";if("relu6"===e)return t?"\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":N_e;if("prelu"===e)return t?nye:tye;if("leakyrelu"===e)return t?J_e:Q_e;if("sigmoid"===e)return"return 1.0 / (1.0 + exp(-1.0 * x));";throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class lye{constructor(e,t,n,i=!1,r=!1,s=!1,o=null,a=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=n,this.enableShapeUniforms=qme(this.outputShape.length);const u=i?e[1]:e[2],c=Math.ceil(u/2),d=i?"i * 2, rc.y":"rc.y, i * 2",h=r?"rc.z, i * 2":"i * 2, rc.z",p=i?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],f=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"];let m="",g="";o&&(m=a?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:l?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:`vec4 activation(vec4 x) {\n ${o}\n }`,g="result = activation(result);");const _=s?"result += getBiasAtOutCoords();":"";s&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let y="rc.x",v="rc.x";e[0]<t[0]?y=`imod(rc.x, ${e[0]})`:t[0]<e[0]&&(v=`imod(rc.x, ${t[0]})`),this.userCode=`\n ${m}\n // Don't use uniform for sharedDimensionPacked for performance.\n const float sharedDimension = ${c}.0;\n\n vec4 dot2x2ARowBCol(ivec3 rc) {\n vec4 result = vec4(0);\n int batchA = ${y};\n int batchB = ${v};\n for (int i = 0; i < ${c}; i++) {\n vec4 a = getMatrixA(batchA, ${d});\n vec4 b = getMatrixB(batchB, ${h});\n\n // These swizzled products need to be separately added.\n // See: https://github.com/tensorflow/tfjs/issues/1735\n result += (${p[0]} * ${f[0]});\n result += (${p[1]} * ${f[1]});\n }\n return result;\n }\n\n void main() {\n ivec3 rc = getOutputCoords();\n vec4 result = dot2x2ARowBCol(rc);\n\n ${_}\n\n ${g}\n\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const uye="return areal * breal - aimag * bimag;",cye="return areal * bimag + aimag * breal;";class dye{constructor(e,t,n){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=v3.backend_util.assertAndGetBroadcastShape(t,n),this.userCode=`\n float binaryOpComplex(\n float areal, float aimag, float breal, float bimag) {\n ${e}\n }\n\n void main() {\n float areal = getARealAtOutCoords();\n float aimag = getAImagAtOutCoords();\n float breal = getBRealAtOutCoords();\n float bimag = getBImagAtOutCoords();\n setOutput(binaryOpComplex(areal, aimag, breal, bimag));\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const hye="return a * b;";function pye(e){const{inputs:t,backend:n}=e,{a:i,b:r}=t,s=v3.backend_util.upcastType(i.dtype,r.dtype);if("complex64"===i.dtype){const e=n.texData.get(i.dataId),t=n.texData.get(r.dataId),s=new dye(uye,i.shape,r.shape),o=new dye(cye,i.shape,r.shape),a=[{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:i.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:i.shape},{dataId:t.complexTensorInfos.real.dataId,dtype:t.complexTensorInfos.real.dtype,shape:r.shape},{dataId:t.complexTensorInfos.imag.dataId,dtype:t.complexTensorInfos.imag.dtype,shape:r.shape}],l=n.runWebGLProgram(s,a,"float32"),u=n.runWebGLProgram(o,a,"float32"),c=K_e({inputs:{real:l,imag:u},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(u),c}if(n.shouldExecuteOnCPU([i,r])){const e=n.texData.get(i.dataId),t=n.texData.get(r.dataId),[o,a]=Xge(i.shape,r.shape,e.values,t.values,s),l=n.makeTensorInfo(a,s);return n.texData.get(l.dataId).values=o,l}let o;return o=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new W_e(hye,i.shape,r.shape):new G_e(hye,i.shape,r.shape),n.runWebGLProgram(o,[i,r],s)}const fye={kernelName:v3.Multiply,backendName:"webgl",kernelFunc:pye};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function mye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{shape:s}=i,o=n,a=v3.util.sizeFromShape(r.shape),l=v3.util.inferFromImplicitShape(s,a),u=v3.util.sizeFromShape(l);v3.util.assert(a===u,()=>`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`);const c=o.texData.get(r.dataId);return!c.isPacked||cme(r.shape,l)||null!==c.texture&&cme(c.shape,l)?(o.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype}):
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n){const i=[sme(e.shape),...ome(e.shape)],r={dtype:e.dtype,shape:i,dataId:e.dataId},s=[sme(t),...ome(t)],o=new w_e(s,i),a=[i],l=n.runWebGLProgram(o,[r],e.dtype,a,!0);return{dataId:l.dataId,shape:t,dtype:l.dtype}}(r,l,o)}const gye={kernelName:v3.Reshape,backendName:"webgl",kernelFunc:mye};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class _ye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];const o=4*Math.floor(n/4),a=n%4;let l="sumValue += dot(values, ones);";if(null!=t){const e=1/t;l=`sumValue += dot(values * ${v3.util.isInt(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 < ${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 ${l}\n }\n\n int inIdx = inOffset + ${o};\n if (${1===a}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${l}\n } else if (${2===a}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${l}\n } else if (${3===a}) {\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 `}}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class yye{constructor(e,t){this.variableNames=["x"];const{windowSize:n,batchSize:i,inSize:r,outSize:s}=e;this.outputShape=[i,s];let o="0.0",a="";"prod"===t?o="1.0":"min"===t?(o="1.0 / 1e-20",a="min"):"max"===t&&(o="-1.0 / 1e-20",a="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 d=`\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 = ${a}(values, minMaxValue);\n if (${"min"===t} || ${"max"===t}) {\n minMaxValue = ${a}(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 `,h="vec4";"all"===t?(o="1.0",d="\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n ",h="bvec4"):"any"===t&&(o="0.0",d="\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n ",h="bvec4");let p="";r%n>0&&(p=`\n if (inIdx < 0 || inIdx >= ${r}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${o};\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(${o});\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 ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${d}\n }\n\n int inIdx = inOffset + ${u};\n if (${1===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${2===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${d}\n } else if (${3===c}) {\n ${h} values = ${h}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${d}\n }\n setOutput(${l});\n }\n `}}function vye(e,t,n,i){const r=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
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],i=v3.backend_util.computeOptimalWindowSize(n);t.push({inSize:n,windowSize:i,outSize:Math.ceil(n/i)})}return t}(e.shape);let s=e;for(let o=0;o<r.length;o++){const{inSize:a,windowSize:l,outSize:u}=r[o];let c,d;c="mean"===n?0===o?new _ye({windowSize:l,inSize:a,batchSize:e.shape[0],outSize:u},a):new _ye({windowSize:l,inSize:a,batchSize:e.shape[0],outSize:u}):new yye({windowSize:l,inSize:a,batchSize:e.shape[0],outSize:u},n),d=s,s=i.runWebGLProgram(c,[s],t),d.dataId!==e.dataId&&i.disposeIntermediateTensorInfo(d)}return s}
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class bye{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let i=0;i<n.length;i++)n[i]=e[t[i]];this.outputShape=n,this.rank=n.length;const i=jme(this.rank),r=function(e){const t=e.length;if(t>6)throw Error(`Transpose for rank ${t} is not yet supported`);const n=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],i=new Array(t);for(let t=0;t<e.length;t++)i[e[t]]=n[t];return i.join()}(t);this.userCode=`\n void main() {\n ${i} resRC = getOutputCoords();\n setOutput(getA(${r}));\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Tye{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;const n=new Array(e.length);for(let i=0;i<n.length;i++)n[i]=e[t[i]];if(this.outputShape=n,this.rank=n.length,this.rank>6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);const i=jme(this.rank),r=T_e("rc",this.rank),s=new Array(this.rank);for(let e=0;e<t.length;e++)s[t[e]]=r[e];const o=`vec2(${s.slice(-2).join()})`,a=`++${r[this.rank-1]} < ${n[this.rank-1]}`,l=`getChannel(getA(${s.join()}), ${o})`;this.userCode=`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result[0] = ${l};\n if(${a}) {\n result[1] = ${l};\n }\n --${r[this.rank-1]};\n if(++${r[this.rank-2]} < ${n[this.rank-2]}) {\n result[2] = ${l};\n if(${a}) {\n result[3] = ${l};\n }\n }\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function xye(e,t,n){const i=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Tye(e.shape,t):new bye(e.shape,t);return n.runWebGLProgram(i,[e],e.dtype)}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Eye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i;
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
return function(e,t,n,i){const r=t,s=e.shape.length,o=v3.util.parseAxisParam(r,e.shape);let a=o;const l=v3.backend_util.getAxesPermutation(a,s),u=null!=l;let c=e;u&&(c=xye(e,l,i),a=v3.backend_util.getInnerMostAxes(a.length,s)),v3.backend_util.assertAxesAreInnerMostDims("sum",a,s);const[d,h]=v3.backend_util.computeOutAndReduceShapes(c.shape,a);let p=d;n&&(p=v3.backend_util.expandShapeToKeepDim(d,o));const f=v3.util.sizeFromShape(h),m=mye({inputs:{x:c},attrs:{shape:[v3.util.sizeFromShape(e.shape)/f,f]},backend:i}),g=vye(m,(0,v3.sumOutType)(e.dtype),"sum",i),_=mye({inputs:{x:g},attrs:{shape:p},backend:i});return i.disposeIntermediateTensorInfo(m),i.disposeIntermediateTensorInfo(g),u&&i.disposeIntermediateTensorInfo(c),_}(r,s,o,n)}const wye={kernelName:v3.Sum,backendName:"webgl",kernelFunc:Eye};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Iye(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{perm:s}=i,o=n,a=r.shape.length,l=new Array(a);for(let e=0;e<l.length;e++)l[e]=r.shape[s[e]];let u;if(o.shouldExecuteOnCPU([r])){const e=o.texData.get(r.dataId).values,t=v_e(e,r.shape,r.dtype,s,l);u=o.makeTensorInfo(l,r.dtype);o.texData.get(u.dataId).values=t}else u=xye(r,s,o);return u}const Aye={kernelName:v3.Transpose,backendName:"webgl",kernelFunc:Iye};function Sye({a:e,b:t,transposeA:n,transposeB:i,backend:r,bias:s=null,preluActivationWeights:o=null,leakyreluAlpha:a=0,activation:l=null}){const u=e.shape.length,c=t.shape.length,d=n?e.shape[u-2]:e.shape[u-1],h=i?t.shape[c-1]:t.shape[c-2],p=n?e.shape[u-1]:e.shape[u-2],f=i?t.shape[c-2]:t.shape[c-1],m=e.shape.slice(0,-2),g=t.shape.slice(0,-2),_=v3.util.sizeFromShape(m),y=v3.util.sizeFromShape(g),v=v3.broadcast_util.assertAndGetBroadcastShape(e.shape.slice(0,-2),t.shape.slice(0,-2)).concat([p,f]);v3.util.assert(d===h,()=>`Error in matMul: inner shapes (${d}) and (${h}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${n} and transposeB=${i} must match.`);const b=n?[_,d,p]:[_,p,d],T=i?[y,f,h]:[y,h,f],x=mye({inputs:{x:e},backend:r,attrs:{shape:b}}),E=mye({inputs:{x:t},backend:r,attrs:{shape:T}}),w=[x,E],I=Math.max(_,y),A=n?x.shape[1]:x.shape[2],S=null!=s,C=null!=o,O="leakyrelu"===l,M=null!=l?aye(l,!0):null;let k;if((1===p||1===f)&&A>1e3&&!1===(S||C||O||null!=M)){let e=x,t=E;n&&(e=Iye({inputs:{x},backend:r,attrs:{perm:[0,2,1]}}),w.push(e)),i&&(t=Iye({inputs:{x:E},backend:r,attrs:{perm:[0,2,1]}}),w.push(t));const s=1===f;let o=e;1!==f&&(o=mye({inputs:{x:e},backend:r,attrs:{shape:[I,A,1]}}),w.push(o));const a=1===f?2:1;let l=t;s&&(l=mye({inputs:{x:t},backend:r,attrs:{shape:[I,1,A]}}),w.push(l));const u=pye({inputs:{a:o,b:l},backend:r});k=Eye({inputs:{x:u},backend:r,attrs:{axis:a,keepDims:!0}}),w.push(u)}else{const l=(0,v3.upcastType)(e.dtype,t.dtype),u=new lye(b,T,[I,p,f],n,i,S,M,C,O),c=[x,E];if(null!=s&&c.push(s),C&&c.push(o),O){const e=r.makeTensorInfo([],"float32",v3.util.createScalarValue(a,"float32"));c.push(e),w.push(e)}k=r.runWebGLProgram(u,c,l)}const R=mye({inputs:{x:k},backend:r,attrs:{shape:v}});w.push(k);for(const e of w)r.disposeIntermediateTensorInfo(e);return R}const Cye={kernelName:v3._FusedMatMul,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s,bias:o,preluActivationWeights:a}=t,{transposeA:l,transposeB:u,activation:c,leakyreluAlpha:d}=i;return Sye({a:r,b:s,transposeA:l,transposeB:u,backend:n,bias:o,preluActivationWeights:a,leakyreluAlpha:d,activation:c})}},Oye="return abs(x);";const Mye={kernelName:v3.Abs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])&&"complex64"!==i.dtype){const e=n.texData.get(i.dataId),t=s_e(e.values);return n.makeTensorInfo(i.shape,i.dtype,t)}let r;return r=(0,v3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new F_e(i.shape,Oye):new O_e(i.shape,Oye),n.runWebGLProgram(r,[i],i.dtype)}},kye=sye({opSnippet:M_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n"}),Rye={kernelName:v3.Acos,backendName:"webgl",kernelFunc:kye},Nye=sye({opSnippet:M_e+"\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));"}),Dye={kernelName:v3.Acosh,backendName:"webgl",kernelFunc:Nye},Fye="return a + b;",Lye=oye({opSnippet:Fye,packedOpSnippet:Fye,supportsComplex:!0,cpuKernelImpl:Age}),Pye={kernelName:v3.Add,backendName:"webgl",kernelFunc:Lye};
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Bye{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 i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n float result = ${i};\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class $ye{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 i=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=`\n void main() {\n ${n.join("\n ")}\n\n vec4 result = ${i};\n setOutput(result);\n }\n `}}const Uye={kernelName:v3.AddN,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function e(t){const{inputs:n,backend:i}=t,r=n;if(1===r.length)return X_e({inputs:{x:r[0]},backend:i});if(r.length>(0,v3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){const t=Math.floor(r.length/2),n=e({inputs:r.slice(0,t),backend:i}),s=e({inputs:r.slice(t),backend:i});return e({inputs:[n,s],backend:i})}const s=r.map(e=>e.dtype).reduce((e,t)=>(0,v3.upcastType)(e,t)),o=r.map(e=>e.shape),a=(0,v3.env)().getBool("WEBGL_PACK")?new $ye(r[0].shape,o):new Bye(r[0].shape,o);return i.runWebGLProgram(a,r,s)}};const Vye={kernelName:v3.All,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=v3.util.parseAxisParam(s,r.shape);let u=l;const c=v3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=Iye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=v3.backend_util.getInnerMostAxes(u.length,a)),v3.backend_util.assertAxesAreInnerMostDims("all",u,a);const[h,p]=v3.backend_util.computeOutAndReduceShapes(d.shape,u),f=mye({inputs:{x:d},backend:n,attrs:{shape:[-1,v3.util.sizeFromShape(p)]}}),m=vye(f,f.dtype,"all",n);let g;if(o){g=mye({inputs:{x:m},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(h,l)}})}else g=mye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}};const zye={kernelName:v3.Any,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=v3.util.parseAxisParam(s,r.shape);let u=l;const c=v3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=Iye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=v3.backend_util.getInnerMostAxes(u.length,a)),v3.backend_util.assertAxesAreInnerMostDims("any",u,a);const[h,p]=v3.backend_util.computeOutAndReduceShapes(d.shape,u),f=mye({inputs:{x:d},backend:n,attrs:{shape:[-1,v3.util.sizeFromShape(p)]}}),m=vye(f,f.dtype,"any",n);let g;if(o){g=mye({inputs:{x:m},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(h,l)}})}else g=mye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class jye{constructor(e,t,n){this.variableNames=["A"];const{windowSize:i,batchSize:r,outSize:s}=e;n||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];const o="max"===t?">":"<",a=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 * ${i};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${i}; i++) {\n int inIdx = ${a};\n float candidate = getA(batch, inIdx);\n if (candidate ${o} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Yye{constructor(e,t,n,i){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,v3.util.assert(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],s=Math.ceil(r/t);this.outputShape=e.slice(0,-1),s>1&&this.outputShape.push(s),i||this.variableNames.push("bestIndicesA");const o=this.outputShape,a=o.length,l=jme(a),u=x_e("coords",a);let c,d;if(1===s){d=a+1;const e=jme(d);c=`\n ${e} sourceLocR = ${e}(${u.join()}, 0);\n ++${u[a-1]};\n ${e} sourceLocG = ${e}(${u.join()}, 0);\n ++${u[a-2]};\n ${e} sourceLocA = ${e}(${u.join()}, 0);\n --${u[a-1]};\n ${e} sourceLocB = ${e}(${u.join()}, 0);\n --${u[a-2]};`}else d=a,c=`\n ${l} sourceLocR = coords;\n ++${u[a-1]};\n ${l} sourceLocG = coords;\n ++${u[a-2]};\n ${l} sourceLocA = coords;\n --${u[a-1]};\n ${l} sourceLocB = coords;\n --${u[a-2]};`;const h=["x","y","z","w","u","v"].slice(0,d),p="."+h[d-1],f=h.map(e=>"int "+e),m=x_e("sourceLocR",d-1).concat("inIdx.r"),g=x_e("sourceLocG",d-1).concat("inIdx.g"),_=x_e("sourceLocB",d-1).concat("inIdx.b"),y=x_e("sourceLocA",d-1).concat("inIdx.a"),v="max"===n?"greaterThan":"lessThan",b=i?"":`\n inIdx = round(vec4(getBestIndicesAChannel(${m.join()}),\n getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${_.join()}),\n getBestIndicesAChannel(${y.join()})));`,T=`vec4(\n getAChannel(${m.join()}),\n hasNextCol ? getAChannel(${g.join()}) : 0.,\n hasNextRow ? getAChannel(${_.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${y.join()}) : 0.)`,x=i?"":`\n float getBestIndicesAChannel(${f.join()}) {\n return getChannel(getBestIndicesA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${f.join()}) {\n return getChannel(getA(${h.join()}),\n vec2(${h.slice(-2).join()}));\n }\n ${x}\n void main() {\n ${l} coords = getOutputCoords();\n bool hasNextCol = ${u[a-1]} < ${o[a-1]-1};\n bool hasNextRow = ${u[a-2]} < ${o[a-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 = ${T};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${b}\n vec4 candidate = ${T};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${v}(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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Gye(e,t,n,i=null){let r=t.shape[0],s=t.shape[1];null!=i&&(r=i.shape[0],s=i.shape[1]);const o=v3.backend_util.computeOptimalWindowSize(s),a={windowSize:o,inSize:s,batchSize:r,outSize:Math.ceil(s/o)},l=new jye(a,n,null==i),u=[t];null!=i&&u.push(i);const c=e.runWebGLProgram(l,u,"int32");if(1===c.shape[1])return c;const d=Gye(e,t,n,c);return e.disposeIntermediateTensorInfo(c),d}function Hye(e,t,n,i=null){const r=null!=i?i.shape:t.shape,s=r[r.length-1],o=v3.backend_util.computeOptimalWindowSize(s),a=new Yye(r,o,n,null==i),l=null==i?[t]:[t,i],u=e.runWebGLProgram(a,l,"int32");if(u.shape.length===t.shape.length){const i=Hye(e,t,n,u);return e.disposeIntermediateTensorInfo(u),i}return u}function Wye(e,t,n,i){const r=[n];if(v3.backend_util.assertAxesAreInnerMostDims("arg"+i.charAt(0).toUpperCase()+i.slice(1),r,t.shape.length),!(0,v3.env)().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){const n=[],s=e.texData.get(t.dataId);let o=t;null!==s&&s.isPacked&&(o=e.unpackTensor(t),n.push(o));const[a,l]=v3.backend_util.computeOutAndReduceShapes(o.shape,r),u=v3.util.sizeFromShape(l),c=mye({inputs:{x:o},backend:e,attrs:{shape:[-1,u]}});n.push(c);const d=Gye(e,c,i);n.push(d);const h=mye({inputs:{x:d},backend:e,attrs:{shape:a}});return n.forEach(t=>e.disposeIntermediateTensorInfo(t)),h}return Hye(e,t,i)}const Xye={kernelName:v3.ArgMax,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=v3.util.parseAxisParam(s,r.shape);const a=v3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=Iye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=v3.backend_util.getInnerMostAxes(o.length,l.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("argMax",[o[0]],l.shape.length);const c=Wye(n,l,o[0],"max");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}};const qye={kernelName:v3.ArgMin,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s}=i;let o=v3.util.parseAxisParam(s,r.shape);const a=v3.backend_util.getAxesPermutation(o,r.shape.length);let l=r;const u=[];null!=a&&(l=Iye({inputs:{x:r},backend:n,attrs:{perm:a}}),u.push(l),o=v3.backend_util.getInnerMostAxes(o.length,l.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("argMin",[o[0]],l.shape.length);const c=Wye(n,l,o[0],"min");return u.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}},Kye=sye({opSnippet:M_e+"\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n"}),Zye={kernelName:v3.Asin,backendName:"webgl",kernelFunc:Kye},Qye=sye({opSnippet:M_e+"return log(x + sqrt(x * x + 1.0));"}),Jye={kernelName:v3.Asinh,backendName:"webgl",kernelFunc:Qye},eve=sye({opSnippet:M_e+"\n return atan(x);\n"}),tve={kernelName:v3.Atan,backendName:"webgl",kernelFunc:eve},nve=oye({opSnippet:Y_e+"\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 "+H_e+"\n return result;\n"}),ive={kernelName:v3.Atan2,backendName:"webgl",kernelFunc:nve},rve=sye({opSnippet:M_e+"\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;"}),sve={kernelName:v3.Atanh,backendName:"webgl",kernelFunc:rve};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class ove{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideHeight,a=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,h=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 _="0.0";if(f||(_="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${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 < ${d};\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 = ${i?r?m:g:`wR * ${d} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `)}let y=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(y="avgValue / max(count, 1.0)");const v=4*Math.floor(s/4),b=s%4,T=`\n if (${f}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${o}, ${a});\n const ivec2 pads = ivec2(${h}, ${p});\n const float initializationValue = ${_};\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(${_});\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 < ${v}; 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 ${T}\n }\n\n int xC = xCCorner + ${v};\n if (${1===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${2===b}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${u}, d),\n initializationValue,\n initializationValue\n );\n\n ${T}\n } else if (${3===b}) {\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 ${T}\n }\n }\n setOutput(${y});\n }\n `}}class ave{constructor(e,t,n,i=!1,r=!1){if(this.variableNames=["x"],"avg"===t&&n)throw new Error("Cannot compute positions for average pool.");const s=e.filterWidth,o=e.strideDepth,a=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,c=e.dilationHeight,d=e.dilationWidth,h=e.effectiveFilterDepth,p=e.effectiveFilterHeight,f=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,_=e.padInfo.left;this.outputShape=e.outShape;const y="avg"===t;let v="0.0";if(y||(v="-1.0 / 1e-20"),n){const t=">=";return void(this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\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 < ${h};\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 += ${d}) {\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 = ${i?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 b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");const T=4*Math.floor(s/4),x=s%4,E=`\n if (${y}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = max(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${o}, ${a}, ${l});\n const ivec3 pads = ivec3(${m}, ${g}, ${_});\n const float initializationValue = ${v};\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(${v});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${h};\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 < ${T}; wC += 4) {\n int xC = xCCorner + wC * ${d};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n getValue(batch, xD, xR, xC + 3 * ${d}, ch)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${T};\n if (${1===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${2===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${3===x}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${d}, ch),\n getValue(batch, xD, xR, xC + 2 * ${d}, ch),\n initializationValue\n );\n\n ${E}\n }\n }\n }\n setOutput(${b});\n }\n `}}const lve={kernelName:v3.AvgPool,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;wme(r,"avgPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=v3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&v3.util.arraysEqual(u.inShape,u.outShape))return X_e({inputs:{x:r},backend:n});const c=new ove(u,"avg",!1);return n.runWebGLProgram(c,[r],"float32")}};const uve={kernelName:v3.AvgPool3D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dimRoundingMode:l,dataFormat:u}=i,c=v3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,l,u),d=new ave(c,"avg",!1);return n.runWebGLProgram(d,[r],"float32")}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class cve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=a-1-e.padInfo.top,c=l-1-e.padInfo.left,d=1/(t*n);this.userCode=`\n const ivec2 pads = ivec2(${u}, ${c});\n const float avgMultiplier = float(${d});\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 < ${a};\n wR += ${s}) {\n float dyR = float(dyRCorner + wR) / ${i}.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+= ${o}) {\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 dve{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.effectiveFilterDepth,d=e.effectiveFilterHeight,h=e.effectiveFilterWidth,p=c-1-e.padInfo.front,f=d-1-e.padInfo.top,m=h-1-e.padInfo.left,g=1/(t*n*i);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 += ${a}) {\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 < ${d};\n wR += ${l}) {\n float dyR = float(dyRCorner + wR) / ${s}.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 < ${h};\n wC += ${u}) {\n float dyC = float(dyCCorner + wC) / ${o}.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 hve={kernelName:v3.AvgPool3DGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=v3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new dve(d);return n.runWebGLProgram(h,[r],o.dtype)}};const pve={kernelName:v3.AvgPoolGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s;wme([r,s],"avgPoolGrad");const{filterSize:a,strides:l,pad:u}=i,c=v3.backend_util.computePool2DInfo(o.shape,a,l,1,u),d=new cve(c);return n.runWebGLProgram(d,[r],o.dtype)}};const fve={kernelName:v3.BatchMatMul,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{a:r,b:s}=t,{transposeA:o,transposeB:a}=i;return Sye({a:r,b:s,transposeA:o,transposeB:a,backend:n})}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class mve{constructor(e,t,n,i,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],v3.backend_util.assertAndGetBroadcastShape(e,t),v3.backend_util.assertAndGetBroadcastShape(e,n);let o="0.0";null!=i&&(v3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="1.0";null!=r&&(v3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${o};\n float scale = ${a};\n float inv = scale * inversesqrt(variance + float(${s}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class gve{constructor(e,t,n,i,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],v3.backend_util.assertAndGetBroadcastShape(e,t),v3.backend_util.assertAndGetBroadcastShape(e,n);let o="vec4(0.0)";null!=i&&(v3.backend_util.assertAndGetBroadcastShape(e,i),this.variableNames.push("offset"),o="getOffsetAtOutCoords()");let a="vec4(1.0)";null!=r&&(v3.backend_util.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),a="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${o};\n vec4 scale = ${a};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${s}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const _ve={kernelName:v3.FusedBatchNorm,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i,mean:r,variance:s,offset:o,scale:a}=e;v3.util.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v3.util.assert(null==o||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v3.util.assert(null==a||r.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=n;null==l&&(l=.001);const u=[i,r,s];let c=null;null!=o&&(c=o.shape,u.push(o));let d=null;null!=a&&(d=a.shape,u.push(a));const h=(0,v3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new gve(i.shape,r.shape,s.shape,c,d,l):new mve(i.shape,r.shape,s.shape,c,d,l);return t.runWebGLProgram(h,u,u[0].dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class yve{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;const t=jme(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];const n=function(e){if(1===e)return"sourceLoc";if(e<=6)return vve.slice(0,e).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank);let i;i=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${e.map((e,t)=>`sourceLoc.${vve[t]} = start[${t}] + coords.${vve[t]};`).join("\n")}\n `,this.userCode=`\n void main() {\n ${i}\n setOutput(getSource(${n}));\n }\n `}}const vve=["x","y","z","w","u","v"];
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class bve{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=jme(this.rank),n=x_e("coords",this.rank),i=x_e("sourceLoc",this.rank),r=1===this.rank?"sourceLoc":`vec2(${i.slice(-2).join()})`,s=`getChannel(getSource(${i.join()}), ${r})`,o=`\n result.x = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.y = ${s};\n --${i[this.rank-1]};\n }\n `,a=1===this.rank?"":`\n --${n[this.rank-1]};\n if (++${n[this.rank-2]} < ${e[this.rank-2]}) {\n ++${i[this.rank-2]};\n result.z = ${s};\n if (++${n[this.rank-1]} < ${e[this.rank-1]}) {\n ++${i[this.rank-1]};\n result.w = ${s};\n }\n }\n `,l=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map((e,t)=>`start[${t}]`).join()});`:e.map((e,t)=>`${i[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 ${o}\n ${a}\n setOutput(result);\n }\n `}}function Tve(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,size:o}=i,[a,l]=v3.slice_util.parseSliceParams(r,s,o);if(v3.slice_util.assertParamsValid(r,a,l),0===v3.util.sizeFromShape(l))return n.makeTensorInfo(l,r.dtype,[]);if(n.shouldExecuteOnCPU([r])||"string"===r.dtype){const e=n.texData.get(r.dataId),t=o_e(e.values,a,l,r.shape,r.dtype);return n.makeTensorInfo(l,r.dtype,t)}const{isPacked:u}=n.texData.get(r.dataId),c=v3.slice_util.isSliceContinous(r.shape,a,l);if(u||!c){const e=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new bve(l):new yve(l),t=[a];return n.runWebGLProgram(e,[r],r.dtype,t)}return n.uploadToGPU(r.dataId),
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=i.texData.get(e.dataId),s=i.makeTensorInfo(n,e.dtype),o=i.texData.get(s.dataId);Object.assign(o,r),o.refCount=1,o.shape=n,o.dtype=e.dtype;let a=v3.slice_util.computeFlatOffset(t,v3.util.computeStrides(e.shape));r.slice&&(a+=r.slice.flatOffset),o.slice={flatOffset:a,origDataId:r.slice&&r.slice.origDataId||e.dataId};const l=i.dataRefCount.get(o.slice.origDataId)||1;return i.dataRefCount.set(o.slice.origDataId,l+1),s}(r,a,l,n)}const xve={kernelName:v3.Slice,backendName:"webgl",kernelFunc:Tve},Eve={kernelName:v3.BatchToSpaceND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,crops:o}=i;v3.util.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=v3.backend_util.getReshaped(r.shape,s,a),u=v3.backend_util.getPermuted(l.length,s.length),c=v3.backend_util.getReshapedPermuted(r.shape,s,a),d=v3.backend_util.getSliceBeginCoords(o,s.length),h=v3.backend_util.getSliceSize(c,o,s.length),p=[],f=mye({inputs:{x:r},backend:n,attrs:{shape:l}}),m=Iye({inputs:{x:f},backend:n,attrs:{perm:u}}),g=mye({inputs:{x:m},backend:n,attrs:{shape:c}}),_=Tve({inputs:{x:g},backend:n,attrs:{begin:d,size:h}});return p.push(f),p.push(m),p.push(g),p.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}};const wve={kernelName:v3.Bincount,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o}=i,a=n.readSync(r.dataId),l=n.readSync(s.dataId),u=Sge(a,l,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,u)}};const Ive={kernelName:v3.BitwiseAnd,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{a:i,b:r}=t,s=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"),o=(0,v3.env)().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([i,r])||1===o){const e=n.texData.get(i.dataId).values,t=n.texData.get(r.dataId).values,[s,o]=Oge(i.shape,r.shape,e,t,i.dtype),a=n.makeTensorInfo(o,i.dtype);return n.texData.get(a.dataId).values=s,a}let a;return a=s?new W_e("\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",i.shape,r.shape,!1):new G_e("\n return float(int(a.r) & int(b.r));\n",i.shape,r.shape),n.runWebGLProgram(a,[i,r],i.dtype)}};const Ave={kernelName:v3.BroadcastArgs,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{s0:i,s1:r}=t,s=n.readSync(i.dataId),o=n.readSync(r.dataId),a=v3.backend_util.assertAndGetBroadcastShape(Array.from(s),Array.from(o));return n.makeTensorInfo([a.length],"int32",Int32Array.from(a))}},Sve=oye({opSnippet:"return float(a != b);",cpuKernelImpl:Kge,dtype:"bool"}),Cve={kernelName:v3.NotEqual,backendName:"webgl",kernelFunc:Sve};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ove(e){const{inputs:t,backend:n}=e,{input:i}=t;return X_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.real},backend:n})}const Mve={kernelName:v3.Real,backendName:"webgl",kernelFunc:Ove};const kve={kernelName:v3.Cast,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function e(t){const{inputs:n,backend:i,attrs:r}=t,{x:s}=n,{dtype:o}=r;if("complex64"===o){if("complex64"===s.dtype)return X_e({inputs:{x:s},backend:i});const t=v3.zeros(s.shape),n=e({inputs:{x:s},backend:i,attrs:{dtype:"float32"}}),r=K_e({inputs:{real:n,imag:t},backend:i});return t.dispose(),i.disposeIntermediateTensorInfo(n),r}if("complex64"===s.dtype){const t=Ove({inputs:{input:s},backend:i}),n=e({inputs:{x:t},backend:i,attrs:{dtype:o}});return i.disposeIntermediateTensorInfo(t),n}if(!v3.util.hasEncodingLoss(s.dtype,o)){const e=X_e({inputs:{x:s},backend:i});return{dataId:e.dataId,shape:e.shape,dtype:o}}if(i.shouldExecuteOnCPU([s])){const e=i.texData.get(s.dataId).values,[t,n,r]=Mge(e,s.shape,s.dtype,o);return i.makeTensorInfo(t,n,r)}if("int32"===o)return function(e,t){const n=new O_e(e.shape,"return float(int(x));"),i=t.runWebGLProgram(n,[e],"int32");return{dataId:i.dataId,shape:i.shape,dtype:i.dtype}}(s,i);if("bool"===o){const e=i.makeTensorInfo([],"bool",v3.util.getTypedArrayFromDType("bool",1)),t=Sve({inputs:{a:s,b:e},backend:i});return i.disposeIntermediateTensorInfo(e),t}throw new Error(`Error in Cast: failed to cast ${s.dtype} to ${o}`)}},Rve="return ceil(x);",Nve=sye({opSnippet:Rve,packedOpSnippet:Rve,cpuKernelImpl:kge}),Dve={kernelName:v3.Ceil,backendName:"webgl",kernelFunc:Nve};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Fve{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 "}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Lve{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 Pve={kernelName:v3.ClipByValue,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{clipValueMin:s,clipValueMax:o}=i;let a;a=(0,v3.env)().getBool("WEBGL_PACK_CLIP")?new Lve(r.shape):new Fve(r.shape);const l=[[s],[o]];return n.runWebGLProgram(a,[r],r.dtype,l)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Bve{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 "}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function $ve(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}const Uve={kernelName:v3.ComplexAbs,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=n.texData.get(i.dataId),s=new Bve(i.shape),o=[$ve(i,r.complexTensorInfos.real),$ve(i,r.complexTensorInfos.imag)];return n.runWebGLProgram(s,o,o[0].dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Vve{constructor(e){this.outputShape=[],this.outputShape=v3.backend_util.computeOutShape(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.length;n++)t[n]=t[n-1]+e[n][1];const n=[`if (yC < ${t[0]}) setOutput(getT0(yR, yC));`];for(let e=1;e<t.length;e++){const i=t[e-1];n.push(`else if (yC < ${t[e]}) setOutput(getT${e}(yR, yC-${i}));`)}const i=t.length,r=t[t.length-1];n.push(`else setOutput(getT${i}(yR, yC-${r}));`),this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int yR = coords.x;\n int yC = coords.y;\n\n ${n.join("\n ")}\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class zve{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=v3.backend_util.computeOutShape(e,t);const n=this.outputShape,i=n.length,r=jme(i),s=x_e("coords",i),o=["x","y","z","w","u","v"].slice(0,i);this.variableNames=e.map((e,t)=>`T${t}`);const a=new Array(e.length-1);a[0]=e[0][t];for(let n=1;n<a.length;n++)a[n]=a[n-1]+e[n][t];const l=o[t],u=o.slice(-2),c=o.join();let d=`if (${l} < ${a[0]}) {\n return getChannel(\n getT0(${c}), vec2(${u.join()}));\n }`;for(let e=1;e<a.length;e++){const t=a[e-1];d+=`\n if (${l} < ${a[e]} && ${l} >= ${a[e-1]}) {\n return getChannel(\n getT${e}(${jve(o,l,t)}),\n vec2(${jve(u,l,t)}));\n }`}const h=a.length,p=a[a.length-1];d+=`\n return getChannel(\n getT${h}(${jve(o,l,p)}),\n vec2(${jve(u,l,p)}));`,this.userCode=`\n float getValue(${o.map(e=>"int "+e)}) {\n ${d}\n }\n\n void main() {\n ${r} coords = getOutputCoords();\n vec4 result = vec4(getValue(${s}), 0., 0., 0.);\n\n ${s[i-1]} = ${s[i-1]} + 1;\n if (${s[i-1]} < ${n[i-1]}) {\n result.g = getValue(${s});\n }\n\n ${s[i-2]} = ${s[i-2]} + 1;\n if (${s[i-2]} < ${n[i-2]}) {\n result.a = getValue(${s});\n }\n\n ${s[i-1]} = ${s[i-1]} - 1;\n if (${s[i-2]} < ${n[i-2]} &&\n ${s[i-1]} < ${n[i-1]}) {\n result.b = getValue(${s});\n }\n setOutput(result);\n }\n `}}function jve(e,t,n){const i=e.indexOf(t);return e.map((e,t)=>t===i?`${e} - ${n}`:e).join()}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Yve(e){const{inputs:t,backend:n}=e,{input:i}=t;return X_e({inputs:{x:n.texData.get(i.dataId).complexTensorInfos.imag},backend:n})}const Gve={kernelName:v3.Imag,backendName:"webgl",kernelFunc:Yve};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Hve(e,t,n){const i=e[0].dtype;if("complex64"===i){const i=e.map(e=>Ove({inputs:{input:e},backend:n})),r=e.map(e=>Yve({inputs:{input:e},backend:n})),s=Hve(i,t,n),o=Hve(r,t,n),a=K_e({inputs:{real:s,imag:o},backend:n});return i.forEach(e=>n.disposeIntermediateTensorInfo(e)),r.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(s),n.disposeIntermediateTensorInfo(o),a}let r=n.shouldExecuteOnCPU(e);if("string"===i&&(r=!0),r){const r=e.map(e=>{const i=v3.util.sizeFromShape(e.shape.slice(t));return mye({inputs:{x:e},backend:n,attrs:{shape:[-1,i]}})}),s=r.map(e=>({vals:n.readSync(e.dataId),shape:e.shape})),o=v3.backend_util.computeOutShape(r.map(e=>e.shape),1),a=1===r[0].shape[0],l=Rge(s,o,i,a),u=v3.backend_util.computeOutShape(e.map(e=>e.shape),t),c=n.makeTensorInfo(u,i,l);return r.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}const s=e.filter(e=>v3.util.sizeFromShape(e.shape)>0),o=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(1===s.length){const t=o?new O_e(e[0].shape,D_e):new F_e(e[0].shape,D_e);return n.runWebGLProgram(t,e,i)}const a=(0,v3.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>a){const e=[];for(let i=0;i<s.length;i+=a){const r=s.slice(i,i+a);e.push(Hve(r,t,n))}const i=Hve(e,t,n);for(const t of e)n.disposeIntermediateTensorInfo(t);return i}if(o){const e=new zve(s.map(e=>e.shape),t);return n.runWebGLProgram(e,s,i)}const{tensors2D:l,outShape:u}=function(e,t,n){const i=v3.backend_util.computeOutShape(e.map(e=>e.shape),t),r=e.map(e=>mye({inputs:{x:e},attrs:{shape:[-1,v3.util.sizeFromShape(e.shape.slice(t))]},backend:n}));return{tensors2D:r,outShape:i}}(s,t,n),c=new Vve(l.map(e=>e.shape)),d=n.runWebGLProgram(c,l,i);l.forEach(e=>n.disposeIntermediateTensorInfo(e));const h=mye({inputs:{x:d},attrs:{shape:u},backend:n});return n.disposeIntermediateTensorInfo(d),h}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Wve(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i,s=v3.util.parseAxisParam(r,t[0].shape)[0],o=t.map(e=>e.shape);v3.backend_util.assertParamsConsistent(o,s);const a=v3.backend_util.computeOutShape(t.map(e=>e.shape),s);if(0===v3.util.sizeFromShape(a))return n.makeTensorInfo(a,t[0].dtype,[]);const l=t.filter(e=>v3.util.sizeFromShape(e.shape)>0);return 1===l.length?X_e({inputs:{x:l[0]},backend:n}):Hve(l,s,n)}const Xve={kernelName:v3.Concat,backendName:"webgl",kernelFunc:Wve};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class qve{constructor(e,t=!1,n=null,i=!1,r=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;const s=e.padInfo.top,o=e.padInfo.left,a=e.strideHeight,l=e.strideWidth,u=e.dilationHeight,c=e.dilationWidth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4,m="channelsLast"===e.dataFormat,g=m?1:2,_=m?2:3,y=m?3:1;let v="",b="";n&&(v=i?`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 `,b="result = activation(result);");const T=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${v}\n\n const ivec2 strides = ivec2(${a}, ${l});\n const ivec2 pads = ivec2(${s}, ${o});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${y}];\n\n ivec2 xRCCorner =\n ivec2(coords[${g}], coords[${_}]) * 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 < ${d}; 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 < ${h}; 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 ${T}\n ${b}\n setOutput(result);\n }\n `}}class Kve{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const t=e.padInfo.front,n=e.padInfo.top,i=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,c=e.filterDepth,d=e.filterHeight,h=e.filterWidth,p=4*Math.floor(e.inChannels/4),f=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${r}, ${s}, ${o});\n const ivec3 pads = ivec3(${t}, ${n}, ${i});\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 * ${a};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${d}; 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 < ${h}; 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 `}}
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Zve{constructor(e,t=!1,n=null,i=!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=qme(this.outputShape.length);const s=e.padInfo.left,o=e.strideWidth,a=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,c=u;let d="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e<u;e++)d+=`\n vec4 xTexelC${2*e};\n int xTexelC${2*e}Ready;\n vec4 xTexelC${2*e+1};\n int xTexelC${2*e+1}Ready;\n vec4 xC${e};`;d+=`\n for (int r = 0; r < ${l}; r++) {\n for (int d1 = 0; d1 < ${e.inChannels}; d1 += 2) {\n `;for(let e=0;e<u;e++)d+=`\n xTexelC${2*e} = vec4(0.0);\n xTexelC${2*e}Ready = 0;\n xTexelC${2*e+1} = vec4(0.0);\n xTexelC${2*e+1}Ready = 0;\n xC${e} = vec4(0.0);`;d+="\n xR = xRCorner + r * dilations[0];\n if (xR >=0 && xR < inDims[0]) {\n ";for(let t=0;t<(c+1)/2;t++){const n=2*t;if(d+=`\n xC = xCCorner + ${n*a};\n `,1===o){if(n<u&&(s%2==1?(d+=`\n xCOffset = xC + 1;\n if (xCOffset >= 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 `,d+=1===a&&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 `):d+=`\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<u)){const e=s%2==0?v3.util.nearestLargerEven(a):a;a%2==0&&s%2==1||a%2!=0&&s%2!=1?(d+=`\n xCOffset = xC + imod(pads[1], 2) + ${e};\n\n if (xCOffset >= 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 `,d+=a>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 `):d+=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<u&&(s%2==1?(d+=`\n xCOffset = xC + 1 - strides[1];\n if(xCOffset >= 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<u&&(d+=`\n final = vec4(0.0);\n xCOffset = xC + 1 + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${n+1} = vec4(xTexelC${n+1}.xy, final.xy);\n `)):(d+=`\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<u&&(d+=`\n xC${n+1} = vec4(xTexelC${n}.zw, xTexelC${n+1}.zw);\n `)));n<u&&(d+=`\n wTexel = getW(r, ${n}, d1, d2);\n dotProd += xC${n}.xxzz * vec4(wTexel.xy, wTexel.xy);\n if(d1 + 1 < ${e.inChannels}) {\n dotProd += xC${n}.yyww * vec4(wTexel.zw, wTexel.zw);\n }\n `,n+1<u&&(d+=`\n wTexel = getW(r, ${n+1}, d1, d2);\n dotProd += xC${n+1}.xxzz * vec4(wTexel.xy, wTexel.xy);\n if(d1 + 1 < ${e.inChannels}) {\n dotProd += xC${n+1}.yyww * vec4(wTexel.zw, wTexel.zw);\n }\n `))}d+="\n }\n ",d+="\n }\n ",d+="\n }\n ";let h="",p="";n&&(h=i?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`vec4 activation(vec4 x) {\n ${n}\n }`,p="result = activation(result);");const f=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${h}\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 xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n vec4 dotProd = vec4(0.000000000000001);\n\n ${d}\n\n vec4 result = dotProd - vec4(0.000000000000001);\n ${f}\n ${p}\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Qve{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec4"},{name:"pad",type:"ivec2"},{name:"stride",type:"ivec2"},{name:"dilation",type:"ivec2"},{name:"inChannels",type:"int"},{name:"itemsPerBlockRow",type:"int"},{name:"outWidth",type:"int"}],this.outputShape=e,this.enableShapeUniforms=qme(this.outputShape.length);const{dataFormat:n}=t,i=Ame(),r="channelsLast"===n,s=r?1:2,o=r?2:3,a=this.enableShapeUniforms?"if(blockIndex < outShape[2] && pos < outShape[1]) {":`if(blockIndex < ${e[2]} && pos < ${e[1]}) {`;let l="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)l+=`\n blockIndex = rc.z + ${t};\n pos = rc.y + ${e};\n\n ${a}\n offsetY = int(blockIndex / outWidth) * stride[0] - pad[0];\n d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow);\n\n if(d0 < inputShape[${s}] && d0 >= 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[${o}] && 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 ${i.output} = result;\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Jve(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 ebe({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const l=e.shape,u=i.texData.get(e.dataId),c=n.inChannels,d=l[0]*l[1]*l[2],h=n.outChannels,p="channelsLast"===n.dataFormat,f=!1;let m;const g=[];if(null!=s){const e=Jve(s.shape,p);null!=e&&(s=mye({inputs:{x:s},backend:i,attrs:{shape:e}}),g.push(s))}if(null!=r){const e=Jve(r.shape,p);null!=e&&(r=mye({inputs:{x:r},backend:i,attrs:{shape:e}}),g.push(r))}if(!((1===d||1===h)&&c>1e3)&&u.isPacked&&p&&null!=u.texture&&l[2]%2!=0&&v3.util.arraysEqual(u.shape.slice(-3),l.slice(-3))){const c=l[0]*l[1]*(l[2]+1),d={dataId:e.dataId,shape:[1,c,n.inChannels],dtype:e.dtype},h=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,v3.util.assert(cme(u.shape,d.shape),()=>`packed reshape ${u.shape} to ${d.shape} isn't free`);const p=mye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}});g.push(p);const _=Sye({a:d,b:p,backend:i,transposeA:false,transposeB:f,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o}),y=i.texData.get(_.dataId);v3.util.assert(y.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=h,y.shape=n.outShape,m=X_e({inputs:{x:_},backend:i}),m.shape=n.outShape,g.push(_)}else{const l=n.outHeight*n.outWidth,u=mye({inputs:{x:e},backend:i,attrs:{shape:p?[n.batchSize,l,n.inChannels]:[n.batchSize,n.inChannels,l]}}),c=mye({inputs:{x:t},backend:i,attrs:{shape:[1,n.inChannels,n.outChannels]}}),d=Sye({a:p?u:c,b:p?c:u,transposeA:!p,transposeB:f,backend:i,bias:r,activation:a,preluActivationWeights:s,leakyreluAlpha:o});m=mye({inputs:{x:d},backend:i,attrs:{shape:n.outShape}}),g.push(u),g.push(c),g.push(d)}for(const e of g)i.disposeIntermediateTensorInfo(e);return m}function tbe({x:e,filter:t,convInfo:n,backend:i,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:o=0,activation:a=null}){const{filterWidth:l,filterHeight:u,inChannels:c,outWidth:d,outHeight:h,dataFormat:p}=n,f="channelsLast"===p,m=l*u*c,g=h*d,_=[n.batchSize,m,g],y=[];if(null!=s){const e=Jve(s.shape,f);null!=e&&(s=mye({inputs:{x:s},backend:i,attrs:{shape:e}}),y.push(s))}if(null!=r){const e=Jve(r.shape,f);null!=e&&(r=mye({inputs:{x:r},backend:i,attrs:{shape:e}}),y.push(r))}const v=mye({inputs:{x:t},backend:i,attrs:{shape:[1,m,v3.util.sizeFromShape(t.shape)/m]}});y.push(v);const b=new Qve(_,n),T=[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=i.runWebGLProgram(b,[e],"float32",T),E=mye({inputs:{x},backend:i,attrs:{shape:_}});y.push(x),y.push(E);const w=null!=r,I=null!=s,A="leakyrelu"===a,S=a?aye(a,!0):null,C=new lye(f?E.shape:v.shape,f?v.shape:E.shape,f?[n.batchSize,g,n.outChannels]:[n.batchSize,n.outChannels,g],!0,!1,w,S,I,A),O=f?[E,v]:[v,E];if(r&&O.push(r),I&&O.push(s),A){const e=i.makeTensorInfo([],"float32",v3.util.createScalarValue(o,"float32"));O.push(e),y.push(e)}const M=i.runWebGLProgram(C,O,"float32"),k=mye({inputs:{x:M},backend:i,attrs:{shape:n.outShape}});y.push(M);for(const e of y)i.disposeIntermediateTensorInfo(e);return k}const nbe={kernelName:v3.Conv2D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dataFormat:l,dilations:u,dimRoundingMode:c}=i,d=v3.backend_util.convertConv2DDataFormat(l),h=v3.backend_util.computeConv2DInfo(r.shape,s.shape,o,u,a,c,!1,d);let p;if(1!==h.filterHeight||1!==h.filterWidth||1!==h.dilationHeight||1!==h.dilationWidth||1!==h.strideHeight||1!==h.strideWidth||"SAME"!==h.padInfo.type&&"VALID"!==h.padInfo.type)if(h.strideWidth<=2&&"channelsLast"===d&&(0,v3.env)().getBool("WEBGL_EXP_CONV")){const e=new Zve(h),t=[[h.padInfo.top,h.padInfo.left],[h.strideHeight,h.strideWidth],[h.dilationHeight,h.dilationWidth],[h.inHeight,h.inWidth]];p=n.runWebGLProgram(e,[r,s],"float32",t)}else if((0,v3.env)().getBool("WEBGL_CONV_IM2COL"))p=tbe({x:r,filter:s,convInfo:h,backend:n});else{const e=new qve(h);p=n.runWebGLProgram(e,[r,s],"float32")}else p=ebe({x:r,filter:s,convInfo:h,backend:n});const f=mye({inputs:{x:p},backend:n,attrs:{shape:h.outShape}});return n.disposeIntermediateTensorInfo(p),f}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class ibe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s="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} - ${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 * ${n} - ${r};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${s?"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 rbe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s="channelsLast"===e.dataFormat,o=t-1-e.padInfo.top,a=n-1-e.padInfo.left,l=s?1:2,u=s?2:3,c=s?3:1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\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) / ${i}.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 (${s}) {\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 sbe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,o=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} - ${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 * ${i} - ${o};\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 obe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterDepth,n=e.filterHeight,i=e.filterWidth,r=e.strideDepth,s=e.strideHeight,o=e.strideWidth,a=t-1-e.padInfo.front,l=n-1-e.padInfo.top,u=i-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${a}, ${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) / ${s}.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 < ${i}; wC++) {\n float dyC = float(dyCCorner + wC) / ${o}.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 = ${i} - 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 abe={kernelName:v3.Conv2DBackpropFilter,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,dataFormat:l,dimRoundingMode:u,filterShape:c}=i,d=v3.backend_util.convertConv2DDataFormat(l),h=v3.backend_util.computeConv2DInfo(r.shape,c,o,1,a,u,!1,d),p=new ibe(h);return n.runWebGLProgram(p,[r,s],"float32")}};
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class lbe{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=qme(this.outputShape.length);const t=e.filterHeight,n=e.filterWidth,i=t-1-e.padInfo.top,r=n-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${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 ube={kernelName:v3.Conv2DBackpropInput,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{inputShape:o,strides:a,pad:l,dataFormat:u,dimRoundingMode:c}=i,d=v3.backend_util.convertConv2DDataFormat(u),h=v3.backend_util.computeConv2DInfo(o,s.shape,a,1,l,c,!1,d);if((0,v3.env)().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===d){const e=[[h.strideHeight,h.strideWidth]],t=new lbe(h);return n.runWebGLProgram(t,[r,s],"float32",e)}{const e=new rbe(h);return n.runWebGLProgram(e,[r,s],"float32")}}};const cbe={kernelName:v3.Conv3D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=v3.backend_util.computeConv3DInfo(r.shape,s.shape,o,l,a),c=new Kve(u);return n.runWebGLProgram(c,[r,s],"float32")}};const dbe={kernelName:v3.Conv3DBackpropFilterV2,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,pad:a,filterShape:l}=i,u=v3.backend_util.computeConv3DInfo(r.shape,l,o,1,a),c=new sbe(u);return n.runWebGLProgram(c,[r,s],"float32")}};const hbe={kernelName:v3.Conv3DBackpropInputV2,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{pad:o,strides:a,inputShape:l}=i,u=v3.backend_util.computeConv3DInfo(l,s.shape,a,1,o),c=new obe(u);return n.runWebGLProgram(c,[r,s],"float32")}},pbe=sye({opSnippet:rye+"\n return cos(x);\n",packedOpSnippet:`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${H_e}\n return result;\n`}),fbe={kernelName:v3.Cos,backendName:"webgl",kernelFunc:pbe},mbe=sye({opSnippet:"\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n"}),gbe={kernelName:v3.Cosh,backendName:"webgl",kernelFunc:mbe};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class _be{constructor(e,t,n,i,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];const[s,o,a,l]=e,[u]=t,[c,d]=n;this.outputShape=[u,c,d,l];const h="bilinear"===i?1:0,[p,f]=[o-1+".0",a-1+".0"],[m,g,_]=c>1?[""+(o-1)/(c-1),"(y2-y1) * height_ratio",`y1*${p} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${p}`],[y,v,b]=d>1?[""+(a-1)/(d-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(${y});\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 >= ${s}) {\n return;\n }\n\n float height_scale = ${g};\n float width_scale = ${v};\n\n float in_y = ${_};\n if( in_y < 0.0 || in_y > ${p} ) {\n setOutput(float(${r}));\n return;\n }\n float in_x = ${b};\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(${h} == 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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const ybe={kernelName:v3.CropAndResize,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{image:r,boxes:s,boxInd:o}=t,{cropSize:a,method:l,extrapolationValue:u}=i,c=new _be(r.shape,s.shape,a,l,u);return n.runWebGLProgram(c,[r,s,o],"float32")}};var vbe;!function(e){e.Prod="*",e.Sum="+"}(vbe||(vbe={}));class bbe{constructor(e,t,n,i){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];const r=this.outputShape.length,s=this.op===vbe.Prod?"1.0":"0.0",o=n?s:`getX(${Tbe(r,"coords",this.op)})`,a=this.outputShape[this.outputShape.length-1];let l="",u="";n?(l=i?"end != "+(a-1):"end != 0",u=i?"end + 1":"end - 1"):(l=i?`end + pow2 < ${a}`:"end >= pow2",u=i?"end + pow2":"end - pow2"),this.userCode=`\n void main() {\n ${jme(r)} coords = getOutputCoords();\n int end = ${xbe(r,"coords",this.op)};\n float val = ${o};\n int pow2 = int(pow(2.0, index));\n if (${l}) {\n int idx = ${u};\n ${xbe(r,"coords",this.op)} = idx;\n val ${this.op}= getX(${Tbe(r,"coords",this.op)});\n }\n setOutput(val);\n }\n `}}function Tbe(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 xbe(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`)}
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Ebe(e,t,n,i,r,s){const o=t.shape.length,a=v3.backend_util.getAxesPermutation([i],o);let l=t;null!=a&&(l=Iye({inputs:{x:t},backend:n,attrs:{perm:a}}));const u=v3.backend_util.getInnerMostAxes(1,o)[0];if(u!==o-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${i}`);const c=l.shape[u];let d=X_e({inputs:{x:l},backend:n});for(let t=0;t<=Math.ceil(Math.log2(c))-1;t++){const i=new bbe(e,l.shape,!1,s),r=[[t]],o=d;d=n.runWebGLProgram(i,[d],d.dtype,r),n.disposeIntermediateTensorInfo(o)}if(r){const t=new bbe(e,l.shape,r,s),i=d;d=n.runWebGLProgram(t,[d],d.dtype),n.disposeIntermediateTensorInfo(i)}if(null!=a){const e=Iye({inputs:{x:d},backend:n,attrs:{perm:v3.backend_util.getUndoAxesPermutation(a)}});return n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(l),e}return d}const wbe={kernelName:v3.Cumprod,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return Ebe(vbe.Prod,r,n,s,o,a)}};const Ibe={kernelName:v3.Cumsum,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,exclusive:o,reverse:a}=i;return Ebe(vbe.Sum,r,n,s,o,a)}};const Abe={kernelName:v3.DenseBincount,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,weights:s}=t,{size:o,binaryOutput:a}=i;if(1===r.shape.length){const e=n.readSync(r.dataId),t=n.readSync(s.dataId),i=Sge(e,t,s.dtype,s.shape,o);return n.makeTensorInfo([o],s.dtype,i)}if(2===r.shape.length){const e=n.bufferSync(r),t=n.bufferSync(s),i=Cge(e,t,o,a);return n.makeTensorInfo(i.shape,s.dtype,i.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Sbe{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 Cbe={kernelName:v3.DepthToSpace,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockSize:s,dataFormat:o}=i,a=r.shape[0],l=("NHWC"===o?r.shape[1]:r.shape[2])*s,u=("NHWC"===o?r.shape[2]:r.shape[3])*s,c=("NHWC"===o?r.shape[3]:r.shape[1])/(s*s),d=new Sbe("NHWC"===o?[a,l,u,c]:[a,c,l,u],s,o);return n.runWebGLProgram(d,[r],r.dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Obe{constructor(e,t=!1,n=null,i=!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=qme(this.outputShape.length);const s=e.filterHeight,o=e.filterWidth,a=e.outChannels/e.inChannels;let l="",u="";n&&(l=i?`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"),i&&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 / ${a};\n int q = d2 - d1 * ${a};\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 < ${s}; 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 < ${o}; 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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Mbe{constructor(e,t=!1,n=null,i=!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=qme(this.outputShape.length);const s=e.outChannels/e.inChannels,o=e.padInfo.left,a=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,c=e.filterWidth,d=c;let h="\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;";for(let e=0;e<c;e++)h+=`\n vec4 xTexelC${2*e};\n int xTexelC${2*e}Ready;\n vec4 xTexelC${2*e+1};\n int xTexelC${2*e+1}Ready;\n vec4 xC${e};`;h+=`\n for (int r = 0; r < ${u}; r++) {\n `;for(let e=0;e<c;e++)h+=`\n xTexelC${2*e} = vec4(0.0);\n xTexelC${2*e}Ready = 0;\n xTexelC${2*e+1} = vec4(0.0);\n xTexelC${2*e+1}Ready = 0;\n xC${e} = vec4(0.0);`;h+="\n xR = xRCorner + r * dilations[0];\n if (xR >=0 && xR < inDims[0]) {\n ";for(let e=0;e<(d+1)/2;e++){const t=2*e;if(h+=`\n xC = xCCorner + ${t*l};\n `,1===a){if(t<c&&(o%2==1?(h+=`\n xCOffset = xC + 1;\n if (xCOffset >= 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 `,h+=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 `):h+=`\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<c)){const e=o%2==0?v3.util.nearestLargerEven(l):l;l%2==0&&o%2==1||l%2!=0&&o%2!=1?(h+=`\n xCOffset = xC + imod(pads[1], 2) + ${e};\n\n if (xCOffset >= 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 `,h+=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 `):h+=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<c&&(o%2==1?(h+=`\n xCOffset = xC + 1 - strides[1];\n if(xCOffset >= 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<c&&(h+=`\n final = vec4(0.0);\n xCOffset = xC + 1 + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy);\n `)):(h+=`\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<c&&(h+=`\n xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw);\n `)));t<c&&(h+=`\n wTexel = getW(r, ${t}, d1, q);\n dotProd += xC${t} * vec4(wTexel.xz, wTexel.xz);\n `,t+1<c&&(h+=`\n wTexel = getW(r, ${t+1}, d1, q);\n dotProd += xC${t+1} * vec4(wTexel.xz, wTexel.xz);\n `))}h+="\n }\n ",h+="\n }\n ";let p="",f="";n&&(p=i?`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${n}\n }`:r?`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${n}\n }`:`vec4 activation(vec4 x) {\n ${n}\n }`,f="result = activation(result);");const m=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=`\n ${p}\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 / ${s};\n int q = d2 - d1 * ${s};\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n //intialize dotProd with a small epsilon seems to reduce GPU accuracy loss.\n vec4 dotProd = vec4(0.000000000000001);\n\n ${h}\n\n vec4 result = dotProd - vec4(0.000000000000001);\n ${m}\n ${f}\n setOutput(result);\n }\n `}}const kbe={kernelName:v3.DepthwiseConv2dNative,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l,dimRoundingMode:u}=i;let c=l;null==c&&(c=[1,1]),v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,c),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${o} and dilations '${c}'`);const d=v3.backend_util.computeConv2DInfo(r.shape,s.shape,o,c,a,u,!0);let h;h=(0,v3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&d.strideWidth<=2&&d.outChannels/d.inChannels===1?new Mbe(d):new Obe(d);const p=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];return n.runWebGLProgram(h,[r,s],"float32",p)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Rbe{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;const t=e.strideHeight,n=e.strideWidth,i=e.padInfo.top,r=e.padInfo.left,s=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 * ${s} + 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} - ${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 * ${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 Nbe{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;const t=e.filterHeight,n=e.filterWidth,i=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,o=n-1-e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${s}, ${o});\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) / ${i}.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 < ${a}; dm++) {\n int d2 = d1 * ${a} + 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 Dbe={kernelName:v3.DepthwiseConv2dNativeBackpropFilter,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,dy:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,filterShape:c}=i,d=v3.backend_util.computeConv2DInfo(r.shape,c,o,a,l,u,!0),h=new Rbe(d);return n.runWebGLProgram(h,[r,s],"float32")}};const Fbe={kernelName:v3.DepthwiseConv2dNativeBackpropInput,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,filter:s}=t,{strides:o,dilations:a,pad:l,dimRoundingMode:u,inputShape:c}=i,d=v3.backend_util.computeConv2DInfo(c,s.shape,o,a,l,u,!0),h=new Nbe(d);return n.runWebGLProgram(h,[r,s],"float32")}};
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Lbe{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 Pbe={kernelName:v3.Diag,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{x:i}=t,r=[...i.shape,...i.shape],s=v3.util.sizeFromShape(i.shape),o=mye({inputs:{x:i},backend:n,attrs:{shape:[s]}}),a=new Lbe(s),l=n.runWebGLProgram(a,[o],o.dtype),u=mye({inputs:{x:l},backend:n,attrs:{shape:r}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),u}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Bbe{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;const{inHeight:t,inWidth:n,padInfo:i,strideHeight:r,strideWidth:s,filterHeight:o,filterWidth:a,dilationHeight:l,dilationWidth:u}=e,{top:c,left:d}=i;this.userCode=`\n const ivec2 strides = ivec2(${r}, ${s});\n const ivec2 pads = ivec2(${c}, ${d});\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 < ${o}; h++) {\n int hIn = hBeg + h * ${l};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${a}; 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 $be={kernelName:v3.Dilation2D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s}=t,{strides:o,pad:a,dilations:l}=i,u=v3.backend_util.computeDilation2DInfo(r.shape,s.shape,o,a,"NHWC",l);let c;const d=new Bbe(u);c=n.runWebGLProgram(d,[r,s],"float32");const h=mye({inputs:{x:c},backend:n,attrs:{shape:u.outShape}});return n.disposeIntermediateTensorInfo(c),h}};const Ube={kernelName:v3.Einsum,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{equation:r}=i,s=t,{allDims:o,summedDims:a,idDims:l}=v3.backend_util.decodeEinsumEquation(r,s.length);v3.backend_util.checkEinsumDimSizes(o.length,l,s);const{path:u,steps:c}=v3.backend_util.getEinsumComputePath(a,l),d=c.length;let h=null,p=o.length;const f=[];for(let e=0;e<d;++e){for(const t of c[e]){const{permutationIndices:e,expandDims:i}=v3.backend_util.getEinsumPermutation(p,l[t]);let r;v3.backend_util.isIdentityPermutation(e)?r=s[t]:(r=Iye({inputs:{x:s[t]},backend:n,attrs:{perm:e}}),f.push(r));const o=r.shape.slice();for(let e=0;e<i.length;++e)o.splice(i[e],0,1);v3.util.arraysEqual(r.shape,o)||(r=mye({inputs:{x:r},backend:n,attrs:{shape:o}}),f.push(r)),null===h?h=r:(h=pye({inputs:{a:r,b:h},backend:n}),f.push(h))}e<d-1&&(u[e]>=0&&(h=Eye({inputs:{x:h},backend:n,attrs:{axis:u[e]-(o.length-p),keepDims:!1}}),f.push(h)),p--)}for(const e of f)e!==h&&n.disposeIntermediateTensorInfo(e);return h}},Vbe=sye({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"}),zbe={kernelName:v3.Elu,backendName:"webgl",kernelFunc:Vbe},jbe={kernelName:v3.EluGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n}=e,{dy:i,y:r}=t,s=(0,v3.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new W_e("\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n",i.shape,r.shape):new G_e("return (b >= 0.0) ? a : a * (b + 1.0);",i.shape,r.shape);return n.runWebGLProgram(s,[i,r],i.dtype)}},Ybe=oye({opSnippet:"return float(a == b);",packedOpSnippet:"\n return vec4(equal(a, b));\n",dtype:"bool",cpuKernelImpl:Nge}),Gbe={kernelName:v3.Equal,backendName:"webgl",kernelFunc:Ybe},Hbe=sye({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 = ${v3.backend_util.ERF_P};\n float a1 = ${v3.backend_util.ERF_A1};\n float a2 = ${v3.backend_util.ERF_A2};\n float a3 = ${v3.backend_util.ERF_A3};\n float a4 = ${v3.backend_util.ERF_A4};\n float a5 = ${v3.backend_util.ERF_A5};\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`}),Wbe={kernelName:v3.Erf,backendName:"webgl",kernelFunc:Hbe},Xbe=sye({opSnippet:rye+"\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:Dge,dtype:"float32"}),qbe={kernelName:v3.Exp,backendName:"webgl",kernelFunc:Xbe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Kbe(e){const{inputs:t,attrs:n,backend:i}=e,{dim:r}=n,{input:s}=t,o=s.shape.length,a=s.shape.slice();let l=r;return r<0&&(v3.util.assert(-(o+1)<=r,()=>`Axis must be in the interval [${-(o+1)}, ${o}]`),l=o+r+1),a.splice(l,0,1),mye({inputs:{x:s},backend:i,attrs:{shape:a}})}const Zbe={kernelName:v3.ExpandDims,backendName:"webgl",kernelFunc:Kbe},Qbe="return exp(x) - 1.0;",Jbe=sye({opSnippet:Qbe,packedOpSnippet:Qbe,cpuKernelImpl:Fge}),eTe={kernelName:v3.Expm1,backendName:"webgl",kernelFunc:Jbe};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class tTe{constructor(e,t,n){this.variableNames=["real","imag"];const i=t[1];this.outputShape=t;const r=n?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=n?`${i}.0`:"1.0";let o;if("real"===e)o="return real * expR - imag * expI;";else{if("imag"!==e)throw new Error(`FFT component must be either "real" or "imag", got ${e}.`);o="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 ${o}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${i});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${i}; 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) / ${s};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function nTe(e,t,n){const i=n.texData.get(e.dataId),r=v3.util.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],o=mye({inputs:{x:e},backend:n,attrs:{shape:[r/s,s]}}),a=o.shape,l=new tTe("real",a,t),u=new tTe("imag",a,t),c=[{dataId:i.complexTensorInfos.real.dataId,dtype:i.complexTensorInfos.real.dtype,shape:a},{dataId:i.complexTensorInfos.imag.dataId,dtype:i.complexTensorInfos.imag.dtype,shape:a}],d=n.runWebGLProgram(l,c,"float32"),h=n.runWebGLProgram(u,c,"float32"),p=K_e({inputs:{real:d,imag:h},backend:n});n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h);const f=mye({inputs:{x:p},backend:n,attrs:{shape:e.shape}});return n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(p),f}const iTe={kernelName:v3.FFT,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{input:i}=t;return nTe(i,!1,n)}};
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class rTe{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 "}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function sTe(e){const{backend:t,attrs:n}=e,{shape:i,value:r}=n;let{dtype:s}=n;if(s=s||v3.util.inferDtype(r),"string"===s){const e=v3.util.getArrayFromDType(s,v3.util.sizeFromShape(i));return e.fill(r),t.makeTensorInfo(i,s,e)}{const e=new rTe(i,r),n=[[r]];return t.runWebGLProgram(e,[],s,n)}}const oTe={kernelName:v3.Fill,backendName:"webgl",kernelFunc:sTe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class aTe{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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const lTe={kernelName:v3.FlipLeftRight,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{const{image:n}=e,i=t,r=new aTe(n.shape);return i.runWebGLProgram(r,[n],n.dtype)}},uTe="return floor(x);",cTe=sye({opSnippet:uTe,packedOpSnippet:uTe,cpuKernelImpl:Lge}),dTe={kernelName:v3.Floor,backendName:"webgl",kernelFunc:cTe},hTe=oye({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"}),pTe={kernelName:v3.FloorDiv,backendName:"webgl",kernelFunc:hTe};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class fTe{constructor(e){this.variableNames=["A"];const t=Ame(),[n,i]=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(${i}.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 `}}
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class mTe{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;const t=Ame(),[n,i]=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(${i}.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 `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const gTe={kernelName:v3.FromPixels,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e;let{pixels:r}=t;const{numChannels:s}=i,o="undefined"!=typeof HTMLVideoElement&&r instanceof HTMLVideoElement,a="undefined"!=typeof HTMLImageElement&&r instanceof HTMLImageElement,[l,u]=o?[r.videoWidth,r.videoHeight]:[r.width,r.height],c=[u,l],d=[u,l,s];if(a||o){const e=(0,v3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");null!=_Te&&e===yTe||(yTe=e,_Te=document.createElement("canvas").getContext("2d",{willReadFrequently:yTe})),_Te.canvas.width=l,_Te.canvas.height=u,_Te.drawImage(r,0,0,l,u),r=_Te.canvas}const h=n.makeTensorInfo(c,"int32");n.texData.get(h.dataId).usage=Tfe.PIXELS,n.gpgpu.uploadPixelDataToTexture(n.getTexture(h.dataId),r);const p=(0,v3.env)().getBool("WEBGL_PACK")?new mTe(d):new fTe(d),f=n.runWebGLProgram(p,[h],"int32");return n.disposeData(h.dataId),f}};let _Te,yTe=(0,v3.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");const vTe={kernelName:v3.FusedConv2D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dataFormat:c,dilations:d,dimRoundingMode:h,activation:p,leakyreluAlpha:f}=i,m=v3.backend_util.convertConv2DDataFormat(c),g=v3.backend_util.computeConv2DInfo(r.shape,s.shape,l,d,u,h,!1,m);let _;const y=[],v=null!=o,b=null!=a,T="leakyrelu"===p,x=()=>{const e=[r,s],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){const t=mye({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return y.push(t),t}return e};if(v&&e.push(t(o,c)),b&&e.push(t(a,c)),T){const t=n.makeTensorInfo([],"float32",v3.util.createScalarValue(f,"float32"));e.push(t),y.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&&(0,v3.env)().getBool("WEBGL_EXP_CONV")){const e=p?aye(p,!0):null,t=new Zve(g,v,e,b,T),i=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],r=x();_=n.runWebGLProgram(t,r,"float32",i)}else if((0,v3.env)().getBool("WEBGL_CONV_IM2COL"))_=tbe({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});else{const e=p?aye(p,!1):null,t=new qve(g,v,e,b,T),i=x();_=n.runWebGLProgram(t,i,"float32")}else _=ebe({x:r,filter:s,convInfo:g,backend:n,bias:o,activation:p,preluActivationWeights:a,leakyreluAlpha:f});const E=mye({inputs:{x:_},backend:n,attrs:{shape:g.outShape}});return y.push(_),y.forEach(e=>n.disposeIntermediateTensorInfo(e)),E}};const bTe={kernelName:v3.FusedDepthwiseConv2D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,filter:s,bias:o,preluActivationWeights:a}=t,{strides:l,pad:u,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:p}=i,f=[];let m=c;null==m&&(m=[1,1]),v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(l,m),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`);const g=v3.backend_util.computeConv2DInfo(r.shape,s.shape,l,m,u,d,!0),_=(0,v3.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,y=h?aye(h,_):null,v=[r,s],b=null!=o,T=null!=a,x="leakyrelu"===h;if(b&&v.push(o),T&&v.push(a),x){const e=n.makeTensorInfo([],"float32",v3.util.createScalarValue(p,"float32"));v.push(e),f.push(e)}let E;E=_?new Mbe(g,b,y,T,x):new Obe(g,b,y,T,x);const w=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],I=n.runWebGLProgram(E,v,"float32",w);return f.forEach(e=>n.disposeIntermediateTensorInfo(e)),I}};class TTe{constructor(e,t,n,i){this.sliceDim=e,this.strides=t,this.paramsShape=i,this.variableNames=["x","indices"],this.outputShape=n;const r=jme(n.length);let s="\n int index;";for(let e=0;e<this.sliceDim;e++)s+=`\n index = round(getIndices(coords[0], ${e}));\n out_of_bounds = out_of_bounds || index < 0;\n out_of_bounds = out_of_bounds || index >= ${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 ${s}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}}const xTe={kernelName:v3.GatherNd,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{params:i,indices:r}=t,s=r.shape,o=s[s.length-1],a=v3.util.sizeFromShape(i.shape),[l,u,c,d]=v3.backend_util.prepareAndValidate(i,r),h=mye({inputs:{x:r},backend:n,attrs:{shape:[u,o]}}),p=mye({inputs:{x:i},backend:n,attrs:{shape:[v3.util.sizeFromShape(i.shape)/c,c]}});if(n.shouldExecuteOnCPU([i,r])||"string"===i.dtype){const e=n.readSync(r.dataId),t=n.bufferSync(i),s=Pge(e,t,i.dtype,u,o,c,d,i.shape,a);return n.makeTensorInfo(l,i.dtype,s.values)}const f=new TTe(o,d,[u,c],i.shape),m=n.runWebGLProgram(f,[p,h],p.dtype),g=mye({inputs:{x:m},backend:n,attrs:{shape:l}});return n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(m),g}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class ETe{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;const n=jme(this.rank),i=function(e){const t=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let i=0;i<e.length;i++)2===i?n.push("index"):n.push(`${t[i]}`);return n.join()}(e);this.userCode=`\n void main() {\n ${n} resRC = getOutputCoords();\n int index = int(getIndices(resRC.x, resRC.z));\n float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${i}));\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function wTe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,indices:s}=t,{axis:o,batchDims:a}=i,l=v3.util.parseAxisParam(o,r.shape)[0];if((0,v3.env)().get("DEBUG")){const e=n.readSync(s.dataId),t=r.shape[l];for(let n=0;n<e.length;++n){const i=e[n];v3.util.assert(i<=t-1&&i>=0,()=>`GatherV2: the index value ${i} is not in [0, ${t-1}]`)}}const u=v3.backend_util.segment_util.collectGatherOpShapeInfo(r,s,l,a),c=v3.util.sizeFromShape(s.shape),d=[],h=mye({inputs:{x:r},backend:n,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),p=mye({inputs:{x:s},backend:n,attrs:{shape:[u.batchSize,c/u.batchSize]}});d.push(h),d.push(p);const f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(n.shouldExecuteOnCPU([r,s])||"string"===r.dtype){const e=n.bufferSync(p),t=n.bufferSync(h),i=Bge(t,e,f);return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.makeTensorInfo(u.outputShape,i.dtype,i.values)}const m=new ETe(h.shape,f),g=n.runWebGLProgram(m,[h,p],h.dtype);d.push(g);const _=mye({inputs:{x:g},backend:n,attrs:{shape:u.outputShape}});return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),_}const ITe={kernelName:v3.GatherV2,backendName:"webgl",kernelFunc:wTe},ATe=oye({opSnippet:"return float(a > b);",packedOpSnippet:"\n return vec4(greaterThan(a, b));\n",cpuKernelImpl:$ge,dtype:"bool"}),STe={kernelName:v3.Greater,backendName:"webgl",kernelFunc:ATe},CTe=oye({opSnippet:"return float(a >= b);",packedOpSnippet:"\n return vec4(greaterThanEqual(a, b));\n",dtype:"bool",cpuKernelImpl:Uge}),OTe={kernelName:v3.GreaterEqual,backendName:"webgl",kernelFunc:CTe};const MTe={kernelName:v3.IFFT,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{input:i}=t;return nTe(i,!0,n)}},kTe=sye({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),RTe={kernelName:v3.IsFinite,backendName:"webgl",kernelFunc:kTe},NTe=sye({opSnippet:"return float(isinf(x));",dtype:"bool"}),DTe={kernelName:v3.IsInf,backendName:"webgl",kernelFunc:NTe},FTe=sye({opSnippet:"return float(isnan(x));",dtype:"bool"}),LTe={kernelName:v3.IsNan,backendName:"webgl",kernelFunc:FTe},PTe=oye({opSnippet:"return float(a < b);",packedOpSnippet:"\n return vec4(lessThan(a, b));\n",cpuKernelImpl:Vge,dtype:"bool"}),BTe={kernelName:v3.Less,backendName:"webgl",kernelFunc:PTe},$Te=oye({opSnippet:"return float(a <= b);",packedOpSnippet:"\n return vec4(lessThanEqual(a, b));\n",cpuKernelImpl:zge,dtype:"bool"}),UTe={kernelName:v3.LessEqual,backendName:"webgl",kernelFunc:$Te};const VTe={kernelName:v3.LinSpace,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{backend:t,attrs:n}=e,{start:i,stop:r,num:s}=n,o=jge(i,r,s);return t.makeTensorInfo([o.length],"float32",o)}},zTe=sye({opSnippet:rye+"\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:Yge}),jTe={kernelName:v3.Log,backendName:"webgl",kernelFunc:zTe},YTe=sye({opSnippet:rye+"\n return log(1.0 + x);\n"}),GTe={kernelName:v3.Log1p,backendName:"webgl",kernelFunc:YTe},HTe=oye({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"}),WTe={kernelName:v3.LogicalAnd,backendName:"webgl",kernelFunc:HTe},XTe=sye({opSnippet:"return float(!(x >= 1.0));"}),qTe={kernelName:v3.LogicalNot,backendName:"webgl",kernelFunc:XTe},KTe=oye({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"}),ZTe={kernelName:v3.LogicalOr,backendName:"webgl",kernelFunc:KTe};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class QTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[];const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.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 = -${s}; j <= ${s}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${o}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${a};\n setOutput(val);\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class JTe{constructor(e,t,n,i,r){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;const s=t,o=e[3]-1;let a;this.outputShape=e;const l=`float(${n}) + float(${i}) * sum`;a=.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 - ${s};\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 = - ${s}; j <= ${s}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o}));\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 * ${a};\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const exe={kernelName:v3.LRN,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{depthRadius:s,bias:o,alpha:a,beta:l}=i,u=(0,v3.env)().getBool("WEBGL_PACK_NORMALIZATION")?new JTe(r.shape,s,o,a,l):new QTe(r.shape,s,o,a,l);return n.runWebGLProgram(u,[r],r.dtype)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class txe{constructor(e,t,n,i,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=n,this.alpha=i,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(${i}) * 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(${i})\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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const nxe={kernelName:v3.LRNGrad,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r,y:s,dy:o}=t,{depthRadius:a,bias:l,alpha:u,beta:c}=i,d=new txe(r.shape,a,l,u,c);return n.runWebGLProgram(d,[r,s,o],r.dtype)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function ixe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reductionIndices:s,keepDims:o}=i,a=r.shape.length,l=v3.util.parseAxisParam(s,r.shape);let u=l;const c=v3.backend_util.getAxesPermutation(u,a),d=null!=c,h=n.shouldExecuteOnCPU([r]);let p=r;if(d){if(h){const e=n.texData.get(p.dataId).values,t=new Array(a);for(let e=0;e<t.length;e++)t[e]=r.shape[c[e]];const i=v_e(e,r.shape,r.dtype,c,t);p=n.makeTensorInfo(t,r.dtype);n.texData.get(p.dataId).values=i}else p=xye(r,c,n);u=v3.backend_util.getInnerMostAxes(u.length,a)}v3.backend_util.assertAxesAreInnerMostDims("max",u,a);const[f,m]=v3.backend_util.computeOutAndReduceShapes(p.shape,u);let g,_=f;if(o&&(_=v3.backend_util.expandShapeToKeepDim(f,l)),h){const e=n.texData.get(p.dataId).values,t=Gge(e,v3.util.sizeFromShape(m),_,r.dtype);g=n.makeTensorInfo(_,r.dtype);n.texData.get(g.dataId).values=t}else g=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=v3.util.sizeFromShape(t),s=mye({inputs:{x:e},attrs:{shape:[v3.util.sizeFromShape(e.shape)/r,r]},backend:i}),o=vye(s,e.dtype,"max",i),a=mye({inputs:{x:o},attrs:{shape:n},backend:i});return i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}(p,m,_,n);return d&&n.disposeIntermediateTensorInfo(p),g}const rxe={kernelName:v3.Max,backendName:"webgl",kernelFunc:ixe},sxe=oye({opSnippet:Y_e+"\n return max(a, b);\n",packedOpSnippet:"\n vec4 result = vec4(max(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 "+H_e+"\n return result;\n",cpuKernelImpl:Hge}),oxe={kernelName:v3.Maximum,backendName:"webgl",kernelFunc:sxe};const axe={kernelName:v3.MaxPool,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;wme(r,"maxPool");const{filterSize:s,strides:o,pad:a,dimRoundingMode:l}=i;v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(o,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${o} and dilations '1'`);const u=v3.backend_util.computePool2DInfo(r.shape,s,o,1,a,l);if(1===u.filterWidth&&1===u.filterHeight&&v3.util.arraysEqual(u.inShape,u.outShape))return X_e({inputs:{x:r},backend:n});const c=new ove(u,"max",!1);return n.runWebGLProgram(c,[r],r.dtype)}};const lxe={kernelName:v3.MaxPool3D,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{filterSize:s,strides:o,pad:a,dataFormat:l,dimRoundingMode:u}=i,c=v3.backend_util.computePool3DInfo(r.shape,s,o,[1,1,1],a,u,l),d=new ave(c,"max",!1);return n.runWebGLProgram(d,[r],r.dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class uxe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideHeight,n=e.strideWidth,i=e.dilationHeight,r=e.effectiveFilterHeight,s=e.effectiveFilterWidth,o=r-1-e.padInfo.top,a=s-1-e.padInfo.left,l=r*s-1;this.userCode=`\n const ivec2 pads = ivec2(${o}, ${a});\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 += ${i}) {\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 < ${s}; 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 * ${s} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}}class cxe{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;const t=e.strideDepth,n=e.strideHeight,i=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,o=e.dilationWidth,a=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,c=a-1-e.padInfo.front,d=l-1-e.padInfo.top,h=u-1-e.padInfo.left,p=a*l*u-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${d}, ${h});\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 < ${a};\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 += ${s}) {\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 += ${o}) {\n float dyC = float(dyCCorner + wC) / ${i}.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 dxe={kernelName:v3.MaxPool3DGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s}=t,o=s,{filterSize:a,strides:l,pad:u,dimRoundingMode:c}=i,d=v3.backend_util.computePool3DInfo(o.shape,a,l,[1,1,1],u,c),h=new ave(d,"max",!0),p=n.runWebGLProgram(h,[o],o.dtype),f=new cxe(d),m=n.runWebGLProgram(f,[r,p],o.dtype);return n.disposeIntermediateTensorInfo(p),m}};const hxe={kernelName:v3.MaxPoolGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{dy:r,input:s,output:o}=t,a=s;wme([s,o],"maxPoolGrad");const{filterSize:l,strides:u,pad:c,dimRoundingMode:d}=i,h=v3.backend_util.computePool2DInfo(a.shape,l,u,1,c,d),p=new ove(h,"max",!0),f=n.runWebGLProgram(p,[a],a.dtype),m=new uxe(h),g=n.runWebGLProgram(m,[r,f],a.dtype);return n.disposeIntermediateTensorInfo(f),g}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const pxe={kernelName:v3.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{filterSize:r,strides:s,pad:o,includeBatchInIndex:a}=t,l=n;v3.util.assert(4===i.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${i.shape.length}.`);const u=[1,1];v3.util.assert(v3.backend_util.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);const c=v3.backend_util.computePool2DInfo(i.shape,r,s,u,o),[d,h]=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){let r=new ove(n,"max",!1);const s=i.runWebGLProgram(r,[e],"float32");return r=new ove(n,"max",!0,!0,t),[s,i.runWebGLProgram(r,[e],"float32")]}(i,a,c,l);return[d,h]}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const fxe={kernelName:v3.Mean,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{x:i}=e,{keepDims:r,axis:s}=t,o=n,a=i.shape.length,l=v3.util.parseAxisParam(s,i.shape);let u=l;const c=v3.backend_util.getAxesPermutation(u,a),d=null!=c,h=o.shouldExecuteOnCPU([i]),p=[];let f=i;if(d){if(h){const e=o.texData.get(f.dataId).values,t=new Array(a);for(let e=0;e<t.length;e++)t[e]=i.shape[c[e]];const n=v_e(e,i.shape,i.dtype,c,t);f=o.makeTensorInfo(t,i.dtype);o.texData.get(f.dataId).values=n}else f=xye(i,c,o);p.push(f),u=v3.backend_util.getInnerMostAxes(u.length,a)}v3.backend_util.assertAxesAreInnerMostDims("sum",u,a);const[m,g]=v3.backend_util.computeOutAndReduceShapes(f.shape,u);let _=m;r&&(_=v3.backend_util.expandShapeToKeepDim(m,l));const y=
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e,t,n,i){const r=v3.util.sizeFromShape(t),s=mye({inputs:{x:e},attrs:{shape:[v3.util.sizeFromShape(e.shape)/r,r]},backend:i}),o=vye(s,"float32","mean",i),a=mye({inputs:{x:o},attrs:{shape:n},backend:i});return i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}(f,g,_,o);for(const e of p)o.disposeIntermediateTensorInfo(e);return y}};const mxe={kernelName:v3.Min,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=v3.util.parseAxisParam(s,r.shape);let u=l;const c=v3.backend_util.getAxesPermutation(u,a);let d=r;null!=c&&(d=Iye({inputs:{x:r},backend:n,attrs:{perm:c}}),u=v3.backend_util.getInnerMostAxes(u.length,r.shape.length)),v3.backend_util.assertAxesAreInnerMostDims("min",u,a);const[h,p]=v3.backend_util.computeOutAndReduceShapes(d.shape,u),f=mye({inputs:{x:d},backend:n,attrs:{shape:[-1,v3.util.sizeFromShape(p)]}}),m=vye(f,f.dtype,"min",n);let g;if(o){g=mye({inputs:{x:m},backend:n,attrs:{shape:v3.backend_util.expandShapeToKeepDim(h,l)}})}else g=mye({inputs:{x:m},backend:n,attrs:{shape:h}});return n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),null!=c&&n.disposeIntermediateTensorInfo(d),g}},gxe=oye({opSnippet:Y_e+"\n return min(a, b);\n",packedOpSnippet:"\n vec4 result = vec4(min(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 "+H_e+"\n return result;\n",cpuKernelImpl:Wge}),_xe={kernelName:v3.Minimum,backendName:"webgl",kernelFunc:gxe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class yxe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=t.map((t,n)=>t[0]+e[n]+t[1]);const i=e.length,r=jme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i),l="reflect"===n?0:1;this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\n\n void main() {\n ${r} outC = getOutputCoords();\n for (int i = 0; i < ${i}; 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(${a}));\n }\n `:`\n int start = ${s};\n int end = ${o};\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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class vxe{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 i=e.length,r=jme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=x_e("rc",i),l=x_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d="reflect"===n?0:1;let h="";if(1===i){const e=`\n ${r} source = rc;\n if (source < start) {\n source = start * 2 - source - ${d};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${d};\n }\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-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 - ${d}) +\n gte * ((end - 1) * 2 - source + ${d});\n source -= start;\n `;h=`\n ${r} rc = outputLoc;\n ${e}\n result[0] = getChannel(getX(${l.join()}), ${c});\n ${a[i-1]} += 1;\n if(${u}) {\n ${e}\n result[1] = getChannel(getX(${l.join()}), ${c});\n }\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {\n ${e}\n result[2] = getChannel(getX(${l.join()}), ${c});\n ${a[i-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}(${s});\n const ${r} end = ${r}(${o});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${h}\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const bxe={kernelName:v3.MirrorPad,backendName:"webgl",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:i}=e,{paddings:r,mode:s}=n,o=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new vxe(i.shape,r,s):new yxe(i.shape,r,s);return t.runWebGLProgram(o,[i],i.dtype)}},Txe=oye({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 "+H_e+"\n return result;\n"}),xxe={kernelName:v3.Mod,backendName:"webgl",kernelFunc:Txe};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Exe{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 `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const wxe=oye({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}),Ixe={kernelName:v3.RealDiv,backendName:"webgl",kernelFunc:wxe},Axe="return a - b;",Sxe=oye({opSnippet:Axe,packedOpSnippet:Axe,supportsComplex:!0,cpuKernelImpl:g_e}),Cxe={kernelName:v3.Sub,backendName:"webgl",kernelFunc:Sxe};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Oxe(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{dim:s}=i,o=v3.util.parseAxisParam([s],r.shape),a=ixe({inputs:{x:r},backend:n,attrs:{reductionIndices:o,keepDims:!1}}),l=v3.backend_util.expandShapeToKeepDim(a.shape,o),u=mye({inputs:{x:a},backend:n,attrs:{shape:l}}),c=Sxe({inputs:{a:r,b:u},backend:n}),d=Xbe({inputs:{x:c},backend:n}),h=Eye({inputs:{x:d},backend:n,attrs:{axis:o,keepDims:!1}}),p=mye({inputs:{x:h},backend:n,attrs:{shape:l}}),f=wxe({inputs:{a:d,b:p},backend:n});return n.disposeIntermediateTensorInfo(a),n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(c),n.disposeIntermediateTensorInfo(d),n.disposeIntermediateTensorInfo(h),n.disposeIntermediateTensorInfo(p),f}const Mxe={kernelName:v3.Softmax,backendName:"webgl",kernelFunc:Oxe};const kxe={kernelName:v3.Multinomial,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{logits:r}=t,{numSamples:s,seed:o,normalized:a}=i,l=a?r:Oxe({inputs:{logits:r},backend:n,attrs:{dim:r.shape.length-1}}),u=l.shape[0],c=l.shape[1],d=new Exe(u,c,s),h=[[o]],p=n.runWebGLProgram(d,[l],"int32",h);return a||n.disposeIntermediateTensorInfo(l),p}},Rxe=M_e+"\n return -x;\n";const Nxe={kernelName:v3.Neg,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n}=e,{x:i}=t;if(n.shouldExecuteOnCPU([i])){const e=n.texData.get(i.dataId),[t,r]=qge(e.values,i.shape,i.dtype);return n.makeTensorInfo(r,i.dtype,t)}let r;return r=(0,v3.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new F_e(i.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 O_e(i.shape,Rxe),n.runWebGLProgram(r,[i],i.dtype)}},Dxe=v3.kernel_impls.nonMaxSuppressionV3Impl;const Fxe={kernelName:v3.NonMaxSuppressionV3,backendName:"webgl",kernelFunc:function(e){v3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),{selectedIndices:d}=Dxe(u,c,o,a,l);return n.makeTensorInfo([d.length],"int32",new Int32Array(d))}},Lxe=v3.kernel_impls.nonMaxSuppressionV4Impl;const Pxe={kernelName:v3.NonMaxSuppressionV4,backendName:"webgl",kernelFunc:function(e){v3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,padToMaxOutputSize:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),{selectedIndices:h,validOutputs:p}=Lxe(c,d,o,a,l,u);return[n.makeTensorInfo([h.length],"int32",new Int32Array(h)),n.makeTensorInfo([],"int32",new Int32Array([p]))]}},Bxe=v3.kernel_impls.nonMaxSuppressionV5Impl;const $xe={kernelName:v3.NonMaxSuppressionV5,backendName:"webgl",kernelFunc:function(e){v3.backend_util.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");const{inputs:t,backend:n,attrs:i}=e,{boxes:r,scores:s}=t,{maxOutputSize:o,iouThreshold:a,scoreThreshold:l,softNmsSigma:u}=i,c=n.readSync(r.dataId),d=n.readSync(s.dataId),h=o,p=a,f=l,m=u,{selectedIndices:g,selectedScores:_}=Bxe(c,d,h,p,f,m);return[n.makeTensorInfo([g.length],"int32",new Int32Array(g)),n.makeTensorInfo([_.length],"float32",new Float32Array(_))]}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Uxe{constructor(e,t,n,i){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(${i}), float(${n}),\n float(index == coords.y)));\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Vxe={kernelName:v3.OneHot,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{indices:r}=t,{dtype:s,depth:o,onValue:a,offValue:l}=i,u=v3.util.sizeFromShape(r.shape),c=new Uxe(u,o,a,l),d=mye({inputs:{x:r},backend:n,attrs:{shape:[u]}}),h=n.runWebGLProgram(c,[d],s);n.disposeIntermediateTensorInfo(d);const p=mye({inputs:{x:h},backend:n,attrs:{shape:[...r.shape,o]}});return n.disposeIntermediateTensorInfo(h),p}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function zxe(e){const{inputs:t,backend:n}=e,{x:i}=t;if("complex64"===i.dtype){const e=Ove({inputs:{input:i},backend:n}),t=zxe({inputs:{x:e},backend:n}),r=Yve({inputs:{input:i},backend:n}),s=zxe({inputs:{x:r},backend:n}),o=K_e({inputs:{real:t,imag:s},backend:n});return n.disposeIntermediateTensorInfo(e),n.disposeIntermediateTensorInfo(t),n.disposeIntermediateTensorInfo(r),n.disposeIntermediateTensorInfo(s),o}return sTe({attrs:{shape:i.shape,dtype:i.dtype,value:"string"===i.dtype?"":0},backend:n})}const jxe={kernelName:v3.ZerosLike,backendName:"webgl",kernelFunc:zxe};const Yxe={kernelName:v3.OnesLike,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function e(t){const{inputs:n,backend:i}=t,{x:r}=n;if("string"===r.dtype)throw new Error("onesLike is not supported under string dtype");if("complex64"===r.dtype){const t=Ove({inputs:{input:r},backend:i}),n=e({inputs:{x:t},backend:i}),s=Yve({inputs:{input:r},backend:i}),o=zxe({inputs:{x:s},backend:i}),a=K_e({inputs:{real:n,imag:o},backend:i});return i.disposeIntermediateTensorInfo(t),i.disposeIntermediateTensorInfo(n),i.disposeIntermediateTensorInfo(s),i.disposeIntermediateTensorInfo(o),a}return sTe({attrs:{shape:r.shape,dtype:r.dtype,value:1},backend:i})}};const Gxe={kernelName:v3.Pack,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{axis:r}=i;if(1===t.length)return Kbe({inputs:{input:t[0]},backend:n,attrs:{dim:r}});const s=t[0].shape,o=t[0].dtype;t.forEach(e=>{v3.util.assertShapesMatch(s,e.shape,"All tensors passed to stack must have matching shapes"),v3.util.assert(o===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});const a=[],l=Wve({inputs:t.map(e=>{const t=Kbe({inputs:{input:e},backend:n,attrs:{dim:r}});return a.push(t),t}),backend:n,attrs:{axis:r}});return a.forEach(e=>n.disposeIntermediateTensorInfo(e)),l}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Hxe{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 i=e.length,r=jme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,i);this.userCode=1!==i?`\n ${r} start = ${r}(${s});\n ${r} end = ${r}(${o});\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(${a}));\n }\n }\n `:`\n int start = ${s};\n int end = ${o};\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 `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Wxe{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 i=e.length,r=jme(i),s=t.map(e=>e[0]).join(","),o=t.map((t,n)=>t[0]+e[n]).join(","),a=x_e("rc",i),l=x_e("source",i),u=`${a[i-1]} < ${this.outputShape[i-1]}`,c=1===i?"source":`vec2(${l.slice(-2).join()})`,d=[`${r} rc = outputLoc;`,`${a[i-1]} += 1;\n if(${u}) {\n `,1===i?"":`}\n rc = outputLoc;\n ${a[i-2]} += 1;\n if(${a[i-2]} < ${this.outputShape[i-2]}) {`,1===i?"":` ${a[i-1]} += 1;\n if(${u}) {`],h=1===i?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";let p="";for(let e=0,t=1===i?2:4;e<t;e++)p+=`\n ${d[e]}\n if (${h}) {\n result[${e}] = float(value);\n } else {\n ${r} source = rc - start;\n result[${e}] = getChannel(getX(${l.join()}), ${c});\n }\n `;p+=1===i?"} ":"}}",this.userCode=`\n const ${r} start = ${r}(${s});\n const ${r} end = ${r}(${o});\n\n void main() {\n ${r} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${p}\n setOutput(result);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const Xxe=e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{paddings:s,constantValue:o}=i;if(0===v3.util.sizeFromShape(r.shape)){const e=s.map((e,t)=>e[0]+r.shape[t]+e[1]);return sTe({backend:n,attrs:{shape:e,value:o,dtype:r.dtype}})}const a=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Wxe(r.shape,s,o):new Hxe(r.shape,s,o),l=[[o]];return n.runWebGLProgram(a,[r],r.dtype,l)},qxe={kernelName:v3.PadV2,backendName:"webgl",kernelFunc:Xxe},Kxe=oye({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 "+H_e+"\n return result;\n"}),Zxe={kernelName:v3.Pow,backendName:"webgl",kernelFunc:Kxe};const Qxe={kernelName:v3.Prod,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{axis:s,keepDims:o}=i,a=r.shape.length,l=[],u=v3.util.parseAxisParam(s,r.shape);let c=u;const d=v3.backend_util.getAxesPermutation(c,a);let h,p=r;if(null!=d&&(p=Iye({inputs:{x:r},backend:n,attrs:{perm:d}}),c=v3.backend_util.getInnerMostAxes(c.length,a),l.push(p)),v3.backend_util.assertAxesAreInnerMostDims("prod",c,a),n.shouldExecuteOnCPU([p])){const e=n.texData.get(p.dataId).values,{outVals:t,outShape:i,outDtype:r}=Zge(p.shape,p.dtype,e,c);h=n.makeTensorInfo(i,r,t)}else{const[e,t]=v3.backend_util.computeOutAndReduceShapes(p.shape,c),i=v3.util.sizeFromShape(t),s=mye({inputs:{x:p},backend:n,attrs:{shape:[-1,i]}}),o=vye(s,(0,v3.sumOutType)(r.dtype),"prod",n);h=mye({inputs:{x:o},backend:n,attrs:{shape:e}}),l.push(s),l.push(o)}if(o){l.push(h);const e=v3.backend_util.expandShapeToKeepDim(h.shape,u);h=mye({inputs:{x:h},backend:n,attrs:{shape:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),h}};const Jxe={kernelName:v3.RaggedGather,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:o}=t,{outputRaggedRank:a}=i,l=r.map(e=>n.readSync(e.dataId)),u=r.map(e=>e.shape),c=n.readSync(s.dataId),d=n.readSync(o.dataId),[h,p,f]=Qge(l,u,c,s.shape,s.dtype,d,o.shape,a),m=h.map(e=>n.makeTensorInfo([e.length],"int32",e)),g=n.makeTensorInfo(f,s.dtype,p);return m.concat([g])}};const eEe={kernelName:v3.RaggedRange,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{starts:i,limits:r,deltas:s}=t,o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=Jge(o,i.shape,i.dtype,a,r.shape,l,s.shape);return[n.makeTensorInfo([u.length],"int32",u),n.makeTensorInfo([c.length],i.dtype,c)]}};const tEe={kernelName:v3.RaggedTensorToTensor,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{shape:r,values:s,defaultValue:o,rowPartitionTensors:a}=t,{rowPartitionTypes:l}=i,u=n.readSync(r.dataId),c=n.readSync(s.dataId),d=n.readSync(o.dataId),h=a.map(e=>n.readSync(e.dataId)),p=a.map(e=>e.shape),[f,m]=e_e(u,r.shape,c,s.shape,s.dtype,d,o.shape,h,p,l);return n.makeTensorInfo(f,s.dtype,m)}},nEe=e=>{const{backend:t,attrs:n}=e,{start:i,stop:r,step:s,dtype:o}=n,a=t_e(i,r,s,o);return t.makeTensorInfo([a.length],o,a)},iEe={kernelName:v3.Range,backendName:"webgl",kernelFunc:nEe},rEe=sye({opSnippet:"return 1.0 / x;"}),sEe={kernelName:v3.Reciprocal,backendName:"webgl",kernelFunc:rEe},oEe=sye({opSnippet:M_e+"\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"}),aEe={kernelName:v3.Relu,backendName:"webgl",kernelFunc:oEe},lEe=sye({opSnippet:M_e+"\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"}),uEe={kernelName:v3.Relu6,backendName:"webgl",kernelFunc:lEe};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class cEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=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(${o}.0, ${a}.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 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 `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class dEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n];let d;d=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(${o}.0, ${a}.0,\n ${a}.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 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 hEe={kernelName:v3.ResizeBilinear,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,v3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new dEe(r.shape,l,u,s,o):new cEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],"float32")}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class pEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+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(${d});\n const float invWidthScale = float(${h});\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 >= ${s}) {\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 >= ${o}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${i-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 fEe={kernelName:v3.ResizeBilinearGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new pEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class mEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=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(${o}.0, ${a}.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 coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class gEe{constructor(e,t,n,i,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];const[s,o,a,l]=e;this.outputShape=[s,t,n,l];const u=[i&&t>1?o-1:o,i&&n>1?a-1:a],c=[i&&t>1?t-1:t,i&&n>1?n-1:n],d=i?"0.5":"0.0";let h;h=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(${o}.0, ${a}.0,\n ${a}.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 coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${d})));\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 _Ee={kernelName:v3.ResizeNearestNeighbor,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:o,size:a}=i,[l,u]=a,c=(0,v3.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new gEe(r.shape,l,u,s,o):new mEe(r.shape,l,u,s,o);return n.runWebGLProgram(c,[r],r.dtype)}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class yEe{constructor(e,t,n){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;const[,i,r]=t,[,s,o]=e,a=[n&&s>1?i-1:i,n&&o>1?r-1:r],l=[n&&s>1?s-1:s,n&&o>1?o-1:o],u=a[0]/l[0],c=a[1]/l[1],d=1/u,h=1/c,p=2*Math.ceil(d)+2,f=2*Math.ceil(h)+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(${d});\n const float invWidthScale = float(${h});\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 >= ${s}) {\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 >= ${o}) {\n continue;\n }\n\n float sourceFracRow =\n float(${a[0]}) *\n (float(dyR) / float(${l[0]}));\n\n float sourceFracCol =\n float(${a[1]}) *\n (float(dyC) / float(${l[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${i}) - 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 vEe={kernelName:v3.ResizeNearestNeighborGrad,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{images:r,dy:s}=t,{alignCorners:o}=i,a=new yEe(s.shape,r.shape,o);return n.runWebGLProgram(a,[s],s.dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class bEe{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 i=e.map((n,i)=>(n=>-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - coords[${n}] - 1`:`coords[${n}]`)(i)).join(","),r=jme(n);this.userCode=`\n void main() {\n ${r} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}}
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class TEe{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 i=x_e("rc",n),r=`${i[n-1]} + 1 < ${this.outputShape[n-1]}`,s=`${i[n-2]} + 1 < ${this.outputShape[n-2]}`,o=jme(n);function a(n){const i=e.map((i,r)=>function(n,i){return-1!==t.indexOf(n)&&1!==e[n]?`${e[n]} - ${i[n]} - 1`:`${i[n]}`}(r,n));return`getChannel(getX(${i.join(",")}), vec2(${i.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 ${o} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${function(e){return a(e)}(i.slice())};\n if(${r}){\n result.g = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",a(e)}(i.slice())};\n }\n if(${s}) {\n result.b = ${function(e){return e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n if(${r}) {\n result.a = ${function(e){return e[n-1]="("+e[n-1]+" + 1)",e[n-2]="("+e[n-2]+" + 1)",a(e)}(i.slice())};\n }\n }\n setOutput(result);\n }\n `}}const xEe={kernelName:v3.Reverse,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{dims:s}=i,o=r.shape.length,a=v3.util.parseAxisParam(s,r.shape);if(0===o)return X_e({inputs:{x:r},backend:n});const l=(0,v3.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new TEe(r.shape,a):new bEe(r.shape,a);return n.runWebGLProgram(l,[r],r.dtype)}};
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class EEe{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];const n=e[1],i=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 < ${i} && coordY >= 0 && coordY < ${n}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
const wEe={kernelName:v3.RotateWithOffset,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:n})=>{const{image:i}=e,{radians:r,fillValue:s,center:o}=t,a=n,l=new EEe(i.shape,s),[u,c]=v3.backend_util.getImageCenter(o,i.shape[1],i.shape[2]),d=[[u,c,Math.sin(r),Math.cos(r)]];return a.runWebGLProgram(l,[i],i.dtype,d)}},IEe=sye({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"}),AEe={kernelName:v3.Round,backendName:"webgl",kernelFunc:IEe},SEe=sye({opSnippet:"return inversesqrt(x);",cpuKernelImpl:n_e}),CEe={kernelName:v3.Rsqrt,backendName:"webgl",kernelFunc:SEe};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class OEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;const l=jme(r.length),u=jme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(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(${d});\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 `}}
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class MEe{constructor(e,t,n,i,r,s,o=!0,a=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s;const l=jme(r.length),u=jme(s.length);let c="";1===n?c="i":2===n&&(c="i, j");const d=`getIndices(${c})`;let h="";1===i?h="i":2===i&&(h="i, coords[1]");const p=`getUpdates(${h})`;let f="";a&&(f="coords[0], coords[1]");const m=`getDefaultValue(${f})`,g=t>1?"strides[j]":"strides",_=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(${d});\n flattenedIndex += index.xz * ${g};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${_};\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 kEe={kernelName:v3.ScatterNd,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{indices:r,updates:s}=t,{shape:o}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=v3.backend_util.calculateShapes(s,r,o),h=[d/u,u];if(0===d)return n.makeTensorInfo(o,r.dtype);const p=mye({inputs:{x:r},backend:n,attrs:{shape:[l,a]}}),f=mye({inputs:{x:s},backend:n,attrs:{shape:[l,u]}}),m=n.makeTensorInfo([],"float32",new Float32Array([0]));let g;g=(0,v3.env)().getBool("WEBGL_PACK")?new MEe(l,a,p.shape.length,f.shape.length,c,h):new OEe(l,a,p.shape.length,f.shape.length,c,h);const _=n.runWebGLProgram(g,[f,p,m],f.dtype),y=mye({inputs:{x:_},backend:n,attrs:{shape:o}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(_),n.disposeIntermediateTensorInfo(m),y}};
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class REe{constructor(e,t,n,i){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;`,s=2===(0,v3.env)().getNumber("WEBGL_VERSION")?"while (left < right) {":r,o="left"===i?"<":"<=";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${s}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${o} 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 NEe={kernelName:v3.SearchSorted,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{sortedSequence:r,values:s}=t,{side:o}=i,a=new REe(r.shape[0],r.shape[1],s.shape[1],o),l=[[r.shape[1]]];return n.runWebGLProgram(a,[r,s],"int32",l)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class DEe{constructor(e,t,n){let i,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",i="resRC";else{const n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],o=[];for(let i=0;i<t.length;i++)o.push(`${n[i]}`),i<e&&s.push(`${n[i]}`);i=s.join(),r=o.join()}const s=jme(n);this.userCode=`\n void main() {\n ${s} resRC = getOutputCoords();\n float cVal = getC(${i});\n if (cVal >= 1.0) {\n setOutput(getA(${r}));\n } else {\n setOutput(getB(${r}));\n }\n }\n `}}const FEe={kernelName:v3.Select,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{condition:i,t:r,e:s}=t,o=new DEe(i.shape.length,r.shape,r.shape.length);return n.runWebGLProgram(o,[i,r,s],(0,v3.upcastType)(r.dtype,s.dtype))}},LEe=sye({opSnippet:`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${v3.backend_util.SELU_SCALEALPHA};\n float scale = ${v3.backend_util.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`}),PEe={kernelName:v3.Selu,backendName:"webgl",kernelFunc:LEe},BEe=sye({opSnippet:rye+"\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:r_e}),$Ee={kernelName:v3.Sigmoid,backendName:"webgl",kernelFunc:BEe},UEe=sye({opSnippet:"\n if (isnan(x)) { return 0.0; }\n return sign(x);\n"}),VEe={kernelName:v3.Sign,backendName:"webgl",kernelFunc:UEe},zEe=sye({opSnippet:rye+"\n return sin(x);\n",packedOpSnippet:`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${H_e}\n return result;\n`}),jEe={kernelName:v3.Sin,backendName:"webgl",kernelFunc:zEe},YEe=sye({opSnippet:"\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n"}),GEe={kernelName:v3.Sinh,backendName:"webgl",kernelFunc:YEe},HEe=sye({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"}),WEe={kernelName:v3.Softplus,backendName:"webgl",kernelFunc:HEe},XEe={kernelName:v3.SpaceToBatchND,backendName:"webgl",kernelFunc:e=>{const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{blockShape:s,paddings:o}=i;v3.util.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");const a=s.reduce((e,t)=>e*t),l=[[0,0]];l.push(...o);for(let e=1+s.length;e<r.shape.length;++e)l.push([0,0]);const u=[],c=Xxe({inputs:{x:r},backend:n,attrs:{paddings:l,constantValue:0}}),d=v3.backend_util.getReshaped(c.shape,s,a,!1),h=v3.backend_util.getPermuted(d.length,s.length,!1),p=v3.backend_util.getReshapedPermuted(c.shape,s,a,!1),f=mye({inputs:{x:c},backend:n,attrs:{shape:d}}),m=Iye({inputs:{x:f},backend:n,attrs:{perm:h}}),g=mye({inputs:{x:m},backend:n,attrs:{shape:p}});return u.push(c),u.push(f),u.push(m),u.forEach(e=>n.disposeIntermediateTensorInfo(e)),g}};const qEe={kernelName:v3.SparseFillEmptyRows,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{indices:i,values:r,denseShape:s,defaultValue:o}=t;if(1!==s.shape.length)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(2!==i.shape.length)throw new Error(`Indices must be a matrix, saw:\n ${i.shape}`);if(1!==r.shape.length)throw new Error(`Values must be a vector, saw:\n ${r.shape}`);if(0!==o.shape.length)throw new Error(`Default value must be a scalar, saw:\n ${o.shape}`);const a=n.readSync(i.dataId),l=n.readSync(r.dataId),u=n.readSync(s.dataId),c=n.readSync(o.dataId)[0],[d,h,p,f,m]=a_e(a,i.shape,i.dtype,l,r.dtype,u,c);return[n.makeTensorInfo(h,i.dtype,d),n.makeTensorInfo([h[0]],r.dtype,p),n.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(e=>Number(e)))),n.makeTensorInfo([m.length],i.dtype,new Int32Array(m))]}};const KEe={kernelName:v3.SparseReshape,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{inputIndices:i,inputShape:r,newShape:s}=t;if(2!==i.shape.length)throw new Error(`Input indices should be a matrix but received shape ${i.shape}`);if(1!==r.shape.length)throw new Error(`Input shape should be a vector but received shape ${r.shape}`);if(1!==s.shape.length)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);const o=Array.from(n.readSync(r.dataId)),a=n.readSync(i.dataId),l=Array.from(n.readSync(s.dataId)),[u,c,d]=l_e(a,i.shape,i.dtype,o,l);return[n.makeTensorInfo(c,i.dtype,u),n.makeTensorInfo([d.length],s.dtype,new Int32Array(d))]}};const ZEe={kernelName:v3.SparseSegmentMean,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.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!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=u_e(o,i.shape,i.dtype,a,l,!0);return n.makeTensorInfo(c,i.dtype,u)}};const QEe={kernelName:v3.SparseSegmentSum,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n}=e,{data:i,indices:r,segmentIds:s}=t;if(i.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!==s.shape.length)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);const o=n.readSync(i.dataId),a=n.readSync(r.dataId),l=n.readSync(s.dataId),[u,c]=u_e(o,i.shape,i.dtype,a,l);return n.makeTensorInfo(c,i.dtype,u)}};const JEe={kernelName:v3.SparseToDense,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{sparseIndices:r,sparseValues:s,defaultValue:o}=t,{outputShape:a}=i,{sliceRank:l,numUpdates:u,sliceSize:c,strides:d,outputSize:h}=v3.backend_util.calculateShapes(s,r,a),p=!1;if("string"===s.dtype){const e=n.bufferSync(r),t=n.bufferSync(s),i=v3.util.decodeString(n.readSync(o.dataId)[0]),f=i_e(e,t,a,h,c,u,l,d,i,p);return n.makeTensorInfo(a,f.dtype,f.values)}const f=new OEe(u,l,r.shape.length,s.shape.length,d,[h,1],p),m=n.runWebGLProgram(f,[s,r,o],s.dtype),g=mye({inputs:{x:m},backend:n,attrs:{shape:a}});return n.disposeIntermediateTensorInfo(m),g}};const ewe={kernelName:v3.SplitV,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{numOrSizeSplits:s,axis:o}=i,a=v3.util.parseAxisParam(o,r.shape)[0],l=v3.backend_util.prepareSplitSize(r,s,a),u=r.shape.length,c=new Array(u).fill(0),d=r.shape.slice();return l.map(e=>{const t=[...d];t[a]=e;const i=Tve({inputs:{x:r},backend:n,attrs:{begin:c,size:t}});return c[a]+=e,i})}},twe="return sqrt(x);",nwe=sye({opSnippet:twe,packedOpSnippet:twe,cpuKernelImpl:c_e}),iwe={kernelName:v3.Sqrt,backendName:"webgl",kernelFunc:nwe},rwe=sye({opSnippet:"return x * x;"}),swe={kernelName:v3.Square,backendName:"webgl",kernelFunc:rwe},owe="return (a - b) * (a - b);",awe=oye({opSnippet:owe,packedOpSnippet:owe}),lwe={kernelName:v3.SquaredDifference,backendName:"webgl",kernelFunc:awe};const uwe={kernelName:v3.StaticRegexReplace,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2023 Google LLC.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t;if("string"!==r.dtype)throw new Error("Input must be of datatype string");const s=n.readSync(r.dataId),o=v3.backend_util.fromUint8ToStringArray(s),a=d_e(o,"string",i);return n.makeTensorInfo(r.shape,"string",a)}};const cwe={kernelName:v3.Step,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function({inputs:e,attrs:t,backend:n}){const{x:i}=e,r=M_e+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,s=new O_e(i.shape,r);return n.runWebGLProgram(s,[i],i.dtype)}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class dwe{constructor(e,t,n){this.variableNames=["x"],this.outputShape=n;const i=n.length,r=jme(n.length),s=jme(n.length);let o="";if(1===i)o="coords * strides + begin";else{let e=0;o=n.map((t,i)=>(e++,1===n.length?`coords * strides[${i}] + begin[${i}]`:`coords[${e-1}] * strides[${i}] + begin[${i}]`)).join(",")}this.userCode=`\n ${r} begin = ${r}(${e});\n ${r} strides = ${r}(${t});\n\n void main() {\n ${s} coords = getOutputCoords();\n setOutput(getX(${o}));\n }\n `}}const hwe={kernelName:v3.StridedSlice,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{begin:s,end:o,strides:a,beginMask:l,endMask:u,ellipsisMask:c,newAxisMask:d,shrinkAxisMask:h}=i,{finalShapeSparse:p,finalShape:f,isIdentity:m,sliceDim0:g,isSimpleSlice:_,begin:y,end:v,strides:b}=v3.slice_util.sliceInfo(r.shape,s,o,a,l,u,c,d,h);let T;if(m)T=mye({inputs:{x:r},backend:n,attrs:{shape:f}});else if(g||_){v3.util.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);const e=v3.slice_util.computeOutShape(y,v,b),t=Tve({inputs:{x:r},backend:n,attrs:{begin:y,size:e}});T=mye({inputs:{x:t},backend:n,attrs:{shape:f}}),n.disposeIntermediateTensorInfo(t)}else{if(n.shouldExecuteOnCPU([r])){const e=n.readSync(r.dataId),t=(0,v3.buffer)(r.shape,r.dtype,e),i=h_e(p,t,b,y);T=n.makeTensorInfo(f,r.dtype,i.values)}else{const e=new dwe(y,b,p);T=n.runWebGLProgram(e,[r],r.dtype)}}const x=mye({inputs:{x:T},backend:n,attrs:{shape:f}});return n.disposeIntermediateTensorInfo(T),x}};const pwe={kernelName:v3.StringNGrams,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{separator:r,nGramWidths:s,leftPad:o,rightPad:a,padWidth:l,preserveShortSequences:u}=i,{data:c,dataSplits:d}=t,h=n.readSync(c.dataId),p=n.readSync(d.dataId),[f,m]=p_e(h,p,r,s,o,a,l,u);return[n.makeTensorInfo([f.length],"string",f),n.makeTensorInfo(d.shape,"int32",m)]}};const fwe={kernelName:v3.StringSplit,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{skipEmpty:r}=i,{input:s,delimiter:o}=t;if("string"!==s.dtype)throw new Error("Input must be of datatype string");if(1!==s.shape.length)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(0!==o.shape.length)throw new Error(`Delimiter must be a scalar, got shape: ${o.shape}`);const a=n.readSync(s.dataId),l=n.readSync(o.dataId)[0],[u,c,d]=f_e(a,l,r),h=c.length;return[n.makeTensorInfo([h,2],"int32",u),n.makeTensorInfo([h],"string",c),n.makeTensorInfo([2],"int32",new Int32Array(d))]}};const mwe={kernelName:v3.StringToHashBucketFast,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{numBuckets:r}=i,{input:s}=t;if("string"!==s.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 o=n.readSync(s.dataId),a=m_e(o,r);return n.makeTensorInfo(s.shape,"int32",a)}},gwe=sye({opSnippet:"return tan(x);"}),_we={kernelName:v3.Tan,backendName:"webgl",kernelFunc:gwe},ywe=sye({opSnippet:"\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n"}),vwe={kernelName:v3.Tanh,backendName:"webgl",kernelFunc:ywe};const bwe={kernelName:v3.TensorScatterUpdate,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2022 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{tensor:r,indices:s,updates:o}=t,{}=i,{sliceRank:a,numUpdates:l,sliceSize:u,strides:c,outputSize:d}=v3.backend_util.calculateShapes(o,s,r.shape),h=[d/u,u];if(0===d)return n.makeTensorInfo(r.shape,s.dtype);const p=mye({inputs:{x:s},backend:n,attrs:{shape:[l,a]}}),f=mye({inputs:{x:o},backend:n,attrs:{shape:[l,u]}}),m=mye({inputs:{x:r},backend:n,attrs:{shape:h}}),g=new OEe(l,a,p.shape.length,f.shape.length,c,h,!1,!0),_=n.runWebGLProgram(g,[f,p,m],m.dtype),y=mye({inputs:{x:_},backend:n,attrs:{shape:r.shape}});return n.disposeIntermediateTensorInfo(p),n.disposeIntermediateTensorInfo(f),n.disposeIntermediateTensorInfo(m),n.disposeIntermediateTensorInfo(_),y}};
/**
* @license
* Copyright 2017 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Twe{constructor(e,t){this.variableNames=["A"];const n=new Array(e.length);for(let i=0;i<n.length;i++)n[i]=e[i]*t[i];this.outputShape=n,this.rank=n.length;const i=jme(this.rank),r=function(e){const t=e.length;if(t>5)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"],i=[];for(let t=0;t<e.length;t++)i.push(`imod(${n[t]}, ${e[t]})`);return i.join()}(e);this.userCode=`\n void main() {\n ${i} resRC = getOutputCoords();\n setOutput(getA(${r}));\n }\n `}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function xwe(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{reps:s}=i;if("string"===r.dtype||r.shape.length>5){const e=n.readSync(r.dataId),t="string"===r.dtype?e.map(e=>v3.util.decodeString(e)):e,i=(0,v3.buffer)(r.shape,r.dtype,t),o=__e(i,s);return n.makeTensorInfo(o.shape,o.dtype,o.values)}const o=new Twe(r.shape,s);return n.runWebGLProgram(o,[r],r.dtype)}const Ewe={kernelName:v3.Tile,backendName:"webgl",kernelFunc:xwe};class wwe{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 Iwe{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 "}}
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function Awe(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function Swe(e){let t=1;for(;t<e;)t*=2;return t}const Cwe={kernelName:v3.TopK,backendName:"webgl",kernelFunc:function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r}=t,{k:s,sorted:o}=i,a=(0,v3.env)().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"),l=(0,v3.env)().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"),u=r.shape,c=u[u.length-1];if(n.shouldExecuteOnCPU([r])||c<a||s>l){const e=n.readSync(r.dataId),[t,i]=y_e(e,u,r.dtype,s,o);return[n.makeTensorInfo(t.shape,t.dtype,t.values),n.makeTensorInfo(i.shape,i.dtype,i.values)]}if(0===s)return u[u.length-1]=0,[n.makeTensorInfo(u,r.dtype,[]),n.makeTensorInfo(u,"int32",[])];if(1===c)return[r,sTe({attrs:{shape:u,dtype:"int32",value:0},backend:n})];const d=n.texData.get(r.dataId),h=null!==d&&d.isPacked,p=h?n.unpackTensor(r):r,f=v3.util.sizeFromShape(u)/c,m=mye({inputs:{x:p},attrs:{shape:[f,c]},backend:n});h&&Awe(n,p);const g=Swe(s),_=Swe(c);let y=null;const v=()=>null===y?[m,m]:[m,y],b=(e,t,i)=>{const r=v(),s=new wwe(i),o=[[c],[null===y?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],a=y;y=n.runWebGLProgram(s,r,"int32",o),Awe(n,a)};for(let e=1;e<g;e*=2){const t=2*e;for(let n=e;n>=1;n/=2)b(t,n,[f,_])}for(let e=_;e>g;e/=2){const t=v(),i=new Iwe([f,e/2]),r=[[c],[null===y?1:0],[g]],s=y;y=n.runWebGLProgram(i,t,"int32",r),Awe(n,s);const o=g/2,a=2*o;for(let e=o;e>=1;e/=2)b(a,e,y.shape)}let T=y;y=Tve({inputs:{x:y},backend:n,attrs:{begin:0,size:[f,s]}}),Awe(n,T);let x=wTe({inputs:{x:m,indices:y},backend:n,attrs:{axis:1,batchDims:1}});Awe(n,m);const E=u.slice(0,-1);E.push(s),T=y,y=mye({inputs:{x:y},attrs:{shape:E},backend:n}),Awe(n,T);const w=x;return x=mye({inputs:{x},attrs:{shape:E},backend:n}),Awe(n,w),[x,y]}};
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Owe{constructor(e,t,n,i,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;const o="nearest"===n?1:2;let a;switch(i){case"constant":default:a=1;break;case"reflect":a=2;break;case"wrap":a=3;break;case"nearest":a=4}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${a} == 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 (${a} == 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 (${a} == 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 (${o} == 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 Mwe={kernelName:v3.Transform,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2021 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{image:r,transforms:s}=t,{interpolation:o,fillMode:a,fillValue:l,outputShape:u}=i,[c,d,h,p]=r.shape,[f,m]=null!=u?u:[d,h],g=new Owe(d,h,o,a,l,[c,f,m,p]);return n.runWebGLProgram(g,[r,s],"float32")}};const kwe={kernelName:v3.Unique,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,attrs:n,backend:i}=e,{axis:r}=n,{x:s}=t;wme(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const o=i.readSync(s.dataId),{outputValues:a,outputShape:l,indices:u}=b_e(o,r,s.shape,s.dtype);return[i.makeTensorInfo(l,s.dtype,a),i.makeTensorInfo([u.length],"int32",u)]}};const Rwe={kernelName:v3.Unpack,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{value:r}=t;let{axis:s}=i;s<0&&(s+=r.shape.length);const o=r,a=o.shape.length,l=r.shape[s],u=new Array(a-1);let c=0;for(let e=0;e<a;e++)e!==s&&(u[c++]=o.shape[e]);const d=[],h=new Array(a).fill(0),p=o.shape.slice();p[s]=1;const f=new Array(l);for(let e=0;e<f.length;e++){h[s]=e;const t=Tve({inputs:{x:o},backend:n,attrs:{begin:h,size:p}}),i=mye({inputs:{x:t},backend:n,attrs:{shape:u}});f[e]=i,d.push(t)}return d.forEach(e=>n.disposeIntermediateTensorInfo(e)),f}};
/**
* @license
* Copyright 2018 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
class Nwe{constructor(e,t){this.variableNames=["x","segmentIds"];const n=e.windowSize,i=e.batchSize,r=e.inSize,s=e.numSegments,o=s*Math.ceil(r/n);this.outputShape=[i,o];const a=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 d="";r%n>0&&(d=`\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 ${d}\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 ${s})) * float(${n}));\n int currentSeg = int(mod(float(outIdx), float(${s})));\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 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 + ${a};\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 Dwe={kernelName:v3.UnsortedSegmentSum,backendName:"webgl",kernelFunc:
/**
* @license
* Copyright 2020 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
function(e){const{inputs:t,backend:n,attrs:i}=e,{x:r,segmentIds:s}=t,{numSegments:o}=i,a=r.shape.length,l=[];let u=0;const c=v3.backend_util.getAxesPermutation([u],a);let d=r;null!=c&&(d=Iye({inputs:{x:r},backend:n,attrs:{perm:c}}),l.push(d),u=v3.backend_util.getInnerMostAxes(1,a)[0]);const h=v3.backend_util.segment_util.computeOutShape(d.shape,u,o),p=v3.util.sizeFromShape([d.shape[u]]),f=mye({inputs:{x:d},backend:n,attrs:{shape:[-1,p]}});l.push(f);const m=(0,v3.sumOutType)(r.dtype),g=(e,t,i,r,s)=>{const o=e.shape[0],a=e.shape[1],u=v3.backend_util.segment_util.segOpComputeOptimalWindowSize(a,s),c=new Nwe({windowSize:u,inSize:a,batchSize:o,numSegments:s},t),d=n.compileAndRun(c,[e,i],r);if(l.push(d),d.shape[1]===s)return d;const h=nEe({backend:n,attrs:{start:0,stop:s,step:1,dtype:"float32"}}),p=xwe({inputs:{x:h},backend:n,attrs:{reps:[a/u]}});l.push(h),l.push(p);return g(d,t,p,r,s)},_=mye({inputs:{x:g(f,"unsortedSegmentSum",s,m,o)},backend:n,attrs:{shape:h}});let y=_;if(null!=c){l.push(_);const e=v3.backend_util.getUndoAxesPermutation(c);y=Iye({inputs:{x:y},backend:n,attrs:{perm:e}})}return l.forEach(e=>n.disposeIntermediateTensorInfo(e)),y}},Fwe=[Cye,Mye,Rye,Dye,Pye,Uye,Vye,zye,Xye,qye,Zye,Jye,tve,ive,sve,lve,uve,hve,pve,fve,_ve,Eve,wve,Ive,Ave,kve,Dve,Pve,Z_e,Uve,Xve,nbe,abe,ube,cbe,dbe,hbe,fbe,gbe,ybe,wbe,Ibe,Abe,Cbe,kbe,Dbe,Fbe,Pbe,$be,Ube,zbe,jbe,Gbe,Wbe,qbe,Zbe,eTe,iTe,oTe,lTe,dTe,pTe,gTe,vTe,bTe,xTe,ITe,STe,OTe,q_e,MTe,Gve,RTe,DTe,LTe,eye,BTe,UTe,VTe,jTe,GTe,WTe,qTe,ZTe,exe,nxe,rxe,oxe,axe,lxe,dxe,hxe,pxe,fxe,mxe,_xe,bxe,xxe,kxe,fye,Nxe,Fxe,Pxe,$xe,Cve,Vxe,Yxe,Gxe,qxe,Zxe,iye,Qxe,Jxe,eEe,tEe,iEe,Mve,Ixe,sEe,aEe,uEe,gye,hEe,fEe,_Ee,vEe,xEe,wEe,AEe,CEe,kEe,NEe,FEe,PEe,$Ee,VEe,jEe,GEe,xve,Mxe,WEe,XEe,qEe,KEe,ZEe,QEe,JEe,ewe,iwe,swe,lwe,uwe,cwe,hwe,pwe,fwe,mwe,Cxe,wye,_we,vwe,bwe,Ewe,Cwe,Mwe,Aye,kwe,Rwe,Dwe,jxe];for(const e of Fwe)(0,v3.registerKernel)(e);
/** @license See the LICENSE file. */
const Lwe={"tfjs-core":v3.version_core,"tfjs-backend-cpu":uce,"tfjs-backend-webgl":V_e,"tfjs-data":Nae,"tfjs-layers":dee,"tfjs-converter":xoe,tfjs:"4.22.0"};var Pwe=__webpack_require__(99778);const Bwe=Symbol("rowContextKey"),$we=hG({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Uwe=dS({name:"ElRow"});const Vwe=AG(HH(dS({...Uwe,props:$we,setup(e){const t=e,n=ij("row"),i=ak(()=>t.gutter);eO(Bwe,{gutter:i});const r=ak(()=>{const e={};return t.gutter?(e.marginRight=e.marginLeft=`-${t.gutter/2}px`,e):e}),s=ak(()=>[n.b(),n.is(`justify-${t.justify}`,"start"!==t.justify),n.is(`align-${t.align}`,!!t.align)]);return(e,t)=>(uM(),gM(uC(e.tag),{class:CE(CI(s)),style:EE(CI(r))},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","row.vue"]])),zwe=hG({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:[Number,Object],default:()=>({})},sm:{type:[Number,Object],default:()=>({})},md:{type:[Number,Object],default:()=>({})},lg:{type:[Number,Object],default:()=>({})},xl:{type:[Number,Object],default:()=>({})}}),jwe=dS({name:"ElCol"});const Ywe=AG(HH(dS({...jwe,props:zwe,setup(e){const t=e,{gutter:n}=tO(Bwe,{gutter:ak(()=>0)}),i=ij("col"),r=ak(()=>{const e={};return n.value&&(e.paddingLeft=e.paddingRight=n.value/2+"px"),e}),s=ak(()=>{const e=[];["span","offset","pull","push"].forEach(n=>{const r=t[n];oj(r)&&("span"===n?e.push(i.b(`${t[n]}`)):r>0&&e.push(i.b(`${n}-${t[n]}`)))});return["xs","sm","md","lg","xl"].forEach(n=>{oj(t[n])?e.push(i.b(`${n}-${t[n]}`)):Jx(t[n])&&Object.entries(t[n]).forEach(([t,r])=>{e.push("span"!==t?i.b(`${n}-${t}-${r}`):i.b(`${n}-${r}`))})}),n.value&&e.push(i.is("guttered")),[i.b(),e]});return(e,t)=>(uM(),gM(uC(e.tag),{class:CE(CI(s)),style:EE(CI(r))},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["class","style"]))}}),[["__file","col.vue"]])),Gwe={class:"vis-left-panel-inner-wrapper"},Hwe={class:"card-header"},Wwe={key:0,style:{margin:"auto"}},Xwe={key:1,style:{margin:"auto"}},qwe=["src"],Kwe={__name:"ModelArea",emits:["shot"],setup(e,{expose:t,emit:n}){const i=n,r=tO("picList"),s=tO("shotList"),o=tO("states"),a=EI(r.value.map((e,t)=>({name:e.title,progress:0}))),l=["#FF6F61","#42A5F5","#66BB6A","#FFA726","#AB47BC"];let u,c,d=[];setInterval(async()=>{if(2!==o.value.isTraining)return;if(""!==p.value)return;i("shot");const e=s.value[s.value.length-1];if(!e||"data:,"===e)return void TW.error("未获取到有效样本");const t=new Image;t.src=e,await new Promise(e=>{t.onload=e});const n=v3.browser.fromPixels(t);let r=v3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),l=u.predict(r);const d=c.predict(l),h=await d.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*h[t]).toFixed(2))}))],n.dispose(),l.dispose(),d.dispose()},200);const h=EI(!1),p=EI(""),f=EI(""),m=EI("20%"),g=EI("20%");async function _(){if(c)try{await c.save(`downloads://${""==S.value?"my-model":S.value}`),TW.success("模型导出成功")}catch(e){TW.error(`模型导出失败: ${e.message}`)}else TW.error("模型尚未训练完成")}async function y(e){const t=new FileReader;return t.onload=async e=>{if(p.value=e.target.result,!u||!c)return TW.error("请先完成模型训练"),!1;const t=new window.Image;t.src=p.value,await new Promise(e=>t.onload=e);const n=v3.browser.fromPixels(t);let i=v3.image.resizeBilinear(n,[224,224]).expandDims(0).div(255),r=u.predict(i);const s=c.predict(r),o=await s.data();a.value=[...a.value.map((e,t)=>({...e,progress:Number((100*o[t]).toFixed(2))}))];const l=o.indexOf(Math.max(...o));f.value=a.value[l]?.name||"未知",n.dispose(),r.dispose(),s.dispose()},t.readAsDataURL(e),!1}function v(){p.value=""}let b=0,T=0,x=0,E=0;function w(e){if(0!==e.button)return;b=e.clientX,T=e.clientY;const t=document.getElementById("vis-left-panel-wrapper").style.top,n=document.getElementById("vis-left-panel-wrapper").style.right;x=t.endsWith("%")?window.innerHeight*Number.parseFloat(t)/100:Number.parseFloat(t),E=n.endsWith("%")?window.innerWidth*Number.parseFloat(n)/100:Number.parseFloat(n),document.addEventListener("mousemove",I),document.addEventListener("mouseup",A)}function I(e){const t=e.clientX-b,n=e.clientY-T;let i=x+n,r=E-t;i=Math.max(0,Math.min(window.innerHeight-100,i)),r=Math.max(0,Math.min(window.innerWidth-200,r)),m.value=`${i}px`,g.value=`${r}px`}function A(){document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",A)}t({train:async function(){const e=document.getElementById("vis-left-panel");e&&(e.innerHTML="训练准备中……"),h.value=!0,console.log("正在加载Mobilenet……"),u=await boe(Rx.join(ze.Env.boardDirPath,"teachableModel/model.json")),console.log("Mobilenet加载完成。"),e&&(e.innerHTML="");const t=r.value.length;let n=null,i=null;c=Pee(),c.add(xie({inputShape:[1280],units:128,activation:"relu"})),c.add(xie({units:t,activation:"softmax"})),c.compile({optimizer:v3.train.adam(.001),loss:"categoricalCrossentropy",metrics:["accuracy"]});for(let e=0;e<r.value.length;e++){if(r.value[e].disabled)continue;const s=r.value[e].list;for(let r=0;r<s.length;r++){const o=new Image;o.src=s[r],await new Promise(e=>{o.onload=e});const a=v3.browser.fromPixels(o),l=a.resizeBilinear([224,224]).toFloat().div(v3.scalar(127.5)).sub(v3.scalar(1)).expandDims(0);let c=u.predict(l);const d=v3.oneHot(v3.tensor1d([e]).toInt(),t);if(null==n)n=c.clone(),i=d.clone();else{const e=n;n=e.concat(c,0),e.dispose();const t=i;i=t.concat(d,0),t.dispose()}d.dispose(),a.dispose()}}d=[];const s=document.getElementById("vis-left-panel")||{name:"训练过程",tab:"训练"};await c.fit(n,i,{epochs:20,batchSize:16,shuffle:!0,validationSplit:.2,callbacks:Pwe.show.fitCallbacks(s,["loss","acc","val_loss","val_acc","accuracy","val_accuracy"],{callbacks:["onEpochEnd"]})}),console.log("训练完成"),a.value=r.value.filter(e=>!0!==e.disabled).map((e,t)=>({name:e.title,progress:0})),console.log(a.value),o.value.isTraining=2}});const S=EI("");async function C(){if(c)try{await c.save(`indexeddb://${""==S.value?"my-model":S.value}`),TW.success("模型保存成功")}catch(e){TW.error(`模型保存失败: ${e.message}`)}else TW.error("模型尚未训练完成")}return(e,t)=>(uM(),mM("div",null,[PA(xM("div",{id:"vis-left-panel-wrapper",class:"vis-left-panel-wrapper",style:EE(`right: ${g.value}; top: ${m.value};`)},[xM("div",Gwe,[xM("div",{class:"vis-left-panel-title",style:{},onMousedown:w},[t[4]||(t[4]=xM("span",null," 训练过程可视化 ",-1)),EM(CI(NX),{size:"small",plain:"",onClick:t[0]||(t[0]=e=>h.value=!1)},{default:LA(()=>t[3]||(t[3]=[SM(" 隐藏 ")])),_:1})],32),t[5]||(t[5]=xM("div",{id:"vis-left-panel",class:"vis-left-panel"},"训练准备中……",-1))])],4),[[Xk,h.value]]),2===CI(o).isTraining?(uM(),gM(CI(PX),{key:0,class:"model-area"},{header:LA(()=>[xM("div",Hwe,[t[8]||(t[8]=SM(" 模型 ")),h.value?OM("v-if",!0):(uM(),gM(CI(NX),{key:0,size:"small",style:{"margin-left":"10px"},type:"primary",plain:"",onClick:t[1]||(t[1]=e=>h.value=!0)},{default:LA(()=>t[6]||(t[6]=[SM(" 显示训练过程 ")])),_:1})),2===CI(o).isTraining?(uM(),gM(CI(NX),{key:1,size:"small",style:{"margin-left":"10px"},type:"success",plain:"",onClick:_},{default:LA(()=>t[7]||(t[7]=[SM(" 模型导出至本地 ")])),_:1})):OM("v-if",!0)])]),default:LA(()=>[EM(CI(Vwe),{class:"model-item",style:{"flex-direction":"column","align-items":"flex-center"}},{default:LA(()=>[EM(CI(Vwe),null,{default:LA(()=>[EM(CI(Ywe),{span:6,style:{display:"flex","align-items":"center","text-align":"right"}},{default:LA(()=>t[9]||(t[9]=[SM(" 名称: ")])),_:1}),EM(CI(Ywe),{span:12},{default:LA(()=>[EM(CI(jq),{modelValue:S.value,"onUpdate:modelValue":t[2]||(t[2]=e=>S.value=e),placeholder:"请输入模型名称"},null,8,["modelValue"])]),_:1}),EM(CI(Ywe),{span:4,style:{display:"flex","align-items":"center"}},{default:LA(()=>[EM(CI(NX),{style:{margin:"auto 5px"},type:"primary",plain:"",size:"small",onClick:C},{default:LA(()=>t[10]||(t[10]=[SM(" 保存 ")])),_:1})]),_:1})]),_:1})]),_:1}),EM(CI(Vwe),{class:"model-item"},{default:LA(()=>t[11]||(t[11]=[xM("b",null,"输入",-1)])),_:1}),EM(CI(Vwe),{class:"model-item"},{default:LA(()=>[p.value?(uM(),mM("div",Xwe,[t[16]||(t[16]=SM(" 下方上传图片 ")),t[17]||(t[17]=xM("br",null,null,-1)),EM(CI(NX),{size:"small",type:"success",plain:"",onClick:v},{default:LA(()=>t[14]||(t[14]=[SM(" 切换为上方拍摄内容 ")])),_:1}),EM(CI(F2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:LA(()=>[EM(CI(NX),{size:"small",type:"success"},{default:LA(()=>t[15]||(t[15]=[SM(" 重新上传一张 ")])),_:1})]),_:1}),xM("img",{src:p.value,alt:"用户上传图片",style:{"max-width":"100%","max-height":"150px","border-radius":"10px"}},null,8,qwe)])):(uM(),mM("div",Wwe,[t[13]||(t[13]=SM(" 上方拍摄内容 ")),EM(CI(F2),{"show-file-list":!1,accept:"image/*","before-upload":y},{default:LA(()=>[EM(CI(NX),{size:"small",type:"success"},{default:LA(()=>t[12]||(t[12]=[SM(" 切换为上传图片 ")])),_:1})]),_:1})]))]),_:1}),EM(CI(Vwe),{class:"model-item"},{default:LA(()=>t[18]||(t[18]=[xM("b",null,"输出",-1)])),_:1}),(uM(!0),mM(iM,null,pC(a.value,(e,t)=>(uM(),gM(CI(Vwe),{key:`${e.name}-${t}`,class:"model-item"},{default:LA(()=>[EM(CI(Ywe),{span:6},{default:LA(()=>[SM(GE(e.name),1)]),_:2},1024),EM(CI(Ywe),{span:18},{default:LA(()=>[EM(CI(WJ),{class:"progress","text-inside":!0,"stroke-width":20,percentage:e.progress,color:l[t%l.length],striped:"",format:e=>`${e}%`},null,8,["percentage","color","format"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):OM("v-if",!0)]))}},Zwe=(0,_3.A)(Kwe,[["__scopeId","data-v-5abb0202"]]),Qwe=hG({trigger:EZ.trigger,triggerKeys:EZ.triggerKeys,placement:mJ.placement,disabled:EZ.disabled,visible:TZ.visible,transition:TZ.transition,popperOptions:mJ.popperOptions,tabindex:mJ.tabindex,content:TZ.content,popperStyle:TZ.popperStyle,popperClass:TZ.popperClass,enterable:{...TZ.enterable,default:!0},effect:{...TZ.effect,default:"light"},teleported:TZ.teleported,appendTo:TZ.appendTo,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Jwe={"update:visible":e=>sj(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},eIe=dS({name:"ElPopover"}),tIe=dS({...eIe,props:Qwe,emits:Jwe,setup(e,{expose:t,emit:n}){const i=e,r=ak(()=>i["onUpdate:visible"]),s=ij("popover"),o=EI(),a=ak(()=>{var e;return null==(e=CI(o))?void 0:e.popperRef}),l=ak(()=>[{width:WH(i.width)},i.popperStyle]),u=ak(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),c=ak(()=>i.transition===`${s.namespace.value}-fade-in-linear`),d=()=>{n("before-enter")},h=()=>{n("before-leave")},p=()=>{n("after-enter")},f=()=>{n("update:visible",!1),n("after-leave")};return t({popperRef:a,hide:()=>{var e;null==(e=o.value)||e.hide()}}),(e,t)=>(uM(),gM(CI(PQ),NM({ref_key:"tooltipRef",ref:o},e.$attrs,{trigger:e.trigger,"trigger-keys":e.triggerKeys,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":CI(u),"popper-style":CI(l),teleported:e.teleported,"append-to":e.appendTo,persistent:e.persistent,"gpu-acceleration":CI(c),"onUpdate:visible":CI(r),onBeforeShow:d,onBeforeHide:h,onShow:p,onHide:f}),{content:LA(()=>[e.title?(uM(),mM("div",{key:0,class:CE(CI(s).e("title")),role:"title"},GE(e.title),3)):OM("v-if",!0),mC(e.$slots,"default",{},()=>[SM(GE(e.content),1)])]),default:LA(()=>[e.$slots.reference?mC(e.$slots,"reference",{key:0}):OM("v-if",!0)]),_:3},16,["trigger","trigger-keys","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","append-to","persistent","gpu-acceleration","onUpdate:visible"]))}});const nIe=(e,t)=>{const n=t.arg||t.value,i=null==n?void 0:n.popperRef;i&&(i.triggerRef=e)};var iIe,rIe;const sIe=AG(HH(tIe,[["__file","popover.vue"]]),{directive:(rIe="popover",(iIe={mounted(e,t){nIe(e,t)},updated(e,t){nIe(e,t)}}).install=e=>{e.directive(rIe,iIe)},iIe)}),oIe=hG({type:{type:String,values:["primary","success","info","warning","danger",""],default:""},size:{type:String,values:pG,default:""},truncated:Boolean,lineClamp:{type:[String,Number]},tag:{type:String,default:"span"}}),aIe=dS({name:"ElText"}),lIe=dS({...aIe,props:oIe,setup(e){const t=e,n=EI(),i=tX(),r=ij("text"),s=ak(()=>[r.b(),r.m(t.type),r.m(i.value),r.is("truncated",t.truncated),r.is("line-clamp",!rj(t.lineClamp))]),o=()=>{var e,i,r,s,o,a,l;if(kC().title)return;let u=!1;const c=(null==(e=n.value)?void 0:e.textContent)||"";if(t.truncated){const e=null==(i=n.value)?void 0:i.offsetWidth,t=null==(r=n.value)?void 0:r.scrollWidth;e&&t&&t>e&&(u=!0)}else if(!rj(t.lineClamp)){const e=null==(s=n.value)?void 0:s.offsetHeight,t=null==(o=n.value)?void 0:o.scrollHeight;e&&t&&t>e&&(u=!0)}u?null==(a=n.value)||a.setAttribute("title",c):null==(l=n.value)||l.removeAttribute("title")};return KS(o),QS(o),(e,t)=>(uM(),gM(uC(e.tag),{ref_key:"textRef",ref:n,class:CE(CI(s)),style:EE({"-webkit-line-clamp":e.lineClamp})},{default:LA(()=>[mC(e.$slots,"default")]),_:3},8,["class","style"]))}});const uIe=AG(HH(lIe,[["__file","text.vue"]])),cIe={__name:"TrainArea",emits:["train"],setup(e,{emit:t}){const n=t,i=tO("picList"),r=tO("states"),s=EI(!1),o=EI("待训练……");function a(){s.value&&(n("train"),r.value.isTraining=1)}return DO([i.value,()=>r.value.isTraining],()=>{s.value=function(){const e=Array.isArray(i.value)?i.value.filter(e=>!1===e.disabled):[];return 1!==r.value.isTraining&&e.length>1&&e.every(e=>Array.isArray(e.list)&&e.list.length>0)}(),0===r.value.isTraining?o.value="待训练……":1===r.value.isTraining?o.value="训练中……":2===r.value.isTraining&&(o.value="训练完成")},{immediate:!0}),(e,t)=>(uM(),gM(CI(PX),{class:"train-area"},{header:LA(()=>t[0]||(t[0]=[xM("div",{class:"card-header"}," 训练 ",-1)])),default:LA(()=>[EM(CI(sIe),{class:"box-item",placement:"bottom",disabled:s.value},{reference:LA(()=>[EM(CI(NX),{disabled:!s.value,type:"primary",style:{"max-width":"100%"},onClick:a},{default:LA(()=>t[1]||(t[1]=[SM(" 训练模型 ")])),_:1},8,["disabled"])]),default:LA(()=>[EM(CI(JH),null,{default:LA(()=>[EM(CI(TH))]),_:1}),t[2]||(t[2]=SM(" 至少有两个类别,且每个类别都需有图像样本。 "))]),_:1},8,["disabled"]),t[3]||(t[3]=xM("br",null,null,-1)),EM(CI(uIe),null,{default:LA(()=>[SM(GE(o.value),1)]),_:1})]),_:1}))}},dIe=(0,_3.A)(cIe,[["__scopeId","data-v-1deba862"]]),hIe={class:"main-splitter"},pIe={class:"class-area"},fIe={class:"add-class-content"},mIe={__name:"teachableModel",setup(e){const t=EI([]);eO("shotList",t);const n=EI([{title:"类别 1",list:[],disabled:!1},{title:"类别 2",list:[],disabled:!1}]);eO("picList",n);async function i(e,i){n.value[e].disabled?TW.error("该类别已被禁用"):i?n.value[e].list.push(i):(await a(),t.value[t.value.length-1]&&"data:,"!==t.value[t.value.length-1]?n.value[e].list.push(t.value[t.value.length-1]):TW.error("未获取到有效样本"))}function r(){n.value.push({title:`类别 ${n.value.length+1}`,list:[],disabled:!1})}eO("states",EI({isTraining:0}));const s=EI(!0),o=EI(null);async function a(){await(o.value?.captureShot())}const l=EI(null);async function u(){await l.value.train()}return(e,t)=>(uM(),mM("div",hIe,[EM(CI(jW),null,{default:LA(()=>[EM(CI(YW),{size:"70%",min:200},{default:LA(()=>[xM("div",pIe,[(uM(!0),mM(iM,null,pC(n.value,(e,r)=>(uM(),gM(f3,{key:r,title:e.title,"pic-list":e.list,disabled:e.disabled,onAddSample:e=>i(r,e),onDeleteSample:e=>n.value[r].list=n.value[r].list.filter(t=>t!==e),onDeleteClass:e=>function(e){n.value.splice(e,1)}(r),onDisableClass:e=>function(e){n.value[e].disabled=!n.value[e].disabled}(r),onRenameClass:e=>function(e,t){n.value[e].title=t}(r,e),onClearSamples:e=>function(e){n.value[e].list=[]}(r)},{default:LA(()=>[EM(CI(NX),{type:"primary",size:"mini",onClick:e=>i(r)},{default:LA(()=>t[0]||(t[0]=[SM(" 添加样本 ")])),_:2},1032,["onClick"])]),_:2},1032,["title","pic-list","disabled","onAddSample","onDeleteSample","onDeleteClass","onDisableClass","onRenameClass","onClearSamples"]))),128)),EM(CI(PX),{class:"add-class-card",onClick:r},{default:LA(()=>[xM("div",fIe,[t[1]||(t[1]=SM(" 添加一个类别 ")),EM(CI(JH),null,{default:LA(()=>[EM(CI(XG))]),_:1})])]),_:1})])]),_:1}),EM(CI(YW),{min:200},{default:LA(()=>[EM(y3,{ref_key:"cameraBoxRef",ref:o},null,512),EM(Rk,{name:"fade-scale"},{default:LA(()=>[s.value?(uM(),gM(Zwe,{key:0,ref_key:"modelAreaRef",ref:l,onShot:a},null,512)):OM("v-if",!0)]),_:1}),EM(dIe,{onTrain:u})]),_:1})]),_:1})]))}},gIe=(0,_3.A)(mIe,[["__scopeId","data-v-02bafc86"]]),_Ie={__name:"App",setup:e=>(e,t)=>(uM(),gM(CI(CG),null,{default:LA(()=>[EM(gIe)]),_:1}))};class yIe{static{ze.HTMLTemplate.add("html/statusbar/loader.html",new ze.HTMLTemplate('<style>\r\n div[m-id="{{d.mId}}"] {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: center;\r\n align-items: center;\r\n position: absolute;\r\n background-color: transparent !important;\r\n font-size: 12px;\r\n line-height: 12px;\r\n color: #fff;\r\n bottom: 0;\r\n height: var(--footer-height);\r\n width: 100%;\r\n }\r\n\r\n div[m-id="{{d.mId}}"] > p {\r\n margin-left: 5px;\r\n }\r\n</style>\r\n<div m-id="{{d.mId}}">\r\n <div class="ui mini active inline slow loader"></div>\r\n <p>{{d.msg.loading}}</p>\r\n</div>')),this.pythonShell=null,this.kernelLoaded=!1,this.$loader=Dx()(ze.HTMLTemplate.get("html/statusbar/loader.html").render({msg:{loading:Ve.Msg.PYTHON_PYODIDE_LOADING}})),this.statusBarImage=null,this.statusBarFileSystem=null,this.init=async function(){ze.app.getFooterBar().getContent().after(this.$loader);const e=Rx.relative(ze.Env.indexDirPath,ze.Env.boardDirPath),t=new dP({rootPath:Rx.join(e,"deps"),language:"python3"}),n=await t.kernelAvailable();if(!n)return;await n.init(),await n.loaded(),this.loader=t,this.kernel=n,this.statusBarImage=hP.init(),this.statusBarFileSystem=qz.init(),this.statusBarTool=Kz.init();oN(_Ie).mount(this.statusBarTool.getContent()[0]),this.statusBarGame=Zz.init(),this.pythonShell=new yIe,this.pyodide=window.pyodide,this.interruptBuffer=new Uint8Array(new ArrayBuffer(1)),this.pyodide.setInterruptBuffer(this.interruptBuffer),this.kernelLoaded=!0,this.$loader.remove(),this.$loader&&this.$loader.remove&&this.$loader.remove(),this.$loader=null},this.run=async function(){if(!this.kernelLoaded)return;const e=ze.Workspace.getMain().getEditorsManager().getActive().getCode();return this.pythonShell.run(e)},this.stop=async function(){if(this.kernelLoaded)return this.pythonShell.stop()}}#C=null;#O=null;#M=null;#k={row:0,column:0};#R="";#N=null;#D=null;#F=!1;#L=!1;#P=null;#B=()=>this.#$();#U=[{name:"REPL-Enter",bindKey:"Enter",exec:e=>{if(e.getSession().selection.getCursor().row===this.#k.row){const e=this.#C.getEndPos();let t=this.#C.getValueRange(this.#k,e);t=t.replace(this.#R,""),this.#N?.(t),this.#N=null,this.#D=null,this.#C.addValue("\n"),this.#V()}return!1}},{name:"REPL-ChangeEditor",bindKey:"Delete|Ctrl-X|Backspace",exec:e=>{const t=e.getSession().selection.getCursor();return t.row<this.#k.row||t.column<=this.#k.column}}];constructor(){const e=ze.Workspace.getMain();this.#M=e.getStatusBarsManager(),this.#C=this.#M.getStatusBarById("output"),this.#O=this.#M.getStatusBarById("images"),this.#P=yIe.kernel,this.#f()}#f(){this.#P.addEventListener("eval.finished",()=>{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`),this.syncfs(!1).catch(ze.Debug.error)}),this.#P.addEventListener("eval.output",e=>{this.#C.addValue(e.content)}),this.#P.addEventListener("eval.error",()=>{this.#L=!1,this.#C.addValue(`\n==${ze.Msg.Lang["shell.finish"]}==`)}),this.#P.addEventListener("eval.input",e=>{const t=String(e?.content?.prompt);this.#C.addValue(t),this.#R=t,this.#N=e.resolve,this.#D=e.reject,this.#z()}),this.#P.addEventListener("eval.display",e=>{this.#M.changeTo("images"),this.#O.display(e)})}#$(){const e=this.#C.getEditor(),t=e.getSession().selection.getCursor();e.setReadOnly(t.row<this.#k.row||t.column<this.#k.column)}#z(){if(!this.#L)return;this.#F=!0,this.#k=this.#C.getEndPos();const e=this.#C.getEditor();e.setReadOnly(!1),e.focus();e.getSession().selection.on("changeCursor",this.#B),e.commands.addCommands(this.#U)}#V(){this.#F=!1;const e=this.#C.getEditor();e.getSession().selection.off("changeCursor",this.#B),e.commands.removeCommands(this.#U),this.#R="",this.#N?.(""),this.cursor_={row:0,column:0},e.setReadOnly(!0)}async run(e){await this.stop(),await this.syncfs(!0),-1!==e.indexOf("import turtle")&&(e+="\nturtle.done()\n"),-1!==e.indexOf("import matplotlib.pyplot")&&(e+="\nplt.clf()\n"),uP.runit(this.#O.getContent()[0]),-1!==e.indexOf("import sprite")||-1!==e.indexOf("from sprite import")?this.#M.changeTo("images"):this.#M.changeTo("output"),this.#M.show(),this.#C.setValue(`${ze.Msg.Lang["shell.running"]}...\n`),this.#L=!0,this.#P.dispatchEvent("eval.request",{code:e,interactive:!1})}async stop(){if(this.#F&&this.#V(),this.#L){const e=5;yIe.interruptBuffer[0]=2;const t=Number(new Date);for(;Number(new Date)-t<1e3*e&&this.#L;)yIe.interruptBuffer[0]=2,await this.sleep(100);this.#L=!1}}async syncfs(e=!1){return new Promise(t=>{window.pyodide.FS.syncfs(e,t)})}sleep(e){return new Promise(t=>setTimeout(t,e))}}const vIe={init:async function(){const e=ze.app.getNav();e.register({icon:"icon-play-circled",title:"",id:"python-run-btn",displayText:Ve.Msg.MSG.run,preconditionFn:()=>!0,callback:()=>{yIe.run().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:4}),e.register({icon:"icon-cancel",title:"",id:"python-stop-btn",displayText:Ve.Msg.MSG.stop,preconditionFn:()=>!0,callback:()=>{yIe.stop().catch(ze.Debug.error)},scopeType:ze.Nav.Scope.LEFT,weight:5}),await yIe.init()}},bIe=vIe,TIe=new ze.Registry,xIe=function(e){let t={ok:!1,buffer:null,json:function(){const e=new TextDecoder("utf-8").decode(this.buffer);return JSON.parse(e)},arrayBuffer:function(){return this.buffer}};return TIe.hasKey(e)?(t.ok=!0,t.buffer=TIe.getItem(e),t):t},EIe={modelsValue:{},loadGraphModel:async function(e){return await boe(e,{fromTFHub:!1,fetchFunc:(...e)=>xIe(e[0])})},loadLayersModel:async function(e){return await Dee(e,{fromTFHub:!1,fetchFunc:(...e)=>xIe(e[0])})},setModelsValue:function(e,t){TIe.hasKey(e)&&TIe.unregister(e),TIe.register(e,t),EIe.modelsValue[e]=t}};window.tensorflow=EIe,window.addEventListener("error",e=>e.error&&e.error.message&&e.error.message.includes("openOrClosedShadowRoot")?(console.warn("捕获到Blockly DOM操作错误这通常是无害的:",e.error.message),e.preventDefault(),!1):e.error&&e.error.message&&(e.error.message.includes("DOM")||e.error.message.includes("Element")||e.error.message.includes("Node"))?(console.warn("捕获到DOM操作错误:",e.error.message),e.preventDefault(),!1):void 0),window.addEventListener("unhandledrejection",e=>{if(e.reason&&e.reason.message&&e.reason.message.includes("openOrClosedShadowRoot"))return console.warn("捕获到未处理的Promise拒绝Blockly DOM错误:",e.reason.message),e.preventDefault(),!1});const wIe=console.error;console.error=function(...e){const t=e.join(" ");t.includes("openOrClosedShadowRoot")||t.includes("DOM")||t.includes("Element")||t.includes("Node")?console.warn("过滤的DOM错误:",...e):wIe.apply(console,e)};const IIe=(e,t)=>{try{if(e&&t&&e.appendChild)return e.appendChild(t)}catch(e){console.warn("安全DOM添加失败:",e.message)}return null},AIe=(e,t)=>{try{if(e&&t&&e.removeChild&&t.parentNode===e)return e.removeChild(t)}catch(e){console.warn("安全DOM移除失败:",e.message)}return null},SIe=(e,t)=>{try{if(e&&e.querySelector)return e.querySelector(t)}catch(e){console.warn("安全DOM查询失败:",e.message)}return null},CIe=e=>e&&e.parentNode&&document.contains(e),OIe={volume:100,effects:{pitch:0,pan:0},builtin:{Meow:"meow"},isRecording:!1,mediaRecorder:null,recordedChunks:[],recordedAudio:null,activeAudios:[],isStopped:!1,abortController:null,blockAllAudio:!1,audioHistory:[],soundQueue:[],isProcessingQueue:!1,currentlyPlaying:null,initAudioContext:()=>{if(!OIe.audioContext)try{OIe.audioContext=new(window.AudioContext||window.webkitAudioContext)}catch(e){console.error("Error initializing audio context:",e)}},createAudio:e=>{if(OIe.blockAllAudio||OIe.isStopped||OIe.abortController&&OIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new Audio(e)},play:async e=>{try{if(OIe.isStopped)return;if(OIe.abortController&&OIe.abortController.signal.aborted)return;if(OIe.blockAllAudio)return;if(OIe.soundQueue.length>0||OIe.isProcessingQueue)return OIe.soundQueue.push({name:e,resolve:()=>{},reject:()=>{}}),void OIe.processQueue();if(OIe.activeAudios.length>0&&(OIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="")}catch(e){console.warn("停止现有音频时出错:",e)}}),OIe.activeAudios=[]),e.startsWith("recording")&&OIe.builtin[e]){if(OIe.blockAllAudio||OIe.isStopped)return;const t=OIe.createAudio(OIe.builtin[e]);t.volume=OIe.volume/100;const n=OIe.effects.pitch,i=OIe.effects.pan;if(0===n&&0===i)return void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});if(OIe.initAudioContext(),!OIe.audioContext)return console.warn("音频上下文初始化失败,无法应用增强音效"),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)});try{const e=OIe.audioContext.createMediaElementSource(t),r=OIe.audioContext.createGain();if(0!==n){const t=OIe.audioContext.createBiquadFilter();t.type="peaking",t.frequency.setValueAtTime(1e3,OIe.audioContext.currentTime),t.Q.setValueAtTime(1,OIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*n));t.gain.setValueAtTime(i,OIe.audioContext.currentTime),e.connect(t),t.connect(r)}else e.connect(r);if(0!==i){const e=OIe.audioContext.createStereoPanner(),t=Math.max(-1,Math.min(1,i/100*1.5));e.pan.setValueAtTime(t,OIe.audioContext.currentTime),r.connect(e),e.connect(OIe.audioContext.destination)}else r.connect(OIe.audioContext.destination);r.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime)}catch(e){return console.warn("应用增强音效失败,使用默认播放:",e),void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e)})}return OIe.activeAudios.push(t),t.onended=()=>{const e=OIe.activeAudios.indexOf(t);e>-1&&OIe.activeAudios.splice(e,1)},void t.play().catch(e=>{"AbortError"!==e.name&&console.error("Error playing recorded audio:",e);const n=OIe.activeAudios.indexOf(t);n>-1&&OIe.activeAudios.splice(n,1)})}if("Meow"===e&&(OIe.initAudioContext(),OIe.audioContext)){const e=OIe.audioContext.createOscillator(),t=OIe.audioContext.createGain();let n=440;if(0!==OIe.effects.pitch&&(n*=Math.pow(2,OIe.effects.pitch/12)),e.frequency.setValueAtTime(n,OIe.audioContext.currentTime),e.type="sine",t.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime),0!==OIe.effects.pan){const n=OIe.audioContext.createStereoPanner(),i=OIe.effects.pan/100;n.pan.setValueAtTime(i,OIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);t.connect(OIe.audioContext.destination),e.start(),e.stop(OIe.audioContext.currentTime+.5)}}catch(e){console.error("Error in sound.play:",e)}},_playAudioInternal:async e=>new Promise((t,n)=>{try{if(OIe.isStopped||OIe.blockAllAudio)return void n(new Error("Playback blocked"));if(e.startsWith("recording")&&OIe.builtin[e]){const i=OIe.createAudio(OIe.builtin[e]);i.volume=OIe.volume/100;const r=OIe.effects.pitch,s=OIe.effects.pan;if((0!==r||0!==s)&&(OIe.initAudioContext(),OIe.audioContext))try{const e=OIe.audioContext.createMediaElementSource(i),t=OIe.audioContext.createGain();if(0!==r){const n=OIe.audioContext.createBiquadFilter();n.type="peaking",n.frequency.setValueAtTime(1e3,OIe.audioContext.currentTime),n.Q.setValueAtTime(1,OIe.audioContext.currentTime);const i=Math.max(-20,Math.min(20,.8*r));n.gain.setValueAtTime(i,OIe.audioContext.currentTime),e.connect(n),n.connect(t)}else e.connect(t);if(0!==s){const e=OIe.audioContext.createStereoPanner(),n=Math.max(-1,Math.min(1,s/100*1.5));e.pan.setValueAtTime(n,OIe.audioContext.currentTime),t.connect(e),e.connect(OIe.audioContext.destination)}else t.connect(OIe.audioContext.destination);t.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime)}catch(e){console.warn("应用音效失败:",e)}i.onended=()=>{const e=OIe.activeAudios.indexOf(i);e>-1&&OIe.activeAudios.splice(e,1),t()},i.onerror=t=>{console.error(`音频播放失败: ${e}`,t);const r=OIe.activeAudios.indexOf(i);r>-1&&OIe.activeAudios.splice(r,1),n(t)},OIe.activeAudios.push(i),i.play().catch(e=>{"AbortError"===e.name?t():(console.error("播放音频失败:",e),n(e))})}else if("Meow"===e)if(OIe.initAudioContext(),OIe.audioContext){const e=OIe.audioContext.createOscillator(),n=OIe.audioContext.createGain();let i=440;if(0!==OIe.effects.pitch&&(i*=Math.pow(2,OIe.effects.pitch/12)),e.frequency.setValueAtTime(i,OIe.audioContext.currentTime),e.type="sine",n.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime),0!==OIe.effects.pan){const t=OIe.audioContext.createStereoPanner(),i=OIe.effects.pan/100;t.pan.setValueAtTime(i,OIe.audioContext.currentTime),e.connect(t),t.connect(n)}else e.connect(n);n.connect(OIe.audioContext.destination),e.start(),e.stop(OIe.audioContext.currentTime+.5),setTimeout(()=>{t()},500)}else n(new Error("AudioContext not available"));else n(new Error(`Unknown sound: ${e}`))}catch(e){console.error("内部播放错误:",e),n(e)}}),processQueue:async()=>{if(!OIe.isProcessingQueue&&0!==OIe.soundQueue.length){for(OIe.isProcessingQueue=!0;OIe.soundQueue.length>0;){const e=OIe.soundQueue.shift();try{if("frequency"===e.type){const{frequency:t,duration:n,resolve:i}=e;OIe.currentlyPlaying={type:"frequency",frequency:t,startTime:Date.now()},await new Promise(e=>{if(OIe.initAudioContext(),OIe.audioContext){const i=OIe.audioContext.createOscillator(),r=OIe.audioContext.createGain();i.frequency.setValueAtTime(t,OIe.audioContext.currentTime),i.type="sine";const s=OIe.effects.pitch;0!==s&&i.frequency.setValueAtTime(t*Math.pow(2,s/12),OIe.audioContext.currentTime),r.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime),i.connect(r),r.connect(OIe.audioContext.destination),i.onended=()=>{OIe.currentlyPlaying=null,e()},i.start(),i.stop(OIe.audioContext.currentTime+n/1e3)}else e()}),OIe.currentlyPlaying=null,i()}else{const{name:t,resolve:n}=e;OIe.currentlyPlaying={name:t,startTime:Date.now()},await OIe._playAudioInternal(t),OIe.currentlyPlaying=null,n()}}catch(t){console.error("队列播放失败:",t),OIe.currentlyPlaying=null,e.reject&&e.reject(t)}}OIe.isProcessingQueue=!1}},play_blocking:e=>new Promise((t,n)=>{OIe.soundQueue.push({name:e,resolve:t,reject:n}),OIe.processQueue()}),stop_all:()=>{try{if(OIe.isStopped=!0,OIe.blockAllAudio=!0,OIe.soundQueue.length>0&&(OIe.soundQueue.forEach(({reject:e})=>{e(new Error("Playback stopped"))}),OIe.soundQueue=[]),OIe.isProcessingQueue=!1,OIe.currentlyPlaying=null,OIe.abortController&&OIe.abortController.abort(),OIe.abortController=new AbortController,OIe.activeAudios.length>0&&(OIe.activeAudios.forEach(e=>{try{e&&"AUDIO"===e.tagName&&(e.pause(),e.currentTime=0,e.src="",e.load(),e.onended=null,e.onerror=null,e.onloadstart=null,e.oncanplay=null,e.onplay=null,e.onpause=null)}catch(e){console.warn("停止音频时出错:",e)}}),OIe.activeAudios=[]),OIe.audioContext)try{OIe.audioContext.close(),OIe.audioContext=null}catch(e){console.warn("关闭音频上下文时出错:",e)}OIe.effects.pitch=0,OIe.effects.pan=0;const e=document.querySelectorAll("audio");e.length>0&&e.forEach(e=>{try{e.pause(),e.currentTime=0,e.src=""}catch(e){console.warn("停止页面音频元素时出错:",e)}}),setTimeout(()=>{OIe.isStopped=!1,OIe.blockAllAudio=!1},100)}catch(e){console.error("Error in sound.stop_all:",e)}},adjust_volume:e=>{const t=Math.max(0,Math.min(100,OIe.volume+e));OIe.volume=t},set_volume:e=>{OIe.volume=Math.max(0,Math.min(100,e))},get_volume:()=>OIe.volume,noteFrequencies:{NOTE_B3:247,NOTE_C4:262,NOTE_D4:294,NOTE_E4:330,NOTE_F4:349,NOTE_G4:392,NOTE_A4:440,NOTE_B4:494,NOTE_C5:523,NOTE_D5:587,NOTE_E5:659,NOTE_F5:698,NOTE_G5:784},play_frequency:(e,t=1e3)=>{try{if(OIe.initAudioContext(),OIe.audioContext){const n=OIe.audioContext.createOscillator(),i=OIe.audioContext.createGain();n.frequency.setValueAtTime(e,OIe.audioContext.currentTime),n.type="sine";const r=OIe.effects.pitch;0!==r&&n.frequency.setValueAtTime(e*Math.pow(2,r/12),OIe.audioContext.currentTime),i.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime),n.connect(i),i.connect(OIe.audioContext.destination),n.start(),n.stop(OIe.audioContext.currentTime+t/1e3),console.log(`播放频率: ${e}Hz, 持续时间: ${t}ms, 音量: ${OIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_continuous:e=>{try{if(OIe.initAudioContext(),OIe.audioContext){const t=OIe.audioContext.createOscillator(),n=OIe.audioContext.createGain();t.frequency.setValueAtTime(e,OIe.audioContext.currentTime),t.type="sine";const i=OIe.effects.pitch;0!==i&&t.frequency.setValueAtTime(e*Math.pow(2,i/12),OIe.audioContext.currentTime),n.gain.setValueAtTime(OIe.volume/100,OIe.audioContext.currentTime),t.connect(n),n.connect(OIe.audioContext.destination),t.start(),t.stop(OIe.audioContext.currentTime+2),console.log(`播放频率(持续): ${e}Hz, 无持续时间限制, 音量: ${OIe.volume}%`)}}catch(e){console.error("播放频率声音失败:",e)}},play_frequency_blocking:(e,t=1e3)=>(console.log(`=== 🔒 阻塞播放频率(加入队列): ${e}Hz, ${t}ms ===`),new Promise((n,i)=>{const r={type:"frequency",frequency:e,duration:t,resolve:n,reject:i};OIe.soundQueue.push(r),console.log(`✅ 频率已加入声音队列,当前队列长度: ${OIe.soundQueue.length}`),OIe.processQueue()})),play_frequency_continuous_blocking:e=>(console.log(`=== 🔒 阻塞播放频率(持续,加入队列): ${e}Hz ===`),new Promise((t,n)=>{const i={type:"frequency",frequency:e,duration:2e3,resolve:t,reject:n};OIe.soundQueue.push(i),console.log(`✅ 频率(持续)已加入声音队列,当前队列长度: ${OIe.soundQueue.length}`),OIe.processQueue()})),play_note_list:e=>{try{const t={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(t){let e=0;t.forEach(t=>{const n=OIe.noteFrequencies[t.note]||440,i=t.duration;setTimeout(()=>{OIe.play_frequency(n,i)},e),e+=i})}else console.warn(`未知的音符列表: ${e}`)}catch(e){console.error("播放音符列表失败:",e)}},play_note_list_blocking:e=>new Promise((t,n)=>{(async()=>{try{const i={DADADADUM:[{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500},{note:"NOTE_D4",duration:500},{note:"NOTE_A4",duration:500}],BIRTHDAY:[{note:"NOTE_C4",duration:400},{note:"NOTE_C4",duration:400},{note:"NOTE_D4",duration:800},{note:"NOTE_C4",duration:800},{note:"NOTE_F4",duration:800},{note:"NOTE_E4",duration:1600}],BA_DING:[{note:"NOTE_C5",duration:200},{note:"NOTE_E5",duration:200},{note:"NOTE_G5",duration:400}],JUMP_UP:[{note:"NOTE_C5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_G5",duration:100}],JUMP_DOWN:[{note:"NOTE_G5",duration:100},{note:"NOTE_E5",duration:100},{note:"NOTE_C5",duration:100}],POWER_UP:[{note:"NOTE_C4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_C5",duration:300}],POWER_DOWN:[{note:"NOTE_C5",duration:150},{note:"NOTE_G4",duration:150},{note:"NOTE_E4",duration:150},{note:"NOTE_C4",duration:300}]}[e];if(i){for(const e of i){const t=OIe.noteFrequencies[e.note]||440;await OIe.play_frequency_blocking(t,e.duration)}t()}else console.warn(`未知的音符列表: ${e}`),n(new Error(`未知的音符列表: ${e}`))}catch(e){console.error("播放音符列表失败:",e),n(e)}})()}),adjust_effect:(e,t)=>{"pitch"===e?OIe.effects.pitch=Math.max(-24,Math.min(24,OIe.effects.pitch+t)):"pan"===e&&(OIe.effects.pan=Math.max(-100,Math.min(100,OIe.effects.pan+t)))},set_effect:(e,t)=>{"pitch"===e?OIe.effects.pitch=Math.max(-24,Math.min(24,t)):"pan"===e&&(OIe.effects.pan=Math.max(-100,Math.min(100,t)))},clear_effects:()=>{OIe.effects.pitch=0,OIe.effects.pan=0},record:()=>{if(!OIe.isRecording)try{navigator.mediaDevices.getUserMedia({audio:!0}).then(e=>{OIe.mediaRecorder=new MediaRecorder(e),OIe.recordedChunks=[],OIe.mediaRecorder.ondataavailable=e=>{e.data.size>0&&OIe.recordedChunks.push(e.data)},OIe.mediaRecorder.onstart=()=>{OIe.isRecording=!0},OIe.mediaRecorder.onstop=()=>{OIe.isRecording=!1;const t=new Blob(OIe.recordedChunks,{type:"audio/wav"});OIe.recordedAudio=URL.createObjectURL(t),e.getTracks().forEach(e=>{e.stop()}),OIe.showPlaybackInterface(t)},OIe.mediaRecorder.onerror=e=>{console.error("MediaRecorder 错误:",e.error),OIe.isRecording=!1},OIe.mediaRecorder.start(100),OIe.showRecordInterface()}).catch(e=>{console.error("获取麦克风权限失败:",e),alert("无法访问麦克风,请检查权限设置。错误: "+e.message)})}catch(e){console.error("录制功能初始化失败:",e),alert("录制功能初始化失败: "+e.message)}},showRecordInterface:()=>{const e=document.createElement("div");e.id="recordModal",e.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const t=document.createElement("div");t.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 300px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",t.innerHTML='\n <h3 style="color: #4a90e2; margin-bottom: 20px;">录制声音</h3>\n <div id="waveform" style="width: 250px; height: 100px; background: #f0f0f0; margin: 20px auto; border-radius: 5px; position: relative; overflow: hidden;">\n <div id="volumeMeter" style="position: absolute; left: 10px; top: 10px; width: 20px; height: 80px; background: linear-gradient(to top, #4CAF50, #FFC107, #F44336); border-radius: 3px;"></div>\n <div id="waveformBars" style="position: absolute; left: 40px; top: 10px; width: 200px; height: 80px;"></div>\n </div>\n <div style="margin: 20px 0;">\n <button id="stopRecord" style="background: #f44336; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin: 0 10px;">停止录制</button>\n </div>\n <div id="status" style="color: #666; font-size: 14px; margin-top: 10px;">正在录制...</div>\n ',e.appendChild(t);try{IIe(document.body,e)}catch(e){return void console.error("添加录制界面到DOM失败:",e)}e.addEventListener("click",e=>{if("stopRecord"===e.target.id)try{OIe.mediaRecorder&&OIe.isRecording?OIe.mediaRecorder.stop():console.warn("MediaRecorder 不存在或未在录制状态")}catch(e){console.error("停止录制时出错:",e),alert("停止录制时出错: "+e.message)}});const n=e.querySelector("#waveformBars");if(n){for(let e=0;e<20;e++){const t=document.createElement("div");t.style.cssText=`\n position: absolute;\n left: ${10*e}px;\n bottom: 0;\n width: 8px;\n height: 20px;\n background: #4a90e2;\n border-radius: 2px;\n transition: height 0.1s ease;\n `,n.appendChild(t)}const t=setInterval(()=>{if(OIe.isRecording&&e.parentNode){const e=n.children;for(let t=0;t<e.length;t++){const n=60*Math.random()+20;e[t].style.height=n+"px",e[t].style.background=`hsl(${200+60*Math.random()}, 70%, 60%)`}}},100);e.waveformInterval=t}let i=0;const r=e.querySelector("#volumeMeter"),s=e.querySelector("#status");if(r&&s){const t=setInterval(()=>{OIe.isRecording&&e.parentNode?(i=60*Math.random()+40,r.style.height=i+"%",s.textContent=`正在录制... 音量: ${Math.round(i)}%`,r.style.opacity=.8+i/100*.2):(clearInterval(t),s&&e.parentNode&&(s.textContent="录制完成",s.style.color="#4CAF50"),r&&e.parentNode&&(r.style.height="100%",r.style.background="linear-gradient(to top, #4CAF50, #4CAF50)"))},200);e.volumeInterval=t}else console.error("找不到音量计或状态显示元素");const o=e=>{"Space"===e.code&&OIe.isRecording&&(e.preventDefault(),OIe.mediaRecorder&&OIe.mediaRecorder.stop())};document.addEventListener("keydown",o),e.keyHandler=o},showPlaybackInterface:e=>{const t=document.getElementById("recordModal");if(t){t.volumeInterval&&clearInterval(t.volumeInterval),t.waveformInterval&&clearInterval(t.waveformInterval),t.keyHandler&&document.removeEventListener("keydown",t.keyHandler);try{CIe(t)&&AIe(document.body,t)}catch(e){console.warn("移除录制界面时出错:",e)}}const n=document.createElement("div");n.id="playbackModal",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10000;\n ";const i=document.createElement("div");i.style.cssText="\n background: white;\n border-radius: 10px;\n padding: 20px;\n text-align: center;\n min-width: 350px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n ",i.innerHTML='\n <h3 style="color: #4a90e2; margin-bottom: 20px;">录音完成</h3>\n <div id="playbackWaveform" style="width: 300px; height: 120px; background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f0f0f0 75%), linear-gradient(-45deg, transparent 75%, #f0f0f0 75%); background-size: 20px 20px; margin: 20px auto; border-radius: 5px; position: relative; overflow: hidden;">\n <div id="waveformLine" style="position: absolute; left: 0; top: 50%; width: 100%; height: 2px; background: #4a90e2; transform: translateY(-50%);"></div>\n </div>\n <div style="margin: 20px 0;">\n <button id="playRecording" style="background: #4CAF50; color: white; border: none; padding: 15px 25px; border-radius: 5px; cursor: pointer; margin: 0 10px; font-size: 16px;">\n <span style="font-size: 20px;">▶</span> 播放\n </button>\n </div>\n <div style="margin: 20px 0;">\n <button id="reRecord" style="background: #FF9800; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin: 0 10px;">🔄 重新录制</button>\n <button id="saveRecording" style="background: #9C27B0; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin: 0 10px;">💾 添加到列表</button>\n </div>\n ',n.appendChild(i);try{IIe(document.body,n)}catch(e){return void console.error("添加播放界面到DOM失败:",e)}const r=n.querySelector("#playRecording");r&&(r.onclick=()=>{try{OIe.createAudio(OIe.recordedAudio).play().catch(e=>{console.error("播放录音失败:",e),alert("播放录音失败: "+e.message)});const e=n.querySelector("#waveformLine");e&&(e.style.background="#FF5722",setTimeout(()=>{e.parentNode&&(e.style.background="#4a90e2")},1e3))}catch(e){console.error("播放录音时出错:",e),alert("播放录音时出错: "+e.message)}});const s=n.querySelector("#reRecord");s&&(s.onclick=()=>{try{CIe(n)&&AIe(document.body,n),OIe.record()}catch(e){console.error("重新录制时出错:",e),alert("重新录制时出错: "+e.message)}});const o=n.querySelector("#saveRecording");o&&(o.onclick=()=>{try{OIe.saveRecording(e),CIe(n)&&AIe(document.body,n)}catch(e){console.error("添加到列表时出错:",e),alert("添加到列表时出错: "+e.message)}}),OIe.createWaveformDisplay(e,n)},createWaveformDisplay:async(e,t)=>{try{if(!t||!t.parentNode)return void console.warn("波形显示容器不存在或已被移除");const n=await e.arrayBuffer(),i=new(window.AudioContext||window.webkitAudioContext),r=(await i.decodeAudioData(n)).getChannelData(0),s=t.querySelector("#playbackWaveform");if(s&&s.parentNode){s.innerHTML="";const e=100,t=Math.floor(r.length/e);for(let n=0;n<e;n++){const i=n*t,o=i+t;let a=0;for(let e=i;e<o;e++)a+=Math.abs(r[e]||0);const l=a/t,u=Math.max(2,100*l),c=document.createElement("div");c.style.cssText=`\n position: absolute;\n left: ${n/e*100}%;\n bottom: 0;\n width: ${100/e}%;\n height: ${u}%;\n background: #4a90e2;\n border-radius: 1px;\n `,s.appendChild(c)}}}catch(e){console.error("创建波形显示失败:",e)}},saveRecording:e=>{try{const t=`recording${Object.keys(OIe.builtin).filter(e=>e.startsWith("recording")).length+1}`,n=e?URL.createObjectURL(e):OIe.recordedAudio;if(!n)throw new Error("录音数据不存在");OIe.builtin[t]=n,alert(`录音已保存为: ${t}`);const i=document.getElementById("playbackModal");if(CIe(i)){const e=SIe(i,"#playRecording");e&&(e.innerHTML=`<span style="font-size: 20px;">▶</span> 播放 ${t}`)}}catch(e){console.error("保存录音失败:",e),alert("保存录音失败: "+e.message)}}},MIe=OIe,kIe=window.Audio;if(window.Audio=function(e){if(OIe.blockAllAudio||OIe.isStopped||OIe.abortController&&OIe.abortController.signal.aborted){return{play:()=>Promise.reject(new Error("Audio playback blocked globally")),pause:()=>{},currentTime:0,src:"",volume:1,playbackRate:1,onended:null,onerror:null,onloadstart:null,oncanplay:null,onplay:null,onpause:null,tagName:"AUDIO",addEventListener:()=>{},removeEventListener:()=>{},load:()=>{},duration:0,ended:!1,paused:!0,muted:!1,readyState:0,networkState:0,preload:"none"}}return new kIe(e)},window.Audio.original=kIe,"undefined"!=typeof window){const e=console.error;console.error=function(...t){const n=t.join(" ");n.includes("sound")&&(n.includes("no-unused-vars")||n.includes("no-trailing-spaces")||n.includes("new-cap"))?console.warn("过滤的sound模块ESLint错误:",...t):e.apply(console,t)}}let RIe=!1;function NIe(e){if(!e)return!1;if("PythonError"===e.name||"KeyboardInterrupt"===e.name){const t=e.message||String(e);return t.includes("KeyboardInterrupt")||t.includes("interrupted")}return!1}function DIe(){if(RIe)return!1;if(window.pyodide&&window.pyodide.globals)try{RIe=!0;const e={play:e=>OIe.play(e),play_blocking:e=>OIe.play_blocking(e),stop_all:()=>OIe.stop_all(),adjust_volume:e=>OIe.adjust_volume(e),set_volume:e=>OIe.set_volume(e),get_volume:()=>OIe.get_volume(),adjust_effect:(e,t)=>OIe.adjust_effect(e,t),set_effect:(e,t)=>OIe.set_effect(e,t),clear_effects:()=>OIe.clear_effects(),play_frequency:(e,t)=>(console.log(`Python调用: sound.play_frequency(${e}, ${t})`),OIe.soundQueue.length>0||OIe.isProcessingQueue?OIe.play_frequency_blocking(e,t):OIe.play_frequency(e,t)),play_frequency_no_duration:e=>(console.log(`Python调用: sound.play_frequency_no_duration(${e})`),OIe.soundQueue.length>0||OIe.isProcessingQueue?OIe.play_frequency_continuous_blocking(e):OIe.play_frequency_continuous(e)),play_frequency_blocking:(e,t)=>(console.log(`Python调用: sound.play_frequency_blocking(${e}, ${t})`),OIe.play_frequency_blocking(e,t)),play_frequency_continuous:e=>(console.log(`Python调用: sound.play_frequency_continuous(${e})`),OIe.play_frequency_continuous(e)),play_frequency_continuous_blocking:e=>(console.log(`Python调用: sound.play_frequency_continuous_blocking(${e})`),OIe.play_frequency_continuous_blocking(e)),play_note_list:e=>OIe.play_note_list(e),play_note_list_blocking:e=>OIe.play_note_list_blocking(e),record:()=>OIe.record(),volume:OIe.volume,effects:OIe.effects};window.pyodide.globals.set("sound",e);const t=new(0,window.pyodide.pyimport("types").ModuleType)("sound");Object.keys(e).forEach(n=>{e[n],t[n]=e[n]});try{window.pyodide.runPython('\nimport sys\nsys.modules[\'sound\'] = sound\n\n# 创建同步版本的play_blocking包装函数\nimport asyncio\nfrom js import Promise\n\n# 保存原始的play_blocking返回Promise的版本\n_original_play_blocking = sound.play_blocking\n\ndef _sync_play_blocking(name):\n """同步版本的play_blocking会等待声音播放完成"""\n promise = _original_play_blocking(name)\n # 使用Pyodide的Promise支持\n # 在Pyodide中可以直接等待JS Promise\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n # Pyodide 0.21+\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n # 降级方案使用asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n # 将JS Promise转换为Python awaitable\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n \n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换sound.play_blocking为同步版本\nsound.play_blocking = _sync_play_blocking\n\n# 创建同步版本的play_frequency包装函数\n_original_play_frequency = sound.play_frequency\n\ndef _sync_play_frequency(frequency, duration):\n """同步版本的play_frequency会自动判断是否需要阻塞"""\n promise = _original_play_frequency(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_frequency_no_duration包装函数\n_original_play_frequency_no_duration = sound.play_frequency_no_duration\n\ndef _sync_play_frequency_no_duration(frequency):\n """同步版本的play_frequency_no_duration会自动判断是否需要阻塞"""\n promise = _original_play_frequency_no_duration(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency = _sync_play_frequency\nsound.play_frequency_no_duration = _sync_play_frequency_no_duration\n\n# 创建同步版本的play_frequency_continuous_blocking包装函数\n_original_play_frequency_continuous_blocking = sound.play_frequency_continuous_blocking\n\ndef _sync_play_frequency_continuous_blocking(frequency):\n """同步版本的play_frequency_continuous_blocking会等待频率播放完成"""\n promise = _original_play_frequency_continuous_blocking(frequency)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n return pyodide.ffi.run_sync(promise)\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n return await promise\n\n return loop.run_until_complete(wait_promise())\n\n# 替换为同步版本\nsound.play_frequency_continuous_blocking = _sync_play_frequency_continuous_blocking\n\n# 创建同步版本的play_frequency_blocking包装函数\n_original_play_frequency_blocking = sound.play_frequency_blocking\n\ndef _sync_play_frequency_blocking(frequency, duration):\n """同步版本的play_frequency_blocking会等待频率播放完成"""\n promise = _original_play_frequency_blocking(frequency, duration)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 创建同步版本的play_note_list_blocking包装函数\n_original_play_note_list_blocking = sound.play_note_list_blocking\n\ndef _sync_play_note_list_blocking(note_list):\n """同步版本的play_note_list_blocking会等待音符列表播放完成"""\n promise = _original_play_note_list_blocking(note_list)\n # 使用Pyodide的Promise支持\n import pyodide\n if hasattr(pyodide, \'ffi\') and hasattr(pyodide.ffi, \'run_sync\'):\n try:\n return pyodide.ffi.run_sync(promise)\n except Exception:\n return None\n else:\n import asyncio\n try:\n loop = asyncio.get_event_loop()\n except RuntimeError:\n loop = asyncio.new_event_loop()\n asyncio.set_event_loop(loop)\n\n async def wait_promise():\n try:\n return await promise\n except Exception:\n return None\n\n try:\n return loop.run_until_complete(wait_promise())\n except Exception:\n return None\n\n# 替换为同步版本\nsound.play_frequency_blocking = _sync_play_frequency_blocking\nsound.play_note_list_blocking = _sync_play_note_list_blocking\n ')}catch(e){if(NIe(e))return RIe=!1,!1;throw e}return window.pyodide.globals.get("sound")?(RIe=!1,!0):(RIe=!1,console.error("Sound对象注入失败验证时未找到对象"),!1)}catch(e){return RIe=!1,NIe(e)?!1:(console.error("注入sound对象到Python环境失败:",e),!1)}return!1}function FIe(){!function(){const e=Element.prototype.remove;if(Element.prototype.remove=function(){if(this)if("function"==typeof this.remove)try{return e.call(this)}catch(e){console.warn("remove()调用失败,已安全处理:",e)}else console.warn("对象没有remove方法已安全忽略");else console.warn("尝试在null对象上调用remove(),已安全忽略")},window.$&&window.$.fn&&window.$.fn.remove){const e=window.$.fn.remove;window.$.fn.remove=function(){if(!this||0===this.length)return console.warn("尝试在空的jQuery对象上调用remove(),已安全忽略"),this;try{return e.call(this)}catch(e){return console.warn("jQuery remove()调用失败,已安全处理:",e),this}}}}(),function(){if(DIe())return;const e=setInterval(()=>{DIe()&&clearInterval(e)},100);setTimeout(()=>{clearInterval(e)},1e4)}()}function LIe(){if(window.pyodide&&window.pyodide.globals)try{window.pyodide.globals.get("sound")||DIe()}catch(e){if(NIe(e))return;console.warn("强制注入检查失败:",e)}}function PIe(){const e=window.eval;if(window.eval=function(t){if("string"==typeof t&&t.includes("sound."))try{LIe()}catch(e){NIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)},window.pyodide&&window.pyodide.runPython){const e=window.pyodide.runPython;window.pyodide.runPython=function(t){if("string"==typeof t&&t.includes("sound."))try{LIe()}catch(e){NIe(e)||console.warn("执行拦截时出错:",e)}return e.call(this,t)}}}function BIe(){document.getElementById("modalOverlay").style.display="none"}function $Ie(e){const t=document.getElementById("imported-models");if([...t.children].some(t=>t.dataset.modelName===e))return;const n=document.createElement("div");n.className="model-item",n.dataset.modelName=e,n.innerHTML=`\n <div style="display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee;">\n <span style="font-size: 1em; color: #333;">${e}</span>\n <button class="delete-model" style="\n background: #f44336;\n color: white;\n border: none;\n padding: 4px 10px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 0.9em;\n transition: background-color 0.2s;\n ">删除</button>\n </div>\n `,n.querySelector(".delete-model").addEventListener("click",()=>{!async function(e){try{await v3.io.removeModel(`indexeddb://${e}`);const t=document.querySelector(`.model-item[data-model-name="${e}"]`);t&&t.remove()}catch(e){console.error("删除模型失败:",e),alert("删除模型失败: "+e.message)}}(e)}),t.appendChild(n)}async function UIe(){try{const e=await v3.io.listModels();document.getElementById("imported-models").innerHTML="";for(const[t]of Object.entries(e)){$Ie(t.replace("indexeddb://",""))}}catch(e){console.error("加载模型列表失败:",e)}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{FIe(),PIe()}):(FIe(),PIe()),window.addEventListener("pyodideLoaded",()=>{FIe(),PIe()}),setTimeout(()=>{FIe(),PIe()},1e3),window.addEventListener("load",()=>{FIe(),PIe()}),setInterval(LIe,5e3),bIe.init(),window.tf=Ue,async function(){const e=document.createElement("div");e.id="modalOverlay",Object.assign(e.style,{display:"none",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:"20011216",pointerEvents:"auto"});const t=document.createElement("div");Object.assign(t.style,{backgroundColor:"white",width:"60%",maxHeight:"80%",margin:"12vh auto",padding:"20px 30px",borderRadius:"12px"}),t.innerHTML='\n <h2 style="margin-bottom: 20px;">选择本地模型</h2>\n <div style="margin-bottom: 25px; position: relative; min-height: 200px;"> \x3c!-- 新增 min-height 和 position --\x3e\n <input type="file" id="model-upload" accept=".json,.bin" multiple style="display: none;">\n <label for="model-upload" style="\n background: #1216ab;\n color: white;\n padding: 10px 20px;\n border-radius: 4px;\n cursor: pointer;\n ">选择模型文件</label>\n <div style="display: flex; gap: 10px; margin-top: 15px; align-items: center;">\n <span style="line-height: 36px;">导入模型名称:</span>\n <input type="text" id="model-name" placeholder="模型名称" value="my-model" style="\n padding: 8px 12px;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-size: 14px;\n flex: 1;\n max-width: 200px;\n ">\n <button id="model-handle" style="\n background: #1216ab;\n color: white;\n padding: 10px 20px;\n border-radius: 4px;\n cursor: pointer;\n ">保存模型</button>\n </div>\n <div style="margin-top: 15px; display: flex; gap: 20px;">\n <div id="json-status" style="\n background: #f5f5f5;\n padding: 10px;\n border-radius: 4px;\n flex: 1;\n ">\n <span>❌ 模型结构描述文件model.json</span>\n\n <div style="color: #666; font-size: 0.9em; margin-top: 5px;">未选择</div>\n </div>\n <div id="weights-status" style="\n background: #f5f5f5;\n padding: 10px;\n border-radius: 4px;\n flex: 1;\n ">\n <span>❌ 权重文件model.weights.bin</span>\n <div style="color: #666; font-size: 0.9em; margin-top: 5px;">0 个已选择</div>\n </div>\n </div>\n <div id="output" style="margin-bottom: 15px; min-height: 40px;"></div>\n <div style="margin-top: 20px;">\n <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">\n <h3>已导入模型</h3>\n <div style="display: flex; gap: 10px;">\n <button id="refresh-models" style="\n background: #4CAF50;\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n cursor: pointer;\n border: none;\n ">刷新</button>\n <button id="clear-models" style="\n background: #f44336;\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n cursor: pointer;\n border: none;\n ">清空</button>\n </div>\n </div>\n <div id="imported-models" style="\n background: #f5f5f5;\n padding: 10px;\n border-radius: 4px;\n height: 200px;\n overflow-y: auto;\n ">\n <div style="color: #666; font-style: italic;">加载中...</div>\n </div>\n </div>\n <div style="display: flex; justify-content: flex-end; margin-top: 15px;">\n <button class="close-btn" style="\n background: #e0e0e0;\n border: none;\n padding: 8px 20px;\n border-radius: 4px;\n cursor: pointer;\n ">关闭</button>\n </div>\n </div>\n ',e.appendChild(t),document.body.appendChild(e),t.querySelector(".close-btn").addEventListener("click",BIe),e.addEventListener("click",t=>{t.target===e&&BIe()});const n=document.getElementById("model-upload"),i=document.getElementById("model-handle"),r=document.getElementById("output");let s=null,o=[];n.addEventListener("change",async e=>{const t=e.target.files,n=document.getElementById("json-status"),i=document.getElementById("weights-status");n.querySelector("span").textContent="❌ 模型结构描述文件model.json",n.querySelector("div").textContent="未选择",i.querySelector("span").textContent="❌ 权重文件model.weights.bin",i.querySelector("div").textContent="0 个已选择",o=[];for(let e=0;e<t.length;e++)t[e].name.endsWith(".json")?s=t[e]:o.push(t[e]);if(s){if(r.innerHTML="正在处理上传的模型文件...",s){n.querySelector("span").textContent="✅ 模型结构描述文件model.json",n.querySelector("div").textContent="已选择";const e=s.name.replace(".json","");document.getElementById("model-name").value=e}o.length>0&&(i.querySelector("span").textContent="✅ 权重文件model.weights.bin",i.querySelector("div").textContent=`${o.length} 个已选择`)}else alert("未找到 model.json 文件")}),i.addEventListener("click",async()=>{try{const e=document.getElementById("model-name").value||"mixly-model",t=await Dee(v3.io.browserFiles([s,...o]));await t.save(`indexeddb://${e}`),UIe(),r.innerHTML=`模型已成功保存为 ${e}`}catch(e){r.innerHTML=`保存模型出错: ${e.message}`,console.error(e)}}),t.querySelector("#refresh-models").addEventListener("click",UIe),t.querySelector("#clear-models").addEventListener("click",async()=>{confirm("确定要删除所有模型吗?此操作不可恢复!")&&await async function(){try{const e=await v3.io.listModels(),t=Object.keys(e).map(e=>e.replace("indexeddb://","")).map(e=>v3.io.removeModel(`indexeddb://${e}`));await Promise.all(t),document.getElementById("imported-models").innerHTML=""}catch(e){console.error("清空模型失败:",e),alert("清空模型失败: "+e.message)}}()})}(),(async()=>{await UIe()})();Ve.getMainWorkspace().registerButtonCallback("handleModels",function(){UIe(),document.getElementById("modalOverlay").style.display="block"}),window.prepare_qmyixtxi=async function(e){let t=null;window.featureExtractor?t=window.featureExtractor:(t=await boe("../common/media/tfmodel/model.json"),window.featureExtractor=t);const n=e.resizeBilinear([224,224]).toFloat().div(v3.scalar(127.5)).sub(v3.scalar(1)).expandDims(0);return window.featureExtractor.predict(n)};const VIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},zIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(new Ve.FieldDropdown(this.getSoundOptions),"SOUND").appendField(Ve.Msg.MIXLY_SOUND_WAIT_FINISH),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_WAIT_TOOLTIP)},getSoundOptions:function(){const e=[["Meow","Meow"],[Ve.Msg.MIXLY_SOUND_RECORD_OPTION,"record"]];if(window.sound&&window.sound.builtin){Object.keys(window.sound.builtin).filter(e=>e.startsWith("recording")).forEach(t=>{e.push([t,t])})}return e}},jIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_STOP_ALL),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_STOP_ALL_TOOLTIP)}},YIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_BY),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_ADD_TOOLTIP)}},GIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_SET_TO).appendField(new Ve.FieldDropdown([[Ve.Msg.MIXLY_SOUND_EFFECT_PITCH,"pitch"],[Ve.Msg.MIXLY_SOUND_EFFECT_PAN,"pan"]]),"EFFECT").appendField(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TO),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_SET_TOOLTIP)}},HIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_CLEAR_EFFECTS),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_EFFECT_CLEAR_TOOLTIP)}},WIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_INCREASE),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_ADD_TOOLTIP)}},XIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_SET),this.appendValueInput("VALUE").setCheck(null),this.appendDummyInput(),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_SET_TOOLTIP)}},qIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_catSoundSOUND_VOLUME_GET),this.setOutput(!0,"Volume"),this.setTooltip(Ve.Msg.MIXLY_SOUND_VOLUME_GET_TOOLTIP)}},KIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_RECORD),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_RECORD_TOOLTIP)}},ZIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY).appendField(Ve.Msg.MIXLY_SOUND_FREQUENCY),this.appendValueInput("FREQUENCY").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_DURATION),this.appendValueInput("DURATION").setCheck(Number).setAlign(Ve.ALIGN_RIGHT),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_TOOLTIP)}},QIe={init:function(){this.setColour("#acc159"),this.appendValueInput("FREQUENCY").setCheck(Number).appendField(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_FREQUENCY_NO_DURATION_TOOLTIP)}},JIe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST).appendField(new Ve.FieldDropdown([["DADADADUM","DADADADUM"],["BIRTHDAY","BIRTHDAY"],["BA_DING","BA_DING"],["JUMP_UP","JUMP_UP"],["JUMP_DOWN","JUMP_DOWN"],["POWER_UP","POWER_UP"],["POWER_DOWN","POWER_DOWN"]]),"NOTE_LIST"),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(Ve.Msg.MIXLY_SOUND_PLAY_NOTE_LIST_TOOLTIP)}},eAe={init:function(){this.setColour("#acc159"),this.appendDummyInput().appendField(new Ve.FieldDropdown([["NOTE_A4","440"],["NOTE_B3","247"],["NOTE_C4","262"],["NOTE_D4","294"],["NOTE_E4","330"],["NOTE_F4","349"],["NOTE_G4","392"],["NOTE_A4","440"],["NOTE_B4","494"],["NOTE_C5","523"],["NOTE_D5","587"],["NOTE_E5","659"],["NOTE_F5","698"],["NOTE_G5","784"]]),"NOTE"),this.setOutput(!0,null),this.setOutputShape(Ve.OUTPUT_SHAPE_ROUND),this.setTooltip(Ve.Msg.MIXLY_SOUND_NOTE_TOOLTIP)}};Object.assign(Ve.Variables,Ye),Object.assign(Ve.Procedures,oc),Ve.Python=ac,Ve.generator=ac,ze.Profile.default={},Object.assign(Ve.Blocks,e,t,n,i,r,s,o,a,l,u,c,d,h,A,S,C,O,M,k,R,N,D,F,L,P,B,U,V,ne,re),Object.assign(Ve.Python.forBlock,p,f,m,g,_,y,v,b,T,x,E,w,I,z,j,Y,fy,G,H,W,X,q,K,Z,Q,J,ee,te,ie,se);const tAe={sound_play:VIe,sound_play_wait:zIe,sound_stop_all:jIe,sound_effect_add:YIe,sound_effect_set:GIe,sound_effect_clear:HIe,sound_volume_add:WIe,sound_volume_set:XIe,sound_volume_get:qIe,sound_record:KIe,sound_play_frequency:ZIe,sound_play_frequency_no_duration:QIe,sound_play_note_list:JIe,sound_note:eAe},nAe={sound_play:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play("${n}")\n`},sound_play_wait:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("SOUND");return"record"===n?"sound.record()\n":`sound.play_blocking("${n}")\n`},sound_stop_all:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.stop_all()\n"},sound_effect_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"10":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"10":"10",`sound.adjust_effect("${n}", ${r})\n`},sound_effect_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");const n=e.getFieldValue("EFFECT"),i=e.getInputTargetBlock("VALUE");let r;return r=i?"math_number"===i.type?i.getFieldValue("NUM")||"100":t.valueToCode(i,"VALUE",t.ORDER_NONE)||"100":"100",`sound.set_effect("${n}", ${r})\n`},sound_effect_clear:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.clear_effects()\n"},sound_volume_add:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.adjust_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"0"})\n`},sound_volume_set:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.set_volume(${t.valueToCode(e,"VALUE",t.ORDER_NONE)||"100"})\n`},sound_volume_get:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),["sound.get_volume()",t.ORDER_ATOMIC]},sound_record:function(e,t){return t.definitions_.import_sound||(t.definitions_.import_sound="import sound"),"sound.record()\n"},sound_play_frequency:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)}, ${t.valueToCode(this,"DURATION",t.ORDER_ATOMIC)})\n`},sound_play_frequency_no_duration:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_frequency_no_duration(${t.valueToCode(this,"FREQUENCY",t.ORDER_ATOMIC)})\n`},sound_play_note_list:function(e,t){t.definitions_.import_sound||(t.definitions_.import_sound="import sound");return`sound.play_note_list("${this.getFieldValue("NOTE_LIST")}")\n`},sound_note:function(e,t){return[this.getFieldValue("NOTE"),t.ORDER_ATOMIC]}};Object.assign(Ve.Blocks,tAe),Object.assign(Ve.Python.forBlock,nAe),window.sound=MIe})()})();