From 5e71bcc634be3c85b9d683262164377e451ffd5e Mon Sep 17 00:00:00 2001 From: si458 Date: Tue, 23 Jul 2024 14:03:03 +0100 Subject: [PATCH] fix minifed files Signed-off-by: si458 --- public/scripts/agent-rdp-0.0.1-min.js | 2 +- public/scripts/amt-desktop-0.0.2-min.js | 2 +- public/scripts/amt-redir-ws-0.1.0-min.js | 2 +- public/scripts/amt-setupbin-0.1.0-min.js | 2 +- public/scripts/amt-terminal-0.0.2-min.js | 2 +- public/scripts/charts-min.js | 2 +- public/scripts/ol-min.js | 2 +- public/scripts/ol3-contextmenu-min.js | 2 +- public/scripts/u2f-api-min.js | 2 +- public/scripts/xterm-min.js | 2 +- public/scripts/zlib-inflate-min.js | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/scripts/agent-rdp-0.0.1-min.js b/public/scripts/agent-rdp-0.0.1-min.js index c4e56f45..c8f14c59 100644 --- a/public/scripts/agent-rdp-0.0.1-min.js +++ b/public/scripts/agent-rdp-0.0.1-min.js @@ -1 +1 @@ -var CreateRDPDesktop=function(e,s){var o={m:{KeyAction:{NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5,DBLCLICK:6}},State:0},i=(o.canvas=Q(e),"string"==typeof(o.CanvasId=e)&&(o.CanvasId=Q(e)),o.Canvas=o.CanvasId.getContext("2d"),o.ScreenWidth=o.width=1280,o.ScreenHeight=o.height=1024,o.m.onClipboardChanged=null,!(o.onConsoleMessageChange=null)),r="default";function n(e){return(!0===o.m.SwapMouse?[2,0,1,0,0]:[1,0,2,0,0])[e]}function c(e){o.State!=e&&(o.State=e,null!=o.onStateChanged)&&o.onStateChanged(o,o.State)}function a(e){var t=o.Canvas.canvas.height/o.CanvasId.clientHeight,n=o.Canvas.canvas.width/o.CanvasId.clientWidth,a=function(e){var t=Array(2);for(t[0]=t[1]=0;e;)t[0]+=e.offsetLeft,t[1]+=e.offsetTop,e=e.offsetParent;return t}(o.Canvas.canvas),n=(e.pageX-a[0])*n,a=(e.pageY-a[1])*t;return e.addx&&(n+=e.addx),e.addy&&(a+=e.addy),{x:n,y:a}}o.mouseCursorActive=function(e){i!=e&&(i=e,o.CanvasId.style.cursor=1==e?r:"default")},o.Start=function(e,t,n){c(1),o.nodeid=e,o.port=t;var a={savepass:(o.credentials=n).savecred,useServerCreds:n.servercred,width:n.width,height:n.height,flags:n.flags,workingDir:n.workdir,alternateShell:n.altshell};n.width&&n.height&&(a.width=o.ScreenWidth=o.width=n.width,a.height=o.ScreenHeight=o.height=n.height,delete n.width,delete n.height),o.render=new Mstsc.Canvas.create(o.canvas),o.socket=new WebSocket("wss://"+window.location.host+s+"mstscrelay.ashx"),o.socket.binaryType="arraybuffer",o.socket.onopen=function(){c(2),o.socket.send(JSON.stringify(["infos",{ip:o.nodeid,port:o.port,screen:{width:o.width,height:o.height},domain:n.domain,username:n.username,password:n.password,options:a,locale:Mstsc.locale()}]))},o.socket.onmessage=function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);switch(t[0]){case"rdp-connect":c(3),o.rotation=0,o.Canvas.setTransform(1,0,0,1,0,0),o.Canvas.canvas.width=o.ScreenWidth,o.Canvas.canvas.height=o.ScreenHeight,o.Canvas.fillRect(0,0,o.ScreenWidth,o.ScreenHeight),null!=o.m.onScreenSizeChange&&o.m.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight,o.CanvasId);break;case"rdp-bitmap":null!=o.bitmapData&&((n=t[1]).data=o.bitmapData,delete o.bitmapData,o.render.update(n));break;case"rdp-pointer":var n=t[1];r=n,i&&(o.CanvasId.style.cursor=n);break;case"rdp-close":o.Stop();break;case"rdp-error":switch(o.consoleMessageTimeout=5,o.consoleMessage=t[1],delete o.consoleMessageArgs,2o.ScreenWidth||t.y>o.ScreenHeight))return o.mouseNagleData=["mouse",t.x,t.y,0,!1],null==o.mouseNagleTimer&&(o.mouseNagleTimer=setTimeout(function(){o.socket.send(JSON.stringify(o.mouseNagleData)),o.mouseNagleTimer=null},50)),e.preventDefault(),!1}},o.m.mouseup=function(e){if(o.socket&&3==o.State){var t=s(e);if(!(t.x<0||t.y<0||t.x>o.ScreenWidth||t.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),o.socket.send(JSON.stringify(["mouse",t.x,t.y,n(e.button),!1])),e.preventDefault(),!1}},o.m.mousedown=function(e){if(o.socket&&3==o.State){var t=s(e);if(!(t.x<0||t.y<0||t.x>o.ScreenWidth||t.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),o.socket.send(JSON.stringify(["mouse",t.x,t.y,n(e.button),!0])),e.preventDefault(),!1}},o.m.handleKeyUp=function(e){if(o.socket&&3==o.State)return o.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!1])),e.preventDefault(),!1},o.m.handleKeyDown=function(e){if(o.socket&&3==o.State)return o.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!0])),e.preventDefault(),!1},o.m.mousewheel=function(e){if(o.socket&&3==o.State){var t,n=s(e);if(!(n.x<0||n.y<0||n.x>o.ScreenWidth||n.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),t=0,e.detail?t=120*e.detail:e.wheelDelta&&(t=3*e.wheelDelta),o.m.ReverseMouseWheel&&(t*=-1),0!=t&&o.socket.send(JSON.stringify(["wheel",n.x,n.y,t,!1,!1])),e.preventDefault(),!1}},o.m.SendStringUnicode=function(e){o.socket&&3==o.State&&o.socket.send(JSON.stringify(["utype",e]))},o.m.SendKeyMsgKC=function(e,t,n){if(3==o.State)if("object"==typeof e)for(var s in e)o.m.SendKeyMsgKC(e[s][0],e[s][1],e[s][2]);else{t=d[t];null!=t&&o.socket.send(JSON.stringify(["scancode",t,0!=(1&e)]))}},o.m.mousedblclick=function(){},o.m.handleKeyPress=function(){},o.m.setRotation=function(){},o.m.sendcad=function(){o.socket.send(JSON.stringify(["scancode",29,!0])),o.socket.send(JSON.stringify(["scancode",56,!0])),o.socket.send(JSON.stringify(["scancode",57427,!0])),o.socket.send(JSON.stringify(["scancode",57427,!1])),o.socket.send(JSON.stringify(["scancode",56,!1])),o.socket.send(JSON.stringify(["scancode",29,!1]))};var d={9:15,16:42,17:29,18:56,27:1,33:57417,34:57425,35:57423,36:57415,37:57419,38:57416,39:57421,40:57424,44:57399,45:57426,46:57427,65:30,66:48,67:46,68:32,69:18,70:33,71:34,72:35,73:23,74:36,75:37,76:38,77:50,78:49,79:24,80:25,81:16,82:19,83:31,84:20,85:22,86:47,87:17,88:45,89:21,90:44,91:57435,112:59,113:60,114:61,115:62,116:63,117:64,118:65,119:66,120:67,121:68,122:87,123:88};return o} \ No newline at end of file diff --git a/public/scripts/amt-desktop-0.0.2-min.js b/public/scripts/amt-desktop-0.0.2-min.js index a4590364..0f876f2d 100644 --- a/public/scripts/amt-desktop-0.0.2-min.js +++ b/public/scripts/amt-desktop-0.0.2-min.js @@ -1 +1 @@ -var CreateAmtRemoteDesktop=function(e,t){var S={};function g(e){return String.fromCharCode.apply(null,e)}function p(e,t,a,n,r,o,i){var s,c,h,d,l=e[t++],v={},u=0,m=0;if(0==l){if(2==S.bpp)for(d=0;d>8&248)+","+(c>>3&252)+","+((31&c)<<3))+")");var f=k(a);n=x(0,n),S.canvas.fillRect(a=f,n,r,o)}else if(1>d&p],u++)}else{for(d=0;d>d&p],u++)}w(S.spare,a,n)}else if(128==l){if(2==S.bpp)for(;u>8&248,S.spare.data[r+1]=e>>3&252,S.spare.data[r+2]=(31&e)<<3}function b(e,t,a){if(S.graymode){var n=t<<2;for(S.lowcolor&&(e<<=4);0<=--a;)S.spare.data[n]=S.spare.data[n+1]=S.spare.data[n+2]=e,n+=4}else for(var n=t<<2,r=224&e,o=(28&e)<<3,i=T((3&e)<<6);0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function D(e,t,a){for(var n=t<<2,r=e>>8&248,o=e>>3&252,i=(31&e)<<3;0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function k(e){return 0==S.rotation||1==S.rotation?e:2==S.rotation?e-S.canvas.canvas.width:3==S.rotation?e-S.canvas.canvas.height:0}function x(e,t){return 0==S.rotation?t:1==S.rotation?t-S.canvas.canvas.width:2==S.rotation?t-S.canvas.canvas.height:3==S.rotation?t:0}function T(e){return 127>32)+IntToStr(32&n)):(S.recordedSize+=a.length,ShortToStr(e)+ShortToStr(t)+IntToStr(a.length)+IntToStr(n>>32)+IntToStr(32&n)+a)}return S.GrabMouseInput=function(){var e;1!=n&&((e=S.canvas.canvas).onmouseup=S.mouseup,e.onmousedown=S.mousedown,e.onmousemove=S.mousemove,e.onwheel=S.mousewheel,n=!0)},S.UnGrabMouseInput=function(){var e;0!=n&&((e=S.canvas.canvas).onmousemove=null,e.onmouseup=null,e.onmousedown=null,e.onwheel=null,n=!1)},S.GrabKeyInput=function(){1!=o&&(document.onkeyup=S.handleKeyUp,document.onkeydown=S.handleKeyDown,document.onkeypress=S.handleKeys,o=!0)},S.UnGrabKeyInput=function(){0!=o&&(document.onkeyup=null,document.onkeypress=document.onkeydown=null,o=!1)},S.handleKeys=function(e){return S.haltEvent(e)},S.handleKeyUp=function(e){return a(0,e)},S.handleKeyDown=function(e){return a(1,e)},S.haltEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1},S.mousedblclick=function(e){},S.mousewheel=function(e){var t,a=0;if("number"==typeof e.deltaY?a=-1*e.deltaY:"number"==typeof e.detail?a=-1*e.detail:"number"==typeof e.wheelDelta&&(a=e.wheelDelta),0!=a)return S.ReverseMouseWheel&&(a*=-1),t=S.buttonmask,S.buttonmask|=1<<(0>8,255&S.width,S.height>>8,255&S.height)+S.DeskRecordServerInit.substring(4),S.recordedData.push(I(2,1,S.DeskRecordServerInit)),S.recordedData.push(I(3,0,atob(S.CanvasId.toDataURL("image/png").split(",")[1]))),!0)},S.StopRecording=function(){var e;if(null!=S.recordedData)return(e=S.recordedData).push(I(3,0,"MeshCentralMCREC")),delete S.recordedData,delete S.recordedStart,delete S.recordedSize,e},S} \ No newline at end of file +var CreateAmtRemoteDesktop=function(e,t){var S={};function g(e){return String.fromCharCode.apply(null,e)}function p(e,t,a,n,r,o,i){var s,c,h,d,l=e[t++],v={},u=0,m=0;if(0==l){if(2==S.bpp)for(d=0;d>8&248)+","+(c>>3&252)+","+((31&c)<<3))+")");var f=k(a);n=x(0,n),S.canvas.fillRect(a=f,n,r,o)}else if(1>d&p],u++)}else{for(d=0;d>d&p],u++)}w(S.spare,a,n)}else if(128==l){if(2==S.bpp)for(;u>8&248,S.spare.data[r+1]=e>>3&252,S.spare.data[r+2]=(31&e)<<3}function b(e,t,a){if(S.graymode){var n=t<<2;for(S.lowcolor&&(e<<=4);0<=--a;)S.spare.data[n]=S.spare.data[n+1]=S.spare.data[n+2]=e,n+=4}else for(var n=t<<2,r=224&e,o=(28&e)<<3,i=T((3&e)<<6);0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function D(e,t,a){for(var n=t<<2,r=e>>8&248,o=e>>3&252,i=(31&e)<<3;0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function k(e){return 0==S.rotation||1==S.rotation?e:2==S.rotation?e-S.canvas.canvas.width:3==S.rotation?e-S.canvas.canvas.height:0}function x(e,t){return 0==S.rotation?t:1==S.rotation?t-S.canvas.canvas.width:2==S.rotation?t-S.canvas.canvas.height:3==S.rotation?t:0}function T(e){return 127>32)+IntToStr(32&n)):(S.recordedSize+=a.length,ShortToStr(e)+ShortToStr(t)+IntToStr(a.length)+IntToStr(n>>32)+IntToStr(32&n)+a)}return S.GrabMouseInput=function(){var e;1!=n&&((e=S.canvas.canvas).onmouseup=S.mouseup,e.onmousedown=S.mousedown,e.onmousemove=S.mousemove,e.onwheel=S.mousewheel,n=!0)},S.UnGrabMouseInput=function(){var e;0!=n&&((e=S.canvas.canvas).onmousemove=null,e.onmouseup=null,e.onmousedown=null,e.onwheel=null,n=!1)},S.GrabKeyInput=function(){1!=o&&(document.onkeyup=S.handleKeyUp,document.onkeydown=S.handleKeyDown,document.onkeypress=S.handleKeys,o=!0)},S.UnGrabKeyInput=function(){0!=o&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,o=!1)},S.handleKeys=function(e){return S.haltEvent(e)},S.handleKeyUp=function(e){return a(0,e)},S.handleKeyDown=function(e){return a(1,e)},S.haltEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1},S.mousedblclick=function(e){},S.mousewheel=function(e){var t,a=0;if("number"==typeof e.deltaY?a=-1*e.deltaY:"number"==typeof e.detail?a=-1*e.detail:"number"==typeof e.wheelDelta&&(a=e.wheelDelta),0!=a)return S.ReverseMouseWheel&&(a*=-1),t=S.buttonmask,S.buttonmask|=1<<(0>8,255&S.width,S.height>>8,255&S.height)+S.DeskRecordServerInit.substring(4),S.recordedData.push(I(2,1,S.DeskRecordServerInit)),S.recordedData.push(I(3,0,atob(S.CanvasId.toDataURL("image/png").split(",")[1]))),!0)},S.StopRecording=function(){var e;if(null!=S.recordedData)return(e=S.recordedData).push(I(3,0,"MeshCentralMCREC")),delete S.recordedData,delete S.recordedStart,delete S.recordedSize,e},S} \ No newline at end of file diff --git a/public/scripts/amt-redir-ws-0.1.0-min.js b/public/scripts/amt-redir-ws-0.1.0-min.js index 63ccea7e..f13b0515 100644 --- a/public/scripts/amt-redir-ws-0.1.0-min.js +++ b/public/scripts/amt-redir-ws-0.1.0-min.js @@ -1 +1 @@ -var CreateAmtRedirect=function(e,o){var y={};function x(e){return String.fromCharCode.apply(null,e)}return((y.m=e).parent=y).authCookie=o,y.State=0,y.socket=null,y.host=null,y.port=0,y.user=null,y.pass=null,y.authuri="/RedirectionService",y.tlsv1only=0,y.inDataCount=0,y.connectstate=0,y.protocol=e.protocol,y.acc=null,y.amtsequence=1,y.amtkeepalivetimer=null,y.onStateChanged=null,y.Start=function(e,t,n,r,a){y.host=e,y.port=t,y.user=n,y.pass=r,y.connectstate=0,y.inDataCount=0;e=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+e+"&port="+t+"&tls="+a+("*"==n?"&serverauth=1":"")+(void 0===r?"&serverauth=1&user="+n:"");null!=o&&""!=o&&(e+="&auth="+o),y.socket=new WebSocket(e),y.socket.binaryType="arraybuffer",y.socket.onopen=y.xxOnSocketConnected,y.socket.onmessage=y.xxOnMessage,y.socket.onclose=y.xxOnSocketClosed,y.xxStateChange(1)},y.xxOnSocketConnected=function(){y.xxStateChange(2),1==y.protocol&&y.directSend(new Uint8Array([16,0,0,0,83,79,76,32])),2==y.protocol&&y.directSend(new Uint8Array([16,1,0,0,75,86,77,82])),3==y.protocol&&y.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))},y.xxOnMessage=function(e){if(e.data&&-1!=y.connectstate){if(y.inDataCount++,1==y.connectstate&&(2==y.protocol||3==y.protocol))return y.m.ProcessBinaryData?y.m.ProcessBinaryData(e.data):y.m.ProcessData(x(e.data));var t;for(null==y.acc?y.acc=e.data:((t=new Uint8Array(y.acc.byteLength+e.data.byteLength)).set(new Uint8Array(y.acc),0),t.set(new Uint8Array(e.data),y.acc.byteLength),y.acc=t.buffer);null!=y.acc&&1<=y.acc.byteLength;){var n=0,r=new Uint8Array(y.acc);switch(r[0]){case 17:if(r.byteLength<4)return;var a=r[1];if(0===a){if(r.byteLength<13)return;a=r[12];if(r.byteLength<13+a)return;y.directSend(new Uint8Array([19,0,0,0,0,0,0,0,0])),n=13+a}else y.Stop(1);break;case 20:if(r.byteLength<9)return;var o=new DataView(y.acc).getUint32(5,!0);if(r.byteLength<9+o)return;var a=r[1],c=r[4],s=[];for(i=0;iAmtSetupBinSetupGuids.length)return null;for(var r,t=[],o=AmtSetupBinSetupGuids[e.fileType-1],a=0,o=(o=(o=(o=(o=(o=(o=(o+=ShortToStrX(e.recordChunkCount))+ShortToStrX(e.recordHeaderByteCount))+IntToStrX(e.recordNumber))+String.fromCharCode(e.majorVersion,e.minorVersion))+ShortToStrX(e.flags))+IntToStrX(e.records.length))+IntToStrX(e.dataRecordsConsumed))+ShortToStrX(e.dataRecordChunkCount);o.length<512;)o+="\0";for(r in t.push(o),e.records){var n,i="",d=e.records[r],i=(i=(i=(i=(i=(i=(i+=IntToStrX(d.typeIdentifier))+IntToStrX(d.flags))+IntToStrX(0))+IntToStrX(0))+ShortToStrX(1))+ShortToStrX(24))+IntToStrX(++a);for(n in d.variables.sort(AmtSetupBinVariableCompare),d.variables){var u="",s=d.variables[n],l=s.value;for(s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],0r.moduleid?1:e.moduleidAmtSetupBinSetupGuids.length)return null;for(var r,t=[],o=AmtSetupBinSetupGuids[e.fileType-1],a=0,o=(o=(o=(o=(o=(o=(o=(o+=ShortToStrX(e.recordChunkCount))+ShortToStrX(e.recordHeaderByteCount))+IntToStrX(e.recordNumber))+String.fromCharCode(e.majorVersion,e.minorVersion))+ShortToStrX(e.flags))+IntToStrX(e.records.length))+IntToStrX(e.dataRecordsConsumed))+ShortToStrX(e.dataRecordChunkCount);o.length<512;)o+="\0";for(r in t.push(o),e.records){var n,i="",d=e.records[r],i=(i=(i=(i=(i=(i=(i+=IntToStrX(d.typeIdentifier))+IntToStrX(d.flags))+IntToStrX(0))+IntToStrX(0))+ShortToStrX(1))+ShortToStrX(24))+IntToStrX(++a);for(n in d.variables.sort(AmtSetupBinVariableCompare),d.variables){var u="",s=d.variables[n],l=s.value;for(s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],0r.moduleid?1:e.moduleidr.varid?1:e.varid":D=!1,d=0;break;case"7":c=S,s=T,d=0;break;case"8":S=c,T=s,d=0;break;case"M":for(var h=l[1];h>=l[0]+1;h--)for(var a=0;al[0]-1;h--)for(a=0;am.height)&&(T=m.height);break;case"C":1==t&&(0==r[0]?S++:S+=r[0],S>m.width)&&(S=m.width);break;case"D":1==t&&(0==r[0]?S--:S-=r[0],S<0)&&(S=0);break;case"d":1==t&&(T=(T=r[0]-1)>m.height?m.height:T)<0&&(T=0);break;case"G":1==t&&(S=(S=r[0]-1)<0?0:S)>m.width-1&&(S=m.width-1);break;case"P":var a=1;for(1==t&&(a=r[0]),n=S;nm.height&&(r[0]=m.height),r[1]>m.width&&(r[1]=m.width),T=r[0]-1,r[1]-1):T=0;break;case"m":for(n=0;nm.height-1&&(l[0]=m.height-1),l[1]<0&&(l[1]=0),l[1]>m.height-1&&(l[1]=m.height-1),l[1]l[0]+a;c--)for(f=0;fl[0];c--)for(f=0;f=m.width&&(s=0,d++);break;default:console.log("Unknown terminal code",e,r,i)}}}(i,b,k+1,v),d=0);break;case 4:case 5:d=0;break;case 6:var o=i.charCodeAt(0);";"==i?k++:7==o?(function(e){var r;0!=e.length&&(0==(r=parseInt(e[0]))||2==r)&&1m.width&&(S=m.width),T>m.height-1&&(T=m.height-1),e){case"\b":0l[1]&&(m.recordLineTobackBuffer(0),x(1),T=l[1]),m.lineFeed="\r",S=0;break;case"\r":S=0;break;default:S>=m.width&&(S=0,C&&T++,T>=m.height-1)&&(x(1),T=m.height-1),o(e),S++}}}function o(e){y[T][S]=e,p[T][S]=(u<<6)+(w<<12)+g}function L(){for(var e=(u<<6)+(w<<12)+g,r=S;r")},m.TermDrawLine=function(e,r,t){for(var i,n,h,a,o=1,c=0;c>a&63],1&i&&(e+=";text-decoration:underline"),e+=';">',t=""+(t=""),o=i),n=y[r][c]){case"&":e+="&";break;case"<":e+="<";break;case">":e+=">";break;case" ":e+=" ";break;default:e+=n}return[e,t]},m.TermDraw=function(){for(var e="",r="",t=0;t")}var n=(B=800"+n+r+e+"",m.DivElement.scrollTop=m.DivElement.scrollHeight,0==m.heightLock&&setTimeout(m.TermLockHeight,10)},m.TermLockHeight=function(){m.heightLock=m.DivElement.clientHeight,m.DivElement.style.height=m.DivElement.parentNode.style.height=m.heightLock+"px",m.DivElement.style["overflow-y"]="scroll"},m.TermInit=function(){m.TermResetScreen()},m.heightLock=0,m.DivElement.style.height="",null!=r&&null!=r.cols&&null!=r.rows?m.Init(r.cols,r.rows):m.Init(),m} \ No newline at end of file +var CreateAmtRemoteTerminal=function(e,r){var l,m={},f=(m.DivId=e,m.DivElement=document.getElementById(e),m.protocol=1,r.protocol&&(m.protocol=r.protocol),m.terminalEmulation=1,m.fxEmulation=0,m.lineFeed="\r\n",m.debugmode=0,m.width=80,m.height=25,m.heightLock=0,["000000","BB0000","00BB00","BBBB00","0000BB","BB00BB","00BBBB","BBBBBB","555555","FF5555","55FF55","FFFF55","5555FF","FF55FF","55FFFF","FFFFFF"]),g=0,u=7,w=0,C=!0,S=0,T=0,c=0,s=0,d=0,b=[],k=0,v=0,p=[],y=[],n=!1,K=!0,D=!1,B=[],F="";m.title=null,m.onTitleChange=null,m.Start=function(){},m.Init=function(e,r){m.width=e||80,m.height=r||25;for(var t=0;t":D=!1,d=0;break;case"7":c=S,s=T,d=0;break;case"8":S=c,T=s,d=0;break;case"M":for(var h=l[1];h>=l[0]+1;h--)for(var a=0;al[0]-1;h--)for(a=0;am.height)&&(T=m.height);break;case"C":1==t&&(0==r[0]?S++:S+=r[0],S>m.width)&&(S=m.width);break;case"D":1==t&&(0==r[0]?S--:S-=r[0],S<0)&&(S=0);break;case"d":1==t&&(T=(T=r[0]-1)>m.height?m.height:T)<0&&(T=0);break;case"G":1==t&&(S=(S=r[0]-1)<0?0:S)>m.width-1&&(S=m.width-1);break;case"P":var a=1;for(1==t&&(a=r[0]),n=S;nm.height&&(r[0]=m.height),r[1]>m.width&&(r[1]=m.width),T=r[0]-1,r[1]-1):T=0;break;case"m":for(n=0;nm.height-1&&(l[0]=m.height-1),l[1]<0&&(l[1]=0),l[1]>m.height-1&&(l[1]=m.height-1),l[0]>l[1]&&(l[0]=l[1]);break;case"S":a=1;1==t&&(a=r[0]);for(var c=l[0];c<=l[1]-a;c++)for(var f=0;fl[0]+a;c--)for(f=0;fl[0];c--)for(f=0;f=m.width&&(s=0,d++);break;default:console.log("Unknown terminal code",e,r,i)}}}(i,b,k+1,v),d=0);break;case 4:case 5:d=0;break;case 6:var o=i.charCodeAt(0);";"==i?k++:7==o?(function(e){var r;0!=e.length&&(0==(r=parseInt(e[0]))||2==r)&&1m.width&&(S=m.width),T>m.height-1&&(T=m.height-1),e){case"\b":0l[1]&&(m.recordLineTobackBuffer(0),x(1),T=l[1]),m.lineFeed="\r",S=0;break;case"\r":S=0;break;default:S>=m.width&&(S=0,C&&T++,T>=m.height-1)&&(x(1),T=m.height-1),o(e),S++}}}function o(e){y[T][S]=e,p[T][S]=(u<<6)+(w<<12)+g}function L(){for(var e=(u<<6)+(w<<12)+g,r=S;r")},m.TermDrawLine=function(e,r,t){for(var i,n,h,a,o=1,c=0;c>a&63],1&i&&(e+=";text-decoration:underline"),e+=';">',t=""+(t=""),o=i),n=y[r][c]){case"&":e+="&";break;case"<":e+="<";break;case">":e+=">";break;case" ":e+=" ";break;default:e+=n}return[e,t]},m.TermDraw=function(){for(var e="",r="",t=0;t")}var n=(B=800"+n+r+e+"",m.DivElement.scrollTop=m.DivElement.scrollHeight,0==m.heightLock&&setTimeout(m.TermLockHeight,10)},m.TermLockHeight=function(){m.heightLock=m.DivElement.clientHeight,m.DivElement.style.height=m.DivElement.parentNode.style.height=m.heightLock+"px",m.DivElement.style["overflow-y"]="scroll"},m.TermInit=function(){m.TermResetScreen()},m.heightLock=0,m.DivElement.style.height="",null!=r&&null!=r.cols&&null!=r.rows?m.Init(r.cols,r.rows):m.Init(),m} \ No newline at end of file diff --git a/public/scripts/charts-min.js b/public/scripts/charts-min.js index ce67c85e..808e3d1a 100644 --- a/public/scripts/charts-min.js +++ b/public/scripts/charts-min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,function(){var a=Object.freeze({__proto__:null,get Colors(){return hr},get Decimation(){return ur},get Filler(){return Sr},get Legend(){return Or},get SubTitle(){return Er},get Title(){return Tr},get Tooltip(){return Yr}});function t(){}let F=(()=>{let t=0;return()=>t++})();function P(t){return null==t}function O(t){return!(!Array.isArray||!Array.isArray(t))||"[object"===(t=Object.prototype.toString.call(t)).slice(0,7)&&"Array]"===t.slice(-6)}function A(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function p(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function u(t,e){return p(t)?t:e}function T(t,e){return void 0===t?e:t}let V=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,B=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function k(t,e,i,a){let s,r,n;if(O(t))if(r=t.length,a)for(s=r-1;0<=s;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function q(t){var e=t.split("."),i=[];let a="";for(let t of e)a+=t,a=a.endsWith("\\")?a.slice(0,-1)+".":(i.push(a),"");return i}function f(t,e){return(X[e]||(X[e]=function(){let i=q(e);return t=>{for(var e of i){if(""===e)break;t=t&&t[e]}return t}}()))(t)}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}let G=t=>void 0!==t,g=t=>"function"==typeof t,Z=(t,e)=>{if(t.size!==e.size)return!1;for(var i of t)if(!e.has(i))return!1;return!0};function J(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}let S=Math.PI,v=2*S,Q=v+S,tt=Number.POSITIVE_INFINITY,et=S/180,D=S/2,it=S/4,at=2*S/3,o=Math.log10,_=Math.sign;function st(t,e,i){return Math.abs(t-e)t-e).pop(),e}function ot(t){return!isNaN(parseFloat(t))&&isFinite(t)}function lt(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function ht(t,e,i){let a,s,r;for(a=0,s=t.length;a=Math.min(e,i)-a&&t<=Math.max(e,i)+a}function bt(e,i,t){t=t||(t=>e[t]>1)?r=a:s=a;return{lo:r,hi:s}}let m=(i,a,s,t)=>bt(i,s,t?t=>{var e=i[t][a];return ei[t][a]bt(e,a,t=>e[t][i]>=a);function vt(t,e,i){let a=0,s=t.length;for(;aa&&t[s-1]>i;)s--;return 0{let i="_onData"+K(t),a=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...e){var t=a.apply(this,e);return s._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),t}})}))}function Mt(e,t){var i=e._chartjs;i&&(-1!==(t=(i=i.listeners).indexOf(t))&&i.splice(t,1),0{delete e[t]}),delete e._chartjs))}function wt(t){var e=new Set(t);return e.size===t.length?t:Array.from(e)}let kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function St(e,i){let a,s=!1;return function(...t){a=t,s||(s=!0,kt.call(window,()=>{s=!1,e.apply(i,a)}))}}function Pt(e,i){let a;return function(...t){return i?(clearTimeout(a),a=setTimeout(e,i,t)):e.apply(this,t),i}}let Dt=t=>"start"===t?"left":"end"===t?"right":"center",E=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Ct=(t,e,i,a)=>t===(a?"left":"right")?i:"center"===t?(e+i)/2:e;function Ot(t,e,i){var a,s,r,n,o,l,h=e.length;let d=0,c=h;return t._sorted&&({iScale:t,_parsed:a}=t,s=t.axis,{min:r,max:n,minDefined:o,maxDefined:l}=t.getUserBounds(),o&&(d=C(Math.min(m(a,s,r).lo,i?h:m(e,s,t.getPixelForValue(r)).lo),0,h-1)),c=l?C(Math.max(m(a,t.axis,n,!0).hi+1,i?0:m(e,s,t.getPixelForValue(n),!0).hi+1),d,h)-d:h-d),{start:d,count:c}}function At(t){var{xScale:e,yScale:i,_scaleRanges:a}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};return a?(e=a.xmin!==e.min||a.xmax!==e.max||a.ymin!==i.min||a.ymax!==i.max,Object.assign(a,s),e):(t._scaleRanges=s,!0)}var r=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,a,t){let s=i.listeners[t],r=i.duration;s.forEach(t=>t({chart:e,initial:i.initial,numSteps:r,currentStep:Math.min(a-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=kt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((a,s)=>{if(a.running&&a.items.length){var r=a.items;let t,e=r.length-1,i=!1;for(;0<=e;--e)(t=r[e])._active?(t._total>a.duration&&(a.duration=t._total),t.tick(n),i=!0):(r[e]=r[r.length-1],r.pop());i&&(s.draw(),this._notify(s,a,n,"progress")),r.length||(a.running=!1,this._notify(s,a,n,"complete"),a.initial=!1),o+=r.length}}),this._lastDate=n,0===o&&(this._running=!1)}_getAnims(t){var e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return 0Math.max(t,e._duration),0),this._refresh())}running(t){return!!this._running&&!!((t=this._charts.get(t))&&t.running&&t.items.length)}stop(e){var i=this._charts.get(e);if(i&&i.items.length){var a=i.items;let t=a.length-1;for(;0<=t;--t)a[t].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}};function Tt(t){return t+.5|0}let Lt=(t,e,i)=>Math.max(Math.min(t,i),e);function Et(t){return Lt(Tt(2.55*t),0,255)}function Rt(t){return Lt(Tt(255*t),0,255)}function n(t){return Lt(Tt(t/2.55)/100,0,1)}function It(t){return Lt(Tt(100*t),0,100)}let l={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zt=[..."0123456789ABCDEF"],Ft=t=>zt[15&t],Vt=t=>zt[(240&t)>>4]+zt[15&t],Bt=t=>(240&t)>>4==(15&t);let Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nt(i,t,a){let s=t*Math.min(a,1-a),e=(t,e=(t+i/30)%12)=>a-s*Math.max(Math.min(e-3,9-e,1),-1);return[e(0),e(8),e(4)]}function Ht(i,a,s){var t=(t,e=(t+i/60)%6)=>s-s*a*Math.max(Math.min(e,4-e,1),0);return[t(5),t(3),t(1)]}function jt(t,e,i){var a=Nt(t,1,.5);let s;for(1t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Qt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function te(e,i,a){if(e){let t=Yt(e);t[i]=Math.max(0,Math.min(t[i]+t[i]*a,0===i?360:1)),t=Ut(t),e.r=t[0],e.g=t[1],e.b=t[2]}}function ee(t,e){return t&&Object.assign(e||{},t)}function ie(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?3<=t.length&&(e={r:t[0],g:t[1],b:t[2],a:255},3>16&255,r>>8&255,255&r]}return t}()).transparent=[0,0,0,0]),(i=Gt[i.toLowerCase()])&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255})||ae(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=ee(this._rgb);return t&&(t.a=n(t.a)),t}set rgb(t){this._rgb=ie(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid&&(t=this._rgb,e=t,e=Bt(e.r)&&Bt(e.g)&&Bt(e.b)&&Bt(e.a)?Ft:Vt,t)?"#"+e(t.r)+e(t.g)+e(t.b)+((t=t.a)<255?e(t):""):void 0;var t,e}hslString(){if(this._valid){var t,e,i,a=this._rgb;if(a)return t=(i=Yt(a))[0],e=It(i[1]),i=It(i[2]),a.a<255?`hsla(${t}, ${e}%, ${i}%, ${n(a.a)})`:`hsl(${t}, ${e}%, ${i}%)`}}mix(t,e){var i,a,s;return t&&(i=this.rgb,t=t.rgb,s=i.a-t.a,i.r=255&(a=(1+((a=2*(e=void 0===e?.5:e)-1)*s==-1?a:(a+s)/(1+a*s)))/2)*i.r+(s=1-a)*t.r+.5,i.g=255&a*i.g+s*t.g+.5,i.b=255&a*i.b+s*t.b+.5,i.a=e*i.a+(1-e)*t.a,this.rgb=i),this}interpolate(t,e){return t&&(this._rgb=(i=this._rgb,t=t._rgb,e=e,a=Qt(n(i.r)),s=Qt(n(i.g)),r=Qt(n(i.b)),{r:Rt(Jt(a+e*(Qt(n(t.r))-a))),g:Rt(Jt(s+e*(Qt(n(t.g))-s))),b:Rt(Jt(r+e*(Qt(n(t.b))-r))),a:i.a+e*(t.a-i.a)})),this;var i,a,s,r}clone(){return new se(this.rgb)}alpha(t){return this._rgb.a=Rt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){var t=this._rgb,e=Tt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return te(this._rgb,2,t),this}darken(t){return te(this._rgb,2,-t),this}saturate(t){return te(this._rgb,1,t),this}desaturate(t){return te(this._rgb,1,-t),this}rotate(t){return e=this._rgb,t=t,(i=Yt(e))[0]=Xt(i[0]+t),i=Ut(i),e.r=i[0],e.g=i[1],e.b=i[2],this;var e,i}}function re(t){return!(!t||"object"!=typeof t||"[object CanvasPattern]"!==(t=t.toString())&&"[object CanvasGradient]"!==t)}function ne(t){return re(t)?t:new se(t)}function oe(t){return re(t)?t:new se(t).saturate(.5).darken(.1).hexString()}let le=["x","y","borderWidth","radius","tension"],he=["color","borderColor","backgroundColor"],de=new Map;function ce(t,e,s){return function(t,e){e=s||{};var i=t+JSON.stringify(e);let a=de.get(i);return a||(a=new Intl.NumberFormat(t,e),de.set(i,a)),a}(e).format(t)}let ue={values:t=>O(t)?t:""+t,numeric(e,t,i){if(0===e)return"0";var a=this.chart.options.locale;let s,r=e;if(1.8*i.length?ue.numeric.call(this,t,e,i):"")}};var ge={formatters:ue};let fe=Object.create(null),pe=Object.create(null);function me(i,t){if(t){var a=t.split(".");for(let t=0,e=a.length;tt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>oe(e.backgroundColor),this.hoverBorderColor=(t,e)=>oe(e.borderColor),this.hoverColor=(t,e)=>oe(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return be(this,t,e)}get(t){return me(this,t)}describe(t,e){return be(pe,t,e)}override(t,e){return be(fe,t,e)}route(t,e,i,a){let s=me(this,t),r=me(this,i),n="_"+e;Object.defineProperties(s,{[n]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[n],e=r[a];return A(t)?Object.assign({},e,t):T(t,e)},set(t){this[n]=t}}})}apply(t){t.forEach(t=>t(this))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:he},numbers:{type:"number",properties:le}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ge.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function xe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ve(t){let e=t.parentNode;return e=e&&"[object ShadowRoot]"===e.toString()?e.host:e}function _e(t,e,i){let a;return"string"==typeof t?(a=parseInt(t,10),-1!==t.indexOf("%")&&(a=a/100*e.parentNode[i])):a=t,a}let ye=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Me(t,e){return ye(t).getPropertyValue(e)}let we=["top","right","bottom","left"];function ke(e,i,a){var s={};a=a?"-"+a:"";for(let t=0;t<4;t++){var r=we[t];s[r]=parseFloat(e[i+"-"+r+a])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Se(t,e){if("native"in t)return t;var{canvas:i,currentDevicePixelRatio:a}=e,s=ye(i),r="border-box"===s.boxSizing,n=ke(s,"padding"),s=ke(s,"border","width"),{x:t,y:o,box:l}=function(t,e){var i,a=t.touches,a=a&&a.length?a[0]:t,{offsetX:s,offsetY:r}=a;let n,o,l=!1;if(i=r,t=t.target,!(0Math.round(10*t)/10;function De(t,e,i,a){var s=ye(t),r=ke(s,"margin"),n=_e(s.maxWidth,t,"clientWidth")||tt,o=_e(s.maxHeight,t,"clientHeight")||tt,t=function(t,s,r){let n,o;if(void 0===s||void 0===r){var l=ve(t);if(l){let t=l.getBoundingClientRect(),e=ye(l),i=ke(e,"border","width"),a=ke(e,"padding");s=t.width-a.width-i.width,r=t.height-a.height-i.height,n=_e(e.maxWidth,l,"clientWidth"),o=_e(e.maxHeight,l,"clientHeight")}else s=t.clientWidth,r=t.clientHeight}return{width:s,height:r,maxWidth:n||tt,maxHeight:o||tt}}(t,e,i);let{width:l,height:h}=t;if("content-box"===s.boxSizing){let t=ke(s,"border","width"),e=ke(s,"padding");l-=e.width+t.width,h-=e.height+t.height}return l=Math.max(0,l-r.width),h=Math.max(0,a?l/a:h-r.height),l=Pe(Math.min(l,n,t.maxWidth)),h=Pe(Math.min(h,o,t.maxHeight)),l&&!h&&(h=Pe(l/2)),(void 0!==e||void 0!==i)&&a&&t.height&&h>t.height&&(h=t.height,l=Pe(Math.floor(h*a))),{width:l,height:h}}function Ce(t,e,i){var e=e||1,a=Math.floor(t.height*e),s=Math.floor(t.width*e),r=(t.height=Math.floor(t.height),t.width=Math.floor(t.width),t.canvas);return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==e||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=e,r.height=a,r.width=s,t.ctx.setTransform(e,0,0,e,0,0),!0)}var Oe=function(){let t=!1;try{var e={get passive(){return!(t=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ae(t,e){t=Me(t,e),e=t&&t.match(/^(\d+)(\.\d+)?px$/);return e?+e[1]:void 0}function Te(t){return!t||P(t.size)||P(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Le(t,e,i,a,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),a=r>a?r:a}function Ee(t,e,i,a){let s=(a=a||{}).data=a.data||{},r=a.garbageCollect=a.garbageCollect||[],n=(a.font!==e&&(s=a.data={},r=a.garbageCollect=[],a.font=e),t.save(),t.font=e,0);var o=i.length;let l,h,d,c,u;for(l=0;li.length){for(l=0;le.left-i&&t.xe.top-i&&t.yo[0]){let i=t||o;void 0===e&&(e=ti("_fallback",o));t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:i,_fallback:e,_getTarget:s,override:t=>Ye([t,...o],l,i,e)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete t._keys,delete o[0][e],!0),get:(r,n)=>Ke(r,n,()=>{var t,e,i=n,a=o,s=r;for(e of l)if(t=ti(Xe(e,i),a),void 0!==t)return qe(i,t)?Je(a,s,i,t):t}),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(o[0]),has:(t,e)=>ei(t).includes(e),ownKeys:t=>ei(t),set(t,e,i){var a=t._storage||(t._storage=s());return t[e]=a[e]=i,delete t._keys,!0}})}function $e(a,e,i,s){var t={_cacheable:!1,_proxy:a,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ue(a,s),setContext:t=>$e(a,t,i,s),override:t=>$e(a.override(t),e,i,s)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete a[e],!0),get:(o,h,d)=>Ke(o,h,()=>{{var l=o,e=h,i=d,{_proxy:a,_context:s,_subProxy:r,_descriptors:n}=l;let t=a[e];return O(t=g(t)&&n.isScriptable(e)?function(t,e,i){var{_proxy:a,_context:s,_subProxy:r,_stack:n}=l;if(n.has(t))throw new Error("Recursion detected: "+Array.from(n).join("->")+"->"+t);n.add(t);let o=e(s,r||i);return n.delete(t),o=qe(t,o)?Je(a._scopes,a,t,o):o}(e,t,i):t)&&t.length&&(t=function(s,r,t,e){var{_proxy:n,_context:o,_subProxy:l,_descriptors:h}=t;if(void 0!==o.index&&e(s))return r[o.index%r.length];if(A(r[0])){let i=r,a=n._scopes.filter(t=>t!==i);r=[];for(let e of i){let t=Je(a,n,s,e);r.push($e(t,o,l&&l[s],h))}}return r}(e,t,l,n.isIndexable)),t=qe(e,t)?$e(t,s,r&&r[e],n):t}}),getOwnPropertyDescriptor:(t,e)=>t._descriptors.allKeys?Reflect.has(a,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(a,e),getPrototypeOf:()=>Reflect.getPrototypeOf(a),has:(t,e)=>Reflect.has(a,e),ownKeys:()=>Reflect.ownKeys(a),set:(t,e,i)=>(a[e]=i,delete t[e],!0)})}function Ue(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:a=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:a,isScriptable:g(i)?i:()=>i,isIndexable:g(a)?a:()=>a}}let Xe=(t,e)=>t?t+K(e):e,qe=(t,e)=>A(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ke(t,e,i){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:(i=i(),t[e]=i)}function Ge(t,e,i){return g(t)?t(e,i):t}let Ze=(t,e)=>!0===t?e:"string"==typeof t?f(e,t):void 0;function Je(t,a,s,r){var e=a._rootScopes,i=Ge(a._fallback,s,r),t=[...t,...e],n=new Set,o=(n.add(r),Qe(n,t,s,i||s,r));return null!==o&&(void 0===i||i===s||null!==(o=Qe(n,t,i,o,r)))&&Ye(Array.from(n),[""],e,i,()=>{return t=s,e=r,i=a._getTarget(),t in i||(i[t]={}),O(i=i[t])&&A(e)?e:i||{};var t,e,i})}function Qe(t,e,i,a,s){for(;i;)i=function(e,t,i,a,s){for(var r of t){let t=Ze(i,r);if(t){e.add(t);r=Ge(t._fallback,i,s);if(void 0!==r&&r!==i&&r!==a)return r}else if(!1===t&&void 0!==a&&i!==a)return null}return!1}(t,e,i,a,s);return i}function ti(e,t){for(var i of t)if(i){let t=i[e];if(void 0!==t)return t}}function ei(t){let e=t._keys;return e=e||(t._keys=function(t){var e,i=new Set;for(e of t)for(let t of Object.keys(e).filter(t=>!t.startsWith("_")))i.add(t);return Array.from(i)}(t._scopes))}function ii(t,e,i,a){var s=t.iScale,{key:r="r"}=this._parsing,n=new Array(a);let o,l,h,d;for(o=0,l=a;oe"x"===t?"y":"x";function ni(t,e,i,a){var t=t.skip?e:t,s=e,e=i.skip?e:i,i=gt(s,t),r=gt(e,s),n=i/(i+r),i=r/(i+r),r=a*(isNaN(n)?0:n),n=a*(isNaN(i)?0:i);return{previous:{x:s.x-r*(e.x-t.x),y:s.y-r*(e.y-t.y)},next:{x:s.x+n*(e.x-t.x),y:s.y+n*(e.y-t.y)}}}function oi(l,e="x"){var i=ri(e),t=l.length,o=Array(t).fill(0),h=Array(t);let a,s,r,n=si(l,0);for(a=0;a!t.skip)),"monotone"===e.cubicInterpolationMode)oi(n,t);else{let t=i?n[n.length-1]:n[0];for(a=0,s=n.length;a0===t||1===t,ci=(t,e,i)=>-Math.pow(2,10*--t)*Math.sin((t-e)*v/i),ui=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*v/i)+1,gi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-(--t*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>--t*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*D),easeOutSine:t=>Math.sin(t*D),easeInOutSine:t=>-.5*(Math.cos(S*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>di(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>1<=t?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1- --t*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>di(t)?t:ci(t,.075,.3),easeOutElastic:t=>di(t)?t:ui(t,.075,.3),easeInOutElastic(t){return di(t)?t:t<.5?.5*ci(2*t,.1125,.45):.5+.5*ui(2*t-1,.1125,.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return--t*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-gi.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*gi.easeInBounce(2*t):.5*gi.easeOutBounce(2*t-1)+.5};function fi(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pi(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:("middle"===a?i<.5?t:e:"after"===a?i<1?t:e:0+t||0;function yi(e,i){var a={},t=A(i),s=t?Object.keys(i):i,r=A(e)?t?t=>T(e[t],e[i[t]]):t=>e[t]:()=>e;for(let t of s)a[t]=_i(r(t));return a}function Mi(t){return yi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function wi(t){return yi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function I(t){t=Mi(t);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function z(t,e){e=e||R.font;let i=T((t=t||{}).size,e.size),a=("string"==typeof i&&(i=parseInt(i,10)),T(t.style,e.style));a&&!(""+a).match(xi)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);t={family:T(t.family,e.family),lineHeight:vi(T(t.lineHeight,e.lineHeight),i),size:i,style:a,weight:T(t.weight,e.weight),string:""};return t.string=Te(t),t}function ki(t,e,i,a){let s,r,n,o=!0;for(s=0,r=t.length;si&&0===t?0:t+e;return{min:s(t,-Math.abs(e)),max:s(a,e)}}function Pi(t,e){return Object.assign(Object.create(t),e)}function Di(t,e,i){return t?(a=e,s=i,{x:t=>a+a+s-t,setWidth(t){s=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t};var a,s}function Ci(t,e){var i,a;"ltr"!==e&&"rtl"!==e||(a=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=a)}function Oi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ai(t){return"angle"===t?{between:pt,compare:ft,normalize:x}:{between:d,compare:(t,e)=>t-e,normalize:t=>t}}function Ti({start:t,end:e,count:i,loop:a,style:s}){return{start:t%i,end:e%i,loop:a&&(e-t+1)%i==0,style:s}}function Li(t,i,g){if(!g)return[t];let{property:a,start:s,end:r}=g,n=i.length,{compare:o,between:l,normalize:h}=Ai(a),{start:d,end:c,loop:u,style:f}=function(t,e){var{property:i,start:a,end:s}=g,{between:r,normalize:n}=Ai(i),o=e.length;let l,h,{start:d,end:c,loop:u}=t;if(u){for(d+=o,c+=o,l=0,h=o;la&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(r,o,i=!!t._loop),Ii(t,!0===n?[{start:a,end:s,loop:i}]:function(e,i,t,a){var s=e.length,r=[];let n,o=i,l=e[i];for(n=i+1;n<=t;++n){let t=e[n%s];t.skip||t.stop?l.skip||(a=!1,r.push({start:i%s,end:(n-1)%s,loop:a}),i=o=t.stop?n:null):(o=n,l.skip&&(i=n)),l=t}return null!==o&&r.push({start:i%s,end:o%s,loop:a}),r}(r,a,s{t[o](a[s],r)&&(n.push({element:t,datasetIndex:e,index:i}),l=l||t.inRange(a.x,a.y,r))}),e&&!l?[]:n}var Hi={evaluateInteractionItems:Vi,modes:{index(t,e,i,a){let s=Se(e,t),r=i.axis||"x",n=i.includeInvisible||!1,o=i.intersect?Bi(t,s,r,a,n):Wi(t,s,r,!1,a,n),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{var e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,a){var e=Se(e,t),s=i.axis||"xy",r=i.includeInvisible||!1;let n=i.intersect?Bi(t,e,s,a,r):Wi(t,e,s,!1,a,r);if(0Bi(t,Se(e,t),i.axis||"xy",a,i.includeInvisible||!1),nearest(t,e,i,a){return Wi(t,Se(e,t),i.axis||"xy",i.intersect,a,i.includeInvisible||!1)},x:(t,e,i,a)=>Ni(t,Se(e,t),"x",i.intersect,a),y:(t,e,i,a)=>Ni(t,Se(e,t),"y",i.intersect,a)}};let ji=["left","top","right","bottom"];function Yi(t,e){return t.filter(t=>t.pos===e)}function $i(t,e){return t.filter(t=>-1===ji.indexOf(t.pos)&&t.box.axis===e)}function Ui(t,a){return t.sort((t,e)=>{var i=a?e:t,t=a?t:e;return i.weight===t.weight?i.index-t.index:i.weight-t.weight})}function Xi(t,e,i,a){return Math.max(t[i],e[i])+Math.max(t[a],e[a])}function qi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ki(i,a,s,r){var n=[];let o,t,l,h,d,c;for(o=0,t=i.length,d=0;o{e[t]=Math.max(i[t],a[t])}),e}}(l.horizontal,a));let{same:t,other:e}=function(e,t,i,a){var{pos:s,box:r}=i,n=e.maxPadding;if(!A(s)){i.size&&(e[s]-=i.size);let t=a[i.stack]||{size:0,count:1};t.size=Math.max(t.size,i.horizontal?r.height:r.width),i.size=t.size/t.count,e[s]+=i.size}return r.getPadding&&qi(n,r.getPadding()),a=Math.max(0,t.outerWidth-Xi(n,e,"left","right")),s=Math.max(0,t.outerHeight-Xi(n,e,"top","bottom")),r=a!==e.w,t=s!==e.h,e.w=a,e.h=s,i.horizontal?{same:r,other:t}:{same:t,other:r}}(a,s,l,r);d|=t&&n.length,c=c||e,h.fullSize||n.push(l)}return d&&Ki(n,a,s,r)||c}function Gi(t,e,i,a,s){t.top=i,t.left=e,t.right=e+a,t.bottom=i+s,t.width=a,t.height=s}function Zi(t,r,n,e){var o,l=n.padding;let{x:h,y:d}=r;for(o of t){let i=o.box,a=e[o.stack]||{count:1,placed:0,weight:1},s=o.stackWeight/a.weight||1;if(o.horizontal){let t=r.w*s,e=a.size||i.height;G(a.start)&&(d=a.start),i.fullSize?Gi(i,l.left,d,n.outerWidth-l.right-l.left,e):Gi(i,r.left+a.placed,d,t,e),a.start=d,a.placed+=t,d=i.bottom}else{let t=r.h*s,e=a.size||i.width;G(a.start)&&(h=a.start),i.fullSize?Gi(i,h,l.top,e,n.outerHeight-l.bottom-l.top):Gi(i,h,r.top+a.placed,e,t),a.start=h,a.placed+=t,h=i.right}}r.x=h,r.y=d}var s={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){e=t.boxes?t.boxes.indexOf(e):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(i,a,s,r){if(i){var n,o,l=I(i.options.layout.padding),h=Math.max(a-l.width,0),d=Math.max(s-l.height,0),c=(u=function(t){var e=[];let i,a,s,r,n,o;for(i=0,a=(t||[]).length;it.box.fullSize),!0),g=Ui(Yi(u,"left"),!0),f=Ui(Yi(u,"right")),m=Ui(Yi(u,"top"),!0),n=Ui(Yi(u,"bottom")),o=$i(u,"x"),p=$i(u,"y"),{fullSize:c,leftAndTop:g.concat(m),rightAndBottom:f.concat(p).concat(n).concat(o),chartArea:Yi(u,"chartArea"),vertical:g.concat(f).concat(p),horizontal:m.concat(n).concat(o)}),u=c.vertical,g=c.horizontal,f=(k(i.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}),u.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),p=Object.freeze({outerWidth:a,outerHeight:s,padding:l,availableWidth:h,availableHeight:d,vBoxMaxWidth:h/2/f,hBoxMaxHeight:d/2}),m=Object.assign({},l);qi(m,I(r));let e=Object.assign({maxPadding:m,w:h,h:d,x:l.left,y:l.top},l),t=function(a,s){var r=function(t){var a,s,r={};for(a of t){let{stack:t,pos:e,stackWeight:i}=a;t&&ji.includes(e)&&((s=r[t]||(r[t]={count:0,placed:0,weight:0,size:0})).count++,s.weight+=i)}return r}(a),{vBoxMaxWidth:n,hBoxMaxHeight:o}=s;let l,t,h;for(l=0,t=a.length;l{t=t.box;Object.assign(t,i.chartArea),t.update(e.w,e.h,{left:0,top:0,right:0,bottom:0})})}}};class Ji{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,a){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,a?Math.floor(e/a):i)}}isAttached(t){return!0}updateConfig(t){}}class Qi extends Ji{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let ta="$chartjs",ea={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ia=t=>null===t||""===t,aa=!!Oe&&{passive:!0};function sa(t,e){for(var i of t)if(i===e||i.contains(e))return!0}function ra(t,e,a){let s=t.canvas,i=new MutationObserver(e=>{let i=!1;for(let t of e)i=i||sa(t.addedNodes,s),i=i&&!sa(t.removedNodes,s);i&&a()});return i.observe(document,{childList:!0,subtree:!0}),i}function na(t,e,a){let s=t.canvas,i=new MutationObserver(e=>{let i=!1;for(let t of e)i=i||sa(t.removedNodes,s),i=i&&!sa(t.addedNodes,s);i&&a()});return i.observe(document,{childList:!0,subtree:!0}),i}let oa=new Map,la=0;function ha(){let i=window.devicePixelRatio;i!==la&&(la=i,oa.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function da(e,t,a){let i=e.canvas,s=i&&ve(i);if(s){let i=St((t,e)=>{var i=s.clientWidth;a(t,e),i{var t=t[0],e=t.contentRect.width,t=t.contentRect.height;0===e&&0===t||i(e,t)});return t.observe(s),e=e,r=i,oa.size||window.addEventListener("resize",ha),oa.set(e,r),t;var r}}function ca(t,e,i){i&&i.disconnect(),"resize"===e&&(i=t,oa.delete(i),oa.size||window.removeEventListener("resize",ha))}function ua(e,t,i){var a=e.canvas,s=St(t=>{null!==e.ctx&&i(function(t,e){var i=ea[t.type]||t.type,{x:a,y:s}=Se(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==s?s:null}}(t,e))},e);return a.addEventListener(t,s,aa),s}class ga extends Ji{acquireContext(e,t){var i=e&&e.getContext&&e.getContext("2d");{if(i&&i.canvas===e){var a=t,t=e.style,s=e.getAttribute("height"),r=e.getAttribute("width");if(e[ta]={initial:{height:s,width:r,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ia(r)){let t=Ae(e,"width");void 0!==t&&(e.width=t)}if(ia(s))if(""===e.style.height)e.height=e.width/(a||2);else{let t=Ae(e,"height");void 0!==t&&(e.height=t)}return i}return null}}releaseContext(t){let i=t.canvas;if(!i[ta])return!1;let a=i[ta].initial,e=(["height","width"].forEach(t=>{var e=a[t];P(e)?i.removeAttribute(t):i.setAttribute(t,e)}),a.style||{});return Object.keys(e).forEach(t=>{i.style[t]=e[t]}),i.width=i.width,delete i[ta],!0}addEventListener(t,e,i){this.removeEventListener(t,e);var a=t.$proxies||(t.$proxies={}),s={attach:ra,detach:na,resize:da}[e]||ua;a[e]=s(t,e,i)}removeEventListener(t,e){var i=t.$proxies||(t.$proxies={}),a=i[e];a&&(({attach:ca,detach:ca,resize:ca}[e]||function(t,e,i){t.canvas.removeEventListener(e,i,aa)})(t,e,a),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return De(t,e,i,a)}isAttached(t){t=ve(t);return!(!t||!t.isConnected)}}function fa(t){return!xe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qi:ga}let pa=Object.freeze({__proto__:null,BasePlatform:Ji,BasicPlatform:Qi,DomPlatform:ga,_detectPlatform:fa}),ma="transparent",ba={boolean:(t,e,i)=>.5t+(e-t)*i};class xa{constructor(t,e,i,a){var s=e[i],s=(a=ki([t.to,a,s,t.from]),ki([t.from,s,a]));this._active=!0,this._fn=t.fn||ba[t.type||typeof s],this._easing=gi[t.easing]||gi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){var a,s,r;this._active&&(this._notify(!1),a=this._target[this._prop],s=i-this._start,r=this._duration-s,this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ki([t.to,e,a,t.from]),this._from=ki([t.from,a,e]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var t=t-this._start,e=this._duration,i=this._prop,a=this._from,s=this._loop,r=this._to;this._active=a!==r&&(s||t{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej",i=this._promises||[];for(let t=0;t{var a=t[i];if(A(a)){let e={};for(let t of s)e[t]=a[t];(O(a.properties)&&a.properties||[i]).forEach(t=>{t!==i&&r.has(t)||r.set(t,e)})}})}}_animateOptions(t,e){let i=e.options,a=function(e,i){if(i){let t=e.options;if(t)return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;e.options=i}}(t,i);return a?(e=this._createAnimations(a,i),i.$shared&&function(e,t){var i=[],a=Object.keys(t);for(let t=0;t{t.options=i},()=>{}),e):[]}_createAnimations(e,i){var a=this._properties,s=[],r=e.$animations||(e.$animations={}),t=Object.keys(i),n=Date.now();let o;for(o=t.length-1;0<=o;--o){var l=t[o];if("$"!==l.charAt(0))if("options"===l)s.push(...this._animateOptions(e,i));else{var h=i[l];let t=r[l];var d=a.get(l);if(t){if(d&&t.active()){t.update(d,h,n);continue}t.cancel()}d&&d.duration?(r[l]=t=new xa(d,e,l,h),s.push(t)):e[l]=h}}return s}update(t,e){var i;if(0!==this._properties.size)return(i=this._createAnimations(t,e)).length?(r.add(this._chart,i),!0):void 0;Object.assign(t,e)}}function _a(t,e){var t=t&&t.options||{},i=t.reverse,a=void 0===t.min?e:0,t=void 0===t.max?e:0;return{start:i?t:a,end:i?a:t}}function ya(t,e){var i=[],a=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=a.length;si[t].axis===e).shift()}function Da(t,i){var a=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(let e of i){let t=e._stacks;if(!t||void 0===t[s]||void 0===t[s][a])return;delete t[s][a],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[a]&&delete t[s]._visualValues[a]}}}let Ca=t=>"reset"===t||"none"===t,Oa=(t,e)=>e?t:Object.assign({},t);class Aa{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){var t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wa(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){var t=this.chart,e=this._cachedMeta,i=this.getDataset(),a=(t,e,i,a)=>"x"===t?e:"r"===t?a:i,s=e.xAxisID=T(i.xAxisID,Pa(t,"x")),r=e.yAxisID=T(i.yAxisID,Pa(t,"y")),i=e.rAxisID=T(i.rAxisID,Pa(t,"r")),t=e.indexAxis,n=e.iAxisID=a(t,s,r,i),a=e.vAxisID=a(t,r,s,i);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(i),e.iScale=this.getScaleForId(n),e.vScale=this.getScaleForId(a)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&Mt(this._data,this),t._stacked&&Da(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(A(e))this._data=function(t){var e=Object.keys(t),i=new Array(e.length);let a,s,r;for(a=0,s=e.length;anull===l[n]||c&&l[n]t||dthis.getContext(i,a,e),l)).$shared&&(d.$shared=o,s[r]=Object.freeze(Oa(d,o))),d)}_resolveAnimations(a,s,r){let t=this.chart,e=this._cachedDataOpts,i="animation-"+s,n=e[i];if(n)return n;let o;if(!1!==t.options.animation){let t=this.chart.config,e=t.datasetAnimationScopeKeys(this._type,s),i=t.getOptionScopes(this.getDataset(),e);o=t.createResolver(i,this.getContext(a,r,s))}a=new va(t,o&&o.animations);return o&&o._cacheable&&(e[i]=Object.freeze(a)),a}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ca(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){var t=this.resolveDataElementOptions(t,e),i=this._sharedOptions,a=this.getSharedOptions(t),i=this.includeOptions(e,a)||a!==i;return this.updateSharedOptions(a,e,t),{sharedOptions:a,includeOptions:i}}updateElement(t,e,i,a){Ca(a)?Object.assign(t,i):this._resolveAnimations(e,a).update(t,i)}updateSharedOptions(t,e,i){t&&!Ca(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,a){t.active=a;var s=this.getStyle(e,a);this._resolveAnimations(e,i,a).update(t,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];var a=i.length,s=e.length,r=Math.min(s,a);r&&this.parse(0,r),a{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(s),n=t;n{a[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),a}}function Ta(t,e,i,a,s){var r=T(a,0),n=Math.min(T(s,t.length),t.length);let o,l,h,d=0;for(i=Math.ceil(i),s&&(i=(o=s-a)/Math.floor(o/i)),h=r;h<0;)d++,h=Math.round(r+d*i);for(l=Math.max(r,0);l"top"===e||"left"===e?t[e]+i:t[e]-i,Ea=(t,e)=>Math.min(e||t,t);function Ra(t,e){var i=[],a=t.length/e,s=t.length;let r=0;for(;rr?r:s,r=n&&s>r?s:r,{min:u(s,u(r,s)),max:u(r,u(s,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(t,e,i){var{beginAtZero:a,grace:s,ticks:r}=this.options,n=r.sampleSize,t=(this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Si(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks(),na)return t}}return Math.max(a,1)}(r,a,s);if(0{var e=t.gc,i=e.length/2;let a;if(y({width:r[t]||0,height:n[t]||0});return{first:w(0),last:w(e-1),widest:w(i),highest:w(M),widths:r,heights:n}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);t=this._startPixel+t*this._length;return mt(this._alignToPixels?Re(this.chart,t,0):t)}getDecimalForPixel(t){t=(t-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:t,max:e}=this;return t<0&&e<0?e:0n+1e-6)))return l}(this,b,f))&&(v=Re(c,x,a),p?_=M=k=P=v:y=w=S=D=v,m.push({tx1:_,ty1:y,tx2:M,ty2:w,x1:k,y1:S,x2:P,y2:D,width:a,color:s,borderDash:r,borderDashOffset:n,tickWidth:o,tickColor:l,tickBorderDash:h,tickBorderDashOffset:d}))}return this._ticksLength=r,this._borderValue=d,m}_computeLabelItems(t){let e=this.axis,i=this.options,{position:o,ticks:l}=i,h=this.isHorizontal(),d=this.ticks,{align:a,crossAlign:c,padding:s,mirror:u}=l,r=Ia(i.grid),n=r+s,g=u?-s:n,f=-L(this.labelRotation),p=[],m,b,x,v,_,y,M,w,k,S,P,D="middle";if("top"===o)_=this.bottom-g,y=this._getXAxisLabelAlignment();else if("bottom"===o)_=this.top+g,y=this._getXAxisLabelAlignment();else if("left"===o){let t=this._getYAxisLabelAlignment(r);y=t.textAlign,v=t.x}else if("right"===o){let t=this._getYAxisLabelAlignment(r);y=t.textAlign,v=t.x}else if("x"===e){if("center"===o)_=(t.top+t.bottom)/2+n;else if(A(o)){let t=Object.keys(o)[0],e=o[t];_=this.chart.scales[t].getPixelForValue(e)+n}y=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===o)v=(t.left+t.right)/2-n;else if(A(o)){let t=Object.keys(o)[0],e=o[t];v=this.chart.scales[t].getPixelForValue(e)}y=this._getYAxisLabelAlignment(r).textAlign}"y"===e&&("start"===a?D="top":"end"===a&&(D="bottom"));var C=this._getLabelSizes();for(m=0,b=d.length;mt.value===e))?i.setContext(this.getContext(t)).lineWidth:0}drawGrid(t){let e=this.options.grid,a=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),s,r;var n=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(e.display)for(s=0,r=i.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:t,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(e){var i=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",s=[];let r,t;for(r=0,t=i.length;r{var e=t.split("."),i=e.pop(),e=[s].concat(e).join("."),t=r[t].split("."),a=t.pop(),t=t.join(".");R.route(e,i,t,a)})),n.descriptors&&R.describe(e,n.descriptors),this.override&&R.override(t.id,t.overrides)),o;throw new Error("class does not have id: "+t)}get(t){return this.items[t]}unregister(t){var e=this.items,t=t.id,i=this.scope;t in e&&delete e[t],i&&t in R[i]&&(delete R[i][t],this.override)&&delete fe[t]}}var M=new class{constructor(){this.controllers=new Va(Aa,"datasets",!0),this.elements=new Va(e,"elements"),this.plugins=new Va(Object,"plugins"),this.scales=new Va(Fa,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(i,t,a){[...t].forEach(t=>{var e=a||this._getRegistryForType(t);a||e.isForType(t)||e===this.plugins&&t.id?this._exec(i,e,t):k(t,t=>{var e=a||this._getRegistryForType(t);this._exec(i,e,t)})})}_exec(t,e,i){var a=K(t);c(i["before"+a],[],i),e[t](i),c(i["after"+a],[],i)}_getRegistryForType(e){for(let t=0;tt.filter(e=>!i.some(t=>e.plugin.id===t.plugin.id));this._notify(a(e,i),t,"stop"),this._notify(a(i,e),t,"start")}}function Wa(t,e){var i=R.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Na(t){if("x"===t||"y"===t||"r"===t)return t}function Ha(e,...t){if(Na(e))return e;for(var i of t){let t=i.axis||("top"===(i=i.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||1{var e=o[t];if(!A(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);let i=Ha(t,e,function(e,t){if(t.data&&t.data.datasets){t=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(t.length)return ja(e,"x",t[0])||ja(e,"y",t[0])}return{}}(t,n),R.scales[e.type]),a=i===l?"_index_":"_value_",s=r.scales||{};h[t]=$(Object.create(null),[{axis:i},e,s[i],s[a]])}),n.data.datasets.forEach(a=>{let t=a.type||n.type,s=a.indexAxis||Wa(t,e),r=(fe[t]||{}).scales||{};Object.keys(r).forEach(t=>{var e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),i=a[e+"AxisID"]||e;h[i]=h[i]||Object.create(null),$(h[i],[{axis:e},o[i],r[t]])})}),Object.keys(h).forEach(t=>{t=h[t];$(t,[R.scales[t.type],R.scale])}),h}(t,e)}function $a(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let Ua=new Map,Xa=new Set;function qa(t,e){let i=Ua.get(t);return i||(i=e(),Ua.set(t,i),Xa.add(i)),i}let Ka=(t,e,i)=>{e=f(e,i);void 0!==e&&t.add(e)};class Ga{constructor(t){this._config=((t=(t=t)||{}).data=$a(t.data),Ya(t),t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$a(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),Ya(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qa(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return qa(t+".transition."+e,()=>[[`datasets.${t}.transitions.`+e,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return qa(t+"-"+e,()=>[[`datasets.${t}.elements.`+e,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){let e=t.id;return qa(this.type+"-plugin-"+e,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){var i=this._scopeCache;let a=i.get(t);return a&&!e||(a=new Map,i.set(t,a)),a}getOptionScopes(e,t,i){let{options:a,type:s}=this,r=this._cachedScopes(e,i),n=r.get(t);if(n)return n;let o=new Set;t.forEach(t=>{e&&(o.add(e),t.forEach(t=>Ka(o,e,t))),t.forEach(t=>Ka(o,a,t)),t.forEach(t=>Ka(o,fe[s]||{},t)),t.forEach(t=>Ka(o,R,t)),t.forEach(t=>Ka(o,pe,t))});i=Array.from(o);return 0===i.length&&i.push(Object.create(null)),Xa.has(t)&&r.set(t,i),i}chartOptionScopes(){var{options:t,type:e}=this;return[t,fe[e]||{},R.datasets[e]||{},{type:e},R,pe]}resolveNamedOptions(t,e,i,a=[""]){var s={$shared:!0},{resolver:a,subPrefixes:r}=Za(this._resolverCache,t,a);let n=a;!function(a,t){var s,{isScriptable:r,isIndexable:n}=Ue(a);for(s of t){let t=r(s),e=n(s),i=(e||t)&&a[s];if(t&&(g(i)||Ja(i))||e&&O(i))return 1}}(a,e)||(s.$shared=!1,n=$e(a,i=g(i)?i():i,this.createResolver(t,i,r)));for(let t of e)s[t]=n[t];return s}createResolver(t,e,i=[""],a){t=Za(this._resolverCache,t,i).resolver;return A(e)?$e(t,e,void 0,a):t}}function Za(t,e,i){let a=t.get(e);a||(a=new Map,t.set(e,a));t=i.join();let s=a.get(t);return s||(s={resolver:Ye(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},a.set(t,s)),s}let Ja=i=>A(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||g(i[e]),!1),Qa=["top","bottom","left","right","chartArea"];function ts(t,e){return"top"===t||"bottom"===t||-1===Qa.indexOf(t)&&"x"===e}function es(i,a){return function(t,e){return t[i]===e[i]?t[a]-e[a]:t[i]-e[i]}}function is(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),c(i&&i.onComplete,[t],e)}function as(t){var e=t.chart,i=e.options.animation;c(i&&i.onProgress,[t],e)}function ss(t){return xe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t=t&&t.canvas?t.canvas:t}let rs={},ns=t=>{let e=ss(t);return Object.values(rs).filter(t=>t.canvas===e).pop()};class i{static defaults=R;static instances=rs;static overrides=fe;static registry=M;static version="4.3.3";static getChart=ns;static register(...t){M.add(...t),os()}static unregister(...t){M.remove(...t),os()}constructor(t,e){var e=this.config=new Ga(e),t=ss(t),i=ns(t);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");var i=e.createResolver(e.chartOptionScopes(),this.getContext()),e=(this.platform=new(e.platform||fa(t)),this.platform.updateConfig(e),this.platform.acquireContext(t,i.aspectRatio)),t=e&&e.canvas,a=t&&t.height,s=t&&t.width;this.id=F(),this.ctx=e,this.canvas=t,this.width=s,this.height=a,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ba,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Pt(t=>this.update(t),i.resizeDelay||0),this._dataChanges=[],rs[this.id]=this,e&&t?(r.listen(this,"complete",is),r.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:a,_aspectRatio:s}=this;return P(t)?e&&s?s:a?i/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return M}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ce(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ie(this.canvas,this.ctx),this}stop(){return r.stop(this),this}resize(t,e){r.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){var i=this.options,a=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(a,t,e,s),t=i.devicePixelRatio||this.platform.getDevicePixelRatio(),e=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ce(this,t,!0)&&(this.notifyPlugins("resize",{size:a}),c(i.onResize,[this,a],this),this.attached)&&this._doResize(e)&&this.render()}ensureScalesHaveIDs(){k(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let n=this.options,a=n.scales,o=this.scales,l=Object.keys(o).reduce((t,e)=>(t[e]=!1,t),{}),t=[];k(t=a?t.concat(Object.keys(a).map(t=>{var e=a[t],t=Ha(t,e),i="r"===t,t="x"===t;return{options:e,dposition:i?"chartArea":t?"bottom":"left",dtype:i?"radialLinear":t?"category":"linear"}})):t,t=>{var e=t.options,i=e.id,a=Ha(i,e),s=T(e.type,t.dtype);void 0!==e.position&&ts(e.position,a)===ts(t.dposition)||(e.position=t.dposition),l[i]=!0;let r=null;i in o&&o[i].type===s?r=o[i]:(r=new(M.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),o[r.id]=r),r.init(e,n)}),k(l,(t,e)=>{t||delete o[e]}),k(o,t=>{s.configure(this,t,t.options),s.addBox(this,t)})}_updateMetasets(){var t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),ei.length&&delete this._stacks,t.forEach((e,t)=>{0===i.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(t)})}buildOrUpdateControllers(){let s=[],e=this.data.datasets,r,t;for(this._removeUnreferencedMetasets(),r=0,t=e.length;r{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config,i=(e.update(),this._options=e.createResolver(e.chartOptionScopes(),this.getContext())),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let i=0,t=this.data.datasets.length;i{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(es("z","_idx"));var{_active:t,_lastEvent:n}=this;n?this._eventHandler(n,!0):t.length&&this._updateHoverStyles(t,t,!0),this.render()}}_updateScales(){k(this.scales,t=>{s.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Z(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var e,i,a,s,r=this._hiddenIndices;for({method:e,start:i,count:a}of this._getUniformDataChanges()||[]){n=void 0;o=void 0;l=void 0;s=void 0;h=void 0;var n=r;var o=i;var l="_removeElements"===e?-a:a;let t=Object.keys(n);for(var h of t){let t=+h;t>=o&&(s=n[h],delete n[h],0o)&&(n[t+l]=s)}}}_getUniformDataChanges(){let t=this._dataChanges;if(t&&t.length){this._dataChanges=[];var e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),a=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}}_updateLayout(i){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){s.update(this,this.width,this.height,i);let t=this.chartArea,e=t.width<=0||t.height<=0;this._layers=[],k(this.boxes,t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}}_updateDatasets(i){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let t=0,e=this.data.datasets.length;tt&&t._dataset===e).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(a)),a}getContext(){return this.$context||(this.$context=Pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];return!!e&&("boolean"==typeof(t=this.getDatasetMeta(t)).hidden?!t.hidden:!e.hidden)}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,t,i){let a=i?"show":"hide",s=this.getDatasetMeta(e),r=s.controller._resolveAnimations(void 0,a);G(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(s,{visible:i}),this.update(t=>t.datasetIndex===e?a:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),r.remove(this),t=0,e=this.data.datasets.length;t{a.addEventListener(this,t,e),i[t]=e},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};k(this.options.events,t=>e(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let i=this._responsiveListeners,a=this.platform,t=(t,e)=>{a.addEventListener(this,t,e),i[t]=e},e=(t,e)=>{i[t]&&(a.removeEventListener(this,t,e),delete i[t])},s=(t,e)=>{this.canvas&&this.resize(t,e)},r,n=()=>{e("attach",n),this.attached=!0,this.resize(),t("resize",s),t("detach",r)};r=()=>{this.attached=!1,e("resize",s),this._stop(),this._resize(0,0),t("attach",n)},(a.isAttached(this.canvas)?n:r)()}unbindEvents(){k(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},k(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){var a=i?"set":"remove";let s,r,n;for("dataset"===t&&this.getDatasetMeta(e[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),r=0,n=e.length;r{var i=this.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("No dataset found at index "+t)});W(t,e)||(this._active=t,this._lastEvent=null,this._updateHoverStyles(t,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(t,e,i){var a=this.options.hover,s=(t,i)=>t.filter(e=>!i.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),r=s(e,t),i=i?t:s(t,e);r.length&&this.updateHoverStyle(r,a.mode,!1),i.length&&a.mode&&this.updateHoverStyle(i,a.mode,!0)}_eventHandler(e,t){var i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,a))return t=this._handleEvent(e,t,i.inChartArea),i.cancelable=!1,this.notifyPlugins("afterEvent",i,a),(t||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:a=[],options:s}=this,r=e,n=this._getActiveElements(t,a,i,r),o=J(t),l=(h=t,d=this._lastEvent,i&&"mouseout"!==h.type?o?d:h:null);i&&(this._lastEvent=null,c(s.onHover,[t,n,this],this),o)&&c(s.onClick,[t,n,this],this);var h,d=!W(n,a);return(d||e)&&(this._active=n,this._updateHoverStyles(n,a,e)),this._lastEvent=l,d}_getActiveElements(t,e,i,a){return"mouseout"===t.type?[]:i?(i=this.options.hover,this.getElementsAtEventForMode(t,i.mode,i,a)):e}}function os(){k(i.instances,t=>t._plugins.invalidate())}function ls(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var hs={_date:class $r{static override(t){Object.assign($r.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ls()}parse(){return ls()}format(){return ls()}add(){return ls()}diff(){return ls()}startOf(){return ls()}endOf(){return ls()}}};function ds(i,a,s,r){if(O(i)){var n=i,o=a,l=s,h=r,d=l.parse(n[0],h),n=l.parse(n[1],h),h=Math.min(d,n),c=Math.max(d,n);let t=h,e=c;Math.abs(h)>Math.abs(c)&&(t=c,e=h),o[l.axis]=e,o._custom={barStart:t,barEnd:e,start:d,end:n,min:h,max:c}}else a[s.axis]=s.parse(i,r);return a}function cs(t,e,i,a){var s=t.iScale,r=t.vScale,n=s.getLabels(),o=s===r,l=[];let h,d,c,u;for(d=(h=i)+a;h"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(r){var t=r.data;if(t.labels.length&&t.datasets.length){let{pointStyle:a,color:s}=r.legend.options.labels;return t.labels.map((t,e)=>{var i=r.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:s,lineWidth:i.borderWidth,pointStyle:a,hidden:!r.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(a,s){let r=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=r;else{let t,e,i=t=>+r[t];if(A(r[a])){let{key:e="value"}=this._parsing;i=t=>+f(r[t],e)}for(e=(t=a)+s;tpt(t,a,s,!0)?1:Math.max(e,e*f,i,i*f),o=(t,e,i)=>pt(t,a,s,!0)?-1:Math.min(e,e*f,i,i*f),l=n(0,t,i),h=n(D,e,r),d=o(S,t,i),c=o(S+D,e,r);p=(l-d)/2,m=(h-c)/2,b=-(l+d)/2,x=-(h+c)/2}return{ratioX:p,ratioY:m,offsetX:b,offsetY:x}}(l,o,r),l=(e.width-s)/l,e=(e.height-s)/o,s=Math.max(Math.min(l,e)/2,0),o=B(this.options.radius,s),l=(o-Math.max(o*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=h*o,this.offsetY=d*o,i.total=this.calculateTotal(),this.outerRadius=o-l*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-l*n,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){var i=this.options,a=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*s/v)}updateElements(a,t,e,s){let r="reset"===s,i=this.chart,n=i.chartArea,o=i.options.animation,l=(n.left+n.right)/2,h=(n.top+n.bottom)/2,d=r&&o.animateScale,c=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:g,includeOptions:f}=this._getSharedOptions(t,s),p,m=this._getRotation();for(p=0;p{var i=r.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:s,lineWidth:i.borderWidth,pointStyle:a,hidden:!r.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,a=i.data.labels||[],e=ce(e._parsed[t].r,i.options.locale);return{label:a[t]||"",value:e}}parseObjectData(t,e,i,a){return ii.bind(this)(t,e,i,a)}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,e)=>{var i=this.getParsed(e).r;!isNaN(i)&&this.chart.getDataVisibility(e)&&(ia.max)&&(a.max=i)}),a}_updateRadius(){var t=this.chart,e=t.chartArea,i=t.options,e=Math.min(e.right-e.left,e.bottom-e.top),e=Math.max(e/2,0),i=(e-Math.max(i.cutoutPercentage?e/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=e-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(s,t,e,r){var n="reset"===r,o=this.chart,l=o.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,c=h.yCenter,u=h.getIndexAngle(0)-.5*S;let g,f=u;var p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?L(this.resolveDataElementOptions(t,e).angle||i):0}}Oe=Object.freeze({__proto__:null,BarController:class extends Aa{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,a){return cs(t,e,i,a)}parseArrayData(t,e,i,a){return cs(t,e,i,a)}parseObjectData(t,e,i,a){var{iScale:s,vScale:r}=t,{xAxisKey:t="x",yAxisKey:n="y"}=this._parsing,o="x"===s.axis?t:n,l="x"===r.axis?t:n,h=[];let d,c,u,g;for(c=(d=i)+a;dt.controller.options.grouped),s=t.options.stacked,r=[];for(let t of a)if((void 0===i||!(t=>{var e=t.controller.getParsed(i),e=e&&e[t.vScale.axis];if(P(e)||isNaN(e))return!0})(t))&&((!1===s||-1===r.indexOf(t.stack)||void 0===s&&void 0===t.stack)&&r.push(t.stack),t.index===e))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){t=this._getStacks(t,i),i=void 0!==e?t.indexOf(e):-1;return-1===i?t.length-1:i}_getRuler(){var t=this.options,e=this._cachedMeta,i=e.iScale,a=[];let s,r;for(s=0,r=e.data.length;st-e))}return a._cache.$bar}(e);let a,s,r,n,o=e._length;var l=()=>{32767!==r&&-32768!==r&&(G(n)&&(o=Math.min(o,Math.abs(r-n)||o)),n=r)};for(a=0,s=i.length;a=m?1:-1))*o),g===l&&(x-=u/2);let t=s.getPixelForDecimal(0),e=s.getPixelForDecimal(1),i=Math.min(t,e),a=Math.max(t,e);x=Math.max(Math.min(x,a),i),c=x+u,r&&!d&&(h._stacks[s.axis]._visualValues[n]=s.getValueForPixel(c)-s.getValueForPixel(x))}if(x===s.getPixelForValue(l)){let t=_(u)*s.getLineWidthForValue(l)/2;x+=t,u-=t}return{size:u,base:x,head:c,center:c+u/2}}_calculateBarIndexPixels(a,s){let t=s.scale,r=this.options,n=r.skipNull,o=T(r.maxBarThickness,1/0),l,h;if(s.grouped){let t=n?this._getStackCount(a):s.stackCount,e=("flex"===r.barThickness?function(t,e,i,a){var s=e.pixels,r=s[t];let n=0=x?e.skip=!0:(M=P((y=this.getParsed(i))[f]),w=e[g]=o.getPixelForValue(y[g],i),k=e[f]=n||M?l.getBasePixel():l.getPixelForValue(h?this.applyStack(l,y,h):y[f],i),e.skip=isNaN(w)||isNaN(k)||M,e.stop=0m,p&&(e.parsed=y,e.raw=d.data[i]),u&&(e.options=c||this.resolveDataElementOptions(i,t.active?"active":r)),b||this.updateElement(t,i,e,r),_=y)}}getMaxOverflow(){var t,e=this._cachedMeta,i=e.dataset,i=i.options&&i.options.borderWidth||0,e=e.data||[];return e.length?(t=e[0].size(this.resolveDataElementOptions(0)),e=e[e.length-1].size(this.resolveDataElementOptions(e.length-1)),Math.max(i,t,e)/2):i}draw(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends ps{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:ms,RadarController:class extends Aa{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){var e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,a){return ii.bind(this)(t,e,i,a)}update(e){let t=this._cachedMeta,i=t.dataset,a=t.data||[],s=t.iScale.getLabels();if(i.points=a,"resize"!==e){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);var r={_loop:!0,_fullLoop:s.length===a.length,options:t};this.updateElement(i,void 0,r,e)}this.updateElements(a,0,a.length,e)}updateElements(o,t,e,l){var h=this._cachedMeta.rScale,d="reset"===l;for(let n=t;nv,x&&(i.parsed=e,i.raw=g.data[n]),p&&(i.options=f||this.resolveDataElementOptions(n,t.active?"active":l)),_||this.updateElement(t,n,i,l),y=e}this.updateSharedOptions(f,l,i)}getMaxOverflow(){var t,e,i=this._cachedMeta,a=i.data||[];if(this.options.showLine)return i=(i=i.dataset).options&&i.options.borderWidth||0,a.length?(t=a[0].size(this.resolveDataElementOptions(0)),e=a[a.length-1].size(this.resolveDataElementOptions(a.length-1)),Math.max(i,t,e)/2):i;{let e=0;for(let t=a.length-1;0<=t;--t)e=Math.max(e,a[t].size(this.resolveDataElementOptions(t))/2);return 0{var e=(i-Math.min(s,t))*a/2;return C(t,0,Math.min(s,e))};return{outerStart:n(t.outerStart),outerEnd:n(t.outerEnd),innerStart:C(t.innerStart,0,r),innerEnd:C(t.innerEnd,0,r)}}(t,h,c,l-g),b=c-d,x=c-f,v=g+d/b,_=l-f/x,y=h+p,M=h+m,w=g+p/y,k=l-m/M;if(s.beginPath(),r){let t=(v+_)/2;if(s.arc(n,o,c,v,t),s.arc(n,o,c,t,_),0(n+(h?o-t:t))%r,v=()=>{g!==f&&(a.lineTo(m,f),a.lineTo(m,g),a.lineTo(m,p))};for(l&&(c=s[x(0)],a.moveTo(c.x,c.y)),d=0;d<=o;++d)if(!(c=s[x(d)]).skip){let t=c.x,e=c.y,i=0|t;i===u?(ef&&(f=e),m=(b*m+t)/++b):(v(),a.lineTo(t,e),u=i,b=0,g=f=e),p=e}v()}function ks(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Ms:ws}let Ss="function"==typeof Path2D;class Ps extends e{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){var i,a=this.options;!a.tension&&"monotone"!==a.cubicInterpolationMode||a.stepped||this._pointsUpdated||(i=a.spanGaps?this._loop:this._fullLoop,hi(this._points,a,t,i,e),this._pointsUpdated=!0)}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ri(this,this.options.segment))}first(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(r,n){var o=this.options,l=r[n],h=this.points,d=Ei(this,{property:n,start:l,end:l});if(d.length){var c,u=[],g=o.stepped?pi:o.tension||"monotone"===o.cubicInterpolationMode?mi:fi;let s,t;for(s=0,t=d.length;s"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var{angle:t,distance:e}=ut(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:i,endAngle:a,innerRadius:s,outerRadius:r,circumference:n}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=(this.options.spacing+this.options.borderWidth)/2,n=T(n,a-i)>=v||pt(t,i,a),t=d(e,s+o,r+o);return n&&t}getCenterPoint(t){var{x:t,y:e,startAngle:i,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:n,spacing:o}=this.options,i=(i+a)/2,a=(s+r+o+n)/2;return{x:t+Math.cos(i)*a,y:e+Math.sin(i)*a}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){var{options:i,circumference:a}=this,s=(i.offset||0)/4,r=(i.spacing||0)/2,n=i.circular;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=a>v?Math.floor(a/v):0,!(0===a||this.innerRadius<0||this.outerRadius<0)){e.save();var o=(this.startAngle+this.endAngle)/2,o=(e.translate(Math.cos(o)*s,Math.sin(o)*s),s*(1-Math.sin(Math.min(S,a||0))));e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor;{var l=e;s=this;a=o;i=r;var h=n;var{fullCircles:d,startAngle:c,circumference:u}=s;let t=s.endAngle;if(d){xs(l,s,a,i,t,h);for(let t=0;ta=e?a:t,o=t=>s=i?s:t;if(t){let t=_(a),e=_(s);t<0&&e<0?o(0):0g&&(M=rt(y*M/g/u)*u),P(o)||(x=Math.pow(10,o),M=Math.ceil(M*x)/x),_="ticks"===a?(v=Math.floor(e/M)*M,Math.ceil(f/M)*M):(v=e,f),p&&m&&s&<((n-r)/s,M/1e3)?(y=Math.round(Math.min((n-r)/M,h)),M=(n-r)/y,v=r,_=n):b?(v=p?r:v,_=m?n:_,y=l-1,M=(_-v)/y):y=st(y=(_-v)/M,Math.round(y),M/1e3)?Math.round(y):Math.ceil(y);g=Math.max(ct(M),ct(v));x=Math.pow(10,P(o)?g:o),v=Math.round(v*x)/x,_=Math.round(_*x)/x;let w=0;for(p&&(c&&v!==r?(i.push({value:r}),vn)break;i.push({value:t})}return m&&c&&_!==n?i.length&&st(i[i.length-1].value,n,Is(n,d,t))?i[i.length-1].value=n:i.push({value:n}):m&&_!==n||i.push({value:_}),i}({maxTicks:Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&ht(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){var t=this.ticks;let e=this.min,i=this.max;super.configure(),this.options.offset&&t.length&&(t=(i-e)/Math.max(t.length-1,1)/2,e-=t,i+=t),this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ce(t,this.chart.options.locale,this.options.ticks.format)}}class Fs extends zs{static id="linear";static defaults={ticks:{callback:ge.formatters.numeric}};determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?t:0,this.max=p(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){var t=this.isHorizontal(),e=t?this.width:this.height,i=L(this.options.ticks.minRotation),t=(t?Math.sin(i):Math.cos(i))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/t))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}let Vs=t=>Math.floor(o(t)),Bs=(t,e)=>Math.pow(10,Vs(t)+e);function Ws(t){return 1==t/Math.pow(10,Vs(t))}function Ns(t,e,i){i=Math.pow(10,i),t=Math.floor(t/i);return Math.ceil(e/i)-t}class Hs extends Fa{static id="logarithmic";static defaults={ticks:{callback:ge.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){t=zs.prototype.parse.apply(this,[t,e]);if(0!==t)return p(t)&&0a=e?a:t,r=t=>s=i?s:t;a===s&&(a<=0?(t(1),r(10)):(t(Bs(a,-1)),r(Bs(s,1)))),a<=0&&t(Bs(s,-1)),s<=0&&r(Bs(a,1)),this.min=a,this.max=s}buildTicks(){var t=this.options,e=function(t,{min:e,max:i}){e=u(t.min,e);var a=[],s=Vs(e);let r=function(t,e){let i=Vs(e-t);for(;10r?Math.pow(10,s):0,s=Math.round((e-l)*n)/n,h=Math.floor((e-l)/o/10)*o*10;let d=Math.floor((s-h)/Math.pow(10,r)),c=u(t.min,Math.round((l+h+d*Math.pow(10,r))*n)/n);for(;ct,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){var t=this._padding=I(js(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!1);this.min=p(t)&&!isNaN(t)?t:0,this.max=p(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/js(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{t=c(this.options.pointLabels.callback,[t,e],this);return t||0===t?t:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){var t=this.options;t.display&&t.pointLabels.display?$s(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,a){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,a))}getIndexAngle(t){return x(t*(v/(this._pointLabels.length||1))+L(this.options.startAngle||0))}getDistanceFromCenterForValue(t){var e;return P(t)?NaN:(e=this.drawingArea/(this.max-this.min),this.options.reverse?(this.max-t)*e:(t-this.min)*e)}getValueForDistanceFromCenter(t){return P(t)?NaN:(t=t/(this.drawingArea/(this.max-this.min)),this.options.reverse?this.max-t:this.min+t)}getPointLabelContext(t){var e=this._pointLabels||[];if(0<=t&&t0!==t)?(m.beginPath(),je(m,{x:b,y:f,w:y,h:v,radius:t}),m.fill()):m.fillRect(b,f,y,v)}var x=z(p.font),{x:M,y:_,textAlign:m}=t;He(u,i._pointLabels[e],M,_+x.lineHeight/2,x,{color:p.color,textAlign:m,textBaseline:"middle"})}}}if(l.display&&this.ticks.forEach((t,e)=>{var i,a,s,r,n,o;0!==e&&(c=this.getDistanceFromCenterForValue(t.value),t=this.getContext(e),e=l.setContext(t),t=h.setContext(t),i=this,e=e,a=c,s=d,t=t,r=i.ctx,n=e.circular,{color:e,lineWidth:o}=e,!n&&!s||!e||!o||a<0||(r.save(),r.strokeStyle=e,r.lineWidth=o,r.setLineDash(t.dash),r.lineDashOffset=t.dashOffset,r.beginPath(),Us(i,a,n,s),r.closePath(),r.stroke(),r.restore()))}),r.display){for(a.save(),n=d-1;0<=n;n--){let t=r.setContext(this.getPointLabelContext(n)),{color:e,lineWidth:i}=t;i&&e&&(a.lineWidth=i,a.strokeStyle=e,a.setLineDash(t.borderDash),a.lineDashOffset=t.borderDashOffset,c=this.getDistanceFromCenterForValue(s.ticks.reverse?this.min:this.max),o=this.getPointPosition(n,c),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(o.x,o.y),a.stroke())}a.restore()}}drawBorder(){}drawLabels(){let n=this.ctx,o=this.options,l=o.ticks;if(l.display){var t=this.getIndexAngle(0);let s,r;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((e,t)=>{if(0!==t||o.reverse){var i=l.setContext(this.getContext(t)),a=z(i.font);if(s=this.getDistanceFromCenterForValue(this.ticks[t].value),i.showLabelBackdrop){n.font=a.string,r=n.measureText(e.label).width,n.fillStyle=i.backdropColor;let t=I(i.backdropPadding);n.fillRect(-r/2-t.left,-s-a.size/2-t.top,r+t.width,a.size+t.height)}He(n,e.label,0,-s,a,{color:i.color,strokeColor:i.textStrokeColor,strokeWidth:i.textStrokeWidth})}}),n.restore()}}drawTitle(){}}let qs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},h=Object.keys(qs);function Ks(t,e){return t-e}function Gs(t,e){if(P(e))return null;var i=t._adapter,{parser:t,round:a,isoWeekday:s}=t._parseOpts;let r=e;return null===(r=p(r="function"==typeof t?t(r):r)?r:"string"==typeof t?i.parse(r,t):i.parse(r))?null:+(r=a?"week"!==a||!ot(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s):r)}function Zs(t,a,s,r){let e=h.length;for(let i=h.indexOf(t);i=h.indexOf(t);e--){let t=h[e];if(qs[t].common&&i._adapter.diff(r,s,t)>=a-1)return t}return h[t?h.indexOf(t):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(i){for(let t=h.indexOf(i)+1,e=h.length;t+t.value))}initOffsets(t=[]){let e,i,a=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),a=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);t=t.length<3?.5:.25;a=C(a,0,t),s=C(s,0,t),this._offsets={start:a,end:s,factor:1/(a+1+s)}}_generate(){var t=this._adapter,e=this.min,i=this.max,a=this.options,s=a.time,r=s.unit||Zs(s.minUnit,e,i,this._getLabelCapacity(e)),n=T(a.ticks.stepSize,1),s="week"===r&&s.isoWeekday,o=ot(s)||!0===s,l={};let h,d,c=e;if(o&&(c=+t.startOf(c,"isoWeek",s)),c=+t.startOf(c,o?"day":r),t.diff(i,e,r)>1e5*n)throw new Error(e+" and "+i+" are too far apart with stepSize of "+n+" "+r);var u="data"===a.ticks.source&&this.getDataTimestamps();for(h=c,d=0;h+t)}getLabelForValue(t){var e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){var i=this.options.time.displayFormats,a=this._unit,e=e||i[a];return this._adapter.format(t,e)}_tickFormatFunction(t,e,i,a){var s,r=this.options,n=r.ticks.callback;return n?c(n,[t,e,i],this):(n=r.time.displayFormats,r=this._unit,s=this._majorUnit,r=r&&n[r],n=s&&n[s],i=i[e],e=s&&n&&i&&i.major,this._adapter.format(t,a||(e?n:r)))}generateTickLabels(t){let e,i,a;for(e=0,i=t.length;e=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=m(t,"pos",e)),{pos:a,time:r}=t[o],{pos:s,time:n}=t[l]):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=m(t,"time",e)),{time:a,pos:r}=t[o],{time:s,pos:n}=t[l]);i=s-a;return i?r+(n-r)*(e-a)/i:r}let ir=Object.freeze({__proto__:null,CategoryScale:class extends Fa{static id="category";static defaults={ticks:{callback:Rs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){var e=this._addedLabels;if(e.length){let t=this.getLabels();for(var{index:i,label:a}of e)t[i]===a&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){var i,a,s,r,n,o,l;return P(t)||(i=this.getLabels(),r=e=isFinite(e)&&i[e]===t?e:(a=i,s=T(e,t=t),r=this._addedLabels,-1===(l=a.indexOf(t))?(o=s,r=r,"string"==typeof(n=t)?(o=a.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o):l!==a.lastIndexOf(t)?s:l),n=i.length-1,null===r)?null:C(Math.round(r),0,n)}determineDataLimits(){var{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:a}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(a=this.getLabels().length-1)),this.min=i,this.max=a}buildTicks(){var e=this.min,i=this.max,t=this.options.offset,a=[];let s=this.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),this._valueRange=Math.max(s.length-(t?0:1),1),this._startValue=this.min-(t?.5:0);for(let t=e;t<=i;t++)a.push({value:t});return a}getLabelForValue(t){return Rs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return null===(t="number"!=typeof t?this.parse(t):t)?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Fs,LogarithmicScale:Hs,RadialLinearScale:Xs,TimeScale:tr,TimeSeriesScale:class extends tr{static id="timeseries";static defaults=tr.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=er(e,this.min),this._tableRange=er(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){var{min:e,max:i}=this,a=[],s=[];let r,n,o,l,h;for(r=0,n=t.length;r=e&&l<=i&&a.push(l);if(a.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,n=a.length;rt-e)}_getTimestampsForTable(){var t,e,i=this._cache.all||[];return i.length||(t=this.getDataTimestamps(),e=this.getLabelTimestamps(),i=t.length&&e.length?this.normalize(t.concat(e)):t.length?t:e,i=this._cache.all=i),i}getDecimalForValue(t){return(er(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return er(this._table,t*this._tableRange+this._minPos,!0)}}}),ar=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],sr=ar.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function rr(t){return ar[t%ar.length]}function nr(t){return sr[t%sr.length]}function or(r){let n=0;return(t,e)=>{var i,a,s,e=r.getDatasetMeta(e).controller;e instanceof ps?n=(a=t,s=n,a.backgroundColor=a.data.map(()=>rr(s++)),s):e instanceof ms?n=(a=t,i=n,a.backgroundColor=a.data.map(()=>nr(i++)),i):e&&(n=(e=t,t=n,e.borderColor=rr(t),e.backgroundColor=nr(t),++t))}}function lr(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return 1}var hr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){var a,s,r;i.enabled&&({data:{datasets:a},options:s}=t.config,r=s.elements,!i.forceOverride&&(lr(a)||s&&(s.borderColor||s.backgroundColor)||r&&lr(r))||(i=or(t),a.forEach(i)))}};function dr(t){var e;t._decimated&&(e=t._data,delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e}))}function cr(t){t.data.datasets.forEach(t=>{dr(t)})}var ur={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(l,t,M)=>{if(M.enabled){let o=l.width;l.data.datasets.forEach((e,t)=>{var{_data:i,indexAxis:a}=e,h=l.getDatasetMeta(t),s=i||e.data;if("y"!==ki([a,l.options.indexAxis])&&h.controller.supportsDecimation){t=l.scales[h.xAxisID];if(("linear"===t.type||"time"===t.type)&&!l.options.parsing){var{start:r,count:n}=function(t){var e=t.length;let i,a=0;var s=h.iScale,{min:r,max:n,minDefined:o,maxDefined:l}=s.getUserBounds();return o&&(a=C(m(t,s.axis,r).lo,0,e-1)),i=l?C(m(t,s.axis,n).hi+1,a,e)-a:e-a,{start:a,count:i}}(s);if(n<=(M.threshold||4*o))dr(e);else{let t;switch(P(i)&&(e._data=s,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),M.algorithm){case"lttb":t=function(n,o,l,t){var e=M.samples||t;if(l<=e)return n.slice(o,o+l);var h=[],d=(l-2)/(e-2);let c=0,i=o+l-1,u,g,f,p,m,b=o;for(h[c++]=n[b],u=0;uf&&(f=p,g=n[t],m=t);h[c++]=g,b=m}return h[c++]=n[i],h}(s,r,n,o);break;case"min-max":t=function(a,t,e,i){let s,r,n,o,l,h,d,c,u,g,f=0,p=0;var m=[],b=a[t].x,x=a[t+e-1].x-b;for(s=t;sg&&(g=o,d=s),f=(p*f+r.x)/++p;else{let i=s-1;if(!P(h)&&!P(d)){let t=Math.min(h,d),e=Math.max(h,d);t!==c&&t!==i&&m.push({...a[t],x:f}),e!==c&&e!==i&&m.push({...a[e],x:f})}0{e=fr(t,e,s);t=s[t],e=s[e];null!==a?(r.push({x:t.x,y:a}),r.push({x:e.x,y:a})):null!==i&&(r.push({x:i,y:t.y}),r.push({x:i,y:e.y}))}),r}(t)).length?new Ps({points:i,options:{tension:0},_loop:a,_fullLoop:a}):null}function br(t){return t&&!1!==t.fill}function xr(e,i,a){var s=[];for(let t=0;t{let{boxHeight:i=e,boxWidth:a=e}=t;return t.usePointStyle&&(i=Math.min(i,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:i,itemHeight:Math.max(e,i)}};class Dr extends e{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let i=this.options.labels||{},t=c(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(t=>i.filter(t,this.chart.data))),i.sort&&(t=t.sort((t,e)=>i.sort(t,e,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){var{options:i,ctx:a}=this;if(i.display){var s=i.labels,r=z(s.font),n=r.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Pr(s,n);let t,e;a.font=r.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(o,n,s,l)+10):(e=this.maxHeight,t=this._fitCols(o,r,s,l)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(t,i,a,s){let{ctx:r,maxWidth:n,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],d=s+o,c=t,u=(r.textAlign="left",r.textBaseline="middle",-1),g=-d;return this.legendItems.forEach((t,e)=>{t=a+i/2+r.measureText(t.text).width;(0===e||h[h.length-1]+t+2*o>n)&&(c+=d,h[h.length-(0{n=l,i=o,a=d,s=t,r=h;var i,a,s,r,{itemWidth:t,itemHeight:n}={itemWidth:function(t,e,i){let a=s.text;return a&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width}(n,i,a),itemHeight:function(t){let e=r;return e="string"!=typeof s.text?Cr(s,t):e}(i.lineHeight)};0f&&(p+=m+c,g.push({width:m,height:b}),x+=m+c,v++,m=b=0),u[e]={left:x,top:b,col:v,width:t,height:n},m=Math.max(m,t),b+=n+c}),p+=m,g.push({width:m,height:b}),p}adjustHitBoxes(){if(this.options.display){var i=this._computeTitleHeight(),{legendHitBoxes:a,options:{align:s,labels:{padding:r},rtl:t}}=this,n=Di(t,this.left,this.width);if(this.isHorizontal()){let t=0,e=E(s,this.left+r,this.right-this.lineWidths[t]);for(var o of a)t!==o.row&&(t=o.row,e=E(s,this.left+r,this.right-this.lineWidths[t])),o.top+=this.top+i+r,o.left=n.leftForLtr(n.x(e),o.width),e+=o.width+r}else{let t=0,e=E(s,this.top+i+r,this.bottom-this.columnSizes[t].height);for(var l of a)l.col!==t&&(t=l.col,e=E(s,this.top+i+r,this.bottom-this.columnSizes[t].height)),l.top=e,l.left+=this.left+r,l.left=n.leftForLtr(n.x(l.left),l.width),e+=l.height+r}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var t;this.options.display&&(Ve(t=this.ctx,this),this._draw(),Be(t))}_draw(){let{options:h,columnSizes:d,lineWidths:c,ctx:u}=this,{align:g,labels:f}=h,p=R.color,m=Di(h.rtl,this.left,this.width),b=z(f.font),x=f.padding,v=b.size,_=v/2,y,{boxWidth:M,boxHeight:w,itemHeight:k}=(this.drawTitle(),u.textAlign=m.textAlign("left"),u.textBaseline="middle",u.lineWidth=.5,u.font=b.string,Pr(f,v)),S=this.isHorizontal(),P=this._computeTitleHeight(),D=(y=S?{x:E(g,this.left+x,this.right-c[0]),y:this.top+x+P,line:0}:{x:this.left+x,y:E(g,this.top+P+x,this.bottom-d[0].height),line:0},Ci(this.ctx,h.textDirection),k+x);this.legendItems.forEach((e,a)=>{u.strokeStyle=e.fontColor,u.fillStyle=e.fontColor;var t=u.measureText(e.text).width,i=m.textAlign(e.textAlign||(e.textAlign=f.textAlign)),t=M+_+t;let s=y.x,r=y.y;m.setWidth(this.width),S?0this.right&&(r=y.y+=D,y.line++,s=y.x=E(g,this.left+x,this.right-c[y.line])):0this.bottom&&(s=y.x=s+d[y.line].width+x,y.line++,r=y.y=E(g,this.top+P+x,this.bottom-d[y.line].height));var a=m.x(s),n=r,o=e;if(!(isNaN(M)||M<=0||isNaN(w)||w<0)){u.save();var l=T(o.lineWidth,1);if(u.fillStyle=T(o.fillStyle,p),u.lineCap=T(o.lineCap,"butt"),u.lineDashOffset=T(o.lineDashOffset,0),u.lineJoin=T(o.lineJoin,"miter"),u.lineWidth=l,u.strokeStyle=T(o.strokeStyle,p),u.setLineDash(T(o.lineDash,[])),f.usePointStyle){let t={radius:w*Math.SQRT2/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:l},e=m.xPlus(a,M/2);Fe(u,t,e,n+_,f.pointStyleWidth&&M)}else{let t=n+Math.max((v-w)/2,0),e=m.leftForLtr(a,M),i=wi(o.borderRadius);u.beginPath(),Object.values(i).some(t=>0!==t)?je(u,{x:e,y:t,w:M,h:w,radius:i}):u.rect(e,t,M,w),u.fill(),0!==l&&u.stroke()}u.restore()}if(s=Ct(i,s+M+_,S?s+t:this.right,h.rtl),n=m.x(s),a=r,o=e,He(u,o.text,n,a+k/2,b,{strikethrough:o.hidden,textAlign:m.textAlign(o.textAlign)}),S)y.x+=t+x;else if("string"!=typeof e.text){let t=b.lineHeight;y.y+=Cr(e,t)+x}else y.y+=D}),Oi(this.ctx,h.textDirection)}drawTitle(){let a=this.options,s=a.title,r=z(s.font),n=I(s.padding);if(s.display){var o=Di(a.rtl,this.left,this.width),l=this.ctx,h=s.position,d=r.size/2,d=n.top+d;let e,t=this.left,i=this.width;if(this.isHorizontal())i=Math.max(...this.lineWidths),e=this.top+d,t=E(a.align,t,this.right-i);else{let t=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);e=d+E(a.align,this.top,this.bottom-t-a.labels.padding-this._computeTitleHeight())}d=E(h,t,t+i);l.textAlign=o.textAlign(Dt(h)),l.textBaseline="middle",l.strokeStyle=s.color,l.fillStyle=s.color,l.font=r.string,He(l,s.text,d,e,r)}}_computeTitleHeight(){var t=this.options.title,e=z(t.font),i=I(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,a,s;if(d(t,this.left,this.right)&&d(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let a=t.data.datasets,{usePointStyle:s,pointStyle:r,textAlign:n,color:o,useBorderRadius:l,borderRadius:h}=t.legend.options.labels;return t._getSortedDatasetMetas().map(t=>{var e=t.controller.getStyle(s?0:void 0),i=I(e.borderWidth);return{text:a[t.index].label,fillStyle:e.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:e.borderColor,pointStyle:r||e.pointStyle,rotation:e.rotation,textAlign:n||e.textAlign,borderRadius:l&&(h||e.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ar extends e{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){var i=this.options;this.left=0,this.top=0,i.display?(this.width=this.right=t,this.height=this.bottom=e,t=O(i.text)?i.text.length:1,this._padding=I(i.padding),e=t*z(i.font).lineHeight+this._padding.height,this.isHorizontal()?this.height=e:this.width=e):this.width=this.height=this.right=this.bottom=0}isHorizontal(){var t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){var{top:e,left:i,bottom:a,right:s,options:r}=this,n=r.align;let o,l,h,d=0;return o=this.isHorizontal()?(l=E(n,i,s),h=e+t,s-i):(d="left"===r.position?(l=i+t,h=E(n,a,e),-.5*S):(l=s-t,h=E(n,e,a),.5*S),a-e),{titleX:l,titleY:h,maxWidth:o,rotation:d}}draw(){var t,e,i,a,s,r=this.ctx,n=this.options;n.display&&(e=(t=z(n.font)).lineHeight/2+this._padding.top,{titleX:e,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(e),He(r,n.text,0,0,t,{color:n.color,maxWidth:a,rotation:s,textAlign:Dt(n.align),textBaseline:"middle",translation:[e,i]}))}}var Tr={id:"title",_element:Ar,start(t,e,i){var a;t=t,i=i,a=new Ar({ctx:t.ctx,options:i,chart:t}),s.configure(t,a,i),s.addBox(t,a),t.titleBlock=a},stop(t){var e=t.titleBlock;s.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){var a=t.titleBlock;s.configure(t,a,i),a.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let Lr=new WeakMap;var Er={id:"subtitle",start(t,e,i){var a=new Ar({ctx:t.ctx,options:i,chart:t});s.configure(t,a,i),s.addBox(t,a),Lr.set(t,a)},stop(t){s.removeBox(t,Lr.get(t)),Lr.delete(t)},beforeUpdate(t,e,i){var a=Lr.get(t);s.configure(t,a,i),a.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let Rr={average(t){if(!t.length)return!1;let i,e,a=0,s=0,r=0;for(i=0,e=t.length;it+e.before.length+e.lines.length+e.after.length,0),v=(x+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*d.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x&&(m+=f*(e.displayColors?Math.max(l,h.lineHeight):h.lineHeight)+(x-f)*h.lineHeight+(x-1)*e.bodySpacing),g&&(m+=e.footerMarginTop+g*c.lineHeight+(g-1)*e.footerSpacing),0);return a.save(),a.font=d.string,k(t.title,i),a.font=h.string,k(t.beforeBody.concat(t.afterBody),i),v=e.displayColors?o+2+e.boxPadding:0,k(s,t=>{k(t.before,i),k(t.lines,i),k(t.after,i)}),v=0,a.font=c.string,k(t.footer,i),a.restore(),{width:b+=p.width,height:m}}function Fr(i,t,a){var e=a.yAlign||t.yAlign||function(){var{y:t,height:e}=a;return ti.height-e/2?"bottom":"center"}();return{xAlign:a.xAlign||t.xAlign||function(s,r,n,t){var{x:e,width:i}=n,{width:a,chartArea:{left:o,right:l}}=s;let h="center";return"center"===t?h=e<=(o+l)/2?"left":"right":e<=i/2?h="left":a-i/2<=e&&(h="right"),h=function(t){var{x:e,width:i}=n,a=r.caretSize+r.caretPadding;return"left"===t&&e+i+a>s.width||"right"===t&&e-i-a<0}(h)?"center":h}(i,t,a,e),yAlign:e}}function Vr(t,i,e,a){var{caretSize:t,caretPadding:s,cornerRadius:r}=t,{xAlign:n,yAlign:o}=e,l=t+s,{topLeft:e,topRight:s,bottomLeft:r,bottomRight:h}=wi(r);let d=function(){let{x:t,width:e}=i;return"right"===n?t-=e:"center"===n&&(t-=e/2),t}();var c=function(){let{y:t,height:e}=i;return"top"===o?t+=l:t-="bottom"===o?e+l:e/2,t}();return"center"===o?"left"===n?d+=l:"right"===n&&(d-=l):"left"===n?d-=Math.max(e,r)+t:"right"===n&&(d+=Math.max(s,h)+t),{x:C(d,0,a.width-i.width),y:C(c,0,a.height-i.height)}}function Br(t,e,i){i=I(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Wr(t){return b([],Ir(t))}function Nr(t,e){e=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return e?t.override(e):t}let Hr={beforeTitle:t,title(t){if(0{var e={before:[],lines:[],after:[]},i=Nr(a,t);b(e.before,Ir(w(i,"beforeLabel",this,t))),b(e.lines,w(i,"label",this,t)),b(e.after,Ir(w(i,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return Wr(w(e.callbacks,"afterBody",this,t))}getFooter(t,e){var e=e.callbacks,i=w(e,"beforeFooter",this,t),a=w(e,"footer",this,t),e=w(e,"afterFooter",this,t),t=b([],Ir(i));return t=b(t,Ir(a)),b(t,Ir(e))}_createItems(a){let t=this._active,s=this.chart.data,i=[],r=[],n=[],e,o,l=[];for(e=0,o=t.length;ea.filter(t,e,i,s))),k(l=a.itemSort?l.sort((t,e)=>a.itemSort(t,e,s)):l,t=>{var e=Nr(a.callbacks,t);i.push(w(e,"labelColor",this,t)),r.push(w(e,"labelPointStyle",this,t)),n.push(w(e,"labelTextColor",this,t))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=n,this.dataPoints=l}update(t,e){var r=this.options.setContext(this.getContext()),n=this._active;let o,l=[];if(n.length){let t=Rr[r.position].call(this,n,this._eventPosition),e=(l=this._createItems(r),this.title=this.getTitle(l,r),this.beforeBody=this.getBeforeBody(l,r),this.body=this.getBody(l,r),this.afterBody=this.getAfterBody(l,r),this.footer=this.getFooter(l,r),this._size=zr(this,r)),i=Object.assign({},t,e),a=Fr(this.chart,r,i),s=Vr(r,i,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:s.x,y:s.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=l,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,a){t=this.getCaretPosition(t,i,a);e.lineTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineTo(t.x3,t.y3)}getCaretPosition(t,e,i){var{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:r}=i,{topLeft:r,topRight:n,bottomLeft:o,bottomRight:l}=wi(r),{x:t,y:h}=t,{width:e,height:d}=e;let c,u,g,f,p,m;return"center"===s?(p=h+d/2,m="left"===a?(c=t,u=c-i,f=p+i,p-i):(c=t+e,u=c+i,f=p-i,p+i),g=c):(u="left"===a?t+Math.max(r,o)+i:"right"===a?t+e-Math.max(n,l)-i:this.caretX,g="top"===s?(f=h,p=f-i,c=u-i,u+i):(f=h+d,p=f+i,c=u+i,u-i),m=f),{x1:c,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,i){var a=this.title,s=a.length;let r,n,o;if(s){var l=Di(i.rtl,this.x,this.width);for(t.x=Br(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=z(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,o=0;o0!==t)?(a.beginPath(),a.fillStyle=r.multiKeyBackground,je(a,{x:t,y:g,w:h,h:l,radius:i}),a.fill(),a.stroke(),a.fillStyle=n.backgroundColor,a.beginPath(),je(a,{x:e,y:g+1,w:h-2,h:l-2,radius:i}),a.fill()):(a.fillStyle=r.multiKeyBackground,a.fillRect(t,g,h,l),a.strokeRect(t,g,h,l),a.fillStyle=n.backgroundColor,a.fillRect(e,g+1,h-2,l-2))}a.fillStyle=this.labelTextColors[e]}drawBody(e,i,t){function a(t){i.fillText(t,f.x(e.x+g),e.y+u/2),e.y+=u+r}let s=this.body,{bodySpacing:r,bodyAlign:n,displayColors:o,boxHeight:l,boxWidth:h,boxPadding:d}=t,c=z(t.bodyFont),u=c.lineHeight,g=0,f=Di(t.rtl,this.x,this.width),p=f.textAlign(n),m,b,x,v,_,y,M;for(i.textAlign=n,i.textBaseline="middle",i.font=c.string,e.x=Br(this,p,t),i.fillStyle=t.bodyColor,k(this.beforeBody,a),g=o&&"right"!==p?"center"===n?h/2+d:h+2+d:0,v=0,y=s.length;v{var i=this.chart.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("Cannot find a dataset at index "+t)}),i=!W(i,t),a=this._positionChanged(t,e);(i||a)&&(this._active=t,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var a=this.options,s=this._active||[],i=this._getActiveElements(t,s,e,i),r=this._positionChanged(i,t),s=e||!W(i,s)||r;return s&&(this._active=i,a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e)),s}_getActiveElements(t,e,i,a){var s=this.options;return"mouseout"===t.type?[]:a?(a=this.chart.getElementsAtEventForMode(t,s.mode,s,i),s.reverse&&a.reverse(),a):e}_positionChanged(t,e){var{caretX:i,caretY:a,options:s}=this,s=Rr[s.position].call(this,t,e);return!1!==s&&(i!==s.x||a!==s.y)}}var Yr={id:"tooltip",_element:jr,positioners:Rr,afterInit(t,e,i){i&&(t.tooltip=new jr({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){var e,i=t.tooltip;i&&i._willRender()&&!(e={tooltip:i})!==t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})&&(i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e))},afterEvent(t,e){var i;t.tooltip&&(i=e.replay,t.tooltip.handleEvent(e.event,i,e.inChartArea))&&(e.changed=!0)},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Hr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return i.register(Oe,ir,Es,a),i.helpers={...Fi},i._adapters=hs,i.Animation=xa,i.Animations=va,i.animator=r,i.controllers=M.controllers.items,i.DatasetController=Aa,i.Element=e,i.elements=Es,i.Interaction=Hi,i.layouts=s,i.platforms=pa,i.Scale=Fa,i.Ticks=ge,Object.assign(i,Oe,ir,Es,a,pa),i.Chart=i,"undefined"!=typeof window&&(window.Chart=i),i}) \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,function(){var a=Object.freeze({__proto__:null,get Colors(){return hr},get Decimation(){return ur},get Filler(){return Sr},get Legend(){return Or},get SubTitle(){return Er},get Title(){return Tr},get Tooltip(){return Yr}});function t(){}let F=(()=>{let t=0;return()=>t++})();function P(t){return null==t}function O(t){return!(!Array.isArray||!Array.isArray(t))||"[object"===(t=Object.prototype.toString.call(t)).slice(0,7)&&"Array]"===t.slice(-6)}function A(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function p(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function u(t,e){return p(t)?t:e}function T(t,e){return void 0===t?e:t}let V=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,B=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function c(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function k(t,e,i,a){let s,r,n;if(O(t))if(r=t.length,a)for(s=r-1;0<=s;s--)e.call(i,t[s],s);else for(s=0;st,x:t=>t.x,y:t=>t.y};function q(t){var e=t.split("."),i=[];let a="";for(let t of e)a+=t,a=a.endsWith("\\")?a.slice(0,-1)+".":(i.push(a),"");return i}function f(t,e){return(X[e]||(X[e]=function(){let i=q(e);return t=>{for(var e of i){if(""===e)break;t=t&&t[e]}return t}}()))(t)}function K(t){return t.charAt(0).toUpperCase()+t.slice(1)}let G=t=>void 0!==t,g=t=>"function"==typeof t,Z=(t,e)=>{if(t.size!==e.size)return!1;for(var i of t)if(!e.has(i))return!1;return!0};function J(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}let S=Math.PI,v=2*S,Q=v+S,tt=Number.POSITIVE_INFINITY,et=S/180,D=S/2,it=S/4,at=2*S/3,o=Math.log10,_=Math.sign;function st(t,e,i){return Math.abs(t-e)t-e).pop(),e}function ot(t){return!isNaN(parseFloat(t))&&isFinite(t)}function lt(t,e){var i=Math.round(t);return i-e<=t&&t<=i+e}function ht(t,e,i){let a,s,r;for(a=0,s=t.length;a=Math.min(e,i)-a&&t<=Math.max(e,i)+a}function bt(e,i,t){t=t||(t=>e[t]>1)?r=a:s=a;return{lo:r,hi:s}}let m=(i,a,s,t)=>bt(i,s,t?t=>{var e=i[t][a];return ei[t][a]bt(e,a,t=>e[t][i]>=a);function vt(t,e,i){let a=0,s=t.length;for(;aa&&t[s-1]>i;)s--;return 0{let i="_onData"+K(t),a=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...e){var t=a.apply(this,e);return s._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),t}})}))}function Mt(e,t){var i=e._chartjs;i&&(-1!==(t=(i=i.listeners).indexOf(t))&&i.splice(t,1),0{delete e[t]}),delete e._chartjs))}function wt(t){var e=new Set(t);return e.size===t.length?t:Array.from(e)}let kt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function St(e,i){let a,s=!1;return function(...t){a=t,s||(s=!0,kt.call(window,()=>{s=!1,e.apply(i,a)}))}}function Pt(e,i){let a;return function(...t){return i?(clearTimeout(a),a=setTimeout(e,i,t)):e.apply(this,t),i}}let Dt=t=>"start"===t?"left":"end"===t?"right":"center",E=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,Ct=(t,e,i,a)=>t===(a?"left":"right")?i:"center"===t?(e+i)/2:e;function Ot(t,e,i){var a,s,r,n,o,l,h=e.length;let d=0,c=h;return t._sorted&&({iScale:t,_parsed:a}=t,s=t.axis,{min:r,max:n,minDefined:o,maxDefined:l}=t.getUserBounds(),o&&(d=C(Math.min(m(a,s,r).lo,i?h:m(e,s,t.getPixelForValue(r)).lo),0,h-1)),c=l?C(Math.max(m(a,t.axis,n,!0).hi+1,i?0:m(e,s,t.getPixelForValue(n),!0).hi+1),d,h)-d:h-d),{start:d,count:c}}function At(t){var{xScale:e,yScale:i,_scaleRanges:a}=t,s={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};return a?(e=a.xmin!==e.min||a.xmax!==e.max||a.ymin!==i.min||a.ymax!==i.max,Object.assign(a,s),e):(t._scaleRanges=s,!0)}var r=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,a,t){let s=i.listeners[t],r=i.duration;s.forEach(t=>t({chart:e,initial:i.initial,numSteps:r,currentStep:Math.min(a-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=kt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((a,s)=>{if(a.running&&a.items.length){var r=a.items;let t,e=r.length-1,i=!1;for(;0<=e;--e)(t=r[e])._active?(t._total>a.duration&&(a.duration=t._total),t.tick(n),i=!0):(r[e]=r[r.length-1],r.pop());i&&(s.draw(),this._notify(s,a,n,"progress")),r.length||(a.running=!1,this._notify(s,a,n,"complete"),a.initial=!1),o+=r.length}}),this._lastDate=n,0===o&&(this._running=!1)}_getAnims(t){var e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return 0Math.max(t,e._duration),0),this._refresh())}running(t){return!!this._running&&!!((t=this._charts.get(t))&&t.running&&t.items.length)}stop(e){var i=this._charts.get(e);if(i&&i.items.length){var a=i.items;let t=a.length-1;for(;0<=t;--t)a[t].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}}remove(t){return this._charts.delete(t)}};function Tt(t){return t+.5|0}let Lt=(t,e,i)=>Math.max(Math.min(t,i),e);function Et(t){return Lt(Tt(2.55*t),0,255)}function Rt(t){return Lt(Tt(255*t),0,255)}function n(t){return Lt(Tt(t/2.55)/100,0,1)}function It(t){return Lt(Tt(100*t),0,100)}let l={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zt=[..."0123456789ABCDEF"],Ft=t=>zt[15&t],Vt=t=>zt[(240&t)>>4]+zt[15&t],Bt=t=>(240&t)>>4==(15&t);let Wt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Nt(i,t,a){let s=t*Math.min(a,1-a),e=(t,e=(t+i/30)%12)=>a-s*Math.max(Math.min(e-3,9-e,1),-1);return[e(0),e(8),e(4)]}function Ht(i,a,s){var t=(t,e=(t+i/60)%6)=>s-s*a*Math.max(Math.min(e,4-e,1),0);return[t(5),t(3),t(1)]}function jt(t,e,i){var a=Nt(t,1,.5);let s;for(1t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Qt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function te(e,i,a){if(e){let t=Yt(e);t[i]=Math.max(0,Math.min(t[i]+t[i]*a,0===i?360:1)),t=Ut(t),e.r=t[0],e.g=t[1],e.b=t[2]}}function ee(t,e){return t&&Object.assign(e||{},t)}function ie(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?3<=t.length&&(e={r:t[0],g:t[1],b:t[2],a:255},3>16&255,r>>8&255,255&r]}return t}()).transparent=[0,0,0,0]),(i=Gt[i.toLowerCase()])&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255})||ae(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=ee(this._rgb);return t&&(t.a=n(t.a)),t}set rgb(t){this._rgb=ie(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${n(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid&&(t=this._rgb,e=t,e=Bt(e.r)&&Bt(e.g)&&Bt(e.b)&&Bt(e.a)?Ft:Vt,t)?"#"+e(t.r)+e(t.g)+e(t.b)+((t=t.a)<255?e(t):""):void 0;var t,e}hslString(){if(this._valid){var t,e,i,a=this._rgb;if(a)return t=(i=Yt(a))[0],e=It(i[1]),i=It(i[2]),a.a<255?`hsla(${t}, ${e}%, ${i}%, ${n(a.a)})`:`hsl(${t}, ${e}%, ${i}%)`}}mix(t,e){var i,a,s;return t&&(i=this.rgb,t=t.rgb,s=i.a-t.a,i.r=255&(a=(1+((a=2*(e=void 0===e?.5:e)-1)*s==-1?a:(a+s)/(1+a*s)))/2)*i.r+(s=1-a)*t.r+.5,i.g=255&a*i.g+s*t.g+.5,i.b=255&a*i.b+s*t.b+.5,i.a=e*i.a+(1-e)*t.a,this.rgb=i),this}interpolate(t,e){return t&&(this._rgb=(i=this._rgb,t=t._rgb,e=e,a=Qt(n(i.r)),s=Qt(n(i.g)),r=Qt(n(i.b)),{r:Rt(Jt(a+e*(Qt(n(t.r))-a))),g:Rt(Jt(s+e*(Qt(n(t.g))-s))),b:Rt(Jt(r+e*(Qt(n(t.b))-r))),a:i.a+e*(t.a-i.a)})),this;var i,a,s,r}clone(){return new se(this.rgb)}alpha(t){return this._rgb.a=Rt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){var t=this._rgb,e=Tt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return te(this._rgb,2,t),this}darken(t){return te(this._rgb,2,-t),this}saturate(t){return te(this._rgb,1,t),this}desaturate(t){return te(this._rgb,1,-t),this}rotate(t){return e=this._rgb,t=t,(i=Yt(e))[0]=Xt(i[0]+t),i=Ut(i),e.r=i[0],e.g=i[1],e.b=i[2],this;var e,i}}function re(t){return!(!t||"object"!=typeof t||"[object CanvasPattern]"!==(t=t.toString())&&"[object CanvasGradient]"!==t)}function ne(t){return re(t)?t:new se(t)}function oe(t){return re(t)?t:new se(t).saturate(.5).darken(.1).hexString()}let le=["x","y","borderWidth","radius","tension"],he=["color","borderColor","backgroundColor"],de=new Map;function ce(t,e,s){return function(t,e){e=s||{};var i=t+JSON.stringify(e);let a=de.get(i);return a||(a=new Intl.NumberFormat(t,e),de.set(i,a)),a}(e).format(t)}let ue={values:t=>O(t)?t:""+t,numeric(e,t,i){if(0===e)return"0";var a=this.chart.options.locale;let s,r=e;if(1.8*i.length?ue.numeric.call(this,t,e,i):"")}};var ge={formatters:ue};let fe=Object.create(null),pe=Object.create(null);function me(i,t){if(t){var a=t.split(".");for(let t=0,e=a.length;tt.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>oe(e.backgroundColor),this.hoverBorderColor=(t,e)=>oe(e.borderColor),this.hoverColor=(t,e)=>oe(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return be(this,t,e)}get(t){return me(this,t)}describe(t,e){return be(pe,t,e)}override(t,e){return be(fe,t,e)}route(t,e,i,a){let s=me(this,t),r=me(this,i),n="_"+e;Object.defineProperties(s,{[n]:{value:s[e],writable:!0},[e]:{enumerable:!0,get(){var t=this[n],e=r[a];return A(t)?Object.assign({},e,t):T(t,e)},set(t){this[n]=t}}})}apply(t){t.forEach(t=>t(this))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:he},numbers:{type:"number",properties:le}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ge.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function xe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ve(t){let e=t.parentNode;return e=e&&"[object ShadowRoot]"===e.toString()?e.host:e}function _e(t,e,i){let a;return"string"==typeof t?(a=parseInt(t,10),-1!==t.indexOf("%")&&(a=a/100*e.parentNode[i])):a=t,a}let ye=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function Me(t,e){return ye(t).getPropertyValue(e)}let we=["top","right","bottom","left"];function ke(e,i,a){var s={};a=a?"-"+a:"";for(let t=0;t<4;t++){var r=we[t];s[r]=parseFloat(e[i+"-"+r+a])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function Se(t,e){if("native"in t)return t;var{canvas:i,currentDevicePixelRatio:a}=e,s=ye(i),r="border-box"===s.boxSizing,n=ke(s,"padding"),s=ke(s,"border","width"),{x:t,y:o,box:l}=function(t,e){var i,a=t.touches,a=a&&a.length?a[0]:t,{offsetX:s,offsetY:r}=a;let n,o,l=!1;if(i=r,t=t.target,!(0Math.round(10*t)/10;function De(t,e,i,a){var s=ye(t),r=ke(s,"margin"),n=_e(s.maxWidth,t,"clientWidth")||tt,o=_e(s.maxHeight,t,"clientHeight")||tt,t=function(t,s,r){let n,o;if(void 0===s||void 0===r){var l=ve(t);if(l){let t=l.getBoundingClientRect(),e=ye(l),i=ke(e,"border","width"),a=ke(e,"padding");s=t.width-a.width-i.width,r=t.height-a.height-i.height,n=_e(e.maxWidth,l,"clientWidth"),o=_e(e.maxHeight,l,"clientHeight")}else s=t.clientWidth,r=t.clientHeight}return{width:s,height:r,maxWidth:n||tt,maxHeight:o||tt}}(t,e,i);let{width:l,height:h}=t;if("content-box"===s.boxSizing){let t=ke(s,"border","width"),e=ke(s,"padding");l-=e.width+t.width,h-=e.height+t.height}return l=Math.max(0,l-r.width),h=Math.max(0,a?l/a:h-r.height),l=Pe(Math.min(l,n,t.maxWidth)),h=Pe(Math.min(h,o,t.maxHeight)),l&&!h&&(h=Pe(l/2)),(void 0!==e||void 0!==i)&&a&&t.height&&h>t.height&&(h=t.height,l=Pe(Math.floor(h*a))),{width:l,height:h}}function Ce(t,e,i){var e=e||1,a=Math.floor(t.height*e),s=Math.floor(t.width*e),r=(t.height=Math.floor(t.height),t.width=Math.floor(t.width),t.canvas);return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=t.height+"px",r.style.width=t.width+"px"),(t.currentDevicePixelRatio!==e||r.height!==a||r.width!==s)&&(t.currentDevicePixelRatio=e,r.height=a,r.width=s,t.ctx.setTransform(e,0,0,e,0,0),!0)}var Oe=function(){let t=!1;try{var e={get passive(){return!(t=!0)}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Ae(t,e){t=Me(t,e),e=t&&t.match(/^(\d+)(\.\d+)?px$/);return e?+e[1]:void 0}function Te(t){return!t||P(t.size)||P(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Le(t,e,i,a,s){let r=e[s];return r||(r=e[s]=t.measureText(s).width,i.push(s)),a=r>a?r:a}function Ee(t,e,i,a){let s=(a=a||{}).data=a.data||{},r=a.garbageCollect=a.garbageCollect||[],n=(a.font!==e&&(s=a.data={},r=a.garbageCollect=[],a.font=e),t.save(),t.font=e,0);var o=i.length;let l,h,d,c,u;for(l=0;li.length){for(l=0;le.left-i&&t.xe.top-i&&t.yo[0]){let i=t||o;void 0===e&&(e=ti("_fallback",o));t={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:o,_rootScopes:i,_fallback:e,_getTarget:s,override:t=>Ye([t,...o],l,i,e)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete t._keys,delete o[0][e],!0),get:(r,n)=>Ke(r,n,()=>{var t,e,i=n,a=o,s=r;for(e of l)if(t=ti(Xe(e,i),a),void 0!==t)return qe(i,t)?Je(a,s,i,t):t}),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(o[0]),has:(t,e)=>ei(t).includes(e),ownKeys:t=>ei(t),set(t,e,i){var a=t._storage||(t._storage=s());return t[e]=a[e]=i,delete t._keys,!0}})}function $e(a,e,i,s){var t={_cacheable:!1,_proxy:a,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ue(a,s),setContext:t=>$e(a,t,i,s),override:t=>$e(a.override(t),e,i,s)};return new Proxy(t,{deleteProperty:(t,e)=>(delete t[e],delete a[e],!0),get:(o,h,d)=>Ke(o,h,()=>{{var l=o,e=h,i=d,{_proxy:a,_context:s,_subProxy:r,_descriptors:n}=l;let t=a[e];return O(t=g(t)&&n.isScriptable(e)?function(t,e,i){var{_proxy:a,_context:s,_subProxy:r,_stack:n}=l;if(n.has(t))throw new Error("Recursion detected: "+Array.from(n).join("->")+"->"+t);n.add(t);let o=e(s,r||i);return n.delete(t),o=qe(t,o)?Je(a._scopes,a,t,o):o}(e,t,i):t)&&t.length&&(t=function(s,r,t,e){var{_proxy:n,_context:o,_subProxy:l,_descriptors:h}=t;if(void 0!==o.index&&e(s))return r[o.index%r.length];if(A(r[0])){let i=r,a=n._scopes.filter(t=>t!==i);r=[];for(let e of i){let t=Je(a,n,s,e);r.push($e(t,o,l&&l[s],h))}}return r}(e,t,l,n.isIndexable)),t=qe(e,t)?$e(t,s,r&&r[e],n):t}}),getOwnPropertyDescriptor:(t,e)=>t._descriptors.allKeys?Reflect.has(a,e)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(a,e),getPrototypeOf:()=>Reflect.getPrototypeOf(a),has:(t,e)=>Reflect.has(a,e),ownKeys:()=>Reflect.ownKeys(a),set:(t,e,i)=>(a[e]=i,delete t[e],!0)})}function Ue(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:a=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:i,indexable:a,isScriptable:g(i)?i:()=>i,isIndexable:g(a)?a:()=>a}}let Xe=(t,e)=>t?t+K(e):e,qe=(t,e)=>A(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ke(t,e,i){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:(i=i(),t[e]=i)}function Ge(t,e,i){return g(t)?t(e,i):t}let Ze=(t,e)=>!0===t?e:"string"==typeof t?f(e,t):void 0;function Je(t,a,s,r){var e=a._rootScopes,i=Ge(a._fallback,s,r),t=[...t,...e],n=new Set,o=(n.add(r),Qe(n,t,s,i||s,r));return null!==o&&(void 0===i||i===s||null!==(o=Qe(n,t,i,o,r)))&&Ye(Array.from(n),[""],e,i,()=>{return t=s,e=r,i=a._getTarget(),t in i||(i[t]={}),O(i=i[t])&&A(e)?e:i||{};var t,e,i})}function Qe(t,e,i,a,s){for(;i;)i=function(e,t,i,a,s){for(var r of t){let t=Ze(i,r);if(t){e.add(t);r=Ge(t._fallback,i,s);if(void 0!==r&&r!==i&&r!==a)return r}else if(!1===t&&void 0!==a&&i!==a)return null}return!1}(t,e,i,a,s);return i}function ti(e,t){for(var i of t)if(i){let t=i[e];if(void 0!==t)return t}}function ei(t){let e=t._keys;return e=e||(t._keys=function(t){var e,i=new Set;for(e of t)for(let t of Object.keys(e).filter(t=>!t.startsWith("_")))i.add(t);return Array.from(i)}(t._scopes))}function ii(t,e,i,a){var s=t["iScale"],{key:r="r"}=this._parsing,n=new Array(a);let o,l,h,d;for(o=0,l=a;oe"x"===t?"y":"x";function ni(t,e,i,a){var t=t.skip?e:t,s=e,e=i.skip?e:i,i=gt(s,t),r=gt(e,s),n=i/(i+r),i=r/(i+r),r=a*(isNaN(n)?0:n),n=a*(isNaN(i)?0:i);return{previous:{x:s.x-r*(e.x-t.x),y:s.y-r*(e.y-t.y)},next:{x:s.x+n*(e.x-t.x),y:s.y+n*(e.y-t.y)}}}function oi(l,e="x"){var i=ri(e),t=l.length,o=Array(t).fill(0),h=Array(t);let a,s,r,n=si(l,0);for(a=0;a!t.skip)),"monotone"===e.cubicInterpolationMode)oi(n,t);else{let t=i?n[n.length-1]:n[0];for(a=0,s=n.length;a0===t||1===t,ci=(t,e,i)=>-Math.pow(2,10*--t)*Math.sin((t-e)*v/i),ui=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*v/i)+1,gi={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-(--t*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>--t*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*D),easeOutSine:t=>Math.sin(t*D),easeInOutSine:t=>-.5*(Math.cos(S*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>di(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>1<=t?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1- --t*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>di(t)?t:ci(t,.075,.3),easeOutElastic:t=>di(t)?t:ui(t,.075,.3),easeInOutElastic(t){return di(t)?t:t<.5?.5*ci(2*t,.1125,.45):.5+.5*ui(2*t-1,.1125,.45)},easeInBack(t){return t*t*(2.70158*t-1.70158)},easeOutBack(t){return--t*t*(2.70158*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-gi.easeOutBounce(1-t),easeOutBounce(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*gi.easeInBounce(2*t):.5*gi.easeOutBounce(2*t-1)+.5};function fi(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function pi(t,e,i,a){return{x:t.x+i*(e.x-t.x),y:("middle"===a?i<.5?t:e:"after"===a?i<1?t:e:0+t||0;function yi(e,i){var a={},t=A(i),s=t?Object.keys(i):i,r=A(e)?t?t=>T(e[t],e[i[t]]):t=>e[t]:()=>e;for(let t of s)a[t]=_i(r(t));return a}function Mi(t){return yi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function wi(t){return yi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function I(t){t=Mi(t);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function z(t,e){e=e||R.font;let i=T((t=t||{}).size,e.size),a=("string"==typeof i&&(i=parseInt(i,10)),T(t.style,e.style));a&&!(""+a).match(xi)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);t={family:T(t.family,e.family),lineHeight:vi(T(t.lineHeight,e.lineHeight),i),size:i,style:a,weight:T(t.weight,e.weight),string:""};return t.string=Te(t),t}function ki(t,e,i,a){let s,r,n,o=!0;for(s=0,r=t.length;si&&0===t?0:t+e;return{min:s(t,-Math.abs(e)),max:s(a,e)}}function Pi(t,e){return Object.assign(Object.create(t),e)}function Di(t,e,i){return t?(a=e,s=i,{x:t=>a+a+s-t,setWidth(t){s=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t};var a,s}function Ci(t,e){var i,a;"ltr"!==e&&"rtl"!==e||(a=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=a)}function Oi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ai(t){return"angle"===t?{between:pt,compare:ft,normalize:x}:{between:d,compare:(t,e)=>t-e,normalize:t=>t}}function Ti({start:t,end:e,count:i,loop:a,style:s}){return{start:t%i,end:e%i,loop:a&&(e-t+1)%i==0,style:s}}function Li(t,i,g){if(!g)return[t];let{property:a,start:s,end:r}=g,n=i.length,{compare:o,between:l,normalize:h}=Ai(a),{start:d,end:c,loop:u,style:f}=function(t,e){var{property:i,start:a,end:s}=g,{between:r,normalize:n}=Ai(i),o=e.length;let l,h,{start:d,end:c,loop:u}=t;if(u){for(d+=o,c+=o,l=0,h=o;la&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(r,o,i=!!t._loop),Ii(t,!0===n?[{start:a,end:s,loop:i}]:function(e,i,t,a){var s=e.length,r=[];let n,o=i,l=e[i];for(n=i+1;n<=t;++n){let t=e[n%s];t.skip||t.stop?l.skip||(a=!1,r.push({start:i%s,end:(n-1)%s,loop:a}),i=o=t.stop?n:null):(o=n,l.skip&&(i=n)),l=t}return null!==o&&r.push({start:i%s,end:o%s,loop:a}),r}(r,a,s{t[o](a[s],r)&&(n.push({element:t,datasetIndex:e,index:i}),l=l||t.inRange(a.x,a.y,r))}),e&&!l?[]:n}var Hi={evaluateInteractionItems:Vi,modes:{index(t,e,i,a){let s=Se(e,t),r=i.axis||"x",n=i.includeInvisible||!1,o=i.intersect?Bi(t,s,r,a,n):Wi(t,s,r,!1,a,n),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{var e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,a){var e=Se(e,t),s=i.axis||"xy",r=i.includeInvisible||!1;let n=i.intersect?Bi(t,e,s,a,r):Wi(t,e,s,!1,a,r);if(0Bi(t,Se(e,t),i.axis||"xy",a,i.includeInvisible||!1),nearest(t,e,i,a){var e=Se(e,t),s=i.axis||"xy",r=i.includeInvisible||!1;return Wi(t,e,s,i.intersect,a,r)},x:(t,e,i,a)=>Ni(t,Se(e,t),"x",i.intersect,a),y:(t,e,i,a)=>Ni(t,Se(e,t),"y",i.intersect,a)}};let ji=["left","top","right","bottom"];function Yi(t,e){return t.filter(t=>t.pos===e)}function $i(t,e){return t.filter(t=>-1===ji.indexOf(t.pos)&&t.box.axis===e)}function Ui(t,a){return t.sort((t,e)=>{var i=a?e:t,t=a?t:e;return i.weight===t.weight?i.index-t.index:i.weight-t.weight})}function Xi(t,e,i,a){return Math.max(t[i],e[i])+Math.max(t[a],e[a])}function qi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ki(i,a,s,r){var n=[];let o,t,l,h,d,c;for(o=0,t=i.length,d=0;o{e[t]=Math.max(i[t],a[t])}),e}}(l.horizontal,a));let{same:t,other:e}=function(e,t,i,a){var{pos:s,box:r}=i,n=e.maxPadding;if(!A(s)){i.size&&(e[s]-=i.size);let t=a[i.stack]||{size:0,count:1};t.size=Math.max(t.size,i.horizontal?r.height:r.width),i.size=t.size/t.count,e[s]+=i.size}return r.getPadding&&qi(n,r.getPadding()),a=Math.max(0,t.outerWidth-Xi(n,e,"left","right")),s=Math.max(0,t.outerHeight-Xi(n,e,"top","bottom")),r=a!==e.w,t=s!==e.h,e.w=a,e.h=s,i.horizontal?{same:r,other:t}:{same:t,other:r}}(a,s,l,r);d|=t&&n.length,c=c||e,h.fullSize||n.push(l)}return d&&Ki(n,a,s,r)||c}function Gi(t,e,i,a,s){t.top=i,t.left=e,t.right=e+a,t.bottom=i+s,t.width=a,t.height=s}function Zi(t,r,n,e){var o,l=n.padding;let{x:h,y:d}=r;for(o of t){let i=o.box,a=e[o.stack]||{count:1,placed:0,weight:1},s=o.stackWeight/a.weight||1;if(o.horizontal){let t=r.w*s,e=a.size||i.height;G(a.start)&&(d=a.start),i.fullSize?Gi(i,l.left,d,n.outerWidth-l.right-l.left,e):Gi(i,r.left+a.placed,d,t,e),a.start=d,a.placed+=t,d=i.bottom}else{let t=r.h*s,e=a.size||i.width;G(a.start)&&(h=a.start),i.fullSize?Gi(i,h,l.top,e,n.outerHeight-l.bottom-l.top):Gi(i,h,r.top+a.placed,e,t),a.start=h,a.placed+=t,h=i.right}}r.x=h,r.y=d}var s={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){e=t.boxes?t.boxes.indexOf(e):-1;-1!==e&&t.boxes.splice(e,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(i,a,s,r){if(i){var n,o,l=I(i.options.layout.padding),h=Math.max(a-l.width,0),d=Math.max(s-l.height,0),c=(u=function(t){var e=[];let i,a,s,r,n,o;for(i=0,a=(t||[]).length;it.box.fullSize),!0),g=Ui(Yi(u,"left"),!0),f=Ui(Yi(u,"right")),m=Ui(Yi(u,"top"),!0),n=Ui(Yi(u,"bottom")),o=$i(u,"x"),p=$i(u,"y"),{fullSize:c,leftAndTop:g.concat(m),rightAndBottom:f.concat(p).concat(n).concat(o),chartArea:Yi(u,"chartArea"),vertical:g.concat(f).concat(p),horizontal:m.concat(n).concat(o)}),u=c.vertical,g=c.horizontal,f=(k(i.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}),u.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),p=Object.freeze({outerWidth:a,outerHeight:s,padding:l,availableWidth:h,availableHeight:d,vBoxMaxWidth:h/2/f,hBoxMaxHeight:d/2}),m=Object.assign({},l);qi(m,I(r));let e=Object.assign({maxPadding:m,w:h,h:d,x:l.left,y:l.top},l),t=function(a,s){var r=function(t){var a,s,r={};for(a of t){let{stack:t,pos:e,stackWeight:i}=a;t&&ji.includes(e)&&((s=r[t]||(r[t]={count:0,placed:0,weight:0,size:0})).count++,s.weight+=i)}return r}(a),{vBoxMaxWidth:n,hBoxMaxHeight:o}=s;let l,t,h;for(l=0,t=a.length;l{t=t.box;Object.assign(t,i.chartArea),t.update(e.w,e.h,{left:0,top:0,right:0,bottom:0})})}}};class Ji{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,a){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,a?Math.floor(e/a):i)}}isAttached(t){return!0}updateConfig(t){}}class Qi extends Ji{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let ta="$chartjs",ea={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ia=t=>null===t||""===t,aa=!!Oe&&{passive:!0};function sa(t,e){for(var i of t)if(i===e||i.contains(e))return!0}function ra(t,e,a){let s=t.canvas,i=new MutationObserver(e=>{let i=!1;for(let t of e)i=i||sa(t.addedNodes,s),i=i&&!sa(t.removedNodes,s);i&&a()});return i.observe(document,{childList:!0,subtree:!0}),i}function na(t,e,a){let s=t.canvas,i=new MutationObserver(e=>{let i=!1;for(let t of e)i=i||sa(t.removedNodes,s),i=i&&!sa(t.addedNodes,s);i&&a()});return i.observe(document,{childList:!0,subtree:!0}),i}let oa=new Map,la=0;function ha(){let i=window.devicePixelRatio;i!==la&&(la=i,oa.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function da(e,t,a){let i=e.canvas,s=i&&ve(i);if(s){let i=St((t,e)=>{var i=s.clientWidth;a(t,e),i{var t=t[0],e=t.contentRect.width,t=t.contentRect.height;0===e&&0===t||i(e,t)});return t.observe(s),e=e,r=i,oa.size||window.addEventListener("resize",ha),oa.set(e,r),t;var r}}function ca(t,e,i){i&&i.disconnect(),"resize"===e&&(i=t,oa.delete(i),oa.size||window.removeEventListener("resize",ha))}function ua(e,t,i){var a=e.canvas,s=St(t=>{null!==e.ctx&&i(function(t,e){var i=ea[t.type]||t.type,{x:a,y:s}=Se(t,e);return{type:i,chart:e,native:t,x:void 0!==a?a:null,y:void 0!==s?s:null}}(t,e))},e);return a.addEventListener(t,s,aa),s}class ga extends Ji{acquireContext(e,t){var i=e&&e.getContext&&e.getContext("2d");{if(i&&i.canvas===e){var a=t,t=e.style,s=e.getAttribute("height"),r=e.getAttribute("width");if(e[ta]={initial:{height:s,width:r,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ia(r)){let t=Ae(e,"width");void 0!==t&&(e.width=t)}if(ia(s))if(""===e.style.height)e.height=e.width/(a||2);else{let t=Ae(e,"height");void 0!==t&&(e.height=t)}return i}return null}}releaseContext(t){let i=t.canvas;if(!i[ta])return!1;let a=i[ta].initial,e=(["height","width"].forEach(t=>{var e=a[t];P(e)?i.removeAttribute(t):i.setAttribute(t,e)}),a.style||{});return Object.keys(e).forEach(t=>{i.style[t]=e[t]}),i.width=i.width,delete i[ta],!0}addEventListener(t,e,i){this.removeEventListener(t,e);var a=t.$proxies||(t.$proxies={}),s={attach:ra,detach:na,resize:da}[e]||ua;a[e]=s(t,e,i)}removeEventListener(t,e){var i=t.$proxies||(t.$proxies={}),a=i[e];a&&(({attach:ca,detach:ca,resize:ca}[e]||function(t,e,i){t.canvas.removeEventListener(e,i,aa)})(t,e,a),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,a){return De(t,e,i,a)}isAttached(t){t=ve(t);return!(!t||!t.isConnected)}}function fa(t){return!xe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qi:ga}let pa=Object.freeze({__proto__:null,BasePlatform:Ji,BasicPlatform:Qi,DomPlatform:ga,_detectPlatform:fa}),ma="transparent",ba={boolean:(t,e,i)=>.5t+(e-t)*i};class xa{constructor(t,e,i,a){var s=e[i],s=(a=ki([t.to,a,s,t.from]),ki([t.from,s,a]));this._active=!0,this._fn=t.fn||ba[t.type||typeof s],this._easing=gi[t.easing]||gi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=a,this._promises=void 0}active(){return this._active}update(t,e,i){var a,s,r;this._active&&(this._notify(!1),a=this._target[this._prop],s=i-this._start,r=this._duration-s,this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ki([t.to,e,a,t.from]),this._from=ki([t.from,a,e]))}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){var t=t-this._start,e=this._duration,i=this._prop,a=this._from,s=this._loop,r=this._to;this._active=a!==r&&(s||t{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej",i=this._promises||[];for(let t=0;t{var a=t[i];if(A(a)){let e={};for(let t of s)e[t]=a[t];(O(a.properties)&&a.properties||[i]).forEach(t=>{t!==i&&r.has(t)||r.set(t,e)})}})}}_animateOptions(t,e){let i=e.options,a=function(e,i){if(i){let t=e.options;if(t)return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;e.options=i}}(t,i);return a?(e=this._createAnimations(a,i),i.$shared&&function(e,t){var i=[],a=Object.keys(t);for(let t=0;t{t.options=i},()=>{}),e):[]}_createAnimations(e,i){var a=this._properties,s=[],r=e.$animations||(e.$animations={}),t=Object.keys(i),n=Date.now();let o;for(o=t.length-1;0<=o;--o){var l=t[o];if("$"!==l.charAt(0))if("options"===l)s.push(...this._animateOptions(e,i));else{var h=i[l];let t=r[l];var d=a.get(l);if(t){if(d&&t.active()){t.update(d,h,n);continue}t.cancel()}d&&d.duration?(r[l]=t=new xa(d,e,l,h),s.push(t)):e[l]=h}}return s}update(t,e){var i;if(0!==this._properties.size)return(i=this._createAnimations(t,e)).length?(r.add(this._chart,i),!0):void 0;Object.assign(t,e)}}function _a(t,e){var t=t&&t.options||{},i=t.reverse,a=void 0===t.min?e:0,t=void 0===t.max?e:0;return{start:i?t:a,end:i?a:t}}function ya(t,e){var i=[],a=t._getSortedDatasetMetas(e);let s,r;for(s=0,r=a.length;si[t].axis===e).shift()}function Da(t,i){var a=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){i=i||t._parsed;for(let e of i){let t=e._stacks;if(!t||void 0===t[s]||void 0===t[s][a])return;delete t[s][a],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[a]&&delete t[s]._visualValues[a]}}}let Ca=t=>"reset"===t||"none"===t,Oa=(t,e)=>e?t:Object.assign({},t);class Aa{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){var t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wa(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Da(this._cachedMeta),this.index=t}linkScales(){var t=this.chart,e=this._cachedMeta,i=this.getDataset(),a=(t,e,i,a)=>"x"===t?e:"r"===t?a:i,s=e.xAxisID=T(i.xAxisID,Pa(t,"x")),r=e.yAxisID=T(i.yAxisID,Pa(t,"y")),i=e.rAxisID=T(i.rAxisID,Pa(t,"r")),t=e.indexAxis,n=e.iAxisID=a(t,s,r,i),a=e.vAxisID=a(t,r,s,i);e.xScale=this.getScaleForId(s),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(i),e.iScale=this.getScaleForId(n),e.vScale=this.getScaleForId(a)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){var t=this._cachedMeta;this._data&&Mt(this._data,this),t._stacked&&Da(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(A(e))this._data=function(t){var e=Object.keys(t),i=new Array(e.length);let a,s,r;for(a=0,s=e.length;anull===l[n]||c&&l[n]t||dthis.getContext(i,a,e),l)).$shared&&(d.$shared=o,s[r]=Object.freeze(Oa(d,o))),d)}_resolveAnimations(a,s,r){let t=this.chart,e=this._cachedDataOpts,i="animation-"+s,n=e[i];if(n)return n;let o;if(!1!==t.options.animation){let t=this.chart.config,e=t.datasetAnimationScopeKeys(this._type,s),i=t.getOptionScopes(this.getDataset(),e);o=t.createResolver(i,this.getContext(a,r,s))}a=new va(t,o&&o.animations);return o&&o._cacheable&&(e[i]=Object.freeze(a)),a}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ca(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){var t=this.resolveDataElementOptions(t,e),i=this._sharedOptions,a=this.getSharedOptions(t),i=this.includeOptions(e,a)||a!==i;return this.updateSharedOptions(a,e,t),{sharedOptions:a,includeOptions:i}}updateElement(t,e,i,a){Ca(a)?Object.assign(t,i):this._resolveAnimations(e,a).update(t,i)}updateSharedOptions(t,e,i){t&&!Ca(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,a){t.active=a;var s=this.getStyle(e,a);this._resolveAnimations(e,i,a).update(t,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];var a=i.length,s=e.length,r=Math.min(s,a);r&&this.parse(0,r),a{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(s),n=t;n{a[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),a}}function Ta(t,e,i,a,s){var r=T(a,0),n=Math.min(T(s,t.length),t.length);let o,l,h,d=0;for(i=Math.ceil(i),s&&(i=(o=s-a)/Math.floor(o/i)),h=r;h<0;)d++,h=Math.round(r+d*i);for(l=Math.max(r,0);l"top"===e||"left"===e?t[e]+i:t[e]-i,Ea=(t,e)=>Math.min(e||t,t);function Ra(t,e){var i=[],a=t.length/e,s=t.length;let r=0;for(;rr?r:s,r=n&&s>r?s:r,{min:u(s,u(r,s)),max:u(r,u(s,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){c(this.options.beforeUpdate,[this])}update(t,e,i){var{beginAtZero:a,grace:s,ticks:r}=this.options,n=r.sampleSize,t=(this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Si(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks(),na)return t}}return Math.max(a,1)}(r,a,s);if(0{var e=t.gc,i=e.length/2;let a;if(y({width:r[t]||0,height:n[t]||0});return{first:w(0),last:w(e-1),widest:w(i),highest:w(M),widths:r,heights:n}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);t=this._startPixel+t*this._length;return mt(this._alignToPixels?Re(this.chart,t,0):t)}getDecimalForPixel(t){t=(t-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){var{min:t,max:e}=this;return t<0&&e<0?e:0n+1e-6)))return l}(this,b,f))&&(v=Re(c,x,a),p?_=M=k=P=v:y=w=S=D=v,m.push({tx1:_,ty1:y,tx2:M,ty2:w,x1:k,y1:S,x2:P,y2:D,width:a,color:s,borderDash:r,borderDashOffset:n,tickWidth:o,tickColor:l,tickBorderDash:h,tickBorderDashOffset:d}))}return this._ticksLength=r,this._borderValue=d,m}_computeLabelItems(t){let e=this.axis,i=this.options,{position:o,ticks:l}=i,h=this.isHorizontal(),d=this.ticks,{align:a,crossAlign:c,padding:s,mirror:u}=l,r=Ia(i.grid),n=r+s,g=u?-s:n,f=-L(this.labelRotation),p=[],m,b,x,v,_,y,M,w,k,S,P,D="middle";if("top"===o)_=this.bottom-g,y=this._getXAxisLabelAlignment();else if("bottom"===o)_=this.top+g,y=this._getXAxisLabelAlignment();else if("left"===o){let t=this._getYAxisLabelAlignment(r);y=t.textAlign,v=t.x}else if("right"===o){let t=this._getYAxisLabelAlignment(r);y=t.textAlign,v=t.x}else if("x"===e){if("center"===o)_=(t.top+t.bottom)/2+n;else if(A(o)){let t=Object.keys(o)[0],e=o[t];_=this.chart.scales[t].getPixelForValue(e)+n}y=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===o)v=(t.left+t.right)/2-n;else if(A(o)){let t=Object.keys(o)[0],e=o[t];v=this.chart.scales[t].getPixelForValue(e)}y=this._getYAxisLabelAlignment(r).textAlign}"y"===e&&("start"===a?D="top":"end"===a&&(D="bottom"));var C=this._getLabelSizes();for(m=0,b=d.length;mt.value===e))?i.setContext(this.getContext(t)).lineWidth:0}drawGrid(t){let e=this.options.grid,a=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),s,r;var n=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(e.display)for(s=0,r=i.length;s{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:t,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(e){var i=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",s=[];let r,t;for(r=0,t=i.length;r{var e=t.split("."),i=e.pop(),e=[s].concat(e).join("."),t=r[t].split("."),a=t.pop(),t=t.join(".");R.route(e,i,t,a)})),n.descriptors&&R.describe(e,n.descriptors),this.override&&R.override(t.id,t.overrides)),o;throw new Error("class does not have id: "+t)}get(t){return this.items[t]}unregister(t){var e=this.items,t=t.id,i=this.scope;t in e&&delete e[t],i&&t in R[i]&&(delete R[i][t],this.override)&&delete fe[t]}}var M=new class{constructor(){this.controllers=new Va(Aa,"datasets",!0),this.elements=new Va(e,"elements"),this.plugins=new Va(Object,"plugins"),this.scales=new Va(Fa,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(i,t,a){[...t].forEach(t=>{var e=a||this._getRegistryForType(t);a||e.isForType(t)||e===this.plugins&&t.id?this._exec(i,e,t):k(t,t=>{var e=a||this._getRegistryForType(t);this._exec(i,e,t)})})}_exec(t,e,i){var a=K(t);c(i["before"+a],[],i),e[t](i),c(i["after"+a],[],i)}_getRegistryForType(e){for(let t=0;tt.filter(e=>!i.some(t=>e.plugin.id===t.plugin.id));this._notify(a(e,i),t,"stop"),this._notify(a(i,e),t,"start")}}function Wa(t,e){var i=R.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Na(t){if("x"===t||"y"===t||"r"===t)return t}function Ha(e,...t){if(Na(e))return e;for(var i of t){let t=i.axis||("top"===(i=i.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||1{var e=o[t];if(!A(e))return console.error("Invalid scale configuration for scale: "+t);if(e._proxy)return console.warn("Ignoring resolver passed as options for scale: "+t);let i=Ha(t,e,function(e,t){if(t.data&&t.data.datasets){t=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(t.length)return ja(e,"x",t[0])||ja(e,"y",t[0])}return{}}(t,n),R.scales[e.type]),a=i===l?"_index_":"_value_",s=r.scales||{};h[t]=$(Object.create(null),[{axis:i},e,s[i],s[a]])}),n.data.datasets.forEach(a=>{let t=a.type||n.type,s=a.indexAxis||Wa(t,e),r=(fe[t]||{}).scales||{};Object.keys(r).forEach(t=>{var e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,s),i=a[e+"AxisID"]||e;h[i]=h[i]||Object.create(null),$(h[i],[{axis:e},o[i],r[t]])})}),Object.keys(h).forEach(t=>{t=h[t];$(t,[R.scales[t.type],R.scale])}),h}(t,e)}function $a(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let Ua=new Map,Xa=new Set;function qa(t,e){let i=Ua.get(t);return i||(i=e(),Ua.set(t,i),Xa.add(i)),i}let Ka=(t,e,i)=>{e=f(e,i);void 0!==e&&t.add(e)};class Ga{constructor(t){this._config=((t=(t=t)||{}).data=$a(t.data),Ya(t),t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$a(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){var t=this._config;this.clearCache(),Ya(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qa(t,()=>[["datasets."+t,""]])}datasetAnimationScopeKeys(t,e){return qa(t+".transition."+e,()=>[[`datasets.${t}.transitions.`+e,"transitions."+e],["datasets."+t,""]])}datasetElementScopeKeys(t,e){return qa(t+"-"+e,()=>[[`datasets.${t}.elements.`+e,"datasets."+t,"elements."+e,""]])}pluginScopeKeys(t){let e=t.id;return qa(this.type+"-plugin-"+e,()=>[["plugins."+e,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){var i=this._scopeCache;let a=i.get(t);return a&&!e||(a=new Map,i.set(t,a)),a}getOptionScopes(e,t,i){let{options:a,type:s}=this,r=this._cachedScopes(e,i),n=r.get(t);if(n)return n;let o=new Set;t.forEach(t=>{e&&(o.add(e),t.forEach(t=>Ka(o,e,t))),t.forEach(t=>Ka(o,a,t)),t.forEach(t=>Ka(o,fe[s]||{},t)),t.forEach(t=>Ka(o,R,t)),t.forEach(t=>Ka(o,pe,t))});i=Array.from(o);return 0===i.length&&i.push(Object.create(null)),Xa.has(t)&&r.set(t,i),i}chartOptionScopes(){var{options:t,type:e}=this;return[t,fe[e]||{},R.datasets[e]||{},{type:e},R,pe]}resolveNamedOptions(t,e,i,a=[""]){var s={$shared:!0},{resolver:a,subPrefixes:r}=Za(this._resolverCache,t,a);let n=a;!function(a,t){var s,{isScriptable:r,isIndexable:n}=Ue(a);for(s of t){let t=r(s),e=n(s),i=(e||t)&&a[s];if(t&&(g(i)||Ja(i))||e&&O(i))return 1}}(a,e)||(s.$shared=!1,n=$e(a,i=g(i)?i():i,this.createResolver(t,i,r)));for(let t of e)s[t]=n[t];return s}createResolver(t,e,i=[""],a){t=Za(this._resolverCache,t,i).resolver;return A(e)?$e(t,e,void 0,a):t}}function Za(t,e,i){let a=t.get(e);a||(a=new Map,t.set(e,a));t=i.join();let s=a.get(t);return s||(s={resolver:Ye(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},a.set(t,s)),s}let Ja=i=>A(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||g(i[e]),!1),Qa=["top","bottom","left","right","chartArea"];function ts(t,e){return"top"===t||"bottom"===t||-1===Qa.indexOf(t)&&"x"===e}function es(i,a){return function(t,e){return t[i]===e[i]?t[a]-e[a]:t[i]-e[i]}}function is(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),c(i&&i.onComplete,[t],e)}function as(t){var e=t.chart,i=e.options.animation;c(i&&i.onProgress,[t],e)}function ss(t){return xe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t=t&&t.canvas?t.canvas:t}let rs={},ns=t=>{let e=ss(t);return Object.values(rs).filter(t=>t.canvas===e).pop()};class i{static defaults=R;static instances=rs;static overrides=fe;static registry=M;static version="4.3.3";static getChart=ns;static register(...t){M.add(...t),os()}static unregister(...t){M.remove(...t),os()}constructor(t,e){var e=this.config=new Ga(e),t=ss(t),i=ns(t);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");var i=e.createResolver(e.chartOptionScopes(),this.getContext()),e=(this.platform=new(e.platform||fa(t)),this.platform.updateConfig(e),this.platform.acquireContext(t,i.aspectRatio)),t=e&&e.canvas,a=t&&t.height,s=t&&t.width;this.id=F(),this.ctx=e,this.canvas=t,this.width=s,this.height=a,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ba,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Pt(t=>this.update(t),i.resizeDelay||0),this._dataChanges=[],rs[this.id]=this,e&&t?(r.listen(this,"complete",is),r.listen(this,"progress",as),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){var{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:a,_aspectRatio:s}=this;return P(t)?e&&s?s:a?i/a:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return M}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ce(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ie(this.canvas,this.ctx),this}stop(){return r.stop(this),this}resize(t,e){r.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){var i=this.options,a=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(a,t,e,s),t=i.devicePixelRatio||this.platform.getDevicePixelRatio(),e=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ce(this,t,!0)&&(this.notifyPlugins("resize",{size:a}),c(i.onResize,[this,a],this),this.attached)&&this._doResize(e)&&this.render()}ensureScalesHaveIDs(){k(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let n=this.options,a=n.scales,o=this.scales,l=Object.keys(o).reduce((t,e)=>(t[e]=!1,t),{}),t=[];k(t=a?t.concat(Object.keys(a).map(t=>{var e=a[t],t=Ha(t,e),i="r"===t,t="x"===t;return{options:e,dposition:i?"chartArea":t?"bottom":"left",dtype:i?"radialLinear":t?"category":"linear"}})):t,t=>{var e=t.options,i=e.id,a=Ha(i,e),s=T(e.type,t.dtype);void 0!==e.position&&ts(e.position,a)===ts(t.dposition)||(e.position=t.dposition),l[i]=!0;let r=null;i in o&&o[i].type===s?r=o[i]:(r=new(M.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),o[r.id]=r),r.init(e,n)}),k(l,(t,e)=>{t||delete o[e]}),k(o,t=>{s.configure(this,t,t.options),s.addBox(this,t)})}_updateMetasets(){var t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),ei.length&&delete this._stacks,t.forEach((e,t)=>{0===i.filter(t=>t===e._dataset).length&&this._destroyDatasetMeta(t)})}buildOrUpdateControllers(){let s=[],e=this.data.datasets,r,t;for(this._removeUnreferencedMetasets(),r=0,t=e.length;r{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config,i=(e.update(),this._options=e.createResolver(e.chartOptionScopes(),this.getContext())),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let i=0,t=this.data.datasets.length;i{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(es("z","_idx"));var{_active:t,_lastEvent:n}=this;n?this._eventHandler(n,!0):t.length&&this._updateHoverStyles(t,t,!0),this.render()}}_updateScales(){k(this.scales,t=>{s.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Z(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){var e,i,a,s,r=this["_hiddenIndices"];for({method:e,start:i,count:a}of this._getUniformDataChanges()||[]){n=void 0;o=void 0;l=void 0;s=void 0;h=void 0;var n=r;var o=i;var l="_removeElements"===e?-a:a;let t=Object.keys(n);for(var h of t){let t=+h;t>=o&&(s=n[h],delete n[h],0o)&&(n[t+l]=s)}}}_getUniformDataChanges(){let t=this._dataChanges;if(t&&t.length){this._dataChanges=[];var e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),a=i(0);for(let t=1;tt.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}}_updateLayout(i){if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){s.update(this,this.width,this.height,i);let t=this.chartArea,e=t.width<=0||t.height<=0;this._layers=[],k(this.boxes,t=>{e&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}}_updateDatasets(i){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:i,cancelable:!0})){for(let t=0,e=this.data.datasets.length;tt&&t._dataset===e).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(a)),a}getContext(){return this.$context||(this.$context=Pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){var e=this.data.datasets[t];return!!e&&("boolean"==typeof(t=this.getDatasetMeta(t)).hidden?!t.hidden:!e.hidden)}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(e,t,i){let a=i?"show":"hide",s=this.getDatasetMeta(e),r=s.controller._resolveAnimations(void 0,a);G(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(s,{visible:i}),this.update(t=>t.datasetIndex===e?a:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),r.remove(this),t=0,e=this.data.datasets.length;t{a.addEventListener(this,t,e),i[t]=e},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};k(this.options.events,t=>e(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let i=this._responsiveListeners,a=this.platform,t=(t,e)=>{a.addEventListener(this,t,e),i[t]=e},e=(t,e)=>{i[t]&&(a.removeEventListener(this,t,e),delete i[t])},s=(t,e)=>{this.canvas&&this.resize(t,e)},r,n=()=>{e("attach",n),this.attached=!0,this.resize(),t("resize",s),t("detach",r)};r=()=>{this.attached=!1,e("resize",s),this._stop(),this._resize(0,0),t("attach",n)},(a.isAttached(this.canvas)?n:r)()}unbindEvents(){k(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},k(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){var a=i?"set":"remove";let s,r,n;for("dataset"===t&&this.getDatasetMeta(e[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),r=0,n=e.length;r{var i=this.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("No dataset found at index "+t)});W(t,e)||(this._active=t,this._lastEvent=null,this._updateHoverStyles(t,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(e){return 1===this._plugins._cache.filter(t=>t.plugin.id===e).length}_updateHoverStyles(t,e,i){var a=this.options.hover,s=(t,i)=>t.filter(e=>!i.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),r=s(e,t),i=i?t:s(t,e);r.length&&this.updateHoverStyle(r,a.mode,!1),i.length&&a.mode&&this.updateHoverStyle(i,a.mode,!0)}_eventHandler(e,t){var i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1!==this.notifyPlugins("beforeEvent",i,a))return t=this._handleEvent(e,t,i.inChartArea),i.cancelable=!1,this.notifyPlugins("afterEvent",i,a),(t||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:a=[],options:s}=this,r=e,n=this._getActiveElements(t,a,i,r),o=J(t),l=(h=t,d=this._lastEvent,i&&"mouseout"!==h.type?o?d:h:null);i&&(this._lastEvent=null,c(s.onHover,[t,n,this],this),o)&&c(s.onClick,[t,n,this],this);var h,d=!W(n,a);return(d||e)&&(this._active=n,this._updateHoverStyles(n,a,e)),this._lastEvent=l,d}_getActiveElements(t,e,i,a){return"mouseout"===t.type?[]:i?(i=this.options.hover,this.getElementsAtEventForMode(t,i.mode,i,a)):e}}function os(){k(i.instances,t=>t._plugins.invalidate())}function ls(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var hs={_date:class $r{static override(t){Object.assign($r.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return ls()}parse(){return ls()}format(){return ls()}add(){return ls()}diff(){return ls()}startOf(){return ls()}endOf(){return ls()}}};function ds(i,a,s,r){if(O(i)){var n=i,o=a,l=s,h=r,d=l.parse(n[0],h),n=l.parse(n[1],h),h=Math.min(d,n),c=Math.max(d,n);let t=h,e=c;Math.abs(h)>Math.abs(c)&&(t=c,e=h),o[l.axis]=e,o._custom={barStart:t,barEnd:e,start:d,end:n,min:h,max:c}}else a[s.axis]=s.parse(i,r);return a}function cs(t,e,i,a){var s=t.iScale,r=t.vScale,n=s.getLabels(),o=s===r,l=[];let h,d,c,u;for(d=(h=i)+a;h"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(r){var t=r.data;if(t.labels.length&&t.datasets.length){let{pointStyle:a,color:s}=r.legend.options["labels"];return t.labels.map((t,e)=>{var i=r.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:s,lineWidth:i.borderWidth,pointStyle:a,hidden:!r.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(a,s){let r=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=r;else{let t,e,i=t=>+r[t];if(A(r[a])){let{key:e="value"}=this._parsing;i=t=>+f(r[t],e)}for(e=(t=a)+s;tpt(t,a,s,!0)?1:Math.max(e,e*f,i,i*f),o=(t,e,i)=>pt(t,a,s,!0)?-1:Math.min(e,e*f,i,i*f),l=n(0,t,i),h=n(D,e,r),d=o(S,t,i),c=o(S+D,e,r);p=(l-d)/2,m=(h-c)/2,b=-(l+d)/2,x=-(h+c)/2}return{ratioX:p,ratioY:m,offsetX:b,offsetY:x}}(l,o,r),l=(e.width-s)/l,e=(e.height-s)/o,s=Math.max(Math.min(l,e)/2,0),o=B(this.options.radius,s),l=(o-Math.max(o*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=h*o,this.offsetY=d*o,i.total=this.calculateTotal(),this.outerRadius=o-l*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-l*n,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){var i=this.options,a=this._cachedMeta,s=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===a._parsed[t]||a.data[t].hidden?0:this.calculateCircumference(a._parsed[t]*s/v)}updateElements(a,t,e,s){let r="reset"===s,i=this.chart,n=i.chartArea,o=i.options.animation,l=(n.left+n.right)/2,h=(n.top+n.bottom)/2,d=r&&o.animateScale,c=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:g,includeOptions:f}=this._getSharedOptions(t,s),p,m=this._getRotation();for(p=0;p{var i=r.getDatasetMeta(0).controller.getStyle(e);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:s,lineWidth:i.borderWidth,pointStyle:a,hidden:!r.getDataVisibility(e),index:e}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,a=i.data.labels||[],e=ce(e._parsed[t].r,i.options.locale);return{label:a[t]||"",value:e}}parseObjectData(t,e,i,a){return ii.bind(this)(t,e,i,a)}update(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,a={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,e)=>{var i=this.getParsed(e).r;!isNaN(i)&&this.chart.getDataVisibility(e)&&(ia.max)&&(a.max=i)}),a}_updateRadius(){var t=this.chart,e=t.chartArea,i=t.options,e=Math.min(e.right-e.left,e.bottom-e.top),e=Math.max(e/2,0),i=(e-Math.max(i.cutoutPercentage?e/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=e-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(s,t,e,r){var n="reset"===r,o=this.chart,l=o.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,c=h.yCenter,u=h.getIndexAngle(0)-.5*S;let g,f=u;var p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(e).r)&&this.chart.getDataVisibility(e)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?L(this.resolveDataElementOptions(t,e).angle||i):0}}Oe=Object.freeze({__proto__:null,BarController:class extends Aa{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,a){return cs(t,e,i,a)}parseArrayData(t,e,i,a){return cs(t,e,i,a)}parseObjectData(t,e,i,a){var{iScale:s,vScale:r}=t,{xAxisKey:t="x",yAxisKey:n="y"}=this._parsing,o="x"===s.axis?t:n,l="x"===r.axis?t:n,h=[];let d,c,u,g;for(c=(d=i)+a;db.x,e="left","right"):(t=b.baset.controller.options.grouped),s=t.options.stacked,r=[];for(let t of a)if((void 0===i||!(t=>{var e=t.controller.getParsed(i),e=e&&e[t.vScale.axis];if(P(e)||isNaN(e))return!0})(t))&&((!1===s||-1===r.indexOf(t.stack)||void 0===s&&void 0===t.stack)&&r.push(t.stack),t.index===e))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){t=this._getStacks(t,i),i=void 0!==e?t.indexOf(e):-1;return-1===i?t.length-1:i}_getRuler(){var t=this.options,e=this._cachedMeta,i=e.iScale,a=[];let s,r;for(s=0,r=e.data.length;st-e))}return a._cache.$bar}(e,t.type);let a,s,r,n,o=e._length;var l=()=>{32767!==r&&-32768!==r&&(G(n)&&(o=Math.min(o,Math.abs(r-n)||o)),n=r)};for(a=0,s=i.length;a=m?1:-1))*o),g===l&&(x-=u/2);let t=s.getPixelForDecimal(0),e=s.getPixelForDecimal(1),i=Math.min(t,e),a=Math.max(t,e);x=Math.max(Math.min(x,a),i),c=x+u,r&&!d&&(h._stacks[s.axis]._visualValues[n]=s.getValueForPixel(c)-s.getValueForPixel(x))}if(x===s.getPixelForValue(l)){let t=_(u)*s.getLineWidthForValue(l)/2;x+=t,u-=t}return{size:u,base:x,head:c,center:c+u/2}}_calculateBarIndexPixels(a,s){let t=s.scale,r=this.options,n=r.skipNull,o=T(r.maxBarThickness,1/0),l,h;if(s.grouped){let t=n?this._getStackCount(a):s.stackCount,e=("flex"===r.barThickness?function(t,e,i,a){var s=e.pixels,r=s[t];let n=0=x?e.skip=!0:(M=P((y=this.getParsed(i))[f]),w=e[g]=o.getPixelForValue(y[g],i),k=e[f]=n||M?l.getBasePixel():l.getPixelForValue(h?this.applyStack(l,y,h):y[f],i),e.skip=isNaN(w)||isNaN(k)||M,e.stop=0m,p&&(e.parsed=y,e.raw=d.data[i]),u&&(e.options=c||this.resolveDataElementOptions(i,t.active?"active":r)),b||this.updateElement(t,i,e,r),_=y)}}getMaxOverflow(){var t,e=this._cachedMeta,i=e.dataset,i=i.options&&i.options.borderWidth||0,e=e.data||[];return e.length?(t=e[0].size(this.resolveDataElementOptions(0)),e=e[e.length-1].size(this.resolveDataElementOptions(e.length-1)),Math.max(i,t,e)/2):i}draw(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends ps{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:ms,RadarController:class extends Aa{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){var e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,a){return ii.bind(this)(t,e,i,a)}update(e){let t=this._cachedMeta,i=t.dataset,a=t.data||[],s=t.iScale.getLabels();if(i.points=a,"resize"!==e){let t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);var r={_loop:!0,_fullLoop:s.length===a.length,options:t};this.updateElement(i,void 0,r,e)}this.updateElements(a,0,a.length,e)}updateElements(o,t,e,l){var h=this._cachedMeta.rScale,d="reset"===l;for(let n=t;nv,x&&(i.parsed=e,i.raw=g.data[n]),p&&(i.options=f||this.resolveDataElementOptions(n,t.active?"active":l)),_||this.updateElement(t,n,i,l),y=e}this.updateSharedOptions(f,l,i)}getMaxOverflow(){var t,e,i=this._cachedMeta,a=i.data||[];if(this.options.showLine)return i=(i=i.dataset).options&&i.options.borderWidth||0,a.length?(t=a[0].size(this.resolveDataElementOptions(0)),e=a[a.length-1].size(this.resolveDataElementOptions(a.length-1)),Math.max(i,t,e)/2):i;{let e=0;for(let t=a.length-1;0<=t;--t)e=Math.max(e,a[t].size(this.resolveDataElementOptions(t))/2);return 0{var e=(i-Math.min(s,t))*a/2;return C(t,0,Math.min(s,e))};return{outerStart:n(t.outerStart),outerEnd:n(t.outerEnd),innerStart:C(t.innerStart,0,r),innerEnd:C(t.innerEnd,0,r)}}(t,h,c,l-g),b=c-d,x=c-f,v=g+d/b,_=l-f/x,y=h+p,M=h+m,w=g+p/y,k=l-m/M;if(s.beginPath(),r){let t=(v+_)/2;if(s.arc(n,o,c,v,t),s.arc(n,o,c,t,_),0(n+(h?o-t:t))%r,v=()=>{g!==f&&(a.lineTo(m,f),a.lineTo(m,g),a.lineTo(m,p))};for(l&&(c=s[x(0)],a.moveTo(c.x,c.y)),d=0;d<=o;++d)if(!(c=s[x(d)]).skip){let t=c.x,e=c.y,i=0|t;i===u?(ef&&(f=e),m=(b*m+t)/++b):(v(),a.lineTo(t,e),u=i,b=0,g=f=e),p=e}v()}function ks(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?Ms:ws}let Ss="function"==typeof Path2D;class Ps extends e{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){var i,a=this.options;!a.tension&&"monotone"!==a.cubicInterpolationMode||a.stepped||this._pointsUpdated||(i=a.spanGaps?this._loop:this._fullLoop,hi(this._points,a,t,i,e),this._pointsUpdated=!0)}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ri(this,this.options.segment))}first(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(r,n){var o=this.options,l=r[n],h=this.points,d=Ei(this,{property:n,start:l,end:l});if(d.length){var c,u=[],g=o.stepped?pi:o.tension||"monotone"===o.cubicInterpolationMode?mi:fi;let s,t;for(s=0,t=d.length;s"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){var{angle:t,distance:e}=ut(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:i,endAngle:a,innerRadius:s,outerRadius:r,circumference:n}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),o=(this.options.spacing+this.options.borderWidth)/2,n=T(n,a-i)>=v||pt(t,i,a),t=d(e,s+o,r+o);return n&&t}getCenterPoint(t){var{x:t,y:e,startAngle:i,endAngle:a,innerRadius:s,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:n,spacing:o}=this.options,i=(i+a)/2,a=(s+r+o+n)/2;return{x:t+Math.cos(i)*a,y:e+Math.sin(i)*a}}tooltipPosition(t){return this.getCenterPoint(t)}draw(e){var{options:i,circumference:a}=this,s=(i.offset||0)/4,r=(i.spacing||0)/2,n=i.circular;if(this.pixelMargin="inner"===i.borderAlign?.33:0,this.fullCircles=a>v?Math.floor(a/v):0,!(0===a||this.innerRadius<0||this.outerRadius<0)){e.save();var o=(this.startAngle+this.endAngle)/2,o=(e.translate(Math.cos(o)*s,Math.sin(o)*s),s*(1-Math.sin(Math.min(S,a||0))));e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor;{var l=e;s=this;a=o;i=r;var h=n;var{fullCircles:d,startAngle:c,circumference:u}=s;let t=s.endAngle;if(d){xs(l,s,a,i,t,h);for(let t=0;ta=e?a:t,o=t=>s=i?s:t;if(t){let t=_(a),e=_(s);t<0&&e<0?o(0):0g&&(M=rt(y*M/g/u)*u),P(o)||(x=Math.pow(10,o),M=Math.ceil(M*x)/x),_="ticks"===a?(v=Math.floor(e/M)*M,Math.ceil(f/M)*M):(v=e,f),p&&m&&s&<((n-r)/s,M/1e3)?(y=Math.round(Math.min((n-r)/M,h)),M=(n-r)/y,v=r,_=n):b?(v=p?r:v,_=m?n:_,y=l-1,M=(_-v)/y):y=st(y=(_-v)/M,Math.round(y),M/1e3)?Math.round(y):Math.ceil(y);g=Math.max(ct(M),ct(v));x=Math.pow(10,P(o)?g:o),v=Math.round(v*x)/x,_=Math.round(_*x)/x;let w=0;for(p&&(c&&v!==r?(i.push({value:r}),vn)break;i.push({value:t})}return m&&c&&_!==n?i.length&&st(i[i.length-1].value,n,Is(n,d,t))?i[i.length-1].value=n:i.push({value:n}):m&&_!==n||i.push({value:_}),i}({maxTicks:Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&ht(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){var t=this.ticks;let e=this.min,i=this.max;super.configure(),this.options.offset&&t.length&&(t=(i-e)/Math.max(t.length-1,1)/2,e-=t,i+=t),this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ce(t,this.chart.options.locale,this.options.ticks.format)}}class Fs extends zs{static id="linear";static defaults={ticks:{callback:ge.formatters.numeric}};determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?t:0,this.max=p(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){var t=this.isHorizontal(),e=t?this.width:this.height,i=L(this.options.ticks.minRotation),t=(t?Math.sin(i):Math.cos(i))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/t))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}let Vs=t=>Math.floor(o(t)),Bs=(t,e)=>Math.pow(10,Vs(t)+e);function Ws(t){return 1==t/Math.pow(10,Vs(t))}function Ns(t,e,i){i=Math.pow(10,i),t=Math.floor(t/i);return Math.ceil(e/i)-t}class Hs extends Fa{static id="logarithmic";static defaults={ticks:{callback:ge.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){t=zs.prototype.parse.apply(this,[t,e]);if(0!==t)return p(t)&&0a=e?a:t,r=t=>s=i?s:t;a===s&&(a<=0?(t(1),r(10)):(t(Bs(a,-1)),r(Bs(s,1)))),a<=0&&t(Bs(s,-1)),s<=0&&r(Bs(a,1)),this.min=a,this.max=s}buildTicks(){var t=this.options,e=function(t,{min:e,max:i}){e=u(t.min,e);var a=[],s=Vs(e);let r=function(t,e){let i=Vs(e-t);for(;10r?Math.pow(10,s):0,s=Math.round((e-l)*n)/n,h=Math.floor((e-l)/o/10)*o*10;let d=Math.floor((s-h)/Math.pow(10,r)),c=u(t.min,Math.round((l+h+d*Math.pow(10,r))*n)/n);for(;cf.r&&(i=(m.end-f.r)/t,g.r=Math.max(g.r,f.r+i)),b.startf.b&&(a=(b.end-f.b)/e,g.b=Math.max(g.b,f.b+a))}}var c,u;i.setCenterPoint(s.l-r.l,r.r-s.r,s.t-r.t,r.b-s.b),i._pointLabelItems=function(i,a,s){let r=[],t=i._pointLabels.length,e=i.options,{centerPointLabels:n,display:o}=e.pointLabels,l={extra:js(e)/2,additionalAngle:n?S/t:0},h;for(let e=0;et,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){var t=this._padding=I(js(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!1);this.min=p(t)&&!isNaN(t)?t:0,this.max=p(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/js(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{t=c(this.options.pointLabels.callback,[t,e],this);return t||0===t?t:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){var t=this.options;t.display&&t.pointLabels.display?$s(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,a){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,a))}getIndexAngle(t){return x(t*(v/(this._pointLabels.length||1))+L(this.options.startAngle||0))}getDistanceFromCenterForValue(t){var e;return P(t)?NaN:(e=this.drawingArea/(this.max-this.min),this.options.reverse?(this.max-t)*e:(t-this.min)*e)}getValueForDistanceFromCenter(t){return P(t)?NaN:(t=t/(this.drawingArea/(this.max-this.min)),this.options.reverse?this.max-t:this.min+t)}getPointLabelContext(t){var e=this._pointLabels||[];if(0<=t&&t0!==t)?(m.beginPath(),je(m,{x:b,y:f,w:y,h:v,radius:t}),m.fill()):m.fillRect(b,f,y,v)}var x=z(p.font),{x:M,y:_,textAlign:m}=t;He(u,i._pointLabels[e],M,_+x.lineHeight/2,x,{color:p.color,textAlign:m,textBaseline:"middle"})}}}if(l.display&&this.ticks.forEach((t,e)=>{var i,a,s,r,n,o;0!==e&&(c=this.getDistanceFromCenterForValue(t.value),t=this.getContext(e),e=l.setContext(t),t=h.setContext(t),i=this,e=e,a=c,s=d,t=t,r=i.ctx,n=e.circular,{color:e,lineWidth:o}=e,!n&&!s||!e||!o||a<0||(r.save(),r.strokeStyle=e,r.lineWidth=o,r.setLineDash(t.dash),r.lineDashOffset=t.dashOffset,r.beginPath(),Us(i,a,n,s),r.closePath(),r.stroke(),r.restore()))}),r.display){for(a.save(),n=d-1;0<=n;n--){let t=r.setContext(this.getPointLabelContext(n)),{color:e,lineWidth:i}=t;i&&e&&(a.lineWidth=i,a.strokeStyle=e,a.setLineDash(t.borderDash),a.lineDashOffset=t.borderDashOffset,c=this.getDistanceFromCenterForValue(s.ticks.reverse?this.min:this.max),o=this.getPointPosition(n,c),a.beginPath(),a.moveTo(this.xCenter,this.yCenter),a.lineTo(o.x,o.y),a.stroke())}a.restore()}}drawBorder(){}drawLabels(){let n=this.ctx,o=this.options,l=o.ticks;if(l.display){var t=this.getIndexAngle(0);let s,r;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((e,t)=>{if(0!==t||o.reverse){var i=l.setContext(this.getContext(t)),a=z(i.font);if(s=this.getDistanceFromCenterForValue(this.ticks[t].value),i.showLabelBackdrop){n.font=a.string,r=n.measureText(e.label).width,n.fillStyle=i.backdropColor;let t=I(i.backdropPadding);n.fillRect(-r/2-t.left,-s-a.size/2-t.top,r+t.width,a.size+t.height)}He(n,e.label,0,-s,a,{color:i.color,strokeColor:i.textStrokeColor,strokeWidth:i.textStrokeWidth})}}),n.restore()}}drawTitle(){}}let qs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},h=Object.keys(qs);function Ks(t,e){return t-e}function Gs(t,e){if(P(e))return null;var i=t._adapter,{parser:t,round:a,isoWeekday:s}=t._parseOpts;let r=e;return null===(r=p(r="function"==typeof t?t(r):r)?r:"string"==typeof t?i.parse(r,t):i.parse(r))?null:+(r=a?"week"!==a||!ot(s)&&!0!==s?i.startOf(r,a):i.startOf(r,"isoWeek",s):r)}function Zs(t,a,s,r){let e=h.length;for(let i=h.indexOf(t);i=e?i[a]:i[s]]=!0):t[e]=!0}function Qs(i,t,a){var s=[],r={},e=t.length;let n,o;for(n=0;n=h.indexOf(t);e--){let t=h[e];if(qs[t].common&&i._adapter.diff(r,s,t)>=a-1)return t}return h[t?h.indexOf(t):0]}(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(i){for(let t=h.indexOf(i)+1,e=h.length;t+t.value))}initOffsets(t=[]){let e,i,a=0,s=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),a=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),s=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);t=t.length<3?.5:.25;a=C(a,0,t),s=C(s,0,t),this._offsets={start:a,end:s,factor:1/(a+1+s)}}_generate(){var t=this._adapter,e=this.min,i=this.max,a=this.options,s=a.time,r=s.unit||Zs(s.minUnit,e,i,this._getLabelCapacity(e)),n=T(a.ticks.stepSize,1),s="week"===r&&s.isoWeekday,o=ot(s)||!0===s,l={};let h,d,c=e;if(o&&(c=+t.startOf(c,"isoWeek",s)),c=+t.startOf(c,o?"day":r),t.diff(i,e,r)>1e5*n)throw new Error(e+" and "+i+" are too far apart with stepSize of "+n+" "+r);var u="data"===a.ticks.source&&this.getDataTimestamps();for(h=c,d=0;h+t)}getLabelForValue(t){var e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){var i=this.options.time.displayFormats,a=this._unit,e=e||i[a];return this._adapter.format(t,e)}_tickFormatFunction(t,e,i,a){var s,r=this.options,n=r.ticks.callback;return n?c(n,[t,e,i],this):(n=r.time.displayFormats,r=this._unit,s=this._majorUnit,r=r&&n[r],n=s&&n[s],i=i[e],e=s&&n&&i&&i.major,this._adapter.format(t,a||(e?n:r)))}generateTickLabels(t){let e,i,a;for(e=0,i=t.length;e=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=m(t,"pos",e)),{pos:a,time:r}=t[o],{pos:s,time:n}=t[l]):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=m(t,"time",e)),{time:a,pos:r}=t[o],{time:s,pos:n}=t[l]);i=s-a;return i?r+(n-r)*(e-a)/i:r}let ir=Object.freeze({__proto__:null,CategoryScale:class extends Fa{static id="category";static defaults={ticks:{callback:Rs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){var e=this._addedLabels;if(e.length){let t=this.getLabels();for(var{index:i,label:a}of e)t[i]===a&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){var i,a,s,r,n,o,l;return P(t)||(i=this.getLabels(),r=e=isFinite(e)&&i[e]===t?e:(a=i,s=T(e,t=t),r=this._addedLabels,-1===(l=a.indexOf(t))?(o=s,r=r,"string"==typeof(n=t)?(o=a.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o):l!==a.lastIndexOf(t)?s:l),n=i.length-1,null===r)?null:C(Math.round(r),0,n)}determineDataLimits(){var{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:a}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(a=this.getLabels().length-1)),this.min=i,this.max=a}buildTicks(){var e=this.min,i=this.max,t=this.options.offset,a=[];let s=this.getLabels();s=0===e&&i===s.length-1?s:s.slice(e,i+1),this._valueRange=Math.max(s.length-(t?0:1),1),this._startValue=this.min-(t?.5:0);for(let t=e;t<=i;t++)a.push({value:t});return a}getLabelForValue(t){return Rs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return null===(t="number"!=typeof t?this.parse(t):t)?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Fs,LogarithmicScale:Hs,RadialLinearScale:Xs,TimeScale:tr,TimeSeriesScale:class extends tr{static id="timeseries";static defaults=tr.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){var t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=er(e,this.min),this._tableRange=er(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){var{min:e,max:i}=this,a=[],s=[];let r,n,o,l,h;for(r=0,n=t.length;r=e&&l<=i&&a.push(l);if(a.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,n=a.length;rt-e)}_getTimestampsForTable(){var t,e,i=this._cache.all||[];return i.length||(t=this.getDataTimestamps(),e=this.getLabelTimestamps(),i=t.length&&e.length?this.normalize(t.concat(e)):t.length?t:e,i=this._cache.all=i),i}getDecimalForValue(t){return(er(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return er(this._table,t*this._tableRange+this._minPos,!0)}}}),ar=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],sr=ar.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function rr(t){return ar[t%ar.length]}function nr(t){return sr[t%sr.length]}function or(r){let n=0;return(t,e)=>{var i,a,s,e=r.getDatasetMeta(e).controller;e instanceof ps?n=(a=t,s=n,a.backgroundColor=a.data.map(()=>rr(s++)),s):e instanceof ms?n=(a=t,i=n,a.backgroundColor=a.data.map(()=>nr(i++)),i):e&&(n=(e=t,t=n,e.borderColor=rr(t),e.backgroundColor=nr(t),++t))}}function lr(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return 1}var hr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){var a,s,r;i.enabled&&({data:{datasets:a},options:s}=t.config,r=s["elements"],!i.forceOverride&&(lr(a)||s&&(s.borderColor||s.backgroundColor)||r&&lr(r))||(i=or(t),a.forEach(i)))}};function dr(t){var e;t._decimated&&(e=t._data,delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e}))}function cr(t){t.data.datasets.forEach(t=>{dr(t)})}var ur={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(l,t,M)=>{if(M.enabled){let o=l.width;l.data.datasets.forEach((e,t)=>{var{_data:i,indexAxis:a}=e,h=l.getDatasetMeta(t),s=i||e.data;if("y"!==ki([a,l.options.indexAxis])&&h.controller.supportsDecimation){t=l.scales[h.xAxisID];if(("linear"===t.type||"time"===t.type)&&!l.options.parsing){var{start:r,count:n}=function(t){var e=t.length;let i,a=0;var s=h["iScale"],{min:r,max:n,minDefined:o,maxDefined:l}=s.getUserBounds();return o&&(a=C(m(t,s.axis,r).lo,0,e-1)),i=l?C(m(t,s.axis,n).hi+1,a,e)-a:e-a,{start:a,count:i}}(s);if(n<=(M.threshold||4*o))dr(e);else{let t;switch(P(i)&&(e._data=s,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),M.algorithm){case"lttb":t=function(n,o,l,t){var e=M.samples||t;if(l<=e)return n.slice(o,o+l);var h=[],d=(l-2)/(e-2);let c=0,i=o+l-1,u,g,f,p,m,b=o;for(h[c++]=n[b],u=0;uf&&(f=p,g=n[t],m=t);h[c++]=g,b=m}return h[c++]=n[i],h}(s,r,n,o);break;case"min-max":t=function(a,t,e,i){let s,r,n,o,l,h,d,c,u,g,f=0,p=0;var m=[],b=a[t].x,x=a[t+e-1].x-b;for(s=t;sg&&(g=o,d=s),f=(p*f+r.x)/++p;else{let i=s-1;if(!P(h)&&!P(d)){let t=Math.min(h,d),e=Math.max(h,d);t!==c&&t!==i&&m.push({...a[t],x:f}),e!==c&&e!==i&&m.push({...a[e],x:f})}0{e=fr(t,e,s);t=s[t],e=s[e];null!==a?(r.push({x:t.x,y:a}),r.push({x:e.x,y:a})):null!==i&&(r.push({x:i,y:t.y}),r.push({x:i,y:e.y}))}),r}(t)).length?new Ps({points:i,options:{tension:0},_loop:a,_fullLoop:a}):null}function br(t){return t&&!1!==t.fill}function xr(e,i,a){var s=[];for(let t=0;t{let{boxHeight:i=e,boxWidth:a=e}=t;return t.usePointStyle&&(i=Math.min(i,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:i,itemHeight:Math.max(e,i)}};class Dr extends e{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let i=this.options.labels||{},t=c(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(t=>i.filter(t,this.chart.data))),i.sort&&(t=t.sort((t,e)=>i.sort(t,e,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){var{options:i,ctx:a}=this;if(i.display){var s=i.labels,r=z(s.font),n=r.size,o=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=Pr(s,n);let t,e;a.font=r.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(o,n,s,l)+10):(e=this.maxHeight,t=this._fitCols(o,r,s,l)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.maxHeight||this.maxHeight)}else this.width=this.height=0}_fitRows(t,i,a,s){let{ctx:r,maxWidth:n,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],d=s+o,c=t,u=(r.textAlign="left",r.textBaseline="middle",-1),g=-d;return this.legendItems.forEach((t,e)=>{t=a+i/2+r.measureText(t.text).width;(0===e||h[h.length-1]+t+2*o>n)&&(c+=d,h[h.length-(0{n=l,i=o,a=d,s=t,r=h;var i,a,s,r,{itemWidth:t,itemHeight:n}={itemWidth:function(t,e,i){let a=s.text;return a&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e)),t+e.size/2+i.measureText(a).width}(n,i,a),itemHeight:function(t){let e=r;return e="string"!=typeof s.text?Cr(s,t):e}(i.lineHeight)};0f&&(p+=m+c,g.push({width:m,height:b}),x+=m+c,v++,m=b=0),u[e]={left:x,top:b,col:v,width:t,height:n},m=Math.max(m,t),b+=n+c}),p+=m,g.push({width:m,height:b}),p}adjustHitBoxes(){if(this.options.display){var i=this._computeTitleHeight(),{legendHitBoxes:a,options:{align:s,labels:{padding:r},rtl:t}}=this,n=Di(t,this.left,this.width);if(this.isHorizontal()){let t=0,e=E(s,this.left+r,this.right-this.lineWidths[t]);for(var o of a)t!==o.row&&(t=o.row,e=E(s,this.left+r,this.right-this.lineWidths[t])),o.top+=this.top+i+r,o.left=n.leftForLtr(n.x(e),o.width),e+=o.width+r}else{let t=0,e=E(s,this.top+i+r,this.bottom-this.columnSizes[t].height);for(var l of a)l.col!==t&&(t=l.col,e=E(s,this.top+i+r,this.bottom-this.columnSizes[t].height)),l.top=e,l.left+=this.left+r,l.left=n.leftForLtr(n.x(l.left),l.width),e+=l.height+r}}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){var t;this.options.display&&(Ve(t=this.ctx,this),this._draw(),Be(t))}_draw(){let{options:h,columnSizes:d,lineWidths:c,ctx:u}=this,{align:g,labels:f}=h,p=R.color,m=Di(h.rtl,this.left,this.width),b=z(f.font),x=f["padding"],v=b.size,_=v/2,y,{boxWidth:M,boxHeight:w,itemHeight:k}=(this.drawTitle(),u.textAlign=m.textAlign("left"),u.textBaseline="middle",u.lineWidth=.5,u.font=b.string,Pr(f,v)),S=this.isHorizontal(),P=this._computeTitleHeight(),D=(y=S?{x:E(g,this.left+x,this.right-c[0]),y:this.top+x+P,line:0}:{x:this.left+x,y:E(g,this.top+P+x,this.bottom-d[0].height),line:0},Ci(this.ctx,h.textDirection),k+x);this.legendItems.forEach((e,a)=>{u.strokeStyle=e.fontColor,u.fillStyle=e.fontColor;var t=u.measureText(e.text).width,i=m.textAlign(e.textAlign||(e.textAlign=f.textAlign)),t=M+_+t;let s=y.x,r=y.y;m.setWidth(this.width),S?0this.right&&(r=y.y+=D,y.line++,s=y.x=E(g,this.left+x,this.right-c[y.line])):0this.bottom&&(s=y.x=s+d[y.line].width+x,y.line++,r=y.y=E(g,this.top+P+x,this.bottom-d[y.line].height));var a=m.x(s),n=r,o=e;if(!(isNaN(M)||M<=0||isNaN(w)||w<0)){u.save();var l=T(o.lineWidth,1);if(u.fillStyle=T(o.fillStyle,p),u.lineCap=T(o.lineCap,"butt"),u.lineDashOffset=T(o.lineDashOffset,0),u.lineJoin=T(o.lineJoin,"miter"),u.lineWidth=l,u.strokeStyle=T(o.strokeStyle,p),u.setLineDash(T(o.lineDash,[])),f.usePointStyle){let t={radius:w*Math.SQRT2/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:l},e=m.xPlus(a,M/2);Fe(u,t,e,n+_,f.pointStyleWidth&&M)}else{let t=n+Math.max((v-w)/2,0),e=m.leftForLtr(a,M),i=wi(o.borderRadius);u.beginPath(),Object.values(i).some(t=>0!==t)?je(u,{x:e,y:t,w:M,h:w,radius:i}):u.rect(e,t,M,w),u.fill(),0!==l&&u.stroke()}u.restore()}if(s=Ct(i,s+M+_,S?s+t:this.right,h.rtl),n=m.x(s),a=r,o=e,He(u,o.text,n,a+k/2,b,{strikethrough:o.hidden,textAlign:m.textAlign(o.textAlign)}),S)y.x+=t+x;else if("string"!=typeof e.text){let t=b.lineHeight;y.y+=Cr(e,t)+x}else y.y+=D}),Oi(this.ctx,h.textDirection)}drawTitle(){let a=this.options,s=a.title,r=z(s.font),n=I(s.padding);if(s.display){var o=Di(a.rtl,this.left,this.width),l=this.ctx,h=s.position,d=r.size/2,d=n.top+d;let e,t=this.left,i=this.width;if(this.isHorizontal())i=Math.max(...this.lineWidths),e=this.top+d,t=E(a.align,t,this.right-i);else{let t=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);e=d+E(a.align,this.top,this.bottom-t-a.labels.padding-this._computeTitleHeight())}d=E(h,t,t+i);l.textAlign=o.textAlign(Dt(h)),l.textBaseline="middle",l.strokeStyle=s.color,l.fillStyle=s.color,l.font=r.string,He(l,s.text,d,e,r)}}_computeTitleHeight(){var t=this.options.title,e=z(t.font),i=I(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,a,s;if(d(t,this.left,this.right)&&d(e,this.top,this.bottom))for(s=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let a=t.data.datasets,{usePointStyle:s,pointStyle:r,textAlign:n,color:o,useBorderRadius:l,borderRadius:h}=t.legend.options["labels"];return t._getSortedDatasetMetas().map(t=>{var e=t.controller.getStyle(s?0:void 0),i=I(e.borderWidth);return{text:a[t.index].label,fillStyle:e.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:(i.width+i.height)/4,strokeStyle:e.borderColor,pointStyle:r||e.pointStyle,rotation:e.rotation,textAlign:n||e.textAlign,borderRadius:l&&(h||e.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ar extends e{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){var i=this.options;this.left=0,this.top=0,i.display?(this.width=this.right=t,this.height=this.bottom=e,t=O(i.text)?i.text.length:1,this._padding=I(i.padding),e=t*z(i.font).lineHeight+this._padding.height,this.isHorizontal()?this.height=e:this.width=e):this.width=this.height=this.right=this.bottom=0}isHorizontal(){var t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){var{top:e,left:i,bottom:a,right:s,options:r}=this,n=r.align;let o,l,h,d=0;return o=this.isHorizontal()?(l=E(n,i,s),h=e+t,s-i):(d="left"===r.position?(l=i+t,h=E(n,a,e),-.5*S):(l=s-t,h=E(n,e,a),.5*S),a-e),{titleX:l,titleY:h,maxWidth:o,rotation:d}}draw(){var t,e,i,a,s,r=this.ctx,n=this.options;n.display&&(e=(t=z(n.font)).lineHeight/2+this._padding.top,{titleX:e,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(e),He(r,n.text,0,0,t,{color:n.color,maxWidth:a,rotation:s,textAlign:Dt(n.align),textBaseline:"middle",translation:[e,i]}))}}var Tr={id:"title",_element:Ar,start(t,e,i){var a;t=t,i=i,a=new Ar({ctx:t.ctx,options:i,chart:t}),s.configure(t,a,i),s.addBox(t,a),t.titleBlock=a},stop(t){var e=t.titleBlock;s.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){var a=t.titleBlock;s.configure(t,a,i),a.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let Lr=new WeakMap;var Er={id:"subtitle",start(t,e,i){var a=new Ar({ctx:t.ctx,options:i,chart:t});s.configure(t,a,i),s.addBox(t,a),Lr.set(t,a)},stop(t){s.removeBox(t,Lr.get(t)),Lr.delete(t)},beforeUpdate(t,e,i){var a=Lr.get(t);s.configure(t,a,i),a.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let Rr={average(t){if(!t.length)return!1;let i,e,a=0,s=0,r=0;for(i=0,e=t.length;it+e.before.length+e.lines.length+e.after.length,0),v=(x+=t.beforeBody.length+t.afterBody.length,u&&(m+=u*d.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x&&(m+=f*(e.displayColors?Math.max(l,h.lineHeight):h.lineHeight)+(x-f)*h.lineHeight+(x-1)*e.bodySpacing),g&&(m+=e.footerMarginTop+g*c.lineHeight+(g-1)*e.footerSpacing),0);return a.save(),a.font=d.string,k(t.title,i),a.font=h.string,k(t.beforeBody.concat(t.afterBody),i),v=e.displayColors?o+2+e.boxPadding:0,k(s,t=>{k(t.before,i),k(t.lines,i),k(t.after,i)}),v=0,a.font=c.string,k(t.footer,i),a.restore(),{width:b+=p.width,height:m}}function Fr(i,t,a){var e=a.yAlign||t.yAlign||function(){var{y:t,height:e}=a;return ti.height-e/2?"bottom":"center"}();return{xAlign:a.xAlign||t.xAlign||function(s,r,n,t){var{x:e,width:i}=n,{width:a,chartArea:{left:o,right:l}}=s;let h="center";return"center"===t?h=e<=(o+l)/2?"left":"right":e<=i/2?h="left":a-i/2<=e&&(h="right"),h=function(t){var{x:e,width:i}=n,a=r.caretSize+r.caretPadding;return"left"===t&&e+i+a>s.width||"right"===t&&e-i-a<0}(h)?"center":h}(i,t,a,e),yAlign:e}}function Vr(t,i,e,a){var{caretSize:t,caretPadding:s,cornerRadius:r}=t,{xAlign:n,yAlign:o}=e,l=t+s,{topLeft:e,topRight:s,bottomLeft:r,bottomRight:h}=wi(r);let d=function(){let{x:t,width:e}=i;return"right"===n?t-=e:"center"===n&&(t-=e/2),t}();var c=function(){let{y:t,height:e}=i;return"top"===o?t+=l:t-="bottom"===o?e+l:e/2,t}();return"center"===o?"left"===n?d+=l:"right"===n&&(d-=l):"left"===n?d-=Math.max(e,r)+t:"right"===n&&(d+=Math.max(s,h)+t),{x:C(d,0,a.width-i.width),y:C(c,0,a.height-i.height)}}function Br(t,e,i){i=I(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Wr(t){return b([],Ir(t))}function Nr(t,e){e=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return e?t.override(e):t}let Hr={beforeTitle:t,title(t){if(0{var e={before:[],lines:[],after:[]},i=Nr(a,t);b(e.before,Ir(w(i,"beforeLabel",this,t))),b(e.lines,w(i,"label",this,t)),b(e.after,Ir(w(i,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return Wr(w(e.callbacks,"afterBody",this,t))}getFooter(t,e){var e=e["callbacks"],i=w(e,"beforeFooter",this,t),a=w(e,"footer",this,t),e=w(e,"afterFooter",this,t),t=b([],Ir(i));return t=b(t,Ir(a)),b(t,Ir(e))}_createItems(a){let t=this._active,s=this.chart.data,i=[],r=[],n=[],e,o,l=[];for(e=0,o=t.length;ea.filter(t,e,i,s))),k(l=a.itemSort?l.sort((t,e)=>a.itemSort(t,e,s)):l,t=>{var e=Nr(a.callbacks,t);i.push(w(e,"labelColor",this,t)),r.push(w(e,"labelPointStyle",this,t)),n.push(w(e,"labelTextColor",this,t))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=n,this.dataPoints=l}update(t,e){var r=this.options.setContext(this.getContext()),n=this._active;let o,l=[];if(n.length){let t=Rr[r.position].call(this,n,this._eventPosition),e=(l=this._createItems(r),this.title=this.getTitle(l,r),this.beforeBody=this.getBeforeBody(l,r),this.body=this.getBody(l,r),this.afterBody=this.getAfterBody(l,r),this.footer=this.getFooter(l,r),this._size=zr(this,r)),i=Object.assign({},t,e),a=Fr(this.chart,r,i),s=Vr(r,i,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,o={opacity:1,x:s.x,y:s.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=l,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,a){t=this.getCaretPosition(t,i,a);e.lineTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineTo(t.x3,t.y3)}getCaretPosition(t,e,i){var{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:r}=i,{topLeft:r,topRight:n,bottomLeft:o,bottomRight:l}=wi(r),{x:t,y:h}=t,{width:e,height:d}=e;let c,u,g,f,p,m;return"center"===s?(p=h+d/2,m="left"===a?(c=t,u=c-i,f=p+i,p-i):(c=t+e,u=c+i,f=p-i,p+i),g=c):(u="left"===a?t+Math.max(r,o)+i:"right"===a?t+e-Math.max(n,l)-i:this.caretX,g="top"===s?(f=h,p=f-i,c=u-i,u+i):(f=h+d,p=f+i,c=u+i,u-i),m=f),{x1:c,x2:u,x3:g,y1:f,y2:p,y3:m}}drawTitle(t,e,i){var a=this.title,s=a.length;let r,n,o;if(s){var l=Di(i.rtl,this.x,this.width);for(t.x=Br(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=z(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,o=0;o0!==t)?(a.beginPath(),a.fillStyle=r.multiKeyBackground,je(a,{x:t,y:g,w:h,h:l,radius:i}),a.fill(),a.stroke(),a.fillStyle=n.backgroundColor,a.beginPath(),je(a,{x:e,y:g+1,w:h-2,h:l-2,radius:i}),a.fill()):(a.fillStyle=r.multiKeyBackground,a.fillRect(t,g,h,l),a.strokeRect(t,g,h,l),a.fillStyle=n.backgroundColor,a.fillRect(e,g+1,h-2,l-2))}a.fillStyle=this.labelTextColors[e]}drawBody(e,i,t){function a(t){i.fillText(t,f.x(e.x+g),e.y+u/2),e.y+=u+r}let s=this["body"],{bodySpacing:r,bodyAlign:n,displayColors:o,boxHeight:l,boxWidth:h,boxPadding:d}=t,c=z(t.bodyFont),u=c.lineHeight,g=0,f=Di(t.rtl,this.x,this.width),p=f.textAlign(n),m,b,x,v,_,y,M;for(i.textAlign=n,i.textBaseline="middle",i.font=c.string,e.x=Br(this,p,t),i.fillStyle=t.bodyColor,k(this.beforeBody,a),g=o&&"right"!==p?"center"===n?h/2+d:h+2+d:0,v=0,y=s.length;v{var i=this.chart.getDatasetMeta(t);if(i)return{datasetIndex:t,element:i.data[e],index:e};throw new Error("Cannot find a dataset at index "+t)}),i=!W(i,t),a=this._positionChanged(t,e);(i||a)&&(this._active=t,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var a=this.options,s=this._active||[],i=this._getActiveElements(t,s,e,i),r=this._positionChanged(i,t),s=e||!W(i,s)||r;return s&&(this._active=i,a.enabled||a.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e)),s}_getActiveElements(t,e,i,a){var s=this.options;return"mouseout"===t.type?[]:a?(a=this.chart.getElementsAtEventForMode(t,s.mode,s,i),s.reverse&&a.reverse(),a):e}_positionChanged(t,e){var{caretX:i,caretY:a,options:s}=this,s=Rr[s.position].call(this,t,e);return!1!==s&&(i!==s.x||a!==s.y)}}var Yr={id:"tooltip",_element:jr,positioners:Rr,afterInit(t,e,i){i&&(t.tooltip=new jr({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){var e,i=t.tooltip;i&&i._willRender()&&!(e={tooltip:i})!==t.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})&&(i.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",e))},afterEvent(t,e){var i;t.tooltip&&(i=e.replay,t.tooltip.handleEvent(e.event,i,e.inChartArea))&&(e.changed=!0)},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Hr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return i.register(Oe,ir,Es,a),i.helpers={...Fi},i._adapters=hs,i.Animation=xa,i.Animations=va,i.animator=r,i.controllers=M.controllers.items,i.DatasetController=Aa,i.Element=e,i.elements=Es,i.Interaction=Hi,i.layouts=s,i.platforms=pa,i.Scale=Fa,i.Ticks=ge,Object.assign(i,Oe,ir,Es,a,pa),i.Chart=i,"undefined"!=typeof window&&(window.Chart=i),i}) \ No newline at end of file diff --git a/public/scripts/ol-min.js b/public/scripts/ol-min.js index 728bf9ef..a40d0a65 100644 --- a/public/scripts/ol-min.js +++ b/public/scripts/ol-min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define([],e):t.ol=e()}(this,function(){var O={},D=this;function t(t,e){var o,i=O;(t=t.split("."))[0]in(i=i||D)||!i.execScript||i.execScript("var "+t[0]);for(;t.length&&(o=t.shift());)t.length||void 0===e?i=i[o]&&i[o]!==Object.prototype[o]?i[o]:i[o]={}:i[o]=e}function U(t,e){return e>>0,r=0;re[0]?t:e)[0],o[1]=(e[1]=t.minZoom;){if(o.call(null,e,Re(t,r,e,i)))return!0;--e}return!1}function je(t,e,o,i){return e[0]A.$)&&(tt(E,new $(rt(P.ca,C),rt(P.$,C),P.da,P.ia))||P.$-P.ca+1>C&&tt(E,A))){b=!0;break t}}b=!1}else b=!0}else b=!1;b?(m in h&&delete h[m],(b=v.b)in y||(y[b]=!0,l[m]=v)):h[m]=v}}}for(r in c=(s=[l,h])[0],s=s[1],this.l)r in c?(this.j[r]||(this.l[r].style.display="",this.j[r]=!0),delete c[r]):r in s?(this.j[r]&&(this.l[r].style.display="none",delete this.j[r]),delete s[r]):(So(this.l[r]),delete this.l[r],delete this.j[r]);for(r in c)d=document.createElement("LI"),d.innerHTML=c[r].b,this.I.appendChild(d),this.l[r]=d,this.j[r]=!0;for(r in s)d=document.createElement("LI"),d.innerHTML=s[r].b,d.style.display="none",this.I.appendChild(d),this.l[r]=d;for(p in r=!Wt(this.j)||!Wt(t.logos),this.B!=r&&(this.element.style.display=r?"":"none",this.B=r),r&&Wt(this.j)?this.element.classList.add("ol-logo-only"):this.element.classList.remove("ol-logo-only"),t=t.logos,r=this.T)p in t||(So(r[p]),delete r[p]);for(n in t)(s=t[n])instanceof HTMLElement&&(this.u.appendChild(s),r[n]=s),n in r||((p=new Image).src=n,""===s?c=p:((c=document.createElement("a")).href=s,c.appendChild(p)),this.u.appendChild(c),r[n]=c);this.u.style.display=Wt(t)?"none":""}else this.B&&(this.element.style.display="none",this.B=!1)}function Eo(t){t.element.classList.toggle("ol-collapsed"),t.c?wo(t.D,t.C):wo(t.C,t.D),t.c=!t.c}function Ao(t){return Math.pow(t,3)}function Co(t){return 1-Ao(1-t)}function jo(t){return 3*t*t-2*t*t*t}function Lo(t){return t}function Ro(t){var e=void 0!==(t=t||{}).className?t.className:"ol-rotate",o=void 0!==t.label?t.label:"⇧",i=(this.c=null,"string"==typeof o?(this.c=document.createElement("span"),this.c.className="ol-compass",this.c.textContent=o):(this.c=o,this.c.classList.add("ol-compass")),t.tipLabel||"Reset rotation");(o=document.createElement("button")).className=e+"-reset",o.setAttribute("type","button"),o.title=i,o.appendChild(this.c),g(o,"click",Ro.prototype.D,this),(i=document.createElement("div")).className=e+" ol-unselectable ol-control",i.appendChild(o),e=t.render||Fo,this.o=t.resetNorth||void 0,Po.call(this,{element:i,render:e,target:t.target}),this.l=void 0!==t.duration?t.duration:250,this.j=void 0===t.autoHide||t.autoHide,this.u=void 0,this.j&&this.element.classList.add("ol-hidden")}function Fo(t){var e,o;(t=t.frameState)&&((t=t.viewState.rotation)!=this.u&&(e="rotate("+t+"rad)",this.j&&((o=this.element.classList.contains("ol-hidden"))||t?o&&t&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")),this.c.style.msTransform=e,this.c.style.webkitTransform=e,this.c.style.transform=e),this.u=t)}function No(t){var e=void 0!==(t=t||{}).className?t.className:"ol-zoom",o=void 0!==t.delta?t.delta:1,i=void 0!==t.zoomInLabel?t.zoomInLabel:"+",r=void 0!==t.zoomOutLabel?t.zoomOutLabel:"−",n=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",p=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",s=document.createElement("button");s.className=e+"-in",s.setAttribute("type","button"),s.title=n,s.appendChild("string"==typeof i?document.createTextNode(i):i),g(s,"click",No.prototype.j.bind(this,o)),(i=document.createElement("button")).className=e+"-out",i.setAttribute("type","button"),i.title=p,i.appendChild("string"==typeof r?document.createTextNode(r):r),g(i,"click",No.prototype.j.bind(this,-o)),(o=document.createElement("div")).className=e+" ol-unselectable ol-control",o.appendChild(s),o.appendChild(i),Po.call(this,{element:o,target:t.target}),this.c=void 0!==t.duration?t.duration:250}function Io(t){t=t||{};var e=new y;return void 0!==t.zoom&&!t.zoom||e.push(new No(t.zoomOptions)),void 0!==t.rotate&&!t.rotate||e.push(new Ro(t.rotateOptions)),void 0!==t.attribution&&!t.attribution||e.push(new Mo(t.attributionOptions)),e}function ko(t){this.c=void 0!==(t=t||{}).className?t.className:"ol-full-screen";var e=void 0!==t.label?t.label:"⤢",o=(this.o="string"==typeof e?document.createTextNode(e):e,this.l="string"==typeof(e=void 0!==t.labelActive?t.labelActive:"×")?document.createTextNode(e):e,t.tipLabel||"Toggle full-screen");(e=document.createElement("button")).className=this.c+"-"+Do(),e.setAttribute("type","button"),e.title=o,e.appendChild(this.o),g(e,"click",this.C,this),(o=document.createElement("div")).className=this.c+" ol-unselectable ol-control "+(Oo()?"":"ol-unsupported"),o.appendChild(e),Po.call(this,{element:o,target:t.target}),this.D=void 0!==t.keys&&t.keys,this.j=t.source}function Oo(){var t=document.body;return t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled}function Do(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function Uo(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}e(Po,oo),Po.prototype.ka=function(){So(this.element),oo.prototype.ka.call(this)},Po.prototype.g=function(){return this.a},Po.prototype.setMap=function(t){this.a&&So(this.element);for(var e=0,o=this.v.length;e>1;){var a=2*e+1,l=2*e+2,a=l>1;if(!(t[p]>n))break;i[o]=i[p],t[o]=t[p],o=p}i[o]=r,t[o]=n}function Oi(t){for(var e=t.l,o=t.b,i=t.i,r=0,n=o.length,p=0;p>1)-1;0<=e;e--)Ii(t,e)}function Di(e,t){Fi.call(this,function(t){return e.apply(null,t)},function(t){return t[0].bb()}),this.v=t,this.j=0,this.g={}}function Ui(t,e,o){for(var i,r,n=0;t.je;)r-=3;if(!((e=t.b[2+o]-t.b[r+2])<1e3/60))return i=t.b[o]-t.b[r],o=t.b[1+o]-t.b[r+1],t.i=Math.atan2(o,i),t.a=Math.sqrt(i*i+o*o)/e,t.a>t.c}}}(this.a)&&(e=((e=this.a).c-e.a)/e.f,o=this.a.i,i=t.wa(),i=r.Ja(i),r=r.Wa([i[0]-e*Math.cos(o),i[1]-e*Math.sin(o)]),t.animate({center:t.Ec(r),duration:500,easing:Co})),Ar(t,1,-1),!1)}function _r(t){var e;return!!(0=this.u}function an(t){var e,o;Vr(t)&&(e=this.a,o=t.pixel,e.c=this.g,e.i=o,nn(e),rn(e),this.b(new fn(un,t.coordinate,t)))}function ln(t){return!Vr(t)||(this.a.setMap(null),this.l(t,this.g,t.pixel)&&(this.j(t),this.b(new fn(cn,t.coordinate,t))),!1)}function hn(t){var e,o;return!!(Vr(t)&&Dr(t)&&this.C(t))&&(this.g=t.pixel,this.a.setMap(t.map),e=this.a,o=this.g,e.c=this.g,e.i=o,nn(e),rn(e),this.b(new fn(yn,t.coordinate,t)),!0)}e(Li,Qe),Li.prototype.Jh=function(t){Ri(this,t);var e,o=new ci("pointerup",this.i,t);this.b(o),this.o||t.button||(e=(o=this).c,t=new ci("click",o.i,e),o.b(t),o.j?(clearTimeout(o.j),o.j=0,t=new ci("dblclick",o.i,e),o.b(t)):o.j=setTimeout(function(){this.j=0;var t=new ci("singleclick",this.i,e);this.b(t)}.bind(o),250)),this.S||(this.f.forEach(Ze),this.f.length=0,this.o=!1,this.c=null,Ye(this.a),this.a=null)},Fi.prototype.clear=function(){this.b.length=0,this.i.length=0,Bt(this.a)},Fi.prototype.f=function(t){_(!(this.c(t)in this.a),31);var e=this.l(t);return 1/0!=e&&(this.b.push(t),this.i.push(e),this.a[this.c(t)]=!0,ki(this,0,this.b.length-1),!0)},e(Di,Fi),Di.prototype.f=function(t){var e=Fi.prototype.f.call(this,t);return e&&g(t[0],"change",this.o,this),e},Di.prototype.o=function(t){var e=(t=t.target).getState();2!==e&&3!==e&&4!==e&&5!==e||(He(t,"change",this.o,this),(t=t.bb())in this.g&&(delete this.g[t],--this.j),this.v())},e(or,oo),or.prototype.Ab=function(t,e){return this.Kb(t[0],t[1],e=e||[NaN,NaN],1/0),e},e(i,or),i.prototype.Mc=er,e(lr,i),lr.prototype.clone=function(){var t=new lr(null);return hr(t,this.ja,this.A.slice()),t},e(p,i),p.prototype.clone=function(){var t=new p(null);return t.ba(this.ja,this.A.slice()),t},e(s,i),s.prototype.pk=function(t){this.A?K(this.A,t.ga()):this.A=t.ga().slice(),this.c.push(this.A.length),this.s()},e(l,oo),l.prototype.animate=function(t){var e,o=Date.now(),i=this.wa().slice(),r=this.Pa(),n=this.Qa(),p=arguments.length;1this.C&&(this.a=!0),this.j=i,(i=(t=t.map).Z()).g.rotation!==Gi&&(r=t.a.getBoundingClientRect(),(e=Hr(this.o))[0]-=r.left,e[1]-=r.top,this.g=t.Wa(e),this.a)&&(r=i.Qa(),t.render(),Rr(i,r+o,this.g))}function En(t){var e,o,i;return!(this.o.length<2&&(Ar(t=t.map.Z(),1,-1),this.a&&(i=t.Qa(),e=this.g,o=this.u,i=t.constrainRotation(i,0),Rr(t,i,e,o)),1))}function An(t){return 2<=this.o.length&&(t=t.map,this.g=null,this.j=void 0,this.a=!1,this.l=0,this.D||Ar(t.Z(),1,1),!0)}function Cn(t){zr.call(this,{handleDownEvent:Rn,handleDragEvent:jn,handleUpEvent:Ln}),this.l=(t=t||{}).constrainResolution||!1,this.g=null,this.u=void 0!==t.duration?t.duration:400,this.a=void 0,this.j=1}function jn(t){var e=1,o=this.o[0],i=this.o[1],r=o.clientX-i.clientX,o=o.clientY-i.clientY,r=Math.sqrt(r*r+o*o);void 0!==this.a&&(e=this.a/r),this.a=r;var i=(r=(t=t.map).Z()).Pa(),n=r.a,p=r.f;n<(o=i*e)?(e=n/i,o=n):ot.a)&&(e=this.g,o=this.u,i=t.constrainResolution(i,0,this.j-1),Nr(t,i,e,o)),1))}function Rn(t){return 2<=this.o.length&&(t=t.map,this.g=null,this.a=void 0,this.j=1,this.D||Ar(t.Z(),1,1),!0)}function Fn(t){t=t||{};var e=new y,o=new Cr(-.005,.05,100);return void 0!==t.altShiftDragRotate&&!t.altShiftDragRotate||e.push(new $r),void 0!==t.doubleClickZoom&&!t.doubleClickZoom||e.push(new Ir({delta:t.zoomDelta,duration:t.zoomDuration})),void 0!==t.dragPan&&!t.dragPan||e.push(new qr({kinetic:o})),void 0!==t.pinchRotate&&!t.pinchRotate||e.push(new Mn),void 0!==t.pinchZoom&&!t.pinchZoom||e.push(new Cn({constrainResolution:t.constrainResolution,duration:t.zoomDuration})),void 0!==t.keyboard&&!t.keyboard||(e.push(new gn),e.push(new mn({delta:t.zoomDelta,duration:t.zoomDuration}))),void 0!==t.mouseWheelZoom&&!t.mouseWheelZoom||e.push(new xn({constrainResolution:t.constrainResolution,duration:t.zoomDuration})),void 0!==t.shiftDragZoom&&!t.shiftDragZoom||e.push(new dn({duration:t.zoomDuration})),e}function Nn(t){oo.call(this);var e=Gt({},t);e.opacity=void 0!==t.opacity?t.opacity:1,e.visible=void 0===t.visible||t.visible,e.zIndex=void 0!==t.zIndex?t.zIndex:0,e.maxResolution=void 0!==t.maxResolution?t.maxResolution:1/0,e.minResolution=void 0!==t.minResolution?t.minResolution:0,this.H(e),this.a={layer:this,Je:!0}}function In(t){return t.a.opacity=et(t.hc(),0,1),t.a.yj=t.$f(),t.a.visible=t.Mb(),t.a.extent=t.G(),t.a.zIndex=t.Ba(),t.a.maxResolution=t.fc(),t.a.minResolution=Math.max(t.gc(),0),t.a}function kn(t){var e=t||{};delete(t=Gt({},e)).layers,e=e.layers,Nn.call(this,t),this.f=[],this.c={},g(this,ro(On),this.Hl,this),e?Array.isArray(e)?e=new y(e.slice(),{unique:!0}):_(e instanceof y,43):e=new y(void 0,{unique:!0}),this.xi(e)}e(Mn,zr),Mn.prototype.Xc=er,e(Cn,zr),Cn.prototype.Xc=er,e(Nn,oo),Nn.prototype.G=function(){return this.get("extent")},e(kn,Nn),kn.prototype.Fd=function(){};var On="layers";function o(t){var e=Gt({},t);delete e.source,Nn.call(this,e),this.v=this.l=this.o=null,t.map&&this.setMap(t.map),g(this,ro("source"),this.Ul,this),this.Wc(t.source||null)}function Dn(t,e){return t.visible&&t.minResolution<=e&&en&&(n=e[u],y=e[u+1]),h=f}else for(h=p=Vs(t,e[u=e.length-o],e[u+1],s++),n=e[u],y=e[u+1],u-=o,c=0;c<=u;u-=o)f=Vs(t,e[u],e[u+1],s++),l.push(Xs(h,f,i)),a.push([Math.min(h.x,f.x),Math.min(h.y,f.y),Math.max(h.x,f.x),Math.max(h.y,f.y)]),e[u]>n&&(n=e[u],y=e[u+1]),h=f;return l.push(Xs(f,p,i)),a.push([Math.min(h.x,f.x),Math.min(h.y,f.y),Math.max(h.x,f.x),Math.max(h.y,f.y)]),r.load(a,l),[n,y]}function Gs(t,e,o){var i=ys(t),r=i,n=us(t),p=!1;do{var s=o?Ep(n.W.x,n.W.y,r.W.x,r.W.y,r.aa.x,r.aa.y):Ep(r.aa.x,r.aa.y,r.W.x,r.W.y,n.W.x,n.W.y)}while(void 0===s?(zs(r,n,t,e),p=!0,n===i&&(i=cs(t)),n=r,fs(t)):r.W.Fb!==s&&(r.W.Fb=s,p=!0),r=n,n=us(t),r!==i);return p}function Bs(t,e,o,i,r){var n=t.b.length,p=ys(e),s=ds(e),a=p,l=us(e),h=cs(e),y=!1;do{var u,c=a.aa,f=a.W,d=l.W}while(!1===f.Fb&&(u=r?Js(h.W,d,f,c,s.aa):Js(s.aa,c,f,d,h.W),!i&&Zs({aa:c,W:d},o).length||!u||Hs(c,f,d,o,!0).length||!i&&!1!==c.Fb&&!1!==d.Fb&&fr([s.aa.x,s.aa.y,c.x,c.y,f.x,f.y,d.x,d.y,h.W.x,h.W.y],0,10,2)!==!r||(t.b[n++]=c.hb,t.b[n++]=f.hb,t.b[n++]=d.hb,zs(a,l,e,o),l===p&&(p=h),y=!0)),s=ds(e),a=gs(e),l=us(e),h=cs(e),a!==p&&3(o.y-i.y)*(e.x-i.x),r=(r.x-i.x)*(e.y-i.y)<(r.y-i.y)*(e.x-i.x),t=(t.x-e.x)*(i.y-e.y)>(t.y-e.y)*(i.x-e.x),o=(o.x-e.x)*(i.y-e.y)<(o.y-e.y)*(i.x-e.x),e=e.Fb?o||t:o&&t,i.Fb?r||n:r&&n)&&e}function Ys(){}function _s(t,e,o){this.f=e,this.g=t,this.c=o,this.a={}}function $s(t,e,o,i,r,n,p,s,a,l,h){for(var y=Qs,u=Object.keys(t.a).map(Number),c=(u.sort(function(t,e){return e-t}),0),f=u.length;cthis.Hf;)this.jk(i,e),e--;this.Zj(o,i,e)},jk:function(t,e){var o=t[e],i=o.children.length,r=this.fh;this.$j(o,r,i),i=this.ak(o,r,i),(i=Rs(o.children.splice(i,o.children.length-i))).height=o.height,i.ib=o.ib,Ss(o,this.wb),Ss(i,this.wb),e?t[e-1].children.push(i):this.hh(o,i)},hh:function(t,e){this.data=Rs([t,e]),this.data.height=t.height+1,this.data.ib=!1,Ss(this.data,this.wb)},ak:function(t,e,o){for(var i=p=1/0,r=e;r<=o-e;r++){var n,p,s=Ps(t,0,r,this.wb),a=Ps(t,r,o,this.wb),l=Math.max(0,Math.min(s.$,a.$)-Math.max(s.ca,a.ca))*Math.max(0,Math.min(s.ia,a.ia)-Math.max(s.da,a.da)),s=As(s)+As(a);lr&&(this.i.push(r),this.f.push(e),this.j.s)&&(this.c.push(r),this.j.s=!1),this.g.b.length>n&&_p(this.g,e,n)},Ys.prototype.La=function(){},e(_s,vp),_s.prototype.b=function(t,e){var o=void 0!==t?t.toString():"0";return void 0===(t=this.a[o])&&(this.a[o]=t={}),void 0===(o=t[e])&&(o=new ta[e](this.g,this.f),t[e]=o),o},_s.prototype.i=function(){return Wt(this.a)},_s.prototype.La=function(t,e,o,i,r,n,p,s){for(var a=Object.keys(this.a).map(Number),l=(a.sort(U),0),h=a.length;l=t.l)break;++n}t.D!=(o=r+" "+i)&&(t.o.innerHTML=o,t.D=o),t.B!=e&&(t.o.style.width=e+"px",t.B=e),t.j||(t.c.style.display="",t.j=!0)}else t.j&&(t.c.style.display="none",t.j=!1)}va.prototype.C=function(){return this.get(wa)},va.prototype.T=function(){xa(this)},va.prototype.I=function(t){this.set(wa,t)};var wa="units";function Sa(t){t=t||{},this.c=void 0,this.j=Pa,this.D=this.l=0,this.I=null,this.na=!1,this.T=void 0!==t.duration?t.duration:200;var e=void 0!==t.className?t.className:"ol-zoomslider",o=document.createElement("button"),i=(o.setAttribute("type","button"),o.className=e+"-thumb ol-unselectable",document.createElement("div"));i.className=e+" ol-unselectable ol-control",i.appendChild(o),this.o=new Mi(i),g(this.o,"pointerdown",this.yl,this),g(this.o,"pointermove",this.wl,this),g(this.o,"pointerup",this.xl,this),g(i,"click",this.vl,this),g(o,"click",$e),Po.call(this,{element:i,render:t.render||Ma})}e(Sa,Po),Sa.prototype.ka=function(){Ye(this.o),Po.prototype.ka.call(this)};var Pa=0;function Ma(t){var e,o,i,r,n;t.frameState&&(this.na||(e=(r=this.element).offsetWidth,o=r.offsetHeight,n=r.firstElementChild,i=getComputedStyle(n),r=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),n=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom),this.I=[r,n],o>1)],o))<0?a=r+1:(l=r,h=!s);s=(r=h?a:~a)<0?(p=nt(t[e+=(-r-2)*i],t[e+i],o=(o-p[-r-2])/(p[-r-1]-p[-r-2])),nt(t[e+1],t[e+i+1],o)):(p=t[e+r*i],t[e+r*i+1])}return n?(n[0]=p,n[1]=s,n):[p,s]}function m(t,e){i.call(this),this.c=null,this.u=this.D=this.j=-1,this.ma(t,e)}function yl(t){return t.j!=t.i&&(t.c=t.wh(.5,t.c),t.j=t.i),t.c}function a(t,e){i.call(this),this.c=[],this.j=this.u=-1,this.ma(t,e)}function ul(t){for(var e=[],o=t.A,i=0,r=t.c,n=(t=t.a,0),p=r.length;n>>0):4294967296*(e>>>0)+(t>>>0)}function ec(t,e){this.layers=t.Ag(sc,{},e)}function oc(t,e){this.x=t,this.y=e}function ic(t,e,o,i,r){this.properties={},this.extent=o,this.type=0,this.Cc=t,this.Ef=-1,this.ne=i,this.pe=r,t.Ag(rc,this,e)}function rc(t,e,o){if(1==t)e.id=o.Ka();else if(2==t)for(t=o.Ka()+o.ea;o.ea>3)?t.Gg():2===e?t.yp():3===e?t.up():4===e?t.Kp():5===e?t.Ka():6===e?t.ce():7===e?t.sp():null;return e}(o))}function sc(t,e,o){3===t&&(t=new Ku(o,o.Ka()+o.ea)).length&&(e[t.name]=t)}function ac(t,e,o,i,r){this.g=r,this.i=t,this.b=e,this.f=o,this.c=i}function lc(t){nl.call(this),t=t||{},this.defaultDataProjection=new Zt({code:"",units:"tile-pixels"}),this.b=t.featureClass||ac,this.a=t.geometryName,this.i=t.layerName||"layer",this.c=t.layers||null}function hc(){Yl.call(this),this.defaultDataProjection=ge("EPSG:4326")}function yc(t,e){e[e.length-1].fe[t.getAttribute("k")]=t.getAttribute("v")}by.prototype.Xb=function(t,e){e=sl(this,e);var o=Ka(wy[4],"kml"),i=(o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:gx",xy[0]),o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance"),o.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd"),{node:o}),r={};return 1>1,a=-7,l=o?-1:1,h=t[e+(r=o?r-1:0)];for(r+=l,o=h&(1<<-a)-1,h>>=-a,a+=n;0>=-a,a+=i;0>3,n=this.ea;this.type=7&i,t(r,e,this),this.ea===n&&this.mq(i)}return e},yp:function(){var t=Bu(this.lc,this.ea,!0,23,4);return this.ea+=4,t},up:function(){var t=Bu(this.lc,this.ea,!0,52,8);return this.ea+=8,t},Ka:function(t){var e=this.lc,o=e[this.ea++],i=127&o;if(o<128)return i;if(i|=(127&(o=e[this.ea++]))<<7,o<128)return i;if(i|=(127&(o=e[this.ea++]))<<14,o<128)return i;if(i|=(127&(o=e[this.ea++]))<<21,o<128)return i;var o=i|(15&e[this.ea])<<28,i=t,e=this,t=e.lc,r=t[e.ea++],n=(112&r)>>4;if(r<128)return tc(o,n,i);if(n|=(127&(r=t[e.ea++]))<<3,r<128)return tc(o,n,i);if(n|=(127&(r=t[e.ea++]))<<10,r<128)return tc(o,n,i);if(n|=(127&(r=t[e.ea++]))<<17,r<128)return tc(o,n,i);if(n|=(127&(r=t[e.ea++]))<<24,r<128)return tc(o,n,i);if((r=t[e.ea++])<128)return tc(o,n|(1&r)<<31,i);throw Error("Expected varint not more than 10 bytes")},Kp:function(){return this.Ka(!0)},ce:function(){var t=this.Ka();return 1==t%2?(t+1)/-2:t/2},sp:function(){return!!this.Ka()},Gg:function(){for(var t=this.Ka()+this.ea,e=this.lc,o="",i=this.ea;i>>10&1023|55296),a=56320|1023&a),o+=String.fromCharCode(a),i+=l}return this.ea=t,o},mq:function(t){if((t&=7)===Qu.c)for(;127>=3),r--,1===i||2===i)n+=t.ce(),p+=t.ce(),1===i&&(e&&s.push(e),e=[]),e.push(new oc(n,p));else{if(7!==i)throw Error("unknown command "+i);e&&e.push(e[0].clone())}return e&&s.push(e),s},ic.prototype.bbox=function(){var t=this.Cc;t.ea=this.Ef;for(var e=t.Ka()+t.ea,o=1,i=0,r=0,n=0,p=1/0,s=-1/0,a=1/0,l=-1/0;t.ea>=3),i--,1===o||2===o)(r+=t.ce())=this.me.length)throw Error("feature index out of bounds");return this.Cc.ea=this.me[t],t=this.Cc.Ka()+this.Cc.ea,new ic(this.Cc,t,this.extent,this.ne,this.pe)},Wu=Ku,si.default={Bf:ec,Wj:ic,Xj:Wu},si.Bf=ec,si.Wj=ic,si.Xj=Wu,ac.prototype.get=function(t){return this.c[t]},e(lc,nl),lc.prototype.U=function(){return"arraybuffer"},e(hc,Yl);var pi=[null],uc=h(pi,{nd:function(t,e){e[e.length-1].md.push(t.getAttribute("ref"))},tag:yc}),cc=h(pi,{node:function(t,e){var o=e[0],i=e[e.length-1],r=t.getAttribute("id"),n=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];i.Sh[r]=n,Wt((t=d({fe:{}},fc,t,e)).fe)||(al(n=new p(n),!1,o),(o=new v(n)).jc(r),o.H(t.fe),i.features.push(o))},way:function(t,e){var o=e[0],i=t.getAttribute("id");t=d({md:[],fe:{}},uc,t,e),e=e[e.length-1];for(var r=[],n=0,p=t.md.length;n>=5;e+=n+=String.fromCharCode(r+63)}return e}function Oc(t,e){e=e||1e5;for(var o=[],i=0,r=0,n=0,p=t.length;n>1):r>>1;for(t=0,i=o.length;tx.width?x.width-T:R),D=P+E>x.height?x.height-E:P;e.drawImage(x,T,E,I,D,N,A,I*o,D*o),1!=M&&(e.globalAlpha=F),1==j&&!C||e.setTransform.apply(e,d)}++u;break;case 5:for(c=N[1],b=N[2],S=N[3],P=N[4]*o,M=N[5]*o,C=N[6],j=N[7]*o,x=N[8],w=N[9],(A=N[10])&&(C+=r);ca[2];)h=qd(this,t,h=l*++b),y.La(f,r,h,s,n),p-=l;h=qd(this,t,0)}ap(f,s,v/2,m/2),f!=o&&(Zd(this,"render",f,t,h),o.drawImage(f.canvas,-d,-g),f.translate(-d,-g)),f.globalAlpha=c}u&&o.restore(),this.ef(o,t,e,h)},Qd.prototype.Ea=function(t,e,o,i,r){var n,p;if(this.f)return n=this.a,p={},this.f.Ea(t,e.viewState.resolution,e.viewState.rotation,o,{},function(t){var e=q(t).toString();if(!(e in p))return p[e]=!0,i.call(r,t,n)})},Qd.prototype.D=function(){Gd(this)},Qd.prototype.sd=function(t){function e(t){var e,o=t.Lc();if(o?e=o.call(t,n):(o=a.f)&&(e=o(t,n)),e){if(o=!1,Array.isArray(e))for(var i=0,r=e.length;it.Sa:t.g===jg&&(i=t.a[0].length>t.Sa,r=[t.a[0][0],t.a[0][t.a[0].length-2]]),i)for(var i=e.map,n=0,p=r.length;n=t.va&&(t.u?i.pop():o=!0),i.push(e.slice()),t.Za(i,r)):t.g===jg&&((i=t.a[0]).length>=t.va&&(t.u?i.pop():o=!0),i.push(e.slice()),o&&(t.l=i[0]),t.Za(t.a,r)),Eg(t),o&&t.Pd()}function Tg(t){t.l=null;var e=t.j;return e&&(t.j=null,t.B=null,t.C=null,t.pa.ha().clear(!0)),e}function Eg(t){var e=[];t.j&&e.push(t.j),t.C&&e.push(t.C),t.B&&e.push(t.B),(t=t.pa.ha()).clear(!0),t.cd(e)}e(hg,oo),hg.prototype.Ea=Z,e(P,hg),P.prototype.yb=function(t){var e,o=q(t).toString();fg(this,o,t)&&(cg(this,o,t),(e=t.V())?(o=e.G(),this.a&&this.a.Ca(o,t)):this.g[o]=t,this.b(new gg("addfeature",t))),this.s()},e(gg,_e),e(vg,zr),vg.prototype.setMap=function(t){zr.prototype.setMap.call(this,t),this.ri()};var Ag="Point",Cg="LineString",jg="Polygon",Lg="Circle";function Rg(t,e){_e.call(this,t),this.feature=e}function Fg(t){var e,o;this.a=this.j=null,this.C=!1,this.B=this.l=null,(t=t||{}).extent&&this.g(t.extent),zr.call(this,{handleDownEvent:Ig,handleDragEvent:kg,handleEvent:Ng,handleUpEvent:Og}),this.u=new S({source:new P({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle||(e=Ua(),function(){return e.Polygon}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.I=new S({source:new P({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle||(o=Ua(),function(){return o.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0})}function Ng(t){var e,o;return!(t instanceof ci&&("pointermove"!=t.type||this.D||Bg(this,Gg(this,e=t.pixel,o=t.map)||o.Wa(e)),Zr.call(this,t),1))}function Ig(t){function e(t){var e=null,o=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?o=r[3]:t[1]==r[3]&&(o=r[1]),null!==e&&null!==o?[e,o]:null}var o=t.pixel,i=t.map,r=this.G();return(t=Gg(this,o,i))&&r?(o=t[0]==r[0]||t[0]==r[2]?t[0]:null,i=t[1]==r[1]||t[1]==r[3]?t[1]:null,null!==o&&null!==i?this.a=Dg(e(t)):null!==o?this.a=Ug(e([o,r[1]]),e([o,r[3]])):null!==i&&(this.a=Ug(e([r[0],i]),e([r[2],i])))):(t=i.Wa(o),this.g([t[0],t[1],t[0],t[1]]),this.a=Dg(t)),!0}function kg(t){return this.a&&(t=t.coordinate,this.g(this.a(t)),Bg(this,t)),!0}function Og(){this.a=null;var t=this.G();return t&&Tt(t)||this.g(null),!1}function Dg(e){return function(t){return lt([e,t])}}function Ug(e,o){return e[0]==o[0]?function(t){return lt([e,[t[0],o[1]]])}:e[1]==o[1]?function(t){return lt([e,[o[0],t[1]]])}:null}function Gg(t,e,o){var i=o.Wa(e);if(r=t.G()){(r=[[[r[0],r[1]],[r[0],r[3]]],[[r[0],r[3]],[r[2],r[3]]],[[r[2],r[3]],[r[2],r[1]]],[[r[2],r[1]],[r[0],r[1]]]]).sort(function(t,e){return $i(i,t)-$i(i,e)});var r=r[0],n=Xi(i,r),p=o.Ja(n);if(_i(e,p)<=10)return e=o.Ja(r[0]),o=o.Ja(r[1]),e=Yi(p,e),o=Yi(p,o),t.C=Math.sqrt(Math.min(e,o))<=10,n=t.C?oe.v),d))Math.abs(o[0]-r[0])<=Math.abs(o[1]-r[1])?(f=[(i[0]+r[0])/2,(i[1]+r[1])/2],c=e.a(f),y=[(n[0]+o[0])/2,(n[1]+o[1])/2],u=e.a(y),t(e,o,i,f,y,p,s,c,u,h-1),t(e,y,f,r,n,u,c,a,l,h-1)):(f=[(o[0]+i[0])/2,(o[1]+i[1])/2],c=e.a(f),y=[(r[0]+n[0])/2,(r[1]+n[1])/2],u=e.a(y),t(e,o,f,y,n,p,c,u,l,h-1),t(e,f,i,r,y,c,s,a,u,h-1));else{if(f){if(!e.l)return;e.o=!0}e.c.push({source:[p,a,l],target:[o,r,n]}),e.c.push({source:[p,s,a],target:[o,i,r]})}}}(this,t,e,i,o,r,a,l,h,10),this.o&&(n=1/0,this.c.forEach(function(t){n=Math.min(n,t.source[0][0],t.source[1][0],t.source[2][0])}),this.c.forEach(function(t){var e;Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-n>this.b/2&&((e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]])[0][0]-n>this.b/2&&(e[0][0]-=this.b),e[1][0]-n>this.b/2&&(e[1][0]-=this.b),e[2][0]-n>this.b/2&&(e[2][0]-=this.b),Math.max(e[0][0],e[1][0],e[2][0])-Math.min(e[0][0],e[1][0],e[2][0])r[0]||t[1]<0||t[1]>r[1])&&(this.f||(this.f=xo(1,1)),this.f.clearRect(0,0,1,1),this.f.drawImage(this.M.Y(),t[0],t[1],1,1,0,0,1,1),0<(r=this.f.getImageData(0,0,1,1).data)[3]))return o.call(i,this.a,r)}},e(G0,o),G0.prototype.Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new S0(this):"webgl"===o&&(e=new U0(t,this)),e},e(B0,w0),B0.prototype.sd=function(t,e){var o=t.pixelRatio,i=t.size,r=(p=t.viewState).projection,n=p.resolution,p=p.center,s=this.a,a=s.ha(),l=a.i,h=a.Ta(r),y=h.tc(n,this.T),u=h.Da(y),c=Math.round(n/u)||1,f=t.extent;if(Ot(f=void 0!==e.extent?Rt(f,e.extent):f))return!1;var d=Le(h,f,u),g=h.Pc(y),v=h.Da(y),m=at(h.gb(y),h.j),g=vt(g[0]+d.ca*m[0]*v,g[1]+d.da*m[1]*v,g[0]+(d.$+1)*m[0]*v,g[1]+(d.ia+1)*m[1]*v,void 0),v=a.nb(o),b=((m={})[y]={},this.Nf(a,r,m)),x=this.l,w=this.va,S=!1;for(j=d.ca;j<=d.$;++j)for(L=d.da;L<=d.ia;++L){var P=a.Nc(y,j,L,o,r);3!=P.getState()||this.a.kd()||pd(P,2),K0(this,P)||(P=nd(P)),K0(this,P)?2==P.getState()&&(m[y][P.ta.toString()]=P,S||-1!=this.g.indexOf(P)||(S=!0)):Ce(h,P.ta,b,w,x)||(P=je(h,P.ta,w,x))&&b(y+1,P)}if(j=(j=t.viewHints)[0]||j[1],!(this.f&&16t.highWaterMark}function ev(t){hg.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.va=void 0!==t.opaque&&t.opaque,this.$a=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.a=new Q0(t.cacheSize),this.o=[0,0],this.uc=""}function ov(t,e,o,i,r){if(!(e=t.Wd(e)))return!1;for(var n,p,s=!0,a=i.ca;a<=i.$;++a)for(var l=i.da;l<=i.ia;++l)n=t.Sb(o,a,l),p=!1,(p=e.b.hasOwnProperty(n)?(p=2===(n=e.get(n)).getState())&&!1!==r(n):p)||(s=!1);return s}function iv(t,e){t.uc!==e&&(t.uc=e,t.s())}function rv(t,e,o){var i,r,n=void 0!==o?o:t.c;return o=t.Ta(n),t.u&&n.c&&(e=(i=e)[0],t=Fe(o,i),e=ut(n=De(n),t)?i:(i=It(n),t[0]+=i*Math.ceil((n[0]-t[0])/i),o.bg(t,e))),i=e[0],n=e[1],t=e[2],(o=!(o.minZoom>i||o.maxZoomTerms of Use'});function j(t){var e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",o=void 0!==t.tileGrid?t.tileGrid:Ie({extent:De(e),maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});A.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX})}function L(t){this.C=t.account,this.B=t.map||"",this.f=t.config||{},this.l={},j.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,state:"loading",wrapX:t.wrapX}),lv(this)}function lv(t){var e,o,i=JSON.stringify(t.f);t.l[i]?hv(t,t.l[i]):(e="https://"+t.C+".cartodb.com/api/v1/map",t.B&&(e+="/named/"+t.B),(o=new XMLHttpRequest).addEventListener("load",t.Dl.bind(t,i)),o.addEventListener("error",t.Cl.bind(t)),o.open("POST",e),o.setRequestHeader("Content-type","application/json"),o.send(JSON.stringify(t.f)))}function hv(t,e){t.jb("https://"+e.cdn_url.https+"/"+t.C+"/api/v1/map/"+e.layergroupid+"/{z}/{x}/{y}.png")}function R(t){P.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.features=[],this.geometryFunction=t.geometryFunction||function(t){return _((t=t.V())instanceof p,10),t},this.source=t.source,this.source.J("change",R.prototype.sa,this)}function yv(t,e){var o=[],i=(Object.keys(e).forEach(function(t){null!==e[t]&&void 0!==e[t]&&o.push(t+"="+encodeURIComponent(e[t]))}),o.join("&"));return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+i}function uv(t){j0.call(this,{attributions:(t=t||{}).attributions,logo:t.logo,projection:t.projection,resolutions:t.resolutions}),this.R=void 0!==t.crossOrigin?t.crossOrigin:null,this.T=void 0===t.hidpi||t.hidpi,this.f=t.url,this.g=t.imageLoadFunction||R0,this.v=t.params||{},this.M=null,this.l=[0,0],this.I=0,this.B=void 0!==t.ratio?t.ratio:1.5}function cv(t){j0.call(this,{projection:t.projection,resolutions:t.resolutions}),this.R=void 0!==t.crossOrigin?t.crossOrigin:null,this.l=void 0!==t.displayDpi?t.displayDpi:96,this.g=t.params||{},this.I=t.url,this.f=t.imageLoadFunction||R0,this.T=void 0===t.hidpi||t.hidpi,this.pa=void 0!==t.metersPerUnit?t.metersPerUnit:1,this.v=void 0!==t.ratio?t.ratio:1,this.va=void 0!==t.useOverlay&&t.useOverlay,this.M=null,this.B=0}function fv(t){var e=t.imageExtent,o=void 0!==t.crossOrigin?t.crossOrigin:null,i=t.imageLoadFunction||R0;j0.call(this,{attributions:t.attributions,logo:t.logo,projection:ge(t.projection)}),this.M=new od(e,void 0,1,this.j,t.url,o,i),this.f=t.imageSize||null,g(this.M,"change",this.o,this)}function dv(t){j0.call(this,{attributions:(t=t||{}).attributions,logo:t.logo,projection:t.projection,resolutions:t.resolutions}),this.pa=void 0!==t.crossOrigin?t.crossOrigin:null,this.g=t.url,this.v=t.imageLoadFunction||R0,this.f=t.params||{},this.l=!0,mv(this),this.T=t.serverType,this.va=void 0===t.hidpi||t.hidpi,this.M=null,this.B=[0,0],this.R=0,this.I=void 0!==t.ratio?t.ratio:1.5}C.prototype.T=function(){return this.f},C.prototype.fa=function(){return this.l},C.prototype.pa=function(t){var e,i,p,s,r,n,a;200!=t.statusCode||"OK"!=t.statusDescription||"ValidCredentials"!=t.authenticationResultCode||1!=t.resourceSets.length||1!=t.resourceSets[0].resources.length?ug(this,"error"):(-1==(e=t.brandLogoUri).indexOf("https")&&(e=e.replace("http","https")),i=t.resourceSets[0].resources[0],p=-1==this.C?i.zoomMax:this.C,s=Ie({extent:t=De(this.c),minZoom:i.zoomMin,maxZoom:p,tileSize:(i.imageWidth==i.imageHeight?i.imageWidth:[i.imageWidth,i.imageHeight])/this.nb()}),this.tileGrid=s,r=this.R,n=this.B,this.tileUrlFunction=Y0(i.imageUrlSubdomains.map(function(t){var e=[0,0,0],o=i.imageUrl.replace("{subdomain}",t).replace("{culture}",r);return function(t){if(t)return Te(t[0],t[1],-t[2]-1,e),t=o,n&&(t+="&dpi=d1&device=mobile"),t.replace("{quadkey}",function(t){for(var e=t[0],o=Array(e),i=1<>=1}return o.join("")}(e))}})),i.imageryProviders&&(a=be(ge("EPSG:4326"),this.c),(t=i.imageryProviders.map(function(t){var e=t.attribution,n={};return t.coverageAreas.forEach(function(t){var e,o=t.zoomMin,i=Math.min(t.zoomMax,p);for(t=Ut([(t=t.bbox)[1],t[0],t[3],t[2]],a),e=o;e<=i;++e){var r=e.toString(),o=Re(s,t,e);r in n?n[r].push(o):n[r]=[o]}}),new Ue({html:e,tileRanges:n})})).push(av),this.ua(t)),this.D=e,ug(this,"ready"))},e(j,A),e(L,j),L.prototype.Kk=function(){return this.f},e(R,P),R.prototype.$n=function(){return this.distance},e(uv,j0),uv.prototype.co=function(){return this.v},e(cv,j0),cv.prototype.ko=function(){return this.g},e(fv,j0),fv.prototype.Jc=function(t){return kt(t,this.M.G())?this.M:null},fv.prototype.o=function(t){var e,o,i,r,n;2==this.M.getState()&&(i=this.M.G(),e=this.M.Y(),n=this.f?(o=this.f[0],this.f[1]):(o=e.width,e.height),(i=Math.ceil(It(i)/(Lt(i)/n)))!=o)&&(r=(i=xo(i,n)).canvas,i.drawImage(e,0,0,o,n,0,0,r.width,r.height),this.M.Og(r)),j0.prototype.o.call(this,t)},e(dv,j0);var gv=[101,101];function vv(t,e,o,i,r,n){if(_(void 0!==t.g,9),n[t.l?"CRS":"SRS"]=r.mb,"STYLES"in t.f||(n.STYLES=""),1!=i)switch(t.T){case"geoserver":i=90*i+.5|0,n.FORMAT_OPTIONS="FORMAT_OPTIONS"in n?n.FORMAT_OPTIONS+";dpi:"+i:"dpi:"+i;break;case"mapserver":n.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":n.DPI=90*i;break;default:_(!1,8)}return n.WIDTH=o[0],n.HEIGHT=o[1],o=r.b,r=t.l&&"ne"==o.substr(0,2)?[e[1],e[0],e[3],e[2]]:e,n.BBOX=r.join(","),yv(t.g,n)}function mv(t){t.l=0<=Wi(t.f.VERSION||"1.3.0")}function bv(t){var e=void 0!==(t=t||{}).attributions?t.attributions:[xv];j.call(this,{attributions:e,cacheSize:t.cacheSize,crossOrigin:void 0!==t.crossOrigin?t.crossOrigin:"anonymous",opaque:void 0===t.opaque||t.opaque,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:void 0!==t.url?t.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",wrapX:t.wrapX})}dv.prototype.so=function(t,e,o,i){var r,n;if(void 0!==this.g)return r=jt(t,e,0,gv),n={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.f.LAYERS},Gt(n,this.f,i),i=Math.floor((r[3]-t[1])/e),n[this.l?"I":"X"]=Math.floor((t[0]-r[0])/e),n[this.l?"J":"Y"]=i,vv(this,r,gv,1,ge(o),n)},e(bv,j);var xv=new Ue({html:'© OpenStreetMap contributors.'}),pi=(ms.df={},ms.df.Af=function(){},ms.df=ms.df||{});function wv(y){var u=!0;try{new ImageData(10,10)}catch(t){u=!1}return function(t){var e=t.buffers,o=t.meta,i=t.width,r=t.height,n=e.length,p=e[0].byteLength;if(t.imageOps){for(p=Array(n),t=0;tthis.fk;)this.Ed.shift().callback(null,null)},Sv.prototype.dh=function(){if(0===this.oe&&0Stamen Design, under CC BY 3.0.'}),xv],Fv={terrain:{Lb:"jpg",opaque:!0},"terrain-background":{Lb:"jpg",opaque:!0},"terrain-labels":{Lb:"png",opaque:!1},"terrain-lines":{Lb:"png",opaque:!1},"toner-background":{Lb:"png",opaque:!0},toner:{Lb:"png",opaque:!0},"toner-hybrid":{Lb:"png",opaque:!1},"toner-labels":{Lb:"png",opaque:!1},"toner-lines":{Lb:"png",opaque:!1},"toner-lite":{Lb:"png",opaque:!0},watercolor:{Lb:"jpg",opaque:!0}},Nv={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}};function F(t){A.call(this,{attributions:(t=t||{}).attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.f=t.params||{},this.l=gt(),iv(this,Iv(this))}function Iv(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function kv(t){ev.call(this,{opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX})}function Ov(t,e,o){rd.call(this,t,2),this.c=e,this.Ia=o,this.a=null}function N(t){var e;this.f=null,A.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:ge("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX}),t.url?t.jsonp?q0(t.url,this.og.bind(this),this.Ve.bind(this)):((e=new XMLHttpRequest).addEventListener("load",this.Ao.bind(this)),e.addEventListener("error",this.zo.bind(this)),e.open("GET",t.url),e.send()):t.tileJSON?this.og(t.tileJSON):_(!1,51)}function Dv(t){var e;ev.call(this,{projection:ge("EPSG:3857"),state:"loading"}),this.v=void 0===t.preemptive||t.preemptive,this.l=_0,this.g=void 0,this.f=t.jsonp||!1,t.url?this.f?q0(t.url,this.pg.bind(this),this.We.bind(this)):((e=new XMLHttpRequest).addEventListener("load",this.Eo.bind(this)),e.addEventListener("error",this.Do.bind(this)),e.open("GET",t.url),e.send()):t.tileJSON?this.pg(t.tileJSON):_(!1,51)}function Uv(t,e,o,i,r,n){rd.call(this,t,e),this.o=o,this.a=i,this.v=r,this.c=this.j=this.g=null,this.l=n}function I(t){var e=(t=t||{}).params||{};A.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,opaque:!(!("TRANSPARENT"in e)||e.TRANSPARENT),projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.C=void 0!==t.gutter?t.gutter:0,this.f=e,this.l=!0,this.B=t.serverType,this.T=void 0===t.hidpi||t.hidpi,this.R="",Bv(this),this.fa=gt(),Wv(this),iv(this,Kv(this))}function Gv(t,e,o,i,r,n,p){var s=t.urls;if(s){if(p.WIDTH=o[0],p.HEIGHT=o[1],p[t.l?"CRS":"SRS"]=n.mb,"STYLES"in t.f||(p.STYLES=""),1!=r)switch(t.B){case"geoserver":o=90*r+.5|0,p.FORMAT_OPTIONS="FORMAT_OPTIONS"in p?p.FORMAT_OPTIONS+";dpi:"+o:"dpi:"+o;break;case"mapserver":p.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":p.DPI=90*r;break;default:_(!1,52)}return n=n.b,t.l&&"ne"==n.substr(0,2)&&(t=i[0],i[0]=i[1],i[1]=t,t=i[2],i[2]=i[3],i[3]=t),p.BBOX=i.join(","),yv(1==s.length?s[0]:s[rt((e[1]<>=1,i>>=1;break;default:_(!1,53)}n.push([1,1]),n.reverse();for(var r=[1],p=[0],i=1,o=n.length;i=e+this.b&&s.height>=o+this.b)return p={offsetX:s.x+this.b,offsetY:s.y+this.b,image:this.f},this.c[t]=p,i.call(r,this.i,s.x+this.b,s.y+this.b),t=n,e+=this.b,i=o+this.b,e=s.width-e>s.height-i?(o={x:s.x+e,y:s.y,width:s.width-e,height:s.height},{x:s.x,y:s.y+i,width:e,height:s.height-i}):(o={x:s.x+e,y:s.y,width:s.width-e,height:i},{x:s.x,y:s.y+i,width:s.width,height:s.height-i}),em(this,t,o,e),p}return null},om.prototype.add=function(t,e,o,i,r,n){return!(e+this.b>this.i||o+this.b>this.i)&&(i=im(this,!1,t,e,o,i,n))?(t=im(this,!0,t,e,o,r||Z,n),{offsetX:i.offsetX,offsetY:i.offsetY,image:i.image,Zl:t.image}):null},t("ol.Attribution",Ue),Ue.prototype.getHTML=Ue.prototype.i,t("ol.Collection",y),y.prototype.extend=y.prototype.fg,y.prototype.getArray=y.prototype.tm,y.prototype.getLength=y.prototype.dc,y.prototype.insertAt=y.prototype.He,y.prototype.removeAt=y.prototype.Hg,y.prototype.setAt=y.prototype.Wp,t("ol.color.asArray",uo),t("ol.color.asString",co),t("ol.colorlike.asColorLike",bo),t("ol.control.defaults",Io),t("ol.coordinate.add",Vi),t("ol.coordinate.createStringXY",function(e){return function(t){return Qi(t,e)}}),t("ol.coordinate.format",Hi),t("ol.coordinate.rotate",qi),t("ol.coordinate.toStringHDMS",function(t,e){return t?zi("NS",t[1],e)+" "+zi("EW",t[0],e):""}),t("ol.coordinate.toStringXY",Qi),t("ol.DeviceOrientation",Aa),Aa.prototype.getAlpha=Aa.prototype.Fk,Aa.prototype.getBeta=Aa.prototype.Ik,Aa.prototype.getGamma=Aa.prototype.Ok,Aa.prototype.getHeading=Aa.prototype.um,Aa.prototype.getTracking=Aa.prototype.Th,Aa.prototype.setTracking=Aa.prototype.gg,t("ol.easing.easeIn",Ao),t("ol.easing.easeOut",Co),t("ol.easing.inAndOut",jo),t("ol.easing.linear",Lo),t("ol.easing.upAndDown",function(t){return t<.5?jo(2*t):1-jo(2*(t-.5))}),t("ol.extent.boundingExtent",lt),t("ol.extent.buffer",ht),t("ol.extent.containsCoordinate",ut),t("ol.extent.containsExtent",ct),t("ol.extent.containsXY",ft),t("ol.extent.createEmpty",gt),t("ol.extent.equals",wt),t("ol.extent.extend",St),t("ol.extent.getArea",Tt),t("ol.extent.getBottomLeft",Et),t("ol.extent.getBottomRight",At),t("ol.extent.getCenter",Ct),t("ol.extent.getHeight",Lt),t("ol.extent.getIntersection",Rt),t("ol.extent.getSize",function(t){return[t[2]-t[0],t[3]-t[1]]}),t("ol.extent.getTopLeft",Ft),t("ol.extent.getTopRight",Nt),t("ol.extent.getWidth",It),t("ol.extent.intersects",kt),t("ol.extent.isEmpty",Ot),t("ol.extent.applyTransform",Ut),t("ol.Feature",v),v.prototype.getGeometry=v.prototype.V,v.prototype.getId=v.prototype.wm,v.prototype.getGeometryName=v.prototype.Qk,v.prototype.getStyle=v.prototype.xm,v.prototype.getStyleFunction=v.prototype.Lc,v.prototype.setGeometry=v.prototype.Ra,v.prototype.setStyle=v.prototype.hg,v.prototype.setId=v.prototype.jc,v.prototype.setGeometryName=v.prototype.Tc,t("ol.featureloader.xhr",rl),t("ol.Geolocation",$f),$f.prototype.getAccuracy=$f.prototype.Dk,$f.prototype.getAccuracyGeometry=$f.prototype.Ek,$f.prototype.getAltitude=$f.prototype.Gk,$f.prototype.getAltitudeAccuracy=$f.prototype.Hk,$f.prototype.getHeading=$f.prototype.ym,$f.prototype.getPosition=$f.prototype.zm,$f.prototype.getProjection=$f.prototype.Uh,$f.prototype.getSpeed=$f.prototype.ll,$f.prototype.getTracking=$f.prototype.Vh,$f.prototype.getTrackingOptions=$f.prototype.Gh,$f.prototype.setProjection=$f.prototype.Wh,$f.prototype.setTracking=$f.prototype.Ke,$f.prototype.setTrackingOptions=$f.prototype.wj,t("ol.Graticule",Qf),Qf.prototype.getMap=Qf.prototype.Cm,Qf.prototype.getMeridians=Qf.prototype.al,Qf.prototype.getParallels=Qf.prototype.hl,t("ol.has.DEVICE_PIXEL_RATIO",Qo),t("ol.has.CANVAS",ei),t("ol.has.DEVICE_ORIENTATION",ee),t("ol.has.GEOLOCATION",oi),t("ol.has.TOUCH",ii),t("ol.has.WEBGL",li),od.prototype.getImage=od.prototype.Y,sd.prototype.getImage=sd.prototype.Y,t("ol.inherits",e),t("ol.interaction.defaults",Fn),t("ol.Kinetic",Cr),t("ol.loadingstrategy.all",lg),t("ol.loadingstrategy.bbox",function(t){return[t]}),t("ol.loadingstrategy.tile",function(i){return function(t,e){e=i.tc(e),t=Re(i,t,e);var o=[];for((e=[e,0,0])[1]=t.ca;e[1]<=t.$;++e[1])for(e[2]=t.da;e[2]<=t.ia;++e[2])o.push(i.Aa(e));return o}}),t("ol.Map",u),u.prototype.addControl=u.prototype.kk,u.prototype.addInteraction=u.prototype.lk,u.prototype.addLayer=u.prototype.ih,u.prototype.addOverlay=u.prototype.jh,u.prototype.forEachFeatureAtPixel=u.prototype.we,u.prototype.forEachLayerAtPixel=u.prototype.Im,u.prototype.hasFeatureAtPixel=u.prototype.Yl,u.prototype.getEventCoordinate=u.prototype.Tf,u.prototype.getEventPixel=u.prototype.xe,u.prototype.getTarget=u.prototype.ag,u.prototype.getTargetElement=u.prototype.jd,u.prototype.getCoordinateFromPixel=u.prototype.Wa,u.prototype.getControls=u.prototype.Lk,u.prototype.getOverlays=u.prototype.fl,u.prototype.getOverlayById=u.prototype.el,u.prototype.getInteractions=u.prototype.Sk,u.prototype.getLayerGroup=u.prototype.Kc,u.prototype.getLayers=u.prototype.Xh,u.prototype.getPixelFromCoordinate=u.prototype.Ja,u.prototype.getSize=u.prototype.Ob,u.prototype.getView=u.prototype.Z,u.prototype.getViewport=u.prototype.sl,u.prototype.renderSync=u.prototype.Tp,u.prototype.removeControl=u.prototype.Mp,u.prototype.removeInteraction=u.prototype.Np,u.prototype.removeLayer=u.prototype.Pp,u.prototype.removeOverlay=u.prototype.Qp,u.prototype.setLayerGroup=u.prototype.qj,u.prototype.setSize=u.prototype.Qg,u.prototype.setTarget=u.prototype.Le,u.prototype.setView=u.prototype.iq,u.prototype.updateSize=u.prototype.Ad,t("ol.Object",oo),oo.prototype.getKeys=oo.prototype.O,oo.prototype.getProperties=oo.prototype.N,oo.prototype.setProperties=oo.prototype.H,oo.prototype.unset=oo.prototype.P,t("ol.Observable",eo),t("ol.Observable.unByKey",function(t){if(Array.isArray(t))for(var e=0,o=t.length;e>>0,r=0;r=e.ca&&t.da<=e.ia&&t.ia>=e.da}function Q(t,e,o){return Math.min(Math.max(t,e),o)}e(q,Error);var tt="cosh"in Math?Math.cosh:function(t){return((t=Math.exp(t))+1/t)/2};function et(t,e,o,i,r,n){var s,a=r-o,p=n-i;return(a||p)&&(1<(s=((t-o)*a+(e-i)*p)/(a*a+p*p))?(o=r,i=n):0t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function Pt(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function At(t,e,o,i,r){for(;oe[0]?t:e)[0],o[1]=(t[1]>e[1]?t:e)[1],o[2]=(t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ut(t){return t[2]=t.minZoom;){if(o.call(null,e,Ie(t,r,e,i)))return!0;--e}return!1}function Le(t,e,o,i){return e[0]T.$)&&($(E,new J(rt(M.ca,j),rt(M.$,j),M.da,M.ia))||M.$-M.ca+1>j&&$(E,T))){m=!0;break t}}m=!1}else m=!0}else m=!1;m?(b in l&&delete l[b],(m=v.b)in u||(u[m]=!0,h[b]=v)):l[b]=v}}}for(r in f=(a=[h,l])[0],a=a[1],this.l)r in f?(this.j[r]||(this.l[r].style.display="",this.j[r]=!0),delete f[r]):r in a?(this.j[r]&&(this.l[r].style.display="none",delete this.j[r]),delete a[r]):(Eo(this.l[r]),delete this.l[r],delete this.j[r]);for(r in f)g=document.createElement("LI"),g.innerHTML=f[r].b,this.I.appendChild(g),this.l[r]=g,this.j[r]=!0;for(r in a)g=document.createElement("LI"),g.innerHTML=a[r].b,g.style.display="none",this.I.appendChild(g),this.l[r]=g;for(s in r=!Zt(this.j)||!Zt(t.logos),this.B!=r&&(this.element.style.display=r?"":"none",this.B=r),r&&Zt(this.j)?this.element.classList.add("ol-logo-only"):this.element.classList.remove("ol-logo-only"),t=t.logos,r=this.T)s in t||(Eo(r[s]),delete r[s]);for(n in t)(a=t[n])instanceof HTMLElement&&(this.u.appendChild(a),r[n]=a),n in r||((s=new Image).src=n,""===a?f=s:((f=document.createElement("a")).href=a,f.appendChild(s)),this.u.appendChild(f),r[n]=f);this.u.style.display=Zt(t)?"none":""}else this.B&&(this.element.style.display="none",this.B=!1)}function Lo(t){t.element.classList.toggle("ol-collapsed"),t.c?Ao(t.D,t.C):Ao(t.C,t.D),t.c=!t.c}function Ro(t){return Math.pow(t,3)}function Io(t){return 1-Ro(1-t)}function No(t){return 3*t*t-2*t*t*t}function Fo(t){return t}function ko(t){var e=void 0!==(t=t||{}).className?t.className:"ol-rotate",o=void 0!==t.label?t.label:"⇧",i=(this.c=null,"string"==typeof o?(this.c=document.createElement("span"),this.c.className="ol-compass",this.c.textContent=o):(this.c=o,this.c.classList.add("ol-compass")),t.tipLabel||"Reset rotation");(o=document.createElement("button")).className=e+"-reset",o.setAttribute("type","button"),o.title=i,o.appendChild(this.c),d(o,"click",ko.prototype.D,this),(i=document.createElement("div")).className=e+" ol-unselectable ol-control",i.appendChild(o),e=t.render||Do,this.o=t.resetNorth||void 0,To.call(this,{element:i,render:e,target:t.target}),this.l=void 0!==t.duration?t.duration:250,this.j=void 0===t.autoHide||t.autoHide,this.u=void 0,this.j&&this.element.classList.add("ol-hidden")}function Do(t){var e,o;(t=t.frameState)&&((t=t.viewState.rotation)!=this.u&&(e="rotate("+t+"rad)",this.j&&((o=this.element.classList.contains("ol-hidden"))||t?o&&t&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")),this.c.style.msTransform=e,this.c.style.webkitTransform=e,this.c.style.transform=e),this.u=t)}function Oo(t){var e=void 0!==(t=t||{}).className?t.className:"ol-zoom",o=void 0!==t.delta?t.delta:1,i=void 0!==t.zoomInLabel?t.zoomInLabel:"+",r=void 0!==t.zoomOutLabel?t.zoomOutLabel:"−",n=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",s=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",a=document.createElement("button");a.className=e+"-in",a.setAttribute("type","button"),a.title=n,a.appendChild("string"==typeof i?document.createTextNode(i):i),d(a,"click",Oo.prototype.j.bind(this,o)),(i=document.createElement("button")).className=e+"-out",i.setAttribute("type","button"),i.title=s,i.appendChild("string"==typeof r?document.createTextNode(r):r),d(i,"click",Oo.prototype.j.bind(this,-o)),(o=document.createElement("div")).className=e+" ol-unselectable ol-control",o.appendChild(a),o.appendChild(i),To.call(this,{element:o,target:t.target}),this.c=void 0!==t.duration?t.duration:250}function Uo(t){t=t||{};var e=new ho;return void 0!==t.zoom&&!t.zoom||e.push(new Oo(t.zoomOptions)),void 0!==t.rotate&&!t.rotate||e.push(new ko(t.rotateOptions)),void 0!==t.attribution&&!t.attribution||e.push(new jo(t.attributionOptions)),e}function Go(t){this.c=void 0!==(t=t||{}).className?t.className:"ol-full-screen";var e=void 0!==t.label?t.label:"⤢",o=(this.o="string"==typeof e?document.createTextNode(e):e,e=void 0!==t.labelActive?t.labelActive:"×",this.l="string"==typeof e?document.createTextNode(e):e,t.tipLabel||"Toggle full-screen");(e=document.createElement("button")).className=this.c+"-"+Xo(),e.setAttribute("type","button"),e.title=o,e.appendChild(this.o),d(e,"click",this.C,this),(o=document.createElement("div")).className=this.c+" ol-unselectable ol-control "+(Bo()?"":"ol-unsupported"),o.appendChild(e),To.call(this,{element:o,target:t.target}),this.D=void 0!==t.keys&&t.keys,this.j=t.source}function Bo(){var t=document.body;return t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled}function Xo(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function Vo(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}e(To,ro),To.prototype.ka=function(){Eo(this.element),ro.prototype.ka.call(this)},To.prototype.g=function(){return this.a},To.prototype.setMap=function(t){this.a&&Eo(this.element);for(var e=0,o=this.v.length;e=e.length){for(var r=[],n=0;nt.D||Math.abs(e.clientY-t.c.clientY)>t.D}function Zi(t,e){this.l=t,this.c=e,this.b=[],this.i=[],this.a={}}function Ki(t){var e=t.b,o=t.i,i=e[0];return 1==e.length?(e.length=0,o.length=0):(e[0]=e.pop(),o[0]=o.pop(),zi(t,0)),e=t.c(i),delete t.a[e],i}function zi(t,e){for(var o=t.b,i=t.i,r=o.length,n=o[e],s=i[e],a=e;e>1;){var p=2*e+1,h=2*e+2,p=h>1;if(!(t[s]>n))break;i[o]=i[s],t[o]=t[s],o=s}i[o]=r,t[o]=n}function Hi(t){for(var e=t.l,o=t.b,i=t.i,r=0,n=o.length,s=0;s>1)-1;0<=e;e--)zi(t,e)}function qi(e,t){Zi.call(this,function(t){return e.apply(null,t)},function(t){return t[0].bb()}),this.v=t,this.j=0,this.g={}}function Ji(t,e,o){for(var i,r,n=0;t.j=l[0]&&r[2]<=l[2]||r[1]>=l[1]&&r[3]<=l[3])||Gr(t,e,o,i,function(t,e){var o,i,r,n,s,a=!1,p=dt(l,t),h=dt(l,e);return 1===p||1===h?a=!0:(o=l[0],i=l[1],r=l[2],n=l[3],s=e[0],t=((e=e[1])-t[1])/(s-t[0]),(a=(a=(a=2&h&&!(2&p)?o<=(a=s-(e-n)/t)&&a<=r:a)||!(4&h)||4&p?a:i<=(a=e-(s-r)*t)&&a<=n)||!(8&h)||8&p?a:o<=(a=s-(e-i)/t)&&a<=r)||!(16&h)||16&p||(a=i<=(a=e-(s-o)*t)&&a<=n)),a}))}function Xr(t,e,o,i,r){var n=o[0];if(!(Br(t,e,n,i,r)||Dr(t,e,n,i,r[0],r[1])||Dr(t,e,n,i,r[0],r[3])||Dr(t,e,n,i,r[2],r[1])||Dr(t,e,n,i,r[2],r[3])))return!1;if(1!==o.length)for(e=1,n=o.length;ee;)r-=3;if(!((e=t.b[2+o]-t.b[r+2])<1e3/60))return i=t.b[o]-t.b[r],o=t.b[1+o]-t.b[r+1],t.i=Math.atan2(o,i),t.a=Math.sqrt(i*i+o*o)/e,t.a>t.c}}}(this.a)&&(e=((e=this.a).c-e.a)/e.f,o=this.a.i,i=t.wa(),i=r.Ja(i),r=r.Wa([i[0]-e*Math.cos(o),i[1]-e*Math.sin(o)]),t.animate({center:t.Ec(r),duration:500,easing:Io})),nn(t,1,-1),!1)}function Cn(t){var e;return!!(0=this.u}function Gn(t){var e,o;xn(t)&&(e=this.a,o=t.pixel,e.c=this.g,e.i=o,Dn(e),kn(e),this.b(new Kn(Wn,t.coordinate,t)))}function Bn(t){return!xn(t)||(this.a.setMap(null),this.l(t,this.g,t.pixel)&&(this.j(t),this.b(new Kn(Zn,t.coordinate,t))),!1)}function Xn(t){var e,o;return!!(xn(t)&&gn(t)&&this.C(t))&&(this.g=t.pixel,this.a.setMap(t.map),e=this.a,o=this.g,e.c=this.g,e.i=o,Dn(e),kn(e),this.b(new Kn(Vn,t.coordinate,t)),!0)}e(Xi,eo),(r=Xi.prototype).Jh=function(t){Vi(this,t);var e,o=new mi("pointerup",this.i,t);this.b(o),this.o||t.button||(e=(o=this).c,t=new mi("click",o.i,e),o.b(t),o.j?(clearTimeout(o.j),o.j=0,t=new mi("dblclick",o.i,e),o.b(t)):o.j=setTimeout(function(){this.j=0;var t=new mi("singleclick",this.i,e);this.b(t)}.bind(o),250)),this.S||(this.f.forEach(qe),this.f.length=0,this.o=!1,this.c=null,$e(this.a),this.a=null)},r.Ol=function(t){Vi(this,t);var e=new mi("pointerdown",this.i,t);this.b(e),this.c=t,this.f.length||(this.a=new Ii(document),this.f.push(d(this.a,"pointermove",this.Hm,this),d(this.a,"pointerup",this.Jh,this),d(this.g,"pointercancel",this.Jh,this)))},r.Hm=function(t){var e;Wi(this,t)&&(this.o=!0,e=new mi("pointerdrag",this.i,t,this.o),this.b(e)),t.preventDefault()},r.Lp=function(t){this.b(new mi(t.type,this.i,t,!(!this.c||!Wi(this,t))))},r.ka=function(){this.v&&(qe(this.v),this.v=null),this.l&&(qe(this.l),this.l=null),this.f.forEach(qe),this.f.length=0,this.a&&($e(this.a),this.a=null),this.g&&($e(this.g),this.g=null),eo.prototype.ka.call(this)},Zi.prototype.clear=function(){this.b.length=0,this.i.length=0,Vt(this.a)},Zi.prototype.f=function(t){O(!(this.c(t)in this.a),31);var e=this.l(t);return 1/0!=e&&(this.b.push(t),this.i.push(e),this.a[this.c(t)]=!0,Yi(this,0,this.b.length-1),!0)},e(qi,Zi),qi.prototype.f=function(t){var e=Zi.prototype.f.call(this,t);return e&&d(t[0],"change",this.o,this),e},qi.prototype.o=function(t){var e=(t=t.target).getState();2!==e&&3!==e&&4!==e&&5!==e||(He(t,"change",this.o,this),(t=t.bb())in this.g&&(delete this.g[t],--this.j),this.v())},e(yr,ro),(r=yr.prototype).Ab=function(t,e){return this.Kb(t[0],t[1],e=e||[NaN,NaN],1/0),e},r.sb=function(t){return this.Mc(t[0],t[1])},r.Mc=fr,r.G=function(t){this.v!=this.i&&(this.l=this.se(this.l),this.v=this.i);var e=this.l;return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]):t=e,t},r.Rb=function(t){return this.Vd(t*t)},r.tb=function(t,e){return this.Dc(me(t,e)),this},e(b,yr),(r=b.prototype).Mc=fr,r.se=function(t){return xt(this.A,0,this.A.length,this.a,t)},r.ac=function(){return this.A.slice(0,this.a)},r.ga=function(){return this.A},r.bc=function(){return this.A.slice(this.A.length-this.a)},r.cc=function(){return this.ja},r.Vd=function(t){if(this.o!=this.i&&(Vt(this.f),this.g=0,this.o=this.i),!(t<0||this.g&&t<=this.g)){var e=t.toString();if(this.f.hasOwnProperty(e))return this.f[e];var o=this.hd(t);if(o.ga().length=this.f&&t<=this.a){var e=this.l||0;if(this.j){if(e+=i=B(this.j,t,1),i==this.j.length-1)return e;var o=this.j[i],i=o/this.j[i+1]}else o=this.a,i=this.C;e+=Math.log(o/t)/Math.log(i)}return e},r.Qf=function(t,e){var o=(o=(e=e||{}).size)||en(this);t instanceof b?"Circle"===t.U()?(f=Hr(t=t.G())).rotate(this.Qa(),Lt(t)):f=t:(O(Array.isArray(t),24),O(!Ut(t),25),f=Hr(t));for(var i=e.padding||[0,0,0,0],r=void 0===e.constrainResolution||e.constrainResolution,n=void 0!==e.nearest&&e.nearest,s=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.constrainResolution(this.a,e.maxZoom-this.l,0):0,a=f.ga(),p=this.Qa(),p=(t=Math.cos(-p),Math.sin(-p)),h=1/0,l=1/0,u=-1/0,c=-1/0,f=f.qa(),y=0,g=a.length;ythis.C&&(this.a=!0),this.j=i,(i=(t=t.map).Z()).g.rotation!==_i&&(r=t.a.getBoundingClientRect(),(e=Pn(this.o))[0]-=r.left,e[1]-=r.top,this.g=t.Wa(e),this.a)&&(r=i.Qa(),t.render(),hn(i,r+o,this.g))}function is(t){var e,o,i;return!(this.o.length<2&&(nn(t=t.map.Z(),1,-1),this.a&&(i=t.Qa(),e=this.g,o=this.u,i=t.constrainRotation(i,0),hn(t,i,e,o)),1))}function rs(t){return 2<=this.o.length&&(t=t.map,this.g=null,this.j=void 0,this.a=!1,this.l=0,this.D||nn(t.Z(),1,1),!0)}function ns(t){Mn.call(this,{handleDownEvent:ps,handleDragEvent:ss,handleUpEvent:as}),this.l=(t=t||{}).constrainResolution||!1,this.g=null,this.u=void 0!==t.duration?t.duration:400,this.a=void 0,this.j=1}function ss(t){var e=1,o=this.o[0],i=this.o[1],r=o.clientX-i.clientX,o=o.clientY-i.clientY,r=Math.sqrt(r*r+o*o);void 0!==this.a&&(e=this.a/r),this.a=r;var i=(r=(t=t.map).Z()).Pa(),n=r.a,s=r.f;n<(o=i*e)?(e=n/i,o=n):ot.a)&&(e=this.g,o=this.u,i=t.constrainResolution(i,0,this.j-1),un(t,i,e,o)),1))}function ps(t){return 2<=this.o.length&&(t=t.map,this.g=null,this.a=void 0,this.j=1,this.D||nn(t.Z(),1,1),!0)}function hs(t){t=t||{};var e=new ho,o=new sn(-.005,.05,100);return void 0!==t.altShiftDragRotate&&!t.altShiftDragRotate||e.push(new Ln),void 0!==t.doubleClickZoom&&!t.doubleClickZoom||e.push(new cn({delta:t.zoomDelta,duration:t.zoomDuration})),void 0!==t.dragPan&&!t.dragPan||e.push(new En({kinetic:o})),void 0!==t.pinchRotate&&!t.pinchRotate||e.push(new es),void 0!==t.pinchZoom&&!t.pinchZoom||e.push(new ns({constrainResolution:t.constrainResolution,duration:t.zoomDuration})),void 0!==t.keyboard&&!t.keyboard||(e.push(new Yn),e.push(new qn({delta:t.zoomDelta,duration:t.zoomDuration}))),void 0!==t.mouseWheelZoom&&!t.mouseWheelZoom||e.push(new _n({constrainResolution:t.constrainResolution,duration:t.zoomDuration})),void 0!==t.shiftDragZoom&&!t.shiftDragZoom||e.push(new zn({duration:t.zoomDuration})),e}function ls(t){ro.call(this);var e=Xt({},t);e.opacity=void 0!==t.opacity?t.opacity:1,e.visible=void 0===t.visible||t.visible,e.zIndex=void 0!==t.zIndex?t.zIndex:0,e.maxResolution=void 0!==t.maxResolution?t.maxResolution:1/0,e.minResolution=void 0!==t.minResolution?t.minResolution:0,this.H(e),this.a={layer:this,Je:!0}}function us(t){return t.a.opacity=Q(t.hc(),0,1),t.a.yj=t.$f(),t.a.visible=t.Mb(),t.a.extent=t.G(),t.a.zIndex=t.Ba(),t.a.maxResolution=t.fc(),t.a.minResolution=Math.max(t.gc(),0),t.a}function cs(t){var e=t||{};delete(t=Xt({},e)).layers,e=e.layers,ls.call(this,t),this.f=[],this.c={},d(this,so(fs),this.Hl,this),e?Array.isArray(e)?e=new ho(e.slice(),{unique:!0}):O(e instanceof ho,43):e=new ho(void 0,{unique:!0}),this.xi(e)}e(es,Mn),es.prototype.Xc=fr,e(ns,Mn),ns.prototype.Xc=fr,e(ls,ro),(r=ls.prototype).G=function(){return this.get("extent")},r.fc=function(){return this.get("maxResolution")},r.gc=function(){return this.get("minResolution")},r.hc=function(){return this.get("opacity")},r.Mb=function(){return this.get("visible")},r.Ba=function(){return this.get("zIndex")},r.vc=function(t){this.set("extent",t)},r.Ac=function(t){this.set("maxResolution",t)},r.Bc=function(t){this.set("minResolution",t)},r.wc=function(t){this.set("opacity",t)},r.xc=function(t){this.set("visible",t)},r.Vb=function(t){this.set("zIndex",t)},e(cs,ls),(r=cs.prototype).Fd=function(){},r.Fe=function(){this.Mb()&&this.s()},r.Hl=function(){this.f.forEach(qe),this.f.length=0;var t=this.qd();for(e in this.f.push(d(t,"add",this.Gl,this),d(t,"remove",this.Il,this)),this.c)this.c[e].forEach(qe);Vt(this.c);for(var e=0,o=(t=t.a).length;e=t.minResolution&&eu[2])&&(c=[y+h*Math.ceil((u[0]-y)/h),t[1]]),h=(u=r.layerStatesArray).length-1;0<=h;--h){var f=u[h],y=f.layer;if(gs(f,l)&&o.call(i,y)&&(f=Ns(this,y),p=y.ha()?f.Ea(y.ha().u?c:t,r,e,a,s):p))return p}},r.Ei=function(t,e,o,i,r){return void 0!==this.Ea(t,e,o,cr,this,i,r)},r.Fl=function(){this.o.render()},r.Jg=Y,r.Rp=function(t,e){for(var o in this.c)e&&o in e.layerStates||(t=o,o=this.c[t],delete this.c[t],qe(this.v[t]),delete this.v[t],$e(o))},e(Ds,Qe);var Os=[0,0,0,1],Us=[],Gs=[0,0,0,1];function Bs(t,e,o,i){e&&(t.translate(o,i),t.rotate(e),t.translate(-o,-i))}function Xs(){}function Vs(t,e,o,i,r){this.i=t,this.u=e,this.c=o,this.S=i,this.Yb=r,this.M=this.b=this.a=this.Ua=this.R=this.I=null,this.na=this.T=this.l=this.B=this.C=this.D=0,this.fa=!1,this.f=this.fb=0,this.pa=!1,this.oa=0,this.Ia="",this.va=this.Jb=0,this.Sa=!1,this.j=this.$a=0,this.ra=this.o=this.g=null,this.v=[],this.xb=ms()}function Ws(t,e,o){if(t.M){e=gr(e,0,o,2,t.S,t.v),o=t.i;for(var i=t.xb,r=o.globalAlpha,n=(1!=t.l&&(o.globalAlpha=r*t.l),t.fb),s=(t.fa&&(n+=t.Yb),0),a=e.length;s=a;){var p=this.i[s];o[U(this.f[s]).toString()]&&(i!==n&&la(t,e,i,n),n=p),s--,i=p}i!==n&&la(t,e,i,n),i=n=a}},r.ve=function(t,e,o,i,r){for(var n,s=this.i.length-2,a=this.i[s+1],p=this.u.length-1;0<=p;--p){var h=this.j[p];for(t.uniform4fv(this.v.B,h[0]),ma(this,t,h[1],h[2]),n=this.u[p];0<=s&&this.i[s]>=n;){var h=this.i[s],l=this.f[s];if(void 0===o[U(l).toString()]&&l.V()&&(void 0===r||Ot(r,l.V().G()))&&(t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),la(t,e,h,a),a=i(l)))return a;s--,a=h}}},r.Ma=function(t,e){var o;e=e?(o=e.i,this.c.lineDash=o||ca,o=e.g,this.c.lineDashOffset=o||0,o=!((o=e.a)instanceof CanvasGradient||o instanceof CanvasPattern)&&vo(o).map(function(t,e){return 3!=e?t/255:t})||fa,void 0!==(e=e.c)?e:1):(o=[0,0,0,0],0),t=!((t=t?t.b:[0,0,0,0])instanceof CanvasGradient||t instanceof CanvasPattern)&&vo(t).map(function(t,e){return 3!=e?t/255:t})||ua,this.c.strokeColor&&Z(this.c.strokeColor,o)&&this.c.fillColor&&Z(this.c.fillColor,t)&&this.c.lineWidth===e||(this.c.s=!0,this.c.fillColor=t,this.c.strokeColor=o,this.c.lineWidth=e,this.j.push([t,o,e]))},e(wa,ta);var xa=new wa;function Sa(){this.b="varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}"}e(Sa,ea);var Ma=new Sa;function Pa(t,e){this.c=t.getUniformLocation(e,"j"),this.f=t.getUniformLocation(e,"i"),this.a=t.getUniformLocation(e,"k"),this.i=t.getUniformLocation(e,"h"),this.v=t.getAttribLocation(e,"e"),this.u=t.getAttribLocation(e,"f"),this.b=t.getAttribLocation(e,"c"),this.D=t.getAttribLocation(e,"g"),this.C=t.getAttribLocation(e,"d")}function Aa(t,e){this.j=t,this.b=e,this.a={},this.c={},this.i={},this.l=this.v=this.f=this.o=null,(this.g=D(di,"OES_element_index_uint"))&&e.getExtension("OES_element_index_uint"),d(this.j,"webglcontextlost",this.Xo,this),d(this.j,"webglcontextrestored",this.Yo,this)}function Ea(t,e,o){var i,r,n=t.b,s=o.b,a=String(U(o));a in t.a?n.bindBuffer(e,t.a[a].buffer):(i=n.createBuffer(),n.bindBuffer(e,i),34962==e?r=new Float32Array(s):34963==e&&(r=new(t.g?Uint32Array:Uint16Array)(s)),n.bufferData(e,r,o.a),t.a[a]={lc:o,buffer:i})}function Ta(t,e){var o=t.b,i=(e=String(U(e)),t.a[e]);o.isContextLost()||o.deleteBuffer(i.buffer),delete t.a[e]}function ja(t){var e,o,i,r;return t.f||(o=(e=t.b).createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,o),i=Ia(e,1,1),r=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,1,1),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,r),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null),t.f=o,t.v=i,t.l=r),t.f}function Ca(t,e){var o,i,r=String(U(e));return r in t.c?t.c[r]:(i=(o=t.b).createShader(e.U()),o.shaderSource(i,e.b),o.compileShader(i),t.c[r]=i)}function La(t,e,o){var i,r,n=U(e)+"/"+U(o);return n in t.i?t.i[n]:(r=(i=t.b).createProgram(),i.attachShader(r,Ca(t,e)),i.attachShader(r,Ca(t,o)),i.linkProgram(r),t.i[n]=r)}function Ra(t,e,o){var i=t.createTexture();return t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==e&&t.texParameteri(3553,10242,e),void 0!==o&&t.texParameteri(3553,10243,o),i}function Ia(t,e,o){var i=Ra(t,void 0,void 0);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,o,0,t.RGBA,t.UNSIGNED_BYTE,null),i}function Na(t,e){var o=Ra(t,33071,33071);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),o}function Fa(t,e){ha.call(this,0,e),this.C=this.D=void 0,this.S=[],this.v=[],this.oa=void 0,this.j=[],this.c=[],this.I=this.ra=void 0,this.B=null,this.fb=this.fa=this.na=this.T=this.Ua=this.R=void 0,this.va=[],this.u=[],this.pa=void 0}function ka(t,e,o,i){for(var r=t.D,n=t.C,s=t.oa,a=t.ra,p=t.I,h=t.R,l=t.Ua,u=t.T,c=t.na?1:0,f=-t.fa,y=t.fb,g=t.pa,d=Math.cos(f),f=Math.sin(f),v=t.b.length,b=t.a.length,m=0;m=a;){var h=this.i[n],l=this.f[n];if(void 0===o[U(l).toString()]&&l.V()&&(void 0===r||Ot(r,l.V().G()))&&(t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),la(t,e,h,p),p=i(l)))return p;p=h,n--}}},r.Ub=function(t){var e=t.Hc(),o=t.Y(1),i=t.ye(),r=t.qg(1),n=t.f,s=t.Oc(),a=t.l,p=t.g,h=t.ic();t=t.a,this.j.length?U(this.j[this.j.length-1])!=U(o)&&(this.S.push(this.b.length),this.j.push(o)):this.j.push(o),this.c.length?U(this.c[this.c.length-1])!=U(r)&&(this.v.push(this.b.length),this.c.push(r)):this.c.push(r),this.D=e[0],this.C=e[1],this.oa=h[1],this.ra=i[1],this.I=i[0],this.R=n,this.Ua=s[0],this.T=s[1],this.fa=p,this.na=a,this.fb=t,this.pa=h[0]},e(Ua,ta);var Ga=new Ua;function Ba(){this.b="varying float a;varying vec2 b;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;b=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}"}e(Ba,ea);var Xa=new Ba;function Va(t,e){this.B=t.getUniformLocation(e,"n"),this.oa=t.getUniformLocation(e,"k"),this.R=t.getUniformLocation(e,"l"),this.c=t.getUniformLocation(e,"j"),this.f=t.getUniformLocation(e,"i"),this.a=t.getUniformLocation(e,"m"),this.ra=t.getUniformLocation(e,"p"),this.i=t.getUniformLocation(e,"h"),this.I=t.getUniformLocation(e,"o"),this.g=t.getAttribLocation(e,"g"),this.o=t.getAttribLocation(e,"d"),this.l=t.getAttribLocation(e,"f"),this.b=t.getAttribLocation(e,"e")}function Wa(t,e){ha.call(this,0,e),this.v=null,this.u=[],this.j=[],this.c={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,s:!1}}function Za(t,e,o,i){for(var r=t.a.length,n=t.b.length,s="bevel"===t.c.lineJoin?0:"miter"===t.c.lineJoin?1:2,a="butt"===t.c.lineCap?0:"square"===t.c.lineCap?1:2,p=Oa(e,o,i),h=n,l=1,u=0;uo&&(this.i.push(o),this.f.push(e),this.c.s)&&(this.j.push(o),this.c.s=!1)},r.Db=function(){this.l=new da(this.a),this.o=new da(this.b),this.i.push(this.b.length),!this.j.length&&0=l;){var u=this.i[h];o[U(this.f[h]).toString()]&&(s!==p&&(la(t,e,s,p),t.clear(t.DEPTH_BUFFER_BIT)),p=u),h--,s=u}s!==p&&(la(t,e,s,p),t.clear(t.DEPTH_BUFFER_BIT)),s=p=l}i||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(n),t.depthFunc(r))},r.ve=function(t,e,o,i,r){for(var n,s=this.i.length-2,a=this.i[s+1],p=this.j.length-1;0<=p;--p)for(qa(this,t,(h=this.u[p])[0],h[1],h[2]),n=this.j[p];0<=s&&this.i[s]>=n;){var h=this.i[s],l=this.f[s];if(void 0===o[U(l).toString()]&&l.V()&&(void 0===r||Ot(r,l.V().G()))&&(t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),la(t,e,h,a),a=i(l)))return a;s--,a=h}},r.Ma=function(t,e){t=e.f,this.c.lineCap=void 0!==t?t:"round",t=e.i,this.c.lineDash=t||ca,t=e.g,this.c.lineDashOffset=t||0,t=e.j,this.c.lineJoin=void 0!==t?t:"round",t=!((t=e.a)instanceof CanvasGradient||t instanceof CanvasPattern)&&vo(t).map(function(t,e){return 3!=e?t/255:t})||fa;var o=void 0!==(o=e.c)?o:1;e=void 0!==(e=e.o)?e:10,this.c.strokeColor&&Z(this.c.strokeColor,t)&&this.c.lineWidth===o&&this.c.miterLimit===e||(this.c.s=!0,this.c.strokeColor=t,this.c.lineWidth=o,this.c.miterLimit=e,this.u.push([t,o,e]))};var Ja=3,_a=5,$a=7,Qa=11,tp=13,ep=17,op=19,ip=23;function rp(){this.b="precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"}e(rp,ta);var np=new rp;function sp(){this.b="attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}"}e(sp,ea);var ap=new sp;function pp(t,e){this.B=t.getUniformLocation(e,"e"),this.c=t.getUniformLocation(e,"d"),this.f=t.getUniformLocation(e,"c"),this.a=t.getUniformLocation(e,"f"),this.i=t.getUniformLocation(e,"b"),this.b=t.getAttribLocation(e,"a")}function hp(t){this.a=void 0!==(t=t||{}).color?t.color:null,this.f=t.lineCap,this.i=void 0!==t.lineDash?t.lineDash:null,this.g=t.lineDashOffset,this.j=t.lineJoin,this.o=t.miterLimit,this.c=t.width,this.b=void 0}function lp(t){this.b=this.a=this.i=void 0,this.f=void 0===t||t,this.c=0}function up(t){var e,o,i=t.b;i&&(e=i.next,o=i.ub,e&&(e.ub=o),o&&(o.next=e),t.b=e||o,t.i===t.a?(t.b=void 0,t.i=void 0,t.a=void 0):t.i===i?t.i=t.b:t.a===i&&(t.a=o?t.b.ub:t.b),t.c--)}function cp(t){if(t.b=t.i,t.b)return t.b.data}function fp(t){if(t.b&&t.b.next)return t.b=t.b.next,t.b.data}function yp(t){if(t.b&&t.b.next)return t.b.next.data}function gp(t){if(t.b&&t.b.ub)return t.b=t.b.ub,t.b.data}function dp(t){if(t.b&&t.b.ub)return t.b.ub.data}function vp(t){if(t.b)return t.b.data}(r=hp.prototype).clone=function(){var t=this.a;return new hp({color:t&&t.slice?t.slice():t||void 0,lineCap:this.f,lineDash:this.i?this.i.slice():void 0,lineDashOffset:this.g,lineJoin:this.j,miterLimit:this.o,width:this.c})},r.No=function(){return this.a},r.Vk=function(){return this.f},r.Oo=function(){return this.i},r.Wk=function(){return this.g},r.Xk=function(){return this.j},r.bl=function(){return this.o},r.Po=function(){return this.c},r.Qo=function(t){this.a=t,this.b=void 0},r.aq=function(t){this.f=t,this.b=void 0},r.setLineDash=function(t){this.i=t,this.b=void 0},r.bq=function(t){this.g=t,this.b=void 0},r.cq=function(t){this.j=t,this.b=void 0},r.gq=function(t){this.o=t,this.b=void 0},r.jq=function(t){this.c=t,this.b=void 0},lp.prototype.concat=function(t){var e;t.b&&(this.b?(e=this.b.next,this.b.next=t.i,t.i.ub=this.b,e.ub=t.a,t.a.next=e,this.c+=t.c):(this.b=t.b,this.i=t.i,this.a=t.a,this.c=t.c),t.b=void 0,t.i=void 0,t.a=void 0,t.c=0)};var bp,mp={$d:function(){}};function wp(t,e,o){var i=t[e];t[e]=t[o],t[o]=i}function xp(t,e){return t=t.ca&&e.ia>=t.da}function Ip(t){return{children:t,height:1,ib:!0,ca:1/0,da:1/0,$:-1/0,ia:-1/0}}function Np(t,e,o,i,r){for(var n,s=[e,o];s.length;)(o=s.pop())-(e=s.pop())<=i||(n=e+Math.ceil((o-e)/i/2)*i,bp(t,n,e,o,r),s.push(e,n,n,o))}function Fp(t){this.a=mp.$d(t),this.b={}}function kp(t,e,o){var i=t.b[U(o)];St([i.ca,i.da,i.$,i.ia],e)||(t.remove(o),t.Ca(e,o))}function Dp(t){return t.a.all().map(function(t){return t.value})}function Op(t,e){return t.a.search({ca:e[0],da:e[1],$:e[2],ia:e[3]}).map(function(t){return t.value})}function Up(t,e,o,i){return Gp(Op(t,e),o,i)}function Gp(t,e,o){for(var i,r=0,n=t.length;rn&&(n=e[c],u=e[c+1]),l=y}else for(l=s=Yp(t,e[c=e.length-o],e[c+1],a++),n=e[c],u=e[c+1],c-=o,f=0;f<=c;c-=o)y=Yp(t,e[c],e[c+1],a++),h.push(Hp(l,y,i)),p.push([Math.min(l.x,y.x),Math.min(l.y,y.y),Math.max(l.x,y.x),Math.max(l.y,y.y)]),e[c]>n&&(n=e[c],u=e[c+1]),l=y;return h.push(Hp(y,s,i)),p.push([Math.min(l.x,y.x),Math.min(l.y,y.y),Math.max(l.x,y.x),Math.max(l.y,y.y)]),r.load(p,h),[n,u]}function Wp(t,e,o){var i=cp(t),r=i,n=fp(t),s=!1;do{var a=o?ya(n.W.x,n.W.y,r.W.x,r.W.y,r.aa.x,r.aa.y):ya(r.aa.x,r.aa.y,r.W.x,r.W.y,n.W.x,n.W.y)}while(void 0===a?(qp(r,n,t,e),s=!0,n===i&&(i=yp(t)),n=r,gp(t)):r.W.Fb!==a&&(r.W.Fb=a,s=!0),r=n,n=fp(t),r!==i);return s}function Zp(t,e,o,i,r){var n=t.b.length,s=cp(e),a=dp(e),p=s,h=fp(e),l=yp(e),u=!1;do{var c,f=p.aa,y=p.W,g=h.W}while(!1===y.Fb&&(c=r?Qp(l.W,g,y,f,a.aa):Qp(a.aa,f,y,g,l.W),!i&&_p({aa:f,W:g},o).length||!c||Jp(f,y,g,o,!0).length||!i&&!1!==f.Fb&&!1!==g.Fb&&Vr([a.aa.x,a.aa.y,f.x,f.y,y.x,y.y,g.x,g.y,l.W.x,l.W.y],0,10,2)!==!r||(t.b[n++]=f.hb,t.b[n++]=y.hb,t.b[n++]=g.hb,qp(p,h,e,o),h===s&&(s=l),u=!0)),a=dp(e),p=vp(e),h=fp(e),l=yp(e),p!==s&&3(o.y-i.y)*(e.x-i.x),r=(r.x-i.x)*(e.y-i.y)<(r.y-i.y)*(e.x-i.x),t=(t.x-e.x)*(i.y-e.y)>(t.y-e.y)*(i.x-e.x),o=(o.x-e.x)*(i.y-e.y)<(o.y-e.y)*(i.x-e.x),e=e.Fb?o||t:o&&t,i.Fb?r||n:r&&n)&&e}function th(){}function eh(t,e,o){this.f=e,this.g=t,this.c=o,this.a={}}function oh(t,e){var o,i=[];for(o in t.a){var r,n=t.a[o];for(r in n)i.push(n[r].Eb(e))}return function(){for(var t,e=i.length,o=0;othis.Hf;)this.jk(i,e),e--;this.Zj(o,i,e)},jk:function(t,e){var o=t[e],i=o.children.length,r=this.fh;this.$j(o,r,i),i=this.ak(o,r,i),(i=Ip(o.children.splice(i,o.children.length-i))).height=o.height,i.ib=o.ib,Mp(o,this.wb),Mp(i,this.wb),e?t[e-1].children.push(i):this.hh(o,i)},hh:function(t,e){this.data=Ip([t,e]),this.data.height=t.height+1,this.data.ib=!1,Mp(this.data,this.wb)},ak:function(t,e,o){for(var i=s=1/0,r=e;r<=o-e;r++){var n,s,a=Pp(t,0,r,this.wb),p=Pp(t,r,o,this.wb),h=Math.max(0,Math.min(a.$,p.$)-Math.max(a.ca,p.ca))*Math.max(0,Math.min(a.ia,p.ia)-Math.max(a.da,p.da)),a=jp(a)+jp(p);hr&&(this.i.push(r),this.f.push(e),this.j.s)&&(this.c.push(r),this.j.s=!1),this.g.b.length>n&&Ha(this.g,e,n)},r.rc=function(t,e){var o=t.Bb(),i=t.qa();if(0=l;){var u=this.i[h];o[U(this.f[h]).toString()]&&(s!==p&&(la(t,e,s,p),t.clear(t.DEPTH_BUFFER_BIT)),p=u),h--,s=u}s!==p&&(la(t,e,s,p),t.clear(t.DEPTH_BUFFER_BIT)),s=p=l}i||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(n),t.depthFunc(r))},r.ve=function(t,e,o,i,r){for(var n,s=this.i.length-2,a=this.i[s+1],p=this.c.length-1;0<=p;--p){var h=this.u[p];for(t.uniform4fv(this.v.B,h),n=this.c[p];0<=s&&this.i[s]>=n;){var h=this.i[s],l=this.f[s];if(void 0===o[U(l).toString()]&&l.V()&&(void 0===r||Ot(r,l.V().G()))&&(t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),la(t,e,h,a),a=i(l)))return a;s--,a=h}}},r.Ma=function(t,e){t=!((t=t?t.b:[0,0,0,0])instanceof CanvasGradient||t instanceof CanvasPattern)&&vo(t).map(function(t,e){return 3!=e?t/255:t})||ua,this.j.fillColor&&Z(t,this.j.fillColor)||(this.j.fillColor=t,this.j.s=!0,this.u.push(t)),e?this.g.Ma(null,e):this.g.Ma(null,new hp({color:[0,0,0,0],lineWidth:0}))},th.prototype.La=function(){},e(eh,$s),eh.prototype.b=function(t,e){var o=void 0!==t?t.toString():"0";return void 0===(t=this.a[o])&&(this.a[o]=t={}),void 0===(o=t[e])&&(o=new nh[e](this.g,this.f),t[e]=o),o},eh.prototype.i=function(){return Zt(this.a)},eh.prototype.La=function(t,e,o,i,r,n,s,a){for(var p=Object.keys(this.a).map(Number),h=(p.sort(G),0),l=p.length;h=t.l)break;++n}t.D!=(o=r+" "+i)&&(t.o.innerHTML=o,t.D=o),t.B!=e&&(t.o.style.width=e+"px",t.B=e),t.j||(t.c.style.display="",t.j=!0)}else t.j&&(t.c.style.display="none",t.j=!1)}Th.prototype.C=function(){return this.get(Rh)},Th.prototype.T=function(){Lh(this)},Th.prototype.I=function(t){this.set(Rh,t)};var Rh="units";function Ih(t){t=t||{},this.c=void 0,this.j=Nh,this.D=this.l=0,this.I=null,this.na=!1,this.T=void 0!==t.duration?t.duration:200;var e=void 0!==t.className?t.className:"ol-zoomslider",o=document.createElement("button"),i=(o.setAttribute("type","button"),o.className=e+"-thumb ol-unselectable",document.createElement("div"));i.className=e+" ol-unselectable ol-control",i.appendChild(o),this.o=new Ii(i),d(this.o,"pointerdown",this.yl,this),d(this.o,"pointermove",this.wl,this),d(this.o,"pointerup",this.xl,this),d(i,"click",this.vl,this),d(o,"click",to),To.call(this,{element:i,render:t.render||Fh})}e(Ih,To),Ih.prototype.ka=function(){$e(this.o),To.prototype.ka.call(this)};var Nh=0;function Fh(t){var e,o,i,r,n;t.frameState&&(this.na||(e=(r=this.element).offsetWidth,o=r.offsetHeight,n=r.firstElementChild,i=getComputedStyle(n),r=n.offsetWidth+parseFloat(i.marginRight)+parseFloat(i.marginLeft),n=n.offsetHeight+parseFloat(i.marginTop)+parseFloat(i.marginBottom),this.I=[r,n],o>1)],o))<0?p=r+1:(h=r,l=!a);a=(r=l?p:~p)<0?(o=(o-s[-r-2])/(s[-r-1]-s[-r-2]),s=nt(t[e+=(-r-2)*i],t[e+i],o),nt(t[e+1],t[e+i+1],o)):(s=t[e+r*i],t[e+r*i+1])}return n?(n[0]=s,n[1]=a,n):[s,a]}function Tl(t,e,o,i,r,n){if(o==e)return null;if(r>1)+1)*i-1]?o=n:e=n+1;if(r==(o=t[e*i-1]))return t.slice((e-1)*i,(e-1)*i+i);var s;for(n=(r-o)/(t[(e+1)*i-1]-o),o=[],s=0;s>>0):4294967296*(e>>>0)+(t>>>0)}function Qy(t,e){this.layers=t.Ag(ng,{},e)}function tg(t,e){this.x=t,this.y=e}function eg(t,e,o,i,r){this.properties={},this.extent=o,this.type=0,this.Cc=t,this.Ef=-1,this.ne=i,this.pe=r,t.Ag(og,this,e)}function og(t,e,o){if(1==t)e.id=o.Ka();else if(2==t)for(t=o.Ka()+o.ea;o.ea>3)?t.Gg():2===e?t.yp():3===e?t.up():4===e?t.Kp():5===e?t.Ka():6===e?t.ce():7===e?t.sp():null;return e}(o))}function ng(t,e,o){3===t&&(t=new Gy(o,o.Ka()+o.ea)).length&&(e[t.name]=t)}function sg(t,e,o,i,r){this.g=r,this.i=t,this.b=e,this.f=o,this.c=i}function ag(t){wl.call(this),t=t||{},this.defaultDataProjection=new qt({code:"",units:"tile-pixels"}),this.b=t.featureClass||sg,this.a=t.geometryName,this.i=t.layerName||"layer",this.c=t.layers||null}function pg(t,e,o){for(var i=0,r=0,n=t.length;r>1,p=-7,h=o?-1:1,l=t[e+(r=o?r-1:0)];for(r+=h,o=l&(1<<-p)-1,l>>=-p,p+=n;0>=-p,p+=i;0>3,n=this.ea;this.type=7&i,t(r,e,this),this.ea===n&&this.mq(i)}return e},yp:function(){var t=Uy(this.lc,this.ea,!0,23,4);return this.ea+=4,t},up:function(){var t=Uy(this.lc,this.ea,!0,52,8);return this.ea+=8,t},Ka:function(t){var e=this.lc,o=e[this.ea++],i=127&o;if(o<128)return i;if(i|=(127&(o=e[this.ea++]))<<7,o<128)return i;if(i|=(127&(o=e[this.ea++]))<<14,o<128)return i;if(i|=(127&(o=e[this.ea++]))<<21,o<128)return i;var o=i|(15&e[this.ea])<<28,i=t,e=this,t=e.lc,r=t[e.ea++],n=(112&r)>>4;if(r<128)return $y(o,n,i);if(n|=(127&(r=t[e.ea++]))<<3,r<128)return $y(o,n,i);if(n|=(127&(r=t[e.ea++]))<<10,r<128)return $y(o,n,i);if(n|=(127&(r=t[e.ea++]))<<17,r<128)return $y(o,n,i);if(n|=(127&(r=t[e.ea++]))<<24,r<128)return $y(o,n,i);if((r=t[e.ea++])<128)return $y(o,n|(1&r)<<31,i);throw Error("Expected varint not more than 10 bytes")},Kp:function(){return this.Ka(!0)},ce:function(){var t=this.Ka();return 1==t%2?(t+1)/-2:t/2},sp:function(){return!!this.Ka()},Gg:function(){for(var t=this.Ka()+this.ea,e=this.lc,o="",i=this.ea;i>>10&1023|55296),p=56320|1023&p),o+=String.fromCharCode(p),i+=h}return this.ea=t,o},mq:function(t){if((t&=7)===_y.c)for(;127>=3),r--,1===i||2===i)n+=t.ce(),s+=t.ce(),1===i&&(e&&a.push(e),e=[]),e.push(new tg(n,s));else{if(7!==i)throw Error("unknown command "+i);e&&e.push(e[0].clone())}return e&&a.push(e),a},eg.prototype.bbox=function(){var t=this.Cc;t.ea=this.Ef;for(var e=t.Ka()+t.ea,o=1,i=0,r=0,n=0,s=1/0,a=-1/0,p=1/0,h=-1/0;t.ea>=3),i--,1===o||2===o)(r+=t.ce())=this.me.length)throw Error("feature index out of bounds");return this.Cc.ea=this.me[t],t=this.Cc.Ka()+this.Cc.ea,new eg(this.Cc,t,this.extent,this.ne,this.pe)},By=Gy,fi.default={Bf:Qy,Wj:eg,Xj:By},fi.Bf=Qy,fi.Wj=eg,fi.Xj=By,(r=sg.prototype).get=function(t){return this.c[t]},r.Bb=function(){return this.f},r.G=function(){return this.a||(this.a="Point"===this.i?wt(this.b):xt(this.b,0,this.b.length,2)),this.a},r.Wn=function(){return this.g},r.ec=function(){return this.b},r.ga=sg.prototype.ec,r.V=function(){return this},r.Xn=function(){return this.c},r.Vd=sg.prototype.V,r.qa=function(){return 2},r.Lc=Y,r.U=function(){return this.i},e(ag,wl),(r=ag.prototype).U=function(){return"arraybuffer"},r.Oa=function(t,e){var o,i=this.c,r=(t=new mp.Dd(t),t=new mp.xf.Bf(t),[]),n=this.b;for(o in t.layers)if(!i||-1!=i.indexOf(o))for(var s,a,p,h,l,u,c,f,y,g=t.layers[o],d=0,v=g.length;d>=5;e+=n+=String.fromCharCode(r+63)}return e}function Dg(t,e){e=e||1e5;for(var o=[],i=0,r=0,n=0,s=t.length;n>1):r>>1;for(t=0,i=o.length;t=e[0]||t[1]<=e[1]&&t[3]>=e[1]||Et(t,this.sb,this))},r.ob=function(t){var e,o=this.a,i=t.slice();for(i[o]=i[0]+(this.A[o]-this.A[0]),e=1;eg[2])&&(c=e*Math.ceil((g[0]-c)/e),f=[f[0]+c,f[1],f[2]+c,f[3]]),c=this.S[0],g=this.S[1],e=-1,i=Math.pow(this.Jb*d,2),r=[],n=[],d=0,o=y0.length;dw.width?w.width-A:R),O=M+E>w.height?w.height-E:M;e.drawImage(w,A,E,F,O,N,T,F*o,O*o),1!=P&&(e.globalAlpha=I),1==C&&!j||e.setTransform.apply(e,g)}++c;break;case 5:for(f=N[1],m=N[2],S=N[3],M=N[4]*o,P=N[5]*o,j=N[6],C=N[7]*o,w=N[8],x=N[9],(T=N[10])&&(j+=r);fthis.c&&(this.c=this.i.lineWidth,this.f=null)},e(Y0,O0),(r=Y0.prototype).Zb=function(t,e){var o,i=this.i,r=i.strokeStyle;void 0===i.fillStyle&&void 0===r||(q0(this,t),G0(this,e),this.b.push([9,bo(Os)]),void 0!==i.strokeStyle&&this.b.push([10,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset,!0,1]),o=t.ga(),r=this.coordinates.length,U0(this,o,0,o.length,t.qa(),!1,!1),this.a.push(t=[1],r=[2,r]),this.b.push(t,r),this.b.push(t=[7]),void 0!==i.fillStyle&&this.a.push(t),void 0!==i.strokeStyle&&(this.a.push(i=[12]),this.b.push(i)),V0(this,e))},r.rc=function(t,e){var o=this.i,o=(q0(this,t),G0(this,e),this.b.push([9,bo(Os)]),void 0!==o.strokeStyle&&this.b.push([10,o.strokeStyle,o.lineWidth,o.lineCap,o.lineJoin,o.miterLimit,o.lineDash,o.lineDashOffset,!0,1]),t.Bb());H0(this,t.ec(),0,o,t.qa()),V0(this,e)},r.pc=function(t,e){var o=this.i,i=o.strokeStyle;if(void 0!==o.fillStyle||void 0!==i){q0(this,t),G0(this,e),this.b.push([9,bo(Os)]),void 0!==o.strokeStyle&&this.b.push([10,o.strokeStyle,o.lineWidth,o.lineCap,o.lineJoin,o.miterLimit,o.lineDash,o.lineDashOffset,!0,1]),o=t.c,i=Il(t),t=t.qa();for(var r=0,n=0,s=o.length;nthis.c&&(this.c=o.lineWidth,this.f=null)):(o.strokeStyle=void 0,o.lineCap=void 0,o.lineDash=null,o.lineDashOffset=void 0,o.lineJoin=void 0,o.lineWidth=void 0,o.miterLimit=void 0)},e(J0,O0),J0.prototype.yc=function(t,e,o,i,r,n){var s,a;""!==this.Ia&&this.g&&(this.i||this.f)&&(this.i&&(r=this.i,(s=this.S)&&s.fillStyle==r.fillStyle||(a=[9,r.fillStyle],this.a.push(a),this.b.push(a),s?s.fillStyle=r.fillStyle:this.S={fillStyle:r.fillStyle})),this.f&&(r=this.f,(s=this.D)&&s.lineCap==r.lineCap&&s.lineDash==r.lineDash&&s.lineDashOffset==r.lineDashOffset&&s.lineJoin==r.lineJoin&&s.lineWidth==r.lineWidth&&s.miterLimit==r.miterLimit&&s.strokeStyle==r.strokeStyle||(a=[10,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset,!1,1],this.a.push(a),this.b.push(a),s?(s.lineCap=r.lineCap,s.lineDash=r.lineDash,s.lineDashOffset=r.lineDashOffset,s.lineJoin=r.lineJoin,s.lineWidth=r.lineWidth,s.miterLimit=r.miterLimit,s.strokeStyle=r.strokeStyle):this.D={lineCap:r.lineCap,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset,lineJoin:r.lineJoin,lineWidth:r.lineWidth,miterLimit:r.miterLimit,strokeStyle:r.strokeStyle})),r=this.g,(s=this.C)&&s.font==r.font&&s.textAlign==r.textAlign&&s.textBaseline==r.textBaseline||(a=[11,r.font,r.textAlign,r.textBaseline],this.a.push(a),this.b.push(a),s?(s.font=r.font,s.textAlign=r.textAlign,s.textBaseline=r.textBaseline):this.C={font:r.font,textAlign:r.textAlign,textBaseline:r.textBaseline}),G0(this,n),t=[5,r=this.coordinates.length,t=U0(this,t,e,o,i,!1,!1),this.Ia,this.j,this.o,this.v,this.u,!!this.i,!!this.f,this.l],this.a.push(t),this.b.push(t),V0(this,n))},J0.prototype.Cb=function(t){var e,o,i,r,n,s,a,p,h;t?((o=t.Fa())?(o=Mo((o=o.b)||Os),this.i?this.i.fillStyle=o:this.i={fillStyle:o}):this.i=null,(s=t.Ga())?(o=s.a,i=s.f,r=s.i,a=s.g,p=s.j,n=s.c,s=s.o,i=void 0!==i?i:"round",r=r?r.slice():Us,a=void 0!==a?a:0,p=void 0!==p?p:"round",n=void 0!==n?n:1,s=void 0!==s?s:10,o=Mo(o||Gs),this.f?((h=this.f).lineCap=i,h.lineDash=r,h.lineDashOffset=a,h.lineJoin=p,h.lineWidth=n,h.miterLimit=s,h.strokeStyle=o):this.f={lineCap:i,lineDash:r,lineDashOffset:a,lineJoin:p,lineWidth:n,miterLimit:s,strokeStyle:o}):this.f=null,e=t.a,o=t.i,i=t.c,r=t.o,n=t.f,s=t.b,a=t.Na(),p=t.g,h=t.j,t=void 0!==e?e:"10px sans-serif",p=void 0!==p?p:"center",h=void 0!==h?h:"middle",this.g?((e=this.g).font=t,e.textAlign=p,e.textBaseline=h):this.g={font:t,textAlign:p,textBaseline:h},this.Ia=void 0!==a?a:"",this.j=void 0!==o?o:0,this.o=void 0!==i?i:0,this.l=void 0!==r&&r,this.v=void 0!==n?n:0,this.u=void 0!==s?s:1):this.Ia=""},e(_0,$s);var $0={0:[[!0]]};function Q0(t,e,o){var i,r=Math.floor(t.length/2);if(r<=e)for(i=r;it.$&&(t.$=i.$),i.dat.ia&&(t.ia=i.ia)):t[e][o]=i:(t[e]={},t[e][o]=i)}function lv(t,e,o,i,r,n,s,a,p,h){for(var l,u=U(e).toString(),c=(u in t.wantedTiles||(t.wantedTiles[u]={}),t.wantedTiles[u]),f=(t=t.tileQueue,o.minZoom),y=s;f<=y;--y)for(var g,d=Ie(o,n,y,d),v=o.Da(y),b=d.ca;b<=d.$;++b)for(l=d.da;l<=d.ia;++l)s-y<=a?(0==(g=e.Nc(y,b,l,i,r)).getState()&&(c[g.bb()]=!0,g.bb()in t.a||t.f([g,u,Ne(o,g.ta),v])),p&&p.call(h,g)):e.Ug(y,b,l,r)}function uv(t){iv.call(this,t),this.fa=ms()}function cv(t,e,o){var i=e.pixelRatio,r=e.size[0]*i,n=e.size[1]*i,s=e.viewState.rotation,a=Ft(o),p=kt(o),h=Ct(o);o=jt(o),Ps(e.coordinateToPixelTransform,a),Ps(e.coordinateToPixelTransform,p),Ps(e.coordinateToPixelTransform,h),Ps(e.coordinateToPixelTransform,o),t.save(),Bs(t,-s,r/2,n/2),t.beginPath(),t.moveTo(a[0]*i,a[1]*i),t.lineTo(p[0]*i,p[1]*i),t.lineTo(h[0]*i,h[1]*i),t.lineTo(o[0]*i,o[1]*i),t.clip(),Bs(t,s,r/2,n/2)}function fv(t,e,o,i,r){var n,s,a,p=t.a;oo(p,e)&&(n=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,Bs(o,-(a=i.viewState.rotation),n/2,s/2),t=r||yv(t,i,0),p.b(new Ds(e,new Vs(o,i.pixelRatio,i.extent,t,i.viewState.rotation),i,o,null)),Bs(o,a,n/2,s/2))}function yv(t,e,o){var i=e.viewState,r=e.pixelRatio,n=r/i.resolution;return js(t.fa,r*e.size[0]/2,r*e.size[1]/2,n,-n,-i.rotation,-i.center[0]+o,-i.center[1])}function gv(t,e){return U(t)-U(e)}function dv(t,e){return(t=.5*t/e)*t}function vv(t,e,o,i,r,n){var s,a,p=!1;return(s=o.Y())&&(2==(a=s.Ye())||3==a?s.Bj(r,n):(0==a&&s.load(),s.Nh(r,n),p=!0)),(r=(0,o.Za)(e))&&(i=r.Vd(i),(0,bv[i.U()])(t,i,o,e)),p}e(iv,io),iv.prototype.Ea=Y,iv.prototype.Ue=fr,iv.prototype.Nf=function(o,i,r){return function(e,t){return Cm(o,i,e,t,function(t){r[e]||(r[e]={}),r[e][t.ta.toString()]=t})}},iv.prototype.na=function(t){2===t.target.getState()&&nv(this)},e(uv,iv),uv.prototype.u=function(t,e,o,i){if(this.Ea(t,e,0,cr,this))return o.call(i,this.a,null)},uv.prototype.ef=function(t,e,o,i){fv(this,"postcompose",t,e,i)};var bv={Point:function(t,e,o,i){var r=o.Y();if(r){if(2!=r.Ye())return;var n=t.b(o.Ba(),"Image");n.Ub(r),n.qc(e,i)}(r=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(r),t.yc(e.ga(),0,2,2,e,i))},LineString:function(t,e,o,i){var r,n=o.Ga();n&&((r=t.b(o.Ba(),"LineString")).Ma(null,n),r.mc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),t.yc(jl(e),0,2,2,e,i))},Polygon:function(t,e,o,i){var r,n=o.Fa(),s=o.Ga();(n||s)&&((r=t.b(o.Ba(),"Polygon")).Ma(n,s),r.rc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),t.yc(zr(e),0,2,2,e,i))},MultiPoint:function(t,e,o,i){var r=o.Y();if(r){if(2!=r.Ye())return;var n=t.b(o.Ba(),"Image");n.Ub(r),n.oc(e,i)}(r=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(r),o=e.ga(),t.yc(o,0,o.length,e.qa(),e,i))},MultiLineString:function(t,e,o,i){var r,n=o.Ga();n&&((r=t.b(o.Ba(),"LineString")).Ma(null,n),r.nc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),o=Cl(e),t.yc(o,0,o.length,2,e,i))},MultiPolygon:function(t,e,o,i){var r,n=o.Fa(),s=o.Ga();(s||n)&&((r=t.b(o.Ba(),"Polygon")).Ma(n,s),r.pc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),o=Rl(e),t.yc(o,0,o.length,2,e,i))},GeometryCollection:function(t,e,o,i){for(var r=0,n=(e=e.a).length;rp[2];)l=yv(this,t,l=h*++m),u.La(y,r,l,a,n),s-=h;l=yv(this,t,0)}Bs(y,a,v/2,b/2),y!=o&&(fv(this,"render",y,t,l),o.drawImage(y.canvas,-g,-d),y.translate(-g,-d)),y.globalAlpha=f}c&&o.restore(),this.ef(o,t,e,l)},mv.prototype.Ea=function(t,e,o,i,r){var n,s;if(this.f)return n=this.a,s={},this.f.Ea(t,e.viewState.resolution,e.viewState.rotation,o,{},function(t){var e=U(t).toString();if(!(e in s))return s[e]=!0,i.call(r,t,n)})},mv.prototype.D=function(){nv(this)},mv.prototype.sd=function(t){function e(t){var e,o=t.Lc();if(o?e=o.call(t,n):(o=p.f)&&(e=o(t,n)),e){if(o=!1,Array.isArray(e))for(var i=0,r=e.length;it.ad:r<=t.ad),t.l?(r=e.coordinate,i=t.j.V(),t.g===Hv?o=t.a:t.g===Jv?(o=(o=t.a[0])[o.length-1],Wv(t,e)&&(r=t.l.slice())):o=(o=t.a)[o.length-1],o[0]=r[0],o[1]=r[1],t.Za(t.a,i),t.B&&t.B.V().ma(r),i instanceof w&&t.g!==Jv?(t.C||(t.C=new x(new S(null))),r=i.Ch(0),(e=t.C.V()).ba(r.ja,r.ga())):t.I&&(e=t.C.V()).ma(t.I),Yv(t)):(e=e.coordinate.slice(),t.B?t.B.V().ma(e):(t.B=new x(new m(e)),Yv(t))),!0}function Wv(t,e){var o=!1;if(t.j){var i=!1,r=[t.l];if(t.g===qv?i=t.a.length>t.Sa:t.g===Jv&&(i=t.a[0].length>t.Sa,r=[t.a[0][0],t.a[0][t.a[0].length-2]]),i)for(var i=e.map,n=0,s=r.length;n=t.va&&(t.u?i.pop():o=!0),i.push(e.slice()),t.Za(i,r)):t.g===Jv&&((i=t.a[0]).length>=t.va&&(t.u?i.pop():o=!0),i.push(e.slice()),o&&(t.l=i[0]),t.Za(t.a,r)),Yv(t),o&&t.Pd()}function zv(t){t.l=null;var e=t.j;return e&&(t.j=null,t.B=null,t.C=null,t.pa.ha().clear(!0)),e}function Yv(t){var e=[];t.j&&e.push(t.j),t.C&&e.push(t.C),t.B&&e.push(t.B),(t=t.pa.ha()).clear(!0),t.cd(e)}e(Lv,ro),(r=Lv.prototype).Ea=Y,r.ya=function(){return this.j},r.xa=function(){return this.D},r.za=function(){return this.c},r.getState=function(){return this.na},r.sa=function(){this.s()},r.ua=function(t){this.j=Rv(t),this.s()},e(a,Lv),(r=a.prototype).yb=function(t){var e,o=U(t).toString();Fv(this,o,t)&&(Nv(this,o,t),(e=t.V())?(o=e.G(),this.a&&this.a.Ca(o,t)):this.g[o]=t,this.b(new Ov("addfeature",t))),this.s()},r.cd=function(t){kv(this,t),this.s()},r.clear=function(t){if(t){for(var e in this.v)this.v[e].forEach(qe);this.f||(this.v={},this.o={},this.l={})}else if(this.a)for(var o in this.a.forEach(this.Ig,this),this.g)this.Ig(this.g[o]);this.f&&this.f.clear(),this.a&&this.a.clear(),this.R.clear(),this.g={},this.b(new Ov("clear")),this.s()},r.sh=function(t,e){return this.a?this.a.forEach(t,e):this.f?this.f.forEach(t,e):void 0},r.$b=function(t,e,o){return this.a?Up(this.a,t,e,o):this.f?this.f.forEach(e,o):void 0},r.th=function(e,o,i){return this.$b(e,function(t){if(t.V().Xa(e)&&(t=o.call(i,t)))return t})},r.Ah=function(){return this.f},r.Xe=function(){var t;return this.f?t=this.f.a:this.a&&(t=Dp(this.a),Zt(this.g)||X(t,Wt(this.g))),t},r.zh=function(t){var e,o,i=[];return e=t,o=function(t){i.push(t)},this.$b([e[0],e[1],e[0],e[1]],function(t){if(t.V().sb(e))return o.call(void 0,t)}),i},r.Uf=function(t){return Op(this.a,t)},r.vh=function(t,e){var i=t[0],r=t[1],n=null,s=[NaN,NaN],a=1/0,p=[-1/0,-1/0,1/0,1/0],h=e||cr;return Up(this.a,p,function(t){var e,o;h(t)&&(e=t.V(),o=a,(a=e.Kb(i,r,s,a))o&&(t.index+=r)})}function Mb(t,e,o){Qe.call(this,t),this.features=e,this.mapBrowserEvent=o}function Pb(t){var e,o;pn.call(this,{handleEvent:Ab}),this.C=(t=t||{}).condition||vn,this.D=t.addCondition||fr,this.B=t.removeCondition||fr,this.I=t.toggleCondition||mn,this.l=t.multi||!1,this.o=t.filter||cr,this.j=t.hitTolerance||0,this.g=new s({source:new a({useSpatialIndex:!1,features:t.features,wrapX:t.wrapX}),style:t.style||(X((e=Qh()).Polygon,e.LineString),X(e.GeometryCollection,e.LineString),function(t){return t.V()?e[t.V().U()]:null}),updateWhileAnimating:!0,updateWhileInteracting:!0}),t=t.layers?"function"==typeof t.layers?t.layers:(o=t.layers,function(t){return D(o,t)}):cr,this.u=t,this.a={},d(t=this.g.ha().f,"add",this.Fn,this),d(t,"remove",this.Jn,this)}function Ab(t){if(!this.C(t))return!0;var o=this.D(t),i=this.B(t),r=this.I(t),e=!o&&!i&&!r,n=t.map,s=this.g.ha().f,a=[],p=[];if(e){for(Vt(this.a),n.we(t.pixel,function(t,e){if(this.o(t,e))return p.push(t),t=U(t),this.a[t]=e,!this.l}.bind(this),{layerFilter:this.u,hitTolerance:this.j}),e=s.dc()-1;0<=e;--e){var n=s.item(e),h=p.indexOf(n);-1e.v),g))Math.abs(o[0]-r[0])<=Math.abs(o[1]-r[1])?(y=[(i[0]+r[0])/2,(i[1]+r[1])/2],f=e.a(y),u=[(n[0]+o[0])/2,(n[1]+o[1])/2],c=e.a(u),t(e,o,i,y,u,s,a,f,c,l-1),t(e,u,y,r,n,c,f,p,h,l-1)):(y=[(o[0]+i[0])/2,(o[1]+i[1])/2],f=e.a(y),u=[(r[0]+n[0])/2,(r[1]+n[1])/2],c=e.a(u),t(e,o,y,u,n,s,f,c,h,l-1),t(e,y,i,r,u,f,a,p,c,l-1));else{if(y){if(!e.l)return;e.o=!0}e.c.push({source:[s,p,h],target:[o,r,n]}),e.c.push({source:[s,a,p],target:[o,i,r]})}}}(this,t,e,i,o,r,p,h,l,10),this.o&&(n=1/0,this.c.forEach(function(t){n=Math.min(n,t.source[0][0],t.source[1][0],t.source[2][0])}),this.c.forEach(function(t){var e;Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-n>this.b/2&&((e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]])[0][0]-n>this.b/2&&(e[0][0]-=this.b),e[1][0]-n>this.b/2&&(e[1][0]-=this.b),e[2][0]-n>this.b/2&&(e[2][0]-=this.b),Math.max(e[0][0],e[1][0],e[2][0])-Math.min(e[0][0],e[1][0],e[2][0])r[0]||t[1]<0||t[1]>r[1])&&(this.f||(this.f=Po(1,1)),this.f.clearRect(0,0,1,1),this.f.drawImage(this.M.Y(),t[0],t[1],1,1,0,0,1,1),0<(r=this.f.getImageData(0,0,1,1).data)[3]))return o.call(i,this.a,r)}},e(pm,ys),pm.prototype.Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new Kb(this):"webgl"===o&&(e=new am(t,this)),e},e(hm,Zb),hm.prototype.sd=function(t,e){var o=t.pixelRatio,i=t.size,r=(s=t.viewState).projection,n=s.resolution,s=s.center,a=this.a,p=a.ha(),h=p.i,l=p.Ta(r),u=l.tc(n,this.T),c=l.Da(u),f=Math.round(n/c)||1,y=t.extent;if(Ut(y=void 0!==e.extent?Nt(y,e.extent):y))return!1;var g=Re(l,y,c),d=l.Pc(u),v=l.Da(u),b=pt(l.gb(u),l.j),d=bt(d[0]+g.ca*b[0]*v,d[1]+g.da*b[1]*v,d[0]+(g.$+1)*b[0]*v,d[1]+(g.ia+1)*b[1]*v,void 0),v=p.nb(o),m=((b={})[u]={},this.Nf(p,r,b)),w=this.l,x=this.va,S=!1;for(C=g.ca;C<=g.$;++C)for(L=g.da;L<=g.ia;++L){var M=p.Nc(u,C,L,o,r);3!=M.getState()||this.a.kd()||S0(M,2),lm(this,M)||(M=x0(M)),lm(this,M)?2==M.getState()&&(b[u][M.ta.toString()]=M,S||-1!=this.g.indexOf(M)||(S=!0)):Ce(l,M.ta,m,x,w)||(M=Le(l,M.ta,x,w))&&m(u+1,M)}if(C=(C=t.viewHints)[0]||C[1],!(this.f&&16t.highWaterMark}function jm(t){Lv.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.va=void 0!==t.opaque&&t.opaque,this.$a=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.a=new Em(t.cacheSize),this.o=[0,0],this.uc=""}function Cm(t,e,o,i,r){if(!(e=t.Wd(e)))return!1;for(var n,s,a=!0,p=i.ca;p<=i.$;++p)for(var h=i.da;h<=i.ia;++h)n=t.Sb(o,p,h),s=!1,(s=e.b.hasOwnProperty(n)?(s=2===(n=e.get(n)).getState())&&!1!==r(n):s)||(a=!1);return a}function Lm(t,e){t.uc!==e&&(t.uc=e,t.s())}function Rm(t,e,o){var i,r,n=void 0!==o?o:t.c;return o=t.Ta(n),t.u&&n.c&&(e=(i=e)[0],t=Ne(o,i),e=ft(n=Ge(n),t)?i:(i=Dt(n),t[0]+=i*Math.ceil((n[0]-t[0])/i),o.bg(t,e))),i=e[0],n=e[1],t=e[2],(o=!(o.minZoom>i||i>o.maxZoom)&&(!(o=(r=o.G())?Ie(o,r,i):o.a?o.a[i]:null)||_(o,n,t)))?e:null}function Im(t,e){Qe.call(this,t),this.tile=e}function Nm(t){jm.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.Fc?this.Fc.bind(this):Pm,this.urls=null,t.urls?this.eb(t.urls):t.url&&this.jb(t.url),t.tileUrlFunction&&this.cb(t.tileUrlFunction)}function T(t){Nm.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction||Dm,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=t.tileClass||M0,this.g={},this.v={},this.Sa=t.reprojectionErrorThreshold,this.I=!1}function Fm(t,e,o,i,r,n,s){return r=(o=Rm(t,e=[e,o,i],n))?t.tileUrlFunction(o,r,n):void 0,(r=new t.tileClass(e,void 0!==r?0:4,void 0!==r?r:"",t.crossOrigin,t.tileLoadFunction)).key=s,d(r,"change",t.Li,t),r}function km(t,e,o,i,r,n){var s=t.Sb(e,o,i),a=t.uc;if(t.a.b.hasOwnProperty(s)){if((h=t.a.get(s)).key!=a){var p=h,h=Fm(t,e,o,i,r,n,a);if(0==p.getState()?h.i=p.i:h.i=p,h.i){e=h.i,o=h;do{if(2==e.getState()){e.i=null;break}}while(1!=e.getState()&&0==e.getState()?o.i=e.i:o=e,e=o.i)}t.a.replace(s,h)}}else h=Fm(t,e,o,i,r,n,a),t.a.set(s,h);return h}function Dm(t,e){t.Y().src=e}function j(t){this.B=void 0!==t.hidpi&&t.hidpi,T.call(this,{cacheSize:t.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:v("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:this.B?2:1,wrapX:void 0===t.wrapX||t.wrapX}),this.R=void 0!==t.culture?t.culture:"en-us",this.C=void 0!==t.maxZoom?t.maxZoom:-1,this.f=t.key,this.l=t.imagerySet,wm("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.l+"?uriScheme=https&include=ImageryProviders&key="+this.f,this.pa.bind(this),void 0,"jsonp")}(r=vm.prototype).sd=function(t,e){var o=this.a,i=o.i;return this.pa!=i&&(this.g.length=0,o=o.j,this.c||"vector"==o||(this.c=Po()),this.c)&&"vector"==o&&(this.c=null),this.pa=i,hm.prototype.sd.apply(this,arguments)},r.Of=function(t,e,o,i,r,n,s,a){var p=t,h=this.a,l=e.pixelRatio,u=e.viewState.projection,c=h.i,f=h.get(jv)||null,y=p.o;if(y.Nd||y.mf!=c||y.Kg!=f){for(var g=0,d=p.a.length;gTerms of Use'});function Um(t){var e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",o=void 0!==t.tileGrid?t.tileGrid:De({extent:Ge(e),maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});T.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX})}function C(t){this.C=t.account,this.B=t.map||"",this.f=t.config||{},this.l={},Um.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,state:"loading",wrapX:t.wrapX}),Gm(this)}function Gm(t){var e,o,i=JSON.stringify(t.f);t.l[i]?Bm(t,t.l[i]):(e="https://"+t.C+".cartodb.com/api/v1/map",t.B&&(e+="/named/"+t.B),(o=new XMLHttpRequest).addEventListener("load",t.Dl.bind(t,i)),o.addEventListener("error",t.Cl.bind(t)),o.open("POST",e),o.setRequestHeader("Content-type","application/json"),o.send(JSON.stringify(t.f)))}function Bm(t,e){t.jb("https://"+e.cdn_url.https+"/"+t.C+"/api/v1/map/"+e.layergroupid+"/{z}/{x}/{y}.png")}function L(t){a.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.features=[],this.geometryFunction=t.geometryFunction||function(t){return O((t=t.V())instanceof m,10),t},this.source=t.source,this.source.J("change",L.prototype.sa,this)}function Xm(t){if(void 0!==t.resolution){t.features.length=0;for(var e=vt(),o=t.distance*t.resolution,i=t.source.Xe(),r={},n=0,s=i.length;n>=1}return o.join("")}(e))}})),i.imageryProviders&&(p=we(v("EPSG:4326"),this.c),(t=i.imageryProviders.map(function(t){var e=t.attribution,n={};return t.coverageAreas.forEach(function(t){var e,o=t.zoomMin,i=Math.min(t.zoomMax,s);for(t=Bt([(t=t.bbox)[1],t[0],t[3],t[2]],p),e=o;e<=i;++e){var r=e.toString(),o=Ie(a,t,e);r in n?n[r].push(o):n[r]=[o]}}),new Be({html:e,tileRanges:n})})).push(Om),this.ua(t)),this.D=e,Iv(this,"ready"))},e(Um,T),e(C,Um),(r=C.prototype).Kk=function(){return this.f},r.tq=function(t){Xt(this.f,t),Gm(this)},r.Xp=function(t){this.f=t||{},Gm(this)},r.Dl=function(t,e){if(!(e=e.target).status||200<=e.status&&e.status<300){try{var o=JSON.parse(e.responseText)}catch(t){return void Iv(this,"error")}Bm(this,o),this.l[t]=o,Iv(this,"ready")}else Iv(this,"error")},r.Cl=function(){Iv(this,"error")},e(L,a),(r=L.prototype).$n=function(){return this.distance},r.ao=function(){return this.source},r.Yd=function(t,e,o){this.source.Yd(t,e,o),e!==this.resolution&&(this.clear(),this.resolution=e,Xm(this),this.cd(this.features))},r.Yp=function(t){this.distance=t,this.sa()},r.sa=function(){this.clear(),Xm(this),this.cd(this.features),a.prototype.sa.call(this)},e(Wm,$b),(r=Wm.prototype).co=function(){return this.v},r.Jc=function(t,e,o,i){if(void 0===this.f)return null;e=Qb(this,e),o=this.T?o:1;var r=this.M;if(r&&this.I==this.i&&r.resolution==e&&r.a==o&&yt(r.G(),t))return r;Xt(r={F:"image",FORMAT:"PNG32",TRANSPARENT:!0},this.v);var n=((t=t.slice())[0]+t[2])/2,s=(t[1]+t[3])/2,a=(1!=this.B&&(a=this.B*Dt(t)/2,p=this.B*It(t)/2,t[0]=n-a,t[1]=s-p,t[2]=n+a,t[3]=s+p),e/o),p=Math.ceil(Dt(t)/a),h=Math.ceil(It(t)/a);return t[0]=n-a*p/2,t[2]=n+a*p/2,t[1]=s-a*h/2,t[3]=s+a*h/2,this.l[0]=p,this.l[1]=h,n=t,s=this.l,a=o,i=i.mb.split(":").pop(),r.SIZE=s[0]+","+s[1],r.BBOX=n.join(","),r.BBOXSR=i,r.IMAGESR=i,r.DPI=Math.round(90*a),(n=(i=this.f).replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"))==i&&O(!1,50),r=Vm(n,r),this.M=new b0(t,e,o,this.j,r,this.R,this.g),this.I=this.i,d(this.M,"change",this.o,this),this.M},r.bo=function(){return this.g},r.eo=function(){return this.f},r.fo=function(t){this.M=null,this.g=t,this.s()},r.ho=function(t){t!=this.f&&(this.f=t,this.M=null,this.s())},r.io=function(t){Xt(this.v,t),this.M=null,this.s()},e(Zm,$b),(r=Zm.prototype).ko=function(){return this.g},r.Jc=function(t,e,o){e=Qb(this,e),o=this.T?o:1;var i,r,n,s,a,p,h,l,u=this.M;return u&&this.B==this.i&&u.resolution==e&&u.a==o&&yt(u.G(),t)||(1!=this.v&&Gt(t=t.slice(),this.v),l=[Dt(t)/e*o,It(t)/e*o],void 0!==this.I?(u=this.I,i=Lt(t),r=this.pa,n=Dt(t),s=It(t),a=l[0],p=l[1],h=.0254/this.l,l={OPERATION:this.va?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol.source.ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.l,SETDISPLAYWIDTH:Math.round(l[0]),SETDISPLAYHEIGHT:Math.round(l[1]),SETVIEWSCALE:a*sOpenStreetMap contributors.'}),fi=(mp.df={},mp.df.Af=function(){},mp.df=mp.df||{});function $m(u){var c=!0;try{new ImageData(10,10)}catch(t){c=!1}return function(t){var e=t.buffers,o=t.meta,i=t.width,r=t.height,n=e.length,s=e[0].byteLength;if(t.imageOps){for(s=Array(n),t=0;tthis.fk;)this.Ed.shift().callback(null,null)},Qm.prototype.dh=function(){if(0===this.oe&&0Stamen Design, under CC BY 3.0.'}),_m],h1={terrain:{Lb:"jpg",opaque:!0},"terrain-background":{Lb:"jpg",opaque:!0},"terrain-labels":{Lb:"png",opaque:!1},"terrain-lines":{Lb:"png",opaque:!1},"toner-background":{Lb:"png",opaque:!0},toner:{Lb:"png",opaque:!0},"toner-hybrid":{Lb:"png",opaque:!1},"toner-labels":{Lb:"png",opaque:!1},"toner-lines":{Lb:"png",opaque:!1},"toner-lite":{Lb:"png",opaque:!0},watercolor:{Lb:"jpg",opaque:!0}},l1={terrain:{minZoom:4,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:1,maxZoom:16}};function R(t){T.call(this,{attributions:(t=t||{}).attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.f=t.params||{},this.l=vt(),Lm(this,u1(this))}function u1(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function c1(t){jm.call(this,{opaque:!1,projection:t.projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX})}function f1(t,e,o){w0.call(this,t,2),this.c=e,this.Ia=o,this.a=null}function y1(t){var e;this.f=null,T.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,projection:v("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX}),t.url?t.jsonp?wm(t.url,this.og.bind(this),this.Ve.bind(this)):((e=new XMLHttpRequest).addEventListener("load",this.Ao.bind(this)),e.addEventListener("error",this.zo.bind(this)),e.open("GET",t.url),e.send()):t.tileJSON?this.og(t.tileJSON):O(!1,51)}function g1(t){var e;jm.call(this,{projection:v("EPSG:3857"),state:"loading"}),this.v=void 0===t.preemptive||t.preemptive,this.l=Pm,this.g=void 0,this.f=t.jsonp||!1,t.url?this.f?wm(t.url,this.pg.bind(this),this.We.bind(this)):((e=new XMLHttpRequest).addEventListener("load",this.Eo.bind(this)),e.addEventListener("error",this.Do.bind(this)),e.open("GET",t.url),e.send()):t.tileJSON?this.pg(t.tileJSON):O(!1,51)}function d1(t,e,o,i,r,n){w0.call(this,t,e),this.o=o,this.a=i,this.v=r,this.c=this.j=this.g=null,this.l=n}function v1(t){var e;0==t.state&&(t.state=1,t.l?wm(t.o,t.Ji.bind(t),t.De.bind(t)):((e=new XMLHttpRequest).addEventListener("load",t.Co.bind(t)),e.addEventListener("error",t.Bo.bind(t)),e.open("GET",t.o),e.send()))}function I(t){var e=(t=t||{}).params||{};T.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,opaque:!(!("TRANSPARENT"in e)||e.TRANSPARENT),projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.C=void 0!==t.gutter?t.gutter:0,this.f=e,this.l=!0,this.B=t.serverType,this.T=void 0===t.hidpi||t.hidpi,this.R="",m1(this),this.fa=vt(),x1(this),Lm(this,w1(this))}function b1(t,e,o,i,r,n,s){var a=t.urls;if(a){if(s.WIDTH=o[0],s.HEIGHT=o[1],s[t.l?"CRS":"SRS"]=n.mb,"STYLES"in t.f||(s.STYLES=""),1!=r)switch(t.B){case"geoserver":o=90*r+.5|0,s.FORMAT_OPTIONS="FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+";dpi:"+o:"dpi:"+o;break;case"mapserver":s.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":s.DPI=90*r;break;default:O(!1,52)}return n=n.b,t.l&&"ne"==n.substr(0,2)&&(t=i[0],i[0]=i[1],i[1]=t,t=i[2],i[2]=i[3],i[3]=t),s.BBOX=i.join(","),Vm(1==a.length?a[0]:a[rt((e[1]<>=1,i>>=1;break;default:O(!1,53)}n.push([1,1]),n.reverse();for(var r=[1],s=[0],i=1,o=n.length;i=e+this.b&&a.height>=o+this.b)return s={offsetX:a.x+this.b,offsetY:a.y+this.b,image:this.f},this.c[t]=s,i.call(r,this.i,a.x+this.b,a.y+this.b),t=n,e+=this.b,i=o+this.b,e=a.width-e>a.height-i?(o={x:a.x+e,y:a.y,width:a.width-e,height:a.height},{x:a.x,y:a.y+i,width:e,height:a.height-i}):(o={x:a.x+e,y:a.y,width:a.width-e,height:i},{x:a.x,y:a.y+i,width:a.width,height:a.height-i}),F1(this,t,o,e),s}return null},k1.prototype.add=function(t,e,o,i,r,n){return!(e+this.b>this.i||o+this.b>this.i)&&(i=D1(this,!1,t,e,o,i,n))?(t=D1(this,!0,t,e,o,r||Y,n),{offsetX:i.offsetX,offsetY:i.offsetY,image:i.image,Zl:t.image}):null},t("ol.Attribution",Be),Be.prototype.getHTML=Be.prototype.i,t("ol.Collection",ho),ho.prototype.extend=ho.prototype.fg,ho.prototype.getArray=ho.prototype.tm,ho.prototype.getLength=ho.prototype.dc,ho.prototype.insertAt=ho.prototype.He,ho.prototype.removeAt=ho.prototype.Hg,ho.prototype.setAt=ho.prototype.Wp,t("ol.color.asArray",vo),t("ol.color.asString",bo),t("ol.colorlike.asColorLike",Mo),t("ol.control.defaults",Uo),t("ol.coordinate.add",er),t("ol.coordinate.createStringXY",function(e){return function(t){return ur(t,e)}}),t("ol.coordinate.format",rr),t("ol.coordinate.rotate",sr),t("ol.coordinate.toStringHDMS",function(t,e){return t?ir("NS",t[1],e)+" "+ir("EW",t[0],e):""}),t("ol.coordinate.toStringXY",ur),t("ol.DeviceOrientation",Uh),Uh.prototype.getAlpha=Uh.prototype.Fk,Uh.prototype.getBeta=Uh.prototype.Ik,Uh.prototype.getGamma=Uh.prototype.Ok,Uh.prototype.getHeading=Uh.prototype.um,Uh.prototype.getTracking=Uh.prototype.Th,Uh.prototype.setTracking=Uh.prototype.gg,t("ol.easing.easeIn",Ro),t("ol.easing.easeOut",Io),t("ol.easing.inAndOut",No),t("ol.easing.linear",Fo),t("ol.easing.upAndDown",function(t){return t<.5?No(2*t):1-No(2*(t-.5))}),t("ol.extent.boundingExtent",ht),t("ol.extent.buffer",lt),t("ol.extent.containsCoordinate",ft),t("ol.extent.containsExtent",yt),t("ol.extent.containsXY",gt),t("ol.extent.createEmpty",vt),t("ol.extent.equals",St),t("ol.extent.extend",Mt),t("ol.extent.getArea",Tt),t("ol.extent.getBottomLeft",jt),t("ol.extent.getBottomRight",Ct),t("ol.extent.getCenter",Lt),t("ol.extent.getHeight",It),t("ol.extent.getIntersection",Nt),t("ol.extent.getSize",function(t){return[t[2]-t[0],t[3]-t[1]]}),t("ol.extent.getTopLeft",Ft),t("ol.extent.getTopRight",kt),t("ol.extent.getWidth",Dt),t("ol.extent.intersects",Ot),t("ol.extent.isEmpty",Ut),t("ol.extent.applyTransform",Bt),t("ol.Feature",x),x.prototype.getGeometry=x.prototype.V,x.prototype.getId=x.prototype.wm,x.prototype.getGeometryName=x.prototype.Qk,x.prototype.getStyle=x.prototype.xm,x.prototype.getStyleFunction=x.prototype.Lc,x.prototype.setGeometry=x.prototype.Ra,x.prototype.setStyle=x.prototype.hg,x.prototype.setId=x.prototype.jc,x.prototype.setGeometryName=x.prototype.Tc,t("ol.featureloader.xhr",ml),t("ol.Geolocation",p0),p0.prototype.getAccuracy=p0.prototype.Dk,p0.prototype.getAccuracyGeometry=p0.prototype.Ek,p0.prototype.getAltitude=p0.prototype.Gk,p0.prototype.getAltitudeAccuracy=p0.prototype.Hk,p0.prototype.getHeading=p0.prototype.ym,p0.prototype.getPosition=p0.prototype.zm,p0.prototype.getProjection=p0.prototype.Uh,p0.prototype.getSpeed=p0.prototype.ll,p0.prototype.getTracking=p0.prototype.Vh,p0.prototype.getTrackingOptions=p0.prototype.Gh,p0.prototype.setProjection=p0.prototype.Wh,p0.prototype.setTracking=p0.prototype.Ke,p0.prototype.setTrackingOptions=p0.prototype.wj,t("ol.Graticule",c0),c0.prototype.getMap=c0.prototype.Cm,c0.prototype.getMeridians=c0.prototype.al,c0.prototype.getParallels=c0.prototype.hl,t("ol.has.DEVICE_PIXEL_RATIO",ni),t("ol.has.CANVAS",ai),t("ol.has.DEVICE_ORIENTATION",pi),t("ol.has.GEOLOCATION",hi),t("ol.has.TOUCH",li),t("ol.has.WEBGL",gi),b0.prototype.getImage=b0.prototype.Y,M0.prototype.getImage=M0.prototype.Y,t("ol.inherits",e),t("ol.interaction.defaults",hs),t("ol.Kinetic",sn),t("ol.loadingstrategy.all",Cv),t("ol.loadingstrategy.bbox",function(t){return[t]}),t("ol.loadingstrategy.tile",function(i){return function(t,e){e=i.tc(e),t=Ie(i,t,e);var o=[];for((e=[e,0,0])[1]=t.ca;e[1]<=t.$;++e[1])for(e[2]=t.da;e[2]<=t.ia;++e[2])o.push(i.Aa(e));return o}}),t("ol.Map",u),u.prototype.addControl=u.prototype.kk,u.prototype.addInteraction=u.prototype.lk,u.prototype.addLayer=u.prototype.ih,u.prototype.addOverlay=u.prototype.jh,u.prototype.forEachFeatureAtPixel=u.prototype.we,u.prototype.forEachLayerAtPixel=u.prototype.Im,u.prototype.hasFeatureAtPixel=u.prototype.Yl,u.prototype.getEventCoordinate=u.prototype.Tf,u.prototype.getEventPixel=u.prototype.xe,u.prototype.getTarget=u.prototype.ag,u.prototype.getTargetElement=u.prototype.jd,u.prototype.getCoordinateFromPixel=u.prototype.Wa,u.prototype.getControls=u.prototype.Lk,u.prototype.getOverlays=u.prototype.fl,u.prototype.getOverlayById=u.prototype.el,u.prototype.getInteractions=u.prototype.Sk,u.prototype.getLayerGroup=u.prototype.Kc,u.prototype.getLayers=u.prototype.Xh,u.prototype.getPixelFromCoordinate=u.prototype.Ja,u.prototype.getSize=u.prototype.Ob,u.prototype.getView=u.prototype.Z,u.prototype.getViewport=u.prototype.sl,u.prototype.renderSync=u.prototype.Tp,u.prototype.removeControl=u.prototype.Mp,u.prototype.removeInteraction=u.prototype.Np,u.prototype.removeLayer=u.prototype.Pp,u.prototype.removeOverlay=u.prototype.Qp,u.prototype.setLayerGroup=u.prototype.qj,u.prototype.setSize=u.prototype.Qg,u.prototype.setTarget=u.prototype.Le,u.prototype.setView=u.prototype.iq,u.prototype.updateSize=u.prototype.Ad,t("ol.Object",ro),ro.prototype.getKeys=ro.prototype.O,ro.prototype.getProperties=ro.prototype.N,ro.prototype.setProperties=ro.prototype.H,ro.prototype.unset=ro.prototype.P,t("ol.Observable",io),t("ol.Observable.unByKey",function(t){if(Array.isArray(t))for(var e=0,o=t.length;e div",this.Base.container,!0);n<=e?(this.Base.container.style.right="auto",this.Base.container.style.left=t[0]+5+"px"):(this.Base.container.style.left="auto",this.Base.container.style.right="15px"),i<=o?(this.Base.container.style.bottom="auto",this.Base.container.style.top=t[1]-10+"px"):(this.Base.container.style.top="auto",this.Base.container.style.bottom=0),d.removeClass(this.Base.container,l.hidden),a.length&&(this.submenu.lastLeft=e<2*n?"-"+n+"px":this.submenu.left,a.forEach(function(t){var e=d.getViewportSize(),n=d.offset(t),i=n.height;o-i<0&&(i=i-(e.h-n.top),t.style.top="-"+i+"px"),t.style.left=s.submenu.lastLeft}))},e.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:o,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},e.prototype.closeMenu=function(){this.opened=!1,d.addClass(this.Base.container,l.hidden),this.Base.dispatchEvent({type:a})},e.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.handleEvent=function(e){var n=this;this.coordinateClicked=this.map.getEventCoordinate(e),this.pixelClicked=this.map.getEventPixel(e),this.Base.dispatchEvent({type:s,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===r&&(e.stopPropagation(),e.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),e.target.addEventListener("mousedown",{handleEvent:function(t){n.closeMenu(),e.target.removeEventListener(t.type,this,!1)}},!1))},e.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",function(t){t.preventDefault();t={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(t,i.map)},!1))};function u(t){d.assert("object"==typeof(t=void 0===t?{}:t),"@param `opt_options` should be object type!"),"default_items"in t&&(c.defaultItems=t.default_items),this.options=d.mergeOptions(c,t),this.disabled=!1,this.Internal=new e(this),this.Html=new n(this),i.call(this,{element:this.container})}return n.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[l.container,l.OL_unselectable];return t&&i.push(l.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},n.prototype.createMenu=function(){var t=[];return"items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(h):this.Base.options.items:this.Base.options.defaultItems&&(t=h),0!==t.length&&void t.forEach(this.addMenuEntry,this)},n.prototype.addMenuEntry=function(t){var e,n,i=this;t.items&&Array.isArray(t.items)?(t.classname=t.classname||"",d.contains(l.submenu,t.classname)||(t.classname=t.classname.length?" "+l.submenu:l.submenu),e=this.generateHtmlAndPublish(this.container,t),(n=this.createContainer()).style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,e.appendChild(n),t.items.forEach(function(t){i.generateHtmlAndPublish(n,t,!0)})):this.generateHtmlAndPublish(this.container,t)},n.prototype.generateHtmlAndPublish=function(t,e,n){var i,s,o,a=!1,r=d.getUniqueId();return"string"==typeof e&&"-"===e.trim()?(i=['
  • ',"
  • "].join(""),s=d.createFragment(i),o=[].slice.call(s.childNodes,0)[0],t.firstChild.appendChild(s),a=!0):(e.classname=e.classname||"",s=d.createFragment(i=""+e.text+""),o=document.createElement("li"),e.icon&&(""===e.classname?e.classname=l.icon:-1===e.classname.indexOf(l.icon)&&(e.classname+=" "+l.icon),o.setAttribute("style","background-image:url("+e.icon+")")),o.id=r,o.className=e.classname,o.appendChild(s),t.firstChild.appendChild(o)),this.Base.Internal.items[r]={id:r,submenu:n||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(o,r),o},n.prototype.removeMenuEntry=function(t){var e=d.find("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},n.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=d.createFragment("Foo"),n=d.createFragment("Foo"),i=document.createElement("li"),s=document.createElement("li"),e=(i.appendChild(e),s.appendChild(n),t.appendChild(i),t.appendChild(s),this.container.parentNode.appendChild(t),t.offsetHeight/2);return this.container.parentNode.removeChild(t),e},(i=ol.control.Control)&&(u.__proto__=i),((u.prototype=Object.create(i&&i.prototype)).constructor=u).prototype.clear=function(){var e=this;Object.keys(this.Internal.items).forEach(function(t){e.Html.removeMenuEntry(t)})},u.prototype.close=function(){this.Internal.closeMenu()},u.prototype.enable=function(){this.disabled=!1},u.prototype.disable=function(){this.disabled=!0},u.prototype.getDefaultItems=function(){return h},u.prototype.extend=function(t){d.assert(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},u.prototype.isOpened=function(){return this.isOpen()},u.prototype.isOpen=function(){return this.Internal.opened},u.prototype.updatePosition=function(t){d.assert(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},u.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},u.prototype.push=function(t){d.assert(d.isDefAndNotNull(t),"@param `item` must be informed."),this.Html.addMenuEntry(t)},u.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},u.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()},u}) \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ContextMenu=e()}(this,function(){function e(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this}function n(t){return this.Base=t,this.Base.container=this.container=this.createContainer(),this}var i,t="ol-ctx-menu",s="beforeopen",o="open",a="close",r="contextmenu",l={container:t+"-container",separator:t+"-separator",submenu:t+"-submenu",hidden:t+"-hidden",icon:t+"-icon",zoomIn:t+"-zoom-in",zoomOut:t+"-zoom-out",OL_unselectable:"ol-unselectable"},c={width:150,scrollAt:4,eventType:r,defaultItems:!0},h=[{text:"Zoom In",classname:[l.zoomIn,l.icon].join(" "),callback:function(t,e){e=e.getView();e.animate({zoom:+e.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:[l.zoomOut,l.icon].join(" "),callback:function(t,e){e=e.getView();e.animate({zoom:+e.getZoom()-1,duration:700,center:t.coordinate})}}],d={isNumeric:function(t){return/^\d+$/.test(t)},classRegex:function(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")},addClass:function(t,e,n){var i=this;if(Array.isArray(t))t.forEach(function(t){i.addClass(t,e)});else for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])||i._addClass(t,s[o],n)},_addClass:function(t,e,n){var i=this;t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._removeClass(t,e)},n)},removeClass:function(t,e,n){var i=this;if(Array.isArray(t))t.forEach(function(t){i.removeClass(t,e,n)});else for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])&&i._removeClass(t,s[o],n)},_removeClass:function(t,e,n){var i=this;t.classList?t.classList.remove(e):t.className=t.className.replace(this.classRegex(e)," ").trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._addClass(t,e)},n)},hasClass:function(t,e){return t.classList?t.classList.contains(e):this.classRegex(e).test(t.className)},toggleClass:function(t,e){var n=this;return Array.isArray(t)?void t.forEach(function(t){n.toggleClass(t,e)}):void(t.classList?t.classList.toggle(e):this.hasClass(t,e)?this._removeClass(t,e):this._addClass(t,e))},$:function(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)},isElement:function(t){return"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&"object"==typeof t&&1===t.nodeType&&!!t.nodeName},find:function(t,e,n){void 0===e&&(e=window.document);var i=Array.prototype.slice,s=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":s=[this.$(t.substr(1))];break;case".":s=i.call(e.getElementsByClassName(t.substr(1).replace(/\./g," ")));break;default:s=i.call(e.getElementsByTagName(t))}else s=i.call(e.querySelectorAll(t));return n?s:s[0]},offset:function(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+window.pageXOffset-n.clientLeft,top:e.top+window.pageYOffset-n.clientTop,width:t.offsetWidth,height:t.offsetHeight}},getViewportSize:function(){return{w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight}},getAllChildren:function(t,e){return[].slice.call(t.getElementsByTagName(e))},isEmpty:function(t){return!t||0===t.length},emptyArray:function(t){for(;t.length;)t.pop()},removeAllChildren:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},mergeOptions:function(t,e){var n,i,s={};for(n in t)s[n]=t[n];for(i in e)s[i]=e[i];return s},createFragment:function(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e},contains:function(t,e){return!!~e.indexOf(t)},getUniqueId:function(){return"_"+Math.random().toString(36).substr(2,9)},isDefAndNotNull:function(t){return null!=t},assertEqual:function(t,e,n){if(t!==e)throw new Error(n+" mismatch: "+t+" != "+e)},assert:function(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}};e.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=0 div",this.Base.container,!0);n<=e?(this.Base.container.style.right="auto",this.Base.container.style.left=t[0]+5+"px"):(this.Base.container.style.left="auto",this.Base.container.style.right="15px"),i<=o?(this.Base.container.style.bottom="auto",this.Base.container.style.top=t[1]-10+"px"):(this.Base.container.style.top="auto",this.Base.container.style.bottom=0),d.removeClass(this.Base.container,l.hidden),a.length&&(this.submenu.lastLeft=e<2*n?"-"+n+"px":this.submenu.left,a.forEach(function(t){var e=d.getViewportSize(),n=d.offset(t),i=n.height;o-i<0&&(i=i-(e.h-n.top),t.style.top="-"+i+"px"),t.style.left=s.submenu.lastLeft}))},e.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:o,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},e.prototype.closeMenu=function(){this.opened=!1,d.addClass(this.Base.container,l.hidden),this.Base.dispatchEvent({type:a})},e.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.handleEvent=function(e){var n=this;this.coordinateClicked=this.map.getEventCoordinate(e),this.pixelClicked=this.map.getEventPixel(e),this.Base.dispatchEvent({type:s,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===r&&(e.stopPropagation(),e.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),e.target.addEventListener("mousedown",{handleEvent:function(t){n.closeMenu(),e.target.removeEventListener(t.type,this,!1)}},!1))},e.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",function(t){t.preventDefault();t={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(t,i.map)},!1))};function u(t){d.assert("object"==typeof(t=void 0===t?{}:t),"@param `opt_options` should be object type!"),"default_items"in t&&(c.defaultItems=t.default_items),this.options=d.mergeOptions(c,t),this.disabled=!1,this.Internal=new e(this),this.Html=new n(this),i.call(this,{element:this.container})}return n.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[l.container,l.OL_unselectable];return t&&i.push(l.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},n.prototype.createMenu=function(){var t=[];return"items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(h):this.Base.options.items:this.Base.options.defaultItems&&(t=h),0!==t.length&&void t.forEach(this.addMenuEntry,this)},n.prototype.addMenuEntry=function(t){var e,n,i=this;t.items&&Array.isArray(t.items)?(t.classname=t.classname||"",d.contains(l.submenu,t.classname)||(t.classname=t.classname.length?" "+l.submenu:l.submenu),e=this.generateHtmlAndPublish(this.container,t),(n=this.createContainer()).style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,e.appendChild(n),t.items.forEach(function(t){i.generateHtmlAndPublish(n,t,!0)})):this.generateHtmlAndPublish(this.container,t)},n.prototype.generateHtmlAndPublish=function(t,e,n){var i,s,o,a=!1,r=d.getUniqueId();return"string"==typeof e&&"-"===e.trim()?(i=['
  • ',"
  • "].join(""),s=d.createFragment(i),o=[].slice.call(s.childNodes,0)[0],t.firstChild.appendChild(s),a=!0):(e.classname=e.classname||"",i=""+e.text+"",s=d.createFragment(i),o=document.createElement("li"),e.icon&&(""===e.classname?e.classname=l.icon:-1===e.classname.indexOf(l.icon)&&(e.classname+=" "+l.icon),o.setAttribute("style","background-image:url("+e.icon+")")),o.id=r,o.className=e.classname,o.appendChild(s),t.firstChild.appendChild(o)),this.Base.Internal.items[r]={id:r,submenu:n||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(o,r),o},n.prototype.removeMenuEntry=function(t){var e=d.find("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},n.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=d.createFragment("Foo"),n=d.createFragment("Foo"),i=document.createElement("li"),s=document.createElement("li"),e=(i.appendChild(e),s.appendChild(n),t.appendChild(i),t.appendChild(s),this.container.parentNode.appendChild(t),t.offsetHeight/2);return this.container.parentNode.removeChild(t),e},(i=ol.control.Control)&&(u.__proto__=i),((u.prototype=Object.create(i&&i.prototype)).constructor=u).prototype.clear=function(){var e=this;Object.keys(this.Internal.items).forEach(function(t){e.Html.removeMenuEntry(t)})},u.prototype.close=function(){this.Internal.closeMenu()},u.prototype.enable=function(){this.disabled=!1},u.prototype.disable=function(){this.disabled=!0},u.prototype.getDefaultItems=function(){return h},u.prototype.extend=function(t){d.assert(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},u.prototype.isOpened=function(){return this.isOpen()},u.prototype.isOpen=function(){return this.Internal.opened},u.prototype.updatePosition=function(t){d.assert(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},u.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},u.prototype.push=function(t){d.assert(d.isDefAndNotNull(t),"@param `item` must be informed."),this.Html.addMenuEntry(t)},u.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},u.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()},u}) \ No newline at end of file diff --git a/public/scripts/u2f-api-min.js b/public/scripts/u2f-api-min.js index e7ec9870..1d05f28c 100644 --- a/public/scripts/u2f-api-min.js +++ b/public/scripts/u2f-api-min.js @@ -1 +1 @@ -var u2f,js_api_version;window.u2f||((u2f=u2f||{}).EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd",u2f.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"},u2f.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5},u2f.getMessagePort=function(e){var t;"undefined"!=typeof chrome&&chrome.runtime?(t={type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]},chrome.runtime.sendMessage(u2f.EXTENSION_ID,t,function(){chrome.runtime.lastError?u2f.getIframePort_(e):u2f.getChromeRuntimePort_(e)})):u2f.isAndroidChrome_()?u2f.getAuthenticatorPort_(e):u2f.isIosChrome_()?u2f.getIosPort_(e):u2f.getIframePort_(e)},u2f.isAndroidChrome_=function(){var e=navigator.userAgent;return-1!=e.indexOf("Chrome")&&-1!=e.indexOf("Android")},u2f.isIosChrome_=function(){var e,t=["iPhone","iPad","iPod"];for(e in t)if(navigator.platform==t[e])return!0;return!1},u2f.getChromeRuntimePort_=function(e){var t=chrome.runtime.connect(u2f.EXTENSION_ID,{includeTlsChannelId:!0});setTimeout(function(){e(new u2f.WrappedChromeRuntimePort_(t))},0)},u2f.getAuthenticatorPort_=function(e){setTimeout(function(){e(new u2f.WrappedAuthenticatorPort_)},0)},u2f.getIosPort_=function(e){setTimeout(function(){e(new u2f.WrappedIosPort_)},0)},u2f.WrappedChromeRuntimePort_=function(e){this.port_=e},u2f.formatSignRequest_=function(e,t,o,r,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=[],u=0;u{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;let r=i(9042),s=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),l=i(9631);class c extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;ethis._onBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._onBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize(e=>this._onResize(e.rows))),this.register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(e=>this._onChar(e))),this.register(this._terminal.onLineFeed(()=>this._onChar("\n"))),this.register(this._terminal.onA11yTab(e=>this._onTab(e))),this.register(this._terminal.onKey(e=>this._onKey(e.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,o.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions()))}dispose(){super.dispose(),(0,l.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(i,r){var s=i.target,e=this._rowElements[0===r?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===r?"1":""+this._terminal.buffer.lines.length)&&i.relatedTarget===e){let e,t;if(0===r?(e=s,t=this._rowElements.pop(),this._rowContainer.removeChild(t)):(e=this._rowElements.shift(),t=s,this._rowContainer.removeChild(e)),e.removeEventListener("focus",this._topBoundaryFocusListener),t.removeEventListener("focus",this._bottomBoundaryFocusListener),0===r){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===r?-1:1),this._rowElements[0===r?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(t){for(let e=0;e{this._accessibilityTreeRoot.appendChild(this._liveRegion)},0)}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&(0,l.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){var s=this._terminal.buffer,n=s.lines.length.toString();for(let r=e;r<=t;r++){let e=s.translateBufferLineToString(s.ydisp+r,!0),t=(s.ydisp+r+1).toString(),i=this._rowElements[r];i&&(0===e.length?i.innerText=" ":i.textContent=e,i.setAttribute("aria-posinset",t),i.setAttribute("aria-setsize",n))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e{function r(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function n(e,t,i){e=s(e=r(e),i.decPrivateModes.bracketedPasteMode),i.triggerDataEvent(e,!0),t.value=""}function o(e,t,i){var i=i.getBoundingClientRect(),r=e.clientX-i.left-10,e=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=r+"px",t.style.top=e+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=r,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&n(e.clipboardData.getData("text/plain"),t,i)},t.paste=n,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r,s){o(e,t,i),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;let r=i(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},5680:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorManager=r.DEFAULT_ANSI_COLORS=void 0;let h=t(8055),i=t(7239),s=h.css.toColor("#ffffff"),n=h.css.toColor("#000000"),o=h.css.toColor("#ffffff"),a=h.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{var t=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let e=0;e<216;e++){var r=i[e/36%6|0],s=i[e/6%6|0],n=i[e%6];t.push({css:h.channels.toCss(r,s,n),rgba:h.channels.toRgba(r,s,n)})}for(let e=0;e<24;e++){var o=8+10*e;t.push({css:h.channels.toCss(o,o,o),rgba:h.channels.toRgba(o,o,o)})}return t})()),r.ColorManager=class{constructor(e,t){this.allowTransparency=t;t=e.createElement("canvas"),t.width=1,t.height=1,e=t.getContext("2d");if(!e)throw new Error("Could not get rendering context");this._ctx=e,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new i.ColorContrastCache,this.colors={foreground:s,background:n,cursor:o,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:h.color.blend(n,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:h.color.blend(n,l),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,t){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=t}}setTheme(i={}){this.colors.foreground=this._parseColor(i.foreground,s),this.colors.background=this._parseColor(i.background,n),this.colors.cursor=this._parseColor(i.cursor,o,!0),this.colors.cursorAccent=this._parseColor(i.cursorAccent,a,!0),this.colors.selectionBackgroundTransparent=this._parseColor(i.selectionBackground,l,!0),this.colors.selectionBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(i.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);let e={css:"",rgba:0};if(this.colors.selectionForeground=i.selectionForeground?this._parseColor(i.selectionForeground,e):void 0,this.colors.selectionForeground===e&&(this.colors.selectionForeground=void 0),h.color.isOpaque(this.colors.selectionBackgroundTransparent))this.colors.selectionBackgroundTransparent=h.color.opacity(this.colors.selectionBackgroundTransparent,.3);if(h.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent))this.colors.selectionInactiveBackgroundTransparent=h.color.opacity(this.colors.selectionInactiveBackgroundTransparent,.3);if(this.colors.ansi=r.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(i.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(i.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(i.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(i.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(i.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(i.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(i.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(i.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(i.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(i.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(i.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(i.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(i.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(i.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(i.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(i.brightWhite,r.DEFAULT_ANSI_COLORS[15]),i.extendedAnsi){let t=Math.min(this.colors.ansi.length-16,i.extendedAnsi.length);for(let e=0;eNumber(e)),s=Math.round(255*r);return{rgba:h.channels.toRgba(e,t,i,s),css:n}}}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t,i;for(i of e)null!=(t=null==i?void 0:i.parentElement)&&t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,r){e.addEventListener(t,i,r);let s=!1;return{dispose:()=>{s||(s=!0,e.removeEventListener(t,i,r))}}}},6465:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{var e=this._linkProviders.indexOf(t);-1!==e&&this._linkProviders.splice(e,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(e){this._isMouseOut=!1;var i=t.composedPath();for(let t=0;t{null!=e&&e.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=r.y);let n=!1;for(let[i,e]of this._linkProviders.entries())t?null!=(s=this._activeProviderReplies)&&s.get(i)&&(n=this._checkLinkProviderResult(i,r,n)):e.provideLinks(r.y,e=>{var t;this._isMouseOut||(e=null==e?void 0:e.map(e=>({link:e})),null!=(t=this._activeProviderReplies)&&t.set(i,e),n=this._checkLinkProviderResult(i,r,n),(null==(t=this._activeProviderReplies)?void 0:t.size)===this._linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies))})}_removeIntersectingLinks(i,t){var r=new Set;for(let e=0;ei?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(t--,1);break}r.add(e)}}}}_checkLinkProviderResult(r,s,n){var o;if(this._activeProviderReplies){let t=this._activeProviderReplies.get(r),i=!1;for(let e=0;ethis._linkAtPosition(e.link,s));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let t=0;tthis._linkAtPosition(e.link,s));if(e){n=!0,this._handleNewLink(e);break}}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var t;this._element&&this._mouseService&&this._currentLink&&(t=this._positionFromMouseEvent(e,this._element,this._mouseService))&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),(this._currentLink=void 0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){var e;this._element&&this._lastMouseEvent&&this._mouseService&&(e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService))&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:void 0===i.link.decorations||i.link.decorations.underline,pointerCursor:void 0===i.link.decorations||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.pointerCursor},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered)&&(null!=(t=this._element)&&t.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.underline},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&(null==(t=null==(t=this._currentLink)?void 0:t.state)?void 0:t.decorations.underline)!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered)&&this._fireUnderlineEvent(i.link,e)}}}),this._renderService)&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{var t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))}_linkHover(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor)&&e.classList.add("xterm-cursor-pointer"),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){var e=e.range,i=this._bufferService.buffer.ydisp,e=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-i-1,e.end.x,e.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(e)}_linkLeave(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor)&&e.classList.remove("xterm-cursor-pointer"),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){var i=e.range.start.y===e.range.end.y,r=e.range.start.yt.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||r&&e.range.end.x>=t.x||s&&e.range.start.x<=t.x||r&&s)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){i=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,r,s){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:s}}},i=r([s(0,n.IBufferService)],i);t.Linkifier2=i},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{if(s)return s.activate(t,e,r);t=e;if(confirm(`Do you want to navigate to ${t}?`)){let e=window.open();if(e){try{e.opener=null}catch(e){}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}},hover:(e,t)=>{var i;return null==(i=null==s?void 0:s.hover)?void 0:i.call(s,e,t,r)},leave:(e,t)=>{var i;return null==(i=null==s?void 0:s.leave)?void 0:i.call(s,e,t,r)}})}h=!1,o=r.hasExtendedAttrs()&&r.extended.urlId?(a=t,r.extended.urlId):a=-1}}e(i)}else e(void 0)}};i=r([s(0,n.IBufferService),s(1,n.IOptionsService),s(2,n.IOscLinkService)],i),t.OscLinkProvider=i},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){var e,t;(this._animationFrame=void 0)!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(var e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;i=i(844);class r extends i.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var e;this._outerListener&&(null!=(e=this._resolutionMediaMatchList)&&e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;let r=i(2950),s=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),l=i(6114),c=i(3656),_=i(9042),d=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(5680),S=i(3230),m=i(4725),C=i(428),b=i(8934),y=i(6465),w=i(5114),E=i(8969),L=i(8055),R=i(4269),k=i(5941),D=i(3107),A=i(5744),x=i(9074),B=i(2585),T=i(2962),M="undefined"!=typeof window?window.document:null;class O extends E.CoreTerminal{constructor(e={}){super(e),this.browser=l,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(y.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((e,t)=>this.refresh(e,t))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this.register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows)))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(e){var t;if(this._colorManager){for(let i of e){let e,t="";switch(i.index){case 256:e="foreground",t="10";break;case 257:e="background",t="11";break;case 258:e="cursor",t="12";break;default:e="ansi",t="4;"+i.index}switch(i.type){case 0:var r=L.color.toColorRGB("ansi"===e?this._colorManager.colors.ansi[i.index]:this._colorManager.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${t};`+(0,k.toRgbString)(r)+o.C1_ESCAPED.ST);break;case 1:"ansi"===e?this._colorManager.colors.ansi[i.index]=L.rgba.toColor(...i.color):this._colorManager.colors[e]=L.rgba.toColor(...i.color);break;case 2:this._colorManager.restoreColor(i.index)}}null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._renderService)&&e.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},null==(e=null==(e=this.element)?void 0:e.parentNode))||e.removeChild(this.element)}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(e){var t;switch(super._updateOptions(e),e){case"fontFamily":case"fontSize":null!=(t=this._renderService)&&t.clear(),null!=(t=this._charSizeService)&&t.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":null!=(t=this.viewport)&&t.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)):(null!=(t=this._accessibilityManager)&&t.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null==(e=this.textarea)?void 0:e.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){var e,t,i,r;this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing&&this._renderService&&(t=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(t))&&(r=Math.min(this.buffer.x,this.cols-1),e=this._renderService.dimensions.actualCellHeight,t=t.getWidth(r),t=this._renderService.dimensions.actualCellWidth*t,i=this.buffer.y*this._renderService.dimensions.actualCellHeight,r=r*this._renderService.dimensions.actualCellWidth,this.textarea.style.left=r+"px",this.textarea.style.top=i+"px",this.textarea.style.width=t+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5")}_initGlobal(){this._bindKeys(),this.register((0,c.addDisposableDomListener)(this.element,"copy",e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)}));var e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,c.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,c.addDisposableDomListener)(this.element,"paste",e)),l.isFirefox?this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,c.addDisposableDomListener)(this.element,"contextmenu",e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),l.isLinux&&this.register((0,c.addDisposableDomListener)(this.element,"auxclick",e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,c.addDisposableDomListener)(this.textarea,"keyup",e=>this._keyUp(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keydown",e=>this._keyDown(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keypress",e=>this._keyPress(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,c.addDisposableDomListener)(this.textarea,"input",e=>this._inputEvent(e),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);var e=M.createDocumentFragment(),t=(this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),e.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),e.appendChild(this.screenElement),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,c.addDisposableDomListener)(this.textarea,"focus",e=>this._onTextAreaFocus(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"blur",()=>this._onTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,null!=(t=this._document.defaultView)?t:window),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new p.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(e=>this._colorManager.onOptionsChange(e,this.optionsService.rawOptions[e]))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(R.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._createRenderer());this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,t,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(r.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(e),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(s.Viewport,e=>this.scrollLines(e,!0,1),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.onCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.onResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.onBlur())),this.register(this.onFocus(()=>this._renderService.onFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(e=>this._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>this._selectionService.onMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange(()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(e){var t;this._theme=e,null!=(t=this._colorManager)&&t.setTheme(e),null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}bindMouse(){let s=this,t=this.element;function i(i){var r=s._mouseService.getMouseReportCoords(i,s.screenElement);if(r){let e,t;switch(i.overrideType||i.type){case"mousemove":t=32,e=void 0===i.buttons?void 0!==i.button&&i.button<3?i.button:3:1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":t=0,e=i.button<3?i.button:3;break;case"mousedown":t=1,e=i.button<3?i.button:3;break;case"wheel":if(0===s.viewport.getLinesScrolled(i))return;t=i.deltaY<0?0:1,e=4;break;default:return}void 0===t||void 0===e||4(i(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(t.addEventListener("mousemove",r.mousemove),n.mousemove=r.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),n.wheel=r.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,c.addDisposableDomListener)(t,"mousedown",e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this.register((0,c.addDisposableDomListener)(t,"wheel",e=>{if(!n.wheel){if(this.buffer.hasScrollback)return this.viewport.onWheel(e)?this.cancel(e):void 0;{var i=this.viewport.getLinesScrolled(e);if(0===i)return;var r=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let t="";for(let e=0;e{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(e),this.cancel(e)},{passive:!0})),this.register((0,c.addDisposableDomListener)(t,"touchmove",e=>this.coreMouseService.areMouseEventsActive||this.viewport.onTouchMove(e)?void 0:this.cancel(e),{passive:!1}))}refresh(e,t){var i;null!=(i=this._renderService)&&i.refreshRows(e,t)}updateCursorStyle(e){var t;null!=(t=this._selectionService)&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(this._characterJoinerService)return e=this._characterJoinerService.register(e),this.refresh(0,this.rows-1),e;throw new Error("Terminal must be opened first")}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;null!=(e=this._selectionService)&&e.clearSelection()}selectAll(){var e;null!=(e=this._selectionService)&&e.selectAll()}selectLines(e,t){var i;null!=(i=this._selectionService)&&i.selectLines(e,t)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(t))return!1;let e=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!e&&!this._compositionHelper.keydown(t))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;e||"Dead"!==t.key&&"AltGraph"!==t.key||(this._unprocessedDeadKey=!0);var i=(0,f.evaluateKeyboardEvent)(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),3!==i.type&&2!==i.type)return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,t)||(i.cancel&&this.cancel(t,!0),!i.key)||!!(t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&1===t.key.length&&65<=t.key.charCodeAt(0)&&t.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?!(this._unprocessedDeadKey=!1):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(t,!0)));{let e=this.rows-1;return this.scrollLines(2===i.type?-e:e),this.cancel(t,!0)}}_isThirdLevelShift(e,t){e=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?e:e&&(!t.keyCode||47{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;i=Date.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=i-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){var e,t;void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t))}}},1680:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._activeBuffer=e.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(e=>this._renderDimensions=e)),setTimeout(()=>this.syncScrollArea(),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){e?(this._innerRefresh(),null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame)):null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(0this._smoothScroll()):this._clearSmoothScrollState())}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||0this._queueRefresh())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,n.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e)))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this.refreshDecorations(),this._animationFrame=void 0}))}refreshDecorations(){for(var e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t=document.createElement("div"),i=(t.classList.add("xterm-decoration"),t.style.width=Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)+"px",t.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",t.style.lineHeight=this._renderService.dimensions.actualCellHeight+"px",null!=(i=e.options.x)?i:0);return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(t){var i=t.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let e=this._decorationElements.get(t);e||(t.onDispose(()=>this._removeDecoration(t)),e=this._createElement(t),t.element=e,this._decorationElements.set(t,e),this._container.appendChild(e)),e.style.top=i*this._renderService.dimensions.actualCellHeight+"px",e.style.display=this._altBufferIsActive?"none":"block",t.onRenderEmitter.fire(e)}}_refreshXPosition(e,t=e.element){var i;t&&(i=null!=(i=e.options.x)?i:0,"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.actualCellWidth+"px":"":t.style.left=i?i*this._renderService.dimensions.actualCellWidth+"px":"")}_removeDecoration(e){var t;null!=(t=this._decorationElements.get(e))&&t.remove(),this._decorationElements.delete(e)}},i=r([s(1,h.IBufferService),s(2,h.IDecorationService),s(3,o.IRenderService)],i);t.BufferDecorationRenderer=i},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(var t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(e=>{"overviewRulerWidth"===e&&this._queueRefresh(!0)})),this.register((0,n.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>{this._queueRefresh(!0)})),this._queueRefresh(!0)}dispose(){var e;null!=(e=this._canvas)&&e.remove(),super.dispose()}_refreshDrawConstants(){var e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=e,_.center=t,_.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=_.left,d.right=_.left+_.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowseService.dpr);var e=this._canvas.height/this._bufferService.buffer.lines.length,e=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);c.left=e,c.center=e,c.right=e}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=this._width+"px",this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=this._screenElement.clientHeight+"px",this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(var t of e)"full"!==t.position&&this._renderColorZone(t);for(var i of e)"full"===i.position&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),_[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}},i=r([s(2,l.IBufferService),s(3,l.IDecorationService),s(4,o.IRenderService),s(5,l.IOptionsService),s(6,o.ICoreBrowserService)],i);t.OverviewRulerRenderer=i},2950:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{var e;this._isSendingComposition&&(this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,0<(e=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start)).length)&&this._coreService.triggerDataEvent(e,!0)},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let i=this._textarea.value;setTimeout(()=>{var e,t;this._isComposing||(t=(e=this._textarea.value).replace(i,""),this._dataAlreadySent=t,e.length>i.length?this._coreService.triggerDataEvent(t,!0):e.lengththis.updateCompositionElements(!0),0)}}},i=r([s(2,o.IBufferService),s(3,o.IOptionsService),s(4,o.ICoreService),s(5,n.IRenderService)],i);t.CompositionHelper=i},9806:(e,t)=>{function l(e,t,i){var r=i.getBoundingClientRect(),e=e.getComputedStyle(i),i=parseInt(e.getPropertyValue("padding-left")),e=parseInt(e.getPropertyValue("padding-top"));return[t.clientX-r.left-i,t.clientY-r.top-e]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=l,t.getCoords=function(e,t,i,r,s,n,o,a,h){return(n=n&&l(e,t,i))?(n[0]=Math.ceil((n[0]+(h?o/2:0))/o),n[1]=Math.ceil(n[1]/a),n[0]=Math.min(Math.max(n[0],1),r+(h?1:0)),n[1]=Math.min(Math.max(n[1],1),s),n):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;let r=i(2584);function f(e,t,i,r){var s=e-v(i,e),n=t-v(i,t);return S(Math.abs(s-n)-function(r,s,n){let o=0,a=r-v(n,r),e=s-v(n,s);for(let i=0;in.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),e=o=0,a++):!s&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),e=o=n.cols-1,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function p(e,t){t=t?"O":"[";return r.C0.ESC+t+e}function S(t,i){t=Math.floor(t);let r="";for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;i=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},1752:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(e)return e;throw new Error("value must not be falsy")},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||9472<=e&&e<=9631}},1296:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._onLinkHover(e))),this.register(this._linkifier2.onHideLinkUnderline(e=>this._onLinkLeave(e)))}get onRequestRedraw(){return(new l.EventEmitter).event}dispose(){this._element.classList.remove(u+this._terminalClass),(0,d.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*e,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*e),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/e),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/e),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(let e of this._rowElements)e.style.width=this.dimensions.canvasWidth+"px",e.style.height=this.dimensions.actualCellHeight+"px",e.style.lineHeight=this.dimensions.actualCellHeight+"px",e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"}setColors(e){this._colors=e,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;i=(i=(i=(i=(i+=`${this._terminalSelector} span:not(.${c.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${c.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${c.ITALIC_CLASS} { font-style: italic;}`)+"@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}")+"@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css}; } 50% {`+` background-color: ${this._colors.cursorAccent.css};`+` color: ${this._colors.cursor.css}; }}`)+`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}:not(.${c.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`)+`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach((e,t)=>{i+=`${this._terminalSelector} .xterm-fg-${t} { color: ${e.css}; }${this._terminalSelector} .xterm-bg-${t} { background-color: ${e.css}; }`}),i+=`${this._terminalSelector} .xterm-fg-${n.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${n.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=i}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(i,r,e){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(i,r,e),this.renderRows(0,this._bufferService.rows-1),i&&r){var s=i[1]-this._bufferService.buffer.ydisp,n=r[1]-this._bufferService.buffer.ydisp,o=Math.max(s,0),a=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||a<0)){var h=document.createDocumentFragment();if(e){let e=i[0]>r[0];h.appendChild(this._createSelectionElement(o,(e?r:i)[0],(e?i:r)[0],a-o+1))}else{let e=s===o?i[0]:0,t=o===n?r[0]:this._bufferService.cols;if(h.appendChild(this._createSelectionElement(o,e,t)),h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,a-o-1)),o!==a){let e=n===a?r[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(a,0,e))}}this._selectionContainer.appendChild(h)}}}_createSelectionElement(e,t,i,r=1){var s=document.createElement("div");return s.style.height=r*this.dimensions.actualCellHeight+"px",s.style.top=e*this.dimensions.actualCellHeight+"px",s.style.left=t*this.dimensions.actualCellWidth+"px",s.style.width=this.dimensions.actualCellWidth*(i-t)+"px",s}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(var e of this._rowElements)e.innerText=""}renderRows(e,t){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink;for(let s=e;s<=t;s++){let e=this._rowElements[s],t=(e.innerText="",s+this._bufferService.buffer.ydisp),i=this._bufferService.buffer.lines.get(t),r=this._optionsService.rawOptions.cursorStyle;e.appendChild(this._rowFactory.createRow(i,t,t===n,r,o,a,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return"."+u+this._terminalClass}_onLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_onLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(i,e,r,t,s,n){for(;i!==e||r!==t;){let e=this._rowElements[r];if(!e)return;let t=e.children[i];t&&(t.style.textDecoration=n?"underline":"none"),++i>=s&&(i=0,r++)}}};g=r([s(5,h.IInstantiationService),s(6,a.ICharSizeService),s(7,h.IOptionsService),s(8,h.IBufferService),s(9,a.ICoreBrowserService)],g),t.DomRenderer=g},3787:function(e,L,t){var i=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=e)&&p<=i&&(p=e),!this._coreService.isCursorHidden&&v&&e===p)switch(y.classList.add(L.CURSOR_CLASS),S&&y.classList.add(L.CURSOR_BLINK_CLASS),g){case"bar":y.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":y.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:y.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}if(r.isBold()&&y.classList.add(L.BOLD_CLASS),r.isItalic()&&y.classList.add(L.ITALIC_CLASS),r.isDim()&&y.classList.add(L.DIM_CLASS),r.isInvisible()?y.textContent=k.WHITESPACE_CELL_CHAR:y.textContent=r.getChars()||k.WHITESPACE_CELL_CHAR,r.isUnderline()&&(y.classList.add(L.UNDERLINE_CLASS+"-"+r.extended.underlineStyle)," "===y.textContent&&(y.innerHTML=" "),!r.isUnderlineColorDefault()))if(r.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(r.getUnderlineColor()).join(",")})`;else{let e=r.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&r.isBold()&&e<8&&(e+=8),y.style.textDecorationColor=this._colors.ansi[e].css}r.isStrikethrough()&&y.classList.add(L.STRIKETHROUGH_CLASS);let s=r.getFgColor(),n=r.getFgColorMode(),o=r.getBgColor(),a=r.getBgColorMode();var w=!!r.isInverse();if(w){let e=s,t=(s=o,o=e,n);n=a,a=t}let h,l,c=!1;this._decorationService.forEachDecorationAtCell(e,f,void 0,e=>{"top"!==e.options.layer&&c||(e.backgroundColorRGB&&(a=50331648,o=e.backgroundColorRGB.rgba>>8&16777215,h=e.backgroundColorRGB),e.foregroundColorRGB&&(n=50331648,s=e.foregroundColorRGB.rgba>>8&16777215,l=e.foregroundColorRGB),c="top"===e.options.layer)});var E=this._isCellInSelection(e,f);let _;switch(c||this._colors.selectionForeground&&E&&(n=50331648,s=this._colors.selectionForeground.rgba>>8&16777215,l=this._colors.selectionForeground),E&&(h=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,c=!0),c&&y.classList.add("xterm-decoration-top"),a){case 16777216:case 33554432:_=this._colors.ansi[o],y.classList.add("xterm-bg-"+o);break;case 50331648:_=D.rgba.toColor(o>>16,o>>8&255,255&o),this._addStyle(y,"background-color:#"+B((o>>>0).toString(16),"0",6));break;default:w?(_=this._colors.foreground,y.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)):_=this._colors.background}switch(h||r.isDim()&&(h=D.color.multiplyOpacity(_,.5)),n){case 16777216:case 33554432:r.isBold()&&s<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(s+=8),this._applyMinimumContrast(y,_,this._colors.ansi[s],r,h,void 0)||y.classList.add("xterm-fg-"+s);break;case 50331648:let e=D.rgba.toColor(s>>16&255,s>>8&255,255&s);this._applyMinimumContrast(y,_,e,r,h,l)||this._addStyle(y,"color:#"+B(s.toString(16),"0",6));break;default:this._applyMinimumContrast(y,_,this._colors.foreground,r,h,void 0)||w&&y.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}C.appendChild(y),e=i}}return C}_applyMinimumContrast(e,t,i,r,s,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,h.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o;return void 0===(o=s||n?o:this._colors.contrastCache.getColor(t.rgba,i.rgba))&&(o=D.color.ensureContrastRatio(s||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((s||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,"color:"+o.css),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){var i=this._selectionStart,r=this._selectionEnd;return!(!i||!r)&&(this._columnSelectMode?i[0]<=r[0]?i[0]<=e&&i[1]<=t&&ei[1]&&t{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){var e;return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0}areSelectionValuesReversed(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&t[0]{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=this._renderService.dimensions.canvasWidth||e[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(e[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(e[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(e[0]),y:Math.floor(e[1])}}},i=r([s(0,n.IRenderService),s(1,n.ICharSizeService)],i);t.MouseService=i},3230:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._renderer.dispose()}),this._renderDebouncer=new h.RenderDebouncer(a.window,(e,t)=>this._renderRows(e,t)),this.register(this._renderDebouncer),this._screenDprMonitor=new c.ScreenDprMonitor(a.window),this._screenDprMonitor.setListener(()=>this.onDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(o.onResize(()=>this._fullRefresh())),this.register(o.buffers.onBufferActivate(()=>{var e;return null==(e=this._renderer)?void 0:e.clear()})),this.register(r.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.onCharSizeChanged())),this.register(n.onDecorationRegistered(()=>this._fullRefresh())),this.register(n.onDecorationRemoved(()=>this._fullRefresh())),this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this.register((0,_.addDisposableDomListener)(a.window,"resize",()=>this.onDevicePixelRatioChange())),"IntersectionObserver"in a.window){let e=new a.window.IntersectionObserver(e=>this._onIntersectionChange(e[e.length-1]),{threshold:0});e.observe(i),this.register({dispose:()=>e.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(e){this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;null!=(t=null==(e=this._renderer)?void 0:e.clearTextureAtlas)&&t.call(e),this._fullRefresh()}setColors(e){this._renderer.setColors(e),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(e,t){this._renderer.onResize(e,t),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}},i=r([s(3,o.IOptionsService),s(4,a.ICharSizeService),s(5,o.IDecorationService),s(6,o.IBufferService),s(7,a.ICoreBrowserService)],i);t.RenderService=i},9312:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._onMouseMove(e),this._mouseUpListener=e=>this._onMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._onTrim(e)),this.register(this._bufferService.buffers.onBufferActivate(e=>this._onBufferActivate(e))),this.enable(),this._model=new l.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;if(!e||!s)return"";var n=this._bufferService.buffer,o=[];if(3===this._activeSelectionMode){if(e[0]===s[0])return"";let i=(e[0]e.replace(g," ")).join(a.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){var e=this._getMouseBufferCoords(e),t=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(t&&i&&e)&&this._areCoordsInSelection(e,t,i)}isCellInSelection(e,t){var i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection([e,t],i,r)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]e&&(t-=e),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return a.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}onMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_onIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_onSingleClick(e){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart&&(this._model.selectionEnd=void 0,e=this._bufferService.buffer.lines.get(this._model.selectionStart[1]))&&e.length!==this._model.selectionStart[0]&&0===e.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_onDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_onTripleClick(e){e=this._getMouseBufferCoords(e);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))}shouldColumnSelect(e){return e.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]this._onTrim(e))}_convertViewportColToCharacterIndex(t,i){let r=i[0];for(let e=0;i[0]>=e;e++){var s=t.loadCell(e,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:1=this._bufferService.cols)){var d=this._bufferService.buffer,u=d.lines.get(c[1]);if(u){var f=d.translateBufferLineToString(c[1],!1);let r=this._convertViewportColToCharacterIndex(u,c),s=r;var v=c[0]-r;let n=0,o=0,a=0,h=0;if(" "===f.charAt(r)){for(;0this._bufferService.cols;)i.length-=this._bufferService.cols,e++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,e]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&0<=this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())}_selectLineAt(e){var e=this._bufferService.buffer.getWrappedRangeForLine(e),t={start:{x:0,y:e.first},end:{x:this._bufferService.cols-1,y:e.last}};this._model.selectionStart=[0,e.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(t,this._bufferService.cols)}},i=r([s(3,o.IBufferService),s(4,o.ICoreService),s(5,n.IMouseService),s(6,o.IOptionsService),s(7,n.IRenderService),s(8,n.ICoreBrowserService)],i);t.SelectionService=i},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;i=i(8343);t.ICharSizeService=(0,i.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,i.createDecorator)("CoreBrowserService"),t.IMouseService=(0,i.createDecorator)("MouseService"),t.IRenderService=(0,i.createDecorator)("RenderService"),t.ISelectionService=(0,i.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,i.createDecorator)("CharacterJoinerService")},6349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;let r=i(8460);t.CircularList=class{constructor(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter,this.onInsertEmitter=new r.EventEmitter,this.onTrimEmitter=new r.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(t){if(this._maxLength!==t){var i=new Array(t);for(let e=0;ethis._length)for(let e=this._length;e=t;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;ethis._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(t,i,r){if(!(i<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;var r,s=Array.isArray(t)?[]:{};for(r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{var a,c,o,i;function s(e){e=e.toString(16);return e.length<2?"0"+e:e}function _(e,t){return e>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l>>0}function l(e,t,i){var r=e>>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l>>0}function r(e,t,i){e/=255,t/=255,i/=255;return.2126*(e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((.055+i)/1.055,2.4))}function n(e,t){var t=Math.round(255*t),[e,i,r]=o.toChannels(e.rgba);return{css:a.toCss(e,i,r,t),rgba:a.toRgba(e,i,r,t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,(i=a=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+s(e)+s(t)+s(i)+s(r):"#"+s(e)+s(t)+s(i)},i.toRgba=function(e,t,i,r=255){return(e<<24|t<<16|i<<8|r)>>>0},(i=t.color||(t.color={})).blend=function(e,t){var i,r,s,n,o=(255&t.rgba)/255;return 1==o?{css:t.css,rgba:t.rgba}:(n=t.rgba>>16&255,i=t.rgba>>8&255,s=e.rgba>>24&255,r=e.rgba>>16&255,e=e.rgba>>8&255,t=s+Math.round(((t.rgba>>24&255)-s)*o),s=r+Math.round((n-r)*o),n=e+Math.round((i-e)*o),{css:a.toCss(t,s,n),rgba:a.toRgba(t,s,n)})},i.isOpaque=function(e){return 255==(255&e.rgba)},i.ensureContrastRatio=function(e,t,i){e=o.ensureContrastRatio(e.rgba,t.rgba,i);if(e)return o.toColor(e>>24&255,e>>16&255,e>>8&255)},i.opaque=function(e){var e=(255|e.rgba)>>>0,[t,i,r]=o.toChannels(e);return{css:a.toCss(t,i,r),rgba:e}},i.opacity=n,i.multiplyOpacity=function(e,t){return n(e,(255&e.rgba)*t/255)},i.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]},(t.css||(t.css={})).toColor=function(s){if(s.match(/#[0-9a-f]{3,8}/i))switch(s.length){case 4:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16);return o.toColor(e,t,i)}case 5:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16),r=parseInt(s.slice(4,5).repeat(2),16);return o.toColor(e,t,i,r)}case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let n=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n){let e=parseInt(n[1]),t=parseInt(n[2]),i=parseInt(n[3]),r=Math.round(255*(void 0===n[5]?1:parseFloat(n[5])));return o.toColor(e,t,i,r)}throw new Error("css.toColor: Unsupported css format")},(i=c=t.rgb||(t.rgb={})).relativeLuminance=function(e){return r(e>>16&255,e>>8&255,255&e)},i.relativeLuminance2=r,(i=o=t.rgba||(t.rgba={})).ensureContrastRatio=function(r,s,n){let o=c.relativeLuminance(r>>8),e=c.relativeLuminance(s>>8);if(_(o,e)>8));if(i_(o,c.relativeLuminance(e>>8))?t:e}return t}var t=l(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i_(o,c.relativeLuminance(e>>8))?t:e}return t}},i.reduceLuminance=h,i.increaseLuminance=l,i.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},i.toColor=function(e,t,i,r){return{css:a.toCss(e,t,i,r),rgba:a.toRgba(e,t,i,r)}},t.toPaddedHex=s,t.contrastRatio=_},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;let r=i(844),s=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),l=i(6975),c=i(8460),_=i(1753),d=i(3730),u=i(1480),f=i(7994),v=i(9282),g=i(5435),p=i(5981),S=i(2660),m=!1;class C extends r.Disposable{constructor(e){super(),this._onBinary=new c.EventEmitter,this._onData=new c.EventEmitter,this._onLineFeed=new c.EventEmitter,this._onResize=new c.EventEmitter,this._onScroll=new c.EventEmitter,this._onWriteParsed=new c.EventEmitter,this._instantiationService=new n.InstantiationService,this.optionsService=new h.OptionsService(e),this._instantiationService.setService(s.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(s.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(o.LogService),this._instantiationService.setService(s.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService,()=>this.scrollToBottom())),this._instantiationService.setService(s.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(_.CoreMouseService),this._instantiationService.setService(s.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(d.DirtyRowService),this._instantiationService.setService(s.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(u.UnicodeService),this._instantiationService.setService(s.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(s.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(s.IOscLinkService,this._oscLinkService),this._inputHandler=new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange(e=>this._updateOptions(e))),this.register(this._bufferService.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=new p.WriteBuffer((e,t)=>this._inputHandler.parse(e,t)),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new c.EventEmitter,this.register(this._onScroll.event(e=>{var t;null!=(t=this._onScrollApi)&&t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(var t in e)this.optionsService.options[t]=e[t]}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._windowsMode)&&e.dispose(),this._windowsMode=void 0)}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=s.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():(null!=(t=this._windowsMode)&&t.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){let t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsMode={dispose:()=>{for(var e of t)e.dispose()}}}}}t.CoreTerminal=C},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let e=0;et.fire(e))}},5435:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let d=i(2584),c=i(7116),_=i(2015),r=i(844),u=i(482),f=i(8437),v=i(8460),g=i(643),p=i(511),n=i(3734),a=i(2585),S=i(6242),m=i(6351),s=i(5941),o={"(":0,")":1,"*":2,"+":3,"-":1,".":2},h=131072;function l(e,t){if(24this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})}),this._parser.setDcsHandlerFallback((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})}),this._parser.setPrintHandler((e,t,i)=>this.print(e,t,i)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new S.OscHandler(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new S.OscHandler(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new S.OscHandler(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new S.OscHandler(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new S.OscHandler(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new S.OscHandler(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new S.OscHandler(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new S.OscHandler(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new S.OscHandler(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new S.OscHandler(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new S.OscHandler(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new S.OscHandler(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let e in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},()=>this.selectCharset("("+e)),this._parser.registerEscHandler({intermediates:")",final:e},()=>this.selectCharset(")"+e)),this._parser.registerEscHandler({intermediates:"*",final:e},()=>this.selectCharset("*"+e)),this._parser.registerEscHandler({intermediates:"+",final:e},()=>this.selectCharset("+"+e)),this._parser.registerEscHandler({intermediates:"-",final:e},()=>this.selectCharset("-"+e)),this._parser.registerEscHandler({intermediates:".",final:e},()=>this.selectCharset("."+e)),this._parser.registerEscHandler({intermediates:"/",final:e},()=>this.selectCharset("/"+e));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(e,t,i,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}parse(r,e){let s,n=this._activeBuffer.x,o=this._activeBuffer.y,t=0,i=this._parseStack.paused;if(i){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(s),s;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,r.length>h&&(t=this._parseStack.position+h)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof r?` "${r}"`:` "${Array.prototype.map.call(r,e=>String.fromCharCode(e)).join("")}"`),"string"==typeof r?r.split("").map(e=>e.charCodeAt(0)):r),this._parseBuffer.lengthh)for(let i=t;i=h)if(l){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=h-1,2===n)continue;if(c&&(d.insertCells(this._activeBuffer.x,n,this._activeBuffer.getNullCell(_),_),2===d.getWidth(h-1))&&d.setCellFromCodePoint(h-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,_.fg,_.bg,_.extended),d.setCellFromCodePoint(this._activeBuffer.x++,s,n,_.fg,_.bg,_.extended),0!l(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new S.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return!(this._activeBuffer.x=0)}backspace(){var e;if(this._coreService.decPrivateModes.reverseWraparound){if(this._restrictCursor(this._bufferService.cols),0this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&null!=(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))&&e.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}this._restrictCursor()}else this._restrictCursor(),0=this._bufferService.cols||(e=this._activeBuffer.x,this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e)),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){var t=this._activeBuffer.y-this._activeBuffer.scrollTop;return 0<=t?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){var t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return 0<=t?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),!(this._activeBuffer.x=0)}cursorPrecedingLine(e){return this.cursorUp(e),!(this._activeBuffer.x=0)}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){e=e.params[0];return 0===e?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===e&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop()}return!0}cursorBackwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop()}return!0}selectProtected(e){e=e.params[0];return 1===e&&(this._curAttrData.bg|=536870912),2!==e&&0!==e||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,r=!1,s=!1){e=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);e.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),s),r&&(e.isWrapped=!1)}_resetBufferLine(e,t=!1){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowService.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;0this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(t){for(let e=0;ee?1:2,e=e.params[0],_=e,a=t?2===e?3:4===e?c(n.modes.insertMode):12===e?4:20===e?c(l.convertEol):0:1===e?c(i.applicationCursorKeys):3===e?l.windowOptions.setWinLines?80===a?2:132===a?1:0:0:6===e?c(i.origin):7===e?c(i.wraparound):8===e?3:9===e?"X10"===r?1:2:12===e?c(l.cursorBlink):25===e?c(!n.isCursorHidden):45===e?c(i.reverseWraparound):66===e?c(i.applicationKeypad):1e3===e?"VT200"===r?1:2:1002===e?"DRAG"===r?1:2:1003===e?"ANY"===r?1:2:1004===e?c(i.sendFocus):1005===e?4:1006===e?"SGR"===s?1:2:1015===e?4:1016===e?"SGR_PIXELS"===s?1:2:1048===e?1:47===e||1047===e||1049===e?o===h?1:2:2004===e?c(i.bracketedPasteMode):0;return n.triggerDataEvent(d.C0.ESC+`[${t?"":"?"}${_};${a}$y`),!0}_updateAttrColor(e,t,i,r,s){return 2===t?e=(e=(e|50331648)&-16777216)|n.AttributeData.fromColorRGB([i,r,s]):5===t&&(e=e&-50331904|(33554432|255&i)),e}_extractColor(i,r,e){var s=[0,0,-1,0,0,0];let n=0,o=0;do{if(s[o+n]=i.params[r+o],i.hasSubParams(r+o)){let e=i.getSubParams(r+o),t=0;for(;5===s[1]&&(n=1),s[o+t+1+n]=e[t],++tthis._bufferService.rows||0===i?this._bufferService.rows:i)>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(l(e.params[0],this._optionsService.rawOptions.windowOptions)){var t=1e.startsWith("id="));return-1!==r&&(i=e[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!(this._currentLinkId=void 0)}_setOrReportSpecialColor(e,t){var i,r=e.split(";");for(let e=0;e=this._specialColors.length);++e,++t)"?"===r[e]?this._onColor.fire([{type:0,index:this._specialColors[t]}]):(i=(0,s.parseColor)(r[e]))&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}]);return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(e){var t,i=[],r=e.split(";");for(let e=0;e=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0}reverseIndex(){var e;return this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop?(e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop,this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)):(this._activeBuffer.y--,this._restrictCursor()),!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){var t=new p.CellData;t.content=1<<22|"E".charCodeAt(0),t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e{function i(e){for(var t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(var e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){e=this._disposables.indexOf(e);-1!==e&&this._disposables.splice(e,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,i,r,s){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(i,r,s)}get(e,t,i,r){return null==(e=this._data.get(e,t))?void 0:e.get(i,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=void 0;var i="undefined"==typeof navigator,r=i?"node":navigator.userAgent,i=i?"node":navigator.platform;t.isFirefox=r.includes("Firefox"),t.isLegacyEdge=r.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(r),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i),t.isIpad="iPad"===i,t.isIphone="iPhone"===i,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(i),t.isLinux=0<=i.indexOf("Linux")},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0!==this._array.length){var t=this._getKey(e);if(void 0!==t&&-1!==(i=this._search(t,0,this._array.length-1))&&this._getKey(this._array[i])===t)do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i=this._array.length)&&this._getKey(this._array[i])===e)for(;yield this._array[i],++i=this._array.length)&&this._getKey(this._array[i])===e)for(;t(this._array[i]),++i{function s(t,i,r=0,s=t.length){if(!(r>=t.length)){s=t.length<=s?t.length:(t.length+s)%t.length;for(let e=r=(t.length+r)%t.length;e{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=i(643);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),t=null==t?void 0:t.get(e.cols-1),e=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);e&&t&&(e.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;t.AttributeData=class r{constructor(){this.fg=0,this.bg=0,this.extended=new i}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){var e=new r;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}};class i{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new i(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=i},9092:(e,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferStringIterator=i.Buffer=i.MAX_BUFFER_SIZE=void 0;let r=t(6349),S=t(8437),s=t(511),n=t(643),m=t(4634),o=t(4863),a=t(7116),h=t(3734);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=s.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,n.WHITESPACE_CELL_CHAR,n.WHITESPACE_CELL_WIDTH,n.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new S.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&ei.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t:e}fillViewportRows(t){if(0===this.lines.length){void 0===t&&(t=S.DEFAULT_ATTR_DATA);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,r){var s=this.getNullCell(S.DEFAULT_ATTR_DATA),n=this._getCorrectBufferLength(r);if(n>this.lines.maxLength&&(this.lines.maxLength=n),0r;e--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(ni))for(let e=0;ethis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){var i=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));0=n&&ds+a){for(let e=o.newLines.length-1;0<=e;e--)this.lines.set(t--,o.newLines[e]);t++,i.push({index:s+1,amount:o.newLines.length}),a+=o.newLines.length,o=l[++n]}else this.lines.set(t,r[s--]);let t=0;for(let e=i.length-1;0<=e;e--)i[e].index+=t,this.lines.onInsertEmitter.fire(i[e]),t+=i[e].amount;var p=Math.max(0,e+c-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(t){this._isClearing=!0;for(let e=0;e{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,r,s){return new l(this,e,t,i,r,s)}};class l{constructor(e,t,i=0,r=e.lines.length,s=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=s,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);let i="";for(let e=t.first;e<=t.last;++e)i+=this._buffer.translateBufferLineToString(e,this._trimRight);return this._current=t.last+1,{range:t,content:i}}}i.BufferStringIterator=l},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let s=i(482),n=i(643),o=i(511),a=i(3734),r=(t.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData),{startIndex:0});t.BufferLine=class h{constructor(t,e,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);var r=e||o.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let e=0;e>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],1>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return r.startIndex=3*e,t.content=this._data[r.startIndex+0],t.fg=this._data[r.startIndex+1],t.bg=this._data[r.startIndex+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,r,s,n){268435456&s&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=s}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(i=2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),-2097152&i|2097152):t|1<<22,this._data[3*e+0]=i)}insertCells(i,r,s,e){if((i%=this.length)&&2===this.getWidth(i-1)&&this.setCellFromCodePoint(i-1,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs),rthis.length){var e=new Uint32Array(3*t);this.length&&(3*t>22);return 0}copyCellsFrom(i,r,s,e,t){var n=i._data;if(t)for(let t=e-1;0<=t;t--){for(let e=0;e<3;e++)this._data[3*(s+t)+e]=n[3*(r+t)+e];268435456&n[3*(r+t)+2]&&(this._extendedAttrs[s+t]=i._extendedAttrs[r+t])}else for(let t=0;t=r&&(this._combined[e-r+s]=i._combined[e])}}translateToString(e=!1,i=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let r="";for(;i>22||1}return r}}},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function u(e,t,i){var r;return t===e.length-1?e[t].getTrimmedLength():(r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),e=2===e[t+1].getWidth(0),r&&e?i-1:i)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(r,h,l,s,c){let _=[];for(let i=0;i=i&&ss||0===d[e].getTrimmedLength());e--)t++;0u(i,t,r)).reduce((e,t)=>e+t);let n=0,o=0,a=0;for(;ah&&(n-=h,o++),2===i[o].getWidth(n-1)),h=(h&&n--,h?e-1:e);t.push(h),a+=h}return t},t.getWrappedLineTrimmedLength=u},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;let r=i(9092),s=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new s.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=i(482),s=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){var t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;var i,r;2{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;let r=i(8460),s=i(844);class n extends s.Disposable{constructor(e){super(),this.line=e,this._id=n._nextId++,this.isDisposed=!1,this._onDispose=new r.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}(t.Marker=n)._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,(r=i=t.C0||(t.C0={})).NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL="",(r=t.C1||(t.C1={})).PAD="€",r.HOP="",r.BPH="‚",r.NBH="ƒ",r.IND="„",r.NEL="…",r.SSA="†",r.ESA="‡",r.HTS="ˆ",r.HTJ="‰",r.VTS="Š",r.PLD="‹",r.PLU="Œ",r.RI="",r.SS2="Ž",r.SS3="",r.DCS="",r.PU1="‘",r.PU2="’",r.STS="“",r.CCH="”",r.MW="•",r.SPA="–",r.EPA="—",r.SOS="˜",r.SGCI="™",r.SCI="š",r.CSI="›",r.ST="œ",r.OSC="",r.PM="ž",r.APC="Ÿ",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=i.ESC+"\\"},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;let o=i(2584),a={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(i,e,t,r){var s={type:0,cancel:!1,key:void 0},n=(i.shiftKey?1:0)|(i.altKey?2:0)|(i.ctrlKey?4:0)|(i.metaKey?8:0);switch(i.keyCode){case 0:"UIKeyInputUpArrow"===i.key?s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A":"UIKeyInputLeftArrow"===i.key?s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D":"UIKeyInputRightArrow"===i.key?s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C":"UIKeyInputDownArrow"===i.key&&(s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 8:i.altKey?s.key=o.C0.ESC+o.C0.DEL:s.key=o.C0.DEL;break;case 9:i.shiftKey?s.key=o.C0.ESC+"[Z":(s.key=o.C0.HT,s.cancel=!0);break;case 13:s.key=i.altKey?o.C0.ESC+o.C0.CR:o.C0.CR,s.cancel=!0;break;case 27:s.key=o.C0.ESC,i.altKey&&(s.key=o.C0.ESC+o.C0.ESC),s.cancel=!0;break;case 37:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"D",s.key===o.C0.ESC+"[1;3D"&&(s.key=o.C0.ESC+(t?"b":"[1;5D"))):s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D");break;case 39:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"C",s.key===o.C0.ESC+"[1;3C"&&(s.key=o.C0.ESC+(t?"f":"[1;5C"))):s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C");break;case 38:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"A",t||s.key!==o.C0.ESC+"[1;3A"||(s.key=o.C0.ESC+"[1;5A")):s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A");break;case 40:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"B",t||s.key!==o.C0.ESC+"[1;3B"||(s.key=o.C0.ESC+"[1;5B")):s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 45:i.shiftKey||i.ctrlKey||(s.key=o.C0.ESC+"[2~");break;case 46:s.key=n?o.C0.ESC+"[3;"+(1+n)+"~":o.C0.ESC+"[3~";break;case 36:s.key=n?o.C0.ESC+"[1;"+(1+n)+"H":e?o.C0.ESC+"OH":o.C0.ESC+"[H";break;case 35:s.key=n?o.C0.ESC+"[1;"+(1+n)+"F":e?o.C0.ESC+"OF":o.C0.ESC+"[F";break;case 33:i.shiftKey?s.type=2:s.key=i.ctrlKey?o.C0.ESC+"[5;"+(1+n)+"~":o.C0.ESC+"[5~";break;case 34:i.shiftKey?s.type=3:s.key=i.ctrlKey?o.C0.ESC+"[6;"+(1+n)+"~":o.C0.ESC+"[6~";break;case 112:s.key=n?o.C0.ESC+"[1;"+(1+n)+"P":o.C0.ESC+"OP";break;case 113:s.key=n?o.C0.ESC+"[1;"+(1+n)+"Q":o.C0.ESC+"OQ";break;case 114:s.key=n?o.C0.ESC+"[1;"+(1+n)+"R":o.C0.ESC+"OR";break;case 115:s.key=n?o.C0.ESC+"[1;"+(1+n)+"S":o.C0.ESC+"OS";break;case 116:s.key=n?o.C0.ESC+"[15;"+(1+n)+"~":o.C0.ESC+"[15~";break;case 117:s.key=n?o.C0.ESC+"[17;"+(1+n)+"~":o.C0.ESC+"[17~";break;case 118:s.key=n?o.C0.ESC+"[18;"+(1+n)+"~":o.C0.ESC+"[18~";break;case 119:s.key=n?o.C0.ESC+"[19;"+(1+n)+"~":o.C0.ESC+"[19~";break;case 120:s.key=n?o.C0.ESC+"[20;"+(1+n)+"~":o.C0.ESC+"[20~";break;case 121:s.key=n?o.C0.ESC+"[21;"+(1+n)+"~":o.C0.ESC+"[21~";break;case 122:s.key=n?o.C0.ESC+"[23;"+(1+n)+"~":o.C0.ESC+"[23~";break;case 123:s.key=n?o.C0.ESC+"[24;"+(1+n)+"~":o.C0.ESC+"[24~";break;default:if(!i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)if(t&&!r||!i.altKey||i.metaKey)!t||i.altKey||i.ctrlKey||i.shiftKey||!i.metaKey?i.key&&!i.ctrlKey&&!i.altKey&&!i.metaKey&&48<=i.keyCode&&1===i.key.length?s.key=i.key:i.key&&i.ctrlKey&&("_"===i.key&&(s.key=o.C0.US),"@"===i.key)&&(s.key=o.C0.NUL):65===i.keyCode&&(s.type=1);else{let e=a[i.keyCode],t=null==e?void 0:e[i.shiftKey?1:0];if(t)s.key=o.C0.ESC+t;else if(65<=i.keyCode&&i.keyCode<=90){let e=i.ctrlKey?i.keyCode-64:i.keyCode+32,t=String.fromCharCode(e);i.shiftKey&&(t=t.toUpperCase()),s.key=o.C0.ESC+t}else if("Dead"===i.key&&i.code.startsWith("Key")){let e=i.code.slice(3,4);i.shiftKey||(e=e.toLowerCase()),s.key=o.C0.ESC+e,s.cancel=!0}}else 65<=i.keyCode&&i.keyCode<=90?s.key=String.fromCharCode(i.keyCode-64):32===i.keyCode?s.key=o.C0.NUL:51<=i.keyCode&&i.keyCode<=55?s.key=String.fromCharCode(i.keyCode-51+27):56===i.keyCode?s.key=o.C0.DEL:219===i.keyCode?s.key=o.C0.ESC:220===i.keyCode?s.key=o.C0.FS:221===i.keyCode&&(s.key=o.C0.GS)}return s}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(i,e=0,r=i.length){let s="";for(let t=e;t>10))+String.fromCharCode(e%1024+56320)):s+=String.fromCharCode(e)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(i,r){let s=i.length;if(!s)return 0;let n=0,o=0;if(this._interim){let e=i.charCodeAt(o++);56320<=e&&e<=57343?r[n++]=1024*(this._interim-55296)+e-56320+65536:(r[n++]=this._interim,r[n++]=e),this._interim=0}for(let t=o;t=s)return this._interim=e,n;var a=i.charCodeAt(t);56320<=a&&a<=57343?r[n++]=1024*(e-55296)+a-56320+65536:(r[n++]=e,r[n++]=a)}else 65279!==e&&(r[n++]=e)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,a){var h=o.length;if(!h)return 0;let e,t,i,r,l=0,s=0,c=0;if(this.interim[0]){let e=!1,t=this.interim[0];t&=192==(224&t)?31:224==(240&t)?15:7;let i,r=0;for(;(i=63&this.interim[++r])&&r<4;)t=(t<<=6)|i;let s=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,n=s-r;for(;c=h)return 0;if(128!=(192&(i=o[c++]))){c--,e=!0;break}this.interim[r++]=i,t=(t<<=6)|63&i}e||(2==s?t<128?c--:a[l++]=t:3==s?t<2048||55296<=t&&t<=57343||65279===t||(a[l++]=t):t<65536||1114111=h)return this.interim[0]=e,l;128!=(192&(t=o[_++]))?_--:(s=(31&e)<<6|63&t)<128?_--:a[l++]=s}else if(224==(240&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;128!=(192&(i=o[_++]))?_--:(s=(15&e)<<12|(63&t)<<6|63&i)<2048||55296<=s&&s<=57343||65279===s||(a[l++]=s)}}else if(240==(248&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;if(128!=(192&(i=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,this.interim[2]=i,l;128!=(192&(r=o[_++]))?_--:(s=(7&e)<<18|(63&t)<<12|(63&i)<<6|63&r)<65536||1114111{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;let r=i(8273),s=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,r.fill)(o,1),(o[0]=0,r.fill)(o,0,1,32),(0,r.fill)(o,0,127,160),(0,r.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,r.fill)(o,2,11904,42192),o[12351]=1,(0,r.fill)(o,2,44032,55204),(0,r.fill)(o,2,63744,64256),(0,r.fill)(o,2,65040,65050),(0,r.fill)(o,2,65072,65136),(0,r.fill)(o,2,65280,65377),(0,r.fill)(o,2,65504,65511);for(let e=0;et[s][1]))for(;s>=r;)if(e>t[i=r+s>>1][1])r=1+i;else{if(!(e{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;let r=i(8460),n="undefined"==typeof queueMicrotask?e=>{Promise.resolve().then(e)}:queueMicrotask;t.WriteBuffer=class{constructor(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new r.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)this._syncCalls=0;else if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}}write(e,t){if(5e7this._innerWrite())),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,i=!0){let r=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],t=this._action(e,i);if(t){let e=e=>12<=Date.now()-r?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);return void t.catch(e=>(n(()=>{throw e}),Promise.resolve(!1))).then(e)}var s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,12<=Date.now()-r)break}this._writeBuffer.length>this._bufferOffset?(50this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;let i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,n=/^[\da-f]+$/;function s(e,t){var i=e.toString(16),r=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(e){let r=e.toLowerCase();if(0===r.indexOf("rgb:")){r=r.slice(4);let t=i.exec(r);if(t){let e=t[1]?15:t[4]?255:t[7]?4095:65535;return[Math.round(parseInt(t[1]||t[4]||t[7]||t[10],16)/e*255),Math.round(parseInt(t[2]||t[5]||t[8]||t[11],16)/e*255),Math.round(parseInt(t[3]||t[6]||t[9]||t[12],16)/e*255)]}}else if(0===r.indexOf("#")&&(r=r.slice(1),n.exec(r))&&[3,6,9,12].includes(r.length)){let t=r.length/3,i=[0,0,0];for(let e=0;e<3;++e){var s=parseInt(r.slice(t*e,t*e+t),16);i[e]=1==t?s<<4:2==t?s:3==t?s>>4:s>>8}return i}}},t.toRgbString=function(e,t=16){var[e,i,r]=e;return`rgb:${s(e,t)}/${s(i,t)}/`+s(r,t)}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;let s=i(482),r=i(8742),n=i(5770),o=[],a=(t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(t,i,r))}unhook(r,s=!0){if(this._active.length){let e=!1,t=this._active.length-1,i=!1;if(this._stack.paused&&(t=this._stack.loopPosition-1,e=s,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===e){for(;0<=t&&!0!==(e=this._active[t].unhook(r));t--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!1,e;t--}for(;0<=t;t--)if((e=this._active[t].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",r);this._active=o,this._ident=0}},new r.Params);a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=1n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params))instanceof Promise)return t.then(e=>(this._params=a,this._data="",this._hitLimit=!1,e));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=i(844),s=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,s.fill)(this.table,e<<4|t)}add(e,t,i,r){this.table[t<<8|e]=i<<4|r}addMany(t,i,r,s){for(let e=0;et),t=(e,t)=>i.slice(e,t),r=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var n=t(0,14);let o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(t(128,144),o,3,0),e.addMany(t(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(_,0,2,0),e.add(_,8,5,8),e.add(_,6,0,6),e.add(_,11,0,11),e.add(_,13,13,13),e}();class l extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new o.OscParser,this._dcsParser=new a.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,e=[64,126]){let r=0;if(i.prefix){if(1t||t>e[1])throw new Error(`final must be in range ${e[0]} .. `+e[1]);return r=(r<<=8)|t}identToString(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){e=this._identifier(e,[48,126]);void 0===this._escHandlers[e]&&(this._escHandlers[e]=[]);let i=this._escHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){e=this._identifier(e);void 0===this._csiHandlers[e]&&(this._csiHandlers[e]=[]);let i=this._csiHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,(this.precedingCodepoint=0)!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(s,n,i){let o,a=0,h=0,l=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let e=this._parseStack.handlers,t=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&-1>4){case 2:for(let e=r+1;;++e){if(e>=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||24===(a=s[e])||26===a||27===a||127=n||(a=s[e])<32||127{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;let r=i(5770),s=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._id,"PUT",(0,s.utf32ToString)(t,i,r))}start(){this.reset(),this._state=1}put(t,i,e){if(3!==this._state){if(1===this._state)for(;ir.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data))instanceof Promise)return t.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;let s=2147483647;class n{constructor(e=32,t=32){if(this.maxLength=e,256<(this.maxSubParamsLength=t))throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){var r=new n;if(i.length)for(let e=Array.isArray(i[0])?1:0;e>8,r=255&this._subParamsIdx[e];0=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>s?s:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>s?s:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return 0<(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)}getSubParams(e){var t=this._subParamsIdx[e]>>8,e=255&this._subParamsIdx[e];return 0>8,r=255&this._subParamsIdx[e];0{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;0<=e;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(i){if(!i.isDisposed){let t=-1;for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;let r=i(3785),s=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){e=this._buffer.lines.get(e);if(e)return new r.BufferLineApiView(e)}getNullCell(){return new s.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;let r=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;let r=i(8771),s=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new s.EventEmitter,this._normal=new r.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new r.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get onBufferChange(){return this._onBufferChange.event}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,t)=>i(e,t.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=r.ybase&&(this.isUserScrolling=!1);var s=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),s===r.ydisp||t||this._onScroll.fire(r.ydisp)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){e-=this.buffer.ydisp;0!=e&&this.scrollLines(e)}},i=r([s(0,n.IOptionsService)],i);t.BufferService=i},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,!(e.shift=!1))},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?i=(i|=64)|e.action:(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}let l=String.fromCharCode,c={DEFAULT:e=>{e=[h(e,!1)+32,e.col+32,e.row+32];return 255{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};`+e.row+t},SGR_PIXELS:e=>{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};`+e.y+t}};i=class{constructor(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(let e of Object.keys(a))this.addProtocol(e,a[e]);for(let e of Object.keys(c))this.addEncoding(e,c[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){var t;return!(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e)||((t=this._encodings[this._activeEncoding](e))&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,0))}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}},i=r([s(0,n.IBufferService),s(1,n.ICoreService)],i);t.CoreMouseService=i},6975:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._scrollToBottom=void 0}),this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}triggerDataEvent(e,t=!1){var i;this._optionsService.rawOptions.disableStdin||((i=this._bufferService.buffer).ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e))}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}},i=r([s(1,n.IBufferService),s(2,n.ILogService),s(3,n.IOptionsService)],i);t.CoreService=i},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;let r=i(8055),s=i(8460),n=i(844),o=i(6106),a={xmin:0,xmax:0};class h extends n.Disposable{constructor(){super(...arguments),this._decorations=new o.SortedList(e=>null==e?void 0:e.marker.line),this._onDecorationRegistered=this.register(new s.EventEmitter),this._onDecorationRemoved=this.register(new s.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(e){if(!e.marker.isDisposed){let t=new l(e);if(t){let e=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}}reset(){for(var e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var r,s,n;for(n of this._decorations.getKeyIterator(t))r=null!=(r=n.options.x)?r:0,s=r+(null!=(s=n.options.width)?s:1),r<=e&&e{var t;a.xmin=null!=(t=e.options.x)?t:0,a.xmax=a.xmin+(null!=(t=e.options.width)?t:1),i>=a.xmin&&ithis._end&&(this._end=e)}markRangeDirty(e,t){var i;tthis._end&&(this._end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}},n=r([s(0,i.IBufferService)],n);t.DirtyRowService=n},4348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=i(2585),n=i(8343);class s{constructor(...e){this._entries=new Map;for(var[t,i]of e)this.set(t,i)}set(e,t){var i=this._entries.get(e);return this._entries.set(e,t),i}forEach(i){this._entries.forEach((e,t)=>i(t,e))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=s,t.InstantiationService=class{constructor(){this._services=new s,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(i,...e){let r=(0,n.getServiceDependencies)(i).sort((e,t)=>e.index-t.index),s=[];for(let t of r){let e=this._services.get(t.id);if(!e)throw new Error(`[createInstance] ${i.name} depends on UNKNOWN service ${t.id}.`);s.push(e)}var t=0{"logLevel"===e&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;let n=t(8460),i=t(6114),r=(s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:i.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0},["normal","bold","100","200","300","400","500","600","700","800","900"]);s.OptionsService=class{constructor(i){this._onOptionChange=new n.EventEmitter;var r=Object.assign({},s.DEFAULT_OPTIONS);for(let t in i)if(t in r)try{let e=i[t];r[t]=this._sanitizeAndValidateOption(t,e)}catch(i){console.error(i)}this.rawOptions=r,this.options=Object.assign({},r),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){var t=e=>{if(e in s.DEFAULT_OPTIONS)return this.rawOptions[e];throw new Error(`No option with key "${e}"`)},i=(e,t)=>{if(!(e in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let e in this.rawOptions){var r={get:t.bind(this,e),set:i.bind(this,e)};Object.defineProperty(this.options,e,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if("block"!==(t=t||s.DEFAULT_OPTIONS[e])&&"underline"!==t&&"bar"!==t)throw new Error(`"${t}" is not a valid value for `+e);break;case"wordSeparator":t=t||s.DEFAULT_OPTIONS[e];break;case"fontWeight":case"fontWeightBold":"number"==typeof t&&1<=t&&t<=1e3||(t=r.includes(t)?t:s.DEFAULT_OPTIONS[e]);break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(e+" cannot be less than 1, value: "+t);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+t);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+t);case"rows":case"cols":if(!t&&0!==t)throw new Error(e+" must be numeric, value: "+t)}return t}}},2660:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._removeMarkerFromLink(t,e)),this._dataByLinkId.set(t.id,t),t.id}let e=i,t=this._getEntryIdKey(e),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,r.ybase+r.y),s.id;let n=r.addMarker(r.ybase+r.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(i,e))}}getLinkData(e){return null==(e=this._dataByLinkId.get(e))?void 0:e.data}_getEntryIdKey(e){return e.id+";;"+e.uri}_removeMarkerFromLink(e,t){t=e.lines.indexOf(t);-1!==t&&(e.lines.splice(t,1),0===e.lines.length)&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id))}},n=r([s(0,i.IBufferService)],n);t.OscLinkService=n},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);function s(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");var r;r=s,i=i,(e=e).di$target===e?e.di$dependencies.push({id:r,index:i}):(e.di$dependencies=[{id:r,index:i}],e.di$target=e)}return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var r,i=i(8343);t.IBufferService=(0,i.createDecorator)("BufferService"),t.ICoreMouseService=(0,i.createDecorator)("CoreMouseService"),t.ICoreService=(0,i.createDecorator)("CoreService"),t.ICharsetService=(0,i.createDecorator)("CharsetService"),t.IDirtyRowService=(0,i.createDecorator)("DirtyRowService"),t.IInstantiationService=(0,i.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,i.createDecorator)("LogService"),t.IOptionsService=(0,i.createDecorator)("OptionsService"),t.IOscLinkService=(0,i.createDecorator)("OscLinkService"),t.IUnicodeService=(0,i.createDecorator)("UnicodeService"),t.IDecorationService=(0,i.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;let r=i(8460),s=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new s.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0;var s=i.length;for(let t=0;t=s)return r+this.wcwidth(e);var n=i.charCodeAt(t);56320<=n&&n<=57343?e=1024*(e-55296)+n-56320+65536:r+=this.wcwidth(n)}r+=this.wcwidth(e)}return r}}}},r={};function a(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},i[e].call(t.exports,t,t.exports,a)),t.exports}var h={};{var l=h;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;let t=a(3236),e=a(9042),i=a(7975),r=a(7090),s=a(5741),n=a(8285),o=["cols","rows"];l.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new s.AddonManager,this._publicOptions=Object.assign({},this._core.options);var i=e=>this._core.options[e],r=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let t in this._core.options){let e={get:i.bind(this,t),set:r.bind(this,t)};Object.defineProperty(this._publicOptions,t,e)}}_checkReadonlyOptions(e){if(o.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new i.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new r.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new n.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){var e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(var t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.addMarker(e)}registerDecoration(e){var t;return this._checkProposedApi(),this._verifyPositiveIntegers(null!=(t=e.x)?t:0,null!=(t=e.width)?t:0,null!=(t=e.height)?t:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){return this._addonManager.loadAddon(this,e)}static get strings(){return e}_verifyIntegers(...e){for(var t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(var t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}}return h}) \ No newline at end of file +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i,r=t();for(i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(self,function(){var i={4567:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;let r=i(9042),s=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),l=i(9631);class c extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;ethis._onBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._onBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize(e=>this._onResize(e.rows))),this.register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(e=>this._onChar(e))),this.register(this._terminal.onLineFeed(()=>this._onChar("\n"))),this.register(this._terminal.onA11yTab(e=>this._onTab(e))),this.register(this._terminal.onKey(e=>this._onKey(e.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,o.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions()))}dispose(){super.dispose(),(0,l.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(i,r){var s=i.target,e=this._rowElements[0===r?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===r?"1":""+this._terminal.buffer.lines.length)&&i.relatedTarget===e){let e,t;if(0===r?(e=s,t=this._rowElements.pop(),this._rowContainer.removeChild(t)):(e=this._rowElements.shift(),t=s,this._rowContainer.removeChild(e)),e.removeEventListener("focus",this._topBoundaryFocusListener),t.removeEventListener("focus",this._bottomBoundaryFocusListener),0===r){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===r?-1:1),this._rowElements[0===r?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(t){for(let e=0;e{this._accessibilityTreeRoot.appendChild(this._liveRegion)},0)}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&(0,l.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){var s=this._terminal.buffer,n=s.lines.length.toString();for(let r=e;r<=t;r++){let e=s.translateBufferLineToString(s.ydisp+r,!0),t=(s.ydisp+r+1).toString(),i=this._rowElements[r];i&&(0===e.length?i.innerText=" ":i.textContent=e,i.setAttribute("aria-posinset",t),i.setAttribute("aria-setsize",n))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e{function r(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function n(e,t,i){e=s(e=r(e),i.decPrivateModes.bracketedPasteMode),i.triggerDataEvent(e,!0),t.value=""}function o(e,t,i){var i=i.getBoundingClientRect(),r=e.clientX-i.left-10,e=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=r+"px",t.style.top=e+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=r,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&n(e.clipboardData.getData("text/plain"),t,i)},t.paste=n,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r,s){o(e,t,i),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;let r=i(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},5680:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorManager=r.DEFAULT_ANSI_COLORS=void 0;let h=t(8055),i=t(7239),s=h.css.toColor("#ffffff"),n=h.css.toColor("#000000"),o=h.css.toColor("#ffffff"),a=h.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{var t=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let e=0;e<216;e++){var r=i[e/36%6|0],s=i[e/6%6|0],n=i[e%6];t.push({css:h.channels.toCss(r,s,n),rgba:h.channels.toRgba(r,s,n)})}for(let e=0;e<24;e++){var o=8+10*e;t.push({css:h.channels.toCss(o,o,o),rgba:h.channels.toRgba(o,o,o)})}return t})()),r.ColorManager=class{constructor(e,t){this.allowTransparency=t;t=e.createElement("canvas"),t.width=1,t.height=1,e=t.getContext("2d");if(!e)throw new Error("Could not get rendering context");this._ctx=e,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new i.ColorContrastCache,this.colors={foreground:s,background:n,cursor:o,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:h.color.blend(n,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:h.color.blend(n,l),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,t){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=t}}setTheme(i={}){this.colors.foreground=this._parseColor(i.foreground,s),this.colors.background=this._parseColor(i.background,n),this.colors.cursor=this._parseColor(i.cursor,o,!0),this.colors.cursorAccent=this._parseColor(i.cursorAccent,a,!0),this.colors.selectionBackgroundTransparent=this._parseColor(i.selectionBackground,l,!0),this.colors.selectionBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(i.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);let e={css:"",rgba:0};if(this.colors.selectionForeground=i.selectionForeground?this._parseColor(i.selectionForeground,e):void 0,this.colors.selectionForeground===e&&(this.colors.selectionForeground=void 0),h.color.isOpaque(this.colors.selectionBackgroundTransparent))this.colors.selectionBackgroundTransparent=h.color.opacity(this.colors.selectionBackgroundTransparent,.3);if(h.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent))this.colors.selectionInactiveBackgroundTransparent=h.color.opacity(this.colors.selectionInactiveBackgroundTransparent,.3);if(this.colors.ansi=r.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(i.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(i.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(i.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(i.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(i.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(i.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(i.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(i.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(i.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(i.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(i.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(i.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(i.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(i.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(i.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(i.brightWhite,r.DEFAULT_ANSI_COLORS[15]),i.extendedAnsi){let t=Math.min(this.colors.ansi.length-16,i.extendedAnsi.length);for(let e=0;eNumber(e)),s=Math.round(255*r);return{rgba:h.channels.toRgba(e,t,i,s),css:n}}}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t,i;for(i of e)null!=(t=null==i?void 0:i.parentElement)&&t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,r){e.addEventListener(t,i,r);let s=!1;return{dispose:()=>{s||(s=!0,e.removeEventListener(t,i,r))}}}},6465:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{var e=this._linkProviders.indexOf(t);-1!==e&&this._linkProviders.splice(e,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(e){this._isMouseOut=!1;var i=t.composedPath();for(let t=0;t{null!=e&&e.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=r.y);let n=!1;for(let[i,e]of this._linkProviders.entries())t?null!=(s=this._activeProviderReplies)&&s.get(i)&&(n=this._checkLinkProviderResult(i,r,n)):e.provideLinks(r.y,e=>{var t;this._isMouseOut||(e=null==e?void 0:e.map(e=>({link:e})),null!=(t=this._activeProviderReplies)&&t.set(i,e),n=this._checkLinkProviderResult(i,r,n),(null==(t=this._activeProviderReplies)?void 0:t.size)===this._linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies))})}_removeIntersectingLinks(i,t){var r=new Set;for(let e=0;ei?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(t--,1);break}r.add(e)}}}}_checkLinkProviderResult(r,s,n){var o;if(this._activeProviderReplies){let t=this._activeProviderReplies.get(r),i=!1;for(let e=0;ethis._linkAtPosition(e.link,s));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let t=0;tthis._linkAtPosition(e.link,s));if(e){n=!0,this._handleNewLink(e);break}}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var t;this._element&&this._mouseService&&this._currentLink&&(t=this._positionFromMouseEvent(e,this._element,this._mouseService))&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),(this._currentLink=void 0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){var e;this._element&&this._lastMouseEvent&&this._mouseService&&(e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService))&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:void 0===i.link.decorations||i.link.decorations.underline,pointerCursor:void 0===i.link.decorations||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.pointerCursor},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered)&&(null!=(t=this._element)&&t.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.underline},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&(null==(t=null==(t=this._currentLink)?void 0:t.state)?void 0:t.decorations.underline)!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered)&&this._fireUnderlineEvent(i.link,e)}}}),this._renderService)&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{var t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))}_linkHover(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor)&&e.classList.add("xterm-cursor-pointer"),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){var e=e.range,i=this._bufferService.buffer.ydisp,e=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-i-1,e.end.x,e.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(e)}_linkLeave(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor)&&e.classList.remove("xterm-cursor-pointer"),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){var i=e.range.start.y===e.range.end.y,r=e.range.start.yt.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||r&&e.range.end.x>=t.x||s&&e.range.start.x<=t.x||r&&s)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){i=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,r,s){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:s}}},i=r([s(0,n.IBufferService)],i);t.Linkifier2=i},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{if(s)return s.activate(t,e,r);t=e;if(confirm(`Do you want to navigate to ${t}?`)){let e=window.open();if(e){try{e.opener=null}catch(e){}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}},hover:(e,t)=>{var i;return null==(i=null==s?void 0:s.hover)?void 0:i.call(s,e,t,r)},leave:(e,t)=>{var i;return null==(i=null==s?void 0:s.leave)?void 0:i.call(s,e,t,r)}})}h=!1,o=r.hasExtendedAttrs()&&r.extended.urlId?(a=t,r.extended.urlId):a=-1}}e(i)}else e(void 0)}};i=r([s(0,n.IBufferService),s(1,n.IOptionsService),s(2,n.IOscLinkService)],i),t.OscLinkProvider=i},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){var e,t;(this._animationFrame=void 0)!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(var e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;i=i(844);class r extends i.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var e;this._outerListener&&(null!=(e=this._resolutionMediaMatchList)&&e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;let r=i(2950),s=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),l=i(6114),c=i(3656),_=i(9042),d=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(5680),S=i(3230),m=i(4725),C=i(428),b=i(8934),y=i(6465),w=i(5114),E=i(8969),L=i(8055),R=i(4269),k=i(5941),D=i(3107),A=i(5744),x=i(9074),B=i(2585),T=i(2962),M="undefined"!=typeof window?window.document:null;class O extends E.CoreTerminal{constructor(e={}){super(e),this.browser=l,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(y.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((e,t)=>this.refresh(e,t))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this.register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows)))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(e){var t;if(this._colorManager){for(let i of e){let e,t="";switch(i.index){case 256:e="foreground",t="10";break;case 257:e="background",t="11";break;case 258:e="cursor",t="12";break;default:e="ansi",t="4;"+i.index}switch(i.type){case 0:var r=L.color.toColorRGB("ansi"===e?this._colorManager.colors.ansi[i.index]:this._colorManager.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${t};`+(0,k.toRgbString)(r)+o.C1_ESCAPED.ST);break;case 1:"ansi"===e?this._colorManager.colors.ansi[i.index]=L.rgba.toColor(...i.color):this._colorManager.colors[e]=L.rgba.toColor(...i.color);break;case 2:this._colorManager.restoreColor(i.index)}}null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._renderService)&&e.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},null==(e=null==(e=this.element)?void 0:e.parentNode))||e.removeChild(this.element)}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(e){var t;switch(super._updateOptions(e),e){case"fontFamily":case"fontSize":null!=(t=this._renderService)&&t.clear(),null!=(t=this._charSizeService)&&t.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":null!=(t=this.viewport)&&t.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)):(null!=(t=this._accessibilityManager)&&t.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null==(e=this.textarea)?void 0:e.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){var e,t,i,r;this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing&&this._renderService&&(t=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(t))&&(r=Math.min(this.buffer.x,this.cols-1),e=this._renderService.dimensions.actualCellHeight,t=t.getWidth(r),t=this._renderService.dimensions.actualCellWidth*t,i=this.buffer.y*this._renderService.dimensions.actualCellHeight,r=r*this._renderService.dimensions.actualCellWidth,this.textarea.style.left=r+"px",this.textarea.style.top=i+"px",this.textarea.style.width=t+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5")}_initGlobal(){this._bindKeys(),this.register((0,c.addDisposableDomListener)(this.element,"copy",e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)}));var e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,c.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,c.addDisposableDomListener)(this.element,"paste",e)),l.isFirefox?this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,c.addDisposableDomListener)(this.element,"contextmenu",e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),l.isLinux&&this.register((0,c.addDisposableDomListener)(this.element,"auxclick",e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,c.addDisposableDomListener)(this.textarea,"keyup",e=>this._keyUp(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keydown",e=>this._keyDown(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keypress",e=>this._keyPress(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,c.addDisposableDomListener)(this.textarea,"input",e=>this._inputEvent(e),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);var e=M.createDocumentFragment(),t=(this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),e.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),e.appendChild(this.screenElement),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,c.addDisposableDomListener)(this.textarea,"focus",e=>this._onTextAreaFocus(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"blur",()=>this._onTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,null!=(t=this._document.defaultView)?t:window),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new p.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(e=>this._colorManager.onOptionsChange(e,this.optionsService.rawOptions[e]))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(R.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._createRenderer());this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,t,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(r.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(e),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(s.Viewport,e=>this.scrollLines(e,!0,1),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.onCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.onResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.onBlur())),this.register(this.onFocus(()=>this._renderService.onFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(e=>this._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>this._selectionService.onMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange(()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(e){var t;this._theme=e,null!=(t=this._colorManager)&&t.setTheme(e),null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}bindMouse(){let s=this,t=this.element;function i(i){var r=s._mouseService.getMouseReportCoords(i,s.screenElement);if(r){let e,t;switch(i.overrideType||i.type){case"mousemove":t=32,void 0===i.buttons?(e=3,void 0!==i.button&&(e=i.button<3?i.button:3)):e=1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":t=0,e=i.button<3?i.button:3;break;case"mousedown":t=1,e=i.button<3?i.button:3;break;case"wheel":if(0===s.viewport.getLinesScrolled(i))return;t=i.deltaY<0?0:1,e=4;break;default:return}void 0===t||void 0===e||4(i(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(t.addEventListener("mousemove",r.mousemove),n.mousemove=r.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),n.wheel=r.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,c.addDisposableDomListener)(t,"mousedown",e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this.register((0,c.addDisposableDomListener)(t,"wheel",e=>{if(!n.wheel){if(this.buffer.hasScrollback)return this.viewport.onWheel(e)?this.cancel(e):void 0;{var i=this.viewport.getLinesScrolled(e);if(0===i)return;var r=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let t="";for(let e=0;e{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(e),this.cancel(e)},{passive:!0})),this.register((0,c.addDisposableDomListener)(t,"touchmove",e=>this.coreMouseService.areMouseEventsActive||this.viewport.onTouchMove(e)?void 0:this.cancel(e),{passive:!1}))}refresh(e,t){var i;null!=(i=this._renderService)&&i.refreshRows(e,t)}updateCursorStyle(e){var t;null!=(t=this._selectionService)&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(this._characterJoinerService)return e=this._characterJoinerService.register(e),this.refresh(0,this.rows-1),e;throw new Error("Terminal must be opened first")}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;null!=(e=this._selectionService)&&e.clearSelection()}selectAll(){var e;null!=(e=this._selectionService)&&e.selectAll()}selectLines(e,t){var i;null!=(i=this._selectionService)&&i.selectLines(e,t)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(t))return!1;let e=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!e&&!this._compositionHelper.keydown(t))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;e||"Dead"!==t.key&&"AltGraph"!==t.key||(this._unprocessedDeadKey=!0);var i=(0,f.evaluateKeyboardEvent)(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),3!==i.type&&2!==i.type)return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,t)||(i.cancel&&this.cancel(t,!0),!i.key)||!!(t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&1===t.key.length&&65<=t.key.charCodeAt(0)&&t.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?!(this._unprocessedDeadKey=!1):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(t,!0)));{let e=this.rows-1;return this.scrollLines(2===i.type?-e:e),this.cancel(t,!0)}}_isThirdLevelShift(e,t){e=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?e:e&&(!t.keyCode||47{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;i=Date.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=i-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){var e,t;void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t))}}},1680:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._activeBuffer=e.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(e=>this._renderDimensions=e)),setTimeout(()=>this.syncScrollArea(),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){e?(this._innerRefresh(),null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame)):null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(0this._smoothScroll()):this._clearSmoothScrollState())}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||0this._queueRefresh())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,n.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e)))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this.refreshDecorations(),this._animationFrame=void 0}))}refreshDecorations(){for(var e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t=document.createElement("div"),i=(t.classList.add("xterm-decoration"),t.style.width=Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)+"px",t.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",t.style.lineHeight=this._renderService.dimensions.actualCellHeight+"px",null!=(i=e.options.x)?i:0);return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(t){var i=t.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let e=this._decorationElements.get(t);e||(t.onDispose(()=>this._removeDecoration(t)),e=this._createElement(t),t.element=e,this._decorationElements.set(t,e),this._container.appendChild(e)),e.style.top=i*this._renderService.dimensions.actualCellHeight+"px",e.style.display=this._altBufferIsActive?"none":"block",t.onRenderEmitter.fire(e)}}_refreshXPosition(e,t=e.element){var i;t&&(i=null!=(i=e.options.x)?i:0,"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.actualCellWidth+"px":"":t.style.left=i?i*this._renderService.dimensions.actualCellWidth+"px":"")}_removeDecoration(e){var t;null!=(t=this._decorationElements.get(e))&&t.remove(),this._decorationElements.delete(e)}},i=r([s(1,h.IBufferService),s(2,h.IDecorationService),s(3,o.IRenderService)],i);t.BufferDecorationRenderer=i},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(var t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(e=>{"overviewRulerWidth"===e&&this._queueRefresh(!0)})),this.register((0,n.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>{this._queueRefresh(!0)})),this._queueRefresh(!0)}dispose(){var e;null!=(e=this._canvas)&&e.remove(),super.dispose()}_refreshDrawConstants(){var e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=e,_.center=t,_.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=_.left,d.right=_.left+_.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowseService.dpr);var e=this._canvas.height/this._bufferService.buffer.lines.length,e=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);c.left=e,c.center=e,c.right=e}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=this._width+"px",this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=this._screenElement.clientHeight+"px",this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(var t of e)"full"!==t.position&&this._renderColorZone(t);for(var i of e)"full"===i.position&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),_[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}},i=r([s(2,l.IBufferService),s(3,l.IDecorationService),s(4,o.IRenderService),s(5,l.IOptionsService),s(6,o.ICoreBrowserService)],i);t.OverviewRulerRenderer=i},2950:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{var e;this._isSendingComposition&&(this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,0<(e=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start)).length)&&this._coreService.triggerDataEvent(e,!0)},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let i=this._textarea.value;setTimeout(()=>{var e,t;this._isComposing||(t=(e=this._textarea.value).replace(i,""),this._dataAlreadySent=t,e.length>i.length?this._coreService.triggerDataEvent(t,!0):e.lengththis.updateCompositionElements(!0),0)}}},i=r([s(2,o.IBufferService),s(3,o.IOptionsService),s(4,o.ICoreService),s(5,n.IRenderService)],i);t.CompositionHelper=i},9806:(e,t)=>{function l(e,t,i){var r=i.getBoundingClientRect(),e=e.getComputedStyle(i),i=parseInt(e.getPropertyValue("padding-left")),e=parseInt(e.getPropertyValue("padding-top"));return[t.clientX-r.left-i,t.clientY-r.top-e]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=l,t.getCoords=function(e,t,i,r,s,n,o,a,h){return(n=n&&l(e,t,i))?(n[0]=Math.ceil((n[0]+(h?o/2:0))/o),n[1]=Math.ceil(n[1]/a),n[0]=Math.min(Math.max(n[0],1),r+(h?1:0)),n[1]=Math.min(Math.max(n[1],1),s),n):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;let r=i(2584);function f(e,t,i,r){var s=e-v(i,e),n=t-v(i,t);return S(Math.abs(s-n)-function(r,s,n){let o=0,a=r-v(n,r),e=s-v(n,s);for(let i=0;in.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),e=o=0,a++):!s&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),e=o=n.cols-1,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function p(e,t){t=t?"O":"[";return r.C0.ESC+t+e}function S(t,i){t=Math.floor(t);let r="";for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;i=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},1752:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(e)return e;throw new Error("value must not be falsy")},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||9472<=e&&e<=9631}},1296:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._onLinkHover(e))),this.register(this._linkifier2.onHideLinkUnderline(e=>this._onLinkLeave(e)))}get onRequestRedraw(){return(new l.EventEmitter).event}dispose(){this._element.classList.remove(u+this._terminalClass),(0,d.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*e,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*e),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/e),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/e),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(let e of this._rowElements)e.style.width=this.dimensions.canvasWidth+"px",e.style.height=this.dimensions.actualCellHeight+"px",e.style.lineHeight=this.dimensions.actualCellHeight+"px",e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"}setColors(e){this._colors=e,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;i=(i=(i=(i=(i+=`${this._terminalSelector} span:not(.${c.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${c.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${c.ITALIC_CLASS} { font-style: italic;}`)+"@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}")+"@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css}; } 50% {`+` background-color: ${this._colors.cursorAccent.css};`+` color: ${this._colors.cursor.css}; }}`)+`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}:not(.${c.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`)+`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach((e,t)=>{i+=`${this._terminalSelector} .xterm-fg-${t} { color: ${e.css}; }${this._terminalSelector} .xterm-bg-${t} { background-color: ${e.css}; }`}),i+=`${this._terminalSelector} .xterm-fg-${n.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${n.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=i}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(i,r,e){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(i,r,e),this.renderRows(0,this._bufferService.rows-1),i&&r){var s=i[1]-this._bufferService.buffer.ydisp,n=r[1]-this._bufferService.buffer.ydisp,o=Math.max(s,0),a=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||a<0)){var h=document.createDocumentFragment();if(e){let e=i[0]>r[0];h.appendChild(this._createSelectionElement(o,(e?r:i)[0],(e?i:r)[0],a-o+1))}else{let e=s===o?i[0]:0,t=o===n?r[0]:this._bufferService.cols;if(h.appendChild(this._createSelectionElement(o,e,t)),h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,a-o-1)),o!==a){let e=n===a?r[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(a,0,e))}}this._selectionContainer.appendChild(h)}}}_createSelectionElement(e,t,i,r=1){var s=document.createElement("div");return s.style.height=r*this.dimensions.actualCellHeight+"px",s.style.top=e*this.dimensions.actualCellHeight+"px",s.style.left=t*this.dimensions.actualCellWidth+"px",s.style.width=this.dimensions.actualCellWidth*(i-t)+"px",s}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(var e of this._rowElements)e.innerText=""}renderRows(e,t){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink;for(let s=e;s<=t;s++){let e=this._rowElements[s],t=(e.innerText="",s+this._bufferService.buffer.ydisp),i=this._bufferService.buffer.lines.get(t),r=this._optionsService.rawOptions.cursorStyle;e.appendChild(this._rowFactory.createRow(i,t,t===n,r,o,a,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return"."+u+this._terminalClass}_onLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_onLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(i,e,r,t,s,n){for(;i!==e||r!==t;){let e=this._rowElements[r];if(!e)return;let t=e.children[i];t&&(t.style.textDecoration=n?"underline":"none"),++i>=s&&(i=0,r++)}}};g=r([s(5,h.IInstantiationService),s(6,a.ICharSizeService),s(7,h.IOptionsService),s(8,h.IBufferService),s(9,a.ICoreBrowserService)],g),t.DomRenderer=g},3787:function(e,L,t){var i=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=e)&&p<=i&&(p=e),!this._coreService.isCursorHidden&&v&&e===p)switch(y.classList.add(L.CURSOR_CLASS),S&&y.classList.add(L.CURSOR_BLINK_CLASS),g){case"bar":y.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":y.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:y.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}if(r.isBold()&&y.classList.add(L.BOLD_CLASS),r.isItalic()&&y.classList.add(L.ITALIC_CLASS),r.isDim()&&y.classList.add(L.DIM_CLASS),r.isInvisible()?y.textContent=k.WHITESPACE_CELL_CHAR:y.textContent=r.getChars()||k.WHITESPACE_CELL_CHAR,r.isUnderline()&&(y.classList.add(L.UNDERLINE_CLASS+"-"+r.extended.underlineStyle)," "===y.textContent&&(y.innerHTML=" "),!r.isUnderlineColorDefault()))if(r.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(r.getUnderlineColor()).join(",")})`;else{let e=r.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&r.isBold()&&e<8&&(e+=8),y.style.textDecorationColor=this._colors.ansi[e].css}r.isStrikethrough()&&y.classList.add(L.STRIKETHROUGH_CLASS);let s=r.getFgColor(),n=r.getFgColorMode(),o=r.getBgColor(),a=r.getBgColorMode();var w=!!r.isInverse();if(w){let e=s,t=(s=o,o=e,n);n=a,a=t}let h,l,c=!1;this._decorationService.forEachDecorationAtCell(e,f,void 0,e=>{"top"!==e.options.layer&&c||(e.backgroundColorRGB&&(a=50331648,o=e.backgroundColorRGB.rgba>>8&16777215,h=e.backgroundColorRGB),e.foregroundColorRGB&&(n=50331648,s=e.foregroundColorRGB.rgba>>8&16777215,l=e.foregroundColorRGB),c="top"===e.options.layer)});var E=this._isCellInSelection(e,f);let _;switch(c||this._colors.selectionForeground&&E&&(n=50331648,s=this._colors.selectionForeground.rgba>>8&16777215,l=this._colors.selectionForeground),E&&(h=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,c=!0),c&&y.classList.add("xterm-decoration-top"),a){case 16777216:case 33554432:_=this._colors.ansi[o],y.classList.add("xterm-bg-"+o);break;case 50331648:_=D.rgba.toColor(o>>16,o>>8&255,255&o),this._addStyle(y,"background-color:#"+B((o>>>0).toString(16),"0",6));break;default:w?(_=this._colors.foreground,y.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)):_=this._colors.background}switch(h||r.isDim()&&(h=D.color.multiplyOpacity(_,.5)),n){case 16777216:case 33554432:r.isBold()&&s<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(s+=8),this._applyMinimumContrast(y,_,this._colors.ansi[s],r,h,void 0)||y.classList.add("xterm-fg-"+s);break;case 50331648:let e=D.rgba.toColor(s>>16&255,s>>8&255,255&s);this._applyMinimumContrast(y,_,e,r,h,l)||this._addStyle(y,"color:#"+B(s.toString(16),"0",6));break;default:this._applyMinimumContrast(y,_,this._colors.foreground,r,h,void 0)||w&&y.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}C.appendChild(y),e=i}}return C}_applyMinimumContrast(e,t,i,r,s,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,h.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o;return void 0===(o=s||n?o:this._colors.contrastCache.getColor(t.rgba,i.rgba))&&(o=D.color.ensureContrastRatio(s||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((s||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,"color:"+o.css),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){var i=this._selectionStart,r=this._selectionEnd;return!(!i||!r)&&(this._columnSelectMode?i[0]<=r[0]?e>=i[0]&&t>=i[1]&&e=i[1]&&e>=r[0]&&t<=r[1]:t>i[1]&&t=i[0]&&e=i[0])}};function B(e,t,i){for(;e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){var e;return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0}areSelectionValuesReversed(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}onTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=this._renderService.dimensions.canvasWidth||e[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(e[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(e[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(e[0]),y:Math.floor(e[1])}}},i=r([s(0,n.IRenderService),s(1,n.ICharSizeService)],i);t.MouseService=i},3230:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._renderer.dispose()}),this._renderDebouncer=new h.RenderDebouncer(a.window,(e,t)=>this._renderRows(e,t)),this.register(this._renderDebouncer),this._screenDprMonitor=new c.ScreenDprMonitor(a.window),this._screenDprMonitor.setListener(()=>this.onDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(o.onResize(()=>this._fullRefresh())),this.register(o.buffers.onBufferActivate(()=>{var e;return null==(e=this._renderer)?void 0:e.clear()})),this.register(r.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.onCharSizeChanged())),this.register(n.onDecorationRegistered(()=>this._fullRefresh())),this.register(n.onDecorationRemoved(()=>this._fullRefresh())),this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this.register((0,_.addDisposableDomListener)(a.window,"resize",()=>this.onDevicePixelRatioChange())),"IntersectionObserver"in a.window){let e=new a.window.IntersectionObserver(e=>this._onIntersectionChange(e[e.length-1]),{threshold:0});e.observe(i),this.register({dispose:()=>e.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(e){this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;null!=(t=null==(e=this._renderer)?void 0:e.clearTextureAtlas)&&t.call(e),this._fullRefresh()}setColors(e){this._renderer.setColors(e),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(e,t){this._renderer.onResize(e,t),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}},i=r([s(3,o.IOptionsService),s(4,a.ICharSizeService),s(5,o.IDecorationService),s(6,o.IBufferService),s(7,a.ICoreBrowserService)],i);t.RenderService=i},9312:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._onMouseMove(e),this._mouseUpListener=e=>this._onMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._onTrim(e)),this.register(this._bufferService.buffers.onBufferActivate(e=>this._onBufferActivate(e))),this.enable(),this._model=new l.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;if(!e||!s)return"";var n=this._bufferService.buffer,o=[];if(3===this._activeSelectionMode){if(e[0]===s[0])return"";let i=(e[0]e.replace(g," ")).join(a.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){var e=this._getMouseBufferCoords(e),t=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(t&&i&&e)&&this._areCoordsInSelection(e,t,i)}isCellInSelection(e,t){var i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection([e,t],i,r)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){var i=null==(i=null==(i=this._linkifier.currentLink)?void 0:i.link)?void 0:i.range;return i?(this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols),!(this._model.selectionEnd=void 0)):!!(i=this._getMouseBufferCoords(e))&&(this._selectWordAt(i,t),!(this._model.selectionEnd=void 0))}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_onTrim(e){this._model.onTrim(e)&&this.refresh()}_getMouseBufferCoords(e){e=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(e)return e[0]--,e[1]--,e[1]+=this._bufferService.buffer.ydisp,e}_getMouseEventScrollAmount(e){let t=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];e=this._renderService.dimensions.canvasHeight;return 0<=t&&t<=e?0:(t>e&&(t-=e),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return a.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}onMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_onIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_onSingleClick(e){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart&&(this._model.selectionEnd=void 0,e=this._bufferService.buffer.lines.get(this._model.selectionStart[1]))&&e.length!==this._model.selectionStart[0]&&0===e.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_onDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_onTripleClick(e){e=this._getMouseBufferCoords(e);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))}shouldColumnSelect(e){return e.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]this._onTrim(e))}_convertViewportColToCharacterIndex(t,i){let r=i[0];for(let e=0;i[0]>=e;e++){var s=t.loadCell(e,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:1=this._bufferService.cols)){var d=this._bufferService.buffer,u=d.lines.get(c[1]);if(u){var f=d.translateBufferLineToString(c[1],!1);let r=this._convertViewportColToCharacterIndex(u,c),s=r;var v=c[0]-r;let n=0,o=0,a=0,h=0;if(" "===f.charAt(r)){for(;0this._bufferService.cols;)i.length-=this._bufferService.cols,e++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,e]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&0<=this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())}_selectLineAt(e){var e=this._bufferService.buffer.getWrappedRangeForLine(e),t={start:{x:0,y:e.first},end:{x:this._bufferService.cols-1,y:e.last}};this._model.selectionStart=[0,e.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(t,this._bufferService.cols)}},i=r([s(3,o.IBufferService),s(4,o.ICoreService),s(5,n.IMouseService),s(6,o.IOptionsService),s(7,n.IRenderService),s(8,n.ICoreBrowserService)],i);t.SelectionService=i},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;i=i(8343);t.ICharSizeService=(0,i.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,i.createDecorator)("CoreBrowserService"),t.IMouseService=(0,i.createDecorator)("MouseService"),t.IRenderService=(0,i.createDecorator)("RenderService"),t.ISelectionService=(0,i.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,i.createDecorator)("CharacterJoinerService")},6349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;let r=i(8460);t.CircularList=class{constructor(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter,this.onInsertEmitter=new r.EventEmitter,this.onTrimEmitter=new r.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(t){if(this._maxLength!==t){var i=new Array(t);for(let e=0;ethis._length)for(let e=this._length;e=t;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;ethis._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(t,i,r){if(!(i<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;var r,s=Array.isArray(t)?[]:{};for(r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{var a,c,o,i;function s(e){e=e.toString(16);return e.length<2?"0"+e:e}function _(e,t){return e>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l>>0}function l(e,t,i){var r=e>>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l>>0}function r(e,t,i){e/=255,t/=255,i/=255;return.2126*(e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((.055+i)/1.055,2.4))}function n(e,t){var t=Math.round(255*t),[e,i,r]=o.toChannels(e.rgba);return{css:a.toCss(e,i,r,t),rgba:a.toRgba(e,i,r,t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,(i=a=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+s(e)+s(t)+s(i)+s(r):"#"+s(e)+s(t)+s(i)},i.toRgba=function(e,t,i,r=255){return(e<<24|t<<16|i<<8|r)>>>0},(i=t.color||(t.color={})).blend=function(e,t){var i,r,s,n,o=(255&t.rgba)/255;return 1==o?{css:t.css,rgba:t.rgba}:(r=t.rgba>>24&255,n=t.rgba>>16&255,t=t.rgba>>8&255,s=e.rgba>>24&255,i=e.rgba>>16&255,e=e.rgba>>8&255,r=s+Math.round((r-s)*o),s=i+Math.round((n-i)*o),n=e+Math.round((t-e)*o),{css:a.toCss(r,s,n),rgba:a.toRgba(r,s,n)})},i.isOpaque=function(e){return 255==(255&e.rgba)},i.ensureContrastRatio=function(e,t,i){e=o.ensureContrastRatio(e.rgba,t.rgba,i);if(e)return o.toColor(e>>24&255,e>>16&255,e>>8&255)},i.opaque=function(e){var e=(255|e.rgba)>>>0,[t,i,r]=o.toChannels(e);return{css:a.toCss(t,i,r),rgba:e}},i.opacity=n,i.multiplyOpacity=function(e,t){return n(e,(255&e.rgba)*t/255)},i.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]},(t.css||(t.css={})).toColor=function(s){if(s.match(/#[0-9a-f]{3,8}/i))switch(s.length){case 4:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16);return o.toColor(e,t,i)}case 5:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16),r=parseInt(s.slice(4,5).repeat(2),16);return o.toColor(e,t,i,r)}case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let n=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n){let e=parseInt(n[1]),t=parseInt(n[2]),i=parseInt(n[3]),r=Math.round(255*(void 0===n[5]?1:parseFloat(n[5])));return o.toColor(e,t,i,r)}throw new Error("css.toColor: Unsupported css format")},(i=c=t.rgb||(t.rgb={})).relativeLuminance=function(e){return r(e>>16&255,e>>8&255,255&e)},i.relativeLuminance2=r,(i=o=t.rgba||(t.rgba={})).ensureContrastRatio=function(r,s,n){let o=c.relativeLuminance(r>>8),e=c.relativeLuminance(s>>8);if(_(o,e)>8));if(i_(o,c.relativeLuminance(e>>8))?t:e}return t}var t=l(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i_(o,c.relativeLuminance(e>>8))?t:e}return t}},i.reduceLuminance=h,i.increaseLuminance=l,i.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},i.toColor=function(e,t,i,r){return{css:a.toCss(e,t,i,r),rgba:a.toRgba(e,t,i,r)}},t.toPaddedHex=s,t.contrastRatio=_},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;let r=i(844),s=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),l=i(6975),c=i(8460),_=i(1753),d=i(3730),u=i(1480),f=i(7994),v=i(9282),g=i(5435),p=i(5981),S=i(2660),m=!1;class C extends r.Disposable{constructor(e){super(),this._onBinary=new c.EventEmitter,this._onData=new c.EventEmitter,this._onLineFeed=new c.EventEmitter,this._onResize=new c.EventEmitter,this._onScroll=new c.EventEmitter,this._onWriteParsed=new c.EventEmitter,this._instantiationService=new n.InstantiationService,this.optionsService=new h.OptionsService(e),this._instantiationService.setService(s.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(s.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(o.LogService),this._instantiationService.setService(s.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService,()=>this.scrollToBottom())),this._instantiationService.setService(s.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(_.CoreMouseService),this._instantiationService.setService(s.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(d.DirtyRowService),this._instantiationService.setService(s.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(u.UnicodeService),this._instantiationService.setService(s.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(s.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(s.IOscLinkService,this._oscLinkService),this._inputHandler=new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange(e=>this._updateOptions(e))),this.register(this._bufferService.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=new p.WriteBuffer((e,t)=>this._inputHandler.parse(e,t)),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new c.EventEmitter,this.register(this._onScroll.event(e=>{var t;null!=(t=this._onScrollApi)&&t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(var t in e)this.optionsService.options[t]=e[t]}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._windowsMode)&&e.dispose(),this._windowsMode=void 0)}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=s.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():(null!=(t=this._windowsMode)&&t.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){let t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsMode={dispose:()=>{for(var e of t)e.dispose()}}}}}t.CoreTerminal=C},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let e=0;et.fire(e))}},5435:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let d=i(2584),c=i(7116),_=i(2015),r=i(844),u=i(482),f=i(8437),v=i(8460),g=i(643),p=i(511),n=i(3734),a=i(2585),S=i(6242),m=i(6351),s=i(5941),o={"(":0,")":1,"*":2,"+":3,"-":1,".":2},h=131072;function l(e,t){if(24this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})}),this._parser.setDcsHandlerFallback((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})}),this._parser.setPrintHandler((e,t,i)=>this.print(e,t,i)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new S.OscHandler(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new S.OscHandler(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new S.OscHandler(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new S.OscHandler(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new S.OscHandler(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new S.OscHandler(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new S.OscHandler(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new S.OscHandler(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new S.OscHandler(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new S.OscHandler(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new S.OscHandler(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new S.OscHandler(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let e in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},()=>this.selectCharset("("+e)),this._parser.registerEscHandler({intermediates:")",final:e},()=>this.selectCharset(")"+e)),this._parser.registerEscHandler({intermediates:"*",final:e},()=>this.selectCharset("*"+e)),this._parser.registerEscHandler({intermediates:"+",final:e},()=>this.selectCharset("+"+e)),this._parser.registerEscHandler({intermediates:"-",final:e},()=>this.selectCharset("-"+e)),this._parser.registerEscHandler({intermediates:".",final:e},()=>this.selectCharset("."+e)),this._parser.registerEscHandler({intermediates:"/",final:e},()=>this.selectCharset("/"+e));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(e,t,i,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}parse(r,e){let s,n=this._activeBuffer.x,o=this._activeBuffer.y,t=0,i=this._parseStack.paused;if(i){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(s),s;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,r.length>h&&(t=this._parseStack.position+h)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof r?` "${r}"`:` "${Array.prototype.map.call(r,e=>String.fromCharCode(e)).join("")}"`),"string"==typeof r?r.split("").map(e=>e.charCodeAt(0)):r),this._parseBuffer.lengthh)for(let i=t;i=h)if(l){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=h-1,2===n)continue;if(c&&(d.insertCells(this._activeBuffer.x,n,this._activeBuffer.getNullCell(_),_),2===d.getWidth(h-1))&&d.setCellFromCodePoint(h-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,_.fg,_.bg,_.extended),d.setCellFromCodePoint(this._activeBuffer.x++,s,n,_.fg,_.bg,_.extended),0!l(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new S.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return!(this._activeBuffer.x=0)}backspace(){var e;if(this._coreService.decPrivateModes.reverseWraparound){if(this._restrictCursor(this._bufferService.cols),0this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&null!=(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))&&e.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}this._restrictCursor()}else this._restrictCursor(),0=this._bufferService.cols||(e=this._activeBuffer.x,this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e)),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){var t=this._activeBuffer.y-this._activeBuffer.scrollTop;return 0<=t?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){var t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return 0<=t?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),!(this._activeBuffer.x=0)}cursorPrecedingLine(e){return this.cursorUp(e),!(this._activeBuffer.x=0)}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){e=e.params[0];return 0===e?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===e&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop()}return!0}cursorBackwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop()}return!0}selectProtected(e){e=e.params[0];return 1===e&&(this._curAttrData.bg|=536870912),2!==e&&0!==e||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,r=!1,s=!1){e=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);e.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),s),r&&(e.isWrapped=!1)}_resetBufferLine(e,t=!1){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowService.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;0this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(t){for(let e=0;ee?1:2,e=e.params[0],_=e,a=t?2===e?3:4===e?c(n.modes.insertMode):12===e?4:20===e?c(l.convertEol):0:1===e?c(i.applicationCursorKeys):3===e?l.windowOptions.setWinLines?80===a?2:132===a?1:0:0:6===e?c(i.origin):7===e?c(i.wraparound):8===e?3:9===e?"X10"===r?1:2:12===e?c(l.cursorBlink):25===e?c(!n.isCursorHidden):45===e?c(i.reverseWraparound):66===e?c(i.applicationKeypad):1e3===e?"VT200"===r?1:2:1002===e?"DRAG"===r?1:2:1003===e?"ANY"===r?1:2:1004===e?c(i.sendFocus):1005===e?4:1006===e?"SGR"===s?1:2:1015===e?4:1016===e?"SGR_PIXELS"===s?1:2:1048===e?1:47===e||1047===e||1049===e?o===h?1:2:2004===e?c(i.bracketedPasteMode):0;return n.triggerDataEvent(d.C0.ESC+`[${t?"":"?"}${_};${a}$y`),!0}_updateAttrColor(e,t,i,r,s){return 2===t?e=(e=(e|50331648)&-16777216)|n.AttributeData.fromColorRGB([i,r,s]):5===t&&(e=e&-50331904|(33554432|255&i)),e}_extractColor(i,r,e){var s=[0,0,-1,0,0,0];let n=0,o=0;do{if(s[o+n]=i.params[r+o],i.hasSubParams(r+o)){let e=i.getSubParams(r+o),t=0;for(;5===s[1]&&(n=1),s[o+t+1+n]=e[t],++tthis._bufferService.rows||0===i?this._bufferService.rows:i)>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(l(e.params[0],this._optionsService.rawOptions.windowOptions)){var t=1e.startsWith("id="));return-1!==r&&(i=e[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!(this._currentLinkId=void 0)}_setOrReportSpecialColor(e,t){var i,r=e.split(";");for(let e=0;e=this._specialColors.length);++e,++t)"?"===r[e]?this._onColor.fire([{type:0,index:this._specialColors[t]}]):(i=(0,s.parseColor)(r[e]))&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}]);return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(e){var t,i=[],r=e.split(";");for(let e=0;e=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0}reverseIndex(){var e;return this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop?(e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop,this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)):(this._activeBuffer.y--,this._restrictCursor()),!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){var t=new p.CellData;t.content=1<<22|"E".charCodeAt(0),t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e{function i(e){for(var t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(var e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){e=this._disposables.indexOf(e);-1!==e&&this._disposables.splice(e,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,i,r,s){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(i,r,s)}get(e,t,i,r){return null==(e=this._data.get(e,t))?void 0:e.get(i,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=void 0;var i="undefined"==typeof navigator,r=i?"node":navigator.userAgent,i=i?"node":navigator.platform;t.isFirefox=r.includes("Firefox"),t.isLegacyEdge=r.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(r),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i),t.isIpad="iPad"===i,t.isIphone="iPhone"===i,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(i),t.isLinux=0<=i.indexOf("Linux")},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0!==this._array.length){var t=this._getKey(e);if(void 0!==t&&-1!==(i=this._search(t,0,this._array.length-1))&&this._getKey(this._array[i])===t)do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i=this._array.length)&&this._getKey(this._array[i])===e)for(;yield this._array[i],++i=this._array.length)&&this._getKey(this._array[i])===e)for(;t(this._array[i]),++i{function s(t,i,r=0,s=t.length){if(!(r>=t.length)){r=(t.length+r)%t.length,s=s>=t.length?t.length:(t.length+s)%t.length;for(let e=r;e{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=i(643);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),t=null==t?void 0:t.get(e.cols-1),e=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);e&&t&&(e.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;t.AttributeData=class r{constructor(){this.fg=0,this.bg=0,this.extended=new i}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){var e=new r;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}};class i{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new i(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=i},9092:(e,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferStringIterator=i.Buffer=i.MAX_BUFFER_SIZE=void 0;let r=t(6349),S=t(8437),s=t(511),n=t(643),m=t(4634),o=t(4863),a=t(7116),h=t(3734);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=s.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,n.WHITESPACE_CELL_CHAR,n.WHITESPACE_CELL_WIDTH,n.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new S.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&ei.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t:e}fillViewportRows(t){if(0===this.lines.length){void 0===t&&(t=S.DEFAULT_ATTR_DATA);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,r){var s=this.getNullCell(S.DEFAULT_ATTR_DATA),n=this._getCorrectBufferLength(r);if(n>this.lines.maxLength&&(this.lines.maxLength=n),0r;e--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(ni))for(let e=0;ethis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){var i=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));0=n&&ds+a){for(let e=o.newLines.length-1;0<=e;e--)this.lines.set(t--,o.newLines[e]);t++,i.push({index:s+1,amount:o.newLines.length}),a+=o.newLines.length,o=l[++n]}else this.lines.set(t,r[s--]);let t=0;for(let e=i.length-1;0<=e;e--)i[e].index+=t,this.lines.onInsertEmitter.fire(i[e]),t+=i[e].amount;var p=Math.max(0,e+c-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(t){this._isClearing=!0;for(let e=0;e{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,r,s){return new l(this,e,t,i,r,s)}};class l{constructor(e,t,i=0,r=e.lines.length,s=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=s,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);let i="";for(let e=t.first;e<=t.last;++e)i+=this._buffer.translateBufferLineToString(e,this._trimRight);return this._current=t.last+1,{range:t,content:i}}}i.BufferStringIterator=l},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let s=i(482),n=i(643),o=i(511),a=i(3734),r=(t.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData),{startIndex:0});t.BufferLine=class h{constructor(t,e,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);var r=e||o.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let e=0;e>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],1>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return r.startIndex=3*e,t.content=this._data[r.startIndex+0],t.fg=this._data[r.startIndex+1],t.bg=this._data[r.startIndex+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,r,s,n){268435456&s&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=s}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(i=2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),-2097152&i|2097152):t|1<<22,this._data[3*e+0]=i)}insertCells(i,r,s,e){if((i%=this.length)&&2===this.getWidth(i-1)&&this.setCellFromCodePoint(i-1,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs),rthis.length){var e=new Uint32Array(3*t);this.length&&(3*t>22);return 0}copyCellsFrom(i,r,s,e,t){var n=i._data;if(t)for(let t=e-1;0<=t;t--){for(let e=0;e<3;e++)this._data[3*(s+t)+e]=n[3*(r+t)+e];268435456&n[3*(r+t)+2]&&(this._extendedAttrs[s+t]=i._extendedAttrs[r+t])}else for(let t=0;t=r&&(this._combined[e-r+s]=i._combined[e])}}translateToString(e=!1,i=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let r="";for(;i>22||1}return r}}},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function u(e,t,i){var r;return t===e.length-1?e[t].getTrimmedLength():(r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),e=2===e[t+1].getWidth(0),r&&e?i-1:i)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(r,h,l,s,c){let _=[];for(let i=0;i=i&&ss||0===d[e].getTrimmedLength());e--)t++;0u(i,t,r)).reduce((e,t)=>e+t);let n=0,o=0,a=0;for(;ah&&(n-=h,o++),2===i[o].getWidth(n-1)),h=(h&&n--,h?e-1:e);t.push(h),a+=h}return t},t.getWrappedLineTrimmedLength=u},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;let r=i(9092),s=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new s.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=i(482),s=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){var t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;var i,r;2{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;let r=i(8460),s=i(844);class n extends s.Disposable{constructor(e){super(),this.line=e,this._id=n._nextId++,this.isDisposed=!1,this._onDispose=new r.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}(t.Marker=n)._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,(r=i=t.C0||(t.C0={})).NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL="",(r=t.C1||(t.C1={})).PAD="€",r.HOP="",r.BPH="‚",r.NBH="ƒ",r.IND="„",r.NEL="…",r.SSA="†",r.ESA="‡",r.HTS="ˆ",r.HTJ="‰",r.VTS="Š",r.PLD="‹",r.PLU="Œ",r.RI="",r.SS2="Ž",r.SS3="",r.DCS="",r.PU1="‘",r.PU2="’",r.STS="“",r.CCH="”",r.MW="•",r.SPA="–",r.EPA="—",r.SOS="˜",r.SGCI="™",r.SCI="š",r.CSI="›",r.ST="œ",r.OSC="",r.PM="ž",r.APC="Ÿ",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=i.ESC+"\\"},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;let o=i(2584),a={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(i,e,t,r){var s={type:0,cancel:!1,key:void 0},n=(i.shiftKey?1:0)|(i.altKey?2:0)|(i.ctrlKey?4:0)|(i.metaKey?8:0);switch(i.keyCode){case 0:"UIKeyInputUpArrow"===i.key?s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A":"UIKeyInputLeftArrow"===i.key?s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D":"UIKeyInputRightArrow"===i.key?s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C":"UIKeyInputDownArrow"===i.key&&(s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 8:i.altKey?s.key=o.C0.ESC+o.C0.DEL:s.key=o.C0.DEL;break;case 9:i.shiftKey?s.key=o.C0.ESC+"[Z":(s.key=o.C0.HT,s.cancel=!0);break;case 13:s.key=i.altKey?o.C0.ESC+o.C0.CR:o.C0.CR,s.cancel=!0;break;case 27:s.key=o.C0.ESC,i.altKey&&(s.key=o.C0.ESC+o.C0.ESC),s.cancel=!0;break;case 37:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"D",s.key===o.C0.ESC+"[1;3D"&&(s.key=o.C0.ESC+(t?"b":"[1;5D"))):s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D");break;case 39:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"C",s.key===o.C0.ESC+"[1;3C"&&(s.key=o.C0.ESC+(t?"f":"[1;5C"))):s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C");break;case 38:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"A",t||s.key!==o.C0.ESC+"[1;3A"||(s.key=o.C0.ESC+"[1;5A")):s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A");break;case 40:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"B",t||s.key!==o.C0.ESC+"[1;3B"||(s.key=o.C0.ESC+"[1;5B")):s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 45:i.shiftKey||i.ctrlKey||(s.key=o.C0.ESC+"[2~");break;case 46:s.key=n?o.C0.ESC+"[3;"+(1+n)+"~":o.C0.ESC+"[3~";break;case 36:s.key=n?o.C0.ESC+"[1;"+(1+n)+"H":e?o.C0.ESC+"OH":o.C0.ESC+"[H";break;case 35:s.key=n?o.C0.ESC+"[1;"+(1+n)+"F":e?o.C0.ESC+"OF":o.C0.ESC+"[F";break;case 33:i.shiftKey?s.type=2:i.ctrlKey?s.key=o.C0.ESC+"[5;"+(1+n)+"~":s.key=o.C0.ESC+"[5~";break;case 34:i.shiftKey?s.type=3:i.ctrlKey?s.key=o.C0.ESC+"[6;"+(1+n)+"~":s.key=o.C0.ESC+"[6~";break;case 112:s.key=n?o.C0.ESC+"[1;"+(1+n)+"P":o.C0.ESC+"OP";break;case 113:s.key=n?o.C0.ESC+"[1;"+(1+n)+"Q":o.C0.ESC+"OQ";break;case 114:s.key=n?o.C0.ESC+"[1;"+(1+n)+"R":o.C0.ESC+"OR";break;case 115:s.key=n?o.C0.ESC+"[1;"+(1+n)+"S":o.C0.ESC+"OS";break;case 116:s.key=n?o.C0.ESC+"[15;"+(1+n)+"~":o.C0.ESC+"[15~";break;case 117:s.key=n?o.C0.ESC+"[17;"+(1+n)+"~":o.C0.ESC+"[17~";break;case 118:s.key=n?o.C0.ESC+"[18;"+(1+n)+"~":o.C0.ESC+"[18~";break;case 119:s.key=n?o.C0.ESC+"[19;"+(1+n)+"~":o.C0.ESC+"[19~";break;case 120:s.key=n?o.C0.ESC+"[20;"+(1+n)+"~":o.C0.ESC+"[20~";break;case 121:s.key=n?o.C0.ESC+"[21;"+(1+n)+"~":o.C0.ESC+"[21~";break;case 122:s.key=n?o.C0.ESC+"[23;"+(1+n)+"~":o.C0.ESC+"[23~";break;case 123:s.key=n?o.C0.ESC+"[24;"+(1+n)+"~":o.C0.ESC+"[24~";break;default:if(!i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)if(t&&!r||!i.altKey||i.metaKey)!t||i.altKey||i.ctrlKey||i.shiftKey||!i.metaKey?i.key&&!i.ctrlKey&&!i.altKey&&!i.metaKey&&48<=i.keyCode&&1===i.key.length?s.key=i.key:i.key&&i.ctrlKey&&("_"===i.key&&(s.key=o.C0.US),"@"===i.key)&&(s.key=o.C0.NUL):65===i.keyCode&&(s.type=1);else{let e=a[i.keyCode],t=null==e?void 0:e[i.shiftKey?1:0];if(t)s.key=o.C0.ESC+t;else if(65<=i.keyCode&&i.keyCode<=90){let e=i.ctrlKey?i.keyCode-64:i.keyCode+32,t=String.fromCharCode(e);i.shiftKey&&(t=t.toUpperCase()),s.key=o.C0.ESC+t}else if("Dead"===i.key&&i.code.startsWith("Key")){let e=i.code.slice(3,4);i.shiftKey||(e=e.toLowerCase()),s.key=o.C0.ESC+e,s.cancel=!0}}else 65<=i.keyCode&&i.keyCode<=90?s.key=String.fromCharCode(i.keyCode-64):32===i.keyCode?s.key=o.C0.NUL:51<=i.keyCode&&i.keyCode<=55?s.key=String.fromCharCode(i.keyCode-51+27):56===i.keyCode?s.key=o.C0.DEL:219===i.keyCode?s.key=o.C0.ESC:220===i.keyCode?s.key=o.C0.FS:221===i.keyCode&&(s.key=o.C0.GS)}return s}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(i,e=0,r=i.length){let s="";for(let t=e;t>10))+String.fromCharCode(e%1024+56320)):s+=String.fromCharCode(e)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(i,r){let s=i.length;if(!s)return 0;let n=0,o=0;if(this._interim){let e=i.charCodeAt(o++);56320<=e&&e<=57343?r[n++]=1024*(this._interim-55296)+e-56320+65536:(r[n++]=this._interim,r[n++]=e),this._interim=0}for(let t=o;t=s)return this._interim=e,n;var a=i.charCodeAt(t);56320<=a&&a<=57343?r[n++]=1024*(e-55296)+a-56320+65536:(r[n++]=e,r[n++]=a)}else 65279!==e&&(r[n++]=e)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,a){var h=o.length;if(!h)return 0;let e,t,i,r,l=0,s=0,c=0;if(this.interim[0]){let e=!1,t=this.interim[0];t&=192==(224&t)?31:224==(240&t)?15:7;let i,r=0;for(;(i=63&this.interim[++r])&&r<4;)t=(t<<=6)|i;let s=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,n=s-r;for(;c=h)return 0;if(128!=(192&(i=o[c++]))){c--,e=!0;break}this.interim[r++]=i,t=(t<<=6)|63&i}e||(2==s?t<128?c--:a[l++]=t:3==s?t<2048||55296<=t&&t<=57343||65279===t||(a[l++]=t):t<65536||1114111=h)return this.interim[0]=e,l;128!=(192&(t=o[_++]))?_--:(s=(31&e)<<6|63&t)<128?_--:a[l++]=s}else if(224==(240&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;128!=(192&(i=o[_++]))?_--:(s=(15&e)<<12|(63&t)<<6|63&i)<2048||55296<=s&&s<=57343||65279===s||(a[l++]=s)}}else if(240==(248&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;if(128!=(192&(i=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,this.interim[2]=i,l;128!=(192&(r=o[_++]))?_--:(s=(7&e)<<18|(63&t)<<12|(63&i)<<6|63&r)<65536||1114111{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;let r=i(8273),s=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,r.fill)(o,1),(o[0]=0,r.fill)(o,0,1,32),(0,r.fill)(o,0,127,160),(0,r.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,r.fill)(o,2,11904,42192),o[12351]=1,(0,r.fill)(o,2,44032,55204),(0,r.fill)(o,2,63744,64256),(0,r.fill)(o,2,65040,65050),(0,r.fill)(o,2,65072,65136),(0,r.fill)(o,2,65280,65377),(0,r.fill)(o,2,65504,65511);for(let e=0;et[s][1]))for(;s>=r;)if(e>t[i=r+s>>1][1])r=1+i;else{if(!(e{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;let r=i(8460),n="undefined"==typeof queueMicrotask?e=>{Promise.resolve().then(e)}:queueMicrotask;t.WriteBuffer=class{constructor(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new r.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)this._syncCalls=0;else if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}}write(e,t){if(5e7this._innerWrite())),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,i=!0){let r=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],t=this._action(e,i);if(t){let e=e=>12<=Date.now()-r?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);return void t.catch(e=>(n(()=>{throw e}),Promise.resolve(!1))).then(e)}var s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,12<=Date.now()-r)break}this._writeBuffer.length>this._bufferOffset?(50this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;let i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,n=/^[\da-f]+$/;function s(e,t){var i=e.toString(16),r=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(e){let r=e.toLowerCase();if(0===r.indexOf("rgb:")){r=r.slice(4);let t=i.exec(r);if(t){let e=t[1]?15:t[4]?255:t[7]?4095:65535;return[Math.round(parseInt(t[1]||t[4]||t[7]||t[10],16)/e*255),Math.round(parseInt(t[2]||t[5]||t[8]||t[11],16)/e*255),Math.round(parseInt(t[3]||t[6]||t[9]||t[12],16)/e*255)]}}else if(0===r.indexOf("#")&&(r=r.slice(1),n.exec(r))&&[3,6,9,12].includes(r.length)){let t=r.length/3,i=[0,0,0];for(let e=0;e<3;++e){var s=parseInt(r.slice(t*e,t*e+t),16);i[e]=1==t?s<<4:2==t?s:3==t?s>>4:s>>8}return i}}},t.toRgbString=function(e,t=16){var[e,i,r]=e;return`rgb:${s(e,t)}/${s(i,t)}/`+s(r,t)}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;let s=i(482),r=i(8742),n=i(5770),o=[],a=(t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(t,i,r))}unhook(r,s=!0){if(this._active.length){let e=!1,t=this._active.length-1,i=!1;if(this._stack.paused&&(t=this._stack.loopPosition-1,e=s,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===e){for(;0<=t&&!0!==(e=this._active[t].unhook(r));t--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!1,e;t--}for(;0<=t;t--)if((e=this._active[t].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",r);this._active=o,this._ident=0}},new r.Params);a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=1n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params))instanceof Promise)return t.then(e=>(this._params=a,this._data="",this._hitLimit=!1,e));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=i(844),s=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,s.fill)(this.table,e<<4|t)}add(e,t,i,r){this.table[t<<8|e]=i<<4|r}addMany(t,i,r,s){for(let e=0;et),t=(e,t)=>i.slice(e,t),r=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var n=t(0,14);let o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(t(128,144),o,3,0),e.addMany(t(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(_,0,2,0),e.add(_,8,5,8),e.add(_,6,0,6),e.add(_,11,0,11),e.add(_,13,13,13),e}();class l extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new o.OscParser,this._dcsParser=new a.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,e=[64,126]){let r=0;if(i.prefix){if(1t||t>e[1])throw new Error(`final must be in range ${e[0]} .. `+e[1]);return r=(r<<=8)|t}identToString(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){e=this._identifier(e,[48,126]);void 0===this._escHandlers[e]&&(this._escHandlers[e]=[]);let i=this._escHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){e=this._identifier(e);void 0===this._csiHandlers[e]&&(this._csiHandlers[e]=[]);let i=this._csiHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,(this.precedingCodepoint=0)!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(s,n,i){let o,a=0,h=0,l=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let e=this._parseStack.handlers,t=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&-1>4){case 2:for(let e=r+1;;++e){if(e>=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||(a=s[e])<32||126=n||24===(a=s[e])||26===a||27===a||127=n||(a=s[e])<32||127{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;let r=i(5770),s=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._id,"PUT",(0,s.utf32ToString)(t,i,r))}start(){this.reset(),this._state=1}put(t,i,e){if(3!==this._state){if(1===this._state)for(;ir.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data))instanceof Promise)return t.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;let s=2147483647;class n{constructor(e=32,t=32){if(this.maxLength=e,256<(this.maxSubParamsLength=t))throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){var r=new n;if(i.length)for(let e=Array.isArray(i[0])?1:0;e>8,r=255&this._subParamsIdx[e];0=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>s?s:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>s?s:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return 0<(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)}getSubParams(e){var t=this._subParamsIdx[e]>>8,e=255&this._subParamsIdx[e];return 0>8,r=255&this._subParamsIdx[e];0{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;0<=e;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(i){if(!i.isDisposed){let t=-1;for(let e=0;e{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;let r=i(3785),s=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){e=this._buffer.lines.get(e);if(e)return new r.BufferLineApiView(e)}getNullCell(){return new s.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;let r=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;let r=i(8771),s=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new s.EventEmitter,this._normal=new r.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new r.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get onBufferChange(){return this._onBufferChange.event}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,t)=>i(e,t.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3=r.ybase&&(this.isUserScrolling=!1);var s=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),s===r.ydisp||t||this._onScroll.fire(r.ydisp)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){e-=this.buffer.ydisp;0!=e&&this.scrollLines(e)}},i=r([s(0,n.IOptionsService)],i);t.BufferService=i},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,!(e.shift=!1))},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?i=(i|=64)|e.action:(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}let l=String.fromCharCode,c={DEFAULT:e=>{e=[h(e,!1)+32,e.col+32,e.row+32];return 255{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};`+e.row+t},SGR_PIXELS:e=>{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};`+e.y+t}};i=class{constructor(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(let e of Object.keys(a))this.addProtocol(e,a[e]);for(let e of Object.keys(c))this.addEncoding(e,c[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){var t;return!(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e)||((t=this._encodings[this._activeEncoding](e))&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,0))}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}},i=r([s(0,n.IBufferService),s(1,n.ICoreService)],i);t.CoreMouseService=i},6975:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._scrollToBottom=void 0}),this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}triggerDataEvent(e,t=!1){var i;this._optionsService.rawOptions.disableStdin||((i=this._bufferService.buffer).ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e))}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}},i=r([s(1,n.IBufferService),s(2,n.ILogService),s(3,n.IOptionsService)],i);t.CoreService=i},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;let r=i(8055),s=i(8460),n=i(844),o=i(6106),a={xmin:0,xmax:0};class h extends n.Disposable{constructor(){super(...arguments),this._decorations=new o.SortedList(e=>null==e?void 0:e.marker.line),this._onDecorationRegistered=this.register(new s.EventEmitter),this._onDecorationRemoved=this.register(new s.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(e){if(!e.marker.isDisposed){let t=new l(e);if(t){let e=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}}reset(){for(var e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var r,s,n;for(n of this._decorations.getKeyIterator(t))r=null!=(r=n.options.x)?r:0,s=r+(null!=(s=n.options.width)?s:1),r<=e&&e{var t;a.xmin=null!=(t=e.options.x)?t:0,a.xmax=a.xmin+(null!=(t=e.options.width)?t:1),i>=a.xmin&&ithis._end&&(this._end=e)}markRangeDirty(e,t){var i;tthis._end&&(this._end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}},n=r([s(0,i.IBufferService)],n);t.DirtyRowService=n},4348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=i(2585),n=i(8343);class s{constructor(...e){this._entries=new Map;for(var[t,i]of e)this.set(t,i)}set(e,t){var i=this._entries.get(e);return this._entries.set(e,t),i}forEach(i){this._entries.forEach((e,t)=>i(t,e))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=s,t.InstantiationService=class{constructor(){this._services=new s,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(i,...e){let r=(0,n.getServiceDependencies)(i).sort((e,t)=>e.index-t.index),s=[];for(let t of r){let e=this._services.get(t.id);if(!e)throw new Error(`[createInstance] ${i.name} depends on UNKNOWN service ${t.id}.`);s.push(e)}var t=0{"logLevel"===e&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;let n=t(8460),i=t(6114),r=(s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:i.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0},["normal","bold","100","200","300","400","500","600","700","800","900"]);s.OptionsService=class{constructor(i){this._onOptionChange=new n.EventEmitter;var r=Object.assign({},s.DEFAULT_OPTIONS);for(let t in i)if(t in r)try{let e=i[t];r[t]=this._sanitizeAndValidateOption(t,e)}catch(i){console.error(i)}this.rawOptions=r,this.options=Object.assign({},r),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){var t=e=>{if(e in s.DEFAULT_OPTIONS)return this.rawOptions[e];throw new Error(`No option with key "${e}"`)},i=(e,t)=>{if(!(e in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let e in this.rawOptions){var r={get:t.bind(this,e),set:i.bind(this,e)};Object.defineProperty(this.options,e,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if("block"!==(t=t||s.DEFAULT_OPTIONS[e])&&"underline"!==t&&"bar"!==t)throw new Error(`"${t}" is not a valid value for `+e);break;case"wordSeparator":t=t||s.DEFAULT_OPTIONS[e];break;case"fontWeight":case"fontWeightBold":"number"==typeof t&&1<=t&&t<=1e3||(t=r.includes(t)?t:s.DEFAULT_OPTIONS[e]);break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(e+" cannot be less than 1, value: "+t);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+t);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+t);case"rows":case"cols":if(!t&&0!==t)throw new Error(e+" must be numeric, value: "+t)}return t}}},2660:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3this._removeMarkerFromLink(t,e)),this._dataByLinkId.set(t.id,t),t.id}let e=i,t=this._getEntryIdKey(e),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,r.ybase+r.y),s.id;let n=r.addMarker(r.ybase+r.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(i,e))}}getLinkData(e){return null==(e=this._dataByLinkId.get(e))?void 0:e.data}_getEntryIdKey(e){return e.id+";;"+e.uri}_removeMarkerFromLink(e,t){t=e.lines.indexOf(t);-1!==t&&(e.lines.splice(t,1),0===e.lines.length)&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id))}},n=r([s(0,i.IBufferService)],n);t.OscLinkService=n},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);function s(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");var r;r=s,i=i,(e=e).di$target===e?e.di$dependencies.push({id:r,index:i}):(e.di$dependencies=[{id:r,index:i}],e.di$target=e)}return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var r,i=i(8343);t.IBufferService=(0,i.createDecorator)("BufferService"),t.ICoreMouseService=(0,i.createDecorator)("CoreMouseService"),t.ICoreService=(0,i.createDecorator)("CoreService"),t.ICharsetService=(0,i.createDecorator)("CharsetService"),t.IDirtyRowService=(0,i.createDecorator)("DirtyRowService"),t.IInstantiationService=(0,i.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,i.createDecorator)("LogService"),t.IOptionsService=(0,i.createDecorator)("OptionsService"),t.IOscLinkService=(0,i.createDecorator)("OscLinkService"),t.IUnicodeService=(0,i.createDecorator)("UnicodeService"),t.IDecorationService=(0,i.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;let r=i(8460),s=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new s.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0;var s=i.length;for(let t=0;t=s)return r+this.wcwidth(e);var n=i.charCodeAt(t);56320<=n&&n<=57343?e=1024*(e-55296)+n-56320+65536:r+=this.wcwidth(n)}r+=this.wcwidth(e)}return r}}}},r={};function a(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},i[e].call(t.exports,t,t.exports,a)),t.exports}var h={};{var l=h;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;let t=a(3236),e=a(9042),i=a(7975),r=a(7090),s=a(5741),n=a(8285),o=["cols","rows"];l.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new s.AddonManager,this._publicOptions=Object.assign({},this._core.options);var i=e=>this._core.options[e],r=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let t in this._core.options){let e={get:i.bind(this,t),set:r.bind(this,t)};Object.defineProperty(this._publicOptions,t,e)}}_checkReadonlyOptions(e){if(o.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new i.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new r.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new n.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){var e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(var t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.addMarker(e)}registerDecoration(e){var t;return this._checkProposedApi(),this._verifyPositiveIntegers(null!=(t=e.x)?t:0,null!=(t=e.width)?t:0,null!=(t=e.height)?t:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){return this._addonManager.loadAddon(this,e)}static get strings(){return e}_verifyIntegers(...e){for(var t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(var t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}}return h}) \ No newline at end of file diff --git a/public/scripts/zlib-inflate-min.js b/public/scripts/zlib-inflate-min.js index 3174b582..8c047621 100644 --- a/public/scripts/zlib-inflate-min.js +++ b/public/scripts/zlib-inflate-min.js @@ -1 +1 @@ -"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"),function(){var Y=11,q=29,C=[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],O=[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,203,69],T=[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],y=[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];function G(t,a){for(var i,s,o,l,e,b,v,p,n,d,r,h,c,f,u,m,_,k,g,w,x=t.next,Z=2==a?t.distbits:t.lenbits,I=t.work,L=t.lens,B=2==a?t.nlen:0,R=t.codes,E=1==a?t.nlen:2==a?t.ndist:19,A=new Array(16),S=new Array(16),z=0;z<=15;z++)A[z]=0;for(i=0;iw?(f.op=k[g+I[i]],f.val=m[_+I[i]]):f.op=96,d=1<>>b)+(r-=d)]=f,0!=r;);for(d=1<>>=1;if(n=0!=d?(n&d-1)+d:0,i++,0==--A[z]){if(z==o)break;z=L[B+I[i]]}if(l>>4),a<48&&(a&=15)),1==i&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==i&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=o,a&&(a<8||15>>8&255],0,2)}function W(t,a){a.strm=t,a.left=t.avail_out,a.next=t.next_in,a.have=t.avail_in,a.hold=t.state.hold,a.bits=t.state.bits}function X(t){var a=t.strm;a.next_in=t.next,a.avail_out=t.left,a.avail_in=t.have,a.state.hold=t.hold,a.state.bits=t.bits}function $(t){t.hold=0,t.bits=0}function tt(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<>>=a,t.bits-=a}function ot(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function lt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var et=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(t,a){var i,s,o,l,e,b,v,p,n,d,r,h,c=-1,f=-1;if(!t||!t.state||!t.input_data&&0!=t.avail_in)return ZLIB.Z_STREAM_ERROR;(i=t.state).mode==Y&&(i.mode=12),W(t,s={}),o=s.have,l=s.left,n=ZLIB.Z_OK;t:for(;;)switch(i.mode){case 0:if(0==i.wrap)i.mode=12;else{if(!at(s,16))break t;if(2&i.wrap&&35615==s.hold)i.check=t.checksum_function(0,null,0,0),V(t,s.hold),$(s),i.mode=1;else if(i.flags=0,null!==i.head&&(i.head.done=-1),!(1&i.wrap)||((it(s,8)<<8)+(s.hold>>>8))%31)t.msg="incorrect header check",i.mode=q;else if(it(s,4)!=ZLIB.Z_DEFLATED)t.msg="unknown compression method",i.mode=q;else{if(st(s,4),p=it(s,4)+8,0==i.wbits)i.wbits=p;else if(p>i.wbits){t.msg="invalid window size",i.mode=q;break}i.dmax=1<>>8&1),512&i.flags&&V(t,s.hold),$(s),i.mode=2;case 2:if(!at(s,32))break t;null!==i.head&&(i.head.time=s.hold),512&i.flags&&(x=s.hold,t.state.check=t.checksum_function(t.state.check,[255&x,x>>>8&255,x>>>16&255,x>>>24&255],0,4)),$(s),i.mode=3;case 3:if(!at(s,16))break t;null!==i.head&&(i.head.xflags=255&s.hold,i.head.os=s.hold>>>8),512&i.flags&&V(t,s.hold),$(s),i.mode=4;case 4:if(1024&i.flags){if(!at(s,16))break t;i.length=s.hold,null!==i.head&&(i.head.extra_len=s.hold),512&i.flags&&V(t,s.hold),$(s),i.head.extra=""}else null!==i.head&&(i.head.extra=null);i.mode=5;case 5:if(1024&i.flags&&((e=(e=i.length)>s.have?s.have:e)&&(null!==i.head&&null!==i.head.extra&&(p=i.head.extra_len-i.length,i.head.extra+=t.input_data.substring(s.next,s.next+(p+e>i.head.extra_max?i.head.extra_max-p:e))),512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,i.length-=e),i.length))break t;i.length=0,i.mode=6;case 6:if(2048&i.flags){if(0==s.have)break t;for(null!==i.head&&null===i.head.name&&(i.head.name=""),e=0;p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length>>9&1,i.head.done=1),t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;break;case 9:if(!at(s,32))break t;t.adler=i.check=lt(s.hold),$(s),i.mode=10;case 10:if(0==i.havedict)return X(s),ZLIB.Z_NEED_DICT;t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;case Y:if(a==ZLIB.Z_BLOCK||a==ZLIB.Z_TREES)break t;case 12:if(i.last)ot(s),i.mode=26;else{if(!at(s,3))break t;switch(i.last=it(s,1),st(s,1),it(s,2)){case 0:i.mode=13;break;case 1:u=m=void 0;var u,m=i;for(J=J||[{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:255}],Q=Q||[{op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025},{op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193},{op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385},{op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577},{op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073},{op:22,bits:5,val:193},{op:64,bits:5,val:0}],m.lencode=0,m.distcode=512,u=0;u<512;u++)m.codes[u]=J[u];for(u=0;u<32;u++)m.codes[u+512]=Q[u];if(m.lenbits=9,m.distbits=5,i.mode=19,a!=ZLIB.Z_TREES)break;st(s,2);break t;case 2:i.mode=16;break;case 3:t.msg="invalid block type",i.mode=q}st(s,2)}break;case 13:if(ot(s),!at(s,32))break t;if((65535&s.hold)!=(s.hold>>>16&65535^65535)){t.msg="invalid stored block lengths",i.mode=q;break}if(i.length=65535&s.hold,$(s),i.mode=14,a==ZLIB.Z_TREES)break t;case 14:i.mode=15;case 15:if(e=i.length){if(0==(e=(e=e>s.have?s.have:e)>s.left?s.left:e))break t;t.output_data+=t.input_data.substring(s.next,s.next+e),t.next_out+=e,s.have-=e,s.next+=e,s.left-=e,i.length-=e}else i.mode=Y;break;case 16:if(!at(s,14))break t;if(i.nlen=it(s,5)+257,st(s,5),i.ndist=it(s,5)+1,st(s,5),i.ncode=it(s,4)+4,st(s,4),286i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=q;break}for(;e--;)i.lens[i.have++]=p}}if(i.mode==q)break;if(0==i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=q;break}if(i.next=0,i.lencode=i.next,i.lenbits=9,n=G(i,1)){t.msg="invalid literal/lengths set",i.mode=q;break}if(i.distcode=i.next,i.distbits=6,n=G(i,2)){t.msg="invalid distances set",i.mode=q;break}if(i.mode=19,a==ZLIB.Z_TREES)break t;case 19:i.mode=20;case 20:if(6<=s.have&&258<=s.left){X(s),I=Z=y=g=k=_=P=U=j=H=T=O=C=z=N=F=D=S=K=A=E=R=B=L=x=w=void 0;var _,k,g,w=t,x=l,Z=-1,I=-1,L=w.state,B=w.input_data,R=w.next_in,E=R+w.avail_in-5,A=w.next_out,K=A-(x-w.avail_out),S=A+(w.avail_out-257),D=L.wsize,F=L.whave,N=L.wnext,z=L.window,C=L.hold,O=L.bits,T=L.codes,H=L.lencode,j=L.distcode,U=(1<>>=k=_.bits,O-=k,0==(k=_.op))w.output_data+=String.fromCharCode(_.val),A++;else{if(!(16&k)){if(0==(64&k)){_=T[H+(_.val+(C&(1<>>=k,O-=k),O<15&&(C+=(255&B.charCodeAt(R++))<>>=k=_.bits,O-=k,!(16&(k=_.op))){if(0==(64&k)){_=T[j+(_.val+(C&(1<>>=k,O-=k,(k=A-K)>>3)<<3))-1,w.next_in=R-=g,w.next_out=A,w.avail_in=R>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,i.length=b.val,0==b.op){i.mode=25;break}if(32&b.op){i.back=-1,i.mode=Y;break}if(64&b.op){t.msg="invalid literal/length code",i.mode=q;break}i.extra=15&b.op,i.mode=21;case 21:if(i.extra){if(!at(s,i.extra))break t;i.length+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.was=i.length,i.mode=22;case 22:for(;!((b=i.codes[i.distcode+it(s,i.distbits)]).bits<=s.bits);)if(!tt(s))break t;if(0==(240&b.op)){for(v=b;b=i.codes[i.distcode+v.val+(it(s,v.bits+v.op)>>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,64&b.op){t.msg="invalid distance code",i.mode=q;break}i.offset=b.val,i.extra=15&b.op,i.mode=23;case 23:if(i.extra){if(!at(s,i.extra))break t;i.offset+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.mode=24;case 24:if(0==s.left)break t;if(e=l-s.left,i.offset>e){if((e=i.offset-e)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=q;break}f=(c=e>i.wnext?(e-=i.wnext,i.wsize-e):i.wnext-e,-1),e>i.length&&(e=i.length)}else c=-1,f=t.next_out-i.offset,e=i.length;if(e>s.left&&(e=s.left),s.left-=e,i.length-=e,0<=c)t.output_data+=i.window.substring(c,c+e),t.next_out+=e,e=0;else for(t.next_out+=e;t.output_data+=t.output_data.charAt(f++),--e;);0==i.length&&(i.mode=20);break;case 25:if(0==s.left)break t;t.output_data+=String.fromCharCode(i.length),t.next_out++,s.left--,i.mode=20;break;case 26:if(i.wrap){if(!at(s,32))break t;if(l-=s.left,t.total_out+=l,i.total+=l,l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,t.output_data.length-l,l)),l=s.left,(i.flags?s.hold:lt(s.hold))!=i.check){t.msg="incorrect data check",i.mode=q;break}$(s)}i.mode=27;case 27:if(i.wrap&&i.flags){if(!at(s,32))break t;if(s.hold!=(4294967295&i.total)){t.msg="incorrect length check",i.mode=q;break}$(s)}i.mode=28;case 28:n=ZLIB.Z_STREAM_END;break t;case q:n=ZLIB.Z_DATA_ERROR;break t;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return X(s),(i.wsize||l!=t.avail_out&&i.modew?(f.op=k[g+I[i]],f.val=m[_+I[i]]):f.op=96,d=1<>>b)+(r-=d)]=f,0!=r;);for(d=1<>>=1;if(n=0!=d?(n&d-1)+d:0,i++,0==--A[z]){if(z==o)break;z=L[B+I[i]]}if(l>>4),a<48&&(a&=15)),1==i&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==i&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=o,a&&(a<8||15>>8&255],0,2)}function W(t,a){a.strm=t,a.left=t.avail_out,a.next=t.next_in,a.have=t.avail_in,a.hold=t.state.hold,a.bits=t.state.bits}function X(t){var a=t.strm;a.next_in=t.next,a.avail_out=t.left,a.avail_in=t.have,a.state.hold=t.hold,a.state.bits=t.bits}function $(t){t.hold=0,t.bits=0}function tt(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<>>=a,t.bits-=a}function ot(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function lt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var et=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(t,a){var i,s,o,l,e,b,v,p,n,d,r,h,c=-1,f=-1;if(!t||!t.state||!t.input_data&&0!=t.avail_in)return ZLIB.Z_STREAM_ERROR;(i=t.state).mode==Y&&(i.mode=12),W(t,s={}),o=s.have,l=s.left,n=ZLIB.Z_OK;t:for(;;)switch(i.mode){case 0:if(0==i.wrap)i.mode=12;else{if(!at(s,16))break t;if(2&i.wrap&&35615==s.hold)i.check=t.checksum_function(0,null,0,0),V(t,s.hold),$(s),i.mode=1;else if(i.flags=0,null!==i.head&&(i.head.done=-1),!(1&i.wrap)||((it(s,8)<<8)+(s.hold>>>8))%31)t.msg="incorrect header check",i.mode=q;else if(it(s,4)!=ZLIB.Z_DEFLATED)t.msg="unknown compression method",i.mode=q;else{if(st(s,4),p=it(s,4)+8,0==i.wbits)i.wbits=p;else if(p>i.wbits){t.msg="invalid window size",i.mode=q;break}i.dmax=1<>>8&1),512&i.flags&&V(t,s.hold),$(s),i.mode=2;case 2:if(!at(s,32))break t;null!==i.head&&(i.head.time=s.hold),512&i.flags&&(x=s.hold,t.state.check=t.checksum_function(t.state.check,[255&x,x>>>8&255,x>>>16&255,x>>>24&255],0,4)),$(s),i.mode=3;case 3:if(!at(s,16))break t;null!==i.head&&(i.head.xflags=255&s.hold,i.head.os=s.hold>>>8),512&i.flags&&V(t,s.hold),$(s),i.mode=4;case 4:if(1024&i.flags){if(!at(s,16))break t;i.length=s.hold,null!==i.head&&(i.head.extra_len=s.hold),512&i.flags&&V(t,s.hold),$(s),i.head.extra=""}else null!==i.head&&(i.head.extra=null);i.mode=5;case 5:if(1024&i.flags&&((e=(e=i.length)>s.have?s.have:e)&&(null!==i.head&&null!==i.head.extra&&(p=i.head.extra_len-i.length,i.head.extra+=t.input_data.substring(s.next,s.next+(p+e>i.head.extra_max?i.head.extra_max-p:e))),512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,i.length-=e),i.length))break t;i.length=0,i.mode=6;case 6:if(2048&i.flags){if(0==s.have)break t;for(null!==i.head&&null===i.head.name&&(i.head.name=""),e=0;p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length>>9&1,i.head.done=1),t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;break;case 9:if(!at(s,32))break t;t.adler=i.check=lt(s.hold),$(s),i.mode=10;case 10:if(0==i.havedict)return X(s),ZLIB.Z_NEED_DICT;t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;case Y:if(a==ZLIB.Z_BLOCK||a==ZLIB.Z_TREES)break t;case 12:if(i.last)ot(s),i.mode=26;else{if(!at(s,3))break t;switch(i.last=it(s,1),st(s,1),it(s,2)){case 0:i.mode=13;break;case 1:u=m=void 0;var u,m=i;for(J=J||[{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:255}],Q=Q||[{op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025},{op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193},{op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385},{op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577},{op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073},{op:22,bits:5,val:193},{op:64,bits:5,val:0}],m.lencode=0,m.distcode=512,u=0;u<512;u++)m.codes[u]=J[u];for(u=0;u<32;u++)m.codes[u+512]=Q[u];if(m.lenbits=9,m.distbits=5,i.mode=19,a!=ZLIB.Z_TREES)break;st(s,2);break t;case 2:i.mode=16;break;case 3:t.msg="invalid block type",i.mode=q}st(s,2)}break;case 13:if(ot(s),!at(s,32))break t;if((65535&s.hold)!=(s.hold>>>16&65535^65535)){t.msg="invalid stored block lengths",i.mode=q;break}if(i.length=65535&s.hold,$(s),i.mode=14,a==ZLIB.Z_TREES)break t;case 14:i.mode=15;case 15:if(e=i.length){if(0==(e=(e=e>s.have?s.have:e)>s.left?s.left:e))break t;t.output_data+=t.input_data.substring(s.next,s.next+e),t.next_out+=e,s.have-=e,s.next+=e,s.left-=e,i.length-=e}else i.mode=Y;break;case 16:if(!at(s,14))break t;if(i.nlen=it(s,5)+257,st(s,5),i.ndist=it(s,5)+1,st(s,5),i.ncode=it(s,4)+4,st(s,4),286i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=q;break}for(;e--;)i.lens[i.have++]=p}}if(i.mode==q)break;if(0==i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=q;break}if(i.next=0,i.lencode=i.next,i.lenbits=9,n=G(i,1)){t.msg="invalid literal/lengths set",i.mode=q;break}if(i.distcode=i.next,i.distbits=6,n=G(i,2)){t.msg="invalid distances set",i.mode=q;break}if(i.mode=19,a==ZLIB.Z_TREES)break t;case 19:i.mode=20;case 20:if(6<=s.have&&258<=s.left){X(s),I=Z=y=g=k=_=P=U=j=H=T=O=C=z=N=F=D=S=K=A=E=R=B=L=x=w=void 0;var _,k,g,w=t,x=l,Z=-1,I=-1,L=w.state,B=w.input_data,R=w.next_in,E=R+w.avail_in-5,A=w.next_out,K=A-(x-w.avail_out),S=A+(w.avail_out-257),D=L.wsize,F=L.whave,N=L.wnext,z=L.window,C=L.hold,O=L.bits,T=L.codes,H=L.lencode,j=L.distcode,U=(1<>>=k=_.bits,O-=k,0==(k=_.op))w.output_data+=String.fromCharCode(_.val),A++;else{if(!(16&k)){if(0==(64&k)){_=T[H+(_.val+(C&(1<>>=k,O-=k),O<15&&(C+=(255&B.charCodeAt(R++))<>>=k=_.bits,O-=k,!(16&(k=_.op))){if(0==(64&k)){_=T[j+(_.val+(C&(1<>>=k,O-=k,(k=A-K)>>3)<<3))-1,w.next_in=R-=g,w.next_out=A,w.avail_in=R>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,i.length=b.val,0==b.op){i.mode=25;break}if(32&b.op){i.back=-1,i.mode=Y;break}if(64&b.op){t.msg="invalid literal/length code",i.mode=q;break}i.extra=15&b.op,i.mode=21;case 21:if(i.extra){if(!at(s,i.extra))break t;i.length+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.was=i.length,i.mode=22;case 22:for(;!((b=i.codes[i.distcode+it(s,i.distbits)]).bits<=s.bits);)if(!tt(s))break t;if(0==(240&b.op)){for(v=b;b=i.codes[i.distcode+v.val+(it(s,v.bits+v.op)>>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,64&b.op){t.msg="invalid distance code",i.mode=q;break}i.offset=b.val,i.extra=15&b.op,i.mode=23;case 23:if(i.extra){if(!at(s,i.extra))break t;i.offset+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.mode=24;case 24:if(0==s.left)break t;if(e=l-s.left,i.offset>e){if((e=i.offset-e)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=q;break}f=(c=e>i.wnext?(e-=i.wnext,i.wsize-e):i.wnext-e,-1),e>i.length&&(e=i.length)}else c=-1,f=t.next_out-i.offset,e=i.length;if(e>s.left&&(e=s.left),s.left-=e,i.length-=e,0<=c)t.output_data+=i.window.substring(c,c+e),t.next_out+=e,e=0;else for(t.next_out+=e;t.output_data+=t.output_data.charAt(f++),--e;);0==i.length&&(i.mode=20);break;case 25:if(0==s.left)break t;t.output_data+=String.fromCharCode(i.length),t.next_out++,s.left--,i.mode=20;break;case 26:if(i.wrap){if(!at(s,32))break t;if(l-=s.left,t.total_out+=l,i.total+=l,l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,t.output_data.length-l,l)),l=s.left,(i.flags?s.hold:lt(s.hold))!=i.check){t.msg="incorrect data check",i.mode=q;break}$(s)}i.mode=27;case 27:if(i.wrap&&i.flags){if(!at(s,32))break t;if(s.hold!=(4294967295&i.total)){t.msg="incorrect length check",i.mode=q;break}$(s)}i.mode=28;case 28:n=ZLIB.Z_STREAM_END;break t;case q:n=ZLIB.Z_DATA_ERROR;break t;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return X(s),(i.wsize||l!=t.avail_out&&i.mode=r.wsize?r.window=d.output_data.substring(h-r.wsize):r.whave+h