fix minifed files
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Jul 23, 2024 at 14:03 UTC
5e71bcc634be3c85b9d683262164377e451ffd5e
11 files changed
+11
-11
public/scripts/agent-rdp-0.0.1-min.js
+1
-1
@@ -1 +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,2<t.length&&(o.consoleMessageArgs=[t[2]]),t[1]){case"NODE_RDP_PROTOCOL_X224_NEG_FAILURE":o.consoleMessageId=1==t[2]?9:2==t[2]?10:3==t[2]?11:4==t[2]?12:5==t[2]?13:6==t[2]?14:7;break;case"NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED":o.consoleMessageId=8;break;default:o.consoleMessageId=null}o.onConsoleMessageChange&&o.onConsoleMessageChange(),o.Stop();break;case"rdp-clipboard":o.lastClipboardContent=t[1],o.m.onClipboardChanged&&o.m.onClipboardChanged(t[1]);break;case"ping":o.socket.send('["pong"]')}}else o.bitmapData=e.data},o.socket.onclose=function(){c(0)},c(1)},o.Stop=function(){o.Canvas.fillRect(0,0,o.ScreenWidth,o.ScreenHeight),o.socket&&o.socket.close()},o.m.setClipboard=function(e){o.socket&&o.socket.send(JSON.stringify(["clipboard",e]))},o.m.getClipboard=function(){return o.lastClipboardContent},o.m.mousemove=function(e){if(o.socket&&3==o.State){var t=a(e);if(!(t.x<0||t.y<0||o.ScreenWidth<t.x||o.ScreenHeight<t.y))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=a(e);if(!(t.x<0||t.y<0||o.ScreenWidth<t.x||o.ScreenHeight<t.y))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=a(e);if(!(t.x<0||t.y<0||o.ScreenWidth<t.x||o.ScreenHeight<t.y))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=a(e);if(!(n.x<0||n.y<0||o.ScreenWidth<n.x||o.ScreenHeight<n.y))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 a in e)o.m.SendKeyMsgKC(e[a][0],e[a][1],e[a][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
1
+var CreateRDPDesktop=function(e,a){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 s(e){var t=o.Canvas.canvas.height/o.CanvasId.clientHeight,n=o.Canvas.canvas.width/o.CanvasId.clientWidth,s=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-s[0])*n,s=(e.pageY-s[1])*t;return e.addx&&(n+=e.addx),e.addy&&(s+=e.addy),{x:n,y:s}}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 s={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&&(s.width=o.ScreenWidth=o.width=n.width,s.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+a+"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:s,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,2<t.length&&(o.consoleMessageArgs=[t[2]]),t[1]){case"NODE_RDP_PROTOCOL_X224_NEG_FAILURE":1==t[2]?o.consoleMessageId=9:2==t[2]?o.consoleMessageId=10:3==t[2]?o.consoleMessageId=11:4==t[2]?o.consoleMessageId=12:5==t[2]?o.consoleMessageId=13:6==t[2]?o.consoleMessageId=14:o.consoleMessageId=7;break;case"NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED":o.consoleMessageId=8;break;default:o.consoleMessageId=null}o.onConsoleMessageChange&&o.onConsoleMessageChange(),o.Stop();break;case"rdp-clipboard":o.lastClipboardContent=t[1],o.m.onClipboardChanged&&o.m.onClipboardChanged(t[1]);break;case"ping":o.socket.send('["pong"]')}}else o.bitmapData=e.data},o.socket.onclose=function(){c(0)},c(1)},o.Stop=function(){o.Canvas.fillRect(0,0,o.ScreenWidth,o.ScreenHeight),o.socket&&o.socket.close()},o.m.setClipboard=function(e){o.socket&&o.socket.send(JSON.stringify(["clipboard",e]))},o.m.getClipboard=function(){return o.lastClipboardContent},o.m.mousemove=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 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
public/scripts/amt-desktop-0.0.2-min.js
+1
-1
@@ -1 +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<i;d++)y(e[t++]+(e[t++]<<8),d);else for(d=0;d<i;d++)C(e[t++],d);w(S.spare,a,n)}else if(1==l){S.graymode?(c=e[t++],S.lowcolor&&(c<<=4),S.canvas.fillStyle="rgb("+c+","+c+","+c+")"):(c=e[t++]+(2==S.bpp?e[t++]<<8:0),S.canvas.fillStyle="rgb("+(1==S.bpp?(224&c)+","+((28&c)<<3)+","+T((3&c)<<6):(c>>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<l&&l<17){var g=4,p=15;if(2==S.bpp){for(d=0;d<l;d++)v[d]=e[t++]+(e[t++]<<8);for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)y(v[c>>d&p],u++)}else{for(d=0;d<l;d++)v[d]=e[t++];for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)C(v[c>>d&p],u++)}w(S.spare,a,n)}else if(128==l){if(2==S.bpp)for(;u<i&&t<e.byteLength;){for(c=e[t++]+(e[t++]<<8),m=1;m+=h=e[t++],255==h;);if(0==S.rotation)D(c,u,m),u+=m;else for(;0<=--m;)y(c,u++)}else for(;u<i&&t<e.byteLength;){for(c=e[t++],m=1;m+=h=e[t++],255==h;);if(0==S.rotation)b(c,u,m),u+=m;else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}else if(129<l){if(2==S.bpp)for(d=0;d<l-128;d++)v[d]=e[t++]+(e[t++]<<8);else for(d=0;d<l-128;d++)v[d]=e[t++];for(;u<i&&t<e.byteLength;){if(m=1,c=v[(s=e[t++])%128],127<s)for(;m+=h=e[t++],255==h;);if(0==S.rotation)(2==S.bpp?D:b)(c,u,m),u+=m;else if(2==S.bpp)for(;0<=--m;)y(c,u++);else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}}function w(e,t,a){var n,r,o;1!=S.holding&&(n=t,r=a,n=0==S.rotation?n:1==S.rotation?S.canvas.canvas.width-S.sparew2-r:2==S.rotation?S.canvas.canvas.width-S.sparew2-n:3==S.rotation?r:0,r=t,o=a,a=0==S.rotation?o:1==S.rotation?r:2==S.rotation?S.canvas.canvas.height-S.spareh2-o:3==S.rotation?S.canvas.canvas.height-S.spareh-r:0,S.canvas.putImageData(e,t=n,a))}function C(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.graymode?(S.lowcolor&&(e<<=4),S.spare.data[r]=S.spare.data[r+1]=S.spare.data[r+2]=e):(S.spare.data[r]=224&e,S.spare.data[r+1]=(28&e)<<3,S.spare.data[r+2]=T((3&e)<<6))}function y(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.spare.data[r]=e>>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<e?e+32:e}function K(){var e;1!=S.holding&&(0<S.focusmode?(e=2*S.focusmode,S.send(String.fromCharCode(3,1)+ShortToStr(Math.max(Math.min(S.ox,S.mx)-S.focusmode,0))+ShortToStr(Math.max(Math.min(S.oy,S.my)-S.focusmode,0))+ShortToStr(e+Math.abs(S.ox-S.mx))+ShortToStr(e+Math.abs(S.oy-S.my))),S.ox=S.mx,S.oy=S.my):S.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(S.rwidth)+ShortToStr(S.rheight)))}S.canvasid=e,S.CanvasId=Q(e),S.scrolldiv=t,S.canvas=Q(e).getContext("2d"),S.protocol=2,S.state=0,S.acc=null,S.ScreenWidth=960,S.ScreenHeight=700,S.width=0,S.height=0,S.rwidth=0,S.rheight=0,S.bpp=2,S.useRLE=!0,S.showmouse=!0,S.buttonmask=0,S.localKeyMap=!0,S.spare=null,S.sparew=0,S.spareh=0,S.sparew2=0,S.spareh2=0,S.sparecache={},S.onScreenSizeChange=null,S.frameRateDelay=0,S.noMouseRotate=!1,S.rotation=0,S.kvmDataSupported=!1,S.onKvmData=null,S.onKvmDataPending=[],S.onKvmDataAck=-1,S.holding=!1,S.lastKeepAlive=Date.now(),S.kvmExt={},S.kvmExtChanged=null,S.useZLib=!1,S.decimationMode=0,S.graymode=!1,S.lowcolor=!1,S.mNagleTimer=null,S.mx=0,S.my=0,S.ox=-1,S.oy=-1,S.focusmode=0,S.inflate=ZLIB.inflateInit(-15),S.xxStateChange=function(e){0==e?(S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),S.canvas.canvas.width=S.rwidth=S.width=640,S.canvas.canvas.height=S.rheight=S.height=400,QS(S.canvasid).cursor="default"):QS(S.canvasid).cursor=S.showmouse?"default":"none"},S.ProcessBinaryData=function(e){var t;for(null!=S.recordedData&&!0!==S.recordedHolding&&S.recordedData.push(I(2,1,String.fromCharCode.apply(null,new Uint8Array(e)))),null==S.acc?S.acc=new Uint8Array(e):((t=new Uint8Array(S.acc.byteLength+e.byteLength)).set(S.acc,0),t.set(new Uint8Array(e),S.acc.byteLength),S.acc=t);null!=S.acc&&0<S.acc.byteLength;){var a=0,n=new DataView(S.acc.buffer);if(0==S.state&&12<=S.acc.byteLength)a=12,S.state=1,S.parent&&delete S.parent.connectTime,S.send("RFB 003.008\n");else if(1==S.state&&1<=S.acc.byteLength)a=S.acc[0]+1,S.send(String.fromCharCode(1)),S.state=2;else if(2==S.state&&4<=S.acc.byteLength){if(a=4,0!=n.getUint32(0))return S.Stop();S.send(String.fromCharCode(1)),S.state=3,S.parent&&(S.parent.disconnectCode=5e4)}else if(3==S.state&&24<=S.acc.byteLength){S.rotation=0;var r=n.getUint32(20);if(S.acc.byteLength<24+r)return;a=24+r,S.canvas.canvas.width=S.rwidth=S.width=S.ScreenWidth=n.getUint16(0),S.canvas.canvas.height=S.rheight=S.height=S.ScreenHeight=n.getUint16(2),S.DeskRecordServerInit=String.fromCharCode.apply(null,new Uint8Array(S.acc.buffer.slice(0,24+r)));r="";S.useRLE&&(r+=IntToStr(16)),r=(r+=IntToStr(0))+IntToStr(1092),S.send(String.fromCharCode(2,0)+ShortToStr(r.length/4+1)+r+IntToStr(-223)),0==S.graymode?1==S.bpp&&S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(2==S.bpp&&(S.bpp=1),0==S.lowcolor?S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)):S.send(String.fromCharCode(0,0,0,0,8,4,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0))),S.state=4,S.parent&&(S.parent.connectTime=Date.now(),S.parent.disconnectCode=0,S.parent.xxStateChange(3)),S.ox=-1,null!=S.kvmExtChanged&&(0<S.decimationMode&&S.sendKvmExtCmd(2,S.decimationMode),S.sendKvmExtCmd(4,!0===S.useZLib?1:0)),K(),null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&(S.parent.disconnectCode=50001,9216e3<S.bpp*S.width*S.height)&&(S.parent.disconnectCode=50002)}else if(4==S.state)switch(S.acc[0]){case 0:if(S.acc.byteLength<4)return;S.state=100+n.getUint16(2),a=4,!0===S.recordedHolding&&(delete S.recordedHolding,S.recordedData.push(I(2,1,String.fromCharCode.apply(null,S.acc))));break;case 2:a=1;break;case 3:if(S.acc.byteLength<8)return;var o=n.getUint32(4)+8;if(S.acc.byteLength<o)return;a=function(e,t){if(e.byteLength<8)return 0;t=t.getUint32(4)+8;if(e.byteLength<t)return 0;if(null!=S.onKvmData){e=g(new Uint8Array(e.buffer.slice(8,t)));if(16<=e.length&&"\0KvmDataChannel"==e.substring(0,15)){0==S.kvmDataSupported&&(S.kvmDataSupported=!0),(-1==S.onKvmDataAck&&16==e.length||0!=e.charCodeAt(15))&&(S.onKvmDataAck=!0);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Recv("+(e.length-16)+"): "+e.substring(16))}catch(e){}16<=e.length&&S.onKvmData(e.substring(16)),1==S.onKvmDataAck&&0<S.onKvmDataPending.length&&S.sendKvmData(S.onKvmDataPending.shift())}else if(13<=e.length&&"\0KvmExtCmd\0"==e.substring(0,11)){var a=e.charCodeAt(11),n=e.charCodeAt(12);1==a&&(S.kvmExt.decimationMode=n,13<e.length&&(S.kvmExt.decimationState=e.charCodeAt(13)),null!=S.kvmExtChanged)&&S.kvmExtChanged(1,S.kvmExt,S.kvmExt),2==a&&S.sendKvmExtCmd(1),3==a&&(S.kvmExt.compression=n,null!=S.kvmExtChanged)&&S.kvmExtChanged(3,S.kvmExt),4==a&&S.sendKvmExtCmd(3)}else{console.log("Got KVM clipboard data:",e);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Recv("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}}}return t}(S.acc,n)}else if(100<S.state&&12<=S.acc.byteLength){var r=n.getUint16(0),i=n.getUint16(2),s=n.getUint16(4),c=n.getUint16(6),h=s*c,d=n.getUint32(8);if(d<17){if(s<1||64<s||c<1||64<c)return console.log("Invalid tile size ("+s+","+c+"), disconnecting."),S.Stop();if(S.sparew!=s||S.spareh!=c){S.sparew=S.sparew2=s,S.spareh=S.spareh2=c,1!=S.rotation&&3!=S.rotation||(S.sparew2=c,S.spareh2=s);var l=S.sparew2+"x"+S.spareh2;if(S.spare=S.sparecache[l],!S.spare){S.sparecache[l]=S.spare=S.canvas.createImageData(S.sparew2,S.spareh2);for(var v=S.sparew2*S.spareh2<<2,u=3;u<v;u+=4)S.spare.data[u]=255}}}if(4294967073==d)S.canvas.canvas.width=S.rwidth=S.width=s,S.canvas.canvas.height=S.rheight=S.height=c,S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height)),a=12,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&9216e3<S.bpp*S.width*S.height&&(S.parent.disconnectCode=50002);else if(0==d){var m=12,l=12+h*S.bpp;if(S.acc.byteLength<l)return;if(a=l,2==S.bpp)for(u=0;u<h;u++)y(n.getUint16(m,!0),u),m+=2;else for(u=0;u<h;u++)C(S.acc[m++],u);w(S.spare,r,i)}else{if(16!=d)return S.Stop();if(S.acc.byteLength<16)return;d=n.getUint32(12);if(S.acc.byteLength<16+d)return;var f,m=16;5<d&&0==S.acc[m]&&n.getUint16(m+1,!0)==d-5?p(S.acc,m+5,r,i,s,c,h):0<(f=S.inflate.inflate(g(new Uint8Array(S.acc.buffer.slice(m,+(m+d)))))).length?p(function(e){for(var t=new Uint8Array(e.length),a=0,n=e.length;a<n;++a)t[a]=e.charCodeAt(a);return t}(f),0,r,i,s,c,h):console.log("Invalid deflate data"),a=16+d}100==--S.state&&(S.state=4,0==S.frameRateDelay?K():setTimeout(K,S.frameRateDelay))}if(0==a)return;a!=S.acc.byteLength?S.acc=new Uint8Array(S.acc.buffer.slice(a)):S.acc=null}},S.hold=function(e){S.holding!=e&&(S.holding=e,S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),0==S.holding?(S.canvas.canvas.width==S.width&&S.canvas.canvas.height==S.height||(S.canvas.canvas.width=S.width,S.canvas.canvas.height=S.height,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight)),S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height))):(S.UnGrabMouseInput(),S.UnGrabKeyInput()))},S.tcanvas=null,S.setRotation=function(e){for(;e<0;)e+=4;var t,a,n,r=e%4;if(1!=S.holding)return r!=S.rotation&&(t=S.canvas.canvas.width,a=S.canvas.canvas.height,1!=S.rotation&&3!=S.rotation||(t=S.canvas.canvas.height,a=S.canvas.canvas.width),null==S.tcanvas&&(S.tcanvas=document.createElement("canvas")),(n=S.tcanvas.getContext("2d")).setTransform(1,0,0,1,0,0),n.canvas.width=t,n.canvas.height=a,n.rotate(-90*S.rotation*Math.PI/180),0==S.rotation&&n.drawImage(S.canvas.canvas,0,0),1==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,0),2==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,-S.canvas.canvas.height),3==S.rotation&&n.drawImage(S.canvas.canvas,0,-S.canvas.canvas.height),0!=S.rotation&&2!=S.rotation||(S.canvas.canvas.height=t,S.canvas.canvas.width=a),1!=S.rotation&&3!=S.rotation||(S.canvas.canvas.height=a,S.canvas.canvas.width=t),S.canvas.setTransform(1,0,0,1,0,0),S.canvas.rotate(90*r*Math.PI/180),S.rotation=r,S.canvas.drawImage(S.tcanvas,k(0),x(0,0)),S.width=S.canvas.canvas.width,S.height=S.canvas.canvas.height,null!=S.onScreenResize)&&S.onScreenResize(S,S.width,S.height,S.CanvasId),!0;S.rotation=r},S.Start=function(){for(var e in S.state=0,S.acc=null,S.inflate.inflateReset(),S.onKvmDataPending=[],S.onKvmDataAck=-1,S.kvmDataSupported=!1,S.kvmExt={},S.sparecache)delete S.sparecache[e]},S.Stop=function(){S.UnGrabMouseInput(),S.UnGrabKeyInput(),S.parent&&S.parent.Stop()},S.send=function(e){S.parent&&S.parent.send(e)};var r={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};function a(e,t){var a,n;return(t=t||window.event).code&&0==S.localKeyMap?null!=(n=(n=t).code.startsWith("Key")&&4==n.code.length?n.code.charCodeAt(3)+(0==n.shiftKey?32:0):n.code.startsWith("Digit")&&6==n.code.length?n.code.charCodeAt(5):n.code.startsWith("Numpad")&&7==n.code.length?n.code.charCodeAt(6):r[n.code])&&S.sendkey(n,e):(a=222==(n=t.keyCode)?39:221==n?93:220==n?92:219==n?91:192==n?96:191==n?47:190==n?46:189==n?45:188==n?44:187==n?61:186==n?59:111==n?47:110==n?46:109==n?45:107==n?43:106==n?42:96<=n&&n<=105?n-48:46==n?65535:45==n?65379:40==n?65364:39==n?65363:38==n?65362:37==n?65361:36==n?65360:35==n?65367:34==n?65366:33==n?65365:27==n?65307:18==n?65513:17==n?65507:16==n?65505:13==n?65293:9==n?65289:8==n?65288:112<=n&&n<=124?n+65358:0==t.shiftKey&&65<=n&&n<=90?n+32:n,S.sendkey(a,e)),S.haltEvent(t)}S.sendkey=function(e,t){if("object"==typeof e){var a,n="";for(a in e)n+=String.fromCharCode(4,e[a][1],0,0)+IntToStr(e[a][0]);S.send(n)}else S.send(String.fromCharCode(4,t,0,0)+IntToStr(e))},S.sendKvmExtCmd=function(e,t){e="\0KvmExtCmd\0"+String.fromCharCode(e)+(null!=t?String.fromCharCode(t):"");S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.sendKvmData=function(e){if(!0!==S.onKvmDataAck)S.onKvmDataPending.push(e);else{try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Send("+e.length+"): "+e)}catch(e){}e="\0KvmDataChannel\0"+e,S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e),S.onKvmDataAck=!1}},S.sendKeepAlive=function(){S.lastKeepAlive<Date.now()-5e3&&(S.lastKeepAlive=Date.now(),S.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0"))},S.sendClipboardData=function(e){try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Send("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.SendCtrlAltDelMsg=function(){S.sendcad()};var n=!(S.sendcad=function(){S.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])}),o=!1;function I(e,t,a){var n=Date.now();return"number"==typeof a?(S.recordedSize+=a,ShortToStr(e)+ShortToStr(t)+IntToStr(a)+IntToStr(n>>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<a?3:4),S.mousemove(e,1),S.buttonmask=t,S.mousemove(e,1)},S.mousedown=function(e){return S.buttonmask|=1<<e.button,S.mousemove(e,1)},S.mouseup=function(e){return S.buttonmask&=65535-(1<<e.button),S.mousemove(e,1)},S.mousemove=function(e,t){var a,n,r,o,i,s;return S.state<4||(r=S.canvas.canvas.height/Q(S.canvasid).offsetHeight,n=S.canvas.canvas.width/Q(S.canvasid).offsetWidth,a=S.getPositionOfControl(Q(S.canvasid)),S.mx=(event.pageX-a[0])*n,S.my=(event.pageY-a[1])*r,event.addx&&(S.mx+=event.addx),event.addy&&(S.my+=event.addy),1!=S.rotation&&3!=S.rotation||(S.mx=S.mx*S.rwidth/S.width,S.my=S.my*S.rheight/S.height),1!=S.noMouseRotate&&(n=S.mx,a=S.my,r=0==S.rotation?n:1==S.rotation?a:2==S.rotation?S.canvas.canvas.width-n:3==S.rotation?S.canvas.canvas.height-a:0,S.my=(n=S.mx,a=S.my,0==S.rotation?a:1==S.rotation?S.canvas.canvas.width-n:2==S.rotation?S.canvas.canvas.height-a:3==S.rotation?n:0),S.mx=r),1==t?(S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),null!=S.mNagleTimer&&(clearTimeout(S.mNagleTimer),S.mNagleTimer=null)):null==S.mNagleTimer&&(S.mNagleTimer=setTimeout(function(){S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),S.mNagleTimer=null},50)),QV("DeskFocus",S.focusmode),0!=S.focusmode&&(a=Math.min(S.mx,S.canvas.canvas.width-S.focusmode),n=Math.min(S.my,S.canvas.canvas.height-S.focusmode),r=2*S.focusmode,o=(t=Q(S.canvasid)).offsetHeight/S.canvas.canvas.height,t=t.offsetWidth/S.canvas.canvas.width,i=QS("DeskFocus"),s=S.getPositionOfControl(Q(S.canvasid).parentElement),i.left=Math.max((a-S.focusmode)*o,0)+(pos[0]-s[0])+"px",i.top=Math.max((n-S.focusmode)*t,0)+(pos[1]-s[1])+"px",i.width=r*o-6+"px",i.height=r*o-6+"px"),S.haltEvent(e))},S.getPositionOfControl=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},S.StartRecording=function(){return(null==S.recordedData||null==S.DeskRecordServerInit)&&(S.recordedHolding=!0,S.recordedData=[],S.recordedStart=Date.now(),S.recordedSize=0,S.recordedData.push(I(1,0,JSON.stringify({magic:"MeshCentralRelaySession",ver:1,time:(new Date).toLocaleString(),protocol:200,bpp:S.bpp,graymode:S.graymode,lowcolor:S.lowcolor,screenSize:[S.width,S.height]}))),S.DeskRecordServerInit=String.fromCharCode(S.width>>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
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<i;d++)y(e[t++]+(e[t++]<<8),d);else for(d=0;d<i;d++)C(e[t++],d);w(S.spare,a,n)}else if(1==l){S.graymode?(c=e[t++],S.lowcolor&&(c<<=4),S.canvas.fillStyle="rgb("+c+","+c+","+c+")"):(c=e[t++]+(2==S.bpp?e[t++]<<8:0),S.canvas.fillStyle="rgb("+(1==S.bpp?(224&c)+","+((28&c)<<3)+","+T((3&c)<<6):(c>>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<l&&l<17){var g=4,p=15;if(2==S.bpp){for(d=0;d<l;d++)v[d]=e[t++]+(e[t++]<<8);for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)y(v[c>>d&p],u++)}else{for(d=0;d<l;d++)v[d]=e[t++];for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)C(v[c>>d&p],u++)}w(S.spare,a,n)}else if(128==l){if(2==S.bpp)for(;u<i&&t<e.byteLength;){for(c=e[t++]+(e[t++]<<8),m=1;m+=h=e[t++],255==h;);if(0==S.rotation)D(c,u,m),u+=m;else for(;0<=--m;)y(c,u++)}else for(;u<i&&t<e.byteLength;){for(c=e[t++],m=1;m+=h=e[t++],255==h;);if(0==S.rotation)b(c,u,m),u+=m;else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}else if(129<l){if(2==S.bpp)for(d=0;d<l-128;d++)v[d]=e[t++]+(e[t++]<<8);else for(d=0;d<l-128;d++)v[d]=e[t++];for(;u<i&&t<e.byteLength;){if(m=1,c=v[(s=e[t++])%128],127<s)for(;m+=h=e[t++],255==h;);if(0==S.rotation)(2==S.bpp?D:b)(c,u,m),u+=m;else if(2==S.bpp)for(;0<=--m;)y(c,u++);else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}}function w(e,t,a){var n,r,o;1!=S.holding&&(n=t,r=a,n=0==S.rotation?n:1==S.rotation?S.canvas.canvas.width-S.sparew2-r:2==S.rotation?S.canvas.canvas.width-S.sparew2-n:3==S.rotation?r:0,r=t,o=a,a=0==S.rotation?o:1==S.rotation?r:2==S.rotation?S.canvas.canvas.height-S.spareh2-o:3==S.rotation?S.canvas.canvas.height-S.spareh-r:0,S.canvas.putImageData(e,t=n,a))}function C(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.graymode?(S.lowcolor&&(e<<=4),S.spare.data[r]=S.spare.data[r+1]=S.spare.data[r+2]=e):(S.spare.data[r]=224&e,S.spare.data[r+1]=(28&e)<<3,S.spare.data[r+2]=T((3&e)<<6))}function y(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.spare.data[r]=e>>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<e?e+32:e}function K(){var e;1!=S.holding&&(0<S.focusmode?(e=2*S.focusmode,S.send(String.fromCharCode(3,1)+ShortToStr(Math.max(Math.min(S.ox,S.mx)-S.focusmode,0))+ShortToStr(Math.max(Math.min(S.oy,S.my)-S.focusmode,0))+ShortToStr(e+Math.abs(S.ox-S.mx))+ShortToStr(e+Math.abs(S.oy-S.my))),S.ox=S.mx,S.oy=S.my):S.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(S.rwidth)+ShortToStr(S.rheight)))}S.canvasid=e,S.CanvasId=Q(e),S.scrolldiv=t,S.canvas=Q(e).getContext("2d"),S.protocol=2,S.state=0,S.acc=null,S.ScreenWidth=960,S.ScreenHeight=700,S.width=0,S.height=0,S.rwidth=0,S.rheight=0,S.bpp=2,S.useRLE=!0,S.showmouse=!0,S.buttonmask=0,S.localKeyMap=!0,S.spare=null,S.sparew=0,S.spareh=0,S.sparew2=0,S.spareh2=0,S.sparecache={},S.onScreenSizeChange=null,S.frameRateDelay=0,S.noMouseRotate=!1,S.rotation=0,S.kvmDataSupported=!1,S.onKvmData=null,S.onKvmDataPending=[],S.onKvmDataAck=-1,S.holding=!1,S.lastKeepAlive=Date.now(),S.kvmExt={},S.kvmExtChanged=null,S.useZLib=!1,S.decimationMode=0,S.graymode=!1,S.lowcolor=!1,S.mNagleTimer=null,S.mx=0,S.my=0,S.ox=-1,S.oy=-1,S.focusmode=0,S.inflate=ZLIB.inflateInit(-15),S.xxStateChange=function(e){0==e?(S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),S.canvas.canvas.width=S.rwidth=S.width=640,S.canvas.canvas.height=S.rheight=S.height=400,QS(S.canvasid).cursor="default"):QS(S.canvasid).cursor=S.showmouse?"default":"none"},S.ProcessBinaryData=function(e){var t;for(null!=S.recordedData&&!0!==S.recordedHolding&&S.recordedData.push(I(2,1,String.fromCharCode.apply(null,new Uint8Array(e)))),null==S.acc?S.acc=new Uint8Array(e):((t=new Uint8Array(S.acc.byteLength+e.byteLength)).set(S.acc,0),t.set(new Uint8Array(e),S.acc.byteLength),S.acc=t);null!=S.acc&&0<S.acc.byteLength;){var a=0,n=new DataView(S.acc.buffer);if(0==S.state&&12<=S.acc.byteLength)a=12,S.state=1,S.parent&&delete S.parent.connectTime,S.send("RFB 003.008\n");else if(1==S.state&&1<=S.acc.byteLength)a=S.acc[0]+1,S.send(String.fromCharCode(1)),S.state=2;else if(2==S.state&&4<=S.acc.byteLength){if(a=4,0!=n.getUint32(0))return S.Stop();S.send(String.fromCharCode(1)),S.state=3,S.parent&&(S.parent.disconnectCode=5e4)}else if(3==S.state&&24<=S.acc.byteLength){S.rotation=0;var r=n.getUint32(20);if(S.acc.byteLength<24+r)return;a=24+r,S.canvas.canvas.width=S.rwidth=S.width=S.ScreenWidth=n.getUint16(0),S.canvas.canvas.height=S.rheight=S.height=S.ScreenHeight=n.getUint16(2),S.DeskRecordServerInit=String.fromCharCode.apply(null,new Uint8Array(S.acc.buffer.slice(0,24+r)));r="";S.useRLE&&(r+=IntToStr(16)),r=(r+=IntToStr(0))+IntToStr(1092),S.send(String.fromCharCode(2,0)+ShortToStr(r.length/4+1)+r+IntToStr(-223)),0==S.graymode?1==S.bpp&&S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(2==S.bpp&&(S.bpp=1),0==S.lowcolor?S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)):S.send(String.fromCharCode(0,0,0,0,8,4,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0))),S.state=4,S.parent&&(S.parent.connectTime=Date.now(),S.parent.disconnectCode=0,S.parent.xxStateChange(3)),S.ox=-1,null!=S.kvmExtChanged&&(0<S.decimationMode&&S.sendKvmExtCmd(2,S.decimationMode),S.sendKvmExtCmd(4,!0===S.useZLib?1:0)),K(),null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&(S.parent.disconnectCode=50001,9216e3<S.bpp*S.width*S.height)&&(S.parent.disconnectCode=50002)}else if(4==S.state)switch(S.acc[0]){case 0:if(S.acc.byteLength<4)return;S.state=100+n.getUint16(2),a=4,!0===S.recordedHolding&&(delete S.recordedHolding,S.recordedData.push(I(2,1,String.fromCharCode.apply(null,S.acc))));break;case 2:a=1;break;case 3:if(S.acc.byteLength<8)return;var o=n.getUint32(4)+8;if(S.acc.byteLength<o)return;a=function(e,t){if(e.byteLength<8)return 0;t=t.getUint32(4)+8;if(e.byteLength<t)return 0;if(null!=S.onKvmData){e=g(new Uint8Array(e.buffer.slice(8,t)));if(16<=e.length&&"\0KvmDataChannel"==e.substring(0,15)){0==S.kvmDataSupported&&(S.kvmDataSupported=!0),(-1==S.onKvmDataAck&&16==e.length||0!=e.charCodeAt(15))&&(S.onKvmDataAck=!0);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Recv("+(e.length-16)+"): "+e.substring(16))}catch(e){}16<=e.length&&S.onKvmData(e.substring(16)),1==S.onKvmDataAck&&0<S.onKvmDataPending.length&&S.sendKvmData(S.onKvmDataPending.shift())}else if(13<=e.length&&"\0KvmExtCmd\0"==e.substring(0,11)){var a=e.charCodeAt(11),n=e.charCodeAt(12);1==a&&(S.kvmExt.decimationMode=n,13<e.length&&(S.kvmExt.decimationState=e.charCodeAt(13)),null!=S.kvmExtChanged)&&S.kvmExtChanged(1,S.kvmExt,S.kvmExt),2==a&&S.sendKvmExtCmd(1),3==a&&(S.kvmExt.compression=n,null!=S.kvmExtChanged)&&S.kvmExtChanged(3,S.kvmExt),4==a&&S.sendKvmExtCmd(3)}else{console.log("Got KVM clipboard data:",e);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Recv("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}}}return t}(S.acc,n)}else if(100<S.state&&12<=S.acc.byteLength){var r=n.getUint16(0),i=n.getUint16(2),s=n.getUint16(4),c=n.getUint16(6),h=s*c,d=n.getUint32(8);if(d<17){if(s<1||64<s||c<1||64<c)return console.log("Invalid tile size ("+s+","+c+"), disconnecting."),S.Stop();if(S.sparew!=s||S.spareh!=c){S.sparew=S.sparew2=s,S.spareh=S.spareh2=c,1!=S.rotation&&3!=S.rotation||(S.sparew2=c,S.spareh2=s);var l=S.sparew2+"x"+S.spareh2;if(S.spare=S.sparecache[l],!S.spare){S.sparecache[l]=S.spare=S.canvas.createImageData(S.sparew2,S.spareh2);for(var v=S.sparew2*S.spareh2<<2,u=3;u<v;u+=4)S.spare.data[u]=255}}}if(4294967073==d)S.canvas.canvas.width=S.rwidth=S.width=s,S.canvas.canvas.height=S.rheight=S.height=c,S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height)),a=12,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&9216e3<S.bpp*S.width*S.height&&(S.parent.disconnectCode=50002);else if(0==d){var m=12,l=12+h*S.bpp;if(S.acc.byteLength<l)return;if(a=l,2==S.bpp)for(u=0;u<h;u++)y(n.getUint16(m,!0),u),m+=2;else for(u=0;u<h;u++)C(S.acc[m++],u);w(S.spare,r,i)}else{if(16!=d)return S.Stop();if(S.acc.byteLength<16)return;d=n.getUint32(12);if(S.acc.byteLength<16+d)return;var f,m=16;5<d&&0==S.acc[m]&&n.getUint16(m+1,!0)==d-5?p(S.acc,m+5,r,i,s,c,h):0<(f=S.inflate.inflate(g(new Uint8Array(S.acc.buffer.slice(m,+(m+d)))))).length?p(function(e){for(var t=new Uint8Array(e.length),a=0,n=e.length;a<n;++a)t[a]=e.charCodeAt(a);return t}(f),0,r,i,s,c,h,f.length):console.log("Invalid deflate data"),a=16+d}100==--S.state&&(S.state=4,0==S.frameRateDelay?K():setTimeout(K,S.frameRateDelay))}if(0==a)return;a!=S.acc.byteLength?S.acc=new Uint8Array(S.acc.buffer.slice(a)):S.acc=null}},S.hold=function(e){S.holding!=e&&(S.holding=e,S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),0==S.holding?(S.canvas.canvas.width==S.width&&S.canvas.canvas.height==S.height||(S.canvas.canvas.width=S.width,S.canvas.canvas.height=S.height,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight)),S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height))):(S.UnGrabMouseInput(),S.UnGrabKeyInput()))},S.tcanvas=null,S.setRotation=function(e){for(;e<0;)e+=4;var t,a,n,r=e%4;if(1!=S.holding)return r!=S.rotation&&(t=S.canvas.canvas.width,a=S.canvas.canvas.height,1!=S.rotation&&3!=S.rotation||(t=S.canvas.canvas.height,a=S.canvas.canvas.width),null==S.tcanvas&&(S.tcanvas=document.createElement("canvas")),(n=S.tcanvas.getContext("2d")).setTransform(1,0,0,1,0,0),n.canvas.width=t,n.canvas.height=a,n.rotate(-90*S.rotation*Math.PI/180),0==S.rotation&&n.drawImage(S.canvas.canvas,0,0),1==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,0),2==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,-S.canvas.canvas.height),3==S.rotation&&n.drawImage(S.canvas.canvas,0,-S.canvas.canvas.height),0!=S.rotation&&2!=S.rotation||(S.canvas.canvas.height=t,S.canvas.canvas.width=a),1!=S.rotation&&3!=S.rotation||(S.canvas.canvas.height=a,S.canvas.canvas.width=t),S.canvas.setTransform(1,0,0,1,0,0),S.canvas.rotate(90*r*Math.PI/180),S.rotation=r,S.canvas.drawImage(S.tcanvas,k(0),x(0,0)),S.width=S.canvas.canvas.width,S.height=S.canvas.canvas.height,null!=S.onScreenResize)&&S.onScreenResize(S,S.width,S.height,S.CanvasId),!0;S.rotation=r},S.Start=function(){for(var e in S.state=0,S.acc=null,S.inflate.inflateReset(),S.onKvmDataPending=[],S.onKvmDataAck=-1,S.kvmDataSupported=!1,S.kvmExt={},S.sparecache)delete S.sparecache[e]},S.Stop=function(){S.UnGrabMouseInput(),S.UnGrabKeyInput(),S.parent&&S.parent.Stop()},S.send=function(e){S.parent&&S.parent.send(e)};var r={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};function a(e,t){var a,n;return(t=t||window.event).code&&0==S.localKeyMap?null!=(n=(n=t).code.startsWith("Key")&&4==n.code.length?n.code.charCodeAt(3)+(0==n.shiftKey?32:0):n.code.startsWith("Digit")&&6==n.code.length?n.code.charCodeAt(5):n.code.startsWith("Numpad")&&7==n.code.length?n.code.charCodeAt(6):r[n.code])&&S.sendkey(n,e):(a=n=t.keyCode,0==t.shiftKey&&65<=n&&n<=90&&(a=n+32),112<=n&&n<=124&&(a=n+65358),8==n&&(a=65288),9==n&&(a=65289),13==n&&(a=65293),16==n&&(a=65505),17==n&&(a=65507),18==n&&(a=65513),27==n&&(a=65307),33==n&&(a=65365),34==n&&(a=65366),35==n&&(a=65367),36==n&&(a=65360),37==n&&(a=65361),38==n&&(a=65362),39==n&&(a=65363),40==n&&(a=65364),45==n&&(a=65379),46==n&&(a=65535),96<=n&&n<=105&&(a=n-48),106==n&&(a=42),107==n&&(a=43),109==n&&(a=45),110==n&&(a=46),111==n&&(a=47),186==n&&(a=59),187==n&&(a=61),188==n&&(a=44),189==n&&(a=45),190==n&&(a=46),191==n&&(a=47),192==n&&(a=96),219==n&&(a=91),220==n&&(a=92),221==n&&(a=93),S.sendkey(a=222==n?39:a,e)),S.haltEvent(t)}S.sendkey=function(e,t){if("object"==typeof e){var a,n="";for(a in e)n+=String.fromCharCode(4,e[a][1],0,0)+IntToStr(e[a][0]);S.send(n)}else S.send(String.fromCharCode(4,t,0,0)+IntToStr(e))},S.sendKvmExtCmd=function(e,t){e="\0KvmExtCmd\0"+String.fromCharCode(e)+(null!=t?String.fromCharCode(t):"");S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.sendKvmData=function(e){if(!0!==S.onKvmDataAck)S.onKvmDataPending.push(e);else{try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Send("+e.length+"): "+e)}catch(e){}e="\0KvmDataChannel\0"+e,S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e),S.onKvmDataAck=!1}},S.sendKeepAlive=function(){S.lastKeepAlive<Date.now()-5e3&&(S.lastKeepAlive=Date.now(),S.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0"))},S.sendClipboardData=function(e){try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Send("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.SendCtrlAltDelMsg=function(){S.sendcad()};var n=!(S.sendcad=function(){S.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])}),o=!1;function I(e,t,a){var n=Date.now();return"number"==typeof a?(S.recordedSize+=a,ShortToStr(e)+ShortToStr(t)+IntToStr(a)+IntToStr(n>>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<a?3:4),S.mousemove(e,1),S.buttonmask=t,S.mousemove(e,1)},S.mousedown=function(e){return S.buttonmask|=1<<e.button,S.mousemove(e,1)},S.mouseup=function(e){return S.buttonmask&=65535-(1<<e.button),S.mousemove(e,1)},S.mousemove=function(e,t){var a,n,r,o,i,s;return S.state<4||(r=S.canvas.canvas.height/Q(S.canvasid).offsetHeight,n=S.canvas.canvas.width/Q(S.canvasid).offsetWidth,a=S.getPositionOfControl(Q(S.canvasid)),S.mx=(event.pageX-a[0])*n,S.my=(event.pageY-a[1])*r,event.addx&&(S.mx+=event.addx),event.addy&&(S.my+=event.addy),1!=S.rotation&&3!=S.rotation||(S.mx=S.mx*S.rwidth/S.width,S.my=S.my*S.rheight/S.height),1!=S.noMouseRotate&&(n=S.mx,a=S.my,r=0==S.rotation?n:1==S.rotation?a:2==S.rotation?S.canvas.canvas.width-n:3==S.rotation?S.canvas.canvas.height-a:0,S.my=(n=S.mx,a=S.my,0==S.rotation?a:1==S.rotation?S.canvas.canvas.width-n:2==S.rotation?S.canvas.canvas.height-a:3==S.rotation?n:0),S.mx=r),1==t?(S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),null!=S.mNagleTimer&&(clearTimeout(S.mNagleTimer),S.mNagleTimer=null)):null==S.mNagleTimer&&(S.mNagleTimer=setTimeout(function(){S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),S.mNagleTimer=null},50)),QV("DeskFocus",S.focusmode),0!=S.focusmode&&(a=Math.min(S.mx,S.canvas.canvas.width-S.focusmode),n=Math.min(S.my,S.canvas.canvas.height-S.focusmode),r=2*S.focusmode,o=(t=Q(S.canvasid)).offsetHeight/S.canvas.canvas.height,t=t.offsetWidth/S.canvas.canvas.width,i=QS("DeskFocus"),s=S.getPositionOfControl(Q(S.canvasid).parentElement),i.left=Math.max((a-S.focusmode)*o,0)+(pos[0]-s[0])+"px",i.top=Math.max((n-S.focusmode)*t,0)+(pos[1]-s[1])+"px",i.width=r*o-6+"px",i.height=r*o-6+"px"),S.haltEvent(e))},S.getPositionOfControl=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},S.StartRecording=function(){return(null==S.recordedData||null==S.DeskRecordServerInit)&&(S.recordedHolding=!0,S.recordedData=[],S.recordedStart=Date.now(),S.recordedSize=0,S.recordedData.push(I(1,0,JSON.stringify({magic:"MeshCentralRelaySession",ver:1,time:(new Date).toLocaleString(),protocol:200,bpp:S.bpp,graymode:S.graymode,lowcolor:S.lowcolor,screenSize:[S.width,S.height]}))),S.DeskRecordServerInit=String.fromCharCode(S.width>>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
public/scripts/amt-redir-ws-0.1.0-min.js
+1
-1
@@ -1 +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;i<o;i++)s.push(r[9+i]);var l=new Uint8Array(y.acc.slice(9,9+o)),n=9+o;if(0==c)0<=s.indexOf(4)?y.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(y.user.length+y.authuri.length+8)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(0,0)+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(0,0,0,0)):y.Stop(2);else if(3!=c&&4!=c||1!=a)if(0==a)switch(y.protocol){case 1:y.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0));break;case 2:y.directSend(new Uint8Array([64,0,0,0,0,0,0,0]));break;case 3:y.connectstate=1,y.xxStateChange(3)}else y.Stop(3);else{var h=0,u=l[0],S=x(new Uint8Array(l.buffer.slice(1,1+u))),u=l[h+=u+1],d=x(new Uint8Array(l.buffer.slice(h+1,h+1+u))),u=(h+=u+1,null),f=function(e){for(var t="",n=0;n<e;n++)t+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return t}(32),g="00000002",C="",l=(4==c&&(m=l[h],u=x(new Uint8Array(l.buffer.slice(h+1,h+1+m))),C=g+":"+f+":"+u+":"),hex_md5(hex_md5(y.user+":"+S+":"+y.pass)+":"+d+":"+C+hex_md5("POST:"+y.authuri))),h=y.user.length+S.length+d.length+y.authuri.length+f.length+g.length+l.length+7,m=(4==c&&(h+=u.length+1),String.fromCharCode(19,0,0,0,c)+IntToStrX(h)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(S.length)+S+String.fromCharCode(d.length)+d+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(f.length)+f+String.fromCharCode(g.length)+g+String.fromCharCode(l.length)+l);4==c&&(m+=String.fromCharCode(u.length)+u),y.xxSend(m)}break;case 33:r.byteLength<23||(n=23,y.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(y.amtsequence++)+String.fromCharCode(0,0,27,0,0,0)),1==y.protocol&&(y.amtkeepalivetimer=setInterval(y.xxSendAmtKeepAlive,2e3)),y.connectstate=1,y.xxStateChange(3));break;case 41:r.byteLength<10||(n=10);break;case 42:r.byteLength<10||r.byteLength<(C=10+(r[9]<<8)+r[8])||(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(10,C))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(10,C)))),n=C);break;case 43:r.byteLength<8||(n=8);break;case 65:r.byteLength<8||(y.connectstate=1,y.m.Start(),8<r.byteLength&&(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(8))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(8))))),n=r.byteLength);break;case 240:y.serverIsRecording=!0,n=1;break;default:return console.log("Unknown Intel AMT command: "+r[0]+" acclen="+r.byteLength),void y.Stop(4)}if(0==n)return;n!=y.acc.byteLength?y.acc=y.acc.slice(n):y.acc=null}}},y.directSend=function(e){try{y.socket.send(e.buffer)}catch(e){}},y.xxSend=function(e){if(null!=y.socket&&y.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);try{y.socket.send(t.buffer)}catch(e){}}},y.Send=y.send=function(e){null!=y.socket&&1==y.connectstate&&y.xxSend(1==y.protocol?String.fromCharCode(40,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(e.length)+e:e)},y.xxSendAmtKeepAlive=function(){null!=y.socket&&y.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(y.amtsequence++))},y.xxOnSocketClosed=function(){0==y.inDataCount&&0==y.tlsv1only?(y.tlsv1only=1,y.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+y.host+"&port="+y.port+"&tls="+y.tls+"&tls1only=1"+("*"==y.user?"&serverauth=1":"")+("undefined"==typeof pass?"&serverauth=1&user="+y.user:"")),y.socket.binaryType="arraybuffer",y.socket.onopen=y.xxOnSocketConnected,y.socket.onmessage=y.xxOnMessage,y.socket.onclose=y.xxOnSocketClosed):y.Stop(5)},y.xxStateChange=function(e){y.State!=e&&(y.State=e,y.m.xxStateChange(y.State),null!=y.onStateChanged)&&y.onStateChanged(y,y.State)},y.Stop=function(e){y.xxStateChange(0),y.connectstate=-1,(y.acc=null)!=y.socket&&(y.socket.close(),y.socket=null),null!=y.amtkeepalivetimer&&(clearInterval(y.amtkeepalivetimer),y.amtkeepalivetimer=null)},y}
\ No newline at end of file
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;i<o;i++)s.push(r[9+i]);var l=new Uint8Array(y.acc.slice(9,9+o)),n=9+o;if(0==c)0<=s.indexOf(4)?y.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(y.user.length+y.authuri.length+8)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(0,0)+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(0,0,0,0)):y.Stop(2);else if(3!=c&&4!=c||1!=a)if(0==a)switch(y.protocol){case 1:y.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0));break;case 2:y.directSend(new Uint8Array([64,0,0,0,0,0,0,0]));break;case 3:y.connectstate=1,y.xxStateChange(3)}else y.Stop(3);else{var h=0,u=l[0],S=x(new Uint8Array(l.buffer.slice(1,1+u))),u=l[h+=u+1],d=x(new Uint8Array(l.buffer.slice(h+1,h+1+u))),u=(h+=u+1,null),f=function(e){for(var t="",n=0;n<e;n++)t+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return t}(32),g="00000002",C="",l=(4==c&&(m=l[h],u=x(new Uint8Array(l.buffer.slice(h+1,h+1+m))),C=g+":"+f+":"+u+":"),hex_md5(hex_md5(y.user+":"+S+":"+y.pass)+":"+d+":"+C+hex_md5("POST:"+y.authuri))),h=y.user.length+S.length+d.length+y.authuri.length+f.length+g.length+l.length+7,m=(4==c&&(h+=u.length+1),String.fromCharCode(19,0,0,0,c)+IntToStrX(h)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(S.length)+S+String.fromCharCode(d.length)+d+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(f.length)+f+String.fromCharCode(g.length)+g+String.fromCharCode(l.length)+l);4==c&&(m+=String.fromCharCode(u.length)+u),y.xxSend(m)}break;case 33:r.byteLength<23||(n=23,y.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(y.amtsequence++)+String.fromCharCode(0,0,27,0,0,0)),1==y.protocol&&(y.amtkeepalivetimer=setInterval(y.xxSendAmtKeepAlive,2e3)),y.connectstate=1,y.xxStateChange(3));break;case 41:r.byteLength<10||(n=10);break;case 42:r.byteLength<10||(C=10+(r[9]<<8)+r[8],r.byteLength<C)||(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(10,C))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(10,C)))),n=C);break;case 43:r.byteLength<8||(n=8);break;case 65:r.byteLength<8||(y.connectstate=1,y.m.Start(),8<r.byteLength&&(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(8))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(8))))),n=r.byteLength);break;case 240:y.serverIsRecording=!0,n=1;break;default:return console.log("Unknown Intel AMT command: "+r[0]+" acclen="+r.byteLength),void y.Stop(4)}if(0==n)return;n!=y.acc.byteLength?y.acc=y.acc.slice(n):y.acc=null}}},y.directSend=function(e){try{y.socket.send(e.buffer)}catch(e){}},y.xxSend=function(e){if(null!=y.socket&&y.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);try{y.socket.send(t.buffer)}catch(e){}}},y.Send=y.send=function(e){null!=y.socket&&1==y.connectstate&&y.xxSend(1==y.protocol?String.fromCharCode(40,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(e.length)+e:e)},y.xxSendAmtKeepAlive=function(){null!=y.socket&&y.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(y.amtsequence++))},y.xxOnSocketClosed=function(){0==y.inDataCount&&0==y.tlsv1only?(y.tlsv1only=1,y.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+y.host+"&port="+y.port+"&tls="+y.tls+"&tls1only=1"+("*"==y.user?"&serverauth=1":"")+("undefined"==typeof pass?"&serverauth=1&user="+y.user:"")),y.socket.binaryType="arraybuffer",y.socket.onopen=y.xxOnSocketConnected,y.socket.onmessage=y.xxOnMessage,y.socket.onclose=y.xxOnSocketClosed):y.Stop(5)},y.xxStateChange=function(e){y.State!=e&&(y.State=e,y.m.xxStateChange(y.State),null!=y.onStateChanged)&&y.onStateChanged(y,y.State)},y.Stop=function(e){y.xxStateChange(0),y.connectstate=-1,(y.acc=null)!=y.socket&&(y.socket.close(),y.socket=null),null!=y.amtkeepalivetimer&&(clearInterval(y.amtkeepalivetimer),y.amtkeepalivetimer=null)},y}
\ No newline at end of file
public/scripts/amt-setupbin-0.1.0-min.js
+1
-1
@@ -1 +1 @@
1
-var AmtSetupBinSetupGuids=["µûqËùJ´AÊ{85xù","²XÏkrL¡^Q.Ä","§÷öÆÄöGíâå\r¥","ª©4Rá)©DM\b¹cS"],AmtSetupBinVarIds={1:{1:[0,"Current MEBx Password"],2:[0,"New MEBx Password"],3:[1,"Manageability Feature Selection"],4:[1,"Firmware Local Update",{0:"Disabled",1:"Enabled",2:"Password Protected"}],5:[1,"Firmware Update Qualifier",{0:"Always",1:"Never",2:"Restricted"}],6:[0,"Power Package"]},2:{1:[0,"Provisioning Preshared Key ID (PID)"],2:[0,"Provisioning Preshared Key (PPS)"],3:[0,"PKI DNS Suffix"],4:[0,"Configuration Server FQDN"],5:[1,"Remote Configuration Enabled (RCFG)",{0:"Off",1:"On"}],6:[1,"Pre-Installed Certificates Enabled",{0:"Off",1:"On"}],7:[1,"User Defined Certificate Configuration",{0:"Disabled",1:"Enabled",2:"Delete"}],8:[0,"User Defined Certificate Addition"],10:[1,"SOL/IDER Redirection Configuration"],11:[0,"Hostname"],12:[0,"Domain Name"],13:[0,"DHCP"],14:[1,"Secure Firmware Update (SFWU)",{0:"Disabled",1:"Enabled"}],15:[0,"ITO"],16:[1,"Provisioning Mode (PM)",{0:"Enterprise",1:"Small Buisness"}],17:[0,"Provisioning Server Address"],18:[2,"Provision Server Port Number (PSPO)"],19:[0,"Static PV4 Parameters"],20:[0,"VLAN"],21:[0,"PASS Policy Flag"],22:[0,"IPv6"],23:[1,"Shared/Dedicated FQDN",{0:"Dedicated",1:"Shared"}],24:[1,"Dynamic DNS Update",{0:"Disabled",1:"Enabled"}],25:[1,"Remote Desktop (KVM) State",{0:"Disabled",1:"Enabled"}],26:[1,"Opt-in User Consent Option",{0:"Disabled",1:"KVM",255:"All"}],27:[1,"Opt-in Remote IT Consent Policy",{0:"Disabled",1:"Enabled"}],28:[1,"ME Provision Halt Active",{0:"Stop",1:"Start"}],29:[1,"Manual Setup and Configuration",{0:"Automated",1:"Manual"}],30:[3,"Support Channel Identifier"],31:[0,"Support Channel Description"],32:[0,"Service Account Number"],33:[0,"Enrollement Passcode"],34:[3,"Service Type"],35:[0,"Service Provider Identifier"]}},AmtSetupBinCreate=function(e,r){var t={};return t.fileType=e,t.recordChunkCount=0,t.recordHeaderByteCount=0,t.recordNumber=0,t.majorVersion=e,t.minorVersion=0,t.flags=r,t.dataRecordsConsumed=0,t.dataRecordChunkCount=0,t.records=[],t},AmtSetupBinDecode=function(e){var r,t={},o=e.substring(0,16);for(r in t.fileType=0,AmtSetupBinSetupGuids)o==AmtSetupBinSetupGuids[r]&&(t.fileType=+r+1);if(0!=t.fileType){t.recordChunkCount=ReadShortX(e,16),t.recordHeaderByteCount=ReadShortX(e,18),t.recordNumber=ReadIntX(e,20),t.majorVersion=e.charCodeAt(24),t.minorVersion=e.charCodeAt(25),t.flags=ReadShortX(e,26);for(var a=ReadIntX(e,28),n=(t.dataRecordsConsumed=ReadIntX(e,32),t.dataRecordChunkCount=ReadShortX(e,36),t.records=[],512);n+512<=e.length;){var i={},d=(i.typeIdentifier=ReadIntX(e,n),i.flags=ReadIntX(e,n+4),i.chunkCount=ReadShortX(e,n+8),i.headerByteCount=ReadShortX(e,n+10),i.number=ReadIntX(e,n+12),i.variables=[],0),u=e.substring(n+24,n+512);for(0!=(2&i.flags)&&(u=AmtSetupBinDescrambleRecordData(u));;){var s={};if(s.moduleid=ReadShortX(u,d),s.varid=ReadShortX(u,d+2),0==s.moduleid||0==s.varid)break;AmtSetupBinVarIds[s.moduleid][s.varid]&&(s.length=ReadShortX(u,d+4),s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],s.desc=AmtSetupBinVarIds[s.moduleid][s.varid][1],s.value=u.substring(d+8,d+8+s.length),1==s.type&&1==s.length?s.value=s.value.charCodeAt(0):2==s.type&&2==s.length?s.value=ReadShortX(s.value,0):3==s.type&&4==s.length&&(s.value=ReadIntX(s.value,0)),i.variables.push(s)),d+=8+4*Math.floor((s.length+3)/4)}i.variables.sort(AmtSetupBinVariableCompare),t.records.push(i),n+=512}if(a==t.records.length)return t}},AmtSetupBinEncode=function(e){if(e.fileType<1&&e.fileType>AmtSetupBinSetupGuids.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],0<s.type&&(l=parseInt(l),1==s.type&&(l=String.fromCharCode(l)),2==s.type&&(l=ShortToStrX(l)),3==s.type)&&(l=IntToStrX(l)),u=(u=(u=(u+=ShortToStrX(s.moduleid))+ShortToStrX(s.varid))+ShortToStrX(l.length))+ShortToStrX(0)+l;u.length%4!=0;)u+="\0";i+=u}for(;i.length<512;)i+="\0";0!=(2&d.flags)&&(i=i.substring(0,24)+AmtSetupBinScrambleRecordData(i.substring(24))),t.push(i)}return t.join("")};function AmtSetupBinVariableCompare(e,r){return e.moduleid>r.moduleid?1:e.moduleid<r.moduleid?-1:r.varid<e.varid?1:e.varid<r.varid?-1:0}function AmtSetupBinScrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+17&255);return r}function AmtSetupBinDescrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+239&255);return r}
\ No newline at end of file
1
+var AmtSetupBinSetupGuids=["µûqËùJ´AÊ{85xù","²XÏkrL¡^Q.Ä","§÷öÆÄöGíâå\r¥","ª©4Rá)©DM\b¹cS"],AmtSetupBinVarIds={1:{1:[0,"Current MEBx Password"],2:[0,"New MEBx Password"],3:[1,"Manageability Feature Selection"],4:[1,"Firmware Local Update",{0:"Disabled",1:"Enabled",2:"Password Protected"}],5:[1,"Firmware Update Qualifier",{0:"Always",1:"Never",2:"Restricted"}],6:[0,"Power Package"]},2:{1:[0,"Provisioning Preshared Key ID (PID)"],2:[0,"Provisioning Preshared Key (PPS)"],3:[0,"PKI DNS Suffix"],4:[0,"Configuration Server FQDN"],5:[1,"Remote Configuration Enabled (RCFG)",{0:"Off",1:"On"}],6:[1,"Pre-Installed Certificates Enabled",{0:"Off",1:"On"}],7:[1,"User Defined Certificate Configuration",{0:"Disabled",1:"Enabled",2:"Delete"}],8:[0,"User Defined Certificate Addition"],10:[1,"SOL/IDER Redirection Configuration"],11:[0,"Hostname"],12:[0,"Domain Name"],13:[0,"DHCP"],14:[1,"Secure Firmware Update (SFWU)",{0:"Disabled",1:"Enabled"}],15:[0,"ITO"],16:[1,"Provisioning Mode (PM)",{0:"Enterprise",1:"Small Buisness"}],17:[0,"Provisioning Server Address"],18:[2,"Provision Server Port Number (PSPO)"],19:[0,"Static PV4 Parameters"],20:[0,"VLAN"],21:[0,"PASS Policy Flag"],22:[0,"IPv6"],23:[1,"Shared/Dedicated FQDN",{0:"Dedicated",1:"Shared"}],24:[1,"Dynamic DNS Update",{0:"Disabled",1:"Enabled"}],25:[1,"Remote Desktop (KVM) State",{0:"Disabled",1:"Enabled"}],26:[1,"Opt-in User Consent Option",{0:"Disabled",1:"KVM",255:"All"}],27:[1,"Opt-in Remote IT Consent Policy",{0:"Disabled",1:"Enabled"}],28:[1,"ME Provision Halt Active",{0:"Stop",1:"Start"}],29:[1,"Manual Setup and Configuration",{0:"Automated",1:"Manual"}],30:[3,"Support Channel Identifier"],31:[0,"Support Channel Description"],32:[0,"Service Account Number"],33:[0,"Enrollement Passcode"],34:[3,"Service Type"],35:[0,"Service Provider Identifier"]}},AmtSetupBinCreate=function(e,r){var t={};return t.fileType=e,t.recordChunkCount=0,t.recordHeaderByteCount=0,t.recordNumber=0,t.majorVersion=e,t.minorVersion=0,t.flags=r,t.dataRecordsConsumed=0,t.dataRecordChunkCount=0,t.records=[],t},AmtSetupBinDecode=function(e){var r,t={},o=e.substring(0,16);for(r in t.fileType=0,AmtSetupBinSetupGuids)o==AmtSetupBinSetupGuids[r]&&(t.fileType=+r+1);if(0!=t.fileType){t.recordChunkCount=ReadShortX(e,16),t.recordHeaderByteCount=ReadShortX(e,18),t.recordNumber=ReadIntX(e,20),t.majorVersion=e.charCodeAt(24),t.minorVersion=e.charCodeAt(25),t.flags=ReadShortX(e,26);for(var a=ReadIntX(e,28),n=(t.dataRecordsConsumed=ReadIntX(e,32),t.dataRecordChunkCount=ReadShortX(e,36),t.records=[],512);n+512<=e.length;){var i={},d=(i.typeIdentifier=ReadIntX(e,n),i.flags=ReadIntX(e,n+4),i.chunkCount=ReadShortX(e,n+8),i.headerByteCount=ReadShortX(e,n+10),i.number=ReadIntX(e,n+12),i.variables=[],0),u=e.substring(n+24,n+512);for(0!=(2&i.flags)&&(u=AmtSetupBinDescrambleRecordData(u));;){var s={};if(s.moduleid=ReadShortX(u,d),s.varid=ReadShortX(u,d+2),0==s.moduleid||0==s.varid)break;AmtSetupBinVarIds[s.moduleid][s.varid]&&(s.length=ReadShortX(u,d+4),s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],s.desc=AmtSetupBinVarIds[s.moduleid][s.varid][1],s.value=u.substring(d+8,d+8+s.length),1==s.type&&1==s.length?s.value=s.value.charCodeAt(0):2==s.type&&2==s.length?s.value=ReadShortX(s.value,0):3==s.type&&4==s.length&&(s.value=ReadIntX(s.value,0)),i.variables.push(s)),d+=8+4*Math.floor((s.length+3)/4)}i.variables.sort(AmtSetupBinVariableCompare),t.records.push(i),n+=512}if(a==t.records.length)return t}},AmtSetupBinEncode=function(e){if(e.fileType<1&&e.fileType>AmtSetupBinSetupGuids.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],0<s.type&&(l=parseInt(l),1==s.type&&(l=String.fromCharCode(l)),2==s.type&&(l=ShortToStrX(l)),3==s.type)&&(l=IntToStrX(l)),u=(u=(u=(u+=ShortToStrX(s.moduleid))+ShortToStrX(s.varid))+ShortToStrX(l.length))+ShortToStrX(0)+l;u.length%4!=0;)u+="\0";i+=u}for(;i.length<512;)i+="\0";0!=(2&d.flags)&&(i=i.substring(0,24)+AmtSetupBinScrambleRecordData(i.substring(24))),t.push(i)}return t.join("")};function AmtSetupBinVariableCompare(e,r){return e.moduleid>r.moduleid?1:e.moduleid<r.moduleid?-1:e.varid>r.varid?1:e.varid<r.varid?-1:0}function AmtSetupBinScrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+17&255);return r}function AmtSetupBinDescrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+239&255);return r}
\ No newline at end of file
public/scripts/amt-terminal-0.0.2-min.js
+1
-1
@@ -1 +1 @@
1
-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<m.height;t++){y[t]=[],p[t]=[];for(var i=0;i<m.width;i++)y[t][i]=" ",p[t][i]=448}m.TermInit(),m.TermDraw()},m.xxStateChange=function(e){},m.ProcessData=function(r){if(2==m.debugmode&&console.log("TRecv("+r.length+"): "+rstr2hex(r)),0==m.terminalEmulation)try{r=decode_utf8(F+r)}catch(e){return void(F+=r)}F="",null!=m.capture&&(m.capture+=r);for(var e=r,t=0;t<e.length;t++){o=a=h=n=i=void 0;var i=String.fromCharCode(e.charCodeAt(t)),n=e.charCodeAt(t);switch(d){case 0:27===n?(d=1,b=[],v=k=0):E(i);break;case 1:switch(i){case"[":d=2;break;case"(":d=4;break;case")":d=5;break;case"]":d=6;break;case"=":D=!0,d=0;break;case">":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;a<m.width;a++)y[h][a]=y[h-1][a],p[h][a]=p[h-1][a];for(h=l[0]+1-1;h>l[0]-1;h--)for(a=0;a<m.width;a++)y[h][a]=" ",p[h][a]=448;d=0;break;default:console.log("unknown terminal short code",i),d=0}break;case 2:"0"<=i&&i<="9"?b[k]?b[k]=10*b[k]+(i-"0"):b[k]=i-"0":";"==i?k++:"?"==i?v=1:(b[0]||(b[0]=0),function(e,r,t,i){if(1==i)switch(e){case"l":25==r[0]&&(K=!1);break;case"h":25==r[0]&&(K=!0)}else if(0==i){var n,h;switch(e){case"c":m.TermResetScreen();break;case"A":1==t&&(0==r[0]?T--:T-=r[0],T<0)&&(T=0);break;case"B":1==t&&(0==r[0]?T++:T+=r[0],T>m.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;n<m.width-a;n++)y[T][n]=y[T][n+a],p[T][n]=p[T][n+a];for(n=m.width-a;n<m.width;n++)y[T][n]=" ",p[T][n]=448;break;case"L":var o=1;for(0==(o=1==t?r[0]:o)&&(o=1),c=l[1];T+o<=c;c--)y[c]=y[c-o],p[c]=p[c-o];for(c=T;c<T+o;c++)for(y[c]=[],p[c]=[],a=0;a<m.width;a++)y[c][a]=" ",p[c][a]=448;break;case"J":if(1==t&&2==r[0])m.TermClear((w<<12)+(u<<6)),T=S=0,B=[];else if(0==t||1==t&&0==r[0])for(L(),n=T+1;n<m.height;n++)P(n);else if(1==t&&1==r[0])for(L(),n=0;n<T-1;n++)P(n);break;case"H":S=2==t?(r[0]<1&&(r[0]=1),r[1]<1&&(r[1]=1),r[0]>m.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;n<t;n++)r[n]&&0!=r[n]?1==r[n]?u<8&&(u+=8):2==r[n]||22==r[n]?8<=u&&(u-=8):7==r[n]?g=2:27==r[n]?g=0:30<=r[n]&&r[n]<=37?(h=8<=u,u=r[n]-30,h&&u<=8&&(u+=8)):40<=r[n]&&r[n]<=47?w=r[n]-40:90<=r[n]&&r[n]<=99?u=r[n]-82:100<=r[n]&&r[n]<=109&&(w=r[n]-92):(u=7,g=w=0);break;case"K":0!=t&&(1!=t||r[0]&&0!=r[0])?1==t&&(1==r[0]?function(){for(var e=(u<<6)+(w<<12)+g,r=0;r<S;r++)y[T][r]=" ",p[T][r]=e}():2==r[0]&&P(T)):L();break;case"h":C=!0;break;case"l":C=!1;break;case"r":(l=2==t?[r[0]-1,r[1]-1]:l)[0]<0&&(l[0]=0),l[0]>m.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]&&(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;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"M":a=1;1==t&&(a=r[0]);for(c=T;c<=l[1]-a;c++)for(f=0;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"T":a=1;1==t&&(a=r[0]);for(c=l[1];c>l[0]+a;c--)for(f=0;f<m.width;f++)y[c][f]=y[c-a][f],p[c][f]=p[c-a][f];for(c=l[0]+a;c>l[0];c--)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"X":var a=1,s=S,d=T;for(1==t&&(a=r[0]);0<a&&d<m.height;)y[d][s]=" ",a--,++s>=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)&&1<e.length&&"?"!=e[1]&&m.onTitleChange&&m.onTitleChange(m,m.title=e[1])}(b),d=0):b[k]?b[k]+=i:b[k]=i}}m.TermDraw()},m.ProcessVt100String=function(e){for(var r=0;r<e.length;r++)E(String.fromCharCode(e.charCodeAt(r)))};var h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];function E(e){if("\0"!=e&&7!=e.charCodeAt()){var r=e.charCodeAt();switch(1==m.terminalEmulation?0!=(128&r)&&(e=String.fromCharCode(h[127&r])):2==m.terminalEmulation&&0!=(128&r)&&(e=String.fromCharCode(a[127&r])),r){case 16:e=" ";break;case 24:e="↑";break;case 25:e="↓"}switch(S>m.width&&(S=m.width),T>m.height-1&&(T=m.height-1),e){case"\b":0<S&&(S--,n)&&o(" ");break;case"\t":for(var t=8-S%8,i=0;i<t;i++)E(" ");break;case"\n":++T>l[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.width;r++)y[T][r]=" ",p[T][r]=e}function P(e){for(var r=(u<<6)+(w<<12)+g,t=0;t<m.width;t++)y[e][t]=" ",p[e][t]=r}function x(e){for(var r,t=l[0];t<=l[1]-e;t++)y[t]=y[t+e],p[t]=p[t+e];for(t=l[1]-e+1;t<=l[1];t++)for(y[t]=[],p[t]=[],r=0;r<m.width;r++)y[t][r]=" ",p[t][r]=448}return m.TermClear=function(e){for(var r=0;r<m.height;r++)for(var t=0;t<m.width;t++)y[r][t]=" ",p[r][t]=e;B=[]},m.TermResetScreen=function(){C=K=!(w=g=0),S=T=0,n=!(u=7),l=[0,m.height-1],D=!1,m.TermClear(448),F=""},m.TermSendKeys=function(e){2==m.debugmode&&console.log("TSend("+e.length+"): "+rstr2hex(e),e),m.parent.send(e)},m.TermSendKey=function(e){2==m.debugmode&&console.log("TSend(1): "+rstr2hex(String.fromCharCode(e)),e),m.parent.send(String.fromCharCode(e))},m.TermHandleKeys=function(e){if(!e.ctrlKey)return 127==e.which?m.TermSendKey(8):13==e.which?m.TermSendKeys(m.lineFeed):0!=e.which&&m.TermSendKey(e.which),!1;e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.TermHandleKeyUp=function(e){return 8!=e.which&&32!=e.which&&9!=e.which||(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)},m.TermHandleKeyDown=function(e){if(!(65<=e.which&&e.which<=90&&1==e.ctrlKey)){if(27==e.which)return m.TermSendKeys(String.fromCharCode(27)),!0;if(1==D){if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,79,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,79,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,79,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,79,66)),!0}else{if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,91,66)),!0}if(33==e.which)return m.TermSendKeys(String.fromCharCode(27,91,53,126)),!0;if(34==e.which)return m.TermSendKeys(String.fromCharCode(27,91,54,126)),!0;if(35==e.which)return m.TermSendKeys(String.fromCharCode(27,91,70)),!0;if(36==e.which)return m.TermSendKeys(String.fromCharCode(27,91,72)),!0;if(45==e.which)return m.TermSendKeys(String.fromCharCode(27,91,50,126)),!0;if(46==e.which)return m.TermSendKeys(String.fromCharCode(27,91,51,126)),!0;if(9==e.which)return m.TermSendKeys("\t"),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!0;var r=[80,81,119,120,116,117,113,114,112,77],t=[49,50,51,52,53,54,55,56,57,48,33,64],i=[80,81,82,83,84,85,86,87,88,89,90,91];if(111<e.which&e.which<124&&0==e.repeat){if(0==m.fxEmulation&&e.which<122)return m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0;if(1==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0;if(2==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0}r=[80,81,119,120,116,117,113,114,112,77];return 111<e.which&e.which<122&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0):(t=[49,50,51,52,53,54,55,56,57,48,33,64],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0):(i=[80,81,82,83,84,85,86,87,88,89,90,91],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0):8!=e.which&&32!=e.which&&9!=e.which||(m.TermSendKey(e.which),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)))}m.TermSendKey(e.which-64),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.recordLineTobackBuffer=function(e){var e=m.TermDrawLine("",e,""),r=e[0];B.push(r+e[1]+"<br>")},m.TermDrawLine=function(e,r,t){for(var i,n,h,a,o=1,c=0;c<m.width;++c)switch(i=p[r][c],S==c&&T==r&&K&&(i|=2),i!=o&&(h=6,a=12,2&i&&(h=12,a=6),e=e+t+'<span style="color:#'+f[i>>h&63]+";background-color:#"+f[i>>a&63],1&i&&(e+=";text-decoration:underline"),e+=';">',t="</span>"+(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<m.height;++t){var i=m.TermDrawLine(r,t,e),r=i[0],e=i[1];t!=m.height-1&&(r+="<br>")}var n=(B=800<B.length?B.slice(B.length-800):B).join("");m.DivElement.innerHTML="<font size='4'><b>"+n+r+e+"</b></font>",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
1
+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<m.height;t++){y[t]=[],p[t]=[];for(var i=0;i<m.width;i++)y[t][i]=" ",p[t][i]=448}m.TermInit(),m.TermDraw()},m.xxStateChange=function(e){},m.ProcessData=function(r){if(2==m.debugmode&&console.log("TRecv("+r.length+"): "+rstr2hex(r)),0==m.terminalEmulation)try{r=decode_utf8(F+r)}catch(e){return void(F+=r)}F="",null!=m.capture&&(m.capture+=r);for(var e=r,t=0;t<e.length;t++){o=a=h=n=i=void 0;var i=String.fromCharCode(e.charCodeAt(t)),n=e.charCodeAt(t);switch(d){case 0:27===n?(d=1,b=[],v=k=0):E(i);break;case 1:switch(i){case"[":d=2;break;case"(":d=4;break;case")":d=5;break;case"]":d=6;break;case"=":D=!0,d=0;break;case">":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;a<m.width;a++)y[h][a]=y[h-1][a],p[h][a]=p[h-1][a];for(h=l[0]+1-1;h>l[0]-1;h--)for(a=0;a<m.width;a++)y[h][a]=" ",p[h][a]=448;d=0;break;default:console.log("unknown terminal short code",i),d=0}break;case 2:"0"<=i&&i<="9"?b[k]?b[k]=10*b[k]+(i-"0"):b[k]=i-"0":";"==i?k++:"?"==i?v=1:(b[0]||(b[0]=0),function(e,r,t,i){if(1==i)switch(e){case"l":25==r[0]&&(K=!1);break;case"h":25==r[0]&&(K=!0)}else if(0==i){var n,h;switch(e){case"c":m.TermResetScreen();break;case"A":1==t&&(0==r[0]?T--:T-=r[0],T<0)&&(T=0);break;case"B":1==t&&(0==r[0]?T++:T+=r[0],T>m.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;n<m.width-a;n++)y[T][n]=y[T][n+a],p[T][n]=p[T][n+a];for(n=m.width-a;n<m.width;n++)y[T][n]=" ",p[T][n]=448;break;case"L":var o=1;for(0==(o=1==t?r[0]:o)&&(o=1),c=l[1];T+o<=c;c--)y[c]=y[c-o],p[c]=p[c-o];for(c=T;c<T+o;c++)for(y[c]=[],p[c]=[],a=0;a<m.width;a++)y[c][a]=" ",p[c][a]=448;break;case"J":if(1==t&&2==r[0])m.TermClear((w<<12)+(u<<6)),T=S=0,B=[];else if(0==t||1==t&&0==r[0])for(L(),n=T+1;n<m.height;n++)P(n);else if(1==t&&1==r[0])for(L(),n=0;n<T-1;n++)P(n);break;case"H":S=2==t?(r[0]<1&&(r[0]=1),r[1]<1&&(r[1]=1),r[0]>m.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;n<t;n++)r[n]&&0!=r[n]?1==r[n]?u<8&&(u+=8):2==r[n]||22==r[n]?8<=u&&(u-=8):7==r[n]?g=2:27==r[n]?g=0:30<=r[n]&&r[n]<=37?(h=8<=u,u=r[n]-30,h&&u<=8&&(u+=8)):40<=r[n]&&r[n]<=47?w=r[n]-40:90<=r[n]&&r[n]<=99?u=r[n]-82:100<=r[n]&&r[n]<=109&&(w=r[n]-92):(u=7,g=w=0);break;case"K":0!=t&&(1!=t||r[0]&&0!=r[0])?1==t&&(1==r[0]?function(){for(var e=(u<<6)+(w<<12)+g,r=0;r<S;r++)y[T][r]=" ",p[T][r]=e}():2==r[0]&&P(T)):L();break;case"h":C=!0;break;case"l":C=!1;break;case"r":(l=2==t?[r[0]-1,r[1]-1]:l)[0]<0&&(l[0]=0),l[0]>m.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;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"M":a=1;1==t&&(a=r[0]);for(c=T;c<=l[1]-a;c++)for(f=0;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"T":a=1;1==t&&(a=r[0]);for(c=l[1];c>l[0]+a;c--)for(f=0;f<m.width;f++)y[c][f]=y[c-a][f],p[c][f]=p[c-a][f];for(c=l[0]+a;c>l[0];c--)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"X":var a=1,s=S,d=T;for(1==t&&(a=r[0]);0<a&&d<m.height;)y[d][s]=" ",a--,++s>=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)&&1<e.length&&"?"!=e[1]&&m.onTitleChange&&m.onTitleChange(m,m.title=e[1])}(b),d=0):b[k]?b[k]+=i:b[k]=i}}m.TermDraw()},m.ProcessVt100String=function(e){for(var r=0;r<e.length;r++)E(String.fromCharCode(e.charCodeAt(r)))};var h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];function E(e){if("\0"!=e&&7!=e.charCodeAt()){var r=e.charCodeAt();switch(1==m.terminalEmulation?0!=(128&r)&&(e=String.fromCharCode(h[127&r])):2==m.terminalEmulation&&0!=(128&r)&&(e=String.fromCharCode(a[127&r])),r){case 16:e=" ";break;case 24:e="↑";break;case 25:e="↓"}switch(S>m.width&&(S=m.width),T>m.height-1&&(T=m.height-1),e){case"\b":0<S&&(S--,n)&&o(" ");break;case"\t":for(var t=8-S%8,i=0;i<t;i++)E(" ");break;case"\n":++T>l[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.width;r++)y[T][r]=" ",p[T][r]=e}function P(e){for(var r=(u<<6)+(w<<12)+g,t=0;t<m.width;t++)y[e][t]=" ",p[e][t]=r}function x(e){for(var r,t=l[0];t<=l[1]-e;t++)y[t]=y[t+e],p[t]=p[t+e];for(t=l[1]-e+1;t<=l[1];t++)for(y[t]=[],p[t]=[],r=0;r<m.width;r++)y[t][r]=" ",p[t][r]=448}return m.TermClear=function(e){for(var r=0;r<m.height;r++)for(var t=0;t<m.width;t++)y[r][t]=" ",p[r][t]=e;B=[]},m.TermResetScreen=function(){C=K=!(w=g=0),S=T=0,n=!(u=7),l=[0,m.height-1],D=!1,m.TermClear(448),F=""},m.TermSendKeys=function(e){2==m.debugmode&&console.log("TSend("+e.length+"): "+rstr2hex(e),e),m.parent.send(e)},m.TermSendKey=function(e){2==m.debugmode&&console.log("TSend(1): "+rstr2hex(String.fromCharCode(e)),e),m.parent.send(String.fromCharCode(e))},m.TermHandleKeys=function(e){if(!e.ctrlKey)return 127==e.which?m.TermSendKey(8):13==e.which?m.TermSendKeys(m.lineFeed):0!=e.which&&m.TermSendKey(e.which),!1;e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.TermHandleKeyUp=function(e){return 8!=e.which&&32!=e.which&&9!=e.which||(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)},m.TermHandleKeyDown=function(e){if(!(65<=e.which&&e.which<=90&&1==e.ctrlKey)){if(27==e.which)return m.TermSendKeys(String.fromCharCode(27)),!0;if(1==D){if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,79,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,79,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,79,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,79,66)),!0}else{if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,91,66)),!0}if(33==e.which)return m.TermSendKeys(String.fromCharCode(27,91,53,126)),!0;if(34==e.which)return m.TermSendKeys(String.fromCharCode(27,91,54,126)),!0;if(35==e.which)return m.TermSendKeys(String.fromCharCode(27,91,70)),!0;if(36==e.which)return m.TermSendKeys(String.fromCharCode(27,91,72)),!0;if(45==e.which)return m.TermSendKeys(String.fromCharCode(27,91,50,126)),!0;if(46==e.which)return m.TermSendKeys(String.fromCharCode(27,91,51,126)),!0;if(9==e.which)return m.TermSendKeys("\t"),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!0;var r=[80,81,119,120,116,117,113,114,112,77],t=[49,50,51,52,53,54,55,56,57,48,33,64],i=[80,81,82,83,84,85,86,87,88,89,90,91];if(111<e.which&e.which<124&&0==e.repeat){if(0==m.fxEmulation&&e.which<122)return m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0;if(1==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0;if(2==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0}r=[80,81,119,120,116,117,113,114,112,77];return 111<e.which&e.which<122&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0):(t=[49,50,51,52,53,54,55,56,57,48,33,64],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0):(i=[80,81,82,83,84,85,86,87,88,89,90,91],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0):8!=e.which&&32!=e.which&&9!=e.which||(m.TermSendKey(e.which),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)))}m.TermSendKey(e.which-64),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.recordLineTobackBuffer=function(e){var e=m.TermDrawLine("",e,""),r=e[0],e=e[1];B.push(r+e+"<br>")},m.TermDrawLine=function(e,r,t){for(var i,n,h,a,o=1,c=0;c<m.width;++c)switch(i=p[r][c],S==c&&T==r&&K&&(i|=2),i!=o&&(h=6,a=12,2&i&&(h=12,a=6),e=e+t+'<span style="color:#'+f[i>>h&63]+";background-color:#"+f[i>>a&63],1&i&&(e+=";text-decoration:underline"),e+=';">',t="</span>"+(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<m.height;++t){var i=m.TermDrawLine(r,t,e),r=i[0],e=i[1];t!=m.height-1&&(r+="<br>")}var n=(B=800<B.length?B.slice(B.length-800):B).join("");m.DivElement.innerHTML="<font size='4'><b>"+n+r+e+"</b></font>",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
public/scripts/charts-min.js
+1
-1
@@ -1 +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;s<r;s++)e.call(i,t[s],s);else if(A(t))for(n=Object.keys(t),r=n.length,s=0;s<r;s++)e.call(i,t[n[s]],n[s])}function W(t,e){let i,a,s,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,a=t.length;i<a;++i)if(s=t[i],r=e[i],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function N(e){if(O(e))return e.map(N);if(A(e)){var i=Object.create(null),a=Object.keys(e),s=a.length;let t=0;for(;t<s;++t)i[a[t]]=N(e[a[t]]);return i}return e}function H(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function j(t,e,i,a){var s;H(t)&&(s=e[t],i=i[t],A(s)&&A(i)?Y(s,i,a):e[t]=N(i))}function Y(a,t,s){var e=O(t)?t:[t],i=e.length;if(A(a)){var r,n=(s=s||{}).merger||j;for(let t=0;t<i;++t)if(A(r=e[t])){let i=Object.keys(r);for(let t=0,e=i.length;t<e;++t)n(i[t],a,r,s)}}return a}function $(t,e){return Y(t,e,{merger:U})}function U(t,e,i){var a;H(t)&&(a=e[t],i=i[t],A(a)&&A(i)?$(a,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=N(i)))}let X={"":t=>t,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)<i}function rt(t){var e=Math.round(t),e=(t=st(t,e,t/1e3)?e:t,Math.pow(10,Math.floor(o(t)))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function nt(t){var e=[],i=Math.sqrt(t);let a;for(a=1;a<i;a++)t%a==0&&(e.push(a),e.push(t/a));return i===(0|i)&&e.push(i),e.sort((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<s;a++)r=t[a][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function L(t){return t*(S/180)}function dt(t){return t*(180/S)}function ct(i){if(p(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function ut(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let a=Math.atan2(e,i);return a<-.5*S&&(a+=v),{angle:a,distance:t}}function gt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ft(t,e){return(t-e+Q)%v-S}function x(t){return(t%v+v)%v}function pt(t,e,i,a){var t=x(t),e=x(e),i=x(i),s=x(e-t),r=x(i-t),n=x(t-e),o=x(t-i);return t===e||t===i||a&&e===i||r<s&&n<o}function C(t,e,i){return Math.max(e,Math.min(i,t))}function mt(t){return C(t,-32768,32767)}function d(t,e,i,a=1e-6){return t>=Math.min(e,i)-a&&t<=Math.max(e,i)+a}function bt(e,i,t){t=t||(t=>e[t]<i);let a,s=e.length-1,r=0;for(;1<s-r;)t(a=r+s>>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 e<s||e===s&&i[t+1][a]===s}:t=>i[t][a]<s),xt=(e,i,a)=>bt(e,a,t=>e[t][i]>=a);function vt(t,e,i){let a=0,s=t.length;for(;a<s&&t[a]<e;)a++;for(;s>a&&t[s-1]>i;)s--;return 0<a||s<t.length?t.slice(a,s):t}let _t=["push","pop","shift","splice","unshift"];function yt(s,t){s._chartjs?s._chartjs.listeners.push(t):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),_t.forEach(t=>{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<i.length||(_t.forEach(t=>{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 0<this._getAnims(t).items.length}start(t){t=this._charts.get(t);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((t,e)=>Math.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(1<e+i&&(e*=s=1/(e+i),i*=s),s=0;s<3;s++)a[s]*=1-e-i,a[s]+=e;return a}function Yt(t){var e=t.r/255,i=t.g/255,t=t.b/255,a=Math.max(e,i,t),s=Math.min(e,i,t),r=(a+s)/2;let n,o,l;return a!==s&&(l=a-s,o=.5<r?l/(2-a-s):l/(a+s),n=60*(n=(s=i,i=t,(t=e)===a?(s-i)/l+(s<i?6:0):s===a?(i-t)/l+2:(t-s)/l+4))+.5),[0|n,o||0,r]}function $t(t,e,i,a){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,a)).map(Rt)}function Ut(t,e,i){return $t(Nt,t,e,i)}function Xt(t){return(t%360+360)%360}let qt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Kt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"},Gt;let Zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Jt=t=>t<=.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<t.length)&&(e.a=Rt(t[3])):(e=ee(t,{r:0,g:0,b:0,a:1})).a=Rt(e.a),e}function ae(t){return("r"===t.charAt(0)?function(t){var e=Zt.exec(t);let i,a,s,r=255;if(e){if(void 0!==e[7]){let t=+e[7];r=e[8]?Et(t):Lt(255*t,0,255)}return i=+e[1],a=+e[3],s=+e[5],{r:255&(e[2]?Et(i):Lt(i,0,255)),g:255&(e[4]?Et(a):Lt(a,0,255)),b:255&(e[6]?Et(s):Lt(s,0,255)),a:r}}}:function(t){var e,i,a,t=Wt.exec(t);let s,r=255;if(t)return void 0!==t[5]&&(r=(t[6]?Et:Rt)(+t[5])),e=Xt(+t[2]),i=+t[3]/100,a=+t[4]/100,{r:(s="hwb"===t[1]?$t(jt,e,i,a):"hsv"===t[1]?$t(Ht,e,i,a):Ut(e,i,a))[0],g:s[1],b:s[2],a:r}})(t)}class se{constructor(t){if(t instanceof se)return t;var e,i,a=typeof t;let s;"object"==a?s=ie(t):"string"==a&&(i=(a=t).length,"#"===a[0]&&(4===i||5===i?e={r:255&17*l[a[1]],g:255&17*l[a[2]],b:255&17*l[a[3]],a:5===i?17*l[a[4]]:255}:7!==i&&9!==i||(e={r:l[a[1]]<<4|l[a[2]],g:l[a[3]]<<4|l[a[4]],b:l[a[5]]<<4|l[a[6]],a:9===i?l[a[7]]<<4|l[a[8]]:255})),s=e||(i=t,Gt||((Gt=function(){var t={},e=Object.keys(Kt),i=Object.keys(qt);let a,s,r,n,o;for(a=0;a<e.length;a++){for(n=o=e[a],s=0;s<i.length;s++)r=i[s],o=o.replace(r,qt[r]);r=parseInt(Kt[n],16),t[o]=[r>>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<i.length){let t=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(t<1e-4||1e15<t)&&(s="scientific"),r=function(t){let e=3<i.length?i[2].value-i[1].value:i[1].value-i[0].value;return e=1<=Math.abs(e)&&t!==Math.floor(t)?t-Math.floor(t):e}(e)}var n=o(Math.abs(r)),n=isNaN(n)?1:Math.max(Math.min(-1*Math.floor(n),20),0),n={notation:s,minimumFractionDigits:n,maximumFractionDigits:n};return Object.assign(n,this.options.ticks.format),ce(e,a,n)},logarithmic(t,e,i){var a;return 0===t?"0":(a=i[e].significand||t/Math.pow(10,Math.floor(o(t))),[1,2,3,5,10,15].includes(a)||e>.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;t<e;++t){var s=a[t];i=i[s]||(i[s]=Object.create(null))}}return i}function be(t,e,i){return"string"==typeof e?Y(me(t,e),i):Y(me(t,""),e)}var R=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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,!(0<s||0<i)||t&&t.shadowRoot){let t=e.getBoundingClientRect();n=a.clientX-t.left,o=a.clientY-t.top,l=!0}else n=s,o=r;return{x:n,y:o,box:l}}(t,i),h=n.left+(l&&s.left),l=n.top+(l&&s.top);let{width:d,height:c}=e;return r&&(d-=n.width+s.width,c-=n.height+s.height),{x:Math.round((t-h)/d*i.width/a),y:Math.round((o-l)/c*i.height/a)}}let Pe=t=>Math.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;l<o;l++)if(null==(c=i[l])||O(c)){if(O(c))for(h=0,d=c.length;h<d;h++)null==(u=c[h])||O(u)||(n=Le(t,s,r,n,u))}else n=Le(t,s,r,n,c);t.restore();var g=r.length/2;if(g>i.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return n}function Re(t,e,i){t=t.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((e-i)*t)/t+i}function Ie(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ze(t,e,i,a){Fe(t,e,i,a,null)}function Fe(t,e,i,a,s){let r,n,o,l,h,d,c,u;var g=e.pointStyle,f=e.rotation,p=e.radius;let m=(f||0)*et;if(g&&"object"==typeof g&&("[object HTMLImageElement]"===(r=g.toString())||"[object HTMLCanvasElement]"===r))t.save(),t.translate(i,a),t.rotate(m),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();else if(!(isNaN(p)||p<=0)){switch(t.beginPath(),g){default:s?t.ellipse(i,a,s/2,p,0,0,v):t.arc(i,a,p,0,v),t.closePath();break;case"triangle":d=s?s/2:p,t.moveTo(i+Math.sin(m)*d,a-Math.cos(m)*p),m+=at,t.lineTo(i+Math.sin(m)*d,a-Math.cos(m)*p),m+=at,t.lineTo(i+Math.sin(m)*d,a-Math.cos(m)*p),t.closePath();break;case"rectRounded":h=.516*p,l=p-h,n=Math.cos(m+it)*l,c=Math.cos(m+it)*(s?s/2-h:l),o=Math.sin(m+it)*l,u=Math.sin(m+it)*(s?s/2-h:l),t.arc(i-c,a-o,h,m-S,m-D),t.arc(i+u,a-n,h,m-D,m),t.arc(i+c,a+o,h,m,m+D),t.arc(i-u,a+n,h,m+D,m+S),t.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,d=s?s/2:l,t.rect(i-d,a-l,2*d,2*l);break}m+=it;case"rectRot":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+u,a-n),t.lineTo(i+c,a+o),t.lineTo(i-u,a+n),t.closePath();break;case"crossRot":m+=it;case"cross":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n);break;case"star":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n),m+=it,c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n);break;case"line":n=s?s/2:Math.cos(m)*p,o=Math.sin(m)*p,t.moveTo(i-n,a-o),t.lineTo(i+n,a+o);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(m)*(s?s/2:p),a+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),0<e.borderWidth&&t.stroke()}}function y(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ve(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Be(t){t.restore()}function We(e,i,a,t,s){if(!i)return e.lineTo(a.x,a.y);if("middle"===s){let t=(i.x+a.x)/2;e.lineTo(t,i.y),e.lineTo(t,a.y)}else"after"===s!=!!t?e.lineTo(i.x,a.y):e.lineTo(a.x,i.y);e.lineTo(a.x,a.y)}function Ne(t,e,i,a){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(a?e.cp1x:e.cp2x,a?e.cp1y:e.cp2y,a?i.cp2x:i.cp1x,a?i.cp2y:i.cp1y,i.x,i.y)}function He(t,e,i,a,s,r={}){var n,o,l,h,d,c,u,g,f=O(e)?e:[e],p=0<r.strokeWidth&&""!==r.strokeColor;let m,b;for(t.save(),t.font=s.string,e=t,(g=r).translation&&e.translate(g.translation[0],g.translation[1]),P(g.rotation)||e.rotate(g.rotation),g.color&&(e.fillStyle=g.color),g.textAlign&&(e.textAlign=g.textAlign),g.textBaseline&&(e.textBaseline=g.textBaseline),m=0;m<f.length;++m)b=f[m],r.backdrop&&(c=r.backdrop,u=void 0,u=(d=t).fillStyle,d.fillStyle=c.color,d.fillRect(c.left,c.top,c.width,c.height),d.fillStyle=u),p&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),P(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(b,i,a,r.maxWidth)),t.fillText(b,i,a,r.maxWidth),c=t,d=i,u=a,n=b,h=l=void 0,((o=r).strikethrough||o.underline)&&(l=d-(n=c.measureText(n)).actualBoundingBoxLeft,d=d+n.actualBoundingBoxRight,h=u+n.actualBoundingBoxDescent,u=o.strikethrough?(u-n.actualBoundingBoxAscent+h)/2:h,c.strokeStyle=c.fillStyle,c.beginPath(),c.lineWidth=o.decorationWidth||2,c.moveTo(l,u),c.lineTo(d,u),c.stroke()),a+=Number(s.lineHeight);t.restore()}function je(t,e){var{x:e,y:i,w:a,h:s,radius:r}=e;t.arc(e+r.topLeft,i+r.topLeft,r.topLeft,-D,S,!0),t.lineTo(e,i+s-r.bottomLeft),t.arc(e+r.bottomLeft,i+s-r.bottomLeft,r.bottomLeft,S,D,!0),t.lineTo(e+a-r.bottomRight,i+s),t.arc(e+a-r.bottomRight,i+s-r.bottomRight,r.bottomRight,D,0,!0),t.lineTo(e+a,i+r.topRight),t.arc(e+a-r.topRight,i+r.topRight,r.topRight,0,-D,!0),t.lineTo(e+r.topLeft,i)}function Ye(o,l=[""],t,e,s=()=>o[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;o<l;++o)d=e[h=o+i],n[o]={r:s.parse(f(d,r),h)};return n}let ai=Number.EPSILON||1e-14,si=(t,e)=>e<t.length&&!t[e].skip&&t[e],ri=t=>"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;++a)if(s=r,r=n,n=si(l,a+1),r){if(n){let t=n[e]-r[e];o[a]=0!=t?(n[i]-r[i])/t:0}h[a]=s?n?_(o[a-1])!==_(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}{var d=l,c=o,u=h,g=d.length;let e,i,a,s,r,n=si(d,0);for(let t=0;t<g-1;++t)r=n,n=si(d,t+1),r&&n&&(st(c[t],0,ai)?u[t]=u[t+1]=0:(e=u[t]/c[t],i=u[t+1]/c[t],(s=Math.pow(e,2)+Math.pow(i,2))<=9||(a=3/Math.sqrt(s),u[t]=e*a*c[t],u[t+1]=i*a*c[t])))}{var[f,p,m="x"]=[l,h,e];let a=ri(m),t=f.length,s,r,n,o=si(f,0);for(let i=0;i<t;++i)if(r=n,n=o,o=si(f,i+1),n){let t=n[m],e=n[a];r&&(s=(t-r[m])/3,n["cp1"+m]=t-s,n["cp1"+a]=e-s*p[i]),o&&(s=(o[m]-t)/3,n["cp2"+m]=t+s,n["cp2"+a]=e+s*p[i])}}}function li(t,e,i){return Math.max(Math.min(t,i),e)}function hi(n,e,o,i,t){let a,s,r,l;if(e.spanGaps&&(n=n.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)oi(n,t);else{let t=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)r=n[a],l=ni(t,r,n[Math.min(a+1,s-(i?0:1))%s],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,t=r}if(e.capBezierPoints){var h=n,d=o;let t,e,i,a,s,r=y(h[0],d);for(t=0,e=h.length;t<e;++t)s=a,a=r,r=t<e-1&&y(h[t+1],d),a&&(i=h[t],s&&(i.cp1x=li(i.cp1x,d.left,d.right),i.cp1y=li(i.cp1y,d.top,d.bottom)),r)&&(i.cp2x=li(i.cp2x,d.left,d.right),i.cp2y=li(i.cp2y,d.top,d.bottom))}}let di=t=>0===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<i?e:t).y}}function mi(t,e,i,a){var s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},t=fi(t,s,i),s=fi(s,r,i),r=fi(r,e,i),e=fi(t,s,i),t=fi(s,r,i);return fi(e,t,i)}let bi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vi(t,e){var i=(""+t).match(bi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}let _i=t=>+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;s<r;++s)if(void 0!==(n=t[s])&&(void 0!==e&&"function"==typeof n&&(n=n(e),o=!1),void 0!==i&&O(n)&&(n=n[i%n.length],o=!1),void 0!==n))return a&&!o&&(a.cacheable=!1),n}function Si(t,e,i){var{min:t,max:a}=t,e=B(e,(a-t)/2),s=(t,e)=>i&&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;l<h&&r(n(e[d%o][i]),a,s);++l)d--,c--;d%=o,c%=o}return c<d&&(c+=o),{start:d,end:c,loop:u,style:t.style}}(t,i),p=[],m,b,x,v,_=null;for(let t=d,e=d;t<=c;++t)(b=i[t%n]).skip||(m=h(b[a]))!==x&&(v=l(m,s,r),null===(_=null===_&&(v||l(s,x,m)&&0!==o(s,x))?0===o(m,s)?t:e:_)||v&&0!==o(r,m)&&!l(r,x,m)||(p.push(Ti({start:_,end:t,loop:u,count:n,style:f})),_=null),e=t,x=m);return null!==_&&p.push(Ti({start:_,end:c,loop:u,count:n,style:f})),p}function Ei(e,i){var a=[],s=e.segments;for(let t=0;t<s.length;t++){var r=Li(s[t],e.points,i);r.length&&a.push(...r)}return a}function Ri(t,e){var i,a,s,r=t.points,n=t.options.spanGaps,o=r.length;return o?({start:a,end:s}=function(t,e,i){let a=0,s=e-1;if(i&&!n)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(s+=a);s>a&&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<a?s+o:s,!!t._fullLoop&&0===a&&s===o-1),r,e)):[]}function Ii(e,i,a,u){if(u&&u.setContext&&a){var g=e,e=i,f=a,p=u;let s=g._chart.getContext(),t=zi(g.options),{_datasetIndex:r,options:{spanGaps:n}}=g,o=f.length,l=[],h=t,d=e[0].start,c=d;function m(t,e,i,a){var s=n?-1:1;if(t!==e){for(t+=o;f[t%o].skip;)t-=s;for(;f[e%o].skip;)e+=s;t%o!=e%o&&(l.push({start:t%o,end:e%o,loop:i,style:a}),h=a,d=e%o)}}for(let a of e){d=n?d:a.start;let e,i=f[d%o];for(c=d+1;c<=a.end;c++){let t=f[c%o];(function(t,e){if(!e)return;function i(t,e){return re(e)?(a.includes(e)||a.push(e),a.indexOf(e)):e}let a=[];return JSON.stringify(t,i)!==JSON.stringify(e,i)})(e=zi(p.setContext(Pi(s,{type:"segment",p0:i,p1:t,p0DataIndex:(c-1)%o,p1DataIndex:c%o,datasetIndex:r}))),h)&&m(d,c-1,a.loop,h),i=t,h=e}d<c-1&&m(d,c-1,a.loop,h)}return l}return i}function zi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}var Fi=Object.freeze({__proto__:null,HALF_PI:D,INFINITY:tt,PI:S,PITAU:Q,QUARTER_PI:it,RAD_PER_DEG:et,TAU:v,TWO_THIRDS_PI:at,_addGrace:Si,_alignPixel:Re,_alignStartEnd:E,_angleBetween:pt,_angleDiff:ft,_arrayUnique:wt,_attachContext:$e,_bezierCurveTo:Ne,_bezierInterpolation:mi,_boundSegment:Li,_boundSegments:Ei,_capitalize:K,_computeSegments:Ri,_createResolver:Ye,_decimalPlaces:ct,_deprecated:function(t,e,i,a){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+a+'" instead')},_descriptors:Ue,_elementsEqual:W,_factorize:nt,_filterBetween:vt,_getParentNode:ve,_getStartAndCountOfVisiblePoints:Ot,_int16Range:mt,_isBetween:d,_isClickEvent:J,_isDomSupported:xe,_isPointInArea:y,_limitValue:C,_longestText:Ee,_lookup:bt,_lookupByKey:m,_measureText:Le,_merger:j,_mergerIf:U,_normalizeAngle:x,_parseObjectDataRadialScale:ii,_pointInLine:fi,_readValueToProps:yi,_rlookupByKey:xt,_scaleRangesChanged:At,_setMinAndMaxByKey:ht,_splitKey:q,_steppedInterpolation:pi,_steppedLineTo:We,_textX:Ct,_toLeftRightCenter:Dt,_updateBezierControlPoints:hi,addRoundedRectPath:je,almostEquals:st,almostWhole:lt,callback:c,clearCanvas:Ie,clipArea:Ve,clone:N,color:ne,createContext:Pi,debounce:Pt,defined:G,distanceBetweenPoints:gt,drawPoint:ze,drawPointLegend:Fe,each:k,easingEffects:gi,finiteOrDefault:u,fontString:function(t,e,i){return e+" "+t+"px "+i},formatNumber:ce,getAngleFromPoint:ut,getHoverColor:oe,getMaximumSize:De,getRelativePosition:Se,getRtlAdapter:Di,getStyle:Me,isArray:O,isFinite:p,isFunction:g,isNullOrUndef:P,isNumber:ot,isObject:A,isPatternOrGradient:re,listenArrayEvents:yt,log10:o,merge:Y,mergeIf:$,niceNum:rt,noop:t,overrideTextDirection:Ci,readUsedSize:Ae,renderText:He,requestAnimFrame:kt,resolve:ki,resolveObjectKey:f,restoreTextDirection:Oi,retinaScale:Ce,setsEqual:Z,sign:_,splineCurve:ni,splineCurveMonotone:oi,supportsEventListenerOptions:Oe,throttled:St,toDegrees:dt,toDimension:B,toFont:z,toFontString:Te,toLineHeight:vi,toPadding:I,toPercentage:V,toRadians:L,toTRBL:Mi,toTRBLCorners:wi,uid:F,unclipArea:Be,unlistenArrayEvents:Mt,valueOrDefault:T});function Vi(t,r,e,n,o){var l=t.getSortedVisibleDatasetMetas(),h=e[r];for(let e=0,t=l.length;e<t;++e){let{index:i,data:a}=l[e],{lo:t,hi:s}=function(t,s,r,e){let{controller:i,data:n,_sorted:a}=t,o=i._cachedMeta.iScale;if(o&&s===o.axis&&"r"!==s&&a&&n.length){let a=o._reversePixels?xt:m;if(!e)return a(n,s,r);if(i._sharedOptions){let t=n[0],i="function"==typeof t.getRange&&t.getRange(s);if(i){let t=a(n,s,r-i),e=a(n,s,r+i);return{lo:t.lo,hi:e.hi}}}}return{lo:0,hi:n.length-1}}(l[e],r,h,o);for(let e=t;e<=s;++e){let t=a[e];t.skip||n(t,i,e)}}}function Bi(a,s,t,r,n){let o=[];return(n||a.isPointInArea(s))&&Vi(a,t,s,function(t,e,i){(n||y(t,a.chartArea,0))&&t.inRange(s.x,s.y,r)&&o.push({element:t,datasetIndex:e,index:i})},!0),o}function Wi(t,e,i,a,s,l){{if(l||t.isPointInArea(e)){if("r"!==i||a){var h=t,d=e,c=i,u=a,g=s,f=l;let r=[],n=function(t){let a=-1!==t.indexOf("x"),s=-1!==t.indexOf("y");return function(t,e){var i=a?Math.abs(t.x-e.x):0,t=s?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(t,2))}}(c),o=Number.POSITIVE_INFINITY;return Vi(h,c,d,function(t,e,i){var a,s=t.inRange(d.x,d.y,g);(!u||s)&&(a=t.getCenterPoint(g),f||h.isPointInArea(a)||s)&&((s=n(d,a))<o?(r=[{element:t,datasetIndex:e,index:i}],o=s):s===o&&r.push({element:t,datasetIndex:e,index:i}))}),r}{var o=e,p=s;let n=[];return Vi(t,i,o,function(t,e,i){var{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],p),r=ut(t,{x:o.x,y:o.y}).angle;pt(r,a,s)&&n.push({element:t,datasetIndex:e,index:i})}),n}}return[]}}function Ni(t,a,s,e,r){let n=[],o="x"===s?"inXRange":"inYRange",l=!1;return Vi(t,s,a,(t,e,i)=>{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(0<n.length){let e=n[0].datasetIndex,i=t.getDatasetMeta(e).data;n=[];for(let t=0;t<i.length;++t)n.push({element:i[t],datasetIndex:e,index:t})}return n},point:(t,e,i,a)=>Bi(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<t;++o){l=i[o],(h=l.box).update(l.width||a.w,l.height||a.h,function(t,i){let a=i.maxPadding;{let e={left:0,top:0,right:0,bottom:0};return(t=t?["left","right"]:["top","bottom"]).forEach(t=>{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;i<a;++i)({position:r,options:{stack:n,stackWeight:o=1}}=s=t[i]),e.push({index:i,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:n&&r+n,stackWeight:o});return e}(i.boxes),c=Ui(u.filter(t=>t.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;++l){let t=(h=a[l]).box.fullSize,e=r[h.stack],i=e&&h.stackWeight/e.weight;h.horizontal?(h.width=i?i*n:t&&s.availableWidth,h.height=o):(h.width=n,h.height=i?i*o:t&&s.availableHeight)}return r}(u.concat(g),p);Ki(c.fullSize,e,p,t),Ki(u,e,p,t),Ki(g,e,p,t)&&Ki(u,e,p,t);{var b=e;let i=b.maxPadding;function x(t){var e=Math.max(i[t]-b[t],0);return b[t]+=e,e}b.y+=x("top"),b.x+=x("left"),x("right"),x("bottom")}Zi(c.leftAndTop,e,p,t),e.x+=e.w,e.y+=e.h,Zi(c.rightAndBottom,e,p,t),i.chartArea={left:e.left,top:e.top,right:e.left+e.w,bottom:e.top+e.h,height:e.h,width:e.w},k(c.chartArea,t=>{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<s.clientWidth&&a()},window),t=new ResizeObserver(t=>{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)=>.5<i?e:t,color(t,e,i){var t=ne(t||ma),a=t.valid&&ne(e||ma);return a&&a.valid?a.mix(t,i).hexString():e},number:(t,e,i)=>t+(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<e),this._active?t<0?this._target[i]=a:(t=t/e%2,t=this._easing(Math.min(1,Math.max(0,s&&1<t?2-t:t))),this._target[i]=this._fn(a,r,t)):(this._target[i]=r,this._notify(!0))}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,e)=>{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class va{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(A(t)){let s=Object.keys(R.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{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<a.length;t++){var s=e[a[t]];s&&s.active()&&i.push(s.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{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;s<r;++s)i.push(a[s].index);return i}function Ma(t,e,i,a={}){var s=t.keys,r="single"===a.mode;let n,o,l,h;if(null!==e){for(n=0,o=s.length;n<o;++n){if((l=+s[n])===i){if(a.all)continue;break}p(h=t.values[l])&&(r||0===e||_(e)===_(h))&&(e+=h)}return e}}function wa(t,e){t=t&&t.options.stacked;return t||void 0===t&&void 0!==e.stack}function ka(e,t,i,a){for(var s of t.getMatchingVisibleMetas(a).reverse()){let t=e[s.index];if(i&&0<t||!i&&t<0)return s.index}return null}function Sa(t,s){let{chart:e,_cachedMeta:r}=t,n=e._stacks||(e._stacks={}),{iScale:i,vScale:o,index:l}=r,h=i.axis,d=o.axis,c=i.id+`.${o.id}.`+(r.stack||r.type),u=s.length;var g,f,p;for(let a=0;a<u;++a){let t=s[a],{[h]:e,[d]:i}=t;(f=(t._stacks||(t._stacks={}))[d]=(p=e,(g=(g=n)[f=c]||(g[f]={}))[p]||(g[p]={})))[l]=i,f._top=ka(f,o,!0,r.type),f._bottom=ka(f,o,!1,r.type),(f._visualValues||(f._visualValues={}))[l]=i}}function Pa(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[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;a<s;++a)r=e[a],i[a]={x:r,y:t[r]};return i}(e);else if(i!==e){if(i){Mt(i,this);let t=this._cachedMeta;Da(t),t._parsed=[]}e&&Object.isExtensible(e)&&yt(e,this),this._syncList=[],this._data=e}}addElements(){var t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){var e=this._cachedMeta,i=this.getDataset();let a=!1;this._dataCheck();var s=e._stacked;e._stacked=wa(e.vScale,e),e.stack!==i.stack&&(a=!0,Da(e),e.stack=i.stack),this._resyncElements(t),!a&&s===e._stacked||Sa(this,e._parsed)}configure(){var t=this.chart.config,e=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,i){let{_cachedMeta:a,_data:s}=this,{iScale:t,_stacked:r}=a,n=t.axis,o,l,h,d=0===e&&i===s.length||a._sorted,c=0<e&&a._parsed[e-1];if(!1===this._parsing)a._parsed=s,a._sorted=!0,h=s;else{h=O(s[e])?this.parseArrayData(a,s,e,i):A(s[e])?this.parseObjectData(a,s,e,i):this.parsePrimitiveData(a,s,e,i);let t=()=>null===l[n]||c&&l[n]<c[n];for(o=0;o<i;++o)a._parsed[o+e]=l=h[o],d&&(t()&&(d=!1),c=l);a._sorted=d}r&&Sa(this,h)}parsePrimitiveData(t,e,i,a){var{iScale:s,vScale:r}=t,n=s.axis,o=r.axis,l=s.getLabels(),h=s===r,d=new Array(a);let c,u,g;for(c=0,u=a;c<u;++c)g=c+i,d[c]={[n]:h||s.parse(l[g],g),[o]:r.parse(e[g],g)};return d}parseArrayData(t,e,i,a){var{xScale:s,yScale:r}=t,n=new Array(a);let o,l,h,d;for(o=0,l=a;o<l;++o)d=e[h=o+i],n[o]={x:s.parse(d[0],h),y:r.parse(d[1],h)};return n}parseObjectData(t,e,i,a){var{xScale:s,yScale:r}=t,{xAxisKey:n="x",yAxisKey:o="y"}=this._parsing,l=new Array(a);let h,d,c,u;for(h=0,d=a;h<d;++h)u=e[c=h+i],l[h]={x:s.parse(f(u,n),c),y:r.parse(f(u,o),c)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){var a=this.chart,s=this._cachedMeta,r=e[t.axis];return Ma({keys:ya(a,!0),values:e._stacks[t.axis]._visualValues},r,s.index,{mode:i})}updateRangeFromParsed(t,e,i,a){var s=i[e.axis];let r=null===s?NaN:s;i=a&&i._stacks[e.axis];a&&i&&(a.values=i,r=Ma(a,s,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(e,t){let i=this._cachedMeta,a=i._parsed,s=i._sorted&&e===i.iScale,r=a.length,n=this._getOtherScale(e),o=(c=this.chart,t&&!i.hidden&&i._stacked&&{keys:ya(c,!0),values:null}),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=function(){var{min:t,max:e,minDefined:i,maxDefined:a}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:a?e:Number.POSITIVE_INFINITY}}();var c;let u,g;function f(){var t=(g=a[u])[n.axis];return!p(g[e.axis])||h>t||d<t}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(l,e,g,o),!s));++u);if(s)for(u=r-1;0<=u;--u)if(!f()){this.updateRangeFromParsed(l,e,g,o);break}return l}getAllParsedValues(t){var e=this._cachedMeta._parsed,i=[];let a,s,r;for(a=0,s=e.length;a<s;++a)p(r=e[a][t.axis])&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){var e=this._cachedMeta,i=e.iScale,e=e.vScale,t=this.getParsed(t);return{label:i?""+i.getLabelForValue(t[i.axis]):"",value:e?""+e.getLabelForValue(t[e.axis]):""}}_update(t){var e,i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let e,i,a,s;return A(t)?(e=t.top,i=t.right,a=t.bottom,s=t.left):e=i=a=s=t,{top:e,right:i,bottom:a,left:s,disabled:!1===t}}(T(this.options.clip,(t=i.xScale,i=i.yScale,!1!==(e=this.getMaxOverflow())&&(t=_a(t,e),{top:(i=_a(i,e)).end,right:t.end,bottom:i.start,left:t.start}))))}update(t){}draw(){let e=this._ctx,t=this.chart,i=this._cachedMeta,a=i.data||[],s=t.chartArea,r=[],n=this._drawStart||0,o=this._drawCount||a.length-n,l=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(e,s,n,o),h=n;h<n+o;++h){let t=a[h];t.hidden||(t.active&&l?r.push(t):t.draw(e,s))}for(h=0;h<r.length;++h)r[h].draw(e,s)}getStyle(t,e){e=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(e,t,i){var a,s=this.getDataset();let r;if(0<=e&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];(r=t.$context||(t.$context=Pi(this.getContext(),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"}))).parsed=this.getParsed(e),r.raw=s.data[e],r.index=r.dataIndex=e}else(r=this.$context||(this.$context=(e=this.chart.getContext(),a=this.index,Pi(e,{active:!1,dataset:void 0,datasetIndex:a,index:a,mode:"default",type:"dataset"})))).dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let a="active"===e,s=this._cachedDataOpts,r=t+"-"+e,n=s[r],o=this.enableOptionSharing&&G(i);var l,h,d;return n?Oa(n,o):(h=(d=this.chart.config).datasetElementScopeKeys(this._type,t),l=a?[t+"Hover","hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),h),t=Object.keys(R.elements[t]),(d=d.resolveNamedOptions(h,t,()=>this.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<s?this._insertElements(a,s-a,t):s<a&&this._removeElements(s,a-s)}_insertElements(t,e,i=!0){let a=this._cachedMeta,s=a.data,r=t+e,n;var o=t=>{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(s),n=t;n<r;++n)s[n]=new this.dataElementType;this._parsing&&o(a._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,a){}_removeElements(t,e){var i,a=this._cachedMeta;this._parsing&&(i=a._parsed.splice(t,e),a._stacked)&&Da(a,i),a.data.splice(t,e)}_sync(t){var e,i,a;this._parsing?this._syncList.push(t):([e,i,a]=t,this[e](i,a)),this.chart._dataChanges.push([this.index,...t])}_onDataPush(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class e{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}hasValue(){return ot(this.x)&&ot(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let a={};return t.forEach(t=>{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<n;l++)l===h&&(e.push(t[l]),d++,h=Math.round(r+d*i))}let La=(t,e,i)=>"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(;r<s;r+=a)i.push(t[Math.floor(r)]);return i}function Ia(t){return t.drawTicks?t.tickLength:0}function za(t,e){var i;return t.display?(e=z(t.font,e),i=I(t.padding),(O(t.text)?t.text.length:1)*e.lineHeight+i.height):0}class Fa extends e{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:a}=this,t=u(t,Number.POSITIVE_INFINITY),e=u(e,Number.NEGATIVE_INFINITY),i=u(i,Number.POSITIVE_INFINITY),a=u(a,Number.NEGATIVE_INFINITY);return{min:u(t,i),max:u(e,a),minDefined:p(t),maxDefined:p(e)}}getMinMax(i){let a,{min:s,max:r,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:s,max:r};var l=this.getMatchingVisibleMetas();for(let t=0,e=l.length;t<e;++t)a=l[t].controller.getMinMax(this,i),n||(s=Math.min(s,a.min)),o||(r=Math.max(r,a.max));return s=o&&s>r?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(),n<this.ticks.length);this._convertTicksToLabels(t?Ra(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,a){let e=t.options.ticks,i=(d=(t=t).options.offset,c=t._tickSize(),d=t._length/c+(d?0:1),Math.floor(Math.min(d,t._maxLength/c))),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?function(t){var e=[];let i,a;for(i=0,a=t.length;i<a;i++)t[i].major&&e.push(i);return e}(a):[],n=r.length,o=r[0],l=r[n-1],h=[];var d,c;if(s<n){var u=a;var g=h;var f=r;var p=n/s;let t,e=0,i=f[0];for(p=Math.ceil(p),t=0;t<u.length;t++)t===i&&(g.push(u[t]),e++,i=f[e*p])}else{var m=function(t,e,i){var t=function(t){var e=t.length;let i,a;if(e<2)return!1;for(a=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==a)return!1;return a}(t),a=e.length/i;if(t){var s=nt(t);for(let e=0,t=s.length-1;e<t;e++){let t=s[e];if(t>a)return t}}return Math.max(a,1)}(r,a,s);if(0<n){let t,e,i=1<n?Math.round((l-o)/(n-1)):null;for(Ta(a,h,m,P(i)?0:o-i,o),t=0,e=n-1;t<e;t++)Ta(a,h,m,r[t],r[t+1]);Ta(a,h,m,l,P(i)?a.length:l+i)}else Ta(a,h,m)}return h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),t&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){c(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),c(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){var e=this.options.ticks;let i,a,s;for(i=0,a=t.length;i<a;i++)(s=t[i]).label=c(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var t,e,i,a,s=this.options,r=s.ticks,n=Ea(this.ticks.length,s.ticks.maxTicksLimit),o=r.minRotation||0,l=r.maxRotation;let h,d,c,u=o;!this._isVisible()||!r.display||l<=o||n<=1||!this.isHorizontal()?this.labelRotation=o:(e=(t=this._getLabelSizes()).widest.width,i=t.highest.height,a=C(this.chart.width-e,0,this.maxWidth),(s.offset?this.maxWidth/n:a/(n-1))<e+6&&(h=a/(n-(s.offset?.5:1)),d=this.maxHeight-Ia(s.grid)-r.padding-za(s.title,this.chart.options.font),c=Math.sqrt(e*e+i*i),u=dt(Math.min(Math.asin(C((t.highest.height+6)/h,-1,1)),Math.asin(C(d/c,-1,1))-Math.asin(C(i/c,-1,1)))),u=Math.max(o,Math.min(l,u))),this.labelRotation=u)}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){c(this.options.beforeFit,[this])}fit(){let l={width:0,height:0},{chart:e,options:{ticks:h,title:i,grid:a}}=this,t=this._isVisible(),d=this.isHorizontal();if(t){let t=za(i,e.options.font);if(d?(l.width=this.maxWidth,l.height=Ia(a)+t):(l.height=this.maxHeight,l.width=Ia(a)+t),h.display&&this.ticks.length){let{first:t,last:e,widest:i,highest:a}=this._getLabelSizes(),s=2*h.padding,r=L(this.labelRotation),n=Math.cos(r),o=Math.sin(r);if(d){let t=h.mirror?0:o*i.width+n*a.height;l.height=Math.min(this.maxHeight,l.height+t+s)}else{let t=h.mirror?0:n*i.width+o*a.height;l.width=Math.min(this.maxWidth,l.width+t+s)}this._calculatePadding(t,e,o,n)}}this._handleMargins(),d?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(s,r,n,o){let{ticks:{align:l,padding:h},position:t}=this.options,d=0!==this.labelRotation,c="top"!==t&&"x"===this.axis;if(this.isHorizontal()){let t=this.getPixelForTick(0)-this.left,e=this.right-this.getPixelForTick(this.ticks.length-1),i=0,a=0;d?a=c?(i=o*s.width,n*r.height):(i=n*s.height,o*r.width):"start"===l?a=r.width:"end"===l?i=s.width:"inner"!==l&&(i=s.width/2,a=r.width/2),this.paddingLeft=Math.max((i-t+h)*this.width/(this.width-t),0),this.paddingRight=Math.max((a-e+h)*this.width/(this.width-e),0)}else{let t=r.height/2,e=s.height/2;"start"===l?(t=0,e=s.height):"end"===l&&(t=r.height,e=0),this.paddingTop=t+h,this.paddingBottom=e+h}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){var{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)P(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){var i=this.options.ticks.sampleSize;let t=this.ticks;i<t.length&&(t=Ra(t,i)),this._labelSizes=e=this._computeLabelSizes(t,t.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(t,e,i){let{ctx:a,_longestTextCache:s}=this,r=[],n=[],o=Math.floor(e/Ea(e,i)),l,h,d,c,u,g,f,p,m,b,x,v=0,_=0;for(l=0;l<e;l+=o){if(c=t[l].label,u=this._resolveTickFontOptions(l),a.font=g=u.string,f=s[g]=s[g]||{data:{},gc:[]},p=u.lineHeight,m=b=0,P(c)||O(c)){if(O(c))for(h=0,d=c.length;h<d;++h)P(x=c[h])||O(x)||(m=Le(a,f.data,f.gc,m,x),b+=p)}else m=Le(a,f.data,f.gc,m,c),b=p;r.push(m),n.push(b),v=Math.max(m,v),_=Math.max(b,_)}y=e,k(s,t=>{var e=t.gc,i=e.length/2;let a;if(y<i){for(a=0;a<i;++a)delete t.data[e[a]];e.splice(0,i)}});var y,i=r.indexOf(v),M=n.indexOf(_),w=t=>({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:0<t&&0<e?t:0}getContext(t){var e=this.ticks||[];return 0<=t&&t<e.length?(e=e[t]).$context||(e.$context=Pi(this.getContext(),{tick:e,index:t,type:"tick"})):this.$context||(this.$context=Pi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){var t=this.options.ticks,e=L(this.labelRotation),i=Math.abs(Math.cos(e)),e=Math.abs(Math.sin(e)),a=this._getLabelSizes(),t=t.autoSkipPadding||0,s=a?a.widest.width+t:0,a=a?a.highest.height+t:0;return this.isHorizontal()?s*e<a*i?s/i:a/e:a*e<s*i?a/i:s/e}_isVisible(){var t=this.options.display;return"auto"!==t?!!t:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(t){function i(t){return Re(c,t,l)}let e=this.axis,c=this.chart,a=this.options,{grid:u,position:s,border:g}=a,f=u.offset,p=this.isHorizontal(),r=this.ticks.length+(f?1:0),n=Ia(u),m=[],o=g.setContext(this.getContext()),l=o.display?o.width:0,h=l/2,d,b,x,v,_,y,M,w,k,S,P,D;if("top"===s)d=i(this.bottom),y=this.bottom-n,w=d-h,S=i(t.top)+h,D=t.bottom;else if("bottom"===s)d=i(this.top),S=t.top,D=i(t.bottom)-h,y=d+h,w=this.top+n;else if("left"===s)d=i(this.right),_=this.right-n,M=d-h,k=i(t.left)+h,P=t.right;else if("right"===s)d=i(this.left),k=t.left,P=i(t.right)-h,_=d+h,M=this.left+n;else if("x"===e){if("center"===s)d=i((t.top+t.bottom)/2+.5);else if(A(s)){let t=Object.keys(s)[0],e=s[t];d=i(this.chart.scales[t].getPixelForValue(e))}S=t.top,D=t.bottom,y=d+h,w=y+n}else if("y"===e){if("center"===s)d=i((t.left+t.right)/2);else if(A(s)){let t=Object.keys(s)[0],e=s[t];d=i(this.chart.scales[t].getPixelForValue(e))}_=d-h,M=_-n,k=t.left,P=t.right}var t=T(a.ticks.maxTicksLimit,r),C=Math.max(1,Math.ceil(r/t));for(b=0;b<r;b+=C){let t=this.getContext(b),e=u.setContext(t),i=g.setContext(t),a=e.lineWidth,s=e.color,r=i.dash||[],n=i.dashOffset,o=e.tickWidth,l=e.tickColor,h=e.tickBorderDash||[],d=e.tickBorderDashOffset;void 0!==(x=function(t,e,i){var a=t.ticks.length,s=Math.min(e,a-1),r=t._startPixel,n=t._endPixel;let o,l=t.getPixelForTick(s);if(!(i&&(o=1===a?Math.max(l-r,n-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(s-1))/2,(l+=s<e?o:-o)<r-1e-6||l>n+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;m<b;++m){x=d[m].label;let r=l.setContext(this.getContext(m)),t=(M=this.getPixelForTick(m)+l.labelOffset,k=(w=this._resolveTickFontOptions(m)).lineHeight,(S=O(x)?x.length:1)/2),e=r.color,i=r.textStrokeColor,a=r.textStrokeWidth,n,s=y;if(h?(v=M,"inner"===y&&(s=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),P="top"===o?"near"===c||0!=f?-S*k+k/2:"center"===c?-C.highest.height/2-t*k+k:-C.highest.height+k/2:"near"===c||0!=f?k/2:"center"===c?C.highest.height/2-t*k:C.highest.height-S*k,u&&(P*=-1),0==f||r.showLabelBackdrop||(v+=k/2*Math.sin(f))):(_=M,P=(1-S)*k/2),r.showLabelBackdrop){let t=I(r.backdropPadding),e=C.heights[m],i=C.widths[m],a=P-t.top,s=0-t.left;switch(D){case"middle":a-=e/2;break;case"bottom":a-=e}switch(y){case"center":s-=i/2;break;case"right":s-=i}n={left:s,top:a,width:i+t.width,height:e+t.height,color:r.backdropColor}}p.push({label:x,font:w,textOffset:P,options:{rotation:f,color:e,strokeColor:i,strokeWidth:a,textAlign:s,textBaseline:D,translation:[v,_],backdrop:n}})}return p}_getXAxisLabelAlignment(){var{position:t,ticks:e}=this.options;if(-L(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){var{position:e,ticks:{crossAlign:i,mirror:a,padding:s}}=this.options,t=t+s,r=this._getLabelSizes().widest.width;let n,o;return"left"===e?a?(o=this.right+s,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o+=r)):(o=this.right-t,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o=this.left)):"right"===e?a?(o=this.left+s,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o-=r)):(o=this.left+t,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o=this.right)):n="right",{textAlign:n,x:o}}_computeLabelArea(){var t,e;if(!this.options.ticks.mirror)return t=this.chart,"left"===(e=this.options.position)||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){var{ctx:t,options:{backgroundColor:e},left:i,top:a,width:s,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,a,s,r),t.restore())}getLineWidthForValue(e){var t,i=this.options.grid;return this._isVisible()&&i.display&&0<=(t=this.ticks.findIndex(t=>t.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<r;++s){let t=i[s];e.drawOnChartArea&&n({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&n({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){var{chart:s,ctx:r,options:{border:n,grid:o}}=this,l=n.setContext(this.getContext()),n=n.display?l.width:0;if(n){var o=o.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let t,e,i,a;this.isHorizontal()?(t=Re(s,this.left,n)-n/2,e=Re(s,this.right,o)+o/2,i=a=h):(i=Re(s,this.top,n)-n/2,a=Re(s,this.bottom,o)+o/2,t=e=h),r.save(),r.lineWidth=l.width,r.strokeStyle=l.color,r.beginPath(),r.moveTo(t,i),r.lineTo(e,a),r.stroke(),r.restore()}}drawLabels(i){if(this.options.ticks.display){let a=this.ctx,t=this._computeLabelArea(),e=(t&&Ve(a,t),this.getLabelItems(i));for(let i of e){let t=i.options,e=i.font;He(a,i.label,0,i.textOffset,e,t)}t&&Be(a)}}drawTitle(){var{ctx:e,options:{position:i,title:a,reverse:s}}=this;if(a.display){var r=z(a.font),n=I(a.padding),o=a.align;let t=r.lineHeight/2;"bottom"===i||"center"===i||A(i)?(t+=n.bottom,O(a.text)&&(t+=r.lineHeight*(a.text.length-1))):t+=n.top;var{titleX:n,titleY:l,maxWidth:h,rotation:d}=function(t,i,a,e){var{top:s,left:r,bottom:n,right:o,chart:l}=t,{chartArea:l,scales:h}=l;let d,c,u,g=0;var f=n-s,p=o-r;if(t.isHorizontal()){if(c=E(e,r,o),A(a)){let t=Object.keys(a)[0],e=a[t];u=h[t].getPixelForValue(e)+f-i}else u="center"===a?(l.bottom+l.top)/2+f-i:La(t,a,i);d=o-r}else{if(A(a)){let t=Object.keys(a)[0],e=a[t];c=h[t].getPixelForValue(e)-p+i}else c="center"===a?(l.left+l.right)/2-p+i:La(t,a,i);u=E(e,n,s),g="left"===a?-D:D}return{titleX:c,titleY:u,maxWidth:d,rotation:g}}(this,t,i,o);He(e,a.text,0,0,r,{color:a.color,maxWidth:h,rotation:d,textAlign:function(t,e,i){let a=Dt(t);return a=i&&"right"!==e||!i&&"right"===e?"left"===(t=a)?"right":"right"===t?"left":t:a}(o,i,s),textBaseline:"middle",translation:[n,l]})}}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){var t=this.options,e=t.ticks&&t.ticks.z||0,i=T(t.grid&&t.grid.z,-1),t=T(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Fa.prototype.draw?[{z:i,draw:t=>{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<t;++r){let t=i[r];t[a]!==this.id||e&&t.type!==e||s.push(t)}return s}_resolveTickFontOptions(t){return z(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Va{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e=Object.getPrototypeOf(t);let i;"id"in(n=e)&&"defaults"in n&&(i=this.register(e));var a,s,r,n=this.items,e=t.id,o=this.scope+"."+e;if(e)return e in n||(n[e]=t,n=t,e=o,a=i,a=Y(Object.create(null),[a?R.get(a):{},R.get(e),n.defaults]),R.set(e,a),n.defaultRoutes&&(s=e,r=n.defaultRoutes,Object.keys(r).forEach(t=>{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;t<this._typedRegistries.length;t++){var i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(t,e,i){e=e.get(t);if(void 0===e)throw new Error('"'+t+'" is not a registered '+i+".");return e}};class Ba{constructor(){this._init=[]}notify(t,e,i,a){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));a=a?this._descriptors(t).filter(a):this._descriptors(t),i=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),i}_notify(t,e,i,a){a=a||{};for(var s of t){let t=s.plugin;if(!1===c(t[i],[e,a,s.options],t)&&a.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){var e;return this._cache||(e=this._cache=this._createDescriptors(t),this._notifyStateChanges(t),e)}_createDescriptors(t,e){var i=t&&t.config,a=T(i.options&&i.options.plugins,{}),i=function(t){let i={},a=[],e=Object.keys(M.plugins.items);for(let t=0;t<e.length;t++)a.push(M.getPlugin(e[t]));var s=t.plugins||[];for(let e=0;e<s.length;e++){let t=s[e];-1===a.indexOf(t)&&(a.push(t),i[t.id]=!0)}return{plugins:a,localIds:i}}(i);if(!1!==a||e){var s,r,n,o,l,h,d,[c,{plugins:u,localIds:g},f,p]=[t,i,a,e],m=[],b=c.getContext();for(s of u){let t=s.id,e=(d=f[t],p||!1!==d?!0===d?{}:d:null);null!==e&&m.push({plugin:s,options:([d,{plugin:r,local:n},o,l]=[c.config,{plugin:s,local:g[t]},e,b],h=void 0,h=d.pluginScopeKeys(r),o=d.getOptionScopes(o,h),n&&r.defaults&&o.push(r.defaults),d.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0}))})}return m}return[]}_notifyStateChanges(t){var e=this._oldCache||[],i=this._cache,a=(t,i)=>t.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<e.length&&Na(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ja(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Ya(t){var e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=function(n,e){let r=fe[n.type]||{scales:{}},o=e.scales||{},l=Wa(n.type,e),h=Object.create(null);return Object.keys(o).forEach(t=>{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),e<i){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(es("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.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<t;r++){let t=e[r],a=this.getDatasetMeta(r);var n=t.type||this.config.type;if(a.type&&a.type!==n&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=n,a.indexAxis=t.indexAxis||Wa(n,this.options),a.order=t.order||0,a.index=r,a.label=""+t.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{let t=M.getController(n),{datasetElementType:e,dataElementType:i}=R.datasets[n];Object.assign(t,{dataElementType:M.getElement(i),datasetElementType:e&&M.getElement(e)}),a.controller=new t(this,r),s.push(a.controller)}}return this._updateMetasets(),s}_resetElements(){k(this.data.datasets,(t,e)=>{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;i++){let t=this.getDatasetMeta(i).controller,e=!s&&-1===r.indexOf(t);t.buildOrUpdateElements(e),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||k(r,t=>{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],0<l||t>o)&&(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;t<e;t++)if(!Z(a,i(t)))return;return Array.from(a).map(t=>t.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;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,e=this.data.datasets.length;t<e;++t)this._updateDataset(t,g(i)?i({datasetIndex:t}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(t,e){var i=this.getDatasetMeta(t),t={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",t)&&(i.controller._update(e),t.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",t))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(r.has(this)?this.attached&&!r.running(this)&&r.start(this):(this.draw(),is({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}}_getSortedDatasetMetas(e){var i=this._sortedMetasets,a=[];let s,t;for(s=0,t=i.length;s<t;++s){let t=i[s];e&&!t.visible||a.push(t)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;0<=t;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(i){var t=this.ctx,e=i._clip,a=!e.disabled,s=function(){var{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}()||this.chartArea,r={meta:i,index:i.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(a&&Ve(t,{left:!1===e.left?0:s.left-e.left,right:!1===e.right?this.width:s.right+e.right,top:!1===e.top?0:s.top-e.top,bottom:!1===e.bottom?this.height:s.bottom+e.bottom}),i.controller.draw(),a&&Be(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return y(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,a){e=Hi.modes[e];return"function"==typeof e?e(this,t,i,a):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,a=i.filter(t=>t&&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<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");var{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ie(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete rs[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let i=this._listeners,a=this.platform,e=(t,e)=>{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<n;++r){let t=(s=e[r])&&this.getDatasetMeta(s.datasetIndex).controller;t&&t[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){var e=this._active||[],t=t.map(({datasetIndex:t,index:e})=>{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<d;++h)u=e[h],(c={})[s.axis]=o||s.parse(n[h],h),l.push(ds(u,c,r,h));return l}function us(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function gs(t,e,i,a){return t=a?fs(t=t===e?i:t===i?e:t,i,e):fs(t,e,i)}function fs(t,e,i){return"start"===t?e:"end"===t?i:t}class ps extends Aa{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"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;t<e;++t)n._parsed[t]=i(t)}}_getRotation(){return L(this.options.rotation-90)}_getCircumference(){return L(this.options.circumference)}_getRotationExtents(){let e=v,i=-v;for(let t=0;t<this.chart.data.datasets.length;++t){var a,s;this.chart.isDatasetVisible(t)&&this.chart.getDatasetMeta(t).type===this._type&&(a=(s=this.chart.getDatasetMeta(t).controller)._getRotation(),s=s._getCircumference(),e=Math.min(e,a),i=Math.max(i,a+s))}return{rotation:e,circumference:i-e}}update(t){var e=this.chart.chartArea,i=this._cachedMeta,a=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,r=Math.max((Math.min(e.width,e.height)-s)/2,0),r=Math.min(V(this.options.cutout,r),1),n=this._getRingWeight(this.index),{circumference:o,rotation:l}=this._getRotationExtents(),{ratioX:l,ratioY:o,offsetX:h,offsetY:d}=function(u,g,f){let p=1,m=1,b=0,x=0;if(g<v){let a=u,s=a+g,t=Math.cos(a),e=Math.sin(a),i=Math.cos(s),r=Math.sin(s),n=(t,e,i)=>pt(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<t;++p)m+=this._circumference(p,r);for(p=t;p<t+e;++p){let t=this._circumference(p,r),e=a[p],i={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+t,circumference:t,outerRadius:u,innerRadius:c};f&&(i.options=g||this.resolveDataElementOptions(p,e.active?"active":s)),m+=t,this.updateElement(e,p,i,s)}}calculateTotal(){var t=this._cachedMeta,e=t.data;let i,a=0;for(i=0;i<e.length;i++){var s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(a+=Math.abs(s))}return a}calculateCircumference(t){var e=this._cachedMeta.total;return 0<e&&!isNaN(t)?v*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,a=i.data.labels||[],e=ce(e._parsed[t],i.options.locale);return{label:a[t]||"",value:e}}getMaxBorderWidth(t){let e=0;var i=this.chart;let a,s,r,n,o;if(!t)for(a=0,s=i.data.datasets.length;a<s;++a)if(i.isDatasetVisible(a)){t=(r=i.getDatasetMeta(a)).data,n=r.controller;break}if(!t)return 0;for(a=0,s=t.length;a<s;++a)"inner"!==(o=n.resolveDataElementOptions(a)).borderAlign&&(e=Math.max(e,o.borderWidth||0,o.hoverBorderWidth||0));return e}getMaxOffset(i){let a=0;for(let e=0,t=i.length;e<t;++e){let t=this.resolveDataElementOptions(e);a=Math.max(a,t.offset||0,t.hoverOffset||0)}return a}_getRingWeightOffset(e){let i=0;for(let t=0;t<e;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ms extends Aa{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};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()}}},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)&&(i<a.min&&(a.min=i),i>a.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<t;++g)f+=this._computeAngle(g,r,p);for(g=t;g<t+e;g++){let t=s[g],e=f,i=f+this._computeAngle(g,r,p),a=o.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=i,n&&(l.animateScale&&(a=0),l.animateRotate)&&(e=i=u);var m={x:d,y:c,innerRadius:0,outerRadius:a,startAngle:e,endAngle:i,options:this.resolveDataElementOptions(g,t.active?"active":r)};this.updateElement(t,g,m,r)}}countVisibleElements(){var t=this._cachedMeta;let i=0;return t.data.forEach((t,e)=>{!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;d<c;++d)g=e[d],(u={})[s.axis]=s.parse(f(g,o),d),h.push(ds(f(g,l),u,r,d));return h}updateRangeFromParsed(t,e,i,a){super.updateRangeFromParsed(t,e,i,a);a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){var{iScale:e,vScale:i}=this._cachedMeta,t=this.getParsed(t),a=t._custom,a=us(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(t[i.axis]);return{label:""+e.getLabelForValue(t[e.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(n,t,e,o){var l="reset"===o,{index:h,_cachedMeta:{vScale:d}}=this,c=d.getBasePixel(),u=d.isHorizontal(),g=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(t,o);for(let r=t;r<t+e;r++){let t=this.getParsed(r),e=l||P(t[d.axis])?{base:c,head:c}:this._calculateBarValuePixels(r),i=this._calculateBarIndexPixels(r,g),a=(t._stacks||{})[d.axis],s={horizontal:u,base:e.base,enableBorderRadius:!a||us(t._custom)||h===a._top||h===a._bottom,x:u?e.head:i.center,y:u?i.center:e.head,height:u?i.size:Math.abs(e.size),width:u?Math.abs(e.size):i.size};p&&(s.options=f||this.resolveDataElementOptions(r,n[r].active?"active":o));var m=s.options||n[r].options;{b=void 0;x=void 0;v=void 0;_=void 0;y=void 0;M=void 0;w=void 0;k=void 0;S=void 0;var b=s;var x=m;var v=a;var _=h;let t=x.borderSkipped;var y,M,w,k,S,x={};t?!0===t?b.borderSkipped={top:!0,right:!0,bottom:!0,left:!0}:({start:y,end:M,reverse:w,top:k,bottom:S}=function(){let t,e,i,a,s;return i=b.horizontal?(t=b.x<b.base,e="left","right"):(t=b.base<b.y,e="bottom","top"),s=t?(a="end","start"):(a="start","end"),{start:e,end:i,reverse:t,top:a,bottom:s}}(),"middle"===t&&v&&(b.enableBorderRadius=!0,t=(v._top||0)===_?k:(v._bottom||0)===_?S:(x[gs(S,y,M,w)]=!0,k)),x[gs(t,y,M,w)]=!0,b.borderSkipped=x):b.borderSkipped=x}[v,{inflateAmount:_},S]=[s,m,g.ratio],v.inflateAmount="auto"===_?1===S?.33:0:_,this.updateElement(n[r],r,s,o)}}_getStacks(e,i){let t=this._cachedMeta.iScale,a=t.getMatchingVisibleMetas(this._type).filter(t=>t.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;s<r;++s)a.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));var n=t.barThickness;return{min:n||function(t){var e=t.iScale,i=function(a){if(!a._cache.$bar){var s=a.getMatchingVisibleMetas(t.type);let i=[];for(let t=0,e=s.length;t<e;t++)i=i.concat(s[t].controller.getAllParsedValues(a));a._cache.$bar=wt(i.sort((t,e)=>t-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<s;++a)r=e.getPixelForValue(i[a]),l();for(n=void 0,a=0,s=e.ticks.length;a<s;++a)r=e.getPixelForTick(a),l();return o}(e),pixels:a,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:n?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:s,_stacked:r,index:n},options:{base:e,minBarLength:o}}=this,l=e||0,h=this.getParsed(t),i=h._custom,d=us(i),c,u,g=h[s.axis],a=0,f=r?this.applyStack(s,h,r):g;f!==g&&(a=f-g,f=g),d&&(g=i.barStart,f=i.barEnd-i.barStart,0!==g&&_(g)!==_(i.barEnd)&&(a=0),a+=g);var p,m,b=P(e)||d?a:e;let x=s.getPixelForValue(b);if(c=this.chart.getDataVisibility(t)?s.getPixelForValue(a+f):x,u=c-x,Math.abs(u)<o){u=(b=u,p=s,m=l,(0!==b?_(b):(p.isHorizontal()?1:-1)*(p.min>=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<t?s[t-1]:null,o=t<s.length-1?s[t+1]:null;s=i.categoryPercentage,null===n&&(n=r-(null===o?e.end-e.start:o-r)),null===o&&(o=r+r-n),t=r-(r-Math.min(n,o))/2*s;return{chunk:Math.abs(o-n)/2*s/a,ratio:i.barPercentage,start:t}}:function(t,e,i,a){var s=i.barThickness;let r,n;return n=P(s)?(r=e.min*i.categoryPercentage,i.barPercentage):(r=s*a,1),{chunk:r/a,ratio:n,start:e.pixels[t]-r/2}})(a,s,r,t),i=this._getStackIndex(this.index,this._cachedMeta.stack,n?a:void 0);l=e.start+e.chunk*i+e.chunk/2,h=Math.min(o,e.chunk*e.ratio)}else l=t.getPixelForValue(this.getParsed(a)[t.axis],a),h=Math.min(o,s.min*s.ratio);return{base:l-h/2,head:l+h/2,center:l,size:h}}draw(){var t=this._cachedMeta,e=t.vScale,i=t.data,a=i.length;let s=0;for(;s<a;++s)null!==this.getParsed(s)[e.axis]&&i[s].draw(this._ctx)}},BubbleController:class extends Aa{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,a){var s=super.parsePrimitiveData(t,e,i,a);for(let t=0;t<s.length;t++)s[t]._custom=this.resolveDataElementOptions(t+i).radius;return s}parseArrayData(t,i,a,e){var s=super.parseArrayData(t,i,a,e);for(let e=0;e<s.length;e++){let t=i[a+e];s[e]._custom=T(t[2],this.resolveDataElementOptions(e+a).radius)}return s}parseObjectData(t,i,a,e){var s=super.parseObjectData(t,i,a,e);for(let e=0;e<s.length;e++){let t=i[a+e];s[e]._custom=T(t&&t.r&&+t.r,this.resolveDataElementOptions(e+a).radius)}return s}getMaxOverflow(){var e=this._cachedMeta.data;let i=0;for(let t=e.length-1;0<=t;--t)i=Math.max(i,e[t].size(this.resolveDataElementOptions(t))/2);return 0<i&&i}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:e,yScale:a}=e,s=this.getParsed(t),e=e.getLabelForValue(s.x),a=a.getLabelForValue(s.y),s=s._custom;return{label:i[t]||"",value:"("+e+", "+a+(s?", "+s:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(n,t,e,o){var l="reset"===o,{iScale:h,vScale:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,o),g=h.axis,f=d.axis;for(let r=t;r<t+e;r++){let t=n[r],e=!l&&this.getParsed(r),i={},a=i[g]=l?h.getPixelForDecimal(.5):h.getPixelForValue(e[g]),s=i[f]=l?d.getBasePixel():d.getPixelForValue(e[f]);i.skip=isNaN(a)||isNaN(s),u&&(i.options=c||this.resolveDataElementOptions(r,t.active?"active":o),l)&&(i.options.radius=0),this.updateElement(t,r,i,o)}}resolveDataElementOptions(t,e){var i=this.getParsed(t);let a=super.resolveDataElementOptions(t,e);t=(a=a.$shared?Object.assign({},a,{$shared:!1}):a).radius;return"active"!==e&&(a.radius=0),a.radius+=T(i&&i._custom,t),a}},DoughnutController:ps,LineController:class extends Aa{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){var e=this._cachedMeta,{dataset:i,data:a=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:n,count:o}=Ot(e,a,r);this._drawStart=n,this._drawCount=o,At(e)&&(n=0,o=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=a;e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0),e.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:e},t),this.updateElements(a,n,o,t)}updateElements(a,s,t,r){let n="reset"===r,{iScale:o,vScale:l,_stacked:h,_dataset:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(s,r),g=o.axis,f=l.axis,{spanGaps:e,segment:p}=this.options,m=ot(e)?e:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===r,x=s+t,v=a.length,_=0<s&&this.getParsed(s-1);for(let i=0;i<v;++i){let t=a[i],e=b?t:{};var y,M,w,k;i<s||i>=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=0<i&&Math.abs(y[g]-_[g])>m,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;n<t+e;n++){let t=o[n],e=this.resolveDataElementOptions(n,t.active?"active":l),i=h.getPointPositionForValue(n,this.getParsed(n).r),a=d?h.xCenter:i.x,s=d?h.yCenter:i.y,r={x:a,y:s,angle:i.angle,skip:isNaN(a)||isNaN(s),options:e};this.updateElement(t,n,r,l)}}},ScatterController:class extends Aa{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){var e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:e,yScale:a}=e,s=this.getParsed(t),e=e.getLabelForValue(s.x),a=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+e+", "+a+")"}}update(i){var a=this._cachedMeta,{data:s=[]}=a,r=this.chart._animationsDisabled;let{start:t,count:e}=Ot(a,s,r);if(this._drawStart=t,this._drawCount=e,At(a)&&(t=0,e=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:t,_dataset:e}=a;t._chart=this.chart,t._datasetIndex=this.index,t._decimated=!!e._decimated,t.points=s;var n=this.resolveDatasetElementOptions(i);n.segment=this.options.segment,this.updateElement(t,void 0,{animated:!r,options:n},i)}else this.datasetElementType&&(delete a.dataset,this.datasetElementType=!1);this.updateElements(s,t,e,i)}addElements(){var t=this.options.showLine;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(o,t,e,l){let h="reset"===l,{iScale:d,vScale:c,_stacked:u,_dataset:g}=this._cachedMeta,i=this.resolveDataElementOptions(t,l),f=this.getSharedOptions(i),p=this.includeOptions(l,f),m=d.axis,b=c.axis,{spanGaps:a,segment:x}=this.options,v=ot(a)?a:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||h||"none"===l,y=0<t&&this.getParsed(t-1);for(let n=t;n<t+e;++n){let t=o[n],e=this.getParsed(n),i=_?t:{},a=P(e[b]),s=i[m]=d.getPixelForValue(e[m],n),r=i[b]=h||a?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,e,u):e[b],n);i.skip=isNaN(s)||isNaN(r)||a,i.stop=0<n&&Math.abs(e[m]-y[m])>v,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<e&&e}}}});function bs(t,e,i,a){return{x:i+t*Math.cos(e),y:a+t*Math.sin(e)}}function xs(s,t,e,i,a,r){var{x:n,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=t,c=Math.max(t.outerRadius+i+e-h,0),h=0<d?d+i+e+h:0;let u=0;var g=a-l;if(i){let t=((0<d?d-i:0)+(0<c?c-i:0))/2;u=(g-(0!=t?g*t/(t+i):g))/2}var d=(g-Math.max(.001,g*c-e/S)/c)/2,g=l+d+u,l=a-d-u,{outerStart:d,outerEnd:f,innerStart:p,innerEnd:m}=function(t,e,i,a){t=yi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);let s=(i-e)/2,r=Math.min(s,a*e/2),n=t=>{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<f){let t=bs(x,_,n,o);s.arc(t.x,t.y,f,_,l+D)}let e=bs(M,l,n,o);if(s.lineTo(e.x,e.y),0<m){let t=bs(M,k,n,o);s.arc(t.x,t.y,m,l+D,k+Math.PI)}let i=(l-m/h+(g+p/h))/2;if(s.arc(n,o,h,l-m/h,i,!0),s.arc(n,o,h,i,g+p/h,!0),0<p){let t=bs(y,w,n,o);s.arc(t.x,t.y,p,w+Math.PI,g-D)}let a=bs(b,g,n,o);if(s.lineTo(a.x,a.y),0<d){let t=bs(b,v,n,o);s.arc(t.x,t.y,d,g-D,v)}}else{s.moveTo(n,o);let t=Math.cos(v)*c+n,e=Math.sin(v)*c+o,i=(s.lineTo(t,e),Math.cos(_)*c+n),a=Math.sin(_)*c+o;s.lineTo(i,a)}s.closePath()}function vs(t,e,i=e){t.lineCap=T(i.borderCapStyle,e.borderCapStyle),t.setLineDash(T(i.borderDash,e.borderDash)),t.lineDashOffset=T(i.borderDashOffset,e.borderDashOffset),t.lineJoin=T(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=T(i.borderWidth,e.borderWidth),t.strokeStyle=T(i.borderColor,e.borderColor)}function _s(t,e,i){t.lineTo(i.x,i.y)}function ys(t,e,i={}){var t=t.length,{start:i=0,end:a=t-1}=i,{start:s,end:r}=e,n=Math.max(i,s),o=Math.min(a,r);return{count:t,start:n,loop:e.loop,ilen:o<n&&!(i<s&&a<s||r<i&&r<a)?t+o-n:o-n}}function Ms(t,e,i,a){let{points:s,options:r}=e,{count:n,start:o,loop:l,ilen:h}=ys(s,i,a),d=r.stepped?We:r.tension||"monotone"===r.cubicInterpolationMode?Ne:_s,c,u,g,{move:f=!0,reverse:p}=a||{};for(c=0;c<=h;++c)(u=s[(o+(p?h-c:c))%n]).skip||(f?(t.moveTo(u.x,u.y),f=!1):d(t,g,u,p,r.stepped),g=u);return l&&(u=s[(o+(p?h:0))%n],d(t,g,u,p,r.stepped)),!!l}function ws(a,t,e,i){let s=t.points,{count:r,start:n,ilen:o}=ys(s,e,i),{move:l=!0,reverse:h}=i||{},d,c,u,g,f,p,m=0,b=0;var x=t=>(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?(e<g?g=e:e>f&&(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<t;++s){let{start:t,end:e}=d[s],i=h[t],a=h[e];i===a?u.push(i):((c=g(i,a,Math.abs((l-i[n])/(a[n]-i[n])),o.stepped))[n]=r[n],u.push(c))}return 1===u.length?u[0]:u}}pathSegment(t,e,i){return ks(this)(t,this,e,i)}path(t,e,i){var a,s=this.segments,r=ks(this);let n=this._loop;e=e||0,i=i||this.points.length-e;for(a of s)n&=r(t,this,a,{start:e,end:e+i-1});return!!n}draw(t,e,i,a){var s,r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),r=t,s=this,i=i,a=a,(Ss&&!s.options.segment?function(t,e,i,a){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,a)&&s.closePath()),vs(t,e.options),t.stroke(s)}:function(t,e,i,a){var s,{segments:r,options:n}=e,o=ks(e);for(s of r)vs(t,n,s.style),t.beginPath(),o(t,e,s,{start:i,end:i+a-1})&&t.closePath(),t.stroke()})(r,s,i,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ds(t,e,i,a){var s=t.options,{[i]:t}=t.getProps([i],a);return Math.abs(e-t)<s.radius+s.hitRadius}function Cs(t,e){var{x:e,y:i,base:a,width:s,height:r}=t.getProps(["x","y","base","width","height"],e);let n,o,l,h,d;return h=t.horizontal?(d=r/2,n=Math.min(e,a),o=Math.max(e,a),l=i-d,i+d):(d=s/2,n=e-d,o=e+d,l=Math.min(i,a),Math.max(i,a)),{left:n,top:l,right:o,bottom:h}}function Os(t,e,i,a){return t?0:C(e,i,a)}function As(t,e,i,a){var s=null===e,r=null===i,t=t&&!(s&&r)&&Cs(t,a);return t&&(s||d(e,t.left,t.right))&&(r||d(i,t.top,t.bottom))}function Ts(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ls(t,e,i={}){var a=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0;return{x:t.x+a,y:t.y+s,w:t.w+((t.x+t.w!==i.x+i.w?e:0)-a),h:t.h+((t.y+t.h!==i.y+i.h?e:0)-s),radius:t.radius}}var Es=Object.freeze({__proto__:null,ArcElement:class extends e{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"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;t<d;++t)l.fill();isNaN(u)||(t=c+(u%v||v))}xs(l,s,a,i,t,h),l.fill()}var g=e,c=this,u=o,s=r,a=n,{fullCircles:f,startAngle:i,circumference:h,options:o}=c,{borderWidth:r,borderJoinStyle:n,borderDash:p,borderDashOffset:m}=o,o="inner"===o.borderAlign;if(r){g.setLineDash(p||[]),g.lineDashOffset=m,o?(g.lineWidth=2*r,g.lineJoin=n||"round"):(g.lineWidth=r,g.lineJoin=n||"bevel");let t=c.endAngle;if(f){xs(g,c,u,s,t,a);for(let t=0;t<f;++t)g.stroke();isNaN(h)||(t=i+(h%v||v))}if(o){p=g;m=c;r=t;var{startAngle:m,pixelMargin:n,x:i,y:h,outerRadius:o,innerRadius:b}=m,x=n/o;p.beginPath(),p.arc(i,h,o,m-x,r+x),n<b?p.arc(i,h,b,r+(x=n/b),m-x,!0):p.arc(i,h,n,r+D,m-D),p.closePath(),p.clip()}f||(xs(g,c,u,s,t,a),g.stroke())}e.restore()}}},BarElement:class extends e{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e,i,a,s,r,n,o,{inflateAmount:l,options:{borderColor:h,backgroundColor:d}}=this,{inner:c,outer:u}=(a=Cs(e=this),s=a.right-a.left,u=s/2,n=(r=a.bottom-a.top)/2,o=(i=e).options.borderWidth,i=i.borderSkipped,o=Mi(o),n={t:Os(i.top,o.top,0,n),r:Os(i.right,o.right,0,u),b:Os(i.bottom,o.bottom,0,n),l:Os(i.left,o.left,0,u)},i=s/2,o=r/2,e=(u=e).getProps(["enableBorderRadius"]).enableBorderRadius,c=u.options.borderRadius,g=wi(c),i=Math.min(i,o),o=u.borderSkipped,e={topLeft:Os(!(u=e||A(c))||o.top||o.left,g.topLeft,0,i),topRight:Os(!u||o.top||o.right,g.topRight,0,i),bottomLeft:Os(!u||o.bottom||o.left,g.bottomLeft,0,i),bottomRight:Os(!u||o.bottom||o.right,g.bottomRight,0,i)},{outer:{x:a.left,y:a.top,w:s,h:r,radius:e},inner:{x:a.left+n.l,y:a.top+n.t,w:s-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,e.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,e.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,e.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,e.bottomRight-Math.max(n.b,n.r))}}}),g=(o=u.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?je:Ts;t.save(),u.w===c.w&&u.h===c.h||(t.beginPath(),g(t,Ls(u,l,c)),t.clip(),g(t,Ls(c,-l,u)),t.fillStyle=h,t.fill("evenodd")),t.beginPath(),g(t,Ls(c,l)),t.fillStyle=d,t.fill(),t.restore()}inRange(t,e,i){return As(this,t,e,i)}inXRange(t,e){return As(this,t,null,e)}inYRange(t,e){return As(this,null,t,e)}getCenterPoint(t){var{x:t,y:e,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(t+i)/2:t,y:a?e:(e+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:Ps,PointElement:class extends e{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var a=this.options,{x:i,y:s}=this.getProps(["x","y"],i);return Math.pow(t-i,2)+Math.pow(e-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(t,e){return Ds(this,t,"x",e)}inYRange(t,e){return Ds(this,t,"y",e)}getCenterPoint(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}size(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(t,e){var i=this.options;this.skip||i.radius<.1||!y(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ze(t,i,this.x,this.y))}getRange(){var t=this.options||{};return t.radius+t.hitRadius}}});function Rs(t){var e=this.getLabels();return 0<=t&&t<e.length?e[t]:t}function Is(t,e,{horizontal:i,minRotation:a}){a=L(a),i=(i?Math.sin(a):Math.cos(a))||.001;return Math.min(e/i,.75*e*(""+t).length)}class zs extends Fa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return P(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let t=this.options.beginAtZero,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:a,max:s}=this;var r,n=t=>a=e?a:t,o=t=>s=i?s:t;if(t){let t=_(a),e=_(s);t<0&&e<0?o(0):0<t&&0<e&&n(0)}a===s&&(r=0===s?1:Math.abs(.05*s),o(s+r),t||n(a-r)),this.min=a,this.max=s}getTickLimit(){let t,{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?1e3<(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),e=e||11),t=e?Math.min(e,t):t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var t=this.options,e=t.ticks,i=this.getTickLimit(),i=function(t,e){var i=[],{bounds:a,step:s,min:r,max:n,precision:o,count:l,maxTicks:h,maxDigits:d,includeBounds:c}=t,u=s||1,g=h-1,{min:e,max:f}=e,p=!P(r),m=!P(n),b=!P(l),d=(f-e)/(d+1);let x,v,_,y,M=rt((f-e)/g/u)*u;if(M<1e-14&&!p&&!m)return[{value:e},{value:f}];(y=Math.ceil(f/M)-Math.floor(e/M))>g&&(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}),v<r&&w++,st(Math.round((v+w*M)*x)/x,r,Is(r,d,t))&&w++):v<r&&w++);w<y;++w){let t=Math.round((v+w*M)*x)/x;if(m&&t>n)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)&&0<t?t:null;this._zero=!0}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?Math.max(0,t):null,this.max=p(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!p(this._userMin)&&(this.min=t===Bs(this.min,0)?Bs(this.min,-1):Bs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:i}=this.getUserBounds(),a=this.min,s=this.max;var t=t=>a=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(;10<Ns(t,e,i);)i++;for(;Ns(t,e,i)<10;)i--;return Math.min(i,Vs(t))}(e,i),n=r<0?Math.pow(10,Math.abs(r)):1;var o=Math.pow(10,r),l=s>r?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(;c<i;)a.push({value:c,major:Ws(c),significand:d}),10<=d?d=d<15?15:20:d++,20<=d&&(r++,d=2,n=0<=r?1:n),c=Math.round((l+h+d*Math.pow(10,r))*n)/n;return e=u(t.max,c),a.push({value:e,major:Ws(e),significand:d}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&ht(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ce(t,this.chart.options.locale,this.options.ticks.format)}configure(){var t=this.min;super.configure(),this._startValue=o(t),this._valueRange=o(this.max)-o(t)}getPixelForValue(t){return null===(t=void 0!==t&&0!==t?t:this.min)||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(o(t)-this._startValue)/this._valueRange)}getValueForPixel(t){t=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+t*this._valueRange)}}function js(t){var e=t.ticks;if(e.display&&t.display){let t=I(e.backdropPadding);return T(e.font&&e.font.size,R.font.size)+t.height}return 0}function Ys(t,e,i,a,s){return t===a||t===s?{start:e-i/2,end:e+i/2}:t<a||s<t?{start:e-i,end:e}:{start:e,end:e+i}}function $s(i){let s={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},r=Object.assign({},s),a=[],n=[],t=i._pointLabels.length,o=i.options.pointLabels,l=o.centerPointLabels?S/t:0;for(let e=0;e<t;e++){let t=o.setContext(i.getPointLabelContext(e));n[e]=t.padding;var h=i.getPointPosition(e,i.drawingArea+n[e],l),d=z(t.font),c=(c=i.ctx,d=d,u=O(u=i._pointLabels[e])?u:[u],{w:Ee(c,d.string,u),h:u.length*d.lineHeight}),u=(a[e]=c,x(i.getIndexAngle(e)+l)),d=Math.round(dt(u));{g=void 0;f=void 0;p=void 0;m=void 0;b=void 0;var g=r;var f=s;var p=u;var m=Ys(d,h.x,c.w,0,180);var b=Ys(d,h.y,c.h,90,270);let t=Math.abs(Math.sin(p)),e=Math.abs(Math.cos(p)),i=0,a=0;m.start<f.l?(i=(f.l-m.start)/t,g.l=Math.min(g.l,f.l-i)):f.r<m.end&&(i=(m.end-f.r)/t,g.r=Math.max(g.r,f.r+i)),b.start<f.t?(a=(f.t-b.start)/e,g.t=Math.min(g.t,f.t-a)):f.b<b.end&&(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;e<t;e++){l.padding=s[e],l.size=a[e];let t=function(t,e,i){let a=t.drawingArea,{extra:s,additionalAngle:r,padding:n,size:o}=i,l=t.getPointPosition(e,a+s+n,r),h=Math.round(dt(x(l.angle+D))),d=function(t,e){return 90===h||270===h?t-=e/2:(270<h||h<90)&&(t-=e),t}(l.y,o.h),c=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(h),u=function(t,e){return"right"===c?t-=e:"center"===c&&(t-=e/2),t}(l.x,o.w);return{visible:!0,x:l.x,y:d,textAlign:c,left:u,top:d,right:u+o.w,bottom:d+o.h}}(i,e,l);r.push(t),"auto"===o&&(t.visible=function(t,e){if(!e)return!0;var{left:t,top:i,right:a,bottom:s}=t;return!(y({x:t,y:i},e)||y({x:t,y:s},e)||y({x:a,y:i},e)||y({x:a,y:s},e))}(t,h),t.visible)&&(h=t)}return r}(i,a,n)}function Us(e,i,t,a){var s=e.ctx;if(t)s.arc(e.xCenter,e.yCenter,i,0,v);else{var r=e.getPointPosition(0,i);s.moveTo(r.x,r.y);for(let t=1;t<a;t++)r=e.getPointPosition(t,i),s.lineTo(r.x,r.y)}}class Xs extends zs{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ge.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,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&&t<e.length)return e=e[t],Pi(this.getContext(),{label:e,index:t,type:"pointLabel"})}getPointPosition(t,e,i=0){t=this.getIndexAngle(t)-D+i;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var{left:t,top:e,right:i,bottom:a}=this._pointLabelItems[t];return{left:t,top:e,right:i,bottom:a}}drawBackground(){var t,{backgroundColor:e,grid:{circular:i}}=this.options;e&&((t=this.ctx).save(),t.beginPath(),Us(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),t.closePath(),t.fillStyle=e,t.fill(),t.restore())}drawGrid(){let a=this.ctx,s=this.options,{angleLines:r,grid:l,border:h}=s,d=this._pointLabels.length,n,c,o;if(s.pointLabels.display){var i=this,t=d,{ctx:u,options:{pointLabels:g}}=i;for(let e=t-1;0<=e;e--){let t=i._pointLabelItems[e];if(t.visible){var f,p=g.setContext(i.getPointLabelContext(e)),m=(f=M=y=_=v=x=b=m=void 0,u),b=p,x=t,{left:v,top:_,right:y,bottom:M}=x;if(!P(f=b.backdropColor)){let t=wi(b.borderRadius),e=I(b.backdropPadding);m.fillStyle=f;b=v-e.left,f=_-e.top,y=y-v+e.width,v=M-_+e.height;Object.values(t).some(t=>0!==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-1;++i){let t=qs[h[i]],e=t.steps||Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((s-a)/(e*t.size))<=r)return h[i]}return h[e-1]}function Js(t,e,i){var a,s;i?i.length&&({lo:a,hi:s}=bt(i,e),t[e<=i[a]?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<e;++n)r[o=t[n]]=n,s.push({value:o,major:!1});if(0!==e&&a){var l=s,h=r,d=a,c=i._adapter,a=+c.startOf(l[0].value,d),u=l[l.length-1].value;let t,e;for(t=a;t<=u;t=+c.add(t,1,d))0<=(e=h[t])&&(l[e].major=!0);return l}return s}class tr extends Fa{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){var i=t.time||(t.time={}),a=this._adapter=new hs._date(t.adapters.date);a.init(e),$(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Gs(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:a,max:s,minDefined:r,maxDefined:n}=this.getUserBounds();function o(t){r||isNaN(t.min)||(a=Math.min(a,t.min)),n||isNaN(t.max)||(s=Math.max(s,t.max))}r&&n||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source)||o(this.getMinMax(!1)),a=p(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),s=p(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){var t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){var t=this.options,e=t.time,i=t.ticks,a="labels"===i.source?this.getLabelTimestamps():this._generate(),s=("ticks"===t.bounds&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]),this.min),r=vt(a,s,this.max);return this._unit=e.unit||(i.autoSkip?Zs(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):function(i,a,t,s,r){for(let e=h.length-1;e>=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<e;++t)if(qs[h[t]].common)return h[t]}(this._unit):void 0,this.initOffsets(a),t.reverse&&r.reverse(),Qs(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(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<i;h=+t.add(h,n,r),d++)Js(l,h,u);return h!==i&&"ticks"!==a.bounds&&1!==d||Js(l,h,u),Object.keys(l).sort(Ks).map(t=>+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<i;++e)(a=t[e]).label=this._tickFormatFunction(a.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){var e=this._offsets,t=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+t)*e.factor)}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+t*(this.max-this.min)}_getLabelSize(t){var e=this.options.ticks,t=this.ctx.measureText(t).width,e=L(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(e),e=Math.sin(e),a=this._resolveTickFontOptions(0).size;return{w:t*i+a*e,h:t*e+a*i}}_getLabelCapacity(t){var e=this.options.time,i=e.displayFormats,e=i[e.unit]||i.millisecond,i=this._tickFormatFunction(t,0,Qs(this,[t],this._majorUnit),e),t=this._getLabelSize(i),e=Math.floor(this.isHorizontal()?this.width/t.w:this.height/t.h)-1;return 0<e?e:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;var a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(t=0,e=a.length;t<e;++t)i=i.concat(a[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){var t=this._cache.labels||[];let e,i;if(t.length)return t;var a=this.getLabels();for(e=0,i=a.length;e<i;++e)t.push(Gs(this,a[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wt(t.sort(Ks))}}function er(t,e,i){let a,s,r,n,o=0,l=t.length-1;i?(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<n;++r)(l=t[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;r<n;++r)h=a[r+1],o=a[r-1],l=a[r],Math.round((h+o)/2)!==l&&s.push({time:l,pos:r/(n-1)});return s}_generate(){var t=this.min,e=this.max,i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort((t,e)=>t-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;u<e-2;u++){let t,e=0,i=0,a=Math.floor((u+1)*d)+1+o,s=Math.min(Math.floor((u+2)*d)+1,l)+o,r=s-a;for(t=a;t<s;t++)e+=n[t].x,i+=n[t].y;e/=r,i/=r;var x=Math.floor(u*d)+1+o,v=Math.min(Math.floor((u+1)*d)+1,l)+o,{x:_,y}=n[b];for(f=-1,t=x;t<v;t++)(p=.5*Math.abs((_-e)*(n[t].y-y)-(_-n[t].x)*(i-y)))>f&&(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;s<t+e;++s){n=((r=a[s]).x-b)/x*i,o=r.y;let t=0|n;if(t===l)o<u?(u=o,h=s):o>g&&(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<s&&i!==c&&m.push(a[i]),m.push(r),l=t,p=0,u=g=o,h=d=c=s}}return m}(s,r,n,o);break;default:throw new Error(`Unsupported decimation algorithm '${M.algorithm}'`)}e._decimated=t}}}})}else cr(l)},destroy(t){cr(t)}};function gr(i,a,s,t){if(!t){let t=a[i],e=s[i];return"angle"===i&&(t=x(t),e=x(e)),{property:i,start:t,end:e}}}function fr(t,e,i){for(;t<e;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function pr(t,e,i,a){return t&&e?a(t[i],e[i]):t?t[i]:e?e[i]:0}function mr(e,t){let i=[],a=!1;return(i=O(e)?(a=!0,e):function(t){let{x:i=null,y:a=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:t,end:e})=>{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<a.length;t++){var{first:r,last:n,point:o}=function(t,e,s){let i=t.interpolate(e,s);if(!i)return{};let r=i[s],n=t.segments,o=t.points,l=!1,h=!1;for(let a=0;a<n.length;a++){let t=n[a],e=o[t.start][s],i=o[t.end][s];if(d(r,e,i)){l=r===e,h=r===i;break}}return{first:l,last:h,point:i}}(a[t],i,"x");if(!(!o||r&&n))if(r)s.unshift(o);else if(e.push(o),!n)break}e.push(...s)}class vr{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){var{x:a,y:s,radius:r}=this;return e=e||{start:0,end:v},t.arc(a,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){var{x:e,y:i,radius:a}=this,t=t.angle;return{x:e+Math.cos(t)*a,y:i+Math.sin(t)*a,angle:t}}}function _r(o){var t,e,{chart:i,fill:a,line:s}=o;if(p(a))return t=a,(e=(i=i).getDatasetMeta(t))&&i.isDatasetVisible(t)?e.dataset:null;if("stack"!==a)return"shape"===a||((i=function(o){if((o.scale||{}).getPointPositionForValue){var l=o;let{scale:e,fill:t}=l,i=e.options,a=e.getLabels().length,s=i.reverse?e.max:e.min,r=(l=t,h=e,"start"===l?s:"end"===l?h.options.reverse?h.min:h.max:A(l)?l.value:h.getBaseValue()),n=[];if(i.grid.circular){let t=e.getPointPositionForValue(0,s);return new vr({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<a;++t)n.push(e.getPointPositionForValue(t,r));return n}var t=o,{scale:l={},fill:t}=t,h=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:A(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(t,l);if(p(h)){let t=l.isHorizontal();return{x:t?h:null,y:t?null:h}}return null}(o))instanceof vr?i:mr(i,s));{let{scale:t,index:e,line:i}=o,a=[],s=i.segments,r=i.points,n=function(t,e){var i=[],a=t.getMatchingVisibleMetas("line");for(let t=0;t<a.length;t++){var s=a[t];if(s.index===e)break;s.hidden||i.unshift(s.dataset)}return i}(t,e);n.push(mr({x:null,y:t.bottom},i));for(let t=0;t<s.length;t++){let e=s[t];for(let t=e.start;t<=e.end;t++)xr(a,r[t],n)}return new Ps({points:a,options:{}})}}function yr(t,e,i){var a,s=_r(e),{line:e,scale:r,axis:n}=e,o=e.options,l=o.fill,o=o.backgroundColor,{above:l=o,below:o=o}=l||{};s&&e.points.length&&(Ve(t,i),a=t,{line:s,target:l,above:o,below:i,area:r,scale:n}=e={line:e,target:s,above:l,below:o,area:i,scale:r,axis:n},e=s._loop?"angle":e.axis,a.save(),"x"===e&&i!==o&&(Mr(a,l,r.top),wr(a,{line:s,target:l,color:o,scale:n,property:e}),a.restore(),a.save(),Mr(a,l,r.bottom)),wr(a,{line:s,target:l,color:i,scale:n,property:e}),a.restore(),Be(t))}function Mr(s,r,n){let{segments:t,points:o}=r,l=!0,h=!1;s.beginPath();for(var d of t){let{start:t,end:e}=d,i=o[t],a=o[fr(t,e,o)];l?(s.moveTo(i.x,i.y),l=!1):(s.lineTo(i.x,n),s.lineTo(i.x,i.y)),(h=!!r.pathSegment(s,d,{move:h}))?s.closePath():s.lineTo(a.x,n)}s.lineTo(r.first().x,n),s.closePath(),s.clip()}function wr(o,t){let{line:l,target:h,property:d,color:c,scale:u}=t,e=function(t,e,s){let i=t.segments,r=t.points,n=e.points,o=[];for(let t of i){var{start:a,end:l}=t,l=fr(a,l,r),h=gr(s,r[a],r[l],t.loop);if(e.segments){var d=Ei(e,h);for(let a of d){let e=gr(s,n[a.start],n[a.end],a.loop),i=Li(t,r,e);for(let t of i)o.push({source:t,target:a,start:{[s]:pr(h,e,"start",Math.max)},end:{[s]:pr(h,e,"end",Math.min)}})}}else o.push({source:t,target:h,start:r[a],end:r[l]})}return o}(l,h,d);for(let{source:a,target:s,start:r,end:n}of e){let{style:{backgroundColor:t=c}={}}=a,e=!0!==h;o.save(),o.fillStyle=t,x=b=m=p=f=g=void 0;var g=o,f=u,p=e&&gr(d,r,n),{top:f,bottom:m}=f.chart.chartArea,{property:p,start:b,end:x}=p||{},p=("x"===p&&(g.beginPath(),g.rect(b,f,x-b,m-f),g.clip()),o.beginPath(),!!l.pathSegment(o,a));let i;if(e){p?o.closePath():kr(o,h,n,d);let t=!!h.pathSegment(o,s,{move:p,reverse:!0});(i=p&&t)||kr(o,h,r,d)}o.closePath(),o.fill(i?"evenodd":"nonzero"),o.restore()}}function kr(t,e,i,a){e=e.interpolate(i,a);e&&t.lineTo(e.x,e.y)}var Sr={id:"filler",afterDatasetsUpdate(t,e,i){var a,s,r,n,o,l,h=(t.data.datasets||[]).length,d=[];let c,u,g,f;for(u=0;u<h;++u)g=(c=t.getDatasetMeta(u)).dataset,f=null,g&&g.options&&g instanceof Ps&&(f={visible:t.isDatasetVisible(u),index:u,fill:(a=g,s=u,r=h,l=o=n=void 0,A(l=function(){var t=a.options,e=t.fill;let i=T(e&&e.target,e);return!1!==(i=void 0===i?!!t.backgroundColor:i)&&null!==i&&(!0===i?"origin":i)}())?!isNaN(l.value)&&l:p(o=parseFloat(l))&&Math.floor(o)===o?(n=l[0],o=o,!((o="-"!==n&&"+"!==n?o:s+o)===s||o<0||r<=o)&&o):0<=["origin","start","end","stack","shape"].indexOf(l)&&l),chart:t,axis:c.controller.options.indexAxis,scale:c.vScale,line:g}),c.$filler=f,d.push(f);for(u=0;u<h;++u)(f=d[u])&&!1!==f.fill&&(f.fill=function(t,e,i){let a=t[e].fill;var s,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!p(a))return a;if(!(s=t[a]))return!1;if(s.visible)return a;r.push(a),a=s.fill}return!1}(d,u,i.propagate))},beforeDraw(i,t,e){var a="beforeDraw"===e.drawTime,s=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let e=s.length-1;0<=e;--e){let t=s[e].$filler;t&&(t.line.updateControlPoints(r,t.axis),a)&&t.fill&&yr(i.ctx,t,r)}},beforeDatasetsDraw(i,t,e){if("beforeDatasetsDraw"===e.drawTime){var a=i.getSortedVisibleDatasetMetas();for(let e=a.length-1;0<=e;--e){let t=a[e].$filler;br(t)&&yr(i.ctx,t,i.chartArea)}}},beforeDatasetDraw(t,e,i){e=e.meta.$filler;br(e)&&"beforeDatasetDraw"===i.drawTime&&yr(t.ctx,e,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let Pr=(t,e)=>{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<e?0:1)]=0,g+=d,u++),l[e]={left:0,top:g,row:u,width:t,height:s},h[h.length-1]+=t+o}),c}_fitCols(t,o,l,h){let{ctx:d,maxHeight:e,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],g=this.columnSizes=[],f=e-t,p=c,m=0,b=0,x=0,v=0;return this.legendItems.forEach((t,e)=>{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)};0<e&&b+n+2*c>f&&(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?0<a&&s+t+x>this.right&&(r=y.y+=D,y.line++,s=y.x=E(g,this.left+x,this.right-c[y.line])):0<a&&r+D>this.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;i<s.length;++i)if(d(t,(a=s[i]).left,a.left+a.width)&&d(e,a.top,a.top+a.height))return this.legendItems[i];return null}handleEvent(t){var e,i,a,s=this.options;("mousemove"!==(e=t.type)&&"mouseout"!==e||!s.onHover&&!s.onLeave)&&(!s.onClick||"click"!==e&&"mouseup"!==e)||(e=this._getLegendItemAt(t.x,t.y),"mousemove"===t.type||"mouseout"===t.type?(a=null!==(i=this._hoveredItem)&&null!==e&&i.datasetIndex===e.datasetIndex&&i.index===e.index,i&&!a&&c(s.onLeave,[t,i,this],this),(this._hoveredItem=e)&&!a&&c(s.onHover,[t,e,this],this)):e&&c(s.onClick,[t,e,this],this))}}function Cr(t,e){return e*(t.text?t.text.length:0)}var Or={id:"legend",_element:Dr,start(t,e,i){var a=t.legend=new Dr({ctx:t.ctx,options:i,chart:t});s.configure(t,a,i),s.addBox(t,a)},stop(t){s.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){var a=t.legend;s.configure(t,a,i),a.options=i},afterUpdate(t){t=t.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){var a=e.datasetIndex,i=i.chart;i.isDatasetVisible(a)?(i.hide(a),e.hidden=!0):(i.show(a),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.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;i<e;++i){let e=t[i].element;if(e&&e.hasValue()){let t=e.tooltipPosition();a+=t.x,s+=t.y,++r}}return{x:a/r,y:s/r}},nearest(t,i){if(!t.length)return!1;let a,e,s,r=i.x,n=i.y,o=Number.POSITIVE_INFINITY;for(a=0,e=t.length;a<e;++a){let e=t[a].element;if(e&&e.hasValue()){let t=gt(i,e.getCenterPoint());t<o&&(o=t,s=e)}}if(s){let t=s.tooltipPosition();r=t.x,n=t.y}return{x:r,y:n}}};function b(t,e){return e&&(O(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ir(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function zr(t,e){function i(t){b=Math.max(b,a.measureText(t).width+v)}let a=t.chart.ctx,{body:s,footer:r,title:n}=t,{boxWidth:o,boxHeight:l}=e,h=z(e.bodyFont),d=z(e.titleFont),c=z(e.footerFont),u=n.length,g=r.length,f=s.length,p=I(e.padding),m=p.height,b=0,x=s.reduce((t,e)=>t+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 t<e/2?"top":t>i.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<t.length){var t=t[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(0<i&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");t=t.formattedValue;return P(t)||(e+=t),e},labelColor(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t};function w(t,e,i,a){t=t[e].call(i,a);return void 0===t?Hr[e].call(i,a):t}class jr extends e{static positioners=Rr;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){var t,e=this._cachedAnimations;return e||(e=this.chart,e=(t=this.options.setContext(this.getContext())).enabled&&e.options.animation&&t.animations,t=new va(this.chart,e),e._cacheable&&(this._cachedAnimations=Object.freeze(t)),t)}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),Pi(t,{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})));var t}getTitle(t,e){var e=e.callbacks,i=w(e,"beforeTitle",this,t),a=w(e,"title",this,t),e=w(e,"afterTitle",this,t),t=b([],Ir(i));return t=b(t,Ir(a)),b(t,Ir(e))}getBeforeBody(t,e){return Wr(w(e.callbacks,"beforeBody",this,t))}getBody(t,e){let a=e.callbacks,s=[];return k(t,t=>{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;e<o;++e)l.push(function(t,e){var{element:e,datasetIndex:i,index:a}=e,s=t.getDatasetMeta(i).controller,{label:r,value:n}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[i].data[a],formattedValue:n,dataset:s.getDataset(),dataIndex:a,datasetIndex:i,element:e}}(this.chart,t[e]));return a.filter&&(l=l.filter((t,e,i)=>a.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;o<s;++o)e.fillText(a[o],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n,o+1===s&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(a,t,e,s,r){let n=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:l,boxWidth:h}=r,i=z(r.bodyFont),d=Br(this,"left",r),c=s.x(d),u=l<i.lineHeight?(i.lineHeight-l)/2:0,g=t.y+u;if(r.usePointStyle){let t={radius:Math.min(h,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(c,h)+h/2,i=g+l/2;a.strokeStyle=r.multiKeyBackground,a.fillStyle=r.multiKeyBackground,ze(a,t,e,i),a.strokeStyle=n.borderColor,a.fillStyle=n.backgroundColor,ze(a,t,e,i)}else{a.lineWidth=A(n.borderWidth)?Math.max(...Object.values(n.borderWidth)):n.borderWidth||1,a.strokeStyle=n.borderColor,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset||0;let t=s.leftForLtr(c,h),e=s.leftForLtr(s.xPlus(c,1),h-2),i=wi(n.borderRadius);Object.values(i).some(t=>0!==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<y;++v){for(m=s[v],b=this.labelTextColors[v],i.fillStyle=b,k(m.before,a),x=m.lines,o&&x.length&&(this._drawColorBox(i,e,v,f,t),u=Math.max(c.lineHeight,l)),_=0,M=x.length;_<M;++_)a(x[_]),u=c.lineHeight;k(m.after,a)}g=0,u=c.lineHeight,k(this.afterBody,a),e.y-=r}drawFooter(t,e,i){var a=this.footer,s=a.length;let r,n;if(s){var o=Di(i.rtl,this.x,this.width);for(t.x=Br(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",r=z(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,n=0;n<s;++n)e.fillText(a[n],o.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,a){var{xAlign:s,yAlign:r}=this,{x:n,y:o}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:g}=wi(a.cornerRadius);e.fillStyle=a.backgroundColor,e.strokeStyle=a.borderColor,e.lineWidth=a.borderWidth,e.beginPath(),e.moveTo(n+d,o),"top"===r&&this.drawCaret(t,e,i,a),e.lineTo(n+l-c,o),e.quadraticCurveTo(n+l,o,n+l,o+c),"center"===r&&"right"===s&&this.drawCaret(t,e,i,a),e.lineTo(n+l,o+h-g),e.quadraticCurveTo(n+l,o+h,n+l-g,o+h),"bottom"===r&&this.drawCaret(t,e,i,a),e.lineTo(n+u,o+h),e.quadraticCurveTo(n,o+h,n,o+h-u),"center"===r&&"left"===s&&this.drawCaret(t,e,i,a),e.lineTo(n,o+d),e.quadraticCurveTo(n,o,n+d,o),e.closePath(),e.fill(),0<a.borderWidth&&e.stroke()}_updateAnimationTarget(e){let i=this.chart,t=this.$animations,a=t&&t.x,s=t&&t.y;if(a||s){let t=Rr[e.position].call(this,this._active,this._eventPosition);var r,n;t&&(r=this._size=zr(this,e),n=Vr(e,n=Object.assign({},t,this._size),e=Fr(i,e,n),i),a._to===n.x&&s._to===n.y||(this.xAlign=e.xAlign,this.yAlign=e.yAlign,this.width=r.width,this.height=r.height,this.caretX=t.x,this.caretY=t.y,this._resolveAnimations().update(this,n)))}}_willRender(){return!!this.opacity}draw(t){var e,i,a,s,r=this.options.setContext(this.getContext()),n=this.opacity;n&&(this._updateAnimationTarget(r),e={width:this.width,height:this.height},i={x:this.x,y:this.y},n=Math.abs(n)<.001?0:n,a=I(r.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length,r.enabled)&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(i,t,e,r),Ci(t,r.textDirection),i.y+=a.top,this.drawTitle(i,t,r),this.drawBody(i,t,r),this.drawFooter(i,t,r),Oi(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){var i=this._active,t=t.map(({datasetIndex:t,index:e})=>{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
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;s<r;s++)e.call(i,t[s],s);else if(A(t))for(n=Object.keys(t),r=n.length,s=0;s<r;s++)e.call(i,t[n[s]],n[s])}function W(t,e){let i,a,s,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,a=t.length;i<a;++i)if(s=t[i],r=e[i],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function N(e){if(O(e))return e.map(N);if(A(e)){var i=Object.create(null),a=Object.keys(e),s=a.length;let t=0;for(;t<s;++t)i[a[t]]=N(e[a[t]]);return i}return e}function H(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function j(t,e,i,a){var s;H(t)&&(s=e[t],i=i[t],A(s)&&A(i)?Y(s,i,a):e[t]=N(i))}function Y(a,t,s){var e=O(t)?t:[t],i=e.length;if(A(a)){var r,n=(s=s||{}).merger||j;for(let t=0;t<i;++t)if(A(r=e[t])){let i=Object.keys(r);for(let t=0,e=i.length;t<e;++t)n(i[t],a,r,s)}}return a}function $(t,e){return Y(t,e,{merger:U})}function U(t,e,i){var a;H(t)&&(a=e[t],i=i[t],A(a)&&A(i)?$(a,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=N(i)))}let X={"":t=>t,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)<i}function rt(t){var e=Math.round(t),e=(t=st(t,e,t/1e3)?e:t,Math.pow(10,Math.floor(o(t)))),t=t/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function nt(t){var e=[],i=Math.sqrt(t);let a;for(a=1;a<i;a++)t%a==0&&(e.push(a),e.push(t/a));return i===(0|i)&&e.push(i),e.sort((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<s;a++)r=t[a][i],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function L(t){return t*(S/180)}function dt(t){return t*(180/S)}function ct(i){if(p(i)){let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}}function ut(t,e){var i=e.x-t.x,e=e.y-t.y,t=Math.sqrt(i*i+e*e);let a=Math.atan2(e,i);return a<-.5*S&&(a+=v),{angle:a,distance:t}}function gt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ft(t,e){return(t-e+Q)%v-S}function x(t){return(t%v+v)%v}function pt(t,e,i,a){var t=x(t),e=x(e),i=x(i),s=x(e-t),r=x(i-t),n=x(t-e),o=x(t-i);return t===e||t===i||a&&e===i||r<s&&n<o}function C(t,e,i){return Math.max(e,Math.min(i,t))}function mt(t){return C(t,-32768,32767)}function d(t,e,i,a=1e-6){return t>=Math.min(e,i)-a&&t<=Math.max(e,i)+a}function bt(e,i,t){t=t||(t=>e[t]<i);let a,s=e.length-1,r=0;for(;1<s-r;)t(a=r+s>>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 e<s||e===s&&i[t+1][a]===s}:t=>i[t][a]<s),xt=(e,i,a)=>bt(e,a,t=>e[t][i]>=a);function vt(t,e,i){let a=0,s=t.length;for(;a<s&&t[a]<e;)a++;for(;s>a&&t[s-1]>i;)s--;return 0<a||s<t.length?t.slice(a,s):t}let _t=["push","pop","shift","splice","unshift"];function yt(s,t){s._chartjs?s._chartjs.listeners.push(t):(Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),_t.forEach(t=>{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<i.length||(_t.forEach(t=>{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 0<this._getAnims(t).items.length}start(t){t=this._charts.get(t);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((t,e)=>Math.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(1<e+i&&(e*=s=1/(e+i),i*=s),s=0;s<3;s++)a[s]*=1-e-i,a[s]+=e;return a}function Yt(t){var e=t.r/255,i=t.g/255,t=t.b/255,a=Math.max(e,i,t),s=Math.min(e,i,t),r=(a+s)/2;let n,o,l;return a!==s&&(l=a-s,o=.5<r?l/(2-a-s):l/(a+s),n=60*(n=(s=i,i=t,(t=e)===a?(s-i)/l+(s<i?6:0):s===a?(i-t)/l+2:(t-s)/l+4))+.5),[0|n,o||0,r]}function $t(t,e,i,a){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,a)).map(Rt)}function Ut(t,e,i){return $t(Nt,t,e,i)}function Xt(t){return(t%360+360)%360}let qt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Kt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"},Gt;let Zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Jt=t=>t<=.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<t.length)&&(e.a=Rt(t[3])):(e=ee(t,{r:0,g:0,b:0,a:1})).a=Rt(e.a),e}function ae(t){return("r"===t.charAt(0)?function(t){var e=Zt.exec(t);let i,a,s,r=255;if(e){if(void 0!==e[7]){let t=+e[7];r=e[8]?Et(t):Lt(255*t,0,255)}return i=+e[1],a=+e[3],s=+e[5],{r:255&(e[2]?Et(i):Lt(i,0,255)),g:255&(e[4]?Et(a):Lt(a,0,255)),b:255&(e[6]?Et(s):Lt(s,0,255)),a:r}}}:function(t){var e,i,a,t=Wt.exec(t);let s,r=255;if(t)return void 0!==t[5]&&(r=(t[6]?Et:Rt)(+t[5])),e=Xt(+t[2]),i=+t[3]/100,a=+t[4]/100,{r:(s="hwb"===t[1]?$t(jt,e,i,a):"hsv"===t[1]?$t(Ht,e,i,a):Ut(e,i,a))[0],g:s[1],b:s[2],a:r}})(t)}class se{constructor(t){if(t instanceof se)return t;var e,i,a=typeof t;let s;"object"==a?s=ie(t):"string"==a&&(i=(a=t).length,"#"===a[0]&&(4===i||5===i?e={r:255&17*l[a[1]],g:255&17*l[a[2]],b:255&17*l[a[3]],a:5===i?17*l[a[4]]:255}:7!==i&&9!==i||(e={r:l[a[1]]<<4|l[a[2]],g:l[a[3]]<<4|l[a[4]],b:l[a[5]]<<4|l[a[6]],a:9===i?l[a[7]]<<4|l[a[8]]:255})),s=e||(i=t,Gt||((Gt=function(){var t={},e=Object.keys(Kt),i=Object.keys(qt);let a,s,r,n,o;for(a=0;a<e.length;a++){for(n=o=e[a],s=0;s<i.length;s++)r=i[s],o=o.replace(r,qt[r]);r=parseInt(Kt[n],16),t[o]=[r>>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<i.length){let t=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(t<1e-4||1e15<t)&&(s="scientific"),r=function(t){let e=3<i.length?i[2].value-i[1].value:i[1].value-i[0].value;return e=1<=Math.abs(e)&&t!==Math.floor(t)?t-Math.floor(t):e}(e)}var n=o(Math.abs(r)),n=isNaN(n)?1:Math.max(Math.min(-1*Math.floor(n),20),0),n={notation:s,minimumFractionDigits:n,maximumFractionDigits:n};return Object.assign(n,this.options.ticks.format),ce(e,a,n)},logarithmic(t,e,i){var a;return 0===t?"0":(a=i[e].significand||t/Math.pow(10,Math.floor(o(t))),[1,2,3,5,10,15].includes(a)||e>.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;t<e;++t){var s=a[t];i=i[s]||(i[s]=Object.create(null))}}return i}function be(t,e,i){return"string"==typeof e?Y(me(t,e),i):Y(me(t,""),e)}var R=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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,!(0<s||0<i)||t&&t.shadowRoot){let t=e.getBoundingClientRect();n=a.clientX-t.left,o=a.clientY-t.top,l=!0}else n=s,o=r;return{x:n,y:o,box:l}}(t,i),h=n.left+(l&&s.left),l=n.top+(l&&s.top);let{width:d,height:c}=e;return r&&(d-=n.width+s.width,c-=n.height+s.height),{x:Math.round((t-h)/d*i.width/a),y:Math.round((o-l)/c*i.height/a)}}let Pe=t=>Math.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;l<o;l++)if(null==(c=i[l])||O(c)){if(O(c))for(h=0,d=c.length;h<d;h++)null==(u=c[h])||O(u)||(n=Le(t,s,r,n,u))}else n=Le(t,s,r,n,c);t.restore();var g=r.length/2;if(g>i.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return n}function Re(t,e,i){t=t.currentDevicePixelRatio,i=0!==i?Math.max(i/2,.5):0;return Math.round((e-i)*t)/t+i}function Ie(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ze(t,e,i,a){Fe(t,e,i,a,null)}function Fe(t,e,i,a,s){let r,n,o,l,h,d,c,u;var g=e.pointStyle,f=e.rotation,p=e.radius;let m=(f||0)*et;if(g&&"object"==typeof g&&("[object HTMLImageElement]"===(r=g.toString())||"[object HTMLCanvasElement]"===r))t.save(),t.translate(i,a),t.rotate(m),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();else if(!(isNaN(p)||p<=0)){switch(t.beginPath(),g){default:s?t.ellipse(i,a,s/2,p,0,0,v):t.arc(i,a,p,0,v),t.closePath();break;case"triangle":d=s?s/2:p,t.moveTo(i+Math.sin(m)*d,a-Math.cos(m)*p),m+=at,t.lineTo(i+Math.sin(m)*d,a-Math.cos(m)*p),m+=at,t.lineTo(i+Math.sin(m)*d,a-Math.cos(m)*p),t.closePath();break;case"rectRounded":h=.516*p,l=p-h,n=Math.cos(m+it)*l,c=Math.cos(m+it)*(s?s/2-h:l),o=Math.sin(m+it)*l,u=Math.sin(m+it)*(s?s/2-h:l),t.arc(i-c,a-o,h,m-S,m-D),t.arc(i+u,a-n,h,m-D,m),t.arc(i+c,a+o,h,m,m+D),t.arc(i-u,a+n,h,m+D,m+S),t.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*p,d=s?s/2:l,t.rect(i-d,a-l,2*d,2*l);break}m+=it;case"rectRot":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+u,a-n),t.lineTo(i+c,a+o),t.lineTo(i-u,a+n),t.closePath();break;case"crossRot":m+=it;case"cross":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n);break;case"star":c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n),m+=it,c=Math.cos(m)*(s?s/2:p),n=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(s?s/2:p),t.moveTo(i-c,a-o),t.lineTo(i+c,a+o),t.moveTo(i+u,a-n),t.lineTo(i-u,a+n);break;case"line":n=s?s/2:Math.cos(m)*p,o=Math.sin(m)*p,t.moveTo(i-n,a-o),t.lineTo(i+n,a+o);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(m)*(s?s/2:p),a+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),0<e.borderWidth&&t.stroke()}}function y(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Ve(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Be(t){t.restore()}function We(e,i,a,t,s){if(!i)return e.lineTo(a.x,a.y);if("middle"===s){let t=(i.x+a.x)/2;e.lineTo(t,i.y),e.lineTo(t,a.y)}else"after"===s!=!!t?e.lineTo(i.x,a.y):e.lineTo(a.x,i.y);e.lineTo(a.x,a.y)}function Ne(t,e,i,a){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(a?e.cp1x:e.cp2x,a?e.cp1y:e.cp2y,a?i.cp2x:i.cp1x,a?i.cp2y:i.cp1y,i.x,i.y)}function He(t,e,i,a,s,r={}){var n,o,l,h,d,c,u,g,f=O(e)?e:[e],p=0<r.strokeWidth&&""!==r.strokeColor;let m,b;for(t.save(),t.font=s.string,e=t,(g=r).translation&&e.translate(g.translation[0],g.translation[1]),P(g.rotation)||e.rotate(g.rotation),g.color&&(e.fillStyle=g.color),g.textAlign&&(e.textAlign=g.textAlign),g.textBaseline&&(e.textBaseline=g.textBaseline),m=0;m<f.length;++m)b=f[m],r.backdrop&&(d=t,c=r.backdrop,u=void 0,u=d.fillStyle,d.fillStyle=c.color,d.fillRect(c.left,c.top,c.width,c.height),d.fillStyle=u),p&&(r.strokeColor&&(t.strokeStyle=r.strokeColor),P(r.strokeWidth)||(t.lineWidth=r.strokeWidth),t.strokeText(b,i,a,r.maxWidth)),t.fillText(b,i,a,r.maxWidth),c=t,d=i,u=a,n=b,h=l=void 0,((o=r).strikethrough||o.underline)&&(l=d-(n=c.measureText(n)).actualBoundingBoxLeft,d=d+n.actualBoundingBoxRight,h=u-n.actualBoundingBoxAscent,u=u+n.actualBoundingBoxDescent,n=o.strikethrough?(h+u)/2:u,c.strokeStyle=c.fillStyle,c.beginPath(),c.lineWidth=o.decorationWidth||2,c.moveTo(l,n),c.lineTo(d,n),c.stroke()),a+=Number(s.lineHeight);t.restore()}function je(t,e){var{x:e,y:i,w:a,h:s,radius:r}=e;t.arc(e+r.topLeft,i+r.topLeft,r.topLeft,-D,S,!0),t.lineTo(e,i+s-r.bottomLeft),t.arc(e+r.bottomLeft,i+s-r.bottomLeft,r.bottomLeft,S,D,!0),t.lineTo(e+a-r.bottomRight,i+s),t.arc(e+a-r.bottomRight,i+s-r.bottomRight,r.bottomRight,D,0,!0),t.lineTo(e+a,i+r.topRight),t.arc(e+a-r.topRight,i+r.topRight,r.topRight,0,-D,!0),t.lineTo(e+r.topLeft,i)}function Ye(o,l=[""],t,e,s=()=>o[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;o<l;++o)d=e[h=o+i],n[o]={r:s.parse(f(d,r),h)};return n}let ai=Number.EPSILON||1e-14,si=(t,e)=>e<t.length&&!t[e].skip&&t[e],ri=t=>"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;++a)if(s=r,r=n,n=si(l,a+1),r){if(n){let t=n[e]-r[e];o[a]=0!=t?(n[i]-r[i])/t:0}h[a]=s?n?_(o[a-1])!==_(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}{var d=l,c=o,u=h,g=d.length;let e,i,a,s,r,n=si(d,0);for(let t=0;t<g-1;++t)r=n,n=si(d,t+1),r&&n&&(st(c[t],0,ai)?u[t]=u[t+1]=0:(e=u[t]/c[t],i=u[t+1]/c[t],(s=Math.pow(e,2)+Math.pow(i,2))<=9||(a=3/Math.sqrt(s),u[t]=e*a*c[t],u[t+1]=i*a*c[t])))}{var[f,p,m="x"]=[l,h,e];let a=ri(m),t=f.length,s,r,n,o=si(f,0);for(let i=0;i<t;++i)if(r=n,n=o,o=si(f,i+1),n){let t=n[m],e=n[a];r&&(s=(t-r[m])/3,n["cp1"+m]=t-s,n["cp1"+a]=e-s*p[i]),o&&(s=(o[m]-t)/3,n["cp2"+m]=t+s,n["cp2"+a]=e+s*p[i])}}}function li(t,e,i){return Math.max(Math.min(t,i),e)}function hi(n,e,o,i,t){let a,s,r,l;if(e.spanGaps&&(n=n.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)oi(n,t);else{let t=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)r=n[a],l=ni(t,r,n[Math.min(a+1,s-(i?0:1))%s],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,t=r}if(e.capBezierPoints){var h=n,d=o;let t,e,i,a,s,r=y(h[0],d);for(t=0,e=h.length;t<e;++t)s=a,a=r,r=t<e-1&&y(h[t+1],d),a&&(i=h[t],s&&(i.cp1x=li(i.cp1x,d.left,d.right),i.cp1y=li(i.cp1y,d.top,d.bottom)),r)&&(i.cp2x=li(i.cp2x,d.left,d.right),i.cp2y=li(i.cp2y,d.top,d.bottom))}}let di=t=>0===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<i?e:t).y}}function mi(t,e,i,a){var s={x:t.cp2x,y:t.cp2y},r={x:e.cp1x,y:e.cp1y},t=fi(t,s,i),s=fi(s,r,i),r=fi(r,e,i),e=fi(t,s,i),t=fi(s,r,i);return fi(e,t,i)}let bi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,xi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vi(t,e){var i=(""+t).match(bi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}let _i=t=>+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;s<r;++s)if(void 0!==(n=t[s])&&(void 0!==e&&"function"==typeof n&&(n=n(e),o=!1),void 0!==i&&O(n)&&(n=n[i%n.length],o=!1),void 0!==n))return a&&!o&&(a.cacheable=!1),n}function Si(t,e,i){var{min:t,max:a}=t,e=B(e,(a-t)/2),s=(t,e)=>i&&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;l<h&&r(n(e[d%o][i]),a,s);++l)d--,c--;d%=o,c%=o}return c<d&&(c+=o),{start:d,end:c,loop:u,style:t.style}}(t,i),p=[],m,b,x,v,_=null;for(let t=d,e=d;t<=c;++t)(b=i[t%n]).skip||(m=h(b[a]))!==x&&(v=l(m,s,r),null===(_=null===_&&(v||l(s,x,m)&&0!==o(s,x))?0===o(m,s)?t:e:_)||v&&0!==o(r,m)&&!l(r,x,m)||(p.push(Ti({start:_,end:t,loop:u,count:n,style:f})),_=null),e=t,x=m);return null!==_&&p.push(Ti({start:_,end:c,loop:u,count:n,style:f})),p}function Ei(e,i){var a=[],s=e.segments;for(let t=0;t<s.length;t++){var r=Li(s[t],e.points,i);r.length&&a.push(...r)}return a}function Ri(t,e){var i,a,s,r=t.points,n=t.options.spanGaps,o=r.length;return o?({start:a,end:s}=function(t,e,i){let a=0,s=e-1;if(i&&!n)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(s+=a);s>a&&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<a?s+o:s,!!t._fullLoop&&0===a&&s===o-1),r,e)):[]}function Ii(e,i,a,u){if(u&&u.setContext&&a){var g=e,e=i,f=a,p=u;let s=g._chart.getContext(),t=zi(g.options),{_datasetIndex:r,options:{spanGaps:n}}=g,o=f.length,l=[],h=t,d=e[0].start,c=d;function m(t,e,i,a){var s=n?-1:1;if(t!==e){for(t+=o;f[t%o].skip;)t-=s;for(;f[e%o].skip;)e+=s;t%o!=e%o&&(l.push({start:t%o,end:e%o,loop:i,style:a}),h=a,d=e%o)}}for(let a of e){d=n?d:a.start;let e,i=f[d%o];for(c=d+1;c<=a.end;c++){let t=f[c%o];(function(t,e){if(!e)return;function i(t,e){return re(e)?(a.includes(e)||a.push(e),a.indexOf(e)):e}let a=[];return JSON.stringify(t,i)!==JSON.stringify(e,i)})(e=zi(p.setContext(Pi(s,{type:"segment",p0:i,p1:t,p0DataIndex:(c-1)%o,p1DataIndex:c%o,datasetIndex:r}))),h)&&m(d,c-1,a.loop,h),i=t,h=e}d<c-1&&m(d,c-1,a.loop,h)}return l}return i}function zi(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}var Fi=Object.freeze({__proto__:null,HALF_PI:D,INFINITY:tt,PI:S,PITAU:Q,QUARTER_PI:it,RAD_PER_DEG:et,TAU:v,TWO_THIRDS_PI:at,_addGrace:Si,_alignPixel:Re,_alignStartEnd:E,_angleBetween:pt,_angleDiff:ft,_arrayUnique:wt,_attachContext:$e,_bezierCurveTo:Ne,_bezierInterpolation:mi,_boundSegment:Li,_boundSegments:Ei,_capitalize:K,_computeSegments:Ri,_createResolver:Ye,_decimalPlaces:ct,_deprecated:function(t,e,i,a){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+a+'" instead')},_descriptors:Ue,_elementsEqual:W,_factorize:nt,_filterBetween:vt,_getParentNode:ve,_getStartAndCountOfVisiblePoints:Ot,_int16Range:mt,_isBetween:d,_isClickEvent:J,_isDomSupported:xe,_isPointInArea:y,_limitValue:C,_longestText:Ee,_lookup:bt,_lookupByKey:m,_measureText:Le,_merger:j,_mergerIf:U,_normalizeAngle:x,_parseObjectDataRadialScale:ii,_pointInLine:fi,_readValueToProps:yi,_rlookupByKey:xt,_scaleRangesChanged:At,_setMinAndMaxByKey:ht,_splitKey:q,_steppedInterpolation:pi,_steppedLineTo:We,_textX:Ct,_toLeftRightCenter:Dt,_updateBezierControlPoints:hi,addRoundedRectPath:je,almostEquals:st,almostWhole:lt,callback:c,clearCanvas:Ie,clipArea:Ve,clone:N,color:ne,createContext:Pi,debounce:Pt,defined:G,distanceBetweenPoints:gt,drawPoint:ze,drawPointLegend:Fe,each:k,easingEffects:gi,finiteOrDefault:u,fontString:function(t,e,i){return e+" "+t+"px "+i},formatNumber:ce,getAngleFromPoint:ut,getHoverColor:oe,getMaximumSize:De,getRelativePosition:Se,getRtlAdapter:Di,getStyle:Me,isArray:O,isFinite:p,isFunction:g,isNullOrUndef:P,isNumber:ot,isObject:A,isPatternOrGradient:re,listenArrayEvents:yt,log10:o,merge:Y,mergeIf:$,niceNum:rt,noop:t,overrideTextDirection:Ci,readUsedSize:Ae,renderText:He,requestAnimFrame:kt,resolve:ki,resolveObjectKey:f,restoreTextDirection:Oi,retinaScale:Ce,setsEqual:Z,sign:_,splineCurve:ni,splineCurveMonotone:oi,supportsEventListenerOptions:Oe,throttled:St,toDegrees:dt,toDimension:B,toFont:z,toFontString:Te,toLineHeight:vi,toPadding:I,toPercentage:V,toRadians:L,toTRBL:Mi,toTRBLCorners:wi,uid:F,unclipArea:Be,unlistenArrayEvents:Mt,valueOrDefault:T});function Vi(t,r,e,n,o){var l=t.getSortedVisibleDatasetMetas(),h=e[r];for(let e=0,t=l.length;e<t;++e){let{index:i,data:a}=l[e],{lo:t,hi:s}=function(t,s,r,e){let{controller:i,data:n,_sorted:a}=t,o=i._cachedMeta.iScale;if(o&&s===o.axis&&"r"!==s&&a&&n.length){let a=o._reversePixels?xt:m;if(!e)return a(n,s,r);if(i._sharedOptions){let t=n[0],i="function"==typeof t.getRange&&t.getRange(s);if(i){let t=a(n,s,r-i),e=a(n,s,r+i);return{lo:t.lo,hi:e.hi}}}}return{lo:0,hi:n.length-1}}(l[e],r,h,o);for(let e=t;e<=s;++e){let t=a[e];t.skip||n(t,i,e)}}}function Bi(a,s,t,r,n){let o=[];return(n||a.isPointInArea(s))&&Vi(a,t,s,function(t,e,i){(n||y(t,a.chartArea,0))&&t.inRange(s.x,s.y,r)&&o.push({element:t,datasetIndex:e,index:i})},!0),o}function Wi(t,e,i,a,s,l){{if(l||t.isPointInArea(e)){if("r"!==i||a){var h=t,d=e,c=i,u=a,g=s,f=l;let r=[],n=function(t){let a=-1!==t.indexOf("x"),s=-1!==t.indexOf("y");return function(t,e){var i=a?Math.abs(t.x-e.x):0,t=s?Math.abs(t.y-e.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(t,2))}}(c),o=Number.POSITIVE_INFINITY;return Vi(h,c,d,function(t,e,i){var a,s=t.inRange(d.x,d.y,g);(!u||s)&&(a=t.getCenterPoint(g),f||h.isPointInArea(a)||s)&&((s=n(d,a))<o?(r=[{element:t,datasetIndex:e,index:i}],o=s):s===o&&r.push({element:t,datasetIndex:e,index:i}))}),r}{var o=e,p=s;let n=[];return Vi(t,i,o,function(t,e,i){var{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],p),r=ut(t,{x:o.x,y:o.y})["angle"];pt(r,a,s)&&n.push({element:t,datasetIndex:e,index:i})}),n}}return[]}}function Ni(t,a,s,e,r){let n=[],o="x"===s?"inXRange":"inYRange",l=!1;return Vi(t,s,a,(t,e,i)=>{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(0<n.length){let e=n[0].datasetIndex,i=t.getDatasetMeta(e).data;n=[];for(let t=0;t<i.length;++t)n.push({element:i[t],datasetIndex:e,index:t})}return n},point:(t,e,i,a)=>Bi(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<t;++o){l=i[o],(h=l.box).update(l.width||a.w,l.height||a.h,function(t,i){let a=i.maxPadding;{let e={left:0,top:0,right:0,bottom:0};return(t=t?["left","right"]:["top","bottom"]).forEach(t=>{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;i<a;++i)({position:r,options:{stack:n,stackWeight:o=1}}=s=t[i]),e.push({index:i,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:n&&r+n,stackWeight:o});return e}(i.boxes),c=Ui(u.filter(t=>t.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;++l){let t=(h=a[l]).box["fullSize"],e=r[h.stack],i=e&&h.stackWeight/e.weight;h.horizontal?(h.width=i?i*n:t&&s.availableWidth,h.height=o):(h.width=n,h.height=i?i*o:t&&s.availableHeight)}return r}(u.concat(g),p);Ki(c.fullSize,e,p,t),Ki(u,e,p,t),Ki(g,e,p,t)&&Ki(u,e,p,t);{var b=e;let i=b.maxPadding;function x(t){var e=Math.max(i[t]-b[t],0);return b[t]+=e,e}b.y+=x("top"),b.x+=x("left"),x("right"),x("bottom")}Zi(c.leftAndTop,e,p,t),e.x+=e.w,e.y+=e.h,Zi(c.rightAndBottom,e,p,t),i.chartArea={left:e.left,top:e.top,right:e.left+e.w,bottom:e.top+e.h,height:e.h,width:e.w},k(c.chartArea,t=>{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<s.clientWidth&&a()},window),t=new ResizeObserver(t=>{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)=>.5<i?e:t,color(t,e,i){var t=ne(t||ma),a=t.valid&&ne(e||ma);return a&&a.valid?a.mix(t,i).hexString():e},number:(t,e,i)=>t+(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<e),this._active?t<0?this._target[i]=a:(t=t/e%2,t=this._easing(Math.min(1,Math.max(0,s&&1<t?2-t:t))),this._target[i]=this._fn(a,r,t)):(this._target[i]=r,this._notify(!0))}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,e)=>{i.push({res:t,rej:e})})}_notify(t){var e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class va{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(A(t)){let s=Object.keys(R.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{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<a.length;t++){var s=e[a[t]];s&&s.active()&&i.push(s.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{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;s<r;++s)i.push(a[s].index);return i}function Ma(t,e,i,a={}){var s=t.keys,r="single"===a.mode;let n,o,l,h;if(null!==e){for(n=0,o=s.length;n<o;++n){if((l=+s[n])===i){if(a.all)continue;break}p(h=t.values[l])&&(r||0===e||_(e)===_(h))&&(e+=h)}return e}}function wa(t,e){t=t&&t.options.stacked;return t||void 0===t&&void 0!==e.stack}function ka(e,t,i,a){for(var s of t.getMatchingVisibleMetas(a).reverse()){let t=e[s.index];if(i&&0<t||!i&&t<0)return s.index}return null}function Sa(t,s){let{chart:e,_cachedMeta:r}=t,n=e._stacks||(e._stacks={}),{iScale:i,vScale:o,index:l}=r,h=i.axis,d=o.axis,c=`${i.id}.${o.id}.`+(r.stack||r.type),u=s.length;var g,f,p;for(let a=0;a<u;++a){let t=s[a],{[h]:e,[d]:i}=t;(f=(t._stacks||(t._stacks={}))[d]=(p=e,(g=(g=n)[f=c]||(g[f]={}))[p]||(g[p]={})))[l]=i,f._top=ka(f,o,!0,r.type),f._bottom=ka(f,o,!1,r.type),(f._visualValues||(f._visualValues={}))[l]=i}}function Pa(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[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;a<s;++a)r=e[a],i[a]={x:r,y:t[r]};return i}(e);else if(i!==e){if(i){Mt(i,this);let t=this._cachedMeta;Da(t),t._parsed=[]}e&&Object.isExtensible(e)&&yt(e,this),this._syncList=[],this._data=e}}addElements(){var t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){var e=this._cachedMeta,i=this.getDataset();let a=!1;this._dataCheck();var s=e._stacked;e._stacked=wa(e.vScale,e),e.stack!==i.stack&&(a=!0,Da(e),e.stack=i.stack),this._resyncElements(t),!a&&s===e._stacked||Sa(this,e._parsed)}configure(){var t=this.chart.config,e=t.datasetScopeKeys(this._type),e=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(e,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,i){let{_cachedMeta:a,_data:s}=this,{iScale:t,_stacked:r}=a,n=t.axis,o,l,h,d=0===e&&i===s.length||a._sorted,c=0<e&&a._parsed[e-1];if(!1===this._parsing)a._parsed=s,a._sorted=!0,h=s;else{h=O(s[e])?this.parseArrayData(a,s,e,i):A(s[e])?this.parseObjectData(a,s,e,i):this.parsePrimitiveData(a,s,e,i);let t=()=>null===l[n]||c&&l[n]<c[n];for(o=0;o<i;++o)a._parsed[o+e]=l=h[o],d&&(t()&&(d=!1),c=l);a._sorted=d}r&&Sa(this,h)}parsePrimitiveData(t,e,i,a){var{iScale:s,vScale:r}=t,n=s.axis,o=r.axis,l=s.getLabels(),h=s===r,d=new Array(a);let c,u,g;for(c=0,u=a;c<u;++c)g=c+i,d[c]={[n]:h||s.parse(l[g],g),[o]:r.parse(e[g],g)};return d}parseArrayData(t,e,i,a){var{xScale:s,yScale:r}=t,n=new Array(a);let o,l,h,d;for(o=0,l=a;o<l;++o)d=e[h=o+i],n[o]={x:s.parse(d[0],h),y:r.parse(d[1],h)};return n}parseObjectData(t,e,i,a){var{xScale:s,yScale:r}=t,{xAxisKey:n="x",yAxisKey:o="y"}=this._parsing,l=new Array(a);let h,d,c,u;for(h=0,d=a;h<d;++h)u=e[c=h+i],l[h]={x:s.parse(f(u,n),c),y:r.parse(f(u,o),c)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){var a=this.chart,s=this._cachedMeta,r=e[t.axis];return Ma({keys:ya(a,!0),values:e._stacks[t.axis]._visualValues},r,s.index,{mode:i})}updateRangeFromParsed(t,e,i,a){var s=i[e.axis];let r=null===s?NaN:s;i=a&&i._stacks[e.axis];a&&i&&(a.values=i,r=Ma(a,s,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(e,t){let i=this._cachedMeta,a=i._parsed,s=i._sorted&&e===i.iScale,r=a.length,n=this._getOtherScale(e),o=(c=this.chart,t&&!i.hidden&&i._stacked&&{keys:ya(c,!0),values:null}),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=function(){var{min:t,max:e,minDefined:i,maxDefined:a}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:a?e:Number.POSITIVE_INFINITY}}();var c;let u,g;function f(){var t=(g=a[u])[n.axis];return!p(g[e.axis])||h>t||d<t}for(u=0;u<r&&(f()||(this.updateRangeFromParsed(l,e,g,o),!s));++u);if(s)for(u=r-1;0<=u;--u)if(!f()){this.updateRangeFromParsed(l,e,g,o);break}return l}getAllParsedValues(t){var e=this._cachedMeta._parsed,i=[];let a,s,r;for(a=0,s=e.length;a<s;++a)p(r=e[a][t.axis])&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){var e=this._cachedMeta,i=e.iScale,e=e.vScale,t=this.getParsed(t);return{label:i?""+i.getLabelForValue(t[i.axis]):"",value:e?""+e.getLabelForValue(t[e.axis]):""}}_update(t){var e,i=this._cachedMeta;this.update(t||"default"),i._clip=function(t){let e,i,a,s;return A(t)?(e=t.top,i=t.right,a=t.bottom,s=t.left):e=i=a=s=t,{top:e,right:i,bottom:a,left:s,disabled:!1===t}}(T(this.options.clip,(t=i.xScale,i=i.yScale,!1!==(e=this.getMaxOverflow())&&(t=_a(t,e),{top:(i=_a(i,e)).end,right:t.end,bottom:i.start,left:t.start}))))}update(t){}draw(){let e=this._ctx,t=this.chart,i=this._cachedMeta,a=i.data||[],s=t.chartArea,r=[],n=this._drawStart||0,o=this._drawCount||a.length-n,l=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(e,s,n,o),h=n;h<n+o;++h){let t=a[h];t.hidden||(t.active&&l?r.push(t):t.draw(e,s))}for(h=0;h<r.length;++h)r[h].draw(e,s)}getStyle(t,e){e=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(e):this.resolveDataElementOptions(t||0,e)}getContext(e,t,i){var a,s=this.getDataset();let r;if(0<=e&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];(r=t.$context||(t.$context=Pi(this.getContext(),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"}))).parsed=this.getParsed(e),r.raw=s.data[e],r.index=r.dataIndex=e}else(r=this.$context||(this.$context=(e=this.chart.getContext(),a=this.index,Pi(e,{active:!1,dataset:void 0,datasetIndex:a,index:a,mode:"default",type:"dataset"})))).dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let a="active"===e,s=this._cachedDataOpts,r=t+"-"+e,n=s[r],o=this.enableOptionSharing&&G(i);var l,h,d;return n?Oa(n,o):(h=(d=this.chart.config).datasetElementScopeKeys(this._type,t),l=a?[t+"Hover","hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),h),t=Object.keys(R.elements[t]),(d=d.resolveNamedOptions(h,t,()=>this.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<s?this._insertElements(a,s-a,t):s<a&&this._removeElements(s,a-s)}_insertElements(t,e,i=!0){let a=this._cachedMeta,s=a.data,r=t+e,n;var o=t=>{for(t.length+=e,n=t.length-1;n>=r;n--)t[n]=t[n-e]};for(o(s),n=t;n<r;++n)s[n]=new this.dataElementType;this._parsing&&o(a._parsed),this.parse(t,e),i&&this.updateElements(s,t,e,"reset")}updateElements(t,e,i,a){}_removeElements(t,e){var i,a=this._cachedMeta;this._parsing&&(i=a._parsed.splice(t,e),a._stacked)&&Da(a,i),a.data.splice(t,e)}_sync(t){var e,i,a;this._parsing?this._syncList.push(t):([e,i,a]=t,this[e](i,a)),this.chart._dataChanges.push([this.index,...t])}_onDataPush(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);e=arguments.length-2;e&&this._sync(["_insertElements",t,e])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class e{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}hasValue(){return ot(this.x)&&ot(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let a={};return t.forEach(t=>{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<n;l++)l===h&&(e.push(t[l]),d++,h=Math.round(r+d*i))}let La=(t,e,i)=>"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(;r<s;r+=a)i.push(t[Math.floor(r)]);return i}function Ia(t){return t.drawTicks?t.tickLength:0}function za(t,e){var i;return t.display?(e=z(t.font,e),i=I(t.padding),(O(t.text)?t.text.length:1)*e.lineHeight+i.height):0}class Fa extends e{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,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._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){var{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:a}=this,t=u(t,Number.POSITIVE_INFINITY),e=u(e,Number.NEGATIVE_INFINITY),i=u(i,Number.POSITIVE_INFINITY),a=u(a,Number.NEGATIVE_INFINITY);return{min:u(t,i),max:u(e,a),minDefined:p(t),maxDefined:p(e)}}getMinMax(i){let a,{min:s,max:r,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:s,max:r};var l=this.getMatchingVisibleMetas();for(let t=0,e=l.length;t<e;++t)a=l[t].controller.getMinMax(this,i),n||(s=Math.min(s,a.min)),o||(r=Math.max(r,a.max));return s=o&&s>r?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(),n<this.ticks.length);this._convertTicksToLabels(t?Ra(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||"auto"===r.source)&&(this.ticks=function(t,a){let e=t.options.ticks,i=(d=(t=t).options.offset,c=t._tickSize(),d=t._length/c+(d?0:1),t=t._maxLength/c,Math.floor(Math.min(d,t))),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?function(t){var e=[];let i,a;for(i=0,a=t.length;i<a;i++)t[i].major&&e.push(i);return e}(a):[],n=r.length,o=r[0],l=r[n-1],h=[];var d,c;if(s<n){var u=a;var g=h;var f=r;var p=n/s;let t,e=0,i=f[0];for(p=Math.ceil(p),t=0;t<u.length;t++)t===i&&(g.push(u[t]),e++,i=f[e*p])}else{var m=function(t,e,i){var t=function(t){var e=t.length;let i,a;if(e<2)return!1;for(a=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==a)return!1;return a}(t),a=e.length/i;if(t){var s=nt(t);for(let e=0,t=s.length-1;e<t;e++){let t=s[e];if(t>a)return t}}return Math.max(a,1)}(r,a,s);if(0<n){let t,e,i=1<n?Math.round((l-o)/(n-1)):null;for(Ta(a,h,m,P(i)?0:o-i,o),t=0,e=n-1;t<e;t++)Ta(a,h,m,r[t],r[t+1]);Ta(a,h,m,l,P(i)?a.length:l+i)}else Ta(a,h,m)}return h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),t&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){c(this.options.afterUpdate,[this])}beforeSetDimensions(){c(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){c(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),c(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){c(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){var e=this.options.ticks;let i,a,s;for(i=0,a=t.length;i<a;i++)(s=t[i]).label=c(e.callback,[s.value,i,t],this)}afterTickToLabelConversion(){c(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){c(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){var t,e,i,a,s=this.options,r=s.ticks,n=Ea(this.ticks.length,s.ticks.maxTicksLimit),o=r.minRotation||0,l=r.maxRotation;let h,d,c,u=o;!this._isVisible()||!r.display||l<=o||n<=1||!this.isHorizontal()?this.labelRotation=o:(e=(t=this._getLabelSizes()).widest.width,i=t.highest.height,a=C(this.chart.width-e,0,this.maxWidth),(s.offset?this.maxWidth/n:a/(n-1))<e+6&&(h=a/(n-(s.offset?.5:1)),d=this.maxHeight-Ia(s.grid)-r.padding-za(s.title,this.chart.options.font),c=Math.sqrt(e*e+i*i),u=dt(Math.min(Math.asin(C((t.highest.height+6)/h,-1,1)),Math.asin(C(d/c,-1,1))-Math.asin(C(i/c,-1,1)))),u=Math.max(o,Math.min(l,u))),this.labelRotation=u)}afterCalculateLabelRotation(){c(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){c(this.options.beforeFit,[this])}fit(){let l={width:0,height:0},{chart:e,options:{ticks:h,title:i,grid:a}}=this,t=this._isVisible(),d=this.isHorizontal();if(t){let t=za(i,e.options.font);if(d?(l.width=this.maxWidth,l.height=Ia(a)+t):(l.height=this.maxHeight,l.width=Ia(a)+t),h.display&&this.ticks.length){let{first:t,last:e,widest:i,highest:a}=this._getLabelSizes(),s=2*h.padding,r=L(this.labelRotation),n=Math.cos(r),o=Math.sin(r);if(d){let t=h.mirror?0:o*i.width+n*a.height;l.height=Math.min(this.maxHeight,l.height+t+s)}else{let t=h.mirror?0:n*i.width+o*a.height;l.width=Math.min(this.maxWidth,l.width+t+s)}this._calculatePadding(t,e,o,n)}}this._handleMargins(),d?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=l.height):(this.width=l.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(s,r,n,o){let{ticks:{align:l,padding:h},position:t}=this.options,d=0!==this.labelRotation,c="top"!==t&&"x"===this.axis;if(this.isHorizontal()){let t=this.getPixelForTick(0)-this.left,e=this.right-this.getPixelForTick(this.ticks.length-1),i=0,a=0;d?a=c?(i=o*s.width,n*r.height):(i=n*s.height,o*r.width):"start"===l?a=r.width:"end"===l?i=s.width:"inner"!==l&&(i=s.width/2,a=r.width/2),this.paddingLeft=Math.max((i-t+h)*this.width/(this.width-t),0),this.paddingRight=Math.max((a-e+h)*this.width/(this.width-e),0)}else{let t=r.height/2,e=s.height/2;"start"===l?(t=0,e=s.height):"end"===l&&(t=r.height,e=0),this.paddingTop=t+h,this.paddingBottom=e+h}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){c(this.options.afterFit,[this])}isHorizontal(){var{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)P(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){var i=this.options.ticks.sampleSize;let t=this.ticks;i<t.length&&(t=Ra(t,i)),this._labelSizes=e=this._computeLabelSizes(t,t.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(t,e,i){let{ctx:a,_longestTextCache:s}=this,r=[],n=[],o=Math.floor(e/Ea(e,i)),l,h,d,c,u,g,f,p,m,b,x,v=0,_=0;for(l=0;l<e;l+=o){if(c=t[l].label,u=this._resolveTickFontOptions(l),a.font=g=u.string,f=s[g]=s[g]||{data:{},gc:[]},p=u.lineHeight,m=b=0,P(c)||O(c)){if(O(c))for(h=0,d=c.length;h<d;++h)P(x=c[h])||O(x)||(m=Le(a,f.data,f.gc,m,x),b+=p)}else m=Le(a,f.data,f.gc,m,c),b=p;r.push(m),n.push(b),v=Math.max(m,v),_=Math.max(b,_)}y=e,k(s,t=>{var e=t.gc,i=e.length/2;let a;if(y<i){for(a=0;a<i;++a)delete t.data[e[a]];e.splice(0,i)}});var y,i=r.indexOf(v),M=n.indexOf(_),w=t=>({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:0<t&&0<e?t:0}getContext(t){var e=this.ticks||[];return 0<=t&&t<e.length?(e=e[t]).$context||(e.$context=Pi(this.getContext(),{tick:e,index:t,type:"tick"})):this.$context||(this.$context=Pi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){var t=this.options.ticks,e=L(this.labelRotation),i=Math.abs(Math.cos(e)),e=Math.abs(Math.sin(e)),a=this._getLabelSizes(),t=t.autoSkipPadding||0,s=a?a.widest.width+t:0,a=a?a.highest.height+t:0;return this.isHorizontal()?s*e<a*i?s/i:a/e:a*e<s*i?a/i:s/e}_isVisible(){var t=this.options.display;return"auto"!==t?!!t:0<this.getMatchingVisibleMetas().length}_computeGridLineItems(t){function i(t){return Re(c,t,l)}let e=this.axis,c=this.chart,a=this.options,{grid:u,position:s,border:g}=a,f=u.offset,p=this.isHorizontal(),r=this.ticks.length+(f?1:0),n=Ia(u),m=[],o=g.setContext(this.getContext()),l=o.display?o.width:0,h=l/2,d,b,x,v,_,y,M,w,k,S,P,D;if("top"===s)d=i(this.bottom),y=this.bottom-n,w=d-h,S=i(t.top)+h,D=t.bottom;else if("bottom"===s)d=i(this.top),S=t.top,D=i(t.bottom)-h,y=d+h,w=this.top+n;else if("left"===s)d=i(this.right),_=this.right-n,M=d-h,k=i(t.left)+h,P=t.right;else if("right"===s)d=i(this.left),k=t.left,P=i(t.right)-h,_=d+h,M=this.left+n;else if("x"===e){if("center"===s)d=i((t.top+t.bottom)/2+.5);else if(A(s)){let t=Object.keys(s)[0],e=s[t];d=i(this.chart.scales[t].getPixelForValue(e))}S=t.top,D=t.bottom,y=d+h,w=y+n}else if("y"===e){if("center"===s)d=i((t.left+t.right)/2);else if(A(s)){let t=Object.keys(s)[0],e=s[t];d=i(this.chart.scales[t].getPixelForValue(e))}_=d-h,M=_-n,k=t.left,P=t.right}var t=T(a.ticks.maxTicksLimit,r),C=Math.max(1,Math.ceil(r/t));for(b=0;b<r;b+=C){let t=this.getContext(b),e=u.setContext(t),i=g.setContext(t),a=e.lineWidth,s=e.color,r=i.dash||[],n=i.dashOffset,o=e.tickWidth,l=e.tickColor,h=e.tickBorderDash||[],d=e.tickBorderDashOffset;void 0!==(x=function(t,e,i){var a=t.ticks.length,s=Math.min(e,a-1),r=t._startPixel,n=t._endPixel;let o,l=t.getPixelForTick(s);if(!(i&&(o=1===a?Math.max(l-r,n-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(s-1))/2,(l+=s<e?o:-o)<r-1e-6||l>n+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;m<b;++m){x=d[m].label;let r=l.setContext(this.getContext(m)),t=(M=this.getPixelForTick(m)+l.labelOffset,k=(w=this._resolveTickFontOptions(m)).lineHeight,(S=O(x)?x.length:1)/2),e=r.color,i=r.textStrokeColor,a=r.textStrokeWidth,n,s=y;if(h?(v=M,"inner"===y&&(s=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),P="top"===o?"near"===c||0!=f?-S*k+k/2:"center"===c?-C.highest.height/2-t*k+k:-C.highest.height+k/2:"near"===c||0!=f?k/2:"center"===c?C.highest.height/2-t*k:C.highest.height-S*k,u&&(P*=-1),0==f||r.showLabelBackdrop||(v+=k/2*Math.sin(f))):(_=M,P=(1-S)*k/2),r.showLabelBackdrop){let t=I(r.backdropPadding),e=C.heights[m],i=C.widths[m],a=P-t.top,s=0-t.left;switch(D){case"middle":a-=e/2;break;case"bottom":a-=e}switch(y){case"center":s-=i/2;break;case"right":s-=i}n={left:s,top:a,width:i+t.width,height:e+t.height,color:r.backdropColor}}p.push({label:x,font:w,textOffset:P,options:{rotation:f,color:e,strokeColor:i,strokeWidth:a,textAlign:s,textBaseline:D,translation:[v,_],backdrop:n}})}return p}_getXAxisLabelAlignment(){var{position:t,ticks:e}=this.options;if(-L(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){var{position:e,ticks:{crossAlign:i,mirror:a,padding:s}}=this.options,t=t+s,r=this._getLabelSizes().widest.width;let n,o;return"left"===e?a?(o=this.right+s,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o+=r)):(o=this.right-t,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o=this.left)):"right"===e?a?(o=this.left+s,"near"===i?n="right":"center"===i?(n="center",o-=r/2):(n="left",o-=r)):(o=this.left+t,"near"===i?n="left":"center"===i?(n="center",o+=r/2):(n="right",o=this.right)):n="right",{textAlign:n,x:o}}_computeLabelArea(){var t,e;if(!this.options.ticks.mirror)return t=this.chart,"left"===(e=this.options.position)||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){var{ctx:t,options:{backgroundColor:e},left:i,top:a,width:s,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,a,s,r),t.restore())}getLineWidthForValue(e){var t,i=this.options.grid;return this._isVisible()&&i.display&&0<=(t=this.ticks.findIndex(t=>t.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<r;++s){let t=i[s];e.drawOnChartArea&&n({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&n({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){var{chart:s,ctx:r,options:{border:n,grid:o}}=this,l=n.setContext(this.getContext()),n=n.display?l.width:0;if(n){var o=o.setContext(this.getContext(0)).lineWidth,h=this._borderValue;let t,e,i,a;this.isHorizontal()?(t=Re(s,this.left,n)-n/2,e=Re(s,this.right,o)+o/2,i=a=h):(i=Re(s,this.top,n)-n/2,a=Re(s,this.bottom,o)+o/2,t=e=h),r.save(),r.lineWidth=l.width,r.strokeStyle=l.color,r.beginPath(),r.moveTo(t,i),r.lineTo(e,a),r.stroke(),r.restore()}}drawLabels(i){if(this.options.ticks.display){let a=this.ctx,t=this._computeLabelArea(),e=(t&&Ve(a,t),this.getLabelItems(i));for(let i of e){let t=i.options,e=i.font;He(a,i.label,0,i.textOffset,e,t)}t&&Be(a)}}drawTitle(){var{ctx:e,options:{position:i,title:a,reverse:s}}=this;if(a.display){var r=z(a.font),n=I(a.padding),o=a.align;let t=r.lineHeight/2;"bottom"===i||"center"===i||A(i)?(t+=n.bottom,O(a.text)&&(t+=r.lineHeight*(a.text.length-1))):t+=n.top;var{titleX:n,titleY:l,maxWidth:h,rotation:d}=function(t,i,a,e){var{top:s,left:r,bottom:n,right:o,chart:l}=t,{chartArea:l,scales:h}=l;let d,c,u,g=0;var f=n-s,p=o-r;if(t.isHorizontal()){if(c=E(e,r,o),A(a)){let t=Object.keys(a)[0],e=a[t];u=h[t].getPixelForValue(e)+f-i}else u="center"===a?(l.bottom+l.top)/2+f-i:La(t,a,i);d=o-r}else{if(A(a)){let t=Object.keys(a)[0],e=a[t];c=h[t].getPixelForValue(e)-p+i}else c="center"===a?(l.left+l.right)/2-p+i:La(t,a,i);u=E(e,n,s),g="left"===a?-D:D}return{titleX:c,titleY:u,maxWidth:d,rotation:g}}(this,t,i,o);He(e,a.text,0,0,r,{color:a.color,maxWidth:h,rotation:d,textAlign:function(t,e,i){let a=Dt(t);return a=i&&"right"!==e||!i&&"right"===e?"left"===(t=a)?"right":"right"===t?"left":t:a}(o,i,s),textBaseline:"middle",translation:[n,l]})}}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){var t=this.options,e=t.ticks&&t.ticks.z||0,i=T(t.grid&&t.grid.z,-1),t=T(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Fa.prototype.draw?[{z:i,draw:t=>{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<t;++r){let t=i[r];t[a]!==this.id||e&&t.type!==e||s.push(t)}return s}_resolveTickFontOptions(t){return z(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Va{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){var e=Object.getPrototypeOf(t);let i;"id"in(n=e)&&"defaults"in n&&(i=this.register(e));var a,s,r,n=this.items,e=t.id,o=this.scope+"."+e;if(e)return e in n||(n[e]=t,n=t,e=o,a=i,a=Y(Object.create(null),[a?R.get(a):{},R.get(e),n.defaults]),R.set(e,a),n.defaultRoutes&&(s=e,r=n.defaultRoutes,Object.keys(r).forEach(t=>{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;t<this._typedRegistries.length;t++){var i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(t,e,i){e=e.get(t);if(void 0===e)throw new Error('"'+t+'" is not a registered '+i+".");return e}};class Ba{constructor(){this._init=[]}notify(t,e,i,a){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));a=a?this._descriptors(t).filter(a):this._descriptors(t),i=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),i}_notify(t,e,i,a){a=a||{};for(var s of t){let t=s.plugin;if(!1===c(t[i],[e,a,s.options],t)&&a.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){var e;return this._cache||(e=this._cache=this._createDescriptors(t),this._notifyStateChanges(t),e)}_createDescriptors(t,e){var i=t&&t.config,a=T(i.options&&i.options.plugins,{}),i=function(t){let i={},a=[],e=Object.keys(M.plugins.items);for(let t=0;t<e.length;t++)a.push(M.getPlugin(e[t]));var s=t.plugins||[];for(let e=0;e<s.length;e++){let t=s[e];-1===a.indexOf(t)&&(a.push(t),i[t.id]=!0)}return{plugins:a,localIds:i}}(i);if(!1!==a||e){var s,r,n,o,l,h,d,[c,{plugins:u,localIds:g},f,p]=[t,i,a,e],m=[],b=c.getContext();for(s of u){let t=s.id,e=(d=f[t],p||!1!==d?!0===d?{}:d:null);null!==e&&m.push({plugin:s,options:([d,{plugin:r,local:n},o,l]=[c.config,{plugin:s,local:g[t]},e,b],h=void 0,h=d.pluginScopeKeys(r),o=d.getOptionScopes(o,h),n&&r.defaults&&o.push(r.defaults),d.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0}))})}return m}return[]}_notifyStateChanges(t){var e=this._oldCache||[],i=this._cache,a=(t,i)=>t.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<e.length&&Na(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ja(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Ya(t){var e=t.options||(t.options={});e.plugins=T(e.plugins,{}),e.scales=function(n,e){let r=fe[n.type]||{scales:{}},o=e.scales||{},l=Wa(n.type,e),h=Object.create(null);return Object.keys(o).forEach(t=>{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),e<i){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(es("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.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<t;r++){let t=e[r],a=this.getDatasetMeta(r);var n=t.type||this.config.type;if(a.type&&a.type!==n&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=n,a.indexAxis=t.indexAxis||Wa(n,this.options),a.order=t.order||0,a.index=r,a.label=""+t.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{let t=M.getController(n),{datasetElementType:e,dataElementType:i}=R.datasets[n];Object.assign(t,{dataElementType:M.getElement(i),datasetElementType:e&&M.getElement(e)}),a.controller=new t(this,r),s.push(a.controller)}}return this._updateMetasets(),s}_resetElements(){k(this.data.datasets,(t,e)=>{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;i++){let t=this.getDatasetMeta(i)["controller"],e=!s&&-1===r.indexOf(t);t.buildOrUpdateElements(e),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||k(r,t=>{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],0<l||t>o)&&(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;t<e;t++)if(!Z(a,i(t)))return;return Array.from(a).map(t=>t.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;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,e=this.data.datasets.length;t<e;++t)this._updateDataset(t,g(i)?i({datasetIndex:t}):i);this.notifyPlugins("afterDatasetsUpdate",{mode:i})}}_updateDataset(t,e){var i=this.getDatasetMeta(t),t={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",t)&&(i.controller._update(e),t.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",t))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(r.has(this)?this.attached&&!r.running(this)&&r.start(this):(this.draw(),is({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),!(this.width<=0||this.height<=0)&&!1!==this.notifyPlugins("beforeDraw",{cancelable:!0})){let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}}_getSortedDatasetMetas(e){var i=this._sortedMetasets,a=[];let s,t;for(s=0,t=i.length;s<t;++s){let t=i[s];e&&!t.visible||a.push(t)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){var e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;0<=t;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}}_drawDataset(i){var t=this.ctx,e=i._clip,a=!e.disabled,s=function(){var{xScale:t,yScale:e}=i;if(t&&e)return{left:t.left,right:t.right,top:e.top,bottom:e.bottom}}()||this.chartArea,r={meta:i,index:i.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",r)&&(a&&Ve(t,{left:!1===e.left?0:s.left-e.left,right:!1===e.right?this.width:s.right+e.right,top:!1===e.top?0:s.top-e.top,bottom:!1===e.bottom?this.height:s.bottom+e.bottom}),i.controller.draw(),a&&Be(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return y(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,a){e=Hi.modes[e];return"function"==typeof e?e(this,t,i,a):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,a=i.filter(t=>t&&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<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");var{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ie(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete rs[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let i=this._listeners,a=this.platform,e=(t,e)=>{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<n;++r){let t=(s=e[r])&&this.getDatasetMeta(s.datasetIndex).controller;t&&t[a+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){var e=this._active||[],t=t.map(({datasetIndex:t,index:e})=>{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<d;++h)u=e[h],(c={})[s.axis]=o||s.parse(n[h],h),l.push(ds(u,c,r,h));return l}function us(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function gs(t,e,i,a){return t=a?fs(t=t===e?i:t===i?e:t,i,e):fs(t,e,i)}function fs(t,e,i){return"start"===t?e:"end"===t?i:t}class ps extends Aa{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"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;t<e;++t)n._parsed[t]=i(t)}}_getRotation(){return L(this.options.rotation-90)}_getCircumference(){return L(this.options.circumference)}_getRotationExtents(){let e=v,i=-v;for(let t=0;t<this.chart.data.datasets.length;++t){var a,s;this.chart.isDatasetVisible(t)&&this.chart.getDatasetMeta(t).type===this._type&&(a=(s=this.chart.getDatasetMeta(t).controller)._getRotation(),s=s._getCircumference(),e=Math.min(e,a),i=Math.max(i,a+s))}return{rotation:e,circumference:i-e}}update(t){var e=this.chart["chartArea"],i=this._cachedMeta,a=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,r=Math.max((Math.min(e.width,e.height)-s)/2,0),r=Math.min(V(this.options.cutout,r),1),n=this._getRingWeight(this.index),{circumference:o,rotation:l}=this._getRotationExtents(),{ratioX:l,ratioY:o,offsetX:h,offsetY:d}=function(u,g,f){let p=1,m=1,b=0,x=0;if(g<v){let a=u,s=a+g,t=Math.cos(a),e=Math.sin(a),i=Math.cos(s),r=Math.sin(s),n=(t,e,i)=>pt(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<t;++p)m+=this._circumference(p,r);for(p=t;p<t+e;++p){let t=this._circumference(p,r),e=a[p],i={x:l+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+t,circumference:t,outerRadius:u,innerRadius:c};f&&(i.options=g||this.resolveDataElementOptions(p,e.active?"active":s)),m+=t,this.updateElement(e,p,i,s)}}calculateTotal(){var t=this._cachedMeta,e=t.data;let i,a=0;for(i=0;i<e.length;i++){var s=t._parsed[i];null===s||isNaN(s)||!this.chart.getDataVisibility(i)||e[i].hidden||(a+=Math.abs(s))}return a}calculateCircumference(t){var e=this._cachedMeta.total;return 0<e&&!isNaN(t)?v*(Math.abs(t)/e):0}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart,a=i.data.labels||[],e=ce(e._parsed[t],i.options.locale);return{label:a[t]||"",value:e}}getMaxBorderWidth(t){let e=0;var i=this.chart;let a,s,r,n,o;if(!t)for(a=0,s=i.data.datasets.length;a<s;++a)if(i.isDatasetVisible(a)){t=(r=i.getDatasetMeta(a)).data,n=r.controller;break}if(!t)return 0;for(a=0,s=t.length;a<s;++a)"inner"!==(o=n.resolveDataElementOptions(a)).borderAlign&&(e=Math.max(e,o.borderWidth||0,o.hoverBorderWidth||0));return e}getMaxOffset(i){let a=0;for(let e=0,t=i.length;e<t;++e){let t=this.resolveDataElementOptions(e);a=Math.max(a,t.offset||0,t.hoverOffset||0)}return a}_getRingWeightOffset(e){let i=0;for(let t=0;t<e;++t)this.chart.isDatasetVisible(t)&&(i+=this._getRingWeight(t));return i}_getRingWeight(t){return Math.max(T(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ms extends Aa{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};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()}}},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)&&(i<a.min&&(a.min=i),i>a.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<t;++g)f+=this._computeAngle(g,r,p);for(g=t;g<t+e;g++){let t=s[g],e=f,i=f+this._computeAngle(g,r,p),a=o.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=i,n&&(l.animateScale&&(a=0),l.animateRotate)&&(e=i=u);var m={x:d,y:c,innerRadius:0,outerRadius:a,startAngle:e,endAngle:i,options:this.resolveDataElementOptions(g,t.active?"active":r)};this.updateElement(t,g,m,r)}}countVisibleElements(){var t=this._cachedMeta;let i=0;return t.data.forEach((t,e)=>{!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;d<c;++d)g=e[d],(u={})[s.axis]=s.parse(f(g,o),d),h.push(ds(f(g,l),u,r,d));return h}updateRangeFromParsed(t,e,i,a){super.updateRangeFromParsed(t,e,i,a);a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){var{iScale:e,vScale:i}=this._cachedMeta,t=this.getParsed(t),a=t._custom,a=us(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(t[i.axis]);return{label:""+e.getLabelForValue(t[e.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(n,t,e,o){var l="reset"===o,{index:h,_cachedMeta:{vScale:d}}=this,c=d.getBasePixel(),u=d.isHorizontal(),g=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(t,o);for(let r=t;r<t+e;r++){let t=this.getParsed(r),e=l||P(t[d.axis])?{base:c,head:c}:this._calculateBarValuePixels(r),i=this._calculateBarIndexPixels(r,g),a=(t._stacks||{})[d.axis],s={horizontal:u,base:e.base,enableBorderRadius:!a||us(t._custom)||h===a._top||h===a._bottom,x:u?e.head:i.center,y:u?i.center:e.head,height:u?i.size:Math.abs(e.size),width:u?Math.abs(e.size):i.size};p&&(s.options=f||this.resolveDataElementOptions(r,n[r].active?"active":o));var m=s.options||n[r].options;{b=void 0;x=void 0;v=void 0;_=void 0;y=void 0;M=void 0;w=void 0;k=void 0;S=void 0;var b=s;var x=m;var v=a;var _=h;let t=x.borderSkipped;var y,M,w,k,S,x={};t?!0===t?b.borderSkipped={top:!0,right:!0,bottom:!0,left:!0}:({start:y,end:M,reverse:w,top:k,bottom:S}=function(){let t,e,i,a,s;return i=b.horizontal?(t=b.base>b.x,e="left","right"):(t=b.base<b.y,e="bottom","top"),s=t?(a="end","start"):(a="start","end"),{start:e,end:i,reverse:t,top:a,bottom:s}}(),"middle"===t&&v&&(b.enableBorderRadius=!0,t=(v._top||0)===_?k:(v._bottom||0)===_?S:(x[gs(S,y,M,w)]=!0,k)),x[gs(t,y,M,w)]=!0,b.borderSkipped=x):b.borderSkipped=x}[v,_,S]=[s,m["inflateAmount"],g.ratio],v.inflateAmount="auto"===_?1===S?.33:0:_,this.updateElement(n[r],r,s,o)}}_getStacks(e,i){let t=this._cachedMeta["iScale"],a=t.getMatchingVisibleMetas(this._type).filter(t=>t.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;s<r;++s)a.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));var n=t.barThickness;return{min:n||function(t){var e=t.iScale,i=function(a,t){if(!a._cache.$bar){var s=a.getMatchingVisibleMetas(t);let i=[];for(let t=0,e=s.length;t<e;t++)i=i.concat(s[t].controller.getAllParsedValues(a));a._cache.$bar=wt(i.sort((t,e)=>t-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<s;++a)r=e.getPixelForValue(i[a]),l();for(n=void 0,a=0,s=e.ticks.length;a<s;++a)r=e.getPixelForTick(a),l();return o}(e),pixels:a,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:n?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:s,_stacked:r,index:n},options:{base:e,minBarLength:o}}=this,l=e||0,h=this.getParsed(t),i=h._custom,d=us(i),c,u,g=h[s.axis],a=0,f=r?this.applyStack(s,h,r):g;f!==g&&(a=f-g,f=g),d&&(g=i.barStart,f=i.barEnd-i.barStart,0!==g&&_(g)!==_(i.barEnd)&&(a=0),a+=g);var p,m,b=P(e)||d?a:e;let x=s.getPixelForValue(b);if(c=this.chart.getDataVisibility(t)?s.getPixelForValue(a+f):x,u=c-x,Math.abs(u)<o){u=(b=u,p=s,m=l,(0!==b?_(b):(p.isHorizontal()?1:-1)*(p.min>=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<t?s[t-1]:null,o=t<s.length-1?s[t+1]:null;s=i.categoryPercentage,null===n&&(n=r-(null===o?e.end-e.start:o-r)),null===o&&(o=r+r-n),t=r-(r-Math.min(n,o))/2*s;return{chunk:Math.abs(o-n)/2*s/a,ratio:i.barPercentage,start:t}}:function(t,e,i,a){var s=i.barThickness;let r,n;return n=P(s)?(r=e.min*i.categoryPercentage,i.barPercentage):(r=s*a,1),{chunk:r/a,ratio:n,start:e.pixels[t]-r/2}})(a,s,r,t),i=this._getStackIndex(this.index,this._cachedMeta.stack,n?a:void 0);l=e.start+e.chunk*i+e.chunk/2,h=Math.min(o,e.chunk*e.ratio)}else l=t.getPixelForValue(this.getParsed(a)[t.axis],a),h=Math.min(o,s.min*s.ratio);return{base:l-h/2,head:l+h/2,center:l,size:h}}draw(){var t=this._cachedMeta,e=t.vScale,i=t.data,a=i.length;let s=0;for(;s<a;++s)null!==this.getParsed(s)[e.axis]&&i[s].draw(this._ctx)}},BubbleController:class extends Aa{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,a){var s=super.parsePrimitiveData(t,e,i,a);for(let t=0;t<s.length;t++)s[t]._custom=this.resolveDataElementOptions(t+i).radius;return s}parseArrayData(t,i,a,e){var s=super.parseArrayData(t,i,a,e);for(let e=0;e<s.length;e++){let t=i[a+e];s[e]._custom=T(t[2],this.resolveDataElementOptions(e+a).radius)}return s}parseObjectData(t,i,a,e){var s=super.parseObjectData(t,i,a,e);for(let e=0;e<s.length;e++){let t=i[a+e];s[e]._custom=T(t&&t.r&&+t.r,this.resolveDataElementOptions(e+a).radius)}return s}getMaxOverflow(){var e=this._cachedMeta.data;let i=0;for(let t=e.length-1;0<=t;--t)i=Math.max(i,e[t].size(this.resolveDataElementOptions(t))/2);return 0<i&&i}getLabelAndValue(t){var e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:e,yScale:a}=e,s=this.getParsed(t),e=e.getLabelForValue(s.x),a=a.getLabelForValue(s.y),s=s._custom;return{label:i[t]||"",value:"("+e+", "+a+(s?", "+s:"")+")"}}update(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(n,t,e,o){var l="reset"===o,{iScale:h,vScale:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,o),g=h.axis,f=d.axis;for(let r=t;r<t+e;r++){let t=n[r],e=!l&&this.getParsed(r),i={},a=i[g]=l?h.getPixelForDecimal(.5):h.getPixelForValue(e[g]),s=i[f]=l?d.getBasePixel():d.getPixelForValue(e[f]);i.skip=isNaN(a)||isNaN(s),u&&(i.options=c||this.resolveDataElementOptions(r,t.active?"active":o),l)&&(i.options.radius=0),this.updateElement(t,r,i,o)}}resolveDataElementOptions(t,e){var i=this.getParsed(t);let a=super.resolveDataElementOptions(t,e);t=(a=a.$shared?Object.assign({},a,{$shared:!1}):a).radius;return"active"!==e&&(a.radius=0),a.radius+=T(i&&i._custom,t),a}},DoughnutController:ps,LineController:class extends Aa{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){var e=this._cachedMeta,{dataset:i,data:a=[],_dataset:s}=e,r=this.chart._animationsDisabled;let{start:n,count:o}=Ot(e,a,r);this._drawStart=n,this._drawCount=o,At(e)&&(n=0,o=a.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=a;e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0),e.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:e},t),this.updateElements(a,n,o,t)}updateElements(a,s,t,r){let n="reset"===r,{iScale:o,vScale:l,_stacked:h,_dataset:d}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(s,r),g=o.axis,f=l.axis,{spanGaps:e,segment:p}=this.options,m=ot(e)?e:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===r,x=s+t,v=a.length,_=0<s&&this.getParsed(s-1);for(let i=0;i<v;++i){let t=a[i],e=b?t:{};var y,M,w,k;i<s||i>=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=0<i&&Math.abs(y[g]-_[g])>m,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;n<t+e;n++){let t=o[n],e=this.resolveDataElementOptions(n,t.active?"active":l),i=h.getPointPositionForValue(n,this.getParsed(n).r),a=d?h.xCenter:i.x,s=d?h.yCenter:i.y,r={x:a,y:s,angle:i.angle,skip:isNaN(a)||isNaN(s),options:e};this.updateElement(t,n,r,l)}}},ScatterController:class extends Aa{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){var e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:e,yScale:a}=e,s=this.getParsed(t),e=e.getLabelForValue(s.x),a=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+e+", "+a+")"}}update(i){var a=this._cachedMeta,{data:s=[]}=a,r=this.chart._animationsDisabled;let{start:t,count:e}=Ot(a,s,r);if(this._drawStart=t,this._drawCount=e,At(a)&&(t=0,e=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:t,_dataset:e}=a;t._chart=this.chart,t._datasetIndex=this.index,t._decimated=!!e._decimated,t.points=s;var n=this.resolveDatasetElementOptions(i);n.segment=this.options.segment,this.updateElement(t,void 0,{animated:!r,options:n},i)}else this.datasetElementType&&(delete a.dataset,this.datasetElementType=!1);this.updateElements(s,t,e,i)}addElements(){var t=this.options["showLine"];!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(o,t,e,l){let h="reset"===l,{iScale:d,vScale:c,_stacked:u,_dataset:g}=this._cachedMeta,i=this.resolveDataElementOptions(t,l),f=this.getSharedOptions(i),p=this.includeOptions(l,f),m=d.axis,b=c.axis,{spanGaps:a,segment:x}=this.options,v=ot(a)?a:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||h||"none"===l,y=0<t&&this.getParsed(t-1);for(let n=t;n<t+e;++n){let t=o[n],e=this.getParsed(n),i=_?t:{},a=P(e[b]),s=i[m]=d.getPixelForValue(e[m],n),r=i[b]=h||a?c.getBasePixel():c.getPixelForValue(u?this.applyStack(c,e,u):e[b],n);i.skip=isNaN(s)||isNaN(r)||a,i.stop=0<n&&Math.abs(e[m]-y[m])>v,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<e&&e}}}});function bs(t,e,i,a){return{x:i+t*Math.cos(e),y:a+t*Math.sin(e)}}function xs(s,t,e,i,a,r){var{x:n,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=t,c=Math.max(t.outerRadius+i+e-h,0),h=0<d?d+i+e+h:0;let u=0;var g=a-l;if(i){let t=((0<d?d-i:0)+(0<c?c-i:0))/2;u=(g-(0!=t?g*t/(t+i):g))/2}var d=(g-Math.max(.001,g*c-e/S)/c)/2,g=l+d+u,l=a-d-u,{outerStart:d,outerEnd:f,innerStart:p,innerEnd:m}=function(t,e,i,a){t=yi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);let s=(i-e)/2,r=Math.min(s,a*e/2),n=t=>{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<f){let t=bs(x,_,n,o);s.arc(t.x,t.y,f,_,l+D)}let e=bs(M,l,n,o);if(s.lineTo(e.x,e.y),0<m){let t=bs(M,k,n,o);s.arc(t.x,t.y,m,l+D,k+Math.PI)}let i=(l-m/h+(g+p/h))/2;if(s.arc(n,o,h,l-m/h,i,!0),s.arc(n,o,h,i,g+p/h,!0),0<p){let t=bs(y,w,n,o);s.arc(t.x,t.y,p,w+Math.PI,g-D)}let a=bs(b,g,n,o);if(s.lineTo(a.x,a.y),0<d){let t=bs(b,v,n,o);s.arc(t.x,t.y,d,g-D,v)}}else{s.moveTo(n,o);let t=Math.cos(v)*c+n,e=Math.sin(v)*c+o,i=(s.lineTo(t,e),Math.cos(_)*c+n),a=Math.sin(_)*c+o;s.lineTo(i,a)}s.closePath()}function vs(t,e,i=e){t.lineCap=T(i.borderCapStyle,e.borderCapStyle),t.setLineDash(T(i.borderDash,e.borderDash)),t.lineDashOffset=T(i.borderDashOffset,e.borderDashOffset),t.lineJoin=T(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=T(i.borderWidth,e.borderWidth),t.strokeStyle=T(i.borderColor,e.borderColor)}function _s(t,e,i){t.lineTo(i.x,i.y)}function ys(t,e,i={}){var t=t.length,{start:i=0,end:a=t-1}=i,{start:s,end:r}=e,n=Math.max(i,s),o=Math.min(a,r);return{count:t,start:n,loop:e.loop,ilen:o<n&&!(i<s&&a<s||r<i&&r<a)?t+o-n:o-n}}function Ms(t,e,i,a){let{points:s,options:r}=e,{count:n,start:o,loop:l,ilen:h}=ys(s,i,a),d=r.stepped?We:r.tension||"monotone"===r.cubicInterpolationMode?Ne:_s,c,u,g,{move:f=!0,reverse:p}=a||{};for(c=0;c<=h;++c)(u=s[(o+(p?h-c:c))%n]).skip||(f?(t.moveTo(u.x,u.y),f=!1):d(t,g,u,p,r.stepped),g=u);return l&&(u=s[(o+(p?h:0))%n],d(t,g,u,p,r.stepped)),!!l}function ws(a,t,e,i){let s=t.points,{count:r,start:n,ilen:o}=ys(s,e,i),{move:l=!0,reverse:h}=i||{},d,c,u,g,f,p,m=0,b=0;var x=t=>(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?(e<g?g=e:e>f&&(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<t;++s){let{start:t,end:e}=d[s],i=h[t],a=h[e];i===a?u.push(i):((c=g(i,a,Math.abs((l-i[n])/(a[n]-i[n])),o.stepped))[n]=r[n],u.push(c))}return 1===u.length?u[0]:u}}pathSegment(t,e,i){return ks(this)(t,this,e,i)}path(t,e,i){var a,s=this.segments,r=ks(this);let n=this._loop;e=e||0,i=i||this.points.length-e;for(a of s)n&=r(t,this,a,{start:e,end:e+i-1});return!!n}draw(t,e,i,a){var s,r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),r=t,s=this,i=i,a=a,(Ss&&!s.options.segment?function(t,e,i,a){let s=e._path;s||(s=e._path=new Path2D,e.path(s,i,a)&&s.closePath()),vs(t,e.options),t.stroke(s)}:function(t,e,i,a){var s,{segments:r,options:n}=e,o=ks(e);for(s of r)vs(t,n,s.style),t.beginPath(),o(t,e,s,{start:i,end:i+a-1})&&t.closePath(),t.stroke()})(r,s,i,a),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Ds(t,e,i,a){var s=t.options,{[i]:t}=t.getProps([i],a);return Math.abs(e-t)<s.radius+s.hitRadius}function Cs(t,e){var{x:e,y:i,base:a,width:s,height:r}=t.getProps(["x","y","base","width","height"],e);let n,o,l,h,d;return h=t.horizontal?(d=r/2,n=Math.min(e,a),o=Math.max(e,a),l=i-d,i+d):(d=s/2,n=e-d,o=e+d,l=Math.min(i,a),Math.max(i,a)),{left:n,top:l,right:o,bottom:h}}function Os(t,e,i,a){return t?0:C(e,i,a)}function As(t,e,i,a){var s=null===e,r=null===i,t=t&&!(s&&r)&&Cs(t,a);return t&&(s||d(e,t.left,t.right))&&(r||d(i,t.top,t.bottom))}function Ts(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ls(t,e,i={}){var a=t.x!==i.x?-e:0,s=t.y!==i.y?-e:0,r=(t.x+t.w!==i.x+i.w?e:0)-a,i=(t.y+t.h!==i.y+i.h?e:0)-s;return{x:t.x+a,y:t.y+s,w:t.w+r,h:t.h+i,radius:t.radius}}var Es=Object.freeze({__proto__:null,ArcElement:class extends e{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"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;t<d;++t)l.fill();isNaN(u)||(t=c+(u%v||v))}xs(l,s,a,i,t,h),l.fill()}var g=e,c=this,u=o,s=r,a=n,{fullCircles:f,startAngle:i,circumference:h,options:o}=c,{borderWidth:r,borderJoinStyle:n,borderDash:p,borderDashOffset:m}=o,o="inner"===o.borderAlign;if(r){g.setLineDash(p||[]),g.lineDashOffset=m,o?(g.lineWidth=2*r,g.lineJoin=n||"round"):(g.lineWidth=r,g.lineJoin=n||"bevel");let t=c.endAngle;if(f){xs(g,c,u,s,t,a);for(let t=0;t<f;++t)g.stroke();isNaN(h)||(t=i+(h%v||v))}if(o){p=g;m=c;r=t;var{startAngle:m,pixelMargin:n,x:i,y:h,outerRadius:o,innerRadius:b}=m,x=n/o;p.beginPath(),p.arc(i,h,o,m-x,r+x),n<b?p.arc(i,h,b,r+(x=n/b),m-x,!0):p.arc(i,h,n,r+D,m-D),p.closePath(),p.clip()}f||(xs(g,c,u,s,t,a),g.stroke())}e.restore()}}},BarElement:class extends e{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e,i,a,s,r,n,o,{inflateAmount:l,options:{borderColor:h,backgroundColor:d}}=this,{inner:c,outer:u}=(a=Cs(e=this),s=a.right-a.left,r=a.bottom-a.top,u=s/2,n=r/2,o=(i=e).options.borderWidth,i=i.borderSkipped,o=Mi(o),n={t:Os(i.top,o.top,0,n),r:Os(i.right,o.right,0,u),b:Os(i.bottom,o.bottom,0,n),l:Os(i.left,o.left,0,u)},i=s/2,o=r/2,e=(u=e).getProps(["enableBorderRadius"]).enableBorderRadius,c=u.options.borderRadius,g=wi(c),i=Math.min(i,o),o=u.borderSkipped,e={topLeft:Os(!(u=e||A(c))||o.top||o.left,g.topLeft,0,i),topRight:Os(!u||o.top||o.right,g.topRight,0,i),bottomLeft:Os(!u||o.bottom||o.left,g.bottomLeft,0,i),bottomRight:Os(!u||o.bottom||o.right,g.bottomRight,0,i)},{outer:{x:a.left,y:a.top,w:s,h:r,radius:e},inner:{x:a.left+n.l,y:a.top+n.t,w:s-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,e.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,e.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,e.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,e.bottomRight-Math.max(n.b,n.r))}}}),g=(o=u.radius).topLeft||o.topRight||o.bottomLeft||o.bottomRight?je:Ts;t.save(),u.w===c.w&&u.h===c.h||(t.beginPath(),g(t,Ls(u,l,c)),t.clip(),g(t,Ls(c,-l,u)),t.fillStyle=h,t.fill("evenodd")),t.beginPath(),g(t,Ls(c,l)),t.fillStyle=d,t.fill(),t.restore()}inRange(t,e,i){return As(this,t,e,i)}inXRange(t,e){return As(this,t,null,e)}inYRange(t,e){return As(this,null,t,e)}getCenterPoint(t){var{x:t,y:e,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(t+i)/2:t,y:a?e:(e+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:Ps,PointElement:class extends e{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){var a=this.options,{x:i,y:s}=this.getProps(["x","y"],i);return Math.pow(t-i,2)+Math.pow(e-s,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(t,e){return Ds(this,t,"x",e)}inYRange(t,e){return Ds(this,t,"y",e)}getCenterPoint(t){var{x:t,y:e}=this.getProps(["x","y"],t);return{x:t,y:e}}size(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}draw(t,e){var i=this.options;this.skip||i.radius<.1||!y(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ze(t,i,this.x,this.y))}getRange(){var t=this.options||{};return t.radius+t.hitRadius}}});function Rs(t){var e=this.getLabels();return 0<=t&&t<e.length?e[t]:t}function Is(t,e,{horizontal:i,minRotation:a}){a=L(a),i=(i?Math.sin(a):Math.cos(a))||.001;return Math.min(e/i,.75*e*(""+t).length)}class zs extends Fa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return P(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let t=this.options["beginAtZero"],{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:a,max:s}=this;var r,n=t=>a=e?a:t,o=t=>s=i?s:t;if(t){let t=_(a),e=_(s);t<0&&e<0?o(0):0<t&&0<e&&n(0)}a===s&&(r=0===s?1:Math.abs(.05*s),o(s+r),t||n(a-r)),this.min=a,this.max=s}getTickLimit(){let t,{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?1e3<(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),e=e||11),t=e?Math.min(e,t):t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){var t=this.options,e=t.ticks,i=this.getTickLimit(),i=function(t,e){var i=[],{bounds:a,step:s,min:r,max:n,precision:o,count:l,maxTicks:h,maxDigits:d,includeBounds:c}=t,u=s||1,g=h-1,{min:e,max:f}=e,p=!P(r),m=!P(n),b=!P(l),d=(f-e)/(d+1);let x,v,_,y,M=rt((f-e)/g/u)*u;if(M<1e-14&&!p&&!m)return[{value:e},{value:f}];(y=Math.ceil(f/M)-Math.floor(e/M))>g&&(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}),v<r&&w++,st(Math.round((v+w*M)*x)/x,r,Is(r,d,t))&&w++):v<r&&w++);w<y;++w){let t=Math.round((v+w*M)*x)/x;if(m&&t>n)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)&&0<t?t:null;this._zero=!0}determineDataLimits(){var{min:t,max:e}=this.getMinMax(!0);this.min=p(t)?Math.max(0,t):null,this.max=p(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!p(this._userMin)&&(this.min=t===Bs(this.min,0)?Bs(this.min,-1):Bs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:i}=this.getUserBounds(),a=this.min,s=this.max;var t=t=>a=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(;10<Ns(t,e,i);)i++;for(;Ns(t,e,i)<10;)i--;return Math.min(i,Vs(t))}(e,i),n=r<0?Math.pow(10,Math.abs(r)):1;var o=Math.pow(10,r),l=s>r?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(;c<i;)a.push({value:c,major:Ws(c),significand:d}),10<=d?d=d<15?15:20:d++,20<=d&&(r++,d=2,n=0<=r?1:n),c=Math.round((l+h+d*Math.pow(10,r))*n)/n;return e=u(t.max,c),a.push({value:e,major:Ws(e),significand:d}),a}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&ht(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ce(t,this.chart.options.locale,this.options.ticks.format)}configure(){var t=this.min;super.configure(),this._startValue=o(t),this._valueRange=o(this.max)-o(t)}getPixelForValue(t){return null===(t=void 0!==t&&0!==t?t:this.min)||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(o(t)-this._startValue)/this._valueRange)}getValueForPixel(t){t=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+t*this._valueRange)}}function js(t){var e=t.ticks;if(e.display&&t.display){let t=I(e.backdropPadding);return T(e.font&&e.font.size,R.font.size)+t.height}return 0}function Ys(t,e,i,a,s){return t===a||t===s?{start:e-i/2,end:e+i/2}:t<a||s<t?{start:e-i,end:e}:{start:e,end:e+i}}function $s(i){let s={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},r=Object.assign({},s),a=[],n=[],t=i._pointLabels.length,o=i.options.pointLabels,l=o.centerPointLabels?S/t:0;for(let e=0;e<t;e++){let t=o.setContext(i.getPointLabelContext(e));n[e]=t.padding;var h=i.getPointPosition(e,i.drawingArea+n[e],l),d=z(t.font),c=(c=i.ctx,d=d,u=O(u=i._pointLabels[e])?u:[u],{w:Ee(c,d.string,u),h:u.length*d.lineHeight}),u=(a[e]=c,x(i.getIndexAngle(e)+l)),d=Math.round(dt(u));{g=void 0;f=void 0;p=void 0;m=void 0;b=void 0;var g=r;var f=s;var p=u;var m=Ys(d,h.x,c.w,0,180);var b=Ys(d,h.y,c.h,90,270);let t=Math.abs(Math.sin(p)),e=Math.abs(Math.cos(p)),i=0,a=0;m.start<f.l?(i=(f.l-m.start)/t,g.l=Math.min(g.l,f.l-i)):m.end>f.r&&(i=(m.end-f.r)/t,g.r=Math.max(g.r,f.r+i)),b.start<f.t?(a=(f.t-b.start)/e,g.t=Math.min(g.t,f.t-a)):b.end>f.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;e<t;e++){l.padding=s[e],l.size=a[e];let t=function(t,e,i){let a=t.drawingArea,{extra:s,additionalAngle:r,padding:n,size:o}=i,l=t.getPointPosition(e,a+s+n,r),h=Math.round(dt(x(l.angle+D))),d=function(t,e){return 90===h||270===h?t-=e/2:(270<h||h<90)&&(t-=e),t}(l.y,o.h),c=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(h),u=function(t,e){return"right"===c?t-=e:"center"===c&&(t-=e/2),t}(l.x,o.w);return{visible:!0,x:l.x,y:d,textAlign:c,left:u,top:d,right:u+o.w,bottom:d+o.h}}(i,e,l);r.push(t),"auto"===o&&(t.visible=function(t,e){if(!e)return!0;var{left:t,top:i,right:a,bottom:s}=t;return!(y({x:t,y:i},e)||y({x:t,y:s},e)||y({x:a,y:i},e)||y({x:a,y:s},e))}(t,h),t.visible)&&(h=t)}return r}(i,a,n)}function Us(e,i,t,a){var s=e["ctx"];if(t)s.arc(e.xCenter,e.yCenter,i,0,v);else{var r=e.getPointPosition(0,i);s.moveTo(r.x,r.y);for(let t=1;t<a;t++)r=e.getPointPosition(t,i),s.lineTo(r.x,r.y)}}class Xs extends zs{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ge.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,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&&t<e.length)return e=e[t],Pi(this.getContext(),{label:e,index:t,type:"pointLabel"})}getPointPosition(t,e,i=0){t=this.getIndexAngle(t)-D+i;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){var{left:t,top:e,right:i,bottom:a}=this._pointLabelItems[t];return{left:t,top:e,right:i,bottom:a}}drawBackground(){var t,{backgroundColor:e,grid:{circular:i}}=this.options;e&&((t=this.ctx).save(),t.beginPath(),Us(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),t.closePath(),t.fillStyle=e,t.fill(),t.restore())}drawGrid(){let a=this.ctx,s=this.options,{angleLines:r,grid:l,border:h}=s,d=this._pointLabels.length,n,c,o;if(s.pointLabels.display){var i=this,t=d,{ctx:u,options:{pointLabels:g}}=i;for(let e=t-1;0<=e;e--){let t=i._pointLabelItems[e];if(t.visible){var f,p=g.setContext(i.getPointLabelContext(e)),m=(f=M=y=_=v=x=b=m=void 0,u),b=p,x=t,{left:v,top:_,right:y,bottom:M}=x;if(!P(f=b["backdropColor"])){let t=wi(b.borderRadius),e=I(b.backdropPadding);m.fillStyle=f;b=v-e.left,f=_-e.top,y=y-v+e.width,v=M-_+e.height;Object.values(t).some(t=>0!==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-1;++i){let t=qs[h[i]],e=t.steps||Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((s-a)/(e*t.size))<=r)return h[i]}return h[e-1]}function Js(t,e,i){var a,s;i?i.length&&({lo:a,hi:s}=bt(i,e),t[i[a]>=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<e;++n)r[o=t[n]]=n,s.push({value:o,major:!1});if(0!==e&&a){var l=s,h=r,d=a,c=i._adapter,a=+c.startOf(l[0].value,d),u=l[l.length-1].value;let t,e;for(t=a;t<=u;t=+c.add(t,1,d))0<=(e=h[t])&&(l[e].major=!0);return l}return s}class tr extends Fa{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){var i=t.time||(t.time={}),a=this._adapter=new hs._date(t.adapters.date);a.init(e),$(i.displayFormats,a.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:Gs(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){var t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:a,max:s,minDefined:r,maxDefined:n}=this.getUserBounds();function o(t){r||isNaN(t.min)||(a=Math.min(a,t.min)),n||isNaN(t.max)||(s=Math.max(s,t.max))}r&&n||(o(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source)||o(this.getMinMax(!1)),a=p(a)&&!isNaN(a)?a:+e.startOf(Date.now(),i),s=p(s)&&!isNaN(s)?s:+e.endOf(Date.now(),i)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){var t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){var t=this.options,e=t.time,i=t.ticks,a="labels"===i.source?this.getLabelTimestamps():this._generate(),s=("ticks"===t.bounds&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]),this.min),r=vt(a,s,this.max);return this._unit=e.unit||(i.autoSkip?Zs(e.minUnit,this.min,this.max,this._getLabelCapacity(s)):function(i,a,t,s,r){for(let e=h.length-1;e>=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<e;++t)if(qs[h[t]].common)return h[t]}(this._unit):void 0,this.initOffsets(a),t.reverse&&r.reverse(),Qs(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(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<i;h=+t.add(h,n,r),d++)Js(l,h,u);return h!==i&&"ticks"!==a.bounds&&1!==d||Js(l,h,u),Object.keys(l).sort(Ks).map(t=>+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<i;++e)(a=t[e]).label=this._tickFormatFunction(a.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){var e=this._offsets,t=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+t)*e.factor)}getValueForPixel(t){var e=this._offsets,t=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+t*(this.max-this.min)}_getLabelSize(t){var e=this.options.ticks,t=this.ctx.measureText(t).width,e=L(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(e),e=Math.sin(e),a=this._resolveTickFontOptions(0).size;return{w:t*i+a*e,h:t*e+a*i}}_getLabelCapacity(t){var e=this.options.time,i=e.displayFormats,e=i[e.unit]||i.millisecond,i=this._tickFormatFunction(t,0,Qs(this,[t],this._majorUnit),e),t=this._getLabelSize(i),e=Math.floor(this.isHorizontal()?this.width/t.w:this.height/t.h)-1;return 0<e?e:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;var a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(t=0,e=a.length;t<e;++t)i=i.concat(a[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){var t=this._cache.labels||[];let e,i;if(t.length)return t;var a=this.getLabels();for(e=0,i=a.length;e<i;++e)t.push(Gs(this,a[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wt(t.sort(Ks))}}function er(t,e,i){let a,s,r,n,o=0,l=t.length-1;i?(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<n;++r)(l=t[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;r<n;++r)h=a[r+1],o=a[r-1],l=a[r],Math.round((h+o)/2)!==l&&s.push({time:l,pos:r/(n-1)});return s}_generate(){var t=this.min,e=this.max,i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort((t,e)=>t-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;u<e-2;u++){let t,e=0,i=0,a=Math.floor((u+1)*d)+1+o,s=Math.min(Math.floor((u+2)*d)+1,l)+o,r=s-a;for(t=a;t<s;t++)e+=n[t].x,i+=n[t].y;e/=r,i/=r;var x=Math.floor(u*d)+1+o,v=Math.min(Math.floor((u+1)*d)+1,l)+o,{x:_,y}=n[b];for(f=-1,t=x;t<v;t++)(p=.5*Math.abs((_-e)*(n[t].y-y)-(_-n[t].x)*(i-y)))>f&&(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;s<t+e;++s){n=((r=a[s]).x-b)/x*i,o=r.y;let t=0|n;if(t===l)o<u?(u=o,h=s):o>g&&(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<s&&i!==c&&m.push(a[i]),m.push(r),l=t,p=0,u=g=o,h=d=c=s}}return m}(s,r,n,o);break;default:throw new Error(`Unsupported decimation algorithm '${M.algorithm}'`)}e._decimated=t}}}})}else cr(l)},destroy(t){cr(t)}};function gr(i,a,s,t){if(!t){let t=a[i],e=s[i];return"angle"===i&&(t=x(t),e=x(e)),{property:i,start:t,end:e}}}function fr(t,e,i){for(;t<e;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function pr(t,e,i,a){return t&&e?a(t[i],e[i]):t?t[i]:e?e[i]:0}function mr(e,t){let i=[],a=!1;return(i=O(e)?(a=!0,e):function(t){let{x:i=null,y:a=null}=e||{},s=t.points,r=[];return t.segments.forEach(({start:t,end:e})=>{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<a.length;t++){var{first:r,last:n,point:o}=function(t,e,s){let i=t.interpolate(e,s);if(!i)return{};let r=i[s],n=t.segments,o=t.points,l=!1,h=!1;for(let a=0;a<n.length;a++){let t=n[a],e=o[t.start][s],i=o[t.end][s];if(d(r,e,i)){l=r===e,h=r===i;break}}return{first:l,last:h,point:i}}(a[t],i,"x");if(!(!o||r&&n))if(r)s.unshift(o);else if(e.push(o),!n)break}e.push(...s)}class vr{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){var{x:a,y:s,radius:r}=this;return e=e||{start:0,end:v},t.arc(a,s,r,e.end,e.start,!0),!i.bounds}interpolate(t){var{x:e,y:i,radius:a}=this,t=t.angle;return{x:e+Math.cos(t)*a,y:i+Math.sin(t)*a,angle:t}}}function _r(o){var t,e,{chart:i,fill:a,line:s}=o;if(p(a))return t=a,(e=(i=i).getDatasetMeta(t))&&i.isDatasetVisible(t)?e.dataset:null;if("stack"!==a)return"shape"===a||((i=function(o){if((o.scale||{}).getPointPositionForValue){var l=o;let{scale:e,fill:t}=l,i=e.options,a=e.getLabels().length,s=i.reverse?e.max:e.min,r=(l=t,h=e,"start"===l?s:"end"===l?h.options.reverse?h.min:h.max:A(l)?l.value:h.getBaseValue()),n=[];if(i.grid.circular){let t=e.getPointPositionForValue(0,s);return new vr({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<a;++t)n.push(e.getPointPositionForValue(t,r));return n}var t=o,{scale:l={},fill:t}=t,h=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:A(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(t,l);if(p(h)){let t=l.isHorizontal();return{x:t?h:null,y:t?null:h}}return null}(o))instanceof vr?i:mr(i,s));{let{scale:t,index:e,line:i}=o,a=[],s=i.segments,r=i.points,n=function(t,e){var i=[],a=t.getMatchingVisibleMetas("line");for(let t=0;t<a.length;t++){var s=a[t];if(s.index===e)break;s.hidden||i.unshift(s.dataset)}return i}(t,e);n.push(mr({x:null,y:t.bottom},i));for(let t=0;t<s.length;t++){let e=s[t];for(let t=e.start;t<=e.end;t++)xr(a,r[t],n)}return new Ps({points:a,options:{}})}}function yr(t,e,i){var a,s=_r(e),{line:e,scale:r,axis:n}=e,o=e.options,l=o.fill,o=o.backgroundColor,{above:l=o,below:o=o}=l||{};s&&e.points.length&&(Ve(t,i),a=t,{line:s,target:l,above:o,below:i,area:r,scale:n}=e={line:e,target:s,above:l,below:o,area:i,scale:r,axis:n},e=s._loop?"angle":e.axis,a.save(),"x"===e&&i!==o&&(Mr(a,l,r.top),wr(a,{line:s,target:l,color:o,scale:n,property:e}),a.restore(),a.save(),Mr(a,l,r.bottom)),wr(a,{line:s,target:l,color:i,scale:n,property:e}),a.restore(),Be(t))}function Mr(s,r,n){let{segments:t,points:o}=r,l=!0,h=!1;s.beginPath();for(var d of t){let{start:t,end:e}=d,i=o[t],a=o[fr(t,e,o)];l?(s.moveTo(i.x,i.y),l=!1):(s.lineTo(i.x,n),s.lineTo(i.x,i.y)),(h=!!r.pathSegment(s,d,{move:h}))?s.closePath():s.lineTo(a.x,n)}s.lineTo(r.first().x,n),s.closePath(),s.clip()}function wr(o,t){let{line:l,target:h,property:d,color:c,scale:u}=t,e=function(t,e,s){let i=t.segments,r=t.points,n=e.points,o=[];for(let t of i){var{start:a,end:l}=t,l=fr(a,l,r),h=gr(s,r[a],r[l],t.loop);if(e.segments){var d=Ei(e,h);for(let a of d){let e=gr(s,n[a.start],n[a.end],a.loop),i=Li(t,r,e);for(let t of i)o.push({source:t,target:a,start:{[s]:pr(h,e,"start",Math.max)},end:{[s]:pr(h,e,"end",Math.min)}})}}else o.push({source:t,target:h,start:r[a],end:r[l]})}return o}(l,h,d);for(let{source:a,target:s,start:r,end:n}of e){let{style:{backgroundColor:t=c}={}}=a,e=!0!==h;o.save(),o.fillStyle=t,x=b=m=p=f=g=void 0;var g=o,f=u,p=e&&gr(d,r,n),{top:f,bottom:m}=f.chart.chartArea,{property:p,start:b,end:x}=p||{},p=("x"===p&&(g.beginPath(),g.rect(b,f,x-b,m-f),g.clip()),o.beginPath(),!!l.pathSegment(o,a));let i;if(e){p?o.closePath():kr(o,h,n,d);let t=!!h.pathSegment(o,s,{move:p,reverse:!0});(i=p&&t)||kr(o,h,r,d)}o.closePath(),o.fill(i?"evenodd":"nonzero"),o.restore()}}function kr(t,e,i,a){e=e.interpolate(i,a);e&&t.lineTo(e.x,e.y)}var Sr={id:"filler",afterDatasetsUpdate(t,e,i){var a,s,r,n,o,l,h=(t.data.datasets||[]).length,d=[];let c,u,g,f;for(u=0;u<h;++u)g=(c=t.getDatasetMeta(u)).dataset,f=null,g&&g.options&&g instanceof Ps&&(f={visible:t.isDatasetVisible(u),index:u,fill:(a=g,s=u,r=h,l=o=n=void 0,A(l=function(){var t=a.options,e=t.fill;let i=T(e&&e.target,e);return!1!==(i=void 0===i?!!t.backgroundColor:i)&&null!==i&&(!0===i?"origin":i)}())?!isNaN(l.value)&&l:p(o=parseFloat(l))&&Math.floor(o)===o?(n=l[0],o=o,!((o="-"!==n&&"+"!==n?o:s+o)===s||o<0||r<=o)&&o):0<=["origin","start","end","stack","shape"].indexOf(l)&&l),chart:t,axis:c.controller.options.indexAxis,scale:c.vScale,line:g}),c.$filler=f,d.push(f);for(u=0;u<h;++u)(f=d[u])&&!1!==f.fill&&(f.fill=function(t,e,i){let a=t[e].fill;var s,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!p(a))return a;if(!(s=t[a]))return!1;if(s.visible)return a;r.push(a),a=s.fill}return!1}(d,u,i.propagate))},beforeDraw(i,t,e){var a="beforeDraw"===e.drawTime,s=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let e=s.length-1;0<=e;--e){let t=s[e].$filler;t&&(t.line.updateControlPoints(r,t.axis),a)&&t.fill&&yr(i.ctx,t,r)}},beforeDatasetsDraw(i,t,e){if("beforeDatasetsDraw"===e.drawTime){var a=i.getSortedVisibleDatasetMetas();for(let e=a.length-1;0<=e;--e){let t=a[e].$filler;br(t)&&yr(i.ctx,t,i.chartArea)}}},beforeDatasetDraw(t,e,i){e=e.meta.$filler;br(e)&&"beforeDatasetDraw"===i.drawTime&&yr(t.ctx,e,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let Pr=(t,e)=>{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<e?0:1)]=0,g+=d,u++),l[e]={left:0,top:g,row:u,width:t,height:s},h[h.length-1]+=t+o}),c}_fitCols(t,o,l,h){let{ctx:d,maxHeight:e,options:{labels:{padding:c}}}=this,u=this.legendHitBoxes=[],g=this.columnSizes=[],f=e-t,p=c,m=0,b=0,x=0,v=0;return this.legendItems.forEach((t,e)=>{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)};0<e&&b+n+2*c>f&&(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?0<a&&s+t+x>this.right&&(r=y.y+=D,y.line++,s=y.x=E(g,this.left+x,this.right-c[y.line])):0<a&&r+D>this.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;i<s.length;++i)if(d(t,(a=s[i]).left,a.left+a.width)&&d(e,a.top,a.top+a.height))return this.legendItems[i];return null}handleEvent(t){var e,i,a,s=this.options;("mousemove"!==(e=t.type)&&"mouseout"!==e||!s.onHover&&!s.onLeave)&&(!s.onClick||"click"!==e&&"mouseup"!==e)||(e=this._getLegendItemAt(t.x,t.y),"mousemove"===t.type||"mouseout"===t.type?(a=null!==(i=this._hoveredItem)&&null!==e&&i.datasetIndex===e.datasetIndex&&i.index===e.index,i&&!a&&c(s.onLeave,[t,i,this],this),(this._hoveredItem=e)&&!a&&c(s.onHover,[t,e,this],this)):e&&c(s.onClick,[t,e,this],this))}}function Cr(t,e){return e*(t.text?t.text.length:0)}var Or={id:"legend",_element:Dr,start(t,e,i){var a=t.legend=new Dr({ctx:t.ctx,options:i,chart:t});s.configure(t,a,i),s.addBox(t,a)},stop(t){s.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){var a=t.legend;s.configure(t,a,i),a.options=i},afterUpdate(t){t=t.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){var a=e.datasetIndex,i=i.chart;i.isDatasetVisible(a)?(i.hide(a),e.hidden=!0):(i.show(a),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.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;i<e;++i){let e=t[i].element;if(e&&e.hasValue()){let t=e.tooltipPosition();a+=t.x,s+=t.y,++r}}return{x:a/r,y:s/r}},nearest(t,i){if(!t.length)return!1;let a,e,s,r=i.x,n=i.y,o=Number.POSITIVE_INFINITY;for(a=0,e=t.length;a<e;++a){let e=t[a].element;if(e&&e.hasValue()){let t=gt(i,e.getCenterPoint());t<o&&(o=t,s=e)}}if(s){let t=s.tooltipPosition();r=t.x,n=t.y}return{x:r,y:n}}};function b(t,e){return e&&(O(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ir(t){return("string"==typeof t||t instanceof String)&&-1<t.indexOf("\n")?t.split("\n"):t}function zr(t,e){function i(t){b=Math.max(b,a.measureText(t).width+v)}let a=t.chart.ctx,{body:s,footer:r,title:n}=t,{boxWidth:o,boxHeight:l}=e,h=z(e.bodyFont),d=z(e.titleFont),c=z(e.footerFont),u=n.length,g=r.length,f=s.length,p=I(e.padding),m=p.height,b=0,x=s.reduce((t,e)=>t+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 t<e/2?"top":t>i.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<t.length){var t=t[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(0<i&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:t,beforeBody:t,beforeLabel:t,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");t=t.formattedValue;return P(t)||(e+=t),e},labelColor(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){t=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:t,afterBody:t,beforeFooter:t,footer:t,afterFooter:t};function w(t,e,i,a){t=t[e].call(i,a);return void 0===t?Hr[e].call(i,a):t}class jr extends e{static positioners=Rr;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){var t,e=this._cachedAnimations;return e||(e=this.chart,e=(t=this.options.setContext(this.getContext())).enabled&&e.options.animation&&t.animations,t=new va(this.chart,e),e._cacheable&&(this._cachedAnimations=Object.freeze(t)),t)}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),Pi(t,{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"})));var t}getTitle(t,e){var e=e["callbacks"],i=w(e,"beforeTitle",this,t),a=w(e,"title",this,t),e=w(e,"afterTitle",this,t),t=b([],Ir(i));return t=b(t,Ir(a)),b(t,Ir(e))}getBeforeBody(t,e){return Wr(w(e.callbacks,"beforeBody",this,t))}getBody(t,e){let a=e["callbacks"],s=[];return k(t,t=>{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;e<o;++e)l.push(function(t,e){var{element:e,datasetIndex:i,index:a}=e,s=t.getDatasetMeta(i).controller,{label:r,value:n}=s.getLabelAndValue(a);return{chart:t,label:r,parsed:s.getParsed(a),raw:t.data.datasets[i].data[a],formattedValue:n,dataset:s.getDataset(),dataIndex:a,datasetIndex:i,element:e}}(this.chart,t[e]));return a.filter&&(l=l.filter((t,e,i)=>a.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;o<s;++o)e.fillText(a[o],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n,o+1===s&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(a,t,e,s,r){let n=this.labelColors[e],o=this.labelPointStyles[e],{boxHeight:l,boxWidth:h}=r,i=z(r.bodyFont),d=Br(this,"left",r),c=s.x(d),u=l<i.lineHeight?(i.lineHeight-l)/2:0,g=t.y+u;if(r.usePointStyle){let t={radius:Math.min(h,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},e=s.leftForLtr(c,h)+h/2,i=g+l/2;a.strokeStyle=r.multiKeyBackground,a.fillStyle=r.multiKeyBackground,ze(a,t,e,i),a.strokeStyle=n.borderColor,a.fillStyle=n.backgroundColor,ze(a,t,e,i)}else{a.lineWidth=A(n.borderWidth)?Math.max(...Object.values(n.borderWidth)):n.borderWidth||1,a.strokeStyle=n.borderColor,a.setLineDash(n.borderDash||[]),a.lineDashOffset=n.borderDashOffset||0;let t=s.leftForLtr(c,h),e=s.leftForLtr(s.xPlus(c,1),h-2),i=wi(n.borderRadius);Object.values(i).some(t=>0!==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<y;++v){for(m=s[v],b=this.labelTextColors[v],i.fillStyle=b,k(m.before,a),x=m.lines,o&&x.length&&(this._drawColorBox(i,e,v,f,t),u=Math.max(c.lineHeight,l)),_=0,M=x.length;_<M;++_)a(x[_]),u=c.lineHeight;k(m.after,a)}g=0,u=c.lineHeight,k(this.afterBody,a),e.y-=r}drawFooter(t,e,i){var a=this.footer,s=a.length;let r,n;if(s){var o=Di(i.rtl,this.x,this.width);for(t.x=Br(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",r=z(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,n=0;n<s;++n)e.fillText(a[n],o.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,a){var{xAlign:s,yAlign:r}=this,{x:n,y:o}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:g}=wi(a.cornerRadius);e.fillStyle=a.backgroundColor,e.strokeStyle=a.borderColor,e.lineWidth=a.borderWidth,e.beginPath(),e.moveTo(n+d,o),"top"===r&&this.drawCaret(t,e,i,a),e.lineTo(n+l-c,o),e.quadraticCurveTo(n+l,o,n+l,o+c),"center"===r&&"right"===s&&this.drawCaret(t,e,i,a),e.lineTo(n+l,o+h-g),e.quadraticCurveTo(n+l,o+h,n+l-g,o+h),"bottom"===r&&this.drawCaret(t,e,i,a),e.lineTo(n+u,o+h),e.quadraticCurveTo(n,o+h,n,o+h-u),"center"===r&&"left"===s&&this.drawCaret(t,e,i,a),e.lineTo(n,o+d),e.quadraticCurveTo(n,o,n+d,o),e.closePath(),e.fill(),0<a.borderWidth&&e.stroke()}_updateAnimationTarget(e){let i=this.chart,t=this.$animations,a=t&&t.x,s=t&&t.y;if(a||s){let t=Rr[e.position].call(this,this._active,this._eventPosition);var r,n;t&&(r=this._size=zr(this,e),n=Vr(e,n=Object.assign({},t,this._size),e=Fr(i,e,n),i),a._to===n.x&&s._to===n.y||(this.xAlign=e.xAlign,this.yAlign=e.yAlign,this.width=r.width,this.height=r.height,this.caretX=t.x,this.caretY=t.y,this._resolveAnimations().update(this,n)))}}_willRender(){return!!this.opacity}draw(t){var e,i,a,s,r=this.options.setContext(this.getContext()),n=this.opacity;n&&(this._updateAnimationTarget(r),e={width:this.width,height:this.height},i={x:this.x,y:this.y},n=Math.abs(n)<.001?0:n,a=I(r.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length,r.enabled)&&s&&(t.save(),t.globalAlpha=n,this.drawBackground(i,t,e,r),Ci(t,r.textDirection),i.y+=a.top,this.drawTitle(i,t,r),this.drawBody(i,t,r),this.drawFooter(i,t,r),Oi(t,r.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){var i=this._active,t=t.map(({datasetIndex:t,index:e})=>{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
public/scripts/ol-min.js
+1
-1
@@ -1 +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<t?1:t<e?-1:0}function G(t,e){return 0<=t.indexOf(e)}function B(t,e,o){var i=t.length;if(t[0]<=e)return 0;if(!(e<=t[i-1]))if(0<o){for(o=1;o<i;++o)if(t[o]<e)return o-1}else if(o<0){for(o=1;o<i;++o)if(t[o]<=e)return o}else for(o=1;o<i;++o){if(t[o]==e)return o;if(t[o]<e)return t[o-1]-e<e-t[o]?o-1:o}return i-1}function K(t,e){var o=Array.isArray(e)?e:[e],i=o.length;for(e=0;e<i;e++)t[t.length]=o[e]}function W(t,e){-1<(e=t.indexOf(e))&&t.splice(e,1)}function V(t,e){for(var o,i=t.length>>>0,r=0;r<i;r++)if(e(o=t[r],r,t))return o;return null}function X(t,e){var o=t.length;if(o===e.length){for(var i=0;i<o;i++)if(t[i]!==e[i])return;return 1}}function z(t){for(var o=ip,e=t.length,i=Array(t.length),r=0;r<e;r++)i[r]={index:r,value:t[r]};for(i.sort(function(t,e){return o(t.value,e.value)||t.index-e.index}),r=0;r<t.length;r++)t[r]=i[r].value}function H(o,i){var r;return o.every(function(t,e){return!i(t,r=e,o)})?-1:r}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function Z(){}function q(t){return t.Vo||(t.Vo=++J)}var J=0;function Y(t){this.message="Assertion failed. See https://openlayers.org/en/v4.2.0/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"}function _(t,e){if(!t)throw new Y(e)}function $(t,e,o,i){this.ca=t,this.$=e,this.da=o,this.ia=i}function Q(t,e,o){return t.ca<=e&&e<=t.$&&t.da<=o&&o<=t.ia}function tt(t,e){return t.ca<=e.$&&e.ca<=t.$&&t.da<=e.ia&&e.da<=t.ia}function et(t,e,o){return Math.min(Math.max(t,e),o)}e(Y,Error);var ot="cosh"in Math?Math.cosh:function(t){return((t=Math.exp(t))+1/t)/2};function it(t){return t*Math.PI/180}function rt(t,e){return(t%=e)*e<0?t+e:t}function nt(t,e,o){return t+o*(e-t)}function pt(t,e,o){return(o=void 0===o?[0,0]:o)[0]=t[0]+2*e,o[1]=t[1]+2*e,o}function st(t,e,o){return(o=void 0===o?[0,0]:o)[0]=t[0]*e+.5|0,o[1]=t[1]*e+.5|0,o}function at(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}function lt(t){for(var e=gt(),o=0,i=t.length;o<i;++o)Pt(e,t[o]);return e}function ht(t,e,o){return o?(o[0]=t[0]-e,o[1]=t[1]-e,o[2]=t[2]+e,o[3]=t[3]+e,o):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function yt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function ut(t,e){return ft(t,e[0],e[1])}function ct(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ft(t,e,o){return t[0]<=e&&e<=t[2]&&t[1]<=o&&o<=t[3]}function dt(t,e){var o=t[1],i=e[0],r=0;return i<t[0]?r|=16:t[2]<i&&(r|=4),(e=e[1])<o?r|=8:t[3]<e&&(r|=2),r=r||1}function gt(){return[1/0,1/0,-1/0,-1/0]}function vt(t,e,o,i,r){return r?(r[0]=t,r[1]=e,r[2]=o,r[3]=i,r):[t,e,o,i]}function mt(t){return vt(1/0,1/0,-1/0,-1/0,t)}function bt(t,e){var o=t[0];return vt(o,t=t[1],o,t,e)}function xt(t,e,o,i,r){return Mt(r=mt(r),t,e,o,i)}function wt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function St(t,e){return e[0]<t[0]&&(t[0]=e[0]),t[2]<e[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),t[3]<e[3]&&(t[3]=e[3]),t}function Pt(t,e){e[0]<t[0]&&(t[0]=e[0]),t[2]<e[0]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),t[3]<e[1]&&(t[3]=e[1])}function Mt(t,e,o,i,r){for(;o<i;o+=r){var n=t,p=e[o],s=e[o+1];n[0]=Math.min(n[0],p),n[1]=Math.min(n[1],s),n[2]=Math.max(n[2],p),n[3]=Math.max(n[3],s)}return t}function Tt(t){var e=0;return e=Ot(t)?e:It(t)*Lt(t)}function Et(t){return[t[0],t[1]]}function At(t){return[t[2],t[1]]}function Ct(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function jt(t,e,o,i,r){var n=e*i[0]/2,p=(i=e*i[1]/2,e=Math.cos(o),Math.sin(o)),s=(o=n*e,n*=p,e*=i,i*p),a=t[0],l=t[1],s=(t=a-o+s,i=a-o-s,p=a+o-s,o=a+o+s,l-n-e),a=l-n+e,h=l+n+e,n=l+n-e;return vt(Math.min(t,i,p,o),Math.min(s,a,h,n),Math.max(t,i,p,o),Math.max(s,a,h,n),r)}function Lt(t){return t[3]-t[1]}function Rt(t,e,o){return o=o||gt(),kt(t,e)&&(o[0]=(t[0]>e[0]?t:e)[0],o[1]=(e[1]<t[1]?t:e)[1],o[2]=(t[2]<e[2]?t:e)[2],o[3]=(t[3]<e[3]?t:e)[3]),o}function Ft(t){return[t[0],t[3]]}function Nt(t){return[t[2],t[3]]}function It(t){return t[2]-t[0]}function kt(t,e){return t[0]<=e[2]&&e[0]<=t[2]&&t[1]<=e[3]&&e[1]<=t[3]}function Ot(t){return t[2]<t[0]||t[3]<t[1]}function Dt(t,e){var o=(t[2]-t[0])/2*(e-1);e=(t[3]-t[1])/2*(e-1),t[0]-=o,t[2]+=o,t[1]-=e,t[3]+=e}function Ut(t,e,o){e(t=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]],t,2);var i=[t[0],t[2],t[4],t[6]],r=[t[1],t[3],t[5],t[7]];return vt(e=Math.min.apply(null,i),t=Math.min.apply(null,r),Math.max.apply(null,i),Math.max.apply(null,r),o)}var Gt="function"==typeof Object.assign?Object.assign:function(t,e){if(!t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),i=1,r=arguments.length;i<r;++i){var n=arguments[i];if(null!=n)for(var p in n)n.hasOwnProperty(p)&&(o[p]=n[p])}return o};function Bt(t){for(var e in t)delete t[e]}function Kt(t){var e,o=[];for(e in t)o.push(t[e]);return o}function Wt(t){for(var e in t)return!1;return!e}function Vt(t){this.radius=t}Vt.prototype.a=function(t){for(var e=0,o=t.length,i=t[o-1][0],r=t[o-1][1],n=0;n<o;n++)var p=t[n][0],s=t[n][1],e=e+it(p-i)*(2+Math.sin(it(r))+Math.sin(it(s))),i=p,r=s;return e*this.radius*this.radius/2},Vt.prototype.b=function(t,e){var o=it(t[1]),i=it(e[1]),r=(i-o)/2;return t=it(e[0]-t[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(t)*Math.sin(t)*Math.cos(o)*Math.cos(i),2*this.radius*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))},Vt.prototype.offset=function(t,e,o){var i=it(t[1]),r=(e/=this.radius,Math.asin(Math.sin(i)*Math.cos(e)+Math.cos(i)*Math.sin(e)*Math.cos(o)));return[180*(it(t[0])+Math.atan2(Math.sin(o)*Math.sin(e)*Math.cos(i),Math.cos(e)-Math.sin(i)*Math.sin(r)))/Math.PI,180*r/Math.PI]};var Xt=new Vt(6370997),zt={},Ht=(zt.degrees=2*Math.PI*Xt.radius/360,zt.ft=.3048,zt.m=1,zt["us-ft"]=1200/3937,null);function Zt(t){this.mb=t.code,this.a=t.units,this.f=void 0!==t.extent?t.extent:null,this.g=void 0!==t.worldExtent?t.worldExtent:null,this.b=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.c=void 0!==t.global&&t.global,this.i=!(!this.c||!this.f),this.o=t.getPointResolution,this.j=null,this.l=t.metersPerUnit;var e=t.code,o=Ht||window.proj4;"function"==typeof o&&void 0!==(e=o.defs(e))&&(void 0!==e.axis&&void 0===t.axisOrientation&&(this.b=e.axis),void 0===t.metersPerUnit&&(this.l=e.to_meter),void 0===t.units)&&(this.a=e.units)}function qt(t){Zt.call(this,{code:t,units:"m",extent:Yt,global:!0,worldExtent:_t,getPointResolution:function(t,e){return t/ot(e[1]/6378137)}})}Zt.prototype.Jk=function(){return this.mb},e(qt,Zt);var Jt=6378137*Math.PI,Yt=[-Jt,-Jt,Jt,Jt],_t=[-180,-85,180,85],$t="EPSG:3857 EPSG:102100 EPSG:102113 EPSG:900913 urn:ogc:def:crs:EPSG:6.18:3:3857 urn:ogc:def:crs:EPSG::3857 http://www.opengis.net/gml/srs/epsg.xml#3857".split(" ").map(function(t){return new qt(t)});function Qt(t,e,o){var i=t.length;o=1<o?o:2,void 0===e&&(e=2<o?t.slice():Array(i));for(var r=0;r<i;r+=o){e[r]=Jt*t[r]/180;var n=6378137*Math.log(Math.tan(Math.PI*(t[r+1]+90)/360));Jt<n?n=Jt:n<-Jt&&(n=-Jt),e[r+1]=n}return e}function te(t,e,o){var i=t.length;o=1<o?o:2,void 0===e&&(e=2<o?t.slice():Array(i));for(var r=0;r<i;r+=o)e[r]=180*t[r]/Jt,e[r+1]=360*Math.atan(Math.exp(t[r+1]/6378137))/Math.PI-90;return e}var ee=new Vt(6378137);function oe(t,e){Zt.call(this,{code:t,units:"degrees",extent:ie,axisOrientation:e,global:!0,metersPerUnit:re,worldExtent:ie})}e(oe,Zt);var ie=[-180,-90,180,90],re=Math.PI*ee.radius/180,ne=[new oe("CRS:84"),new oe("EPSG:4326","neu"),new oe("urn:ogc:def:crs:EPSG::4326","neu"),new oe("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new oe("urn:ogc:def:crs:OGC:1.3:CRS84"),new oe("urn:ogc:def:crs:OGC:2:84"),new oe("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new oe("urn:x-ogc:def:crs:EPSG:4326","neu")],pe={},se={};function ae(t,e,o){t=t.mb,e=e.mb,t in se||(se[t]={}),se[t][e]=o}function le(t,e){var o;return o=t in se&&e in se[t]?se[t][e]:o}function he(t,e,o){var i=(t=ge(t)).o;return i?e=i(e,o):"degrees"!=t.a&&(e=(i=be(t,ge("EPSG:4326")))(e=[o[0]-e/2,o[1],o[0]+e/2,o[1],o[0],o[1]-e/2,o[0],o[1]+e/2],e,2),e=(Xt.b(e.slice(0,2),e.slice(2,4))+Xt.b(e.slice(4,6),e.slice(6,8)))/2,void 0!==(t=t.sc()))&&(e/=t),e}function ye(t){t.forEach(ue),t.forEach(function(e){t.forEach(function(t){e!==t&&ae(e,t,we)})})}function ue(t){ae(pe[t.mb]=t,t,we)}function ce(t){return t?"string"==typeof t?ge(t):t:ge("EPSG:3857")}function fe(t,e,o,i){ae(t=ge(t),e=ge(e),de(o)),ae(e,t,de(i))}function de(p){return function(t,e,o){var i,r=t.length;for(o=void 0!==o?o:2,e=void 0!==e?e:Array(r),i=0;i<r;i+=o){var n=p([t[i],t[i+1]]);for(e[i]=n[0],e[i+1]=n[1],n=o-1;2<=n;--n)e[i+n]=t[i+n]}return e}}function ge(t){var e,o=null;return t instanceof Zt?o=t:"string"==typeof t&&(o=pe[t]||null,e=Ht||window.proj4,o||"function"!=typeof e||void 0===e.defs(t)||ue(o=new Zt({code:t}))),o}function ve(t,e){var o;return t===e||(o=t.a===e.a,(t.mb===e.mb||be(t,e)===we)&&o)}function me(t,e){return be(t=ge(t),e=ge(e))}function be(t,e){var o,i,r,n=t.mb,p=e.mb,s=le(n,p);return s||"function"==typeof(o=Ht||window.proj4)&&(i=o.defs(n),r=o.defs(p),void 0!==i)&&void 0!==r&&(i===r?ye([e,t]):fe(e,t,(s=o(p,n)).forward,s.inverse),s=le(n,p)),s=s||xe}function xe(t,e){if(void 0!==e&&t!==e){for(var o=0,i=t.length;o<i;++o)e[o]=t[o];t=e}return t}function we(t,e){if(void 0!==e){for(var o=0,i=t.length;o<i;++o)e[o]=t[o];t=e}else t=t.slice();return t}function Se(t,e,o){return me(e,o)(t,void 0,t.length)}function Pe(t,e,o){return Ut(t,e=me(e,o))}function Me(){ye($t),ye(ne),ne.forEach(function(e){$t.forEach(function(t){ae(e,t,Qt),ae(t,e,te)})})}function Te(t,e,o,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=o,i):[t,e,o]}function Ee(t){this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.b=t.resolutions,_((o=this.b,i=function(t,e){return e-t}||U,o.every(function(t,e){return!e||!(0<(t=i(o[e-1],t))||0===t)})),17),this.maxZoom=this.b.length-1,this.i=void 0!==t.origin?t.origin:null,this.c=null,void 0!==t.origins&&(this.c=t.origins,_(this.c.length==this.b.length,20));var o,i,e=t.extent;if(void 0===e||this.i||this.c||(this.i=Ft(e)),_(!this.i&&this.c||this.i&&!this.c,18),this.f=null,void 0!==t.tileSizes&&(this.f=t.tileSizes,_(this.f.length==this.b.length,19)),this.g=void 0!==t.tileSize?t.tileSize:this.f?null:256,_(!this.g&&this.f||this.g&&!this.f,22),this.v=void 0!==e?e:null,this.a=null,this.j=[0,0],void 0!==t.sizes)this.a=t.sizes.map(function(t){return new $(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this);else if(e){for(var r=this,n=e,p=r.b.length,s=Array(p),a=r.minZoom;a<p;++a)s[a]=Re(r,n,a);r.a=s}}Me();var Ae=[0,0,0];function Ce(t,e,o,i,r){for(r=t.Aa(e,r),e=e[0]-1;e>=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]<t.maxZoom?(i=t.Aa(e,i),Re(t,i,e[0]+1,o)):null}function Le(t,e,o,i){Ne(t,e[0],e[1],o,!1,Ae);var r=Ae[1],n=Ae[2];return Ne(t,e[2],e[3],o,!0,Ae),t=Ae[1],e=Ae[2],void 0!==i?(i.ca=r,i.$=t,i.da=n,i.ia=e):i=new $(r,t,n,e),i}function Re(t,e,o,i){return Le(t,e,t.Da(o),i)}function Fe(t,e){var o=t.Pc(e[0]),i=t.Da(e[0]);return t=at(t.gb(e[0]),t.j),[o[0]+(e[1]+.5)*t[0]*i,o[1]+(e[2]+.5)*t[1]*i]}function Ne(t,e,o,i,r,n){var p=t.tc(i),s=i/t.Da(p),a=t.Pc(p);return t=at(t.gb(p),t.j),e=s*Math.floor((e-a[0])/i+(r?.5:0))/t[0],o=s*Math.floor((o-a[1])/i+(r?0:.5))/t[1],o=r?(e=Math.ceil(e)-1,Math.ceil(o)-1):(e=Math.floor(e),Math.floor(o)),Te(p,e,o,n)}function Ie(t){var e={};return Gt(e,t||{}),void 0===e.extent&&(e.extent=ge("EPSG:3857").G()),e.resolutions=ke(e.extent,e.maxZoom,e.tileSize),delete e.maxZoom,new Ee(e)}function ke(t,e,o){e=void 0!==e?e:42;var i=Lt(t);for(t=It(t),o=at(void 0!==o?o:256),o=Math.max(t/o[0],i/o[1]),e+=1,i=Array(e),t=0;t<e;++t)i[t]=o/Math.pow(2,t);return i}function Oe(t,e,o){return e=ke(t=De(t),e,o),new Ee({extent:t,origin:Ft(t),resolutions:e,tileSize:o})}function De(t){var e=(t=ge(t)).G();return e=e?e:vt(-(t=180*zt.degrees/t.sc()),-t,t,t)}function Ue(t){this.b=t.html,this.a=t.tileRanges||null}function Ge(t){return t}function Be(i){return i.mh=function(t){var e=i.listener,o=i.lh||i.target;return i.nh&&Ze(i),e.call(o,t)}}function Ke(t,e,o,i){for(var r,n=0,p=t.length;n<p;++n)if((r=t[n]).listener===e&&r.lh===o)return i&&(r.deleteIndex=n),r}function We(t,e){return(t=t.fb)?t[e]:void 0}function Ve(t){return t.fb||(t.fb={})}function Xe(t,e){var o=We(t,e);if(o){for(var i=0,r=o.length;i<r;++i)t.removeEventListener(e,o[i].mh),Bt(o[i]);o.length=0,(o=t.fb)&&(delete o[e],Object.keys(o).length||delete t.fb)}}function g(t,e,o,i,r){var n=Ve(t),p=n[e];return(n=Ke(p=p||(n[e]=[]),o,i,!1))?r||(n.nh=!1):(t.addEventListener(e,Be(n={lh:i,nh:!!r,listener:o,target:t,type:e})),p.push(n)),n}function ze(t,e,o,i){return g(t,e,o,i,!0)}function He(t,e,o,i){(t=We(t,e))&&(o=Ke(t,o,i,!0))&&Ze(o)}function Ze(t){var e,o;t&&t.target&&(t.target.removeEventListener(t.type,t.mh),(e=We(t.target,t.type))&&(-1!==(o="deleteIndex"in t?t.deleteIndex:e.indexOf(t))&&e.splice(o,1),e.length||Xe(t.target,t.type)),Bt(t))}function qe(t){for(var e in Ve(t))Xe(t,e)}function Je(){}function Ye(t){t.Jb||(t.Jb=!0,t.ka())}function _e(t){this.type=t,this.target=null}function $e(t){t.stopPropagation()}function Qe(){this.Ua={},this.ra={},this.oa={}}function to(t,e){return e?e in t.oa:0<Object.keys(t.oa).length}function eo(){Qe.call(this),this.i=0}function oo(t){eo.call(this),q(this),this.S={},void 0!==t&&this.H(t)}Ee.prototype.Rf=function(t,e,o){for(var i=(t=Re(this,t,e)).ca,r=t.$;i<=r;++i)for(var n=t.da,p=t.ia;n<=p;++n)o([e,i,n])},Je.prototype.Jb=!(Ue.prototype.i=function(){return this.b}),Je.prototype.ka=Z,_e.prototype.preventDefault=_e.prototype.stopPropagation=function(){this.qp=!0},e(Qe,Je),Qe.prototype.addEventListener=function(t,e){var o=this.oa[t];-1===(o=o||(this.oa[t]=[])).indexOf(e)&&o.push(e)},Qe.prototype.b=function(t){var e="string"==typeof t?new _e(t):t,o=(t=e.type,(e.target=this).oa[t]);if(o){t in this.ra||(this.ra[t]=0,this.Ua[t]=0),++this.ra[t];for(var i=0,r=o.length;i<r;++i)if(!1===o[i].call(this,e)||e.qp){var n=!1;break}if(--this.ra[t],!this.ra[t]){for(e=this.Ua[t],delete this.Ua[t];e--;)this.removeEventListener(t,Z);delete this.ra[t]}return n}},Qe.prototype.ka=function(){qe(this)},Qe.prototype.removeEventListener=function(t,e){var o=this.oa[t];o&&(e=o.indexOf(e),t in this.Ua?(o[e]=Z,++this.Ua[t]):(o.splice(e,1),o.length||delete this.oa[t]))},e(eo,Qe),eo.prototype.s=function(){++this.i,this.b("change")},e(oo,eo);var io={};function ro(t){return io.hasOwnProperty(t)?io[t]:io[t]="change:"+t}function no(t,e,o){_e.call(this,t),this.key=e,this.oldValue=o}function y(t,e){if(oo.call(this),this.c=!!(e||{}).unique,this.a=t||[],this.c)for(t=0,e=this.a.length;t<e;++t)so(this,this.a[t],t);po(this)}function po(t){t.set(ao,t.a.length)}function so(t,e,o){for(var i=0,r=t.a.length;i<r;++i)if(t.a[i]===e&&i!==o)throw new Y(58)}oo.prototype.get=function(t){var e;return e=this.S.hasOwnProperty(t)?this.S[t]:e},e(no,_e),e(y,oo),y.prototype.clear=function(){for(;0<this.dc();)this.pop()};var ao="length";function lo(t,e){_e.call(this,t),this.element=e}e(lo,_e);var ho=/^#(?:[0-9a-f]{3}){1,2}$/i,yo=/^([a-z]*)$/i;function uo(t){return Array.isArray(t)?t:vo(t)}function co(t){var e;return t="string"!=typeof t?"rgba("+(e=(e=t[0])!=(0|e)?e+.5|0:e)+","+(e=(e=t[1])!=(0|e)?e+.5|0:e)+","+(e=(e=t[2])!=(0|e)?e+.5|0:e)+","+(void 0===t[3]?1:t[3])+")":t}fo={},go=0;var fo,go,vo=function(t){if(fo.hasOwnProperty(t))var e=fo[t];else{if(1024<=go)for(var o in e=0,fo)3&e++||(delete fo[o],--go);var i,r;yo.exec(e=t)&&((o=document.createElement("div")).style.color=e,document.body.appendChild(o),e=getComputedStyle(o).color,document.body.removeChild(o)),ho.exec(e)?(_(3==(r=e.length-1)||6==r,54),i=3==r?1:2,r=parseInt(e.substr(1+0*i,i),16),o=parseInt(e.substr(1+i,i),16),e=parseInt(e.substr(1+2*i,i),16),1==i&&(r=(r<<4)+r,o=(o<<4)+o,e=(e<<4)+e),r=[r,o,e,1]):e.indexOf("rgba(")?e.indexOf("rgb(")?_(!1,14):((e=e.slice(4,-1).split(",").map(Number)).push(1),r=mo(e)):r=mo(e=e.slice(5,-1).split(",").map(Number)),e=r,fo[t]=e,++go}return e};function mo(t){var e=[];return e[0]=et(t[0]+.5|0,0,255),e[1]=et(t[1]+.5|0,0,255),e[2]=et(t[2]+.5|0,0,255),e[3]=et(t[3],0,1),e}function bo(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient?t:co(t)}function xo(t,e){var o=document.createElement("CANVAS");return t&&(o.width=t),e&&(o.height=e),o.getContext("2d")}function wo(t,e){var o=e.parentNode;o&&o.replaceChild(t,e)}function So(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Po(t){oo.call(this),this.element=t.element||null,this.a=this.R=null,this.v=[],this.render=t.render||Z,t.target&&this.f(t.target)}function Mo(t){t=t||{},this.I=document.createElement("UL"),this.u=document.createElement("LI"),this.I.appendChild(this.u),this.u.style.display="none",this.c=void 0===t.collapsed||t.collapsed,this.o=void 0===t.collapsible||t.collapsible,this.o||(this.c=!1);var e=void 0!==t.className?t.className:"ol-attribution",o=void 0!==t.tipLabel?t.tipLabel:"Attributions",i=void 0!==t.collapseLabel?t.collapseLabel:"»",r=("string"==typeof i?(this.D=document.createElement("span"),this.D.textContent=i):this.D=i,"string"==typeof(i=void 0!==t.label?t.label:"i")?(this.C=document.createElement("span"),this.C.textContent=i):this.C=i,this.o&&!this.c?this.D:this.C);(i=document.createElement("button")).setAttribute("type","button"),i.title=o,i.appendChild(r),g(i,"click",this.Vm,this),(o=document.createElement("div")).className=e+" ol-unselectable ol-control"+(this.c&&this.o?" ol-collapsed":"")+(this.o?"":" ol-uncollapsible"),o.appendChild(this.I),o.appendChild(i),Po.call(this,{element:o,render:t.render||To,target:t.target}),this.B=!0,this.l={},this.j={},this.T={}}function To(t){if(t=t.frameState){var e,o,i,r,n,p,s,a=t.layerStatesArray,l=Gt({},t.attributions),h={},y={},u=t.viewState.projection,c=0;for(s=a.length;c<s;c++)if(o=a[c].layer.ha()){var f=q(o).toString();if(i=o.j)for(var d=0,g=i.length;d<g;d++){var v=i[d],m=q(v).toString();if(!(m in l)){if(e=t.usedTiles[f])t:{var b=void 0,x=v,w=P=o.Ta(u),S=u;if(x.a){for(b in e)if(b in x.a)for(var P=e[b],M=0,T=x.a[b].length;M<T;++M){var E=x.a[b][M];if(tt(E,P)){b=!0;break t}var A=Re(w,De(S),parseInt(b,10)),C=A.$-A.ca+1;if((P.ca<A.ca||P.$>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<o;++e)Ze(this.v[e]);this.v.length=0,(this.a=t)&&((this.R||t.D).appendChild(this.element),this.render!==Z&&this.v.push(g(t,"postrender",this.render,this)),t.render())},Po.prototype.f=function(t){this.R="string"==typeof t?document.getElementById(t):t},e(Mo,Po),Mo.prototype.Vm=function(t){t.preventDefault(),Eo(this)},e(Ro,Po),Ro.prototype.D=function(t){t.preventDefault(),this.o?this.o():(t=this.a.Z())&&void 0!==t.Qa()&&(0<this.l?t.animate({rotation:0,duration:this.l,easing:Co}):t.Oe(0))},e(No,Po),No.prototype.j=function(t,e){var o;e.preventDefault(),(e=this.a.Z())&&(o=e.Pa())&&(t=e.constrainResolution(o,t),0<this.c?(e.Ic()&&e.ed(),e.animate({resolution:t,duration:this.c,easing:Co})):e.Vc(t))},e(ko,Po),ko.prototype.C=function(t){t.preventDefault(),Oo()&&(t=this.a)&&(Do()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(t=this.j?"string"==typeof this.j?document.getElementById(this.j):this.j:t.jd(),this.D?t.mozRequestFullScreenWithKeys?t.mozRequestFullScreenWithKeys():t.webkitRequestFullscreen?t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):Uo(t):Uo(t)))},ko.prototype.u=function(){var t=this.element.firstElementChild,e=this.a;Do()?(t.className=this.c+"-true",wo(this.l,this.o)):(t.className=this.c+"-false",wo(this.o,this.l)),e&&e.Ad()},ko.prototype.setMap=function(t){Po.prototype.setMap.call(this,t),t&&this.v.push(g(document,Bo(),this.u,this))};var Go,Bo=function(){var t;return Go||((t=document.body).webkitRequestFullscreen?Go="webkitfullscreenchange":t.mozRequestFullScreen?Go="mozfullscreenchange":t.msRequestFullscreen?Go="MSFullscreenChange":t.requestFullscreen&&(Go="fullscreenchange")),Go};function Ko(t){t=t||{};var e=document.createElement("DIV");e.className=void 0!==t.className?t.className:"ol-mouse-position",Po.call(this,{element:e,render:t.render||Wo,target:t.target}),g(this,ro(Xo),this.Ym,this),t.coordinateFormat&&this.kj(t.coordinateFormat),t.projection&&this.$h(t.projection),this.u=void 0!==t.undefinedHTML?t.undefinedHTML:"",this.l=e.innerHTML,this.o=this.j=this.c=null}function Wo(t){(t=t.frameState)?this.c!=t.viewState.projection&&(this.c=t.viewState.projection,this.j=null):this.c=null,Vo(this,this.o)}function Vo(t,e){var o,i=t.u;e&&t.c&&(t.j||(o=t.Zh(),t.j=o?be(t.c,o):xe),e=t.a.Wa(e))&&(t.j(e,e),i=(i=t.xh())?i(e):e.toString()),t.l&&i==t.l||(t.element.innerHTML=i,t.l=i)}e(Ko,Po),Ko.prototype.Ym=function(){this.j=null};var Xo="projection";function zo(t,e,o){_e.call(this,t),this.map=e,this.frameState=void 0!==o?o:null}function Ho(t,e,o,i,r){zo.call(this,t,e,r),this.originalEvent=o,this.pixel=e.xe(o),this.coordinate=e.Wa(this.pixel),this.dragging=void 0!==i&&i}e(zo,_e),e(Ho,zo),Ho.prototype.preventDefault=function(){zo.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},Ho.prototype.stopPropagation=function(){zo.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var Zo=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function qo(t,e){for(var o,i=Zo.length,r=0;r<i;++r)try{if(o=t.getContext(Zo[r],e))return o}catch(t){}return null}var ee="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",Jo=-1!==ee.indexOf("firefox"),Yo=-1!==ee.indexOf("safari")&&-1==ee.indexOf("chrom"),_o=-1!==ee.indexOf("webkit")&&-1==ee.indexOf("edge"),$o=-1!==ee.indexOf("macintosh"),Qo=window.devicePixelRatio||1,ti=!1,ei=function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(ti=!0),!0)}catch(t){return!1}}(),ee="DeviceOrientationEvent"in window,oi="geolocation"in navigator,ii="ontouchstart"in window,ri="PointerEvent"in window,ni=!!navigator.msPointerEnabled,pi=!1,si=[];if("WebGLRenderingContext"in window)try{var ai=qo(document.createElement("CANVAS"),{failIfMajorPerformanceCaveat:!0});ai&&(pi=!0,Wu=ai.getParameter(ai.MAX_TEXTURE_SIZE),si=ai.getSupportedExtensions())}catch(t){}var li=pi,hi=si,yi=Wu,ui={Iq:"singleclick",xq:"click",yq:"dblclick",Bq:"pointerdrag",Eq:"pointermove",Aq:"pointerdown",Hq:"pointerup",Gq:"pointerover",Fq:"pointerout",Cq:"pointerenter",Dq:"pointerleave",zq:"pointercancel"};function ci(t,e,o,i,r){Ho.call(this,t,e,o.b,i,r),this.b=o}function fi(t,e){this.b=t,this.f=e}function di(t){fi.call(this,t,{mousedown:this.fm,mousemove:this.gm,mouseup:this.jm,mouseover:this.im,mouseout:this.hm}),this.a=t.i,this.i=[]}function gi(t,e){t=t.i;var o=e.clientX;e=e.clientY;for(var i,r=0,n=t.length;r<n&&(i=t[r]);r++){var p=Math.abs(e-i[1]);if(Math.abs(o-i[0])<=25&&p<=25)return 1}}function vi(t){var e=Ei(t,t),o=e.preventDefault;return e.preventDefault=function(){t.preventDefault(),o()},e.pointerId=1,e.isPrimary=!0,e.pointerType="mouse",e}function mi(t){fi.call(this,t,{MSPointerDown:this.om,MSPointerMove:this.pm,MSPointerUp:this.sm,MSPointerOut:this.qm,MSPointerOver:this.rm,MSPointerCancel:this.nm,MSGotPointerCapture:this.lm,MSLostPointerCapture:this.mm}),this.a=t.i,this.i=["","unavailable","touch","pen","mouse"]}function bi(t,e){var o=e;return"number"==typeof e.pointerType&&((o=Ei(e,e)).pointerType=t.i[e.pointerType]),o}function xi(t){fi.call(this,t,{pointerdown:this.ip,pointermove:this.jp,pointerup:this.mp,pointerout:this.kp,pointerover:this.lp,pointercancel:this.hp,gotpointercapture:this.ul,lostpointercapture:this.em})}function wi(t,e,o){var i;_e.call(this,t),this.b=e,this.buttons=function(t){if(t.buttons||Si)t=t.buttons;else switch(t.which){case 1:t=1;break;case 2:t=4;break;case 3:t=2;break;default:t=0}return t}(t=o||{}),this.pressure=(o=t,i=this.buttons,o.pressure||(i?.5:0)),this.bubbles="bubbles"in t&&t.bubbles,this.cancelable="cancelable"in t&&t.cancelable,this.view="view"in t?t.view:null,this.detail="detail"in t?t.detail:null,this.screenX="screenX"in t?t.screenX:0,this.screenY="screenY"in t?t.screenY:0,this.clientX="clientX"in t?t.clientX:0,this.clientY="clientY"in t?t.clientY:0,this.ctrlKey="ctrlKey"in t&&t.ctrlKey,this.altKey="altKey"in t&&t.altKey,this.shiftKey="shiftKey"in t&&t.shiftKey,this.metaKey="metaKey"in t&&t.metaKey,this.button="button"in t?t.button:0,this.relatedTarget="relatedTarget"in t?t.relatedTarget:null,this.pointerId="pointerId"in t?t.pointerId:0,this.width="width"in t?t.width:0,this.height="height"in t?t.height:0,this.tiltX="tiltX"in t?t.tiltX:0,this.tiltY="tiltY"in t?t.tiltY:0,this.pointerType="pointerType"in t?t.pointerType:"",this.isPrimary="isPrimary"in t&&t.isPrimary,e.preventDefault&&(this.preventDefault=function(){e.preventDefault()})}e(ci,Ho),e(di,fi),di.prototype.fm=function(t){var e;gi(this,t)||(1..toString()in this.a&&this.cancel(t),e=vi(t),this.a[1..toString()]=t,Ai(this.b,"pointerdown",e,t))},e(mi,fi),mi.prototype.om=function(t){this.a[t.pointerId.toString()]=t;var e=bi(this,t);Ai(this.b,"pointerdown",e,t)},e(xi,fi),xi.prototype.ip=function(t){Ci(this.b,t)},e(wi,_e);var Si=!1;try{Si=1===new MouseEvent("click",{buttons:1}).buttons}catch(t){}function Pi(t,e){fi.call(this,t,{touchstart:this.rq,touchmove:this.qq,touchend:this.pq,touchcancel:this.oq}),this.a=t.i,this.j=e,this.i=void 0,this.g=0,this.c=void 0}function Mi(t){Qe.call(this),this.g=t,this.i={},this.f={},this.a=[],ri?Ti(this,new xi(this)):ni?Ti(this,new mi(this)):(Ti(this,t=new di(this)),ii&&Ti(this,new Pi(this,t))),t=this.a.length;for(var e,o,i=0;i<t;i++)e=this.a[i],o=this,Object.keys(e.f).forEach(function(t){g(this.g,t,this.c,this)},o)}function Ti(t,o){var e=Object.keys(o.f);e&&(e.forEach(function(t){var e=o.f[t];e&&(this.f[t]=e.bind(o))},t),t.a.push(o))}function Ei(t,e){for(var o,i={},r=0,n=ji.length;r<n;r++)i[o=ji[r][0]]=t[o]||e[o]||ji[r][1];return i}function Ai(t,e,o,i){t.b(new wi(e,i,o))}function Ci(t,e){t.b(new wi(e.type,e,e))}e(Pi,fi),Pi.prototype.ij=function(){this.g=0,this.c=void 0},e(Mi,Qe),Mi.prototype.c=function(t){var e=this.f[t.type];e&&e(t)},Mi.prototype.out=function(t,e){t.bubbles=!0,Ai(this,"pointerout",t,e)},Mi.prototype.cancel=function(t,e){Ai(this,"pointercancel",t,e)};var ji=[["bubbles",!(Mi.prototype.ka=function(){for(var t,e,o=this.a.length,i=0;i<o;i++)t=this.a[i],e=this,Object.keys(t.f).forEach(function(t){He(this.g,t,this.c,this)},e);Qe.prototype.ka.call(this)})],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];function Li(t,e){Qe.call(this),this.i=t,this.j=0,this.o=!1,this.f=[],this.D=e?e*Qo:Qo,this.c=null,t=this.i.a,this.S=0,this.u={},this.g=new Mi(t),this.a=null,this.l=g(this.g,"pointerdown",this.Ol,this),this.v=g(this.g,"pointermove",this.Lp,this)}function Ri(t,e){"pointerup"==e.type||"pointercancel"==e.type?delete t.u[e.pointerId]:"pointerdown"==e.type&&(t.u[e.pointerId]=!0),t.S=Object.keys(t.u).length}function Fi(t,e){this.l=t,this.c=e,this.b=[],this.i=[],this.a={}}function Ni(t){var e=t.b,o=t.i,i=e[0];return 1==e.length?o.length=e.length=0:(e[0]=e.pop(),o[0]=o.pop(),Ii(t,0)),e=t.c(i),delete t.a[e],i}function Ii(t,e){for(var o=t.b,i=t.i,r=o.length,n=o[e],p=i[e],s=e;e<r>>1;){var a=2*e+1,l=2*e+2,a=l<r&&i[l]<i[a]?l:a;o[e]=o[a],i[e]=i[a],e=a}o[e]=n,i[e]=p,ki(t,s,e)}function ki(t,e,o){for(var i=t.b,r=i[o],n=(t=t.i)[o];e<o;){var p=o-1>>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<n;++p){var s=o[p],a=e(s);1/0==a?delete t.a[t.c(s)]:(i[r]=a,o[r++]=s)}for(o.length=r,i.length=r,e=(t.b.length>>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.j<e&&n<o&&0<t.b.length;)r=(i=Ni(t)[0]).bb(),0!==i.getState()||r in t.g||(t.g[r]=!0,++t.j,++n,i.load())}function Gi(t){if(void 0!==t)return 0}function Bi(t,e){if(void 0!==t)return t+e}function Ki(t,e){return 2<(e=-1===(e=(t=void 0!==e?t.toFixed(e):""+t).indexOf("."))?t.length:e)?t:Array(3-e).join("0")+t}function Wi(t){t=(""+t).split(".");for(var e=["1","3"],o=0;o<Math.max(t.length,e.length);o++){var i=parseInt(t[o]||"0",10),r=parseInt(e[o]||"0",10);if(r<i)return 1;if(i<r)return-1}return 0}function Vi(t,e){return t[0]+=e[0],t[1]+=e[1],t}function Xi(t,e){var o=t[0],i=(t=t[1],e[0]),r=e[1],i=(e=i[0],i[1]),n=r[0],p=n-e,s=(r=r[1])-i;return o=(o=p||s?(p*(o-e)+s*(t-i))/(p*p+s*s||0):0)<=0?(t=e,i):1<=o?(t=n,r):(t=e+o*p,i+o*s),[t,o]}function zi(t,e,o){e=rt(e+180,360)-180;var i=Math.abs(3600*e),r=(o=o||0,Math.pow(10,o)),n=Math.floor(i/3600),p=Math.floor((i-3600*n)/60);return 60<=(i=Math.ceil((i-3600*n-60*p)*r)/r)&&(i=0,p+=1),60<=p&&(p=0,n+=1),n+"° "+Ki(p)+"′ "+Ki(i,o)+"″"+(e?" "+t.charAt(e<0?1:0):"")}function Hi(t,e,o){return t?e.replace("{x}",t[0].toFixed(o)).replace("{y}",t[1].toFixed(o)):""}function Zi(t,e){for(var o=!0,i=t.length-1;0<=i;--i)if(t[i]!=e[i]){o=!1;break}return o}function qi(t,e){var o=Math.cos(e),i=(e=Math.sin(e),t[1]*o+t[0]*e);return t[0]=t[0]*o-t[1]*e,t[1]=i,t}function Ji(t,e){t[0]*=e,t[1]*=e}function Yi(t,e){var o=t[0]-e[0];return o*o+(t=t[1]-e[1])*t}function _i(t,e){return Math.sqrt(Yi(t,e))}function $i(t,e){return Yi(t,Xi(t,e))}function Qi(t,e){return Hi(t,"{x}, {y}",e)}function tr(){return!0}function er(){return!1}function or(){oo.call(this),this.l=gt(),this.v=-1,this.f={},this.o=this.g=0}function ir(t,e,o,i,r,n){for(var p=n||[],s=0;e<o;e+=i){var a=t[e],l=t[e+1];p[s++]=r[0]*a+r[2]*l+r[4],p[s++]=r[1]*a+r[3]*l+r[5]}return n&&p.length!=s&&(p.length=s),p}function rr(t,e,o,i,r,n,p){for(var s,a=p||[],l=0;e<o;e+=i)for(a[l++]=t[e]+r,a[l++]=t[e+1]+n,s=e+2;s<e+i;++s)a[l++]=t[s];return p&&a.length!=l&&(a.length=l),a}function i(){or.call(this),this.ja="XY",this.a=2,this.A=null}function nr(t){var e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function pr(t,e,o){t.a=nr(e),t.ja=e,t.A=o}function sr(t,e,o,i){for(var r=0,n=t[o-i],p=t[o-i+1];e<o;e+=i)var s=t[e],a=t[e+1],r=r+(p*s-n*a),n=s,p=a;return r/2}function ar(t,e,o,i){for(var r=0,n=o.length;r<n;++r)for(var p=o[r],s=0;s<i;++s)t[e++]=p[s];return e}function lr(t,e){i.call(this),this.c=this.j=-1,this.ma(t,e)}function hr(t,e,o){pr(t,e,o),t.s()}function p(t,e){i.call(this),this.ma(t,e)}function yr(t,e,o,i,r,n){for(var p=0,s=t[o-i],a=t[o-i+1];e<o;e+=i){var l=t[e],h=t[e+1];a<=n?n<h&&0<(l-s)*(n-a)-(r-s)*(h-a)&&p++:h<=n&&(l-s)*(n-a)-(r-s)*(h-a)<0&&p--,s=l,a=h}return p}function ur(t,e,o,i,r,n){if(!o.length||!yr(t,e,o[0],i,r,n))return!1;var p;for(e=1,p=o.length;e<p;++e)if(yr(t,o[e-1],o[e],i,r,n))return!1;return!0}function cr(t,e,o,i,r,n,p){for(var s=r[n+1],a=[],l=o[0],h=t[l-i],y=t[l-i+1],u=e;u<l;u+=i){var c=t[u],f=t[u+1];(s<=y&&f<=s||y<=s&&s<=f)&&a.push(h=(s-y)/(f-y)*(c-h)+h),h=c,y=f}for(l=NaN,y=-1/0,a.sort(U),h=a[0],u=1,f=a.length;u<f;++u){var c=a[u],d=Math.abs(c-h);y<d&&ur(t,e,o,i,h=(h+c)/2,s)&&(l=h,y=d),h=c}return isNaN(l)&&(l=r[n]),p?(p.push(l,s),p):[l,s]}function fr(t,e,o,i){for(var r=0,n=t[o-i],p=t[o-i+1];e<o;e+=i)var s=t[e],a=t[e+1],r=r+(s-n)*(a+p),n=s,p=a;return 0<r}function dr(t,e,o,i){for(var r=0,n=(i=void 0!==i&&i,0),p=e.length;n<p;++n){var s=e[n],r=fr(t,r,s,o);if(n){if(i&&!r||!i&&r)return}else if(i&&r||!i&&!r)return;r=s}return 1}function gr(t,e,o,i,r){r=void 0!==r&&r;for(var n=0,p=o.length;n<p;++n){var s=o[n],a=fr(t,e,s,i);if(n?r&&!a||!r&&a:r&&a||!r&&!a)for(var a=t,l=s,h=i;e<l-h;){for(var y=0;y<h;++y){var u=a[e+y];a[e+y]=a[l-h+y],a[l-h+y]=u}e+=h,l-=h}e=s}return e}function vr(t,e,o,i){for(var r=0,n=0,p=e.length;n<p;++n)r=gr(t,r,e[n],o,i);return r}function s(t,e){i.call(this),this.c=[],this.u=-1,this.D=null,this.I=this.C=this.B=-1,this.j=null,this.ma(t,e)}function mr(t){var e;return t.u!=t.i&&(e=Ct(t.G()),t.D=cr(t.ec(),0,t.c,t.a,e,0),t.u=t.i),t.D}function br(t,e,o,i){var r,n=i||32;for(i=[],r=0;r<n;++r)K(i,t.offset(e,o,2*Math.PI*r/n));return i.push(i[0],i[1]),(t=new s(null)).ba("XY",i,[i.length]),t}function xr(t){var e=t[0],o=t[1],i=t[2],e=[e,o,e,t=t[3],i,t,i,o,e,o];return(o=new s(null)).ba("XY",e,[e.length]),o}function wr(t,e,o){for(var i=e||32,r=t.qa(),n=new s(null,e=t.ja),i=r*(i+1),r=Array(i),p=0;p<i;p++)r[p]=0;return n.ba(e,r,[r.length]),Sr(n,t.wa(),t.pd(),o),n}function Sr(t,e,o,i){var r=t.ga(),n=t.ja,p=t.qa(),s=t.Bb(),a=r.length/p-1;i=i||0;for(var l,h,y=0;y<=a;++y)h=y*p,l=i+2*rt(y,a)*Math.PI/a,r[h]=e[0]+o*Math.cos(l),r[1+h]=e[1]+o*Math.sin(l);t.ba(n,r,s)}function l(t){oo.call(this),t=Gt({},t),this.o=[0,0],this.c=[],this.wf=this.wf.bind(this),this.v=ce(t.projection),Pr(this,t)}function Pr(t,e){var o,i,r,n,p,s,a,l,h,y,u,c={},f=(c.center=void 0!==e.center?e.center:null,void 0!==e.minZoom?e.minZoom:0),d=void 0!==e.maxZoom?e.maxZoom:28,g=void 0!==e.zoomFactor?e.zoomFactor:2;d=void 0!==e.resolutions?(o=(d=e.resolutions)[0],i=d[d.length-1],a=d,function(t,e,o){if(void 0!==t)return(t=et((t=B(a,t,o))+e,0,a.length-1))!=(e=Math.floor(t))&&e<a.length-1?a[e]/Math.pow(a[e]/a[e+1],t-e):a[e]}):(r=(l=((i=(o=ce(e.projection)).G())?Math.max(It(i),Lt(i)):360*zt.degrees/o.sc())/256/Math.pow(2,0))/Math.pow(2,28),void 0!==(o=e.maxResolution)?f=0:o=l/Math.pow(g,f),void 0===(i=e.minResolution)&&(i=void 0!==e.maxZoom?void 0!==e.maxResolution?o/Math.pow(g,d):l/Math.pow(g,d):r),d=f+Math.floor(Math.log(o/i)/Math.log(g)),i=o/Math.pow(g,d-f),n=g,p=o,s=d-f,function(t,e,o){if(void 0!==t)return t=Math.max(Math.floor(Math.log(p/t)/Math.log(n)+(-o/2+.5))+e,0),void 0!==s&&(t=Math.min(t,s)),p/Math.pow(n,t)}),t.a=o,t.f=i,t.C=g,t.j=e.resolutions,t.l=f,f=void 0===e.enableRotation||e.enableRotation?void 0===(f=e.constrainRotation)||!0===f?(y=it(5),function(t,e){if(void 0!==t)return Math.abs(t+e)<=y?0:t+e}):!1!==f&&"number"==typeof f?(l=f,h=2*Math.PI/l,function(t,e){if(void 0!==t)return Math.floor((t+e)/h+.5)*h}):Bi:Gi,t.g={center:void 0!==e.extent?(u=e.extent,function(t){if(t)return[et(t[0],u[0],u[2]),et(t[1],u[1],u[3])]}):Ge,resolution:d,rotation:f},void 0!==e.resolution?c.resolution=e.resolution:void 0!==e.zoom&&(c.resolution=t.constrainResolution(t.a,e.zoom-t.l)),c.rotation=void 0!==e.rotation?e.rotation:0,t.H(c),t.D=e}function Mr(t,e,o){var i,r=t.wa();return t=t.Pa(),i=void 0!==r&&void 0!==t?[o[0]-e*(o[0]-r[0])/t,o[1]-e*(o[1]-r[1])/t]:i}function Tr(t,e){return void 0!==e?(e[0]=t.o[0],e[1]=t.o[1],e):t.o.slice()}function Er(t){return t.wa()&&void 0!==t.Pa()}function Ar(t,e,o){t.o[e]+=o,t.s()}function Cr(t,e,o){this.f=t,this.c=e,this.g=o,this.b=[],this.a=this.i=0}function jr(t){t.b.length=0,t.i=0,t.a=0}function Lr(t){oo.call(this),this.v=null,this.Ha(!0),this.handleEvent=t.handleEvent}function Rr(t,e,o,i){var r,n;void 0!==e&&(r=t.Qa(),n=t.wa(),void 0!==r&&n&&0<i?t.animate({rotation:e,anchor:o,duration:i,easing:Co}):t.rotate(e,o))}function Fr(t,e,o,i){var r,n=t.Pa();e=t.constrainResolution(n,e,0),o&&void 0!==e&&e!==n&&(r=t.wa(),o=Mr(t,e,o),o=t.Ec(o),o=[(e*r[0]-n*o[0])/(e-n),(e*r[1]-n*o[1])/(e-n)]),Nr(t,e,o,i)}function Nr(t,e,o,i){var r,n;e&&(r=t.Pa(),n=t.wa(),void 0!==r&&n&&e!==r&&i?t.animate({resolution:e,anchor:o,duration:i,easing:Co}):(o&&(o=Mr(t,e,o),t.ob(o)),t.Vc(e)))}function Ir(t){this.a=(t=t||{}).delta||1,Lr.call(this,{handleEvent:kr}),this.g=void 0!==t.duration?t.duration:250}function kr(t){var e=!1,o=t.originalEvent;return"dblclick"==t.type&&(e=t.coordinate,o=o.shiftKey?-this.a:this.a,Fr(t.map.Z(),o,e,this.g),t.preventDefault(),e=!0),!e}function Or(t){return(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey}function Dr(t){return!((t=t.originalEvent).button||_o&&$o&&t.ctrlKey)}function Ur(t){return"pointermove"==t.type}function Gr(t){return"singleclick"==t.type}function Br(t){return!(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey}function Kr(t){return!(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey}function Wr(t){return"INPUT"!==(t=t.originalEvent.target.tagName)&&"SELECT"!==t&&"TEXTAREA"!==t}function Vr(t){return _(t.b,56),"mouse"==t.b.pointerType}function Xr(t){return(t=t.b).isPrimary&&0===t.button}function zr(t){Lr.call(this,{handleEvent:(t=t||{}).handleEvent||Zr}),this.yf=t.handleDownEvent||er,this.If=t.handleDragEvent||Z,this.Jf=t.handleMoveEvent||Z,this.sk=t.handleUpEvent||er,this.D=!1,this.na={},this.o=[]}function Hr(t){for(var e=t.length,o=0,i=0,r=0;r<e;r++)o+=t[r].clientX,i+=t[r].clientY;return[o/e,i/e]}function Zr(t){var e,o;return!(t instanceof ci&&(e=!1,"pointerdown"!==(o=t.type)&&"pointerdrag"!==o&&"pointerup"!==o||(o=t.b,"pointerup"==t.type?delete this.na[o.pointerId]:("pointerdown"==t.type||o.pointerId in this.na)&&(this.na[o.pointerId]=o),this.o=Kt(this.na)),this.D?"pointerdrag"==t.type?this.If(t):"pointerup"==t.type&&(this.D=this.sk(t)&&0<this.o.length):"pointerdown"==t.type?(this.D=t=this.yf(t),e=this.Xc(t)):"pointermove"==t.type&&this.Jf(t),e))}function qr(t){zr.call(this,{handleDownEvent:_r,handleDragEvent:Jr,handleUpEvent:Yr}),this.a=(t=t||{}).kinetic,this.g=null,this.u=t.condition||Br,this.j=!1}function Jr(t){var e,o,i=this.o,r=Hr(i);i.length==this.l?(this.a&&this.a.b.push(r[0],r[1],Date.now()),this.g&&(Ji(o=[o=this.g[0]-r[0],r[1]-this.g[1]],(e=(t=t.map.Z()).getState()).resolution),qi(o,e.rotation),Vi(o,e.center),o=t.Ec(o),t.ob(o))):this.a&&jr(this.a),this.g=r,this.l=i.length}function Yr(t){var e,o,i,r=t.map;return t=r.Z(),this.o.length?(this.a&&jr(this.a),!(this.g=null)):(!this.j&&this.a&&function(t){if(!(t.b.length<6)){var e=Date.now()-t.g,o=t.b.length-3;if(!(t.b[2+o]<e)){for(var i,r=o-3;0<r&&t.b[r+2]>e;)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.o.length&&this.u(t))&&(e=t.map.Z(),this.g=null,this.D||Ar(e,1,1),Tr(e)[0]&&e.ob(t.frameState.viewState.center),this.a&&jr(this.a),this.j=1<this.o.length,!0)}function $r(t){t=t||{},zr.call(this,{handleDownEvent:en,handleDragEvent:Qr,handleUpEvent:tn}),this.g=t.condition||Or,this.a=void 0,this.j=void 0!==t.duration?t.duration:250}function Qr(t){var e,o,i;Vr(t)&&(e=(o=t.map).Z()).g.rotation!==Gi&&(o=o.Ob(),t=t.pixel,t=Math.atan2(o[1]/2-t[1],t[0]-o[0]/2),void 0!==this.a&&(o=t-this.a,i=e.Qa(),Rr(e,i-o)),this.a=t)}function tn(t){if(!Vr(t))return!0;Ar(t=t.map.Z(),1,-1);var e=t.Qa(),o=this.j,e=t.constrainRotation(e,0);return Rr(t,e,void 0,o),!1}function en(t){return!!(Vr(t)&&Dr(t)&&this.g(t))&&(Ar(t.map.Z(),1,1),!(this.a=void 0))}function on(t){this.Gc=null,this.a=document.createElement("div"),this.a.style.position="absolute",this.a.className="ol-box "+t,this.i=this.c=this.b=null}function rn(t){var e=t.c,o=t.i;(t=t.a.style).left=Math.min(e[0],o[0])+"px",t.top=Math.min(e[1],o[1])+"px",t.width=Math.abs(o[0]-e[0])+"px",t.height=Math.abs(o[1]-e[1])+"px"}function nn(t){var e=t.c,o=t.i;(e=[e,[e[0],o[1]],o,[o[0],e[1]]].map(t.b.Wa,t.b))[4]=e[0].slice(),t.Gc?t.Gc.ma([e]):t.Gc=new s([e])}function pn(t){zr.call(this,{handleDownEvent:hn,handleDragEvent:an,handleUpEvent:ln}),this.a=new on((t=t||{}).className||"ol-dragbox"),this.u=void 0!==t.minArea?t.minArea:64,this.g=null,this.C=t.condition||tr,this.l=t.boxEndCondition||sn}function sn(t,e,o){return(t=o[0]-e[0])*t+(e=o[1]-e[1])*e>=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;1<p&&"function"==typeof arguments[p-1]&&(e=arguments[p-1],--p);for(var s=[],a=0;a<p;++a){var l=arguments[a],h={start:o,complete:!1,anchor:l.anchor,duration:void 0!==l.duration?l.duration:1e3,easing:l.easing||jo};l.center&&(h.Rg=i,h.Tg=l.center,i=h.Tg),void 0!==l.zoom?(h.tf=r,h.zd=this.constrainResolution(this.a,l.zoom-this.l,0),r=h.zd):l.resolution&&(h.tf=r,h.zd=l.resolution,r=h.zd),void 0!==l.rotation&&(h.Sg=n,h.uf=l.rotation,n=h.uf),h.callback=e,o+=h.duration,s.push(h)}this.c.push(s),Ar(this,0,1),this.wf()},e(Lr,oo),Lr.prototype.c=function(){return this.get("active")},Lr.prototype.f=function(){return this.v},Lr.prototype.Ha=function(t){this.set("active",t)},Lr.prototype.setMap=function(t){this.v=t},e(Ir,Lr),e(zr,Lr),zr.prototype.Xc=function(t){return t},e(qr,zr),qr.prototype.Xc=er,e($r,zr),$r.prototype.Xc=er,e(on,Je),on.prototype.ka=function(){this.setMap(null)},on.prototype.setMap=function(t){var e;this.b&&(this.b.C.removeChild(this.a),(e=this.a.style).left=e.top=e.width=e.height="inherit"),(this.b=t)&&this.b.C.appendChild(this.a)},on.prototype.V=function(){return this.Gc},e(pn,zr),pn.prototype.V=function(){return this.a.V()},pn.prototype.j=Z;var yn="boxstart",un="boxdrag",cn="boxend";function fn(t,e,o){_e.call(this,t),this.coordinate=e,this.mapBrowserEvent=o}function dn(t){var e=(t=t||{}).condition||Kr;this.B=void 0!==t.duration?t.duration:200,this.I=void 0!==t.out&&t.out,pn.call(this,{condition:e,className:t.className||"ol-dragzoom"})}function gn(t){Lr.call(this,{handleEvent:vn}),t=t||{},this.a=function(t){return Br(t)&&Wr(t)},this.g=t.condition||this.a,this.j=void 0!==t.duration?t.duration:100,this.o=void 0!==t.pixelDelta?t.pixelDelta:128}function vn(t){var e,o,i,r,n=!1;return"keydown"==t.type&&(e=t.originalEvent.keyCode,!this.g(t)||40!=e&&37!=e&&39!=e&&38!=e||(o=(n=t.map.Z()).Pa()*this.o,r=i=0,40==e?r=-o:37==e?i=-o:39==e?i=o:r=o,qi(o=[i,r],n.Qa()),e=this.j,(i=n.wa())&&(o=n.Ec([i[0]+o[0],i[1]+o[1]]),e?n.animate({duration:e,easing:Lo,center:o}):n.ob(o)),t.preventDefault(),n=!0)),!n}function mn(t){Lr.call(this,{handleEvent:bn}),this.g=(t=t||{}).condition||Wr,this.a=t.delta||1,this.j=void 0!==t.duration?t.duration:100}function bn(t){var e,o=!1;return"keydown"!=t.type&&"keypress"!=t.type||(e=t.originalEvent.charCode,!this.g(t))||43!=e&&45!=e||(o=43==e?this.a:-this.a,Fr(e=t.map.Z(),o,void 0,this.j),t.preventDefault(),o=!0),!o}function xn(t){Lr.call(this,{handleEvent:wn}),t=t||{},this.j=0,this.D=void 0!==t.duration?t.duration:250,this.na=void 0!==t.timeout?t.timeout:80,this.C=void 0===t.useAnchor||t.useAnchor,this.R=t.constrainResolution||!1,this.a=null,this.l=this.o=this.u=this.g=void 0}function wn(t){if("wheel"!==(p=t.type)&&"mousewheel"!==p)return!0;t.preventDefault();var e,o,i,r,n,p=t.map,s=t.originalEvent;return this.C&&(this.a=t.coordinate),"wheel"==t.type?(e=s.deltaY,Jo&&s.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Qo),s.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"==t.type&&(e=-s.wheelDeltaY,Yo)&&(e/=3),0!==e&&(t=Date.now(),void 0===this.g&&(this.g=t),(!this.o||400<t-this.g)&&(this.o=Math.abs(e)<4?Sn:Pn),this.o===Sn?(p=p.Z(),this.l?clearTimeout(this.l):Ar(p,1,1),this.l=setTimeout(this.B.bind(this),400),s=p.Pa()*Math.pow(2,e/300),o=p.f,i=p.a,r=0,s<o?(s=Math.max(s,o/1.5),r=1):i<s&&(s=Math.min(s,1.5*i),r=-1),this.a&&(n=Mr(p,s,this.a),p.ob(p.Ec(n))),p.Vc(s),!r&&this.R&&p.animate({resolution:p.constrainResolution(s,0<e?-1:1),easing:Co,anchor:this.a,duration:this.D}),0<r?p.animate({resolution:o,easing:Co,anchor:this.a,duration:500}):r<0&&p.animate({resolution:i,easing:Co,anchor:this.a,duration:500}),this.g=t):(this.j+=e,e=Math.max(this.na-(t-this.g),0),clearTimeout(this.u),this.u=setTimeout(this.I.bind(this,p),e))),!1}e(fn,_e),e(dn,pn),dn.prototype.j=function(){var t=(r=this.v).Z(),e=r.Ob(),o=this.V().G();if(this.I){for(var i=t.dd(e),o=[r.Ja(Et(o)),r.Ja(Nt(o))],r=mt(void 0),n=0,p=o.length;n<p;++n)Pt(r,o[n]);Dt(i,1/(o=t.ze(r,e))),o=i}e=t.constrainResolution(t.ze(o,e)),i=Ct(o),i=t.Ec(i),t.animate({resolution:e,center:i,duration:this.B,easing:Co})},e(gn,Lr),e(mn,Lr),e(xn,Lr),xn.prototype.B=function(){this.l=void 0,Ar(this.v.Z(),1,-1)},xn.prototype.I=function(t){(t=t.Z()).Ic()&&t.ed(),Fr(t,-et(this.j,-1,1),this.a,this.D),this.o=void 0,this.j=0,this.a=null,this.u=this.g=void 0},xn.prototype.T=function(t){(this.C=t)||(this.a=null)};var Sn="trackpad",Pn="wheel";function Mn(t){zr.call(this,{handleDownEvent:An,handleDragEvent:Tn,handleUpEvent:En}),t=t||{},this.g=null,this.j=void 0,this.a=!1,this.l=0,this.C=void 0!==t.threshold?t.threshold:.3,this.u=void 0!==t.duration?t.duration:250}function Tn(t){var e,o=0,i=this.o[0],r=this.o[1],i=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);void 0!==this.j&&(o=i-this.j,this.l+=o,!this.a)&&Math.abs(this.l)>this.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):o<p&&(e=p/i,o=p),1!=e&&(this.j=e),e=t.a.getBoundingClientRect(),(i=Hr(this.o))[0]-=e.left,i[1]-=e.top,this.g=t.Wa(i),t.render(),Nr(r,o,this.g)}function Ln(t){var e,o,i;return!(this.o.length<2&&(Ar(t=t.map.Z(),1,-1),i=t.Pa(),(this.l||i<t.f||i>t.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&&e<t.maxResolution}function Un(){this.b={},this.a=0}e(o,Nn),o.prototype.Yf=function(t){return(t=t||[]).push(In(this)),t},Un.prototype.clear=function(){this.b={},this.a=0},Un.prototype.get=function(t,e,o){return(t=e+":"+t+":"+(o?co(o):"null"))in this.b?this.b[t]:null},Un.prototype.set=function(t,e,o,i){this.b[e+":"+t+":"+(o?co(o):"null")]=i,++this.a};var Gn=new Un,Bn=Array(6);function Kn(){return[1,0,0,1,0,0]}function Wn(t){return Xn(t,1,0,0,1,0,0)}function Vn(t,e){var o=t[0],i=t[1],r=t[2],n=t[3],p=t[4],s=t[5],a=e[0],l=e[1],h=e[2],y=e[3],u=e[4];return e=e[5],t[0]=o*a+r*l,t[1]=i*a+n*l,t[2]=o*h+r*y,t[3]=i*h+n*y,t[4]=o*u+r*e+p,t[5]=i*u+n*e+s,t}function Xn(t,e,o,i,r,n,p){return t[0]=e,t[1]=o,t[2]=i,t[3]=r,t[4]=n,t[5]=p,t}function zn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Hn(t,e){var o=e[0],i=e[1];return e[0]=t[0]*o+t[2]*i+t[4],e[1]=t[1]*o+t[3]*i+t[5],e}function Zn(t,e){var o=Math.cos(e);e=Math.sin(e),Vn(t,Xn(Bn,o,e,-e,o,0,0))}function qn(t,e,o){return Vn(t,Xn(Bn,e,0,0,o,0,0))}function Jn(t,e,o){Vn(t,Xn(Bn,1,0,0,1,e,o))}function Yn(t,e,o,i,r,n,p,s){var a=Math.sin(n);return n=Math.cos(n),t[0]=i*n,t[1]=r*a,t[2]=-i*a,t[3]=r*n,t[4]=p*i*n-s*i*a+e,t[5]=p*r*a+s*r*n+o,t}function _n(t){var e=t[0]*t[3]-t[1]*t[2],o=(_(!!e,32),t[0]),i=t[1],r=t[2],n=t[3],p=t[4],s=t[5];return t[0]=n/e,t[1]=-i/e,t[2]=-r/e,t[3]=o/e,t[4]=(r*s-n*p)/e,t[5]=-(o*s-i*p)/e,t}function $n(t,e){this.o=e,this.c={},this.v={}}function Qn(t){var e=t.viewState,o=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;Yn(o,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),_n(zn(i,o))}function tp(){if(32<Gn.a){var t,e=0;for(t in Gn.b){var o=Gn.b[t];3&e++||to(o)||(delete Gn.b[t],--Gn.a)}}}function ep(t,e){var o=q(e).toString();return o in t.c?t.c[o]:(e=e.Fd(t),t.c[o]=e,t.v[o]=g(e,"change",t.Fl,t),e)}function op(t,e){for(var o in t.c)if(!(o in e.layerStates)){e.postRenderFunctions.push(t.Rp.bind(t));break}}function ip(t,e){return t.zIndex-e.zIndex}function rp(t,e,o,i,r){_e.call(this,t),this.vectorContext=e,this.frameState=o,this.context=i,this.glContext=r}e($n,Je),$n.prototype.ka=function(){for(var t in this.c)Ye(this.c[t])},e(rp,_e);var np=[0,0,0,1],pp=[],sp=[0,0,0,1];function ap(t,e,o,i){e&&(t.translate(o,i),t.rotate(e),t.translate(-o,-i))}function lp(){}function hp(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=Kn()}function yp(t,e,o,i){var r=0;if(t.ra&&""!==t.Ia){t.g&&up(t,t.g),t.o&&cp(t,t.o);var n=t.ra,p=t.i;for((a=t.Ua)?(a.font!=n.font&&(a.font=p.font=n.font),a.textAlign!=n.textAlign&&(a.textAlign=p.textAlign=n.textAlign),a.textBaseline!=n.textBaseline&&(a.textBaseline=p.textBaseline=n.textBaseline)):(p.font=n.font,p.textAlign=n.textAlign,p.textBaseline=n.textBaseline,t.Ua={font:n.font,textAlign:n.textAlign,textBaseline:n.textBaseline}),e=ir(e,r,o,i,t.S,t.v),n=t.i,p=t.$a,t.Sa&&(p+=t.Yb);r<o;r+=i){var s,a=e[r]+t.Jb,l=e[r+1]+t.va;!p&&1==t.j||(s=Yn(t.xb,a,l,t.j,t.j,p,-a,-l),n.setTransform.apply(n,s)),t.o&&n.strokeText(t.Ia,a,l),t.g&&n.fillText(t.Ia,a,l)}!p&&1==t.j||n.setTransform(1,0,0,1,0,0)}}function up(t,e){var o=t.i,i=t.I;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=o.fillStyle=e.fillStyle):(o.fillStyle=e.fillStyle,t.I={fillStyle:e.fillStyle})}function cp(t,e){var o=t.i,i=t.R;i?(i.lineCap!=e.lineCap&&(i.lineCap=o.lineCap=e.lineCap),ti&&!X(i.lineDash,e.lineDash)&&o.setLineDash(i.lineDash=e.lineDash),i.lineJoin!=e.lineJoin&&(i.lineJoin=o.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=o.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=o.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=o.strokeStyle=e.strokeStyle)):(o.lineCap=e.lineCap,ti&&o.setLineDash(e.lineDash),o.lineJoin=e.lineJoin,o.lineWidth=e.lineWidth,o.miterLimit=e.miterLimit,o.strokeStyle=e.strokeStyle,t.R={lineCap:e.lineCap,lineDash:e.lineDash,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}function fp(t,e){$n.call(this,0,e),this.i=xo(),this.b=this.i.canvas,this.b.style.width="100%",this.b.style.height="100%",this.b.style.display="block",this.b.className="ol-unselectable",t.insertBefore(this.b,t.childNodes[0]||null),this.a=!0,this.f=Kn()}function dp(t,e,o){var i,r,n,p,s,a=t.o,l=t.i;to(a,e)&&(i=o.extent,n=o.viewState.rotation,s=(r=o.pixelRatio)/(p=o.viewState).resolution,t=Yn(t.f,t.b.width/2,t.b.height/2,s,-s,-p.rotation,-p.center[0],-p.center[1]),a.b(new rp(e,new hp(l,r,i,t,n),o,l,null)))}lp.prototype.zb=function(){},e(hp,lp),hp.prototype.Zb=function(t){var e,o,i;kt(this.c,t.G())&&((this.a||this.b)&&(this.a&&up(this,this.a),this.b&&cp(this,this.b),e=this.S,o=this.v,o=(e=(i=t.ga())?ir(i,0,i.length,t.qa(),e,o):null)[2]-e[0],i=e[3]-e[1],o=Math.sqrt(o*o+i*i),(i=this.i).beginPath(),i.arc(e[0],e[1],o,0,2*Math.PI),this.a&&i.fill(),this.b)&&i.stroke(),""!==this.Ia)&&yp(this,t.wa(),2,2)},e(fp,$n),fp.prototype.U=function(){return"canvas"},fp.prototype.Jg=function(t){if(t){for(var e=this.i,o=t.pixelRatio,i=Math.round(t.size[0]*o),r=Math.round(t.size[1]*o),n=(this.b.width!=i||this.b.height!=r?(this.b.width=i,this.b.height=r):e.clearRect(0,0,i,r),o=t.viewState.rotation,Qn(t),dp(this,"precompose",t),t.layerStatesArray),i=(z(n),o&&(e.save(),ap(e,o,i/2,r/2)),t.viewState.resolution),r=0,p=n.length;r<p;++r){var s=n[r],a=ep(this,a=s.layer);Dn(s,i)&&"ready"==s.yj&&a.sd(t,s)&&a.S(t,s,e)}o&&e.restore(),dp(this,"postcompose",t),this.a||(this.b.style.display="",this.a=!0),op(this,t),t.postRenderFunctions.push(tp)}else this.a&&(this.b.style.display="none",this.a=!1)},fp.prototype.Di=function(t,e,o,i,r,n){var p=e.viewState.resolution,s=e.layerStatesArray,a=s.length;for(t=Hn(e.pixelToCoordinateTransform,t.slice()),--a;0<=a;--a){var l=s[a],h=l.layer;if(Dn(l,p)&&r.call(n,h)&&(l=ep(this,h).u(t,e,o,i)))return l}};var gp=["Polygon","Circle","LineString","Image","Text"];function vp(){}function mp(t){this.b=t}function bp(t){this.b=t}function xp(t){this.b=t}function wp(){this.b="precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"}e(bp,mp),bp.prototype.U=function(){return 35632},e(xp,mp),xp.prototype.U=function(){return 35633},e(wp,bp);function Sp(){this.b="varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;if(f==0.0){offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}"}e(Sp,xp);function Pp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mp(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}function Tp(t,e){this.origin=Ct(e),this.xb=Kn(),this.Sa=Kn(),this.$a=Kn(),this.Jb=Pp(),this.b=[],this.o=null,this.i=[],this.f=[],this.a=[],this.l=null,this.g=void 0}e(Tp,lp),Tp.prototype.La=function(t,e,o,i,r,n,p,s,a,l,h){var y,u,c,f,d,g,v,m,b,x=t.b,w=(this.g&&(y=x.isEnabled(x.STENCIL_TEST),u=x.getParameter(x.STENCIL_FUNC),c=x.getParameter(x.STENCIL_VALUE_MASK),f=x.getParameter(x.STENCIL_REF),d=x.getParameter(x.STENCIL_WRITEMASK),g=x.getParameter(x.STENCIL_FAIL),v=x.getParameter(x.STENCIL_PASS_DEPTH_PASS),m=x.getParameter(x.STENCIL_PASS_DEPTH_FAIL),x.enable(x.STENCIL_TEST),x.clear(x.STENCIL_BUFFER_BIT),x.stencilMask(255),x.stencilFunc(x.ALWAYS,1,255),x.stencilOp(x.KEEP,x.KEEP,x.REPLACE),this.g.La(t,e,o,i,r,n,p,s,a,l,h),x.stencilMask(0),x.stencilFunc(x.NOTEQUAL,1,255)),Ip(t,34962,this.l),Ip(t,34963,this.o),n=this.rf(x,t,r,n),Wn(this.xb));return qn(w,2/(o*r[0]),2/(o*r[1])),Zn(w,-i),Jn(w,-(e[0]-this.origin[0]),-(e[1]-this.origin[1])),qn(e=Wn(this.$a),2/r[0],2/r[1]),r=Wn(this.Sa),i&&Zn(r,-i),x.uniformMatrix4fv(n.i,!1,Mp(this.Jb,w)),x.uniformMatrix4fv(n.f,!1,Mp(this.Jb,e)),x.uniformMatrix4fv(n.c,!1,Mp(this.Jb,r)),x.uniform1f(n.a,p),a?b=t=l?this.ve(x,t,s,a,h):(x.clear(x.COLOR_BUFFER_BIT|x.DEPTH_BUFFER_BIT),this.Od(x,t,s,!0),(t=a(null))||void 0):this.Od(x,t,s,!1),this.sf(x,n),this.g&&(y||x.disable(x.STENCIL_TEST),x.clear(x.STENCIL_BUFFER_BIT),x.stencilFunc(u,f,c),x.stencilMask(d),x.stencilOp(g,m,v)),b};function Ep(t,e,o,i,r,n){return(t=(o-t)*(n-e)-(r-t)*(i-e))<=Ap&&-Ap<=t?void 0:0<t}var Ap=Number.EPSILON||2220446049250313e-31;function Cp(t){this.b=void 0!==t?t:[],this.a=jp}var jp=35044;function Lp(t,e){Tp.call(this,0,e),this.v=null,this.j=[],this.u=[],this.S=0,this.c={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,s:!1}}function Rp(){this.b="precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"}e(Lp,Tp),Lp.prototype.Zb=function(t,e){var o=t.pd(),i=t.qa();if(o){this.i.push(this.b.length),this.f.push(e),this.c.s&&(this.u.push(this.b.length),this.c.s=!1),this.S=o,t=rr(t=t.ga(),0,2,i,-this.origin[0],-this.origin[1]),e=this.a.length;for(var o=this.b.length,r=e/4,n=0;n<2;n+=i)this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=0,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=1,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=2,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=3,this.a[e++]=this.S,this.b[o++]=r,this.b[o++]=r+1,this.b[o++]=r+2,this.b[o++]=r+2,this.b[o++]=r+3,this.b[o++]=r,r+=4}else this.c.s&&(this.j.pop(),this.j.length)&&(i=this.j[this.j.length-1],this.c.fillColor=i[0],this.c.strokeColor=i[1],this.c.lineWidth=i[2],this.c.s=!1)},e(Rp,bp);function Fp(){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(Fp,xp);function Np(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=G(hi,"OES_element_index_uint"))&&e.getExtension("OES_element_index_uint"),g(this.j,"webglcontextlost",this.Xo,this),g(this.j,"webglcontextrestored",this.Yo,this)}function Ip(t,e,o){var i,r,n=t.b,p=o.b,s=String(q(o));s in t.a?n.bindBuffer(e,t.a[s].buffer):(i=n.createBuffer(),n.bindBuffer(e,i),34962==e?r=new Float32Array(p):34963==e&&(r=new(t.g?Uint32Array:Uint16Array)(p)),n.bufferData(e,r,o.a),t.a[s]={lc:o,buffer:i})}function kp(t,e){var o=t.b,i=(e=String(q(e)),t.a[e]);o.isContextLost()||o.deleteBuffer(i.buffer),delete t.a[e]}function Op(t){var e,o,i,r;return t.f||(o=(e=t.b).createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,o),i=Bp(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 Dp(t,e){var o,i,r=String(q(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 Up(t,e,o){var i,r,n=q(e)+"/"+q(o);return n in t.i?t.i[n]:(r=(i=t.b).createProgram(),i.attachShader(r,Dp(t,e)),i.attachShader(r,Dp(t,o)),i.linkProgram(r),t.i[n]=r)}function Gp(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 Bp(t,e,o){var i=Gp(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 Kp(t,e){var o=Gp(t,33071,33071);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),o}function Wp(t,e){Tp.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 Vp(t,e,o){var i=e-o;return t[0]===t[i]&&t[1]===t[1+i]&&3<+e/o&&!!sr(t,0,e,o)}function Xp(){this.b="precision mediump float;varying float a;varying vec2 b;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((b.x+1.0)/2.0*o.x*p,(b.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"}e(Np,Je),Np.prototype.ka=function(){qe(this.j);var t=this.b;if(!t.isContextLost()){for(var e in this.a)t.deleteBuffer(this.a[e].buffer);for(e in this.i)t.deleteProgram(this.i[e]);for(e in this.c)t.deleteShader(this.c[e]);t.deleteFramebuffer(this.f),t.deleteRenderbuffer(this.l),t.deleteTexture(this.v)}},e(Wp,Tp),Wp.prototype.Eb=function(o){var i=this.l,r=this.o,n=this.va,p=this.u,s=o.b;return function(){if(!s.isContextLost()){for(var t=0,e=n.length;t<e;++t)s.deleteTexture(n[t]);for(t=0,e=p.length;t<e;++t)s.deleteTexture(p[t])}kp(o,i),kp(o,r)}},e(Xp,bp);function zp(){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(zp,xp);function Hp(t,e){Tp.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 Zp(t,e,o,i){for(var r=t.a.length,n=t.b.length,p="bevel"===t.c.lineJoin?0:"miter"===t.c.lineJoin?1:2,s="butt"===t.c.lineCap?0:"square"===t.c.lineCap?1:2,a=Vp(e,o,i),l=n,h=1,y=0;y<o;y+=i){var u,c=r/7,f=d,d=u||[e[y],e[y+1]];if(y){if(y===o-i){a?u=g:(r=qp(t,f=f||[0,0],d,[0,0],h*Qp*(s||1),r),r=qp(t,f,d,[0,0],-h*Qp*(s||1),r),t.b[n++]=c,t.b[n++]=l-1,t.b[n++]=l,t.b[n++]=l,t.b[n++]=c+1,t.b[n++]=c,s&&(r=qp(t,f,d,[0,0],h*es*s,r),r=qp(t,f,d,[0,0],-h*es*s,r),t.b[n++]=c+2,t.b[n++]=c,t.b[n++]=c+1,t.b[n++]=c+1,t.b[n++]=c+3,t.b[n++]=c+2));break}u=[e[y+i],e[y+i+1]]}else{if(u=[e[y+i],e[y+i+1]],+o==2*i&&X(d,u))break;if(!a){s&&(r=qp(t,[0,0],d,u,h*ts*s,r),r=qp(t,[0,0],d,u,-h*ts*s,r),t.b[n++]=c+2,t.b[n++]=c,t.b[n++]=c+1,t.b[n++]=c+1,t.b[n++]=c+3,t.b[n++]=c+2),r=qp(t,[0,0],d,u,h*$p*(s||1),r),l=(r=qp(t,[0,0],d,u,-h*$p*(s||1),r))/7-1;continue}var f=[e[o-2*i],e[o-2*i+1]],g=u}var v=Ep(f[0],f[1],d[0],d[1],u[0],u[1])?-1:1,r=qp(t,f,d,u,v*os*(p||1),r);r=qp(t,f,d,u,v*is*(p||1),r),r=qp(t,f,d,u,-v*rs*(p||1),r),0<y&&(t.b[n++]=c,t.b[n++]=l-1,t.b[n++]=l,t.b[n++]=c+2,t.b[n++]=c,t.b[n++]=0<h*v?l:l-1),t.b[n++]=c,t.b[n++]=c+2,t.b[n++]=c+1,l=c+2,h=v,p&&(r=qp(t,f,d,u,v*ns*p,r),t.b[n++]=c+1,t.b[n++]=c+3,t.b[n++]=c)}a&&(c=c||r/7,r=qp(t,f,d,u,(v=fr([f[0],f[1],d[0],d[1],u[0],u[1]],0,6,2)?1:-1)*os*(p||1),r),qp(t,f,d,u,-v*rs*(p||1),r),t.b[n++]=c,t.b[n++]=l-1,t.b[n++]=l,t.b[n++]=c+1,t.b[n++]=c,t.b[n++]=0<h*v?l:l-1)}function qp(t,e,o,i,r,n){return t.a[n++]=e[0],t.a[n++]=e[1],t.a[n++]=o[0],t.a[n++]=o[1],t.a[n++]=i[0],t.a[n++]=i[1],t.a[n++]=r,n}function Jp(t,e,o,i){return!((o-=e)<2*i||o===2*i&&X([t[e],t[e+1]],[t[e+i],t[e+i+1]]))}function Yp(t,e,o,i){var r;if(Vp(e,e.length,i)||(e.push(e[0]),e.push(e[1])),Zp(t,e,e.length,i),o.length)for(e=0,r=o.length;e<r;++e)Vp(o[e],o[e].length,i)||(o[e].push(o[e][0]),o[e].push(o[e][1])),Zp(t,o[e],o[e].length,i)}function _p(t,e,o){o=void 0===o?t.b.length:o,t.i.push(o),t.f.push(e),t.c.s&&(t.j.push(o),t.c.s=!1)}e(Hp,Tp),Hp.prototype.mc=function(t,e){var o=t.ga();t=t.qa(),Jp(o,0,o.length,t)&&(o=rr(o,0,o.length,t,-this.origin[0],-this.origin[1]),this.c.s&&(this.j.push(this.b.length),this.c.s=!1),this.i.push(this.b.length),this.f.push(e),Zp(this,o,o.length,t))};var $p=3,Qp=5,ts=7,es=11,os=13,is=17,rs=19,ns=23;function ps(){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(ps,bp);function ss(){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(ss,xp);function as(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 ls(t){this.b=this.a=this.i=void 0,this.f=void 0===t||t,this.c=0}function hs(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 ys(t){if(t.b=t.i,t.b)return t.b.data}function us(t){if(t.b&&t.b.next)return t.b=t.b.next,t.b.data}function cs(t){if(t.b&&t.b.next)return t.b.next.data}function fs(t){if(t.b&&t.b.ub)return t.b=t.b.ub,t.b.data}function ds(t){if(t.b&&t.b.ub)return t.b.ub.data}function gs(t){if(t.b)return t.b.data}as.prototype.clone=function(){var t=this.a;return new as({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})},ls.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 vs,ms={$d:function(){}};function bs(t,e,o){var i=t[e];t[e]=t[o],t[o]=i}function xs(t,e){return t<e?-1:e<t?1:0}function ws(t,e){if(!(this instanceof ws))return new ws(t,e);this.Hf=Math.max(4,t||9),this.fh=Math.max(2,Math.ceil(.4*this.Hf)),e&&this.ek(e),this.clear()}function Ss(t,e){Ps(t,0,t.children.length,e,t)}function Ps(t,e,o,i,r){(r=r||Rs(null)).ca=1/0,r.da=1/0,r.$=-1/0,r.ia=-1/0;for(var n;e<o;e++)n=t.children[e],Ms(r,t.ib?i(n):n);return r}function Ms(t,e){t.ca=Math.min(t.ca,e.ca),t.da=Math.min(t.da,e.da),t.$=Math.max(t.$,e.$),t.ia=Math.max(t.ia,e.ia)}function Ts(t,e){return t.ca-e.ca}function Es(t,e){return t.da-e.da}function As(t){return(t.$-t.ca)*(t.ia-t.da)}function Cs(t){return t.$-t.ca+(t.ia-t.da)}function js(t,e){return t.ca<=e.ca&&t.da<=e.da&&e.$<=t.$&&e.ia<=t.ia}function Ls(t,e){return e.ca<=t.$&&e.da<=t.ia&&t.ca<=e.$&&t.da<=e.ia}function Rs(t){return{children:t,height:1,ib:!0,ca:1/0,da:1/0,$:-1/0,ia:-1/0}}function Fs(t,e,o,i,r){for(var n,p=[e,o];p.length;)(o=p.pop())-(e=p.pop())<=i||(n=e+Math.ceil((o-e)/i/2)*i,vs(t,n,e,o,r),p.push(e,n,n,o))}function Ns(t){this.a=ms.$d(t),this.b={}}function Is(t,e,o){var i=t.b[q(o)];wt([i.ca,i.da,i.$,i.ia],e)||(t.remove(o),t.Ca(e,o))}function ks(t,e){return t.a.search({ca:e[0],da:e[1],$:e[2],ia:e[3]}).map(function(t){return t.value})}function Os(t,e){Tp.call(this,0,e),this.g=new Hp(0,e),this.v=null,this.u=[],this.c=[],this.j={fillColor:null,s:!1}}function Ds(t,e,o,i){var r=new ls,n=new Ns;if(e=Us(t,e,i,r,n,!0),o.length){for(var p=[],s=0,a=o.length;s<a;++s){var l={list:new ls,$:void 0,Mg:new Ns};p.push(l),l.$=Us(t,o[s],i,l.list,l.Mg,!1)}for(p.sort(function(t,e){return e.$[0]===t.$[0]?t.$[1]-e.$[1]:e.$[0]-t.$[0]}),s=0;s<p.length;++s){a=i=ys(o=p[s].list);do{if(Zs(a,n).length){var h=!0;break}}while(i!==(a=us(o)));h||(Gs(o,p[s].Mg,!0),function(t,e,o,i,r){for(var n=ys(t);n.W.x!==e;)n=us(t);e=n.W,i={x:i,y:e.y,hb:-1};var p,s=1/0,a=Zs({aa:e,W:i},r,!0),l=0;for(p=a.length;l<p;++l){var h,y=a[l],u=qs(e,i,y.aa,y.W,!0),c=Math.abs(e.x-u[0]);c<s&&void 0!==Ep(e.x,e.y,y.aa.x,y.aa.y,y.W.x,y.W.y)&&(s=c,h={x:u[0],y:u[1],hb:-1},n=y)}if(1/0===s)return;if(a=n.W,0<s&&(n=Hs(e,h,n.W,r)).length)for(h=1/0,l=0,p=n.length;l<p;++l)s=n[l],((y=Math.atan2(e.y-s.y,i.x-s.x))<h||y===h&&s.x<a.x)&&(h=y,a=s);for(n=ys(o);n.W.x!==a.x||n.W.y!==a.y;)n=us(o);return i={x:e.x,y:e.y,hb:e.hb,Fb:void 0},l={x:n.W.x,y:n.W.y,hb:n.W.hb,Fb:void 0},cs(t).aa=i,Xs(e,n.W,t,r),Xs(l,i,t,r),n.W=l,t.f&&t.b&&(t.i=t.b,t.a=t.b.ub),o.concat(t),1}(o,p[s].$[0],r,e[0],n)&&(n.concat(p[s].Mg),Gs(r,n,!1)))}}else Gs(r,n,!1);!function t(e,o,i){for(var r=!1,n=Ws(o,i);3<o.c;)if(n){if(!Bs(e,o,i,n,r)&&!Gs(o,i,r)&&!Ks(e,o,i,!0))break}else if(!Bs(e,o,i,n,r)&&!Gs(o,i,r)&&!Ks(e,o,i)){if(!(n=Ws(o,i))){n=e,p=s=ys(r=o);do{if((a=Zs(p,i)).length){for(s=a[0],a=qs(p.aa,p.W,s.aa,s.W),a=Vs(n,a[0],a[1],n.a.length/2),l=new ls,h=new Ns,Xs(a,p.W,l,h),p.W=a,Is(i,[Math.min(p.aa.x,a.x),Math.min(p.aa.y,a.y),Math.max(p.aa.x,a.x),Math.max(p.aa.y,a.y)],p),p=us(r);p!==s;)Xs(p.aa,p.W,l,h),i.remove(p),hs(r),p=gs(r);Xs(s.aa,a,l,h),s.aa=a,Is(i,[Math.min(s.W.x,a.x),Math.min(s.W.y,a.y),Math.max(s.W.x,a.x),Math.max(s.W.y,a.y)],s),Gs(r,i,!1),t(n,r,i),Gs(l,h,!1),t(n,l,h);break}}while((p=us(r))!==s);break}for(var p=2*(r=o).c,s=Array(p),a=ys(r),l=a,h=0;s[h++]=l.aa.x,s[h++]=l.aa.y,(l=us(r))!==a;);r=!fr(s,0,p,2),Gs(o,i,r)}3===o.c&&(n=e.b.length,e.b[n++]=ds(o).aa.hb,e.b[n++]=gs(o).aa.hb,e.b[n++]=cs(o).aa.hb)}(t,r,n)}function Us(t,e,o,i,r,n){var p,s=t.a.length/2,a=[],l=[];if(n===fr(e,0,e.length,o))for(var h=p=Vs(t,e[0],e[1],s++),y=(n=e[0],e[1]),u=o,c=e.length;u<c;u+=o){var 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}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<e.c);return y}function Ks(t,e,o,i){var r=ys(e),n=(us(e),r),p=us(e),s=!1;do{var a=qs(n.aa,n.W,p.aa,p.W,i);if(a){var s=t.b.length,l=t.a.length/2,h=fs(e),y=(hs(e),o.remove(h),h===r);if(i?(y=a[0]===n.aa.x&&a[1]===n.aa.y?(fs(e),a=n.aa,p.aa=a,o.remove(n),y||n===r):(a=p.W,n.W=a,o.remove(p),y||p===r),hs(e)):(a=Vs(t,a[0],a[1],l),n.W=a,p.aa=a,Is(o,[Math.min(n.aa.x,n.W.x),Math.min(n.aa.y,n.W.y),Math.max(n.aa.x,n.W.x),Math.max(n.aa.y,n.W.y)],n),Is(o,[Math.min(p.aa.x,p.W.x),Math.min(p.aa.y,p.W.y),Math.max(p.aa.x,p.W.x),Math.max(p.aa.y,p.W.y)],p)),t.b[s++]=h.aa.hb,t.b[s++]=h.W.hb,t.b[s++]=a.hb,s=!0,y)break}}while(n=ds(e),p=us(e),n!==r);return s}function Ws(t,e){var o=ys(t),i=o;do{if(Zs(i,e).length)return!1}while((i=us(t))!==o);return!0}function Vs(t,e,o,i){var r=t.a.length;return{x:t.a[r++]=e,y:t.a[+r]=o,hb:i,Fb:void 0}}function Xs(t,e,o,i){var r,n={aa:t,W:e},p={ub:void 0,next:void 0,data:n},s=o.b;return s?(r=s.next,p.ub=s,p.next=r,s.next=p,r&&(r.ub=p),s===o.a&&(o.a=p)):(o.i=p,o.a=p,o.f&&((p.next=p).ub=p)),o.b=p,o.c++,i&&i.Ca([Math.min(t.x,e.x),Math.min(t.y,e.y),Math.max(t.x,e.x),Math.max(t.y,e.y)],n),n}function zs(t,e,o,i){gs(o)===e&&(hs(o),t.W=e.W,i.remove(e),Is(i,[Math.min(t.aa.x,t.W.x),Math.min(t.aa.y,t.W.y),Math.max(t.aa.x,t.W.x),Math.max(t.aa.y,t.W.y)],t))}function Hs(t,e,o,i,r){var n,p,s=[],a=ks(i,[Math.min(t.x,e.x,o.x),Math.min(t.y,e.y,o.y),Math.max(t.x,e.x,o.x),Math.max(t.y,e.y,o.y)]);for(i=0,n=a.length;i<n;++i)for(p in a[i]){var l=a[i][p];"object"!=typeof l||r&&!l.Fb||l.x===t.x&&l.y===t.y||l.x===e.x&&l.y===e.y||l.x===o.x&&l.y===o.y||-1!==s.indexOf(l)||!yr([t.x,t.y,e.x,e.y,o.x,o.y],0,6,2,l.x,l.y)||s.push(l)}return s}function Zs(t,e,o){for(var i=t.aa,r=t.W,n=[],p=0,s=(e=ks(e,[Math.min(i.x,r.x),Math.min(i.y,r.y),Math.max(i.x,r.x),Math.max(i.y,r.y)])).length;p<s;++p){var a=e[p];t!==a&&(o||a.aa!==r||a.W!==i)&&qs(i,r,a.aa,a.W,o)&&n.push(a)}return n}function qs(t,e,o,i,r){var n=(i.y-o.y)*(e.x-t.x)-(i.x-o.x)*(e.y-t.y);if(n&&(i=((i.x-o.x)*(t.y-o.y)-(i.y-o.y)*(t.x-o.x))/n,o=((e.x-t.x)*(t.y-o.y)-(e.y-t.y)*(t.x-o.x))/n,!r&&Ap<i&&i<1-Ap&&Ap<o&&o<1-Ap||r&&0<=i&&i<=1&&0<=o&&o<=1))return[t.x+i*(e.x-t.x),t.y+i*(e.y-t.y)]}function Js(t,e,o,i,r){var n;return void 0!==e.Fb&&void 0!==i.Fb&&(n=(o.x-i.x)*(e.y-i.y)>(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;c<f;++c)for(var d=t.a[u[c].toString()],g=gp.length-1;0<=g;--g){var v=d[gp[g]];if(void 0!==v&&(v=v.La(e,o,i,r,y,n,p,s,a,l,h)))return v}}ai=ms.$d=ms.$d||{},vs=function t(e,o,i,r,n){for(i=i||0,r=r||e.length-1,n=n||xs;i<r;){var p,s,a,l;for(600<r-i&&(p=r-i+1,s=o-i+1,l=Math.log(p),a=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*a*(p-a)/p)*(s-p/2<0?-1:1),t(e,o,Math.max(i,Math.floor(o-s*a/p+l)),Math.min(r,Math.floor(o+(p-s)*a/p+l)),n)),p=e[o],a=r,bs(e,s=i,o),0<n(e[r],p)&&bs(e,i,r);s<a;){for(bs(e,s,a),s++,a--;n(e[s],p)<0;)s++;for(;0<n(e[a],p);)a--}0===n(e[i],p)?bs(e,i,a):bs(e,++a,r),a<=o&&(i=a+1),o<=a&&(r=a-1)}},ws.prototype={all:function(){return this.$g(this.data,[])},search:function(t){var e=this.data,o=[],i=this.wb;if(Ls(t,e))for(var r,n,p,s,a=[];e;){for(r=0,n=e.children.length;r<n;r++)p=e.children[r],Ls(t,s=e.ib?i(p):p)&&(e.ib?o.push(p):js(t,s)?this.$g(p,o):a.push(p));e=a.pop()}return o},load:function(t){if(t&&t.length)if(t.length<this.fh)for(var e=0,o=t.length;e<o;e++)this.Ca(t[e]);else t=this.bh(t.slice(),0,t.length-1,0),this.data.children.length?this.data.height===t.height?this.hh(this.data,t):(this.data.height<t.height&&(e=this.data,this.data=t,t=e),this.eh(t,this.data.height-t.height-1,!0)):this.data=t;return this},Ca:function(t){return t&&this.eh(t,this.data.height-1),this},clear:function(){return this.data=Rs([]),this},remove:function(t,e){if(t)for(var o,i,r,n=this.data,p=this.wb(t),s=[],a=[];n||s.length;){if(n||(n=s.pop(),i=s[s.length-1],o=a.pop(),r=!0),n.ib){t:{var l=t,h=n.children,y=e;if(y){for(var u=0;u<h.length;u++)if(y(l,h[u])){l=u;break t}l=-1}else l=h.indexOf(l)}if(-1!==l){n.children.splice(l,1),s.push(n),this.ck(s);break}}r||n.ib||!js(n,p)?i?(o++,n=i.children[o],r=!1):n=null:(s.push(n),a.push(o),n=(i=n).children[o=0])}return this},wb:function(t){return t},Lf:Ts,Mf:Es,toJSON:function(){return this.data},$g:function(t,e){for(var o=[];t;)t.ib?e.push.apply(e,t.children):o.push.apply(o,t.children),t=o.pop();return e},bh:function(t,e,o,i){var r,n,p=o-e+1,s=this.Hf;if(p<=s)Ss(r=Rs(t.slice(e,o+1)),this.wb);else{for(i||(i=Math.ceil(Math.log(p)/Math.log(s)),s=Math.ceil(p/Math.pow(s,i-1))),(r=Rs([])).ib=!1,r.height=i,Fs(t,e,o,s=(p=Math.ceil(p/s))*Math.ceil(Math.sqrt(s)),this.Lf);e<=o;e+=s){var a=Math.min(e+s-1,o);for(Fs(t,e,a,p,this.Mf),n=e;n<=a;n+=p){var l=Math.min(n+p-1,a);r.children.push(this.bh(t,n,l,i-1))}}Ss(r,this.wb)}return r},bk:function(t,e,o,i){for(var r,n,p,s,a,l,h,y;i.push(e),!e.ib&&i.length-1!==o;){for(h=y=1/0,r=0,n=e.children.length;r<n;r++)a=As(p=e.children[r]),(l=(Math.max(p.$,t.$)-Math.min(p.ca,t.ca))*(Math.max(p.ia,t.ia)-Math.min(p.da,t.da))-a)<y?(y=l,h=a<h?a:h,s=p):l===y&&a<h&&(h=a,s=p);e=s||e.children[0]}return e},eh:function(t,e,o){var i=this.wb,i=(o=o?t:i(t),[]),r=this.bk(o,this.data,e,i);for(r.children.push(t),Ms(r,o);0<=e&&i[e].children.length>this.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);l<i?(i=l,n=r,p=s<p?s:p):l===i&&s<p&&(p=s,n=r)}return n},$j:function(t,e,o){var i=t.ib?this.Lf:Ts,r=t.ib?this.Mf:Es;this.ah(t,e,o,i)<(e=this.ah(t,e,o,r))&&t.children.sort(i)},ah:function(t,e,o,i){t.children.sort(i);for(var r=Ps(t,0,e,i=this.wb),n=Ps(t,o-e,o,i),p=Cs(r)+Cs(n),s=e;s<o-e;s++){var a=t.children[s];Ms(r,t.ib?i(a):a),p+=Cs(r)}for(s=o-e-1;e<=s;s--)a=t.children[s],Ms(n,t.ib?i(a):a),p+=Cs(n);return p},Zj:function(t,e,o){for(;0<=o;o--)Ms(e[o],t)},ck:function(t){for(var e,o=t.length-1;0<=o;o--)0===t[o].children.length?0<o?(e=t[o-1].children).splice(e.indexOf(t[o]),1):this.clear():Ss(t[o],this.wb)},ek:function(t){var e=["return a"," - b",";"];this.Lf=new Function("a","b",e.join(t[0])),this.Mf=new Function("a","b",e.join(t[1])),this.wb=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},ai.default=ws,ms.$d=ms.$d.default,Ns.prototype.Ca=function(t,e){t={ca:t[0],da:t[1],$:t[2],ia:t[3],value:e},this.a.Ca(t),this.b[q(e)]=t},e(Os,Tp),Os.prototype.pc=function(t,e){for(var o=t.c,i=t.qa(),r=this.b.length,n=this.g.b.length,p=(t=t.ga(),u=0),s=o.length;p<s;++p){var a=o[p];if(0<a.length){var l=rr(t,u,a[0],i,-this.origin[0],-this.origin[1]);if(l.length){for(var h,y=[],u=1,c=a.length;u<c;++u)a[u]!==a[u-1]&&(h=rr(t,a[u-1],a[u],i,-this.origin[0],-this.origin[1]),y.push(h));Yp(this.g,l,y,i),Ds(this,l,y,i)}}u=a[a.length-1]}this.b.length>r&&(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<h;++l)for(var y=this.a[a[l].toString()],u=0,c=gp.length;u<c;++u){var f=y[gp[u]];void 0!==f&&f.La(t,e,o,i,r,n,p,s,void 0,!1)}},_s.prototype.Ea=function(t,e,o,i,r,n,p,s,a,l){var h,y=e.b;return y.bindFramebuffer(y.FRAMEBUFFER,Op(e)),$s(this,e,t,i,r,p,s,a,function(t){var e=new Uint8Array(4);if(y.readPixels(0,0,1,1,y.RGBA,y.UNSIGNED_BYTE,e),0<e[3]&&(t=l(t)))return t},!0,h=void 0!==this.c?ht(bt(t),i*this.c):h)};var Qs=[1,1],ta={Circle:Lp,Image:Wp,LineString:Hp,Polygon:Os,Text:Ys};function ea(t,e,o,i,r,n,p){this.b=t,this.i=e,this.a=n,this.c=p,this.j=r,this.g=i,this.f=o,this.o=this.l=this.v=null}function oa(){this.c=0,this.b={},this.i=this.a=null}function ia(t,e){$n.call(this,0,e),this.b=document.createElement("CANVAS"),this.b.style.width="100%",this.b.style.height="100%",this.b.style.display="block",this.b.className="ol-unselectable",t.insertBefore(this.b,t.childNodes[0]||null),this.S=this.D=0,this.C=xo(),this.l=!0,this.i=qo(this.b,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.f=new Np(this.b,this.i),g(this.b,"webglcontextlost",this.Yn,this),g(this.b,"webglcontextrestored",this.Zn,this),this.a=new oa,this.u=null,this.j=new Fi(function(t){var e=t[1],o=(t=t[2],e[0]-this.u[0]),e=e[1]-this.u[1];return 65536*Math.log(t)+Math.sqrt(o*o+e*e)/t}.bind(this),function(t){return t[0].bb()}),this.B=function(){var t;return this.j.b.length&&(Oi(this.j),ra(this,(t=Ni(this.j))[0],t[3],t[4])),!1}.bind(this),this.g=0,na(this)}function ra(t,e,o,i){var r,n,p,s=t.i,a=e.bb();t.a.b.hasOwnProperty(a)?(t=t.a.get(a),s.bindTexture(3553,t.Ib),9729!=t.Ph&&(s.texParameteri(3553,10240,9729),t.Ph=9729),9729!=t.Rh&&(s.texParameteri(3553,10241,9729),t.Rh=9729)):(r=s.createTexture(),s.bindTexture(3553,r),0<i?(n=t.C.canvas,p=t.C,t.D!==o[0]||t.S!==o[1]?(n.width=o[0],n.height=o[1],t.D=o[0],t.S=o[1]):p.clearRect(0,0,o[0],o[1]),p.drawImage(e.Y(),i,i,o[0],o[1],0,0,o[0],o[1]),s.texImage2D(3553,0,6408,6408,5121,n)):s.texImage2D(3553,0,6408,6408,5121,e.Y()),s.texParameteri(3553,10240,9729),s.texParameteri(3553,10241,9729),s.texParameteri(3553,10242,33071),s.texParameteri(3553,10243,33071),t.a.set(a,{Ib:r,Ph:9729,Rh:9729}))}function na(t){(t=t.i).activeTexture(33984),t.blendFuncSeparate(770,771,1,771),t.disable(2884),t.disable(2929),t.disable(3089),t.disable(2960)}e(ea,lp),ea.prototype.rd=function(t){this.Ma(t.Fa(),t.Ga()),this.Ub(t.Y())},oa.prototype.clear=function(){this.c=0,this.b={},this.i=this.a=null},e(ia,$n),ia.prototype.ka=function(){var e=this.i;e.isContextLost()||this.a.forEach(function(t){t&&e.deleteTexture(t.Ib)}),Ye(this.f),$n.prototype.ka.call(this)};var pa=["canvas","webgl"];function u(t){oo.call(this);var e=function(t){var e=null,o=(void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget),{}),i={};void 0===t.logo||"boolean"==typeof t.logo&&t.logo?i["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC"]="https://openlayers.org/":"string"==typeof(p=t.logo)?i[p]="":p instanceof HTMLElement?i[q(p).toString()]=p:p&&(_("string"==typeof p.href,44),_("string"==typeof p.src,45),i[p.src]=p.href);p=t.layers instanceof kn?t.layers:new kn({layers:t.layers}),o.layergroup=p,o.target=t.target,o.view=void 0!==t.view?t.view:new l;var r,n,p=$n,s=(void 0!==t.renderer?(Array.isArray(t.renderer)?r=t.renderer:"string"==typeof t.renderer?r=[t.renderer]:_(!1,46),0<=r.indexOf("dom")&&(r=r.concat(pa))):r=pa,0);for(n=r.length;s<n;++s){var a=r[s];if("canvas"==a){if(ei){p=fp;break}}else if("webgl"==a&&li){p=ia;break}}return r=void 0!==t.controls?Array.isArray(t.controls)?new y(t.controls.slice()):(_(t.controls instanceof y,47),t.controls):Io(),s=void 0!==t.interactions?Array.isArray(t.interactions)?new y(t.interactions.slice()):(_(t.interactions instanceof y,48),t.interactions):Fn(),t=void 0!==t.overlays?Array.isArray(t.overlays)?new y(t.overlays.slice()):(_(t.overlays instanceof y,49),t.overlays):new y,{controls:r,interactions:s,keyboardEventTarget:e,logos:i,overlays:t,Up:p,values:o}}(t);this.Cf=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.Df=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.If=void 0!==t.pixelRatio?t.pixelRatio:Qo,this.yf=e.logos,this.pa=function(){this.j=void 0,this.Sp.call(this,Date.now())}.bind(this),this.Yb=Kn(),this.Jf=Kn(),this.ad=0,this.I=this.R=this.T=this.g=this.c=null,this.a=document.createElement("DIV"),this.a.className="ol-viewport"+(ii?" ol-touch":""),this.a.style.position="relative",this.a.style.overflow="hidden",this.a.style.width="100%",this.a.style.height="100%",this.a.style.msTouchAction="none",this.a.style.touchAction="none",this.C=document.createElement("DIV"),this.C.className="ol-overlaycontainer",this.a.appendChild(this.C),this.D=document.createElement("DIV"),this.D.className="ol-overlaycontainer-stopevent";for(var o,i="click dblclick mousedown touchstart MSPointerDown pointerdown mousewheel wheel".split(" "),r=0,n=i.length;r<n;++r)g(this.D,i[r],$e);for(o in this.a.appendChild(this.D),this.Sa=new Li(this,t.moveTolerance),ui)g(this.Sa,ui[o],this.Ih,this);this.va=e.keyboardEventTarget,this.u=null,g(this.a,"wheel",this.ld,this),g(this.a,"mousewheel",this.ld,this),this.l=e.controls,this.o=e.interactions,this.v=e.overlays,this.rg={},this.B=new e.Up(this.a,this),this.na=null,this.xb=[],this.$a=new Di(this.ql.bind(this),this.Wl.bind(this)),this.fa={},g(this,ro("layergroup"),this.El,this),g(this,ro("view"),this.Xl,this),g(this,ro("size"),this.Tl,this),g(this,ro("target"),this.Vl,this),this.H(e.values),this.l.forEach(function(t){t.setMap(this)},this),g(this.l,"add",function(t){t.element.setMap(this)},this),g(this.l,"remove",function(t){t.element.setMap(null)},this),this.o.forEach(function(t){t.setMap(this)},this),g(this.o,"add",function(t){t.element.setMap(this)},this),g(this.o,"remove",function(t){t.element.setMap(null)},this),this.v.forEach(this.kh,this),g(this.v,"add",function(t){this.kh(t.element)},this),g(this.v,"remove",function(t){var e=t.element.g;void 0!==e&&delete this.rg[e.toString()],t.element.setMap(null)},this)}function sa(t){oo.call(this),this.g=t.id,this.l=void 0===t.insertFirst||t.insertFirst,this.v=void 0===t.stopEvent||t.stopEvent,this.c=document.createElement("DIV"),this.c.className="ol-overlay-container ol-selectable",this.c.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.j=t.autoPanAnimation||{},this.o=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.a={re:"",Ie:"",nf:"",vf:"",visible:!0},this.f=null,g(this,ro(aa),this.zl,this),g(this,ro(la),this.Jl,this),g(this,ro(ha),this.Nl,this),g(this,ro(ya),this.Pl,this),g(this,ro(ua),this.Ql,this),void 0!==t.element&&this.lj(t.element),this.rj(void 0!==t.offset?t.offset:[0,0]),this.uj(void 0!==t.positioning?t.positioning:"top-left"),void 0!==t.position&&this.Ne(t.position)}e(u,oo),u.prototype.kk=function(t){this.l.push(t)},e(sa,oo),sa.prototype.Rd=function(){return this.get(aa)};var aa="element",la="map",ha="offset",ya="position",ua="positioning";function ca(t){function e(t){t=s.Tf(t),a.a.Z().ob(t),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",e)}function o(t){t=s.Tf({clientX:t.clientX-h.offsetWidth/2,clientY:t.clientY+h.offsetHeight/2}),l.Ne(t)}this.j=void 0===(t=t||{}).collapsed||t.collapsed,this.o=void 0===t.collapsible||t.collapsible,this.o||(this.j=!1);var i=void 0!==t.className?t.className:"ol-overviewmap",r=void 0!==t.tipLabel?t.tipLabel:"Overview map",n=void 0!==t.collapseLabel?t.collapseLabel:"«",p=("string"==typeof n?(this.u=document.createElement("span"),this.u.textContent=n):this.u=n,"string"==typeof(n=void 0!==t.label?t.label:"»")?(this.D=document.createElement("span"),this.D.textContent=n):this.D=n,this.o&&!this.j?this.u:this.D),s=((n=document.createElement("button")).setAttribute("type","button"),n.title=r,n.appendChild(p),g(n,"click",this.an,this),this.C=document.createElement("DIV"),this.C.className="ol-overviewmap-map",this.c=new u({controls:new y,interactions:new y,view:t.view})),a=(t.layers&&t.layers.forEach(function(t){s.ih(t)},this),(r=document.createElement("DIV")).className="ol-overviewmap-box",r.style.boxSizing="border-box",this.l=new sa({position:[0,0],positioning:"bottom-left",element:r}),this.c.jh(this.l),(r=document.createElement("div")).className=i+" ol-unselectable ol-control"+(this.j&&this.o?" ol-collapsed":"")+(this.o?"":" ol-uncollapsible"),r.appendChild(this.C),r.appendChild(n),Po.call(this,{element:r,render:t.render||fa,target:t.target}),this),l=this.l,h=this.l.Rd();h.addEventListener("mousedown",function(){window.addEventListener("mousemove",o),window.addEventListener("mouseup",e)})}function fa(){var t,e,o,i,r=this.a,n=this.c;r.c&&n.c&&(t=r.Ob(),r=r.Z().dd(t),i=n.Ob(),t=n.Z().dd(i),e=n.Ja(Ft(r)),o=n.Ja(At(r)),n=Math.abs(e[0]-o[0]),e=Math.abs(e[1]-o[1]),o=i[0],i=i[1],n<.1*o||e<.1*i||.75*o<n||.75*i<e?da(this):ct(t,r)||(r=this.c,t=this.a.Z(),r.Z().ob(t.wa()))),ga(this)}function da(t){var e=t.a,o=(t=t.c,e.Ob()),e=e.Z().dd(o);t=t.Z(),Dt(e,1/(.1*Math.pow(2,Math.log(7.5)/Math.LN2/2))),t.Qf(e)}function ga(t){var e,o,i,r,n,p,s=t.a,a=t.c;s.c&&a.c&&(i=s.Ob(),r=s.Z(),n=a.Z(),a=r.Qa(),s=t.l,e=t.l.Rd(),o=r.dd(i),i=n.Pa(),r=Et(o),n=Nt(o),(t=t.a.Z().wa())&&(qi(p=[r[0]-t[0],r[1]-t[1]],a),Vi(p,t)),s.Ne(p),e)&&(e.style.width=Math.abs((r[0]-n[0])/i)+"px",e.style.height=Math.abs((n[1]-r[1])/i)+"px")}function va(t){var e=void 0!==(t=t||{}).className?t.className:"ol-scale-line";this.o=document.createElement("DIV"),this.o.className=e+"-inner",this.c=document.createElement("DIV"),this.c.className=e+" ol-unselectable",this.c.appendChild(this.o),this.u=null,this.l=void 0!==t.minWidth?t.minWidth:64,this.j=!1,this.B=void 0,this.D="",Po.call(this,{element:this.c,render:t.render||ba,target:t.target}),g(this,ro(wa),this.T,this),this.I(t.units||"metric")}e(ca,Po),ca.prototype.setMap=function(t){var e=this.a;t!==e&&(e&&((e=e.Z())&&He(e,ro("rotation"),this.Ge,this),this.c.Le(null)),Po.prototype.setMap.call(this,t),t)&&(this.c.Le(this.C),this.v.push(g(t,"propertychange",this.Kl,this)),this.c.Xh().dc()||this.c.qj(t.Kc()),t=t.Z())&&(g(t,ro("rotation"),this.Ge,this),Er(t)&&(this.c.Ad(),da(this)))},e(va,Po);var ma=[1,2,5];function ba(t){(t=t.frameState)?this.u=t.viewState:this.u=null,xa(this)}function xa(t){if(o=t.u){var e=(i=o.projection).sc(),o=he(i,o.resolution,o.center)*e,e=t.l*o,i="";"degrees"==(n=t.C())?(o/=i=zt.degrees,e<i/60?(i="″",o*=3600):e<i?(i="′",o*=60):i="°"):"imperial"==n?e<.9144?(i="in",o/=.0254):e<1609.344?(i="ft",o/=.3048):(i="mi",o/=1609.344):"nautical"==n?(o/=1852,i="nm"):"metric"==n?e<.001?(i="μm",o*=1e6):e<1?(i="mm",o*=1e3):e<1e3?i="m":(i="km",o/=1e3):"us"==n?e<.9144?(i="in",o*=39.37):e<1609.344?(i="ft",o/=.30480061):(i="mi",o/=1609.3472):_(!1,33);for(var r,n=3*Math.floor(Math.log(t.l*o)/Math.log(10));;){if(r=ma[(n%3+3)%3]*Math.pow(10,Math.floor(n/3)),e=Math.round(r/o),isNaN(e))return t.c.style.display="none",void(t.j=!1);if(e>=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<e?(this.j=1,this.D=e-r):(this.j=Pa,this.l=o-n),this.na=!0),(t=t.frameState.viewState.resolution)!==this.c)&&(this.c=t,Ta(this,t))}function Ta(t,e){e=1-(r=t.a.Z(),o=r.a,i=Math.log(o/r.f)/Math.log(2),function(t){return Math.log(o/t)/Math.log(2)/i}(e));var o,i,r=t.element.firstElementChild;1==t.j?r.style.left=t.D*e+"px":r.style.top=t.l*e+"px"}function Ea(t){this.c=(t=t||{}).extent||null;var e=void 0!==t.className?t.className:"ol-zoom-extent",o=void 0!==t.label?t.label:"E",i=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",r=document.createElement("button");r.setAttribute("type","button"),r.title=i,r.appendChild("string"==typeof o?document.createTextNode(o):o),g(r,"click",this.j,this),(o=document.createElement("div")).className=e+" ol-unselectable ol-control",o.appendChild(r),Po.call(this,{element:o,target:t.target})}function Aa(t){oo.call(this),t=t||{},this.a=null,g(this,ro(Ca),this.vm,this),this.gg(void 0!==t.tracking&&t.tracking)}Sa.prototype.setMap=function(t){Po.prototype.setMap.call(this,t),t&&t.render()},e(Ea,Po),Ea.prototype.j=function(t){t.preventDefault(),t=this.a.Z();var e=this.c||t.v.G();t.Qf(e)},e(Aa,oo),Aa.prototype.ka=function(){this.gg(!1),oo.prototype.ka.call(this)};var Ca="tracking";function ja(t){this.f=t.opacity,this.l=t.rotateWithView,this.g=t.rotation,this.a=t.scale,this.v=t.snapToPixel}function La(t){this.D=this.u=this.c=null,this.Va=void 0!==t.fill?t.fill:null,this.oa=[0,0],this.o=t.points,this.b=void 0!==t.radius?t.radius:t.radius1,this.i=t.radius2,this.j=void 0!==t.angle?t.angle:0,this.Ya=void 0!==t.stroke?t.stroke:null,this.B=this.ra=this.C=null,this.S=t.atlasManager,Ra(this,this.S),ja.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})}function Ra(t,e){var o,i,r="",n="",p=0,s=null,a=0,l=(t.Ya&&(o=bo(o=null===(o=t.Ya.a)?sp:o),void 0===(a=t.Ya.c)&&(a=1),s=t.Ya.i,ti||(s=null),void 0===(n=t.Ya.j)&&(n="round"),void 0===(r=t.Ya.f)&&(r="round"),void 0===(p=t.Ya.o))&&(p=10),2*(t.b+a)+1),r={strokeStyle:o,zj:a,size:l,lineCap:r,lineDash:s,lineJoin:n,miterLimit:p};void 0===e?(i=xo(l,l),t.u=i.canvas,e=l=t.u.width,t.rh(r,i,0,0),t.Va?t.D=t.u:(i=xo(r.size,r.size),t.D=i.canvas,t.qh(r,i,0,0))):(l=Math.round(l),(n=!t.Va)&&(i=t.qh.bind(t,r)),p=t.Ya?(void 0===(p=t.Ya).b&&(p.b="s",p.b=p.a?"string"==typeof p.a?p.b+p.a:p.b+q(p.a).toString():p.b+"-",p.b+=","+(void 0!==p.f?p.f.toString():"-")+","+(p.i?p.i.toString():"-")+","+(void 0!==p.g?p.g:"-")+","+(void 0!==p.j?p.j:"-")+","+(void 0!==p.o?p.o.toString():"-")+","+(void 0!==p.c?p.c.toString():"-")),p.b):"-",s=t.Va?(void 0===(s=t.Va).a&&(s.a=s.b instanceof CanvasPattern||s.b instanceof CanvasGradient?q(s.b).toString():"f"+(s.b?co(s.b):"-")),s.a):"-",t.c&&p==t.c[1]&&s==t.c[2]&&t.b==t.c[3]&&t.i==t.c[4]&&t.j==t.c[5]&&t.o==t.c[6]||(t.c=["r"+p+s+(void 0!==t.b?t.b.toString():"-")+(void 0!==t.i?t.i.toString():"-")+(void 0!==t.j?t.j.toString():"-")+(void 0!==t.o?t.o.toString():"-"),p,s,t.b,t.i,t.j,t.o]),i=e.add(t.c[0],l,l,t.rh.bind(t,r),i),t.u=i.image,t.oa=[i.offsetX,i.offsetY],e=i.image.width,t.D=n?i.Zl:t.u),t.C=[l/2,l/2],t.ra=[l,l],t.B=[e,e]}function Fa(t){La.call(this,{points:1/0,fill:(t=t||{}).fill,radius:t.radius,snapToPixel:t.snapToPixel,stroke:t.stroke,atlasManager:t.atlasManager})}function Na(t){this.b=void 0!==(t=t||{}).color?t.color:null,this.a=void 0}function Ia(t){t=t||{},this.Gc=null,this.Za=Ga,void 0!==t.geometry&&this.Ra(t.geometry),this.Va=void 0!==t.fill?t.fill:null,this.M=void 0!==t.image?t.image:null,this.Ya=void 0!==t.stroke?t.stroke:null,this.Ia=void 0!==t.text?t.text:null,this.Fj=t.zIndex}function ka(t){var e;return"function"!=typeof t&&(e=Array.isArray(t)?t:(_(t instanceof Ia,41),[t]),t=function(){return e}),t}ja.prototype.Ze=function(){return this.f},e(La,ja),La.prototype.clone=function(){var t=new La({fill:this.Fa()?this.Fa().clone():void 0,points:this.o,radius:this.b,radius2:this.i,angle:this.j,snapToPixel:this.v,stroke:this.Ga()?this.Ga().clone():void 0,rotation:this.g,rotateWithView:this.l,atlasManager:this.S});return t.td(this.f),t.ud(this.a),t},e(Fa,La),Fa.prototype.clone=function(){var t=new Fa({fill:this.Fa()?this.Fa().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,radius:this.b,snapToPixel:this.v,atlasManager:this.S});return t.td(this.f),t.ud(this.a),t},Fa.prototype.Uc=function(t){this.b=t,Ra(this,this.S)},Na.prototype.clone=function(){var t=this.b;return new Na({color:t&&t.slice?t.slice():t||void 0})},Na.prototype.i=function(){return this.b},Na.prototype.c=function(t){this.b=t,this.a=void 0},Ia.prototype.clone=function(){var t=this.V();return new Ia({geometry:t=t&&t.clone?t.clone():t,fill:this.Fa()?this.Fa().clone():void 0,image:this.Y()?this.Y().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,text:this.Na()?this.Na().clone():void 0,zIndex:this.Ba()})};var Oa=null;function Da(){var t,e;return Oa||(t=new Na({color:"rgba(255,255,255,0.4)"}),e=new as({color:"#3399CC",width:1.25}),Oa=[new Ia({image:new Fa({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]),Oa}function Ua(){var t={},e=[255,255,255,1],o=[0,153,255,1];return t.Polygon=[new Ia({fill:new Na({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Ia({stroke:new as({color:e,width:5})}),new Ia({stroke:new as({color:o,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Ia({image:new Fa({radius:6,fill:new Na({color:o}),stroke:new as({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function Ga(t){return t.V()}function v(t){oo.call(this),this.a=void 0,this.c="geometry",this.g=null,this.j=void 0,this.f=null,g(this,ro(this.c),this.Ee,this),void 0!==t&&(t instanceof or||!t?this.Ra(t):this.H(t))}e(v,oo),v.prototype.clone=function(){var t=new v(this.N()),e=(t.Tc(this.c),this.V());return e&&t.Ra(e.clone()),(e=this.g)&&t.hg(e),t};var Ba=document.implementation.createDocument("","",null);function Ka(t,e){return Ba.createElementNS(t,e)}function Wa(t,e){return function t(e,o,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)o?i.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(e.nodeValue);else for(e=e.firstChild;e;e=e.nextSibling)t(e,o,i);return i}(t,e,[]).join("")}function Va(t){return t instanceof Document}function Xa(t){return t instanceof Node}function za(t){return(new DOMParser).parseFromString(t,"application/xml")}function Ha(o,i){return function(t,e){void 0!==(t=o.call(i,t,e))&&K(e[e.length-1],t)}}function Za(o,i){return function(t,e){void 0!==(t=o.call(void 0!==i?i:this,t,e))&&e[e.length-1].push(t)}}function qa(o,i){return function(t,e){void 0!==(t=o.call(void 0!==i?i:this,t,e))&&(e[e.length-1]=t)}}function Ja(i){return function(t,e){var o=i.call(this,t,e);void 0!==o&&(e=e[e.length-1],((t=t.localName)in e?e[t]:e[t]=[]).push(o))}}function r(i,r){return function(t,e){var o=i.call(this,t,e);void 0!==o&&(e[e.length-1][void 0!==r?r:t.localName]=o)}}function c(i,r){return function(t,e,o){i.call(void 0!==r?r:this,t,e,o),o[o.length-1].node.appendChild(t)}}function Ya(r){var n,p;return function(t,e,o){var i;n||(n={},(i={})[t.localName]=r,n[t.namespaceURI]=i,p=_a(t.localName)),el(n,p,e,o)}}function _a(i,r){return function(t,e,o){return t=e[e.length-1].node,void 0===(e=i)&&(e=o),Ka(o=void 0===(o=r)?t.namespaceURI:r,e)}}var $a=_a();function Qa(t,e){for(var o=e.length,i=Array(o),r=0;r<o;++r)i[r]=t[e[r]];return i}function h(t,e,o){o=void 0!==o?o:{};for(var i=0,r=t.length;i<r;++i)o[t[i]]=e;return o}function tl(t,e,o,i){for(e=e.firstElementChild;e;e=e.nextElementSibling){var r=t[e.namespaceURI];void 0!==r&&(r=r[e.localName])&&r.call(i,e,o)}}function d(t,e,o,i,r){return i.push(t),tl(e,o,i,r),i.pop()}function el(t,e,o,i,r,n){for(var p,s,a=(void 0!==r?r:o).length,l=0;l<a;++l)void 0!==(p=o[l])&&void 0!==(s=e.call(n,p,i,void 0!==r?r[l]:void 0))&&t[s.namespaceURI][s.localName].call(n,s,p,i)}function ol(t,e,o,i,r,n,p){r.push(t),el(e,o,i,r,n,p),r.pop()}function il(r,n,p,s){return function(t,e,o){var i=new XMLHttpRequest;i.open("GET","function"==typeof r?r(t,e,o):r,!0),"arraybuffer"==n.U()&&(i.responseType="arraybuffer"),i.onload=function(){var t,e;(!i.status||200<=i.status&&i.status<300)&&("json"==(t=n.U())||"text"==t?e=i.responseText:"xml"==t?e=(e=i.responseXML)||za(i.responseText):"arraybuffer"==t&&(e=i.response),e)?p.call(this,n.Oa(e,{featureProjection:o}),n.kb(e)):s.call(this)}.bind(this),i.onerror=function(){s.call(this)}.bind(this),i.send()}}function rl(t,e){return il(t,e,function(t){this.cd(t)},Z)}function nl(){this.f=this.defaultDataProjection=null}function pl(t,e,o){var i;return o&&(i={dataProjection:o.dataProjection||t.kb(e),featureProjection:o.featureProjection}),sl(t,i)}function sl(t,e){return Gt({dataProjection:t.defaultDataProjection,featureProjection:t.f},e)}function al(t,e,o){var i,r=o?ge(o.featureProjection):null,n=o?ge(o.dataProjection):null,n=r&&n&&!ve(r,n)?t instanceof or?(e?t.clone():t).tb(e?r:n,e?n:r):Pe(t,n,r):t;return e&&o&&void 0!==o.decimals&&(i=Math.pow(10,o.decimals),(n=n===t?n.clone():n).Dc(function(t){for(var e=0,o=t.length;e<o;++e)t[e]=Math.round(t[e]*i)/i;return t})),n}function ll(){nl.call(this)}function hl(t,e,o,i,r,n){var p=NaN,s=NaN;if(1===(a=(o-e)/i))p=t[e],s=t[e+1];else if(2==a)p=(1-r)*t[e]+r*t[e+i],s=(1-r)*t[e+1]+r*t[e+i+1];else if(a){for(var s=t[e],a=t[e+1],l=0,p=[0],h=e+i;h<o;h+=i){var y=t[h],u=t[h+1],l=l+Math.sqrt((y-s)*(y-s)+(u-a)*(u-a));p.push(l),s=y,a=u}for(o=r*l,a=0,l=p.length,h=!1;a<l;)(s=+U(p[r=a+(l-a>>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<p;++n){var s=r[n];K(e,i=hl(o,i,s,t,.5)),i=s}return e}function cl(t,e){for(var o=t.ja,i=[],r=[],n=0,p=e.length;n<p;++n){var s=e[n];n||(o=s.ja),K(i,s.ga()),r.push(i.length)}t.ba(o,i,r)}function f(t,e){i.call(this),this.ma(t,e)}function b(t,e){i.call(this),this.c=[],this.u=-1,this.D=null,this.I=this.C=this.B=-1,this.j=null,this.ma(t,e)}function fl(t){if(t.u!=t.i){var e=t.A,o=t.c,i=t.a,r=0,n=[],p=0;for(l=o.length;p<l;++p){var s=o[p],r=xt(e,r,s[0],i);n.push((r[0]+r[2])/2,(r[1]+r[3])/2),r=s[s.length-1]}for(e=dl(t),i=t.a,l=[],s=p=0,r=(o=t.c).length;s<r;++s)var a=o[s],l=cr(e,p,a,i,n,2*s,l),p=a[a.length-1];t.D=l,t.u=t.i}return t.D}function dl(t){if(t.I!=t.i){var e=t.A;t:{for(var o=t.c,i=0,r=o.length;i<r;++i)if(!dr(e,o[i],t.a,void 0)){o=!1;break t}o=!0}o?t.j=e:(t.j=e.slice(),t.j.length=vr(t.j,t.c,t.a)),t.I=t.i}return t.j}function gl(t,e,o,i){pr(t,e,o),t.c=i,t.s()}function vl(t,e){for(var o=t.ja,i=[],r=[],n=0,p=e.length;n<p;++n){for(var s=e[n],a=(n||(o=s.ja),i.length),l=s.Bb(),h=0,y=l.length;h<y;++h)l[h]+=a;K(i,s.ga()),r.push(l)}gl(t,o,i,r)}function ml(t){t=t||{},nl.call(this),this.b=t.geometryName}function bl(t,e){if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)var o="Point";else if(t.points)o="MultiPoint";else if(t.paths)o=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){for(var i=t.rings,r=xl(t),n=[],p=[],o=[],s=0,a=i.length;s<a;++s)n.length=0,ar(n,0,i[s],r.length),fr(n,0,n.length,r.length)?p.push([i[s]]):o.push(i[s]);for(;o.length;){for(i=o.shift(),r=!1,s=p.length-1;0<=s;s--)if(ct(new lr(p[s][0]).G(),new lr(i).G())){p[s].push(i),r=!0;break}r||p.push([i.reverse()])}t=Gt({},t),1===p.length?(o="Polygon",t.rings=p[0]):(o="MultiPolygon",t.rings=p)}return al((0,wl[o])(t),!1,e)}function xl(t){var e="XY";return!0===t.hasZ&&!0===t.hasM?e="XYZM":!0===t.hasZ?e="XYZ":!0===t.hasM&&(e="XYM"),e}e(ll,nl),ll.prototype.U=function(){return"json"},e(m,i),m.prototype.mk=function(t){this.A?K(this.A,t):this.A=t.slice(),this.s()},e(a,i),a.prototype.nk=function(t){this.A?K(this.A,t.ga().slice()):this.A=t.ga().slice(),this.c.push(this.A.length),this.s()},e(f,i),f.prototype.qk=function(t){this.A?K(this.A,t.ga()):this.A=t.ga().slice(),this.s()},e(b,i),b.prototype.rk=function(t){if(this.A)for(var e=this.A.length,o=(K(this.A,t.ga()),0),i=(t=t.Bb().slice()).length;o<i;++o)t[o]+=e;else this.A=t.ga().slice(),t=t.Bb().slice(),this.c.push();this.c.push(t),this.s()},e(ml,ll);var wl={Point:function(t){return void 0!==t.m&&void 0!==t.z?new p([t.x,t.y,t.z,t.m],"XYZM"):void 0!==t.z?new p([t.x,t.y,t.z],"XYZ"):void 0!==t.m?new p([t.x,t.y,t.m],"XYM"):new p([t.x,t.y])},LineString:function(t){return new m(t.paths[0],xl(t))},Polygon:function(t){return new s(t.rings,xl(t))},MultiPoint:function(t){return new f(t.points,xl(t))},MultiLineString:function(t){return new a(t.paths,xl(t))},MultiPolygon:function(t){return new b(t.rings,xl(t))}};function Sl(t){this.kc=t}function Pl(t,e){this.kc=t,this.b=Array.prototype.slice.call(arguments,1),_(2<=this.b.length,57)}function Ml(t){var e=["And"].concat(Array.prototype.slice.call(arguments));Pl.apply(this,e)}function Tl(t,e,o){this.kc="BBOX",this.geometryName=t,this.extent=e,this.srsName=o}function El(t,e){this.kc=t,this.b=e}function Al(t,e,o){El.call(this,"During",t),this.a=e,this.i=o}function Cl(t,e,o,i){El.call(this,t,e),this.i=o,this.a=i}function jl(t,e,o){Cl.call(this,"PropertyIsEqualTo",t,e,o)}function Ll(t,e){Cl.call(this,"PropertyIsGreaterThan",t,e)}function Rl(t,e){Cl.call(this,"PropertyIsGreaterThanOrEqualTo",t,e)}function Fl(t,e,o,i){this.kc=t,this.geometryName=e||"the_geom",this.geometry=o,this.srsName=i}function Nl(t,e,o){Fl.call(this,"Intersects",t,e,o)}function Il(t,e,o){El.call(this,"PropertyIsBetween",t),this.a=e,this.i=o}function kl(t,e,o,i,r,n){El.call(this,"PropertyIsLike",t),this.c=e,this.g=void 0!==o?o:"*",this.f=void 0!==i?i:".",this.i=void 0!==r?r:"!",this.a=n}function Ol(t){El.call(this,"PropertyIsNull",t)}function Dl(t,e){Cl.call(this,"PropertyIsLessThan",t,e)}function Ul(t,e){Cl.call(this,"PropertyIsLessThanOrEqualTo",t,e)}function Gl(t){this.kc="Not",this.condition=t}function Bl(t,e,o){Cl.call(this,"PropertyIsNotEqualTo",t,e,o)}function Kl(t){var e=["Or"].concat(Array.prototype.slice.call(arguments));Pl.apply(this,e)}function Wl(t,e,o){Fl.call(this,"Within",t,e,o)}function Vl(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Ml,e))}function Xl(t,e,o){return new Tl(t,e,o)}function zl(t){or.call(this),this.a=t||null,Hl(this)}function Hl(t){if(t.a)for(var e=0,o=t.a.length;e<o;++e)g(t.a[e],"change",t.s,t)}function Zl(t){t=t||{},nl.call(this),this.defaultDataProjection=ge(t.defaultDataProjection||"EPSG:4326"),t.featureProjection&&(this.f=ge(t.featureProjection)),this.b=t.geometryName}function ql(t,e){return t?al((0,Jl[t.type])(t),!1,e):null}ml.prototype.Rc=function(t,e){var o=bl(t.geometry,e),i=new v;return this.b&&i.Tc(this.b),i.Ra(o),e&&e.dg&&t.attributes[e.dg]&&i.jc(t.attributes[e.dg]),t.attributes&&i.H(t.attributes),i},e(Pl,Sl),e(Ml,Pl),e(Tl,Sl),e(El,Sl),e(Al,El),e(Cl,El),e(jl,Cl),e(Ll,Cl),e(Rl,Cl),e(Fl,Sl),e(Nl,Fl),e(Il,El),e(kl,El),e(Ol,El),e(Dl,Cl),e(Ul,Cl),e(Gl,Sl),e(Bl,Cl),e(Kl,Pl),e(Wl,Fl),e(zl,or),zl.prototype.clone=function(){var t=new zl(null);return t.oj(this.a),t},e(Zl,ll);var Jl={Point:function(t){return new p(t.coordinates)},LineString:function(t){return new m(t.coordinates)},Polygon:function(t){return new s(t.coordinates)},MultiPoint:function(t){return new f(t.coordinates)},MultiLineString:function(t){return new a(t.coordinates)},MultiPolygon:function(t){return new b(t.coordinates)},GeometryCollection:function(t,e){return new zl(t=t.geometries.map(function(t){return ql(t,e)}))}};function Yl(){this.i=new XMLSerializer,nl.call(this)}function _l(t){this.featureType=(t=t||{}).featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.b={},this.b["http://www.opengis.net/gml"]={featureMember:qa(_l.prototype.be),featureMembers:qa(_l.prototype.be)},Yl.call(this)}Zl.prototype.Rc=function(t,e){e=ql((t="Feature"===t.type?t:{type:"Feature",geometry:t}).geometry,e);var o=new v;return this.b&&o.Tc(this.b),o.Ra(e),void 0!==t.id&&o.jc(t.id),t.properties&&o.H(t.properties),o},e(Yl,nl),Yl.prototype.U=function(){return"xml"},e(_l,Yl);function $l(t){return Ql(t=Wa(t,!1))}function Ql(t){if(t=/^\s*(true|1)|(false|0)\s*$/.exec(t))return void 0!==t[1]||!1}function th(t){return t=Wa(t,!1),t=Date.parse(t),isNaN(t)?void 0:t/1e3}function eh(t){return oh(t=Wa(t,!1))}function oh(t){if(t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t))return parseFloat(t[1])}function ih(t){return rh(t=Wa(t,!1))}function rh(t){if(t=/^\s*(\d+)\s*$/.exec(t))return parseInt(t[1],10)}function n(t){return Wa(t,!1).trim()}function nh(t,e){ah(t,e?"1":"0")}function ph(t,e){t.appendChild(Ba.createTextNode(e.toPrecision()))}function sh(t,e){t.appendChild(Ba.createTextNode(e.toString()))}function ah(t,e){t.appendChild(Ba.createTextNode(e))}function x(t){_l.call(this,t=t||{}),this.l=void 0!==t.surface&&t.surface,this.c=void 0!==t.curve&&t.curve,this.g=void 0===t.multiCurve||t.multiCurve,this.j=void 0===t.multiSurface||t.multiSurface,this.schemaLocation=t.schemaLocation||"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd"}_l.prototype.be=function(t,e){var o=t.localName,i=null;if("FeatureCollection"==o)i=d("http://www.opengis.net/wfs"===t.namespaceURI?[]:null,this.b,t,e,this);else if("featureMembers"==o||"featureMember"==o){var r=(f=e[0]).featureType,n=f.featureNS;if(!r&&t.childNodes){r=[];for(var n={},p=0,s=t.childNodes.length;p<s;++p)if(1===(u=t.childNodes[p]).nodeType){var a=u.nodeName.split(":").pop();if(-1===r.indexOf(a)){var l,h="",y=0,u=u.namespaceURI;for(l in n){if(n[l]===u){h=l;break}++y}h||(n[h="p"+y]=u),r.push(h+":"+a)}}"featureMember"!=o&&(f.featureType=r,f.featureNS=n)}"string"==typeof n&&(p=n,(n={}).p0=p);var c,f={},r=Array.isArray(r)?r:[r];for(c in n){for(a={},p=0,s=r.length;p<s;++p)(-1===r[p].indexOf(":")?"p0":r[p].split(":")[0])===c&&(a[r[p].split(":").pop()]=("featureMembers"==o?Za:qa)(this.wg,this));f[n[c]]=a}i=d("featureMember"==o?void 0:[],f,t,e)}return i=null===i?[]:i},Za(_l.prototype.Xi),Za(_l.prototype.Xi),Za(_l.prototype.Mh),Za(_l.prototype.Mh),Za(_l.prototype.Yi),Za(_l.prototype.Yi),Za(_l.prototype.ff),Za(_l.prototype.hf),Za(_l.prototype.jf),qa(_l.prototype.wp),e(x,_l),x.prototype.Ap=function(t,e){if(t=d([],this.Lj,t,e,this))return cl(e=new a(null),t),e},qa(x.prototype.xp),qa(x.prototype.Bg),qa(_l.prototype.fj),qa(_l.prototype.dj),qa(_l.prototype.hf),qa(_l.prototype.cj),qa(_l.prototype.bj),qa(_l.prototype.jf),qa(_l.prototype.ej),qa(x.prototype.gj),qa(x.prototype.Bp),qa(x.prototype.Zi),qa(x.prototype.Ap),qa(x.prototype.vp),Za(x.prototype.ph),Za(x.prototype.ph),Za(x.prototype.Aj),Za(x.prototype.Aj),Za(_l.prototype.hf),Za(x.prototype.Zi),Za(_l.prototype.jf),Za(x.prototype.gj),qa(x.prototype.Ep),qa(x.prototype.Hp),Za(x.prototype.Bg),Za(x.prototype.Bg),qa(x.prototype.Fp),qa(x.prototype.zp);var lh={"http://www.opengis.net/gml":{lowerCorner:c(ah),upperCorner:c(ah)}},hh=(x.prototype.jn=function(t,e,o){var i=o[o.length-1].srsName;i&&t.setAttribute("srsName",i),ol({node:t},lh,$a,[e[0]+" "+e[1],e[2]+" "+e[3]],o,["lowerCorner","upperCorner"],this)},c(x.prototype.pi),c(x.prototype.pi),c(x.prototype.ln),c(x.prototype.ji),c(x.prototype.ji),c(x.prototype.oi),c(x.prototype.oi),c(x.prototype.Re),c(x.prototype.li),c(x.prototype.ni),c(x.prototype.kn),c(x.prototype.Re),c(x.prototype.li),c(x.prototype.ki),c(x.prototype.Se),c(x.prototype.mi),c(x.prototype.Se),c(x.prototype.mi),c(x.prototype.jn),{MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"});function yh(t){_l.call(this,t=t||{}),this.b["http://www.opengis.net/gml"].featureMember=Za(_l.prototype.be),this.schemaLocation=t.schemaLocation||"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd"}x.prototype.o=function(t,e){return Ka("http://www.opengis.net/gml",hh[e[e.length-1].node.nodeName])},x.prototype.a=function(t,e){e=(r=e[e.length-1]).multiSurface;var o=r.surface,i=r.curve,r=r.multiCurve;return Array.isArray(t)?t="Envelope":"MultiPolygon"===(t=t.U())&&!0===e?t="MultiSurface":"Polygon"===t&&!0===o?t="Surface":"LineString"===t&&!0===i?t="Curve":"MultiLineString"===t&&!0===r&&(t="MultiCurve"),Ka("http://www.opengis.net/gml",t)},x.prototype.ie=function(t,e){e=sl(this,e);var o=Ka("http://www.opengis.net/gml","geom"),i={node:o,hasZ:this.hasZ,srsName:this.srsName,curve:this.c,surface:this.l,multiSurface:this.j,multiCurve:this.g};return e&&Gt(i,e),this.od(o,t,[i]),o},x.prototype.Xb=function(t,e){e=sl(this,e);var o=Ka("http://www.opengis.net/gml","featureMembers"),i=(o.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",this.schemaLocation),{srsName:this.srsName,hasZ:this.hasZ,curve:this.c,surface:this.l,multiSurface:this.j,multiCurve:this.g,featureNS:this.featureNS,featureType:this.featureType}),r=(e&&Gt(i,e),(e=[i])[e.length-1]),i=r.featureType,n=r.featureNS,p={};return p[n]={},p[n][i]=c(this.ii,this),(r=Gt({},r)).node=o,ol(r,p,_a(i,n),t,e),o},e(yh,_l),yh.prototype.$i=function(t,e){t=Wa(t,!1).replace(/^\s*|\s*$/g,"");var o=e[0].srsName;e="enu",(o=o&&ge(o))&&(e=o.b);for(var i,r,n=[],p=0,s=(t=t.trim().split(/\s+/)).length;p<s;p++)r=t[p].split(/,+/),o=parseFloat(r[0]),i=parseFloat(r[1]),r=3===r.length?parseFloat(r[2]):0,"en"===e.substr(0,2)?n.push(o,i,r):n.push(i,o,r);return n},qa(yh.prototype.$i),Za(yh.prototype.$i),qa(_l.prototype.fj),qa(_l.prototype.dj),qa(_l.prototype.hf),qa(_l.prototype.cj),qa(_l.prototype.bj),qa(_l.prototype.jf),qa(_l.prototype.ej),qa(yh.prototype.tp);c(yh.prototype.Pe),c(yh.prototype.di),c(yh.prototype.fi),c(yh.prototype.fn),c(yh.prototype.Pe),c(yh.prototype.di),c(yh.prototype.ci),c(yh.prototype.Qe),c(yh.prototype.ei),c(yh.prototype.Qe),c(yh.prototype.ei),c(yh.prototype.en),c(yh.prototype.gi),c(yh.prototype.gi),c(yh.prototype.gn),c(yh.prototype.bi),c(yh.prototype.bi);yh.prototype.a=function(t,e){return Ka("http://www.opengis.net/gml",uh[e[e.length-1].node.nodeName])};var uh={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};c(yh.prototype.hi),c(yh.prototype.hi),c(ah),c(ah);function ch(t){t=t||{},Yl.call(this),this.defaultDataProjection=ge("EPSG:4326"),this.b=t.readExtensions}e(ch,Yl);var fh=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"];function dh(t,e,o,i){return t.push(parseFloat(o.getAttribute("lon")),parseFloat(o.getAttribute("lat"))),"ele"in i?(t.push(i.ele),delete i.ele,e.hasZ=!0):t.push(0),"time"in i?(t.push(i.time),delete i.time,e.hasM=!0):t.push(0),t}function gh(t,e,o){var i="XY",r=2;if(t.hasZ&&t.hasM?(i="XYZM",r=4):t.hasZ?(i="XYZ",r=3):t.hasM&&(i="XYM",r=3),4!==r){for(var n=0,p=e.length/4;n<p;n++)e[n*r]=e[4*n],e[n*r+1]=e[4*n+1],t.hasZ&&(e[n*r+2]=e[4*n+2]),t.hasM&&(e[n*r+2]=e[4*n+3]);if(e.length=e.length/4*r,o)for(n=0,p=o.length;n<p;n++)o[n]=o[n]/4*r}return i}function vh(t,e){var o=e[e.length-1],i=t.getAttribute("href");null!==i&&(o.link=i),tl(Mh,t,e)}function mh(t,e){e[e.length-1].extensionsNode_=t}function bh(t,e){var o,i,r=e[0];if(t=d({flatCoordinates:[],layoutOptions:{}},Th,t,e))return e=t.flatCoordinates,delete t.flatCoordinates,o=t.layoutOptions,delete t.layoutOptions,o=gh(o,e),(i=new m(null)).ba(o,e),al(i,!1,r),(r=new v(i)).H(t),r}function xh(t,e){var o,i,r,n=e[0];if(t=d({flatCoordinates:[],ends:[],layoutOptions:{}},Ah,t,e))return e=t.flatCoordinates,delete t.flatCoordinates,o=t.ends,delete t.ends,i=t.layoutOptions,delete t.layoutOptions,i=gh(i,e,o),(r=new a(null)).ba(i,e,o),al(r,!1,n),(n=new v(r)).H(t),n}function wh(t,e){var o,i=e[0];if(e=d({},Lh,t,e))return al(t=new p(t=dh([],o={},t,e),o=gh(o,t)),!1,i),(i=new v(t)).H(e),i}var Sh={rte:bh,trk:xh,wpt:wh},Ph=h(fh,{rte:Za(bh),trk:Za(xh),wpt:Za(wh)}),Mh=h(fh,{text:r(n,"linkText"),type:r(n,"linkType")}),Th=h(fh,{name:r(n),cmt:r(n),desc:r(n),src:r(n),link:vh,number:r(ih),extensions:mh,type:r(n),rtept:function(t,e){var o=d({},Eh,t,e);o&&dh((e=e[e.length-1]).flatCoordinates,e.layoutOptions,t,o)}}),Eh=h(fh,{ele:r(eh),time:r(th)}),Ah=h(fh,{name:r(n),cmt:r(n),desc:r(n),src:r(n),link:vh,number:r(ih),type:r(n),extensions:mh,trkseg:function(t,e){var o=e[e.length-1];tl(Ch,t,e),o.ends.push(o.flatCoordinates.length)}}),Ch=h(fh,{trkpt:function(t,e){var o=d({},jh,t,e);o&&dh((e=e[e.length-1]).flatCoordinates,e.layoutOptions,t,o)}}),jh=h(fh,{ele:r(eh),time:r(th)}),Lh=h(fh,{ele:r(eh),time:r(th),magvar:r(eh),geoidheight:r(eh),name:r(n),cmt:r(n),desc:r(n),src:r(n),link:vh,sym:r(n),type:r(n),fix:r(n),sat:r(ih),hdop:r(eh),vdop:r(eh),pdop:r(eh),ageofdgpsdata:r(eh),dgpsid:r(ih),extensions:mh});function Rh(t,e){for(var o=0,i=(e=e||[]).length;o<i;++o){var r,n=e[o];t.b&&(r=n.get("extensionsNode_")||null,t.b(n,r)),n.set("extensionsNode_",void 0)}}function Fh(t,e,o){t.setAttribute("href",e),e=o[o.length-1].properties,ol({node:t},kh,$a,[e.linkText,e.linkType],o,Ih)}function Nh(t,e,o){var i=o[o.length-1],r=i.node.namespaceURI,n=i.properties;switch(t.setAttributeNS(null,"lat",e[1]),t.setAttributeNS(null,"lon",e[0]),i.geometryLayout){case"XYZM":e[3]&&(n.time=e[3]);case"XYZ":e[2]&&(n.ele=e[2]);break;case"XYM":e[2]&&(n.time=e[2])}i=Qa(n,e=("rtept"==t.nodeName?Uh:Vh)[r]),ol({node:t,properties:n},Xh,$a,i,o,e)}ch.prototype.xg=function(t,e){var o;return G(fh,t.namespaceURI)&&(o=Sh[t.localName])&&(t=o(t,[pl(this,t,e)]))?(Rh(this,[t]),t):null},ch.prototype.zc=function(t,e){return G(fh,t.namespaceURI)&&"gpx"==t.localName&&(t=d([],Ph,t,[pl(this,t,e)]))?(Rh(this,t),t):[]};var Ih=["text","type"],kh=h(fh,{text:c(ah),type:c(ah)}),Oh=h(fh,"name cmt desc src link number type rtept".split(" ")),Dh=h(fh,{name:c(ah),cmt:c(ah),desc:c(ah),src:c(ah),link:c(Fh),number:c(sh),type:c(ah),rtept:Ya(c(Nh))}),Uh=h(fh,["ele","time"]),Gh=h(fh,"name cmt desc src link number type trkseg".split(" ")),Bh=h(fh,{name:c(ah),cmt:c(ah),desc:c(ah),src:c(ah),link:c(Fh),number:c(sh),type:c(ah),trkseg:Ya(c(function(t,e,o){ol({node:t,geometryLayout:e.ja,properties:{}},Wh,Kh,e.X(),o)}))}),Kh=_a("trkpt"),Wh=h(fh,{trkpt:c(Nh)}),Vh=h(fh,"ele time magvar geoidheight name cmt desc src link sym type fix sat hdop vdop pdop ageofdgpsdata dgpsid".split(" ")),Xh=h(fh,{ele:c(ph),time:c(function(t,e){e=new Date(1e3*e),t.appendChild(Ba.createTextNode(e.getUTCFullYear()+"-"+Ki(e.getUTCMonth()+1)+"-"+Ki(e.getUTCDate())+"T"+Ki(e.getUTCHours())+":"+Ki(e.getUTCMinutes())+":"+Ki(e.getUTCSeconds())+"Z"))}),magvar:c(ph),geoidheight:c(ph),name:c(ah),cmt:c(ah),desc:c(ah),src:c(ah),link:c(Fh),sym:c(ah),type:c(ah),fix:c(ah),sat:c(sh),hdop:c(ph),vdop:c(ph),pdop:c(ph),ageofdgpsdata:c(ph),dgpsid:c(sh)}),zh={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Hh(t,e){if(t=(t=t.V())&&zh[t.U()])return Ka(e[e.length-1].node.namespaceURI,t)}var Zh=h(fh,{rte:c(function(t,e,o){var i=o[0],r=e.N();t={node:t,properties:r},(e=e.V())&&(e=al(e,!0,i),t.geometryLayout=e.ja,r.rtept=e.X()),r=Qa(r,i=Oh[o[o.length-1].node.namespaceURI]),ol(t,Dh,$a,r,o,i)}),trk:c(function(t,e,o){var i=o[0],r=e.N();t={node:t,properties:r},(e=e.V())&&(e=al(e,!0,i),r.trkseg=e.gd()),r=Qa(r,i=Gh[o[o.length-1].node.namespaceURI]),ol(t,Bh,$a,r,o,i)}),wpt:c(function(t,e,o){var i=o[0],r=o[o.length-1];r.properties=e.N(),(e=e.V())&&(e=al(e,!0,i),r.geometryLayout=e.ja,Nh(t,e.X(),o))})});function qh(){nl.call(this)}function Jh(t){t=t||{},nl.call(this),this.defaultDataProjection=ge("EPSG:4326"),this.b=t.altitudeMode||"none"}ch.prototype.Xb=function(t,e){e=sl(this,e);var o=Ka("http://www.topografix.com/GPX/1/1","gpx");return 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.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),o.setAttribute("version","1.1"),o.setAttribute("creator","OpenLayers"),ol({node:o},Zh,Hh,t,[e]),o},e(qh,nl),qh.prototype.U=function(){return"text"},e(Jh,qh);var Yh,_h,$h,Qh,ty,ey,oy,iy,ry,ny,py,sy,ay,ly,hy,yy=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,uy=/^H.([A-Z]{3}).*?:(.*)/,cy=/^HFDTE(\d{2})(\d{2})(\d{2})/,fy=/\r\n|\r|\n/;function dy(t,e,o,i,r,n){Qe.call(this),this.j=null,this.M=t||new Image,null!==i&&(this.M.crossOrigin=i),this.c=n?document.createElement("CANVAS"):null,this.g=n,this.f=null,this.i=r,this.a=o,this.o=e,this.l=!1,2==this.i&&gy(this)}function gy(e){var t=xo(1,1);try{t.drawImage(e.M,0,0),t.getImageData(0,0,1,1)}catch(t){e.l=!0}}function vy(t){this.o=void 0!==(t=t||{}).anchor?t.anchor:[.5,.5],this.u=null,this.i=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.C=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.B=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.ra=void 0!==t.crossOrigin?t.crossOrigin:null;var e=void 0!==t.img?t.img:null,o=void 0!==t.imgSize?t.imgSize:null,i=t.src,r=(_(!(void 0!==i&&e),4),_(!e||o,5),_(void 0!==(i=void 0!==i&&i.length||!e?i:e.src||q(e).toString())&&0<i.length,6),void 0!==t.src?0:2),n=(this.j=void 0!==t.color?uo(t.color):null,this.ra),p=this.j,s=Gn.get(i,n,p);s||(s=new dy(e,i,o,n,r,p),Gn.set(i,n,p,s)),this.b=s,this.oa=void 0!==t.offset?t.offset:[0,0],this.c=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.S=null,this.D=void 0!==t.size?t.size:null,ja.call(this,{opacity:void 0!==t.opacity?t.opacity:1,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView})}function my(t){this.a=(t=t||{}).font,this.f=t.rotation,this.o=t.rotateWithView,this.b=t.scale,this.Ia=t.text,this.g=t.textAlign,this.j=t.textBaseline,this.Va=void 0!==t.fill?t.fill:new Na({color:"#333"}),this.Ya=void 0!==t.stroke?t.stroke:null,this.i=void 0!==t.offsetX?t.offsetX:0,this.c=void 0!==t.offsetY?t.offsetY:0}function by(t){t=t||{},Yl.call(this),Yh||($h=new Na({color:_h=[255,255,255,1]}),ey=ty="pixels",ny=new vy({anchor:Qh=[20,2],anchorOrigin:"bottom-left",anchorXUnits:ty,anchorYUnits:ey,crossOrigin:"anonymous",rotation:0,scale:ry=.5,size:oy=[64,64],src:iy="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),py="NO_IMAGE",sy=new as({color:_h,width:1}),ay=new as({color:[51,51,51,1],width:2}),ly=new my({font:"bold 16px Helvetica",fill:$h,stroke:ay,scale:.8}),hy=new Ia({fill:$h,image:ny,text:ly,stroke:sy,zIndex:0}),Yh=[hy]),this.defaultDataProjection=ge("EPSG:4326"),this.a=t.defaultStyle||Yh,this.c=void 0===t.extractStyles||t.extractStyles,this.j=void 0===t.writeStyles||t.writeStyles,this.b={},this.g=void 0===t.showPointNames||t.showPointNames}Jh.prototype.ae=function(t,e){for(var o=this.b,i=t.split(fy),r=(t={},[]),n=2e3,p=0,s=1,a=-1,l=0,h=i.length;l<h;++l){var y,u,c,f,d,g=i[l];"B"==g.charAt(0)?(y=yy.exec(g))&&(g=parseInt(y[1],10),u=parseInt(y[2],10),c=parseInt(y[3],10),f=parseInt(y[4],10)+parseInt(y[5],10)/6e4,"S"==y[6]&&(f=-f),d=parseInt(y[7],10)+parseInt(y[8],10)/6e4,"W"==y[9]&&(d=-d),r.push(d,f),"none"!=o&&r.push("gps"==o?parseInt(y[11],10):"barometric"==o?parseInt(y[12],10):0),(y=Date.UTC(n,p,s,g,u,c))<a&&(y=Date.UTC(n,p,s+1,g,u,c)),r.push(y/1e3),a=y):"H"==g.charAt(0)&&((y=cy.exec(g))?(s=parseInt(y[1],10),p=parseInt(y[2],10)-1,n=2e3+parseInt(y[3],10)):(y=uy.exec(g))&&(t[y[1]]=y[2].trim()))}return r.length?((i=new m(null)).ba("none"==o?"XYM":"XYZM",r),(e=new v(al(i,!1,e))).H(t),e):null},e(dy,Qe),dy.prototype.v=function(){this.i=3,this.f.forEach(Ze),this.f=null,this.b("change")},dy.prototype.u=function(){if(this.i=2,this.a&&(this.M.width=this.a[0],this.M.height=this.a[1]),this.a=[this.M.width,this.M.height],this.f.forEach(Ze),this.f=null,gy(this),!this.l&&null!==this.g){this.c.width=this.M.width,this.c.height=this.M.height;var t=this.c.getContext("2d");t.drawImage(this.M,0,0);for(var e=t.getImageData(0,0,this.M.width,this.M.height),o=e.data,i=this.g[0]/255,r=this.g[1]/255,n=this.g[2]/255,p=0,s=o.length;p<s;p+=4)o[p]*=i,o[p+1]*=r,o[p+2]*=n;t.putImageData(e,0,0)}this.b("change")},dy.prototype.Y=function(){return this.c||this.M},dy.prototype.load=function(){if(0==this.i){this.i=1,this.f=[ze(this.M,"error",this.v,this),ze(this.M,"load",this.u,this)];try{this.M.src=this.o}catch(t){this.v()}}},e(vy,ja),vy.prototype.clone=function(){var t,e,o=this.Y(1);return 2===this.b.i&&("IMG"===o.tagName.toUpperCase()?t=o.cloneNode(!0):(e=(t=document.createElement("canvas")).getContext("2d"),t.width=o.width,t.height=o.height,e.drawImage(o,0,0))),new vy({anchor:this.o.slice(),anchorOrigin:this.i,anchorXUnits:this.C,anchorYUnits:this.B,crossOrigin:this.ra,color:this.j&&this.j.slice?this.j.slice():this.j||void 0,img:t||void 0,imgSize:t?this.b.a.slice():void 0,src:t?void 0:this.b.o,offset:this.oa.slice(),offsetOrigin:this.c,size:null!==this.D?this.D.slice():void 0,opacity:this.f,scale:this.a,snapToPixel:this.v,rotation:this.g,rotateWithView:this.l})},my.prototype.clone=function(){return new my({font:this.a,rotation:this.f,rotateWithView:this.o,scale:this.b,text:this.Na(),textAlign:this.g,textBaseline:this.j,fill:this.Fa()?this.Fa().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,offsetX:this.i,offsetY:this.c})},e(by,Yl);var xy=["http://www.google.com/kml/ext/2.2"],wy=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],Sy={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"};function Py(t){if(t=Wa(t,!1),t=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t))return t=t[1],[parseInt(t.substr(6,2),16),parseInt(t.substr(4,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(0,2),16)/255]}function My(t){t=Wa(t,!1);for(var e,o=[],i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=i.exec(t);)o.push(parseFloat(e[1]),parseFloat(e[2]),e[3]?parseFloat(e[3]):0),t=t.substr(e[0].length);if(""===t)return o}function Ty(t){var e=Wa(t,!1).trim();return t.baseURI&&"about:blank"!==t.baseURI?new URL(e,t.baseURI).href:e}function Ey(t){return eh(t)}function Ay(t,e){return d(null,Xy,t,e)}function Cy(t,e){if(e=d({A:[],Ej:[]},Hy,t,e)){t=e.A,e=e.Ej;for(var o=0,i=Math.min(t.length,e.length);o<i;++o)t[4*o+3]=e[o];return(e=new m(null)).ba("XYZM",t),e}}function jy(t,e){var o=d({},Vy,t,e);if(t=d(null,Zy,t,e))return(e=new m(null)).ba("XYZ",t),e.H(o),e}function Ly(t,e){var o=d({},Vy,t,e);if(t=d(null,Zy,t,e))return(e=new s(null)).ba("XYZ",t,[t.length]),e.H(o),e}function Ry(t,e){if(!(t=d([],Qy,t,e)))return null;if(!t.length)return new zl(t);var o=!0,i=t[0].U(),r=1;for(p=t.length;r<p;++r)if((e=t[r]).U()!=i){o=!1;break}if(o)if("Point"==i){for(var n=t[0],o=n.ja,i=n.ga(),r=1,p=t.length;r<p;++r)K(i,(e=t[r]).ga());(n=new f(null)).ba(o,i),ky(n,t)}else"LineString"==i?(cl(n=new a(null),t),ky(n,t)):"Polygon"==i?(vl(n=new b(null),t),ky(n,t)):"GeometryCollection"==i?n=new zl(t):_(!1,37);else n=new zl(t);return n}function Fy(t,e){var o=d({},Vy,t,e);if(t=d(null,Zy,t,e))return(e=new p(null)).ba("XYZ",t),e.H(o),e}function Ny(t,e){var o=d({},Vy,t,e);if((t=d([null],zy,t,e))&&t[0]){e=new s(null);for(var i=t[0],r=[i.length],n=1,p=t.length;n<p;++n)K(i,t[n]),r.push(i.length);return e.ba("XYZ",i,r),e.H(o),e}}function Iy(t,e){if(!(e=d({},pu,t,e)))return null;t="fillStyle"in e?e.fillStyle:$h;var o=e.fill,i=(void 0===o||o||(t=null),(o="imageStyle"in e?e.imageStyle:ny)==py&&(o=void 0),"textStyle"in e?e.textStyle:ly),r="strokeStyle"in e?e.strokeStyle:sy;return[new Ia({fill:t,image:o,stroke:r=void 0===(e=e.outline)||e?r:null,text:i,zIndex:void 0})]}function ky(t,e){for(var o,i=e.length,r=Array(e.length),n=Array(e.length),p=o=!1,s=0;s<i;++s){var a=e[s];r[s]=a.get("extrude"),n[s]=a.get("altitudeMode"),p=p||void 0!==r[s],o=o||n[s]}p&&t.set("extrude",r),o&&t.set("altitudeMode",n)}function Oy(t,e){tl(Gy,t,e)}function Dy(t,e){tl(By,t,e)}var Uy=h(wy,{displayName:r(n),value:r(n)}),Gy=h(wy,{Data:function(t,e){var o=t.getAttribute("name");tl(Uy,t,e),t=e[e.length-1],null!==o?t[o]=t.value:null!==t.displayName&&(t[t.displayName]=t.value)},SchemaData:function(t,e){tl(nu,t,e)}}),By=h(wy,{LatLonAltBox:function(t,e){(t=d({},Ky,t,e))&&((e=e[e.length-1]).extent=[parseFloat(t.west),parseFloat(t.south),parseFloat(t.east),parseFloat(t.north)],e.altitudeMode=t.altitudeMode,e.minAltitude=parseFloat(t.minAltitude),e.maxAltitude=parseFloat(t.maxAltitude))},Lod:function(t,e){(t=d({},Wy,t,e))&&((e=e[e.length-1]).minLodPixels=parseFloat(t.minLodPixels),e.maxLodPixels=parseFloat(t.maxLodPixels),e.minFadeExtent=parseFloat(t.minFadeExtent),e.maxFadeExtent=parseFloat(t.maxFadeExtent))}}),Ky=h(wy,{altitudeMode:r(n),minAltitude:r(eh),maxAltitude:r(eh),north:r(eh),south:r(eh),east:r(eh),west:r(eh)}),Wy=h(wy,{minLodPixels:r(eh),maxLodPixels:r(eh),minFadeExtent:r(eh),maxFadeExtent:r(eh)}),Vy=h(wy,{extrude:r($l),altitudeMode:r(n)}),Xy=h(wy,{coordinates:qa(My)}),zy=h(wy,{innerBoundaryIs:function(t,e){(t=d(void 0,Yy,t,e))&&e[e.length-1].push(t)},outerBoundaryIs:function(t,e){(t=d(void 0,ou,t,e))&&(e[e.length-1][0]=t)}}),Hy=h(wy,{when:function(t,e){e=e[e.length-1].Ej,t=Wa(t,!1),t=Date.parse(t),e.push(isNaN(t)?0:t)}},h(xy,{coord:function(t,e){e=e[e.length-1].A,t=Wa(t,!1),(t=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(t))?e.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),0):e.push(0,0,0,0)}})),Zy=h(wy,{coordinates:qa(My)}),qy=h(wy,{href:r(Ty)},h(xy,{x:r(eh),y:r(eh),w:r(eh),h:r(eh)})),Jy=h(wy,{Icon:r(function(t,e){return(t=d({},qy,t,e))||null}),heading:r(eh),hotSpot:r(function(t){var e=t.getAttribute("xunits"),o=t.getAttribute("yunits"),i="insetPixels"!==e?"insetPixels"!==o?"bottom-left":"top-left":"insetPixels"!==o?"bottom-right":"top-right";return{x:parseFloat(t.getAttribute("x")),Xg:Sy[e],y:parseFloat(t.getAttribute("y")),Yg:Sy[o],origin:i}}),scale:r(Ey)}),Yy=h(wy,{LinearRing:qa(Ay)}),_y=h(wy,{color:r(Py),scale:r(Ey)}),$y=h(wy,{color:r(Py),width:r(eh)}),Qy=h(wy,{LineString:Za(jy),LinearRing:Za(Ly),MultiGeometry:Za(Ry),Point:Za(Fy),Polygon:Za(Ny)}),tu=h(xy,{Track:Za(Cy)}),eu=(h(wy,{ExtendedData:Oy,Region:Dy,Link:function(t,e){tl(eu,t,e)},address:r(n),description:r(n),name:r(n),open:r($l),phoneNumber:r(n),visibility:r($l)}),h(wy,{href:r(Ty)})),ou=h(wy,{LinearRing:qa(Ay)}),iu=h(wy,{Style:r(Iy),key:r(n),styleUrl:r(Ty)}),ru=(h(wy,{ExtendedData:Oy,Region:Dy,MultiGeometry:r(Ry,"geometry"),LineString:r(jy,"geometry"),LinearRing:r(Ly,"geometry"),Point:r(Fy,"geometry"),Polygon:r(Ny,"geometry"),Style:r(Iy),StyleMap:function(t,e){(t=d(void 0,su,t,e))&&(e=e[e.length-1],Array.isArray(t)?e.Style=t:"string"==typeof t?e.styleUrl=t:_(!1,38))},address:r(n),description:r(n),name:r(n),open:r($l),phoneNumber:r(n),styleUrl:r(Ty),visibility:r($l)},h(xy,{MultiTrack:r(function(t,e){if(t=d([],tu,t,e))return cl(e=new a(null),t),e},"geometry"),Track:r(Cy,"geometry")})),h(wy,{color:r(Py),fill:r($l),outline:r($l)})),nu=h(wy,{SimpleData:function(t,e){var o=t.getAttribute("name");null!==o&&(t=n(t),e[e.length-1][o]=t)}}),pu=h(wy,{IconStyle:function(t,e){var o,i,r,n,p,s,a,l,h,y,u,c;(t=d({},Jy,t,e))&&(e=e[e.length-1],c="Icon"in t?t.Icon:{},o=!("Icon"in t)||0<Object.keys(c).length,(r=c.href)?i=r:o&&(i=iy),r="bottom-left",(y=t.hotSpot)?(n=[y.x,y.y],p=y.Xg,s=y.Yg,r=y.origin):i===iy?(n=Qh,p=ty,s=ey):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(n=[.5,0],s=p="fraction"),l=c.y,void 0!==(y=c.x)&&void 0!==l&&(a=[y,l]),y=c.w,c=c.h,void 0!==y&&void 0!==c&&(h=[y,c]),void 0!==(c=t.heading)&&(u=it(c)),t=t.scale,o?(i=new vy({anchor:n,anchorOrigin:r,anchorXUnits:p,anchorYUnits:s,crossOrigin:"anonymous",offset:a,offsetOrigin:"bottom-left",rotation:u,scale:t=i==iy&&(h=oy,void 0===t)?ry:t,size:h,src:i}),e.imageStyle=i):e.imageStyle=py)},LabelStyle:function(t,e){(t=d({},_y,t,e))&&(e[e.length-1].textStyle=new my({fill:new Na({color:"color"in t?t.color:_h}),scale:t.scale}))},LineStyle:function(t,e){(t=d({},$y,t,e))&&(e[e.length-1].strokeStyle=new as({color:"color"in t?t.color:_h,width:"width"in t?t.width:1}))},PolyStyle:function(t,e){var o;(t=d({},ru,t,e))&&((e=e[e.length-1]).fillStyle=new Na({color:"color"in t?t.color:_h}),void 0!==(o=t.fill)&&(e.fill=o),void 0!==(t=t.outline))&&(e.outline=t)}}),su=h(wy,{Pair:function(t,e){var o;(t=d({},iu,t,e))&&(o=t.key)&&"normal"==o&&((o=t.styleUrl)&&(e[e.length-1]=o),t=t.Style)&&(e[e.length-1]=t)}});function au(t,e){var o;for(e=[255*(4==(e=uo(e)).length?e[3]:1),e[2],e[1],e[0]],o=0;o<4;++o){var i=parseInt(e[o],10).toString(16);e[o]=1==i.length?"0"+i:i}ah(t,e.join(""))}function lu(t,e,o){t={node:t};var i,r,n=e.U();"GeometryCollection"==n?(i=e.Vf(),r=Gu):"MultiPoint"==n?(i=e.Zd(),r=qu):"MultiLineString"==n?(i=e.gd(),r=Ju):"MultiPolygon"==n?(i=e.Td(),r=_u):_(!1,39),ol(t,ju,r,i,o)}function hu(t,e,o){ol({node:t},Cu,Yu,[e],o)}function yu(t,e,o){var i,r={node:t},n=(e.a&&t.setAttribute("id",e.a),t=e.N(),{address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1}),p=(n[e.c]=1,Object.keys(t||{}).sort().filter(function(t){return!n[t]}));0<p.length&&(i=Qa(t,p),ol(r,Ru,Hu,[{names:p,values:i}],o)),(p=(p=e.Lc())&&p.call(e,0))&&(p=Array.isArray(p)?p[0]:p,this.j&&(t.Style=p),p=p.Na())&&(t.name=p.Na()),t=Qa(t,p=Lu[o[o.length-1].node.namespaceURI]),ol(r,Ru,$a,t,o,p),t=o[0],e=(e=e.V())&&al(e,!0,t),ol(r,Ru,Gu,[e],o)}function uu(t,e,o){var i=e.ga();(t={node:t}).layout=e.ja,t.stride=e.qa(),ol(t,Fu,Xu,[i],o)}function cu(t,e,o){var i=(e=e.Sd()).shift();ol(t={node:t},Nu,Zu,e,o),ol(t,Nu,$u,[i],o)}function fu(t,e){ph(t,Math.round(1e6*e)/1e6)}by.prototype.vg=function(t,e){if(t=d([],h(wy,{Document:Ha(this.vg,this),Folder:Ha(this.vg,this),Placemark:Za(this.Dg,this),Style:this.Jp.bind(this),StyleMap:this.Ip.bind(this)}),t,e,this))return t};var du=h(wy,["Document","Placemark"]),gu=h(wy,{Document:c(function(t,e,o){ol({node:t},vu,Uu,e,o,void 0,this)}),Placemark:c(yu)}),vu=h(wy,{Placemark:c(yu)}),mu=h(wy,{Data:c(function(t,e,o){t.setAttribute("name",e.name),t={node:t},"object"==typeof(e=e.value)?(null!==e&&e.displayName&&ol(t,mu,$a,[e.displayName],o,["displayName"]),null!==e&&e.value&&ol(t,mu,$a,[e.value],o,["value"])):ol(t,mu,$a,[e],o,["value"])}),value:c(function(t,e){ah(t,e)}),displayName:c(function(t,e){t.appendChild(Ba.createCDATASection(e))})}),bu={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},xu=h(wy,["href"],h(xy,["x","y","w","h"])),wu=h(wy,{href:c(ah)},h(xy,{x:c(ph),y:c(ph),w:c(ph),h:c(ph)})),Su=h(wy,["scale","heading","Icon","hotSpot"]),Pu=h(wy,{Icon:c(function(t,e,o){t={node:t};var i=xu[o[o.length-1].node.namespaceURI],r=Qa(e,i);ol(t,wu,$a,r,o,i),r=Qa(e,i=xu[xy[0]]),ol(t,wu,Du,r,o,i)}),heading:c(ph),hotSpot:c(function(t,e){t.setAttribute("x",e.x),t.setAttribute("y",e.y),t.setAttribute("xunits",e.Xg),t.setAttribute("yunits",e.Yg)}),scale:c(fu)}),Mu=h(wy,["color","scale"]),Tu=h(wy,{color:c(au),scale:c(fu)}),Eu=h(wy,["color","width"]),Au=h(wy,{color:c(au),width:c(ph)}),Cu=h(wy,{LinearRing:c(uu)}),ju=h(wy,{LineString:c(uu),Point:c(uu),Polygon:c(cu),GeometryCollection:c(lu)}),Lu=h(wy,"name open visibility address phoneNumber description styleUrl Style".split(" ")),Ru=h(wy,{ExtendedData:c(function(t,e,o){t={node:t};var i=e.names;e=e.values;for(var r=i.length,n=0;n<r;n++)ol(t,mu,zu,[{name:i[n],value:e[n]}],o)}),MultiGeometry:c(lu),LineString:c(uu),LinearRing:c(uu),Point:c(uu),Polygon:c(cu),Style:c(function(t,e,o){t={node:t};var i={},r=e.Fa(),n=e.Ga(),p=e.Y();e=e.Na(),p instanceof vy&&(i.IconStyle=p),e&&(i.LabelStyle=e),n&&(i.LineStyle=n),r&&(i.PolyStyle=r),i=Qa(i,e=ku[o[o.length-1].node.namespaceURI]),ol(t,Ou,$a,i,o,e)}),address:c(ah),description:c(ah),name:c(ah),open:c(nh),phoneNumber:c(ah),styleUrl:c(ah),visibility:c(nh)}),Fu=h(wy,{coordinates:c(function(t,e,o){var i,r=(o=o[o.length-1]).layout;o=o.stride,"XY"==r||"XYM"==r?i=2:"XYZ"==r||"XYZM"==r?i=3:_(!1,34);var n,p=e.length,s="";if(0<p){for(s+=e[0],r=1;r<i;++r)s+=","+e[r];for(n=o;n<p;n+=o)for(s+=" "+e[n],r=1;r<i;++r)s+=","+e[n+r]}ah(t,s)})}),Nu=h(wy,{outerBoundaryIs:c(hu),innerBoundaryIs:c(hu)}),Iu=h(wy,{color:c(au)}),ku=h(wy,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Ou=h(wy,{IconStyle:c(function(t,e,o){t={node:t};var i,r,n={},p=e.ic(),s=e.ye(),a={href:e.b.o};p&&(a.w=p[0],a.h=p[1],i=e.Hc(),(r=e.Oc())&&s&&r[0]&&r[1]!==p[1]&&(a.x=r[0],a.y=s[1]-(r[1]+p[1])),i)&&i[0]&&i[1]!==p[1]&&(n.hotSpot={x:i[0],Xg:"pixels",y:p[1]-i[1],Yg:"pixels"}),n.Icon=a,1!==(p=e.a)&&(n.scale=p),(e=e.g)&&(n.heading=e),n=Qa(n,e=Su[o[o.length-1].node.namespaceURI]),ol(t,Pu,$a,n,o,e)}),LabelStyle:c(function(t,e,o){t={node:t};var i={},r=e.Fa();r&&(i.color=r.b),(e=e.b)&&1!==e&&(i.scale=e),i=Qa(i,e=Mu[o[o.length-1].node.namespaceURI]),ol(t,Tu,$a,i,o,e)}),LineStyle:c(function(t,e,o){t={node:t};var i=Eu[o[o.length-1].node.namespaceURI];e=Qa({color:e.a,width:e.c},i),ol(t,Au,$a,e,o,i)}),PolyStyle:c(function(t,e,o){ol({node:t},Iu,Vu,[e.b],o)})});function Du(t,e,o){return Ka(xy[0],"gx:"+o)}function Uu(t,e){return Ka(e[e.length-1].node.namespaceURI,"Placemark")}function Gu(t,e){if(t)return Ka(e[e.length-1].node.namespaceURI,bu[t.U()])}var Bu,Ku,Wu,Vu=_a("color"),Xu=_a("coordinates"),zu=_a("Data"),Hu=_a("ExtendedData"),Zu=_a("innerBoundaryIs"),qu=_a("Point"),Ju=_a("LineString"),Yu=_a("LinearRing"),_u=_a("Polygon"),$u=_a("outerBoundaryIs");function Qu(t){this.lc=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.type=this.ea=0,this.length=this.lc.length}function tc(t,e,o){return o?4294967296*e+(t>>>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<t;){var i=e.ne[o.Ka()],r=e.pe[o.Ka()];e.properties[i]=r}else 3==t?e.type=o.Ka():4==t&&(e.Ef=o.ea)}function nc(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Cc=t,this.ne=[],this.pe=[],this.me=[],t.Ag(pc,this,e),this.length=this.me.length}function pc(t,e,o){15===t?e.version=o.Ka():1===t?e.name=o.Gg():5===t?e.extent=o.Ka():2===t?e.me.push(o.ea):3===t?e.ne.push(o.Gg()):4===t&&e.pe.push(function(t){for(var e=null,o=t.Ka()+t.ea;t.ea<o;)e=1==(e=t.Ka()>>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<t.length?r.Document=t:1==t.length&&(r.Placemark=t[0]),r=Qa(r,t=du[o.namespaceURI]),ol(i,gu,$a,r,[e],t,this),o},ms.Dd=function(){},pi=ms.Dd=ms.Dd||{},Bu=function(t,e,o,i,r){var n=8*r-i-1,p=(1<<n)-1,s=p>>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;o=256*o+t[e+r],r+=l,a-=8);for(n=o&(1<<-a)-1,o>>=-a,a+=i;0<a;n=256*n+t[e+r],r+=l,a-=8);if(0===o)o=1-s;else{if(o===p)return n?NaN:1/0*(h?-1:1);n+=Math.pow(2,i),o-=s}return(h?-1:1)*n*Math.pow(2,o-i)},Qu.c=0,Qu.i=1,Qu.b=2,Qu.a=5,Qu.prototype={Ag:function(t,e,o){for(o=o||this.length;this.ea<o;){var i=this.Ka(),r=i>>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<t;){var r,n,p,s=e[i],a=null,l=239<s?4:223<s?3:191<s?2:1;if(t<i+l)break;1===l?s<128&&(a=s):2===l?128==(192&(r=e[i+1]))&&(a=(31&s)<<6|63&r)<=127&&(a=null):3===l?(r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&((a=(15&s)<<12|(63&r)<<6|63&n)<=2047||55296<=a&&a<=57343)&&(a=null)):4===l&&(r=e[i+1],n=e[i+2],p=e[i+3],128==(192&r))&&128==(192&n)&&128==(192&p)&&((a=(15&s)<<18|(63&r)<<12|(63&n)<<6|63&p)<=65535||1114112<=a)&&(a=null),null===a?(a=65533,l=1):65535<a&&(a-=65536,o+=String.fromCharCode(a>>>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<this.lc[this.ea++];);else if(t===Qu.b)this.ea=this.Ka()+this.ea;else if(t===Qu.a)this.ea+=4;else{if(t!==Qu.i)throw Error("Unimplemented type: "+t);this.ea+=8}}},pi.default=Qu,ms.Dd=ms.Dd.default,ms.xf={},ms.xf.Bf=function(){},si=ms.xf=ms.xf||{},oc.prototype={clone:function(){return new oc(this.x,this.y)},add:function(t){return this.clone().Yj(t)},rotate:function(t){return this.clone().hk(t)},round:function(){return this.clone().ik()},angle:function(){return Math.atan2(this.y,this.x)},Yj:function(t){return this.x+=t.x,this.y+=t.y,this},hk:function(t){var e=Math.cos(t),o=(t=Math.sin(t))*this.x+e*this.y;return this.x=e*this.x-t*this.y,this.y=o,this},ik:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},oc.Kq=function(t){return!(t instanceof oc)&&Array.isArray(t)?new oc(t[0],t[1]):t},ic.b=["Unknown","Point","LineString","Polygon"],ic.prototype.Oh=function(){var t=this.Cc;t.ea=this.Ef;for(var e,o=t.Ka()+t.ea,i=1,r=0,n=0,p=0,s=[];t.ea<o;)if(r||(i=7&(r=t.Ka()),r>>=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<e;)if(i||(o=7&(i=t.Ka()),i>>=3),i--,1===o||2===o)(r+=t.ce())<p&&(p=r),s<r&&(s=r),(n+=t.ce())<a&&(a=n),l<n&&(l=n);else if(7!==o)throw Error("unknown command "+o);return[p,a,s,l]},(Ku=nc).prototype.feature=function(t){if(t<0||t>=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<p;n++)K(r,e.Sh[t.md[n]]);t.md[0]==t.md[t.md.length-1]?(n=new s(null)).ba("XY",r,[r.length]):(n=new m(null)).ba("XY",r),al(n,!1,o),(o=new v(n)).jc(i),o.H(t.fe),e.features.push(o)}}),fc=h(pi,{tag:yc});function dc(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}function gc(){}function vc(){}hc.prototype.zc=function(t,e){return e=pl(this,t,e),"osm"==t.localName&&(t=d({Sh:{},features:[]},cc,t,[e])).features?t.features:[]},hc.prototype.Vg=function(){},hc.prototype.Xb=function(){},hc.prototype.ie=function(){},gc.prototype.read=function(t){return Va(t)?this.a(t):Xa(t)?this.b(t):"string"==typeof t?(t=za(t),this.a(t)):null},e(vc,gc),vc.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},vc.prototype.b=function(t){return(t=d({},mc,t,[]))||null};var si=[null,"http://www.opengis.net/ows/1.1"],mc=h(si,{ServiceIdentification:r(function(t,e){return d({},Lc,t,e)}),ServiceProvider:r(function(t,e){return d({},Rc,t,e)}),OperationsMetadata:r(function(t,e){return d({},Ec,t,e)})}),bc=h(si,{DeliveryPoint:r(n),City:r(n),AdministrativeArea:r(n),PostalCode:r(n),Country:r(n),ElectronicMailAddress:r(n)}),xc=h(si,{Value:Ja(n)}),wc=h(si,{AllowedValues:r(function(t,e){return d({},xc,t,e)})}),Sc=h(si,{Phone:r(function(t,e){return d({},Ac,t,e)}),Address:r(function(t,e){return d({},bc,t,e)})}),Pc=h(si,{HTTP:r(function(t,e){return d({},Mc,t,e)})}),Mc=h(si,{Get:Ja(function(t,e){var o=dc(t);if(o)return d({href:o},Cc,t,e)}),Post:void 0}),Tc=h(si,{DCP:r(function(t,e){return d({},Pc,t,e)})}),Ec=h(si,{Operation:function(t,e){var o=t.getAttribute("name");(t=d({},Tc,t,e))&&(e[e.length-1][o]=t)}}),Ac=h(si,{Voice:r(n),Facsimile:r(n)}),Cc=h(si,{Constraint:Ja(function(t,e){var o=t.getAttribute("name");if(o)return d({name:o},wc,t,e)})}),jc=h(si,{IndividualName:r(n),PositionName:r(n),ContactInfo:r(function(t,e){return d({},Sc,t,e)})}),Lc=h(si,{Title:r(n),ServiceTypeVersion:r(n),ServiceType:r(n)}),Rc=h(si,{ProviderName:r(n),ProviderSite:r(dc),ServiceContact:r(function(t,e){return d({},jc,t,e)})});function Fc(t){t=t||{},nl.call(this),this.defaultDataProjection=ge("EPSG:4326"),this.b=t.factor||1e5,this.a=t.geometryLayout||"XY"}function Nc(t,e,o){for(var i=Array(e),r=0;r<e;++r)i[r]=0;for(var n=0,p=t.length;n<p;)for(r=0;r<e;++r,++n){var s=t[n],a=s-i[r];i[r]=s,t[n]=a}return kc(t,o||1e5)}function Ic(t,e,o){for(var i,r=Array(e),n=0;n<e;++n)r[n]=0;for(t=Oc(t,o||1e5),o=0,i=t.length;o<i;)for(n=0;n<e;++n,++o)r[n]+=t[o],t[o]=r[n];return t}function kc(t,e){e=e||1e5;for(var o=0,i=t.length;o<i;++o)t[o]=Math.round(t[o]*e);for(e=0,o=t.length;e<o;++e)i=t[e],t[e]=i<0?~(i<<1):i<<1;for(e="",o=0,i=t.length;o<i;++o){for(var r=t[o],n="";32<=r;)n+=String.fromCharCode(63+(32|31&r)),r>>=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<p;++n){var s=t.charCodeAt(n)-63,i=i|(31&s)<<r;s<32?(o.push(i),r=i=0):r+=5}for(t=0,i=o.length;t<i;++t)o[t]=1&(r=o[t])?~(r>>1):r>>1;for(t=0,i=o.length;t<i;++t)o[t]/=e;return o}function Dc(t){t=t||{},nl.call(this),this.a=t.layerName,this.b=t.layers||null,this.defaultDataProjection=ge(t.defaultDataProjection||"EPSG:4326")}function Uc(t,e){for(var o=[],i=0,r=t.length;i<r;++i){var n=t[i];0<i&&o.pop(),n=0<=n?e[n]:e[~n].slice().reverse(),o.push.apply(o,n)}for(t=0,e=o.length;t<e;++t)o[t]=o[t].slice();return o}function Gc(t,e,o,i,r,n,p){var s=t.type,a=Kc[s];return o="Point"===s||"MultiPoint"===s?a(t,o,i):a(t,e),(e=new v).Ra(al(o,!1,p)),void 0!==t.id&&e.jc(t.id),t=t.properties,r&&((t=t||{})[r]=n),t&&e.H(t),e}function Bc(t,e,o){t[0]=t[0]*e[0]+o[0],t[1]=t[1]*e[1]+o[1]}e(Fc,qh),Fc.prototype.ae=function(t,e){return new v(t=this.wd(t,e))},e(Dc,ll),Dc.prototype.yg=function(t,e){if("Topology"!=t.type)return[];var o=null,i=null,r=(t.transform&&(o=(n=t.transform).scale,i=n.translate),t.arcs);if(n)for(var n=o,p=i,s=0,a=r.length;s<a;++s)for(var l=r[s],h=n,y=p,u=0,c=0,f=0,d=l.length;f<d;++f){var g=l[f];u+=g[0],c+=g[1],g[0]=u,g[1]=c,Bc(g,h,y)}n=[];var v,p=this.a;for(v in t=t.objects)this.b&&-1==this.b.indexOf(v)||("GeometryCollection"===t[v].type?(s=t[v],n.push.apply(n,function(t,e,o,i,r,n,p){for(var s=[],a=0,l=(t=t.geometries).length;a<l;++a)s[a]=Gc(t[a],e,o,i,r,n,p);return s}(s,r,o,i,p,v,e))):(s=t[v],n.push(Gc(s,r,o,i,p,v,e))));return n},Dc.prototype.Fg=function(){return this.defaultDataProjection};var Kc={Point:function(t,e,o){return t=t.coordinates,e&&o&&Bc(t,e,o),new p(t)},LineString:function(t,e){return new m(t=Uc(t.arcs,e))},Polygon:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i)o[i]=Uc(t.arcs[i],e);return new s(o)},MultiPoint:function(t,e,o){if(t=t.coordinates,e&&o)for(var i=0,r=t.length;i<r;++i)Bc(t[i],e,o);return new f(t)},MultiLineString:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i)o[i]=Uc(t.arcs[i],e);return new a(o)},MultiPolygon:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i){for(var n=t.arcs[i],p=[],s=0,a=n.length;s<a;++s)p[s]=Uc(n[s],e);o[i]=p}return new b(o)}};function Wc(t){this.c=(t=t||{}).featureType,this.a=t.featureNS,this.b=t.gmlFormat||new x,this.o=t.schemaLocation||Vc["1.1.0"],Yl.call(this)}Dc.prototype.Zc=function(){},e(Wc,Yl);var Vc={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"};function Xc(t,e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return Hc(t,e)}Wc.prototype.zc=function(t,e){var o={featureType:this.c,featureNS:this.a};return Gt(o,pl(this,t,e||{})),e=[o],this.b.b["http://www.opengis.net/gml"].featureMember=Za(_l.prototype.be),t=(t=d([],this.b.b,t,e,this.b))||[]},Wc.prototype.j=function(t){return Va(t)?_c(t):Xa(t)?d({},Yc,t,[]):"string"==typeof t?_c(t=za(t)):void 0},Wc.prototype.g=function(t){return Va(t)?Xc(this,t):Xa(t)?Hc(this,t):"string"==typeof t?Xc(this,t=za(t)):void 0};var zc={"http://www.opengis.net/gml":{boundedBy:r(_l.prototype.gf,"bounds")}};function Hc(t,e){var o={},i=rh(e.getAttribute("numberOfFeatures"));return o.numberOfFeatures=i,d(o,zc,e,[],t.b)}var Zc={"http://www.opengis.net/wfs":{totalInserted:r(ih),totalUpdated:r(ih),totalDeleted:r(ih)}},qc={"http://www.opengis.net/ogc":{FeatureId:Za(function(t){return t.getAttribute("fid")})}},Jc={"http://www.opengis.net/wfs":{Feature:function(t,e){tl(qc,t,e)}}},Yc={"http://www.opengis.net/wfs":{TransactionSummary:r(function(t,e){return d({},Zc,t,e)},"transactionSummary"),InsertResults:r(function(t,e){return d([],Jc,t,e)},"insertIds")}};function _c(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return d({},Yc,t,[])}var $c={"http://www.opengis.net/wfs":{PropertyName:c(ah)}};function Qc(t,e){var o=Ka("http://www.opengis.net/ogc","Filter"),i=Ka("http://www.opengis.net/ogc","FeatureId");o.appendChild(i),i.setAttribute("fid",e),t.appendChild(o)}function tf(t,e){return e.indexOf(t=(t||"feature")+":")?t+e:e}var ef={"http://www.opengis.net/wfs":{Insert:c(function(t,e,o){var i=(r=o[o.length-1]).gmlVersion,r=Ka(r.featureNS,r.featureType);if(t.appendChild(r),2===i){t=yh.prototype,(i=e.a)&&r.setAttribute("fid",i);var n=(i=o[o.length-1]).featureNS,p=e.c,s=(i.lb||(i.lb={},i.lb[n]={}),e.N()),a=(e=[],[]);for(h in s){var l=s[h];null!==l&&(e.push(h),a.push(l),h==p||l instanceof or?h in i.lb[n]||(i.lb[n][h]=c(t.ai,t)):h in i.lb[n]||(i.lb[n][h]=c(ah)))}var h=Gt({},i);h.node=r,ol(h,i.lb,_a(void 0,n),a,o,e)}else x.prototype.ii(r,e,o)}),Update:c(function(t,e,o){var i=o[o.length-1],r=(_(void 0!==e.a,27),i.featurePrefix),n=i.featureNS;if(t.setAttribute("typeName",tf(r,i.featureType)),t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+r,n),void 0!==(r=e.a)){for(var p=[],s=0,a=(n=e.O()).length;s<a;s++){var l=e.get(n[s]);void 0!==l&&p.push({name:n[s],value:l})}ol({gmlVersion:i.gmlVersion,node:t,hasZ:i.hasZ,srsName:i.srsName},ef,_a("Property"),p,o),Qc(t,r)}}),Delete:c(function(t,e,o){o=o[o.length-1],_(void 0!==e.a,26);var i=o.featurePrefix,r=o.featureNS;t.setAttribute("typeName",tf(i,o.featureType)),t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+i,r),void 0!==(e=e.a)&&Qc(t,e)}),Property:c(function(t,e,o){var i=Ka("http://www.opengis.net/wfs","Name"),r=o[o.length-1].gmlVersion;t.appendChild(i),ah(i,e.name),null!=e.value&&(i=Ka("http://www.opengis.net/wfs","Value"),t.appendChild(i),e.value instanceof or?2===r?yh.prototype.ai(i,e.value,o):x.prototype.od(i,e.value,o):ah(i,e.value))}),Native:c(function(t,e){e.vq&&t.setAttribute("vendorId",e.vq),void 0!==e.Vp&&t.setAttribute("safeToIgnore",e.Vp),void 0!==e.value&&ah(t,e.value)})}};function of(t,e,o){var i={node:t};e.b.forEach(function(t){ol(i,lf,_a(t.kc),[t],o)})}function rf(t,e){void 0!==e.a&&t.setAttribute("matchCase",e.a.toString()),pf(t,e.b),sf(t,""+e.i)}function nf(t,e,o){ah(t=Ka("http://www.opengis.net/ogc",t),o),e.appendChild(t)}function pf(t,e){nf("PropertyName",t,e)}function sf(t,e){nf("Literal",t,e)}function af(t,e){var o=Ka("http://www.opengis.net/gml","TimeInstant");t.appendChild(o),t=Ka("http://www.opengis.net/gml","timePosition"),o.appendChild(t),ah(t,e)}var lf={"http://www.opengis.net/wfs":{Query:c(function(t,e,o){var i=o[o.length-1],r=i.featurePrefix,n=i.featureNS,p=i.propertyNames,s=i.srsName;t.setAttribute("typeName",r?tf(r,e):e),s&&t.setAttribute("srsName",s),n&&t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+r,n),(e=Gt({},i)).node=t,ol(e,$c,_a("PropertyName"),p,o),(i=i.filter)&&(p=Ka("http://www.opengis.net/ogc","Filter"),t.appendChild(p),ol({node:p},lf,_a(i.kc),[i],o))})},"http://www.opengis.net/ogc":{During:c(function(t,e){var o=Ka("http://www.opengis.net/fes","ValueReference");ah(o,e.b),t.appendChild(o),o=Ka("http://www.opengis.net/gml","TimePeriod"),t.appendChild(o),t=Ka("http://www.opengis.net/gml","begin"),o.appendChild(t),af(t,e.a),t=Ka("http://www.opengis.net/gml","end"),o.appendChild(t),af(t,e.i)}),And:c(of),Or:c(of),Not:c(function(t,e,o){e=e.condition,ol({node:t},lf,_a(e.kc),[e],o)}),BBOX:c(function(t,e,o){o[o.length-1].srsName=e.srsName,pf(t,e.geometryName),x.prototype.od(t,e.extent,o)}),Intersects:c(function(t,e,o){o[o.length-1].srsName=e.srsName,pf(t,e.geometryName),x.prototype.od(t,e.geometry,o)}),Within:c(function(t,e,o){o[o.length-1].srsName=e.srsName,pf(t,e.geometryName),x.prototype.od(t,e.geometry,o)}),PropertyIsEqualTo:c(rf),PropertyIsNotEqualTo:c(rf),PropertyIsLessThan:c(rf),PropertyIsLessThanOrEqualTo:c(rf),PropertyIsGreaterThan:c(rf),PropertyIsGreaterThanOrEqualTo:c(rf),PropertyIsNull:c(function(t,e){pf(t,e.b)}),PropertyIsBetween:c(function(t,e){pf(t,e.b);var o=Ka("http://www.opengis.net/ogc","LowerBoundary");t.appendChild(o),sf(o,""+e.a),o=Ka("http://www.opengis.net/ogc","UpperBoundary"),t.appendChild(o),sf(o,""+e.i)}),PropertyIsLike:c(function(t,e){t.setAttribute("wildCard",e.g),t.setAttribute("singleChar",e.f),t.setAttribute("escapeChar",e.i),void 0!==e.a&&t.setAttribute("matchCase",e.a.toString()),pf(t,e.b),sf(t,""+e.c)})}};function hf(t){t=t||{},nl.call(this),this.b=void 0!==t.splitCollection&&t.splitCollection}Wc.prototype.l=function(t){var e,o,i=Ka("http://www.opengis.net/wfs","GetFeature");return i.setAttribute("service","WFS"),i.setAttribute("version","1.1.0"),t&&(t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",t.maxFeatures),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",t.startIndex),void 0!==t.count&&i.setAttribute("count",t.count),o=t.filter,t.bbox)&&(_(t.geometryName,12),e=Xl(t.geometryName,t.bbox,t.srsName),o=o?Vl(o,e):e),i.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",this.o),o={node:i,srsName:t.srsName,featureNS:t.featureNS||this.a,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:o,propertyNames:t.propertyNames||[]},_(Array.isArray(t.featureTypes),11),t=t.featureTypes,(e=Gt({},(o=[o])[o.length-1])).node=i,ol(e,lf,_a("Query"),t,o),i},Wc.prototype.v=function(t,e,o,i){var r,n=[],p=Ka("http://www.opengis.net/wfs","Transaction"),s=i.version||"1.1.0",a="1.0.0"===s?2:3;return p.setAttribute("service","WFS"),p.setAttribute("version",s),i&&(r=i.gmlOptions||{},i.handle)&&p.setAttribute("handle",i.handle),p.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",Vc[s]),t&&(s={node:p,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:a,hasZ:i.hasZ,srsName:i.srsName},Gt(s,r),ol(s,ef,_a("Insert"),t,n)),e&&(s={node:p,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:a,hasZ:i.hasZ,srsName:i.srsName},Gt(s,r),ol(s,ef,_a("Update"),e,n)),o&&ol({node:p,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:a,srsName:i.srsName},ef,_a("Delete"),o,n),i.nativeElements&&ol({node:p,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:a,srsName:i.srsName},ef,_a("Native"),i.nativeElements,n),p},Wc.prototype.Eg=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.kf(t);return null},Wc.prototype.kf=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(t=(t=t.firstElementChild.firstElementChild).firstElementChild;t;t=t.nextElementSibling){var e;if(0!==t.childNodes.length&&(1!==t.childNodes.length||3!==t.firstChild.nodeType))return this.b.gf(t,e=[{}]),ge(e.pop().srsName)}return null},e(hf,qh);function yf(t){t.b=function t(e){var o=e.a.charAt(++e.b),i={position:e.b,value:o};if("("==o)i.type=2;else if(","==o)i.type=5;else if(")"==o)i.type=3;else if("0"<=o&&o<="9"||"."==o||"-"==o){var o=e.b,r=!(i.type=4),n=!1;do{"."==p?r=!0:"e"!=p&&"E"!=p||(n=!0);var p=e.a.charAt(++e.b)}while("0"<=p&&p<="9"||"."==p&&(void 0===r||!r)||!n&&("e"==p||"E"==p)||n&&("-"==p||"+"==p));e=parseFloat(e.a.substring(o,e.b--)),i.value=e}else if("a"<=o&&o<="z"||"A"<=o&&o<="Z"){for(i.type=1,o=e.b;"a"<=(p=e.a.charAt(++e.b))&&p<="z"||"A"<=p&&p<="Z";);e=e.a.substring(o,e.b--).toUpperCase(),i.value=e}else{if(" "==o||"\t"==o||"\r"==o||"\n"==o)return t(e);if(""!==o)throw Error("Unexpected character: "+o);i.type=6}return i}(t.i)}function uf(t,e){return(e=t.b.type==e)&&yf(t),e}function cf(t){for(var e=[],o=t.a.length,i=0;i<o;++i){var r=t.b;if(!uf(t,4))break;e.push(r.value)}if(e.length==o)return e;throw Error(df(t))}function ff(t){var e=1==t.b.type&&"EMPTY"==t.b.value;return e&&yf(t),e}function df(t){return"Unexpected `"+t.b.value+"` at position "+t.b.position+" in `"+t.i.a+"`"}hf.prototype.ae=function(t,e){return(t=this.wd(t,e))?((e=new v).Ra(t),e):null};function gf(){this.version=void 0}function vf(t,e){return d({},Of,t,e)}function mf(t,e){return d({},Ff,t,e)}function bf(t,e){if(e=vf(t,e))return t=[rh(t.getAttribute("width")),rh(t.getAttribute("height"))],e.size=t,e}function xf(t,e){return d([],Df,t,e)}e(gf,gc),gf.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},gf.prototype.b=function(t){return this.version=t.getAttribute("version").trim(),(t=d({version:this.version},wf,t,[]))||null};var pi=[null,"http://www.opengis.net/wms"],wf=h(pi,{Service:r(function(t,e){return d({},Pf,t,e)}),Capability:r(function(t,e){return d({},Sf,t,e)})}),Sf=h(pi,{Request:r(function(t,e){return d({},Rf,t,e)}),Exception:r(function(t,e){return d([],Af,t,e)}),Layer:r(function(t,e){return d({},Cf,t,e)})}),Pf=h(pi,{Name:r(n),Title:r(n),Abstract:r(n),KeywordList:r(xf),OnlineResource:r(dc),ContactInformation:r(function(t,e){return d({},Mf,t,e)}),Fees:r(n),AccessConstraints:r(n),LayerLimit:r(ih),MaxWidth:r(ih),MaxHeight:r(ih)}),Mf=h(pi,{ContactPersonPrimary:r(function(t,e){return d({},Tf,t,e)}),ContactPosition:r(n),ContactAddress:r(function(t,e){return d({},Ef,t,e)}),ContactVoiceTelephone:r(n),ContactFacsimileTelephone:r(n),ContactElectronicMailAddress:r(n)}),Tf=h(pi,{ContactPerson:r(n),ContactOrganization:r(n)}),Ef=h(pi,{AddressType:r(n),Address:r(n),City:r(n),StateOrProvince:r(n),PostCode:r(n),Country:r(n)}),Af=h(pi,{Format:Za(n)}),Cf=h(pi,{Name:r(n),Title:r(n),Abstract:r(n),KeywordList:r(xf),CRS:Ja(n),EX_GeographicBoundingBox:r(function(t,e){if(i=d({},Lf,t,e)){t=i.westBoundLongitude,e=i.southBoundLatitude;var o=i.eastBoundLongitude,i=i.northBoundLatitude;if(void 0!==t&&void 0!==e&&void 0!==o&&void 0!==i)return[t,e,o,i]}}),BoundingBox:Ja(function(t){var e=[oh(t.getAttribute("minx")),oh(t.getAttribute("miny")),oh(t.getAttribute("maxx")),oh(t.getAttribute("maxy"))],o=[oh(t.getAttribute("resx")),oh(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:e,res:o}}),Dimension:Ja(function(t){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Ql(t.getAttribute("multipleValues")),nearestValue:Ql(t.getAttribute("nearestValue")),current:Ql(t.getAttribute("current")),values:n(t)}}),Attribution:r(function(t,e){return d({},jf,t,e)}),AuthorityURL:Ja(function(t,e){if(e=vf(t,e))return e.name=t.getAttribute("name"),e}),Identifier:Ja(n),MetadataURL:Ja(function(t,e){if(e=vf(t,e))return e.type=t.getAttribute("type"),e}),DataURL:Ja(vf),FeatureListURL:Ja(vf),Style:Ja(function(t,e){return d({},kf,t,e)}),MinScaleDenominator:r(eh),MaxScaleDenominator:r(eh),Layer:Ja(function(t,e){var o=e[e.length-1],i=d({},Cf,t,e);if(i)return void 0===(e=Ql(t.getAttribute("queryable")))&&(e=o.queryable),i.queryable=void 0!==e&&e,void 0===(e=rh(t.getAttribute("cascaded")))&&(e=o.cascaded),i.cascaded=e,void 0===(e=Ql(t.getAttribute("opaque")))&&(e=o.opaque),i.opaque=void 0!==e&&e,void 0===(e=Ql(t.getAttribute("noSubsets")))&&(e=o.noSubsets),i.noSubsets=void 0!==e&&e,e=(e=oh(t.getAttribute("fixedWidth")))||o.fixedWidth,i.fixedWidth=e,t=(t=oh(t.getAttribute("fixedHeight")))||o.fixedHeight,i.fixedHeight=t,["Style","CRS","AuthorityURL"].forEach(function(t){t in o&&(i[t]=(i[t]||[]).concat(o[t]))}),"EX_GeographicBoundingBox BoundingBox Dimension Attribution MinScaleDenominator MaxScaleDenominator".split(" ").forEach(function(t){t in i||(i[t]=o[t])}),i})}),jf=h(pi,{Title:r(n),OnlineResource:r(dc),LogoURL:r(bf)}),Lf=h(pi,{westBoundLongitude:r(eh),eastBoundLongitude:r(eh),southBoundLatitude:r(eh),northBoundLatitude:r(eh)}),Rf=h(pi,{GetCapabilities:r(mf),GetMap:r(mf),GetFeatureInfo:r(mf)}),Ff=h(pi,{Format:Ja(n),DCPType:Ja(function(t,e){return d({},Nf,t,e)})}),Nf=h(pi,{HTTP:r(function(t,e){return d({},If,t,e)})}),If=h(pi,{Get:r(vf),Post:r(vf)}),kf=h(pi,{Name:r(n),Title:r(n),Abstract:r(n),LegendURL:Ja(bf),StyleSheetURL:r(vf),StyleURL:r(vf)}),Of=h(pi,{Format:r(n),OnlineResource:r(dc)}),Df=h(pi,{Keyword:Za(n)});function Uf(t){t=t||{},this.a="http://mapserver.gis.umn.edu/mapserver",this.b=new yh,this.c=t.layers||null,Yl.call(this)}function Gf(){this.i=new vc}function Bf(t){var e=n(t).split(" ");if(e&&2==e.length&&(t=+e[0],e=+e[1],!isNaN(t))&&!isNaN(e))return[t,e]}e(Uf,Yl),Uf.prototype.zc=function(t,e){var o={},i=(e&&Gt(o,pl(this,t,e)),o=[o],t.setAttribute("namespaceURI",this.a),t.localName);if(e=[],t.childNodes.length){if("msGMLOutput"==i)for(var r=0,n=t.childNodes.length;r<n;r++){var p,s,a,l=t.childNodes[r];l.nodeType===Node.ELEMENT_NODE&&(p=o[0],s=l.localName.replace("_layer",""),!this.c||G(this.c,s))&&(s+="_feature",p.featureType=s,p.featureNS=this.a,(a={})[s]=Za(this.b.wg,this.b),p=h([p.featureNS,null],a),l.setAttribute("namespaceURI",this.a),l=d([],p,l,o,this.b))&&K(e,l)}"FeatureCollection"==i&&(t=d([],this.b.b,t,[{}],this.b))&&(e=t)}return e},Uf.prototype.Vg=function(){},Uf.prototype.Xb=function(){},Uf.prototype.ie=function(){},e(Gf,gc),Gf.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},Gf.prototype.b=function(t){var e=t.getAttribute("version").trim(),o=this.i.b(t);return o&&(o.version=e,o=d(o,Kf,t,[]))||null};var si=[null,"http://www.opengis.net/wmts/1.0"],pi=[null,"http://www.opengis.net/ows/1.1"],Kf=h(si,{Contents:r(function(t,e){return d({},Wf,t,e)})}),Wf=h(si,{Layer:Ja(function(t,e){return d({},Vf,t,e)}),TileMatrixSet:Ja(function(t,e){return d({},Yf,t,e)})}),Vf=h(si,{Style:Ja(function(t,e){if(e=d({},Xf,t,e))return t="true"===t.getAttribute("isDefault"),e.isDefault=t,e}),Format:Ja(n),TileMatrixSetLink:Ja(function(t,e){return d({},zf,t,e)}),Dimension:Ja(function(t,e){return d({},qf,t,e)}),ResourceURL:Ja(function(t){var e=t.getAttribute("format"),o=t.getAttribute("template"),i=(t=t.getAttribute("resourceType"),{});return e&&(i.format=e),o&&(i.template=o),t&&(i.resourceType=t),i})},h(pi,{Title:r(n),Abstract:r(n),WGS84BoundingBox:r(function(t,e){if(2==(t=d([],Jf,t,e)).length)return lt(t)}),Identifier:r(n)})),Xf=h(si,{LegendURL:Ja(function(t){var e={};return e.format=t.getAttribute("format"),e.href=dc(t),e})},h(pi,{Title:r(n),Identifier:r(n)})),zf=h(si,{TileMatrixSet:r(n),TileMatrixSetLimits:r(function(t,e){return d([],Hf,t,e)})}),Hf=h(si,{TileMatrixLimits:Za(function(t,e){return d({},Zf,t,e)})}),Zf=h(si,{TileMatrix:r(n),MinTileRow:r(ih),MaxTileRow:r(ih),MinTileCol:r(ih),MaxTileCol:r(ih)}),qf=h(si,{Default:r(n),Value:Ja(n)},h(pi,{Identifier:r(n)})),Jf=h(pi,{LowerCorner:Za(Bf),UpperCorner:Za(Bf)}),Yf=h(si,{WellKnownScaleSet:r(n),TileMatrix:Ja(function(t,e){return d({},_f,t,e)})},h(pi,{SupportedCRS:r(n),Identifier:r(n)})),_f=h(si,{TopLeftCorner:r(Bf),ScaleDenominator:r(eh),TileWidth:r(ih),TileHeight:r(ih),MatrixWidth:r(ih),MatrixHeight:r(ih)},h(pi,{Identifier:r(n)}));function $f(t){oo.call(this),t=t||{},this.a=null,this.f=xe,this.c=void 0,g(this,ro("projection"),this.Am,this),g(this,ro("tracking"),this.Bm,this),void 0!==t.projection&&this.Wh(t.projection),void 0!==t.trackingOptions&&this.wj(t.trackingOptions),this.Ke(void 0!==t.tracking&&t.tracking)}function w(t,e,o){i.call(this),this.Ng(t,e||0,o)}function Qf(t){t=t||{},this.j=this.v=null,this.f=this.o=1/0,this.g=this.l=-1/0,this.ra=this.oa=1/0,this.R=this.I=-1/0,this.Jb=void 0!==t.targetSize?t.targetSize:100,this.fb=void 0!==t.maxLines?t.maxLines:100,this.i=[],this.c=[],this.pa=void 0!==t.strokeStyle?t.strokeStyle:td,this.D=this.u=void 0,this.a=this.b=this.S=null,1==t.showLabels&&(this.na=t.lonLabelFormatter||zi.bind(this,"EW"),this.Ua=t.latLabelFormatter||zi.bind(this,"NS"),this.fa=null==t.lonLabelPosition?0:t.lonLabelPosition,this.T=null==t.latLabelPosition?1:t.latLabelPosition,this.B=void 0!==t.lonLabelStyle?t.lonLabelStyle:new my({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Na({color:"rgba(0,0,0,1)"}),stroke:new as({color:"rgba(255,255,255,1)",width:3})}),this.C=void 0!==t.latLabelStyle?t.latLabelStyle:new my({font:"12px Calibri,sans-serif",textAlign:"end",fill:new Na({color:"rgba(0,0,0,1)"}),stroke:new as({color:"rgba(255,255,255,1)",width:3})}),this.b=[],this.a=[]),this.setMap(void 0!==t.map?t.map:null)}e($f,oo),$f.prototype.ka=function(){this.Ke(!1),oo.prototype.ka.call(this)},e(w,i),w.prototype.clone=function(){var t=new w(null);return pr(t,this.ja,this.A.slice()),t.s(),t};var td=new as({color:"rgba(0,0,0,0.2)"});function ed(t,e,o,i,r){Qe.call(this),this.f=r,this.extent=t,this.a=o,this.resolution=e,this.state=i}function od(t,e,o,i,r,n,p){ed.call(this,t,e,o,0,i),this.j=r,this.M=new Image,null!==n&&(this.M.crossOrigin=n),this.c={},this.i=null,this.state=0,this.g=p}function id(t,e,o,i,r,n){this.c=n||null,ed.call(this,t,e,o,n?0:2,i),this.i=r}function rd(t,e){Qe.call(this),this.ta=t,this.state=e,this.i=null,this.key=""}function nd(t){if(t.i){var e=t.i;do{if(2==e.getState())return e}while(e=e.i)}return t}function pd(t,e){t.state=e,t.s()}function sd(t,e,o,i,r){rd.call(this,t,e),this.g=o,this.M=new Image,null!==i&&(this.M.crossOrigin=i),this.c=null,this.j=r}function ad(t){t.c.forEach(Ze),t.c=null}Qf.prototype.Cm=function(){return this.v},e(ed,Qe),ed.prototype.s=function(){this.b("change")},ed.prototype.G=function(){return this.extent},ed.prototype.getState=function(){return this.state},e(od,ed),od.prototype.Y=function(t){var e;return void 0!==t?(t=q(t))in this.c?this.c[t]:(e=Wt(this.c)?this.M:this.M.cloneNode(!1),this.c[t]=e):this.M},e(id,ed),id.prototype.g=function(t){this.state=t?3:2,this.s()},id.prototype.load=function(){0==this.state&&(this.state=1,this.s(),this.c(this.g.bind(this)))},id.prototype.Y=function(){return this.i},e(rd,Qe),rd.prototype.s=function(){this.b("change")},rd.prototype.bb=function(){return this.key+"/"+this.ta},rd.prototype.f=function(){return this.ta},rd.prototype.getState=function(){return this.state},e(sd,rd),sd.prototype.ka=function(){1==this.state&&ad(this),this.i&&Ye(this.i),this.state=5,this.s(),rd.prototype.ka.call(this)};si=new Image;function ld(t){t=t||{},Lr.call(this,{handleEvent:tr}),this.g=t.formatConstructors||[],this.o=t.projection?ge(t.projection):null,this.a=null,this.target=t.target||null}function hd(t){for(var e=0,o=(t=t.dataTransfer.files).length;e<o;++e){var i=t.item(e),r=new FileReader;r.addEventListener("load",this.j.bind(this,i)),r.readAsText(i)}}function yd(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}function ud(t){var e=t.v;e&&(e=t.target||e.a,t.a=[g(e,"drop",hd,t),g(e,"dragenter",yd,t),g(e,"dragover",yd,t),g(e,"drop",yd,t)])}function cd(t){t.a&&(t.a.forEach(Ze),t.a=null)}si.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e(ld,Lr),ld.prototype.j=function(t,e){e=e.target.result;for(var o=this.v,i=(i=this.o)||o.Z().v,r=[],n=0,p=(o=this.g).length;n<p;++n){var s=new o[n],a={featureProjection:i};try{r=s.Oa(e,a)}catch(t){r=null}if(r&&0<r.length)break}this.b(new dd(fd,t,r,i))},ld.prototype.Ha=function(t){Lr.prototype.Ha.call(this,t),(t?ud:cd)(this)},ld.prototype.setMap=function(t){cd(this),Lr.prototype.setMap.call(this,t),this.c()&&ud(this)};var fd="addfeatures";function dd(t,e,o,i){_e.call(this,t),this.features=o,this.file=e,this.projection=i}function gd(t){t=t||{},zr.call(this,{handleDownEvent:bd,handleDragEvent:vd,handleUpEvent:md}),this.l=t.condition||Kr,this.a=this.g=void 0,this.j=0,this.u=void 0!==t.duration?t.duration:400}function vd(t){var e,o,i;Vr(t)&&(o=(e=t.map).Ob(),t=(i=t.pixel)[0]-o[0]/2,i=o[1]/2-i[1],o=Math.atan2(i,t),t=Math.sqrt(t*t+i*i),(e=e.Z()).g.rotation!==Gi&&void 0!==this.g&&(i=o-this.g,Rr(e,e.Qa()-i)),this.g=o,void 0!==this.a&&(o=this.a*(e.Pa()/t),Nr(e,o)),void 0!==this.a&&(this.j=this.a/t),this.a=t)}function md(t){if(!Vr(t))return!0;Ar(t=t.map.Z(),1,-1);var e=this.j-1,o=t.Qa(),o=t.constrainRotation(o,0),o=(Rr(t,o,void 0,void 0),t.Pa()),i=this.u,o=t.constrainResolution(o,0,e);return Nr(t,o,void 0,i),this.j=0,!1}function bd(t){return!(!Vr(t)||!this.l(t)||(Ar(t.map.Z(),1,1),this.a=this.g=void 0))}function xd(t,e,o,i){this.fb=t,this.Ua=e,this.overlaps=i,this.c=0,this.resolution=o,this.ra=this.oa=null,this.a=[],this.coordinates=[],this.T=Kn(),this.b=[],this.B=null,this.fa=Kn(),this.na=Kn()}function wd(t,e,o,i,r,n,p){for(var s=t.coordinates.length,a=t.Sf(),l=(p&&(o+=r),p=[e[o],e[o+1]],[NaN,NaN]),h=!0,y=o+r;y<i;y+=r){l[0]=e[y],l[1]=e[y+1];var u=dt(a,l),h=u!==c?(h&&(t.coordinates[s++]=p[0],t.coordinates[s++]=p[1]),t.coordinates[s++]=l[0],t.coordinates[s++]=l[1],!1):1!==u||(t.coordinates[s++]=l[0],t.coordinates[s++]=l[1],!1),c=(p[0]=l[0],p[1]=l[1],u)}return(n&&h||y===o+r)&&(t.coordinates[s++]=p[0],t.coordinates[s++]=p[1]),s}function Sd(t,e){t.oa=[0,e,0],t.a.push(t.oa),t.ra=[0,e,0],t.b.push(t.ra)}function Pd(t,e,o,i,r,n,p,s,a){var l;t.B&&X(i,t.T)?l=t.B:(t.B||(t.B=[]),l=ir(t.coordinates,0,t.coordinates.length,2,i,t.B),zn(t.T,i)),i=!Wt(n);for(var h,y,u=0,O=p.length,c=0,f=t.fa,d=t.na,g=0,v=0,m=t.a!=p||t.overlaps?0:200;u<O;)switch((N=p[u])[0]){case 0:c=N[1],i&&n[q(c).toString()]||!c.V()?u=N[2]:void 0===a||kt(a,c.V().G())?++u:u=N[2]+1;break;case 1:m<g&&(t.Va(e,r),g=0),m<v&&(e.stroke(),v=0),g||v||(e.beginPath(),h=y=NaN),++u;break;case 2:b=l[c=N[1]],N=l[c+1],C=l[c+2]-b,c=l[c+3]-N,c=Math.sqrt(C*C+c*c),e.moveTo(b+c,N),e.arc(b,N,c,0,2*Math.PI,!0),++u;break;case 3:e.closePath(),++u;break;case 4:c=N[1];var b=N[2],x=N[3],w=N[4]*o,S=N[5]*o,P=N[6],M=N[7],T=N[8],E=N[9],A=N[10],C=N[11],j=N[12],L=N[13],R=N[14];for(A&&(C+=r);c<b;c+=2){var F,N=l[c]-w,A=l[c+1]-S,I=(L&&(N=Math.round(N),A=Math.round(A)),1==j&&!C||(Yn(f,F=N+w,I=A+S,j,j,C,-F,-I),e.setTransform.apply(e,f)),F=e.globalAlpha,1!=M&&(e.globalAlpha=F*M),R+T>x.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);c<b;c+=2){for(N=l[c]+P,A=l[c+1]+M,1==j&&!C||(Yn(f,N,A,j,j,C,-N,-A),e.setTransform.apply(e,f)),1<(E=(T=S.split("\n")).length)?A-=(E-1)/2*(L=Math.round(1.5*e.measureText("M").width)):L=0,R=0;R<E;R++)F=T[R],w&&e.strokeText(F,N,A),x&&e.fillText(F,N,A),A+=L;1==j&&!C||e.setTransform.apply(e,d)}++u;break;case 6:if(s&&(c=s(c=N[1])))return c;++u;break;case 7:m?g++:t.Va(e,r),++u;break;case 8:for(c=N[1],b=N[2],N=l[c],j=(A=l[c+1])+.5|0,(C=N+.5|0)===h&&j===y||(e.moveTo(N,A),h=C,y=j),c+=2;c<b;c+=2)C=(N=l[c])+.5|0,j=(A=l[c+1])+.5|0,c!=b-2&&C===h&&j===y||(e.lineTo(N,A),h=C,y=j);++u;break;case 9:t.R=N[2],g&&(t.Va(e,r),g=0,v)&&(e.stroke(),v=0),e.fillStyle=N[1],++u;break;case 10:var c=void 0===N[8]||N[8],k=N[9];b=N[2],v&&(e.stroke(),v=0),e.strokeStyle=N[1],e.lineWidth=c?b*o:b,e.lineCap=N[3],e.lineJoin=N[4],e.miterLimit=N[5],ti&&(b=N[6],C=N[7],c&&o!==k&&(b=b.map(function(t){return t*o/k}),C*=o/k,N[6]=b,N[7]=C,N[9]=o),e.lineDashOffset=C,e.setLineDash(b)),++u;break;case 11:e.font=N[1],e.textAlign=N[2],e.textBaseline=N[3],++u;break;case 12:m?v++:e.stroke(),++u;break;default:++u}g&&t.Va(e,r),v&&e.stroke()}function Md(t){var e=t.b;e.reverse();for(var o=e.length,i=-1,r=0;r<o;++r){var n=e[r],p=n[0];if(6==p)i=r;else if(0==p){for(n[2]=r,n=t.b,p=r;i<p;){var s=n[i];n[i]=n[p],n[p]=s,++i,--p}i=-1}}}function Td(t,e){t.oa[2]=t.a.length,t.oa=null,t.ra[2]=t.b.length,t.ra=null,t.a.push(e=[6,e]),t.b.push(e)}function Ed(t,e,o,i){xd.call(this,t,e,o,i),this.M=this.I=null,this.C=this.D=this.S=this.u=this.v=this.l=this.o=this.j=this.g=this.f=this.i=void 0}function Ad(t,e,o,i){xd.call(this,t,e,o,i),this.f=null,this.i={Md:void 0,Gd:void 0,Hd:null,Id:void 0,Jd:void 0,Kd:void 0,Ld:void 0,eg:0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}}function Cd(t,e,o,i){xd.call(this,t,e,o,i),this.f=null,this.i={oh:void 0,Md:void 0,Gd:void 0,Hd:null,Id:void 0,Jd:void 0,Kd:void 0,Ld:void 0,fillStyle:void 0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}}function jd(t,e){var o,i=t.i,r=i.fillStyle,n=i.strokeStyle,p=i.lineCap,s=i.lineDash,a=i.lineDashOffset,l=i.lineJoin,h=i.lineWidth,y=i.miterLimit;void 0===r||"string"==typeof r&&i.oh==r||(o=[9,r],"string"!=typeof r&&(e=e.G(),o.push([e[0],e[3]])),t.a.push(o),i.oh=i.fillStyle),void 0===n||i.Md==n&&i.Gd==p&&X(i.Hd,s)&&i.Id==a&&i.Jd==l&&i.Kd==h&&i.Ld==y||(t.a.push([10,n,h,p,l,y,s,a,!0,1]),i.Md=n,i.Gd=p,i.Hd=s,i.Id=a,i.Jd=l,i.Kd=h,i.Ld=y)}function Ld(t,e,o,i){xd.call(this,t,e,o,i),this.C=this.D=this.S=null,this.Ia="",this.o=this.j=0,this.l=void 0,this.u=this.v=0,this.g=this.f=this.i=null}function Rd(t,e,o,i,r){this.v=t,this.c=e,this.o=i,this.l=o,this.f=r,this.a={},this.g=xo(1,1),this.j=Kn()}e(dd,_e),e(gd,zr),e(xd,lp),xd.prototype.Va=function(t,e){var o;this.R&&(o=Hn(this.T,this.R.slice()),t.translate(o[0],o[1]),t.rotate(e)),t.fill(),this.R&&t.setTransform.apply(t,this.na)},xd.prototype.La=function(t,e,o,i,r){Pd(this,t,e,o,i,r,this.a,void 0,void 0)},xd.prototype.Te=Z,xd.prototype.Sf=function(){return this.Ua},e(Ed,xd),Ed.prototype.qc=function(t,e){var o,i;this.M&&(Sd(this,e),o=t.ga(),i=this.coordinates.length,t=wd(this,o,0,o.length,t.qa(),!1,!1),this.a.push([4,i,t,this.M,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),this.b.push([4,i,t,this.I,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),Td(this,e))},Ed.prototype.oc=function(t,e){var o,i;this.M&&(Sd(this,e),o=t.ga(),i=this.coordinates.length,t=wd(this,o,0,o.length,t.qa(),!1,!1),this.a.push([4,i,t,this.M,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),this.b.push([4,i,t,this.I,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),Td(this,e))},Ed.prototype.Te=function(){Md(this),this.f=this.i=void 0,this.M=this.I=null,this.C=this.D=this.u=this.v=this.l=this.o=this.j=this.S=this.g=void 0},Ed.prototype.Ub=function(t){var e=t.Hc(),o=t.ic(),i=t.qg(1),r=t.Y(1),n=t.Oc();this.i=e[0],this.f=e[1],this.I=i,this.M=r,this.g=o[1],this.j=t.f,this.o=n[0],this.l=n[1],this.v=t.l,this.u=t.g,this.S=t.a,this.D=t.v,this.C=o[0]},e(Ad,xd),Ad.prototype.Sf=function(){return this.f||(this.f=yt(this.Ua),0<this.c&&ht(this.f,this.resolution*(this.c+1)/2,this.f)),this.f},e(Cd,xd),Cd.prototype.Zb=function(t,e){var o,i=this.i,r=i.strokeStyle;void 0===i.fillStyle&&void 0===r||(jd(this,t),Sd(this,e),this.b.push([9,co(np)]),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,wd(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)),Td(this,e))},e(Ld,xd),Ld.prototype.yc=function(t,e,o,i,r,n){var p,s;""!==this.Ia&&this.g&&(this.i||this.f)&&(this.i&&(r=this.i,(p=this.S)&&p.fillStyle==r.fillStyle||(s=[9,r.fillStyle],this.a.push(s),this.b.push(s),p?p.fillStyle=r.fillStyle:this.S={fillStyle:r.fillStyle})),this.f&&(r=this.f,(p=this.D)&&p.lineCap==r.lineCap&&p.lineDash==r.lineDash&&p.lineDashOffset==r.lineDashOffset&&p.lineJoin==r.lineJoin&&p.lineWidth==r.lineWidth&&p.miterLimit==r.miterLimit&&p.strokeStyle==r.strokeStyle||(s=[10,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset,!1,1],this.a.push(s),this.b.push(s),p?(p.lineCap=r.lineCap,p.lineDash=r.lineDash,p.lineDashOffset=r.lineDashOffset,p.lineJoin=r.lineJoin,p.lineWidth=r.lineWidth,p.miterLimit=r.miterLimit,p.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,(p=this.C)&&p.font==r.font&&p.textAlign==r.textAlign&&p.textBaseline==r.textBaseline||(s=[11,r.font,r.textAlign,r.textBaseline],this.a.push(s),this.b.push(s),p?(p.font=r.font,p.textAlign=r.textAlign,p.textBaseline=r.textBaseline):this.C={font:r.font,textAlign:r.textAlign,textBaseline:r.textBaseline}),Sd(this,n),t=[5,r=this.coordinates.length,t=wd(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),Td(this,n))},Ld.prototype.Cb=function(t){var e,o,i,r,n,p,s,a,l;t?((o=t.Fa())?(o=bo((o=o.b)||np),this.i?this.i.fillStyle=o:this.i={fillStyle:o}):this.i=null,(p=t.Ga())?(o=p.a,i=p.f,r=p.i,s=p.g,a=p.j,n=p.c,p=p.o,i=void 0!==i?i:"round",r=r?r.slice():pp,s=void 0!==s?s:0,a=void 0!==a?a:"round",n=void 0!==n?n:1,p=void 0!==p?p:10,o=bo(o||sp),this.f?((l=this.f).lineCap=i,l.lineDash=r,l.lineDashOffset=s,l.lineJoin=a,l.lineWidth=n,l.miterLimit=p,l.strokeStyle=o):this.f={lineCap:i,lineDash:r,lineDashOffset:s,lineJoin:a,lineWidth:n,miterLimit:p,strokeStyle:o}):this.f=null,e=t.a,o=t.i,i=t.c,r=t.o,n=t.f,p=t.b,s=t.Na(),a=t.g,l=t.j,t=void 0!==e?e:"10px sans-serif",a=void 0!==a?a:"center",l=void 0!==l?l:"middle",this.g?((e=this.g).font=t,e.textAlign=a,e.textBaseline=l):this.g={font:t,textAlign:a,textBaseline:l},this.Ia=void 0!==s?s:"",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!==p?p:1):this.Ia=""},e(Rd,vp);var Fd={0:[[!0]]};function Nd(t,e,o){var i,r=Math.floor(t.length/2);if(r<=e)for(i=r;i<e;i++)t[i][o]=!0;else if(e<r)for(i=e+1;i<r;i++)t[i][o]=!0}function Id(t){for(var e in t.a){var o,i=t.a[e];for(o in i)i[o].Te()}}function kd(t,e){var o=t.c,i=(t=o[0],o[1]),r=o[2];return ir(t=[t,i,t,o=o[3],r,o,r,i],0,8,2,e,t),t}Rd.prototype.Ea=function(t,e,o,i,r,n){var p,s,a,l=2*(i=Math.round(i))+1,h=Yn(this.j,i+.5,i+.5,1/e,-1/e,-o,-t[0],-t[1]),y=this.g,u=(y.canvas.width!==l||y.canvas.height!==l?(y.canvas.width=l,y.canvas.height=l):y.clearRect(0,0,l,l),void 0!==this.f&&(Pt(p=gt(),t),ht(p,e*(this.f+i),p)),function(t){if(void 0!==Fd[t])return Fd[t];for(var e=2*t+1,o=Array(e),i=0;i<e;i++)o[i]=Array(e);for(var e=t,r=i=0;i<=e;)Nd(o,t+e,t+i),Nd(o,t+i,t+e),Nd(o,t-i,t+e),Nd(o,t-e,t+i),Nd(o,t-e,t-i),Nd(o,t-i,t-e),Nd(o,t+i,t-e),Nd(o,t+e,t-i),0<2*((r+=1+2*++i)-e)+1&&(r+=1-2*--e);return Fd[t]=o}(i)),c=this,f=y,d=h,g=o,v=r,m=function(t){for(var e=y.getImageData(0,0,l,l).data,o=0;o<l;o++)for(var i=0;i<l;i++)if(u[o][i]&&0<e[4*(i*l+o)+3])return(t=n(t))||void y.clearRect(0,0,l,l)},b=p,x=Object.keys(c.a).map(Number),w=(x.sort(function(t,e){return e-t}),0);for(s=x.length;w<s;++w){var S=c.a[x[w].toString()];for(a=gp.length-1;0<=a;--a){var P=S[gp[a]];if(void 0!==P&&(P=Pd(P,f,1,d,g,v,P.b,m,b)))return P}}},Rd.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 Od[e](this.v,this.c,this.l,this.o),t[e]=o),o},Rd.prototype.i=function(){return Wt(this.a)},Rd.prototype.La=function(t,e,o,i,r,n){var p=Object.keys(this.a).map(Number),s=(p.sort(U),kd(this,o));t.save(),t.beginPath(),t.moveTo(s[0],s[1]),t.lineTo(s[2],s[3]),t.lineTo(s[4],s[5]),t.lineTo(s[6],s[7]),t.clip(),n=n||gp;for(var s=0,a=p.length;s<a;++s)for(var l=this.a[p[s].toString()],h=0,y=n.length;h<y;++h){var u=l[n[h]];void 0!==u&&u.La(t,e,o,i,r)}t.restore()};var Od={Circle:Cd,Image:Ed,LineString:Ad,Polygon:Cd,Text:Ld};function Dd(t){eo.call(this),this.a=t}function Ud(t,e){var o=e.getState();return 2!=o&&3!=o&&g(e,"change",t.na,t),0==o&&(e.load(),o=e.getState()),2==o}function Gd(t){var e=t.a;e.Mb()&&"ready"==e.$f()&&t.s()}function Bd(t,e){e.Ki()&&t.postRenderFunctions.push(function(t,e,o){e=q(t).toString(),t.fd(o.viewState.projection,o.usedTiles[e])}.bind(null,e))}function Kd(t,e){if(e)for(var o=0,i=e.length;o<i;++o){var r=e[o];t[q(r).toString()]=r}}function Wd(t,e){void 0!==(e=e.D)&&("string"==typeof e?t.logos[e]="":e&&(_("string"==typeof e.href,44),_("string"==typeof e.src,45),t.logos[e.src]=e.href))}function Vd(t,e,o,i){e=q(e).toString(),o=o.toString(),e in t?o in t[e]?(t=t[e][o],i.ca<t.ca&&(t.ca=i.ca),t.$<i.$&&(t.$=i.$),i.da<t.da&&(t.da=i.da),t.ia<i.ia&&(t.ia=i.ia)):t[e][o]=i:(t[e]={},t[e][o]=i)}function Xd(t,e,o,i,r,n,p,s,a,l){for(var h,y=q(e).toString(),u=(y in t.wantedTiles||(t.wantedTiles[y]={}),t.wantedTiles[y]),c=(t=t.tileQueue,o.minZoom),f=p;c<=f;--f)for(var d,g=Re(o,n,f,g),v=o.Da(f),m=g.ca;m<=g.$;++m)for(h=g.da;h<=g.ia;++h)p-f<=s?(0==(d=e.Nc(f,m,h,i,r)).getState()&&(u[d.bb()]=!0,d.bb()in t.a||t.f([d,y,Fe(o,d.ta),v])),a&&a.call(l,d)):e.Ug(f,m,h,r)}function zd(t){Dd.call(this,t),this.fa=Kn()}function Hd(t,e,o){var i=e.pixelRatio,r=e.size[0]*i,n=e.size[1]*i,p=e.viewState.rotation,s=Ft(o),a=Nt(o),l=At(o);o=Et(o),Hn(e.coordinateToPixelTransform,s),Hn(e.coordinateToPixelTransform,a),Hn(e.coordinateToPixelTransform,l),Hn(e.coordinateToPixelTransform,o),t.save(),ap(t,-p,r/2,n/2),t.beginPath(),t.moveTo(s[0]*i,s[1]*i),t.lineTo(a[0]*i,a[1]*i),t.lineTo(l[0]*i,l[1]*i),t.lineTo(o[0]*i,o[1]*i),t.clip(),ap(t,p,r/2,n/2)}function Zd(t,e,o,i,r){var n,p,s,a=t.a;to(a,e)&&(n=i.size[0]*i.pixelRatio,p=i.size[1]*i.pixelRatio,ap(o,-(s=i.viewState.rotation),n/2,p/2),t=r||qd(t,i,0),a.b(new rp(e,new hp(o,i.pixelRatio,i.extent,t,i.viewState.rotation),i,o,null)),ap(o,s,n/2,p/2))}function qd(t,e,o){var i=e.viewState,r=e.pixelRatio,n=r/i.resolution;return Yn(t.fa,r*e.size[0]/2,r*e.size[1]/2,n,-n,-i.rotation,-i.center[0]+o,-i.center[1])}function Jd(t,e){return q(t)-q(e)}function Yd(t,e){return(t=.5*t/e)*t}function _d(t,e,o,i,r,n){var p,s,a=!1;return(p=o.Y())&&(2==(s=p.Ye())||3==s?p.Bj(r,n):(0==s&&p.load(),p.Nh(r,n),a=!0)),(r=(0,o.Za)(e))&&(i=r.Vd(i),(0,$d[i.U()])(t,i,o,e)),a}e(Dd,eo),Dd.prototype.Ea=Z,Dd.prototype.Ue=er,Dd.prototype.Nf=function(o,i,r){return function(e,t){return ov(o,i,e,t,function(t){r[e]||(r[e]={}),r[e][t.ta.toString()]=t})}},Dd.prototype.na=function(t){2===t.target.getState()&&Gd(this)},e(zd,Dd),zd.prototype.u=function(t,e,o,i){if(this.Ea(t,e,0,tr,this))return o.call(i,this.a,null)},zd.prototype.ef=function(t,e,o,i){Zd(this,"postcompose",t,e,i)};var $d={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(yl(e),0,2,2,e,i))},Polygon:function(t,e,o,i){var r,n=o.Fa(),p=o.Ga();(n||p)&&((r=t.b(o.Ba(),"Polygon")).Ma(n,p),r.rc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),t.yc(mr(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=ul(e),t.yc(o,0,o.length,2,e,i))},MultiPolygon:function(t,e,o,i){var r,n=o.Fa(),p=o.Ga();(p||n)&&((r=t.b(o.Ba(),"Polygon")).Ma(n,p),r.pc(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),o=fl(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;r<n;++r)(0,$d[e[r].U()])(t,e[r],o,i)},Circle:function(t,e,o,i){var r,n=o.Fa(),p=o.Ga();(n||p)&&((r=t.b(o.Ba(),"Circle")).Ma(n,p),r.Zb(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),t.yc(e.wa(),0,2,2,e,i))}};function Qd(t){zd.call(this,t),this.c=!1,this.v=-1,this.l=NaN,this.j=gt(),this.f=this.o=null,this.g=xo()}function tg(){this.b="precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"}e(Qd,zd),Qd.prototype.S=function(t,e,o){var i=t.extent,r=t.pixelRatio,n=e.Je?t.skippedFeatureUids:{},p=(s=t.viewState).projection,s=s.rotation,a=p.G(),l=this.a.ha(),h=qd(this,t,0),y=(Zd(this,"precompose",o,t,h),e.extent),u=void 0!==y;if(u&&Hd(o,t,y),(y=this.f)&&!y.i()){var c,f,d=0,g=0,v=(c=(f=to(this.a,"render")?(f=o.canvas.width,c=o.canvas.height,s&&(d=((v=Math.round(Math.sqrt(f*f+c*c)))-f)/2,g=(v-c)/2,f=c=v),this.g.canvas.width=f,this.g.canvas.height=c,this.g):o).globalAlpha,f.globalAlpha=e.opacity,f!=o&&f.translate(d,g),t.size[0]*r),m=t.size[1]*r;if(ap(f,-s,v/2,m/2),y.La(f,r,h,s,n),l.u&&p.i&&!ct(a,i)){for(var p=i[0],l=It(a),b=0;p<a[0];)h=qd(this,t,h=l*--b),y.La(f,r,h,s,n),p+=l;for(b=0,p=i[2];p>a[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;i<r;++i)o=_d(s,t,e[i],Yd(n,p),this.D,this)||o;else o=_d(s,t,e,Yd(n,p),this.D,this)||o;t=o,this.c=this.c||t}}var o,n,p,i,s,r,a=this.a,l=a.ha(),h=(Kd(t.attributions,l.j),Wd(t,l),t.viewHints[0]),y=t.viewHints[1],u=a.T,c=a.na;return!this.c&&!u&&h||!c&&y||(o=t.extent,h=(c=t.viewState).projection,n=c.resolution,p=t.pixelRatio,y=a.i,i=a.c,void 0===(u=a.get(ag))&&(u=Jd),o=ht(o,i*n),i=c.projection.G(),l.u&&c.projection.i&&!ct(i,t.extent)&&(t=Math.max(It(o)/2,It(i)),o[0]=i[0]-t,o[2]=i[2]+t),!this.c&&this.l==n&&this.v==y&&this.o==u&&ct(this.j,o))||(this.f=null,this.c=!1,s=new Rd(.5*n/p,o,n,l.T,a.c),l.Yd(o,n,h),u?(r=[],l.$b(o,function(t){r.push(t)},this),r.sort(u),r.forEach(e,this)):l.$b(o,e,this),Id(s),this.l=n,this.v=y,this.o=u,this.j=o,this.f=s),!0},e(tg,bp);var eg=new tg;function og(){this.b="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}"}e(og,xp);var ig=new og;function rg(t,e){this.i=t.getUniformLocation(e,"f"),this.c=t.getUniformLocation(e,"e"),this.g=t.getUniformLocation(e,"d"),this.f=t.getUniformLocation(e,"g"),this.b=t.getAttribLocation(e,"b"),this.a=t.getAttribLocation(e,"c")}function ng(t,e){Dd.call(this,e),this.c=t,this.T=new Cp([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.g=this.Ib=null,this.j=void 0,this.v=Kn(),this.S=Kn(),this.C=Pp(),this.u=null}function pg(t,e,o,i){var r;to(t=t.a,e)&&(r=i.viewState,t.b(new rp(e,new ea(o,r.center,r.resolution,r.rotation,i.size,i.extent,i.pixelRatio),i,null,o)))}function sg(t,e){ng.call(this,t,e),this.l=!1,this.R=-1,this.I=NaN,this.D=gt(),this.o=this.f=this.B=null}function S(t){var e=Gt({},t=t||{});delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,o.call(this,e),this.c=void 0!==t.renderBuffer?t.renderBuffer:100,this.u=null,this.f=void 0,this.g(t.style),this.T=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.na=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}e(ng,Dd),ng.prototype.Gi=function(t,e,o){pg(this,"precompose",o,t),Ip(o,34962,this.T);var i,r=o.b,n=Up(o,eg,ig);this.u?i=this.u:this.u=i=new rg(r,n),o.Qc(n)&&(r.enableVertexAttribArray(i.b),r.vertexAttribPointer(i.b,2,5126,!1,16,0),r.enableVertexAttribArray(i.a),r.vertexAttribPointer(i.a,2,5126,!1,16,8),r.uniform1i(i.f,0)),r.uniformMatrix4fv(i.g,!1,Mp(this.C,this.v)),r.uniformMatrix4fv(i.c,!1,Mp(this.C,this.S)),r.uniform1f(i.i,e.opacity),r.bindTexture(3553,this.Ib),r.drawArrays(5,0,4),pg(this,"postcompose",o,t)},ng.prototype.mg=function(){this.g=this.Ib=null,this.j=void 0},e(sg,ng),sg.prototype.Gi=function(t,e,o){this.o=e;var i=t.viewState,r=this.f,n=t.size,p=t.pixelRatio,s=this.c.i;r&&!r.i()&&(s.enable(s.SCISSOR_TEST),s.scissor(0,0,n[0]*p,n[1]*p),r.La(o,i.center,i.resolution,i.rotation,n,p,e.opacity,e.Je?t.skippedFeatureUids:{}),s.disable(s.SCISSOR_TEST))},e(S,o),S.prototype.Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new Qd(this):"webgl"===o&&(e=new sg(t,this)),e},S.prototype.D=function(){return this.u},S.prototype.C=function(){return this.f},S.prototype.g=function(t){this.u=void 0!==t?t:Da,this.f=null===t?void 0:ka(this.u),this.s()};var ag="renderOrder";function lg(){return[[-1/0,-1/0,1/0,1/0]]}function hg(t){oo.call(this),this.c=ge(t.projection),this.j=yg(t.attributions),this.D=t.logo,this.na=void 0!==t.state?t.state:"ready",this.u=void 0!==t.wrapX&&t.wrapX}function yg(t){if("string"==typeof t)return[new Ue({html:t})];if(t instanceof Ue)return[t];if(Array.isArray(t)){for(var e=t.length,o=Array(e),i=0;i<e;i++){var r=t[i];o[i]="string"==typeof r?new Ue({html:r}):r}return o}return null}function ug(t,e){t.na=e,t.s()}function P(t){hg.call(this,{attributions:(t=t||{}).attributions,logo:t.logo,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.B=Z,this.C=t.format,this.T=null==t.overlaps||t.overlaps,this.I=t.url,t.loader?this.B=t.loader:void 0!==this.I&&(_(this.C,7),this.B=rl(this.I,this.C)),this.fa=t.strategy||lg;var e,o,i,r,n=void 0===t.useSpatialIndex||t.useSpatialIndex;this.a=n?new Ns:null,this.R=new Ns,this.g={},this.o={},this.l={},this.v={},this.f=null,t.features instanceof y?o=(e=t.features).a:Array.isArray(t.features)&&(o=t.features),n||(e=e||new y(o)),o&&dg(this,o),e&&(i=e,r=!1,g(t=this,"addfeature",function(t){r||(r=!0,i.push(t.feature),r=!1)}),g(t,"removefeature",function(t){r||(r=!0,i.remove(t.feature),r=!1)}),g(i,"add",function(t){r||(r=!0,this.yb(t.element),r=!1)},t),g(i,"remove",function(t){r||(r=!0,this.Gb(t.element),r=!1)},t),t.f=i)}function cg(t,e,o){t.v[e]=[g(o,"change",t.Oi,t),g(o,"propertychange",t.Oi,t)]}function fg(t,e,o){var i=!0,r=o.a;return void 0!==r?r.toString()in t.o?i=!1:t.o[r.toString()]=o:(_(!(e in t.l),30),t.l[e]=o),i}function dg(t,e){for(var o=[],i=[],r=[],n=0,p=e.length;n<p;n++){var s=e[n],a=q(s).toString();fg(t,a,s)&&i.push(s)}for(n=0,p=i.length;n<p;n++)cg(t,a=q(s=i[n]).toString(),s),(e=s.V())?(a=e.G(),o.push(a),r.push(s)):t.g[a]=s;for(t.a&&t.a.load(o,r),n=0,p=i.length;n<p;n++)t.b(new gg("addfeature",i[n]))}function gg(t,e){_e.call(this,t),this.feature=e}function vg(t){var e;zr.call(this,{handleDownEvent:bg,handleEvent:mg,handleUpEvent:xg}),this.T=!1,this.fa=null,this.u=!1,this.Yb=t.source||null,this.$a=t.features||null,this.wk=t.snapTolerance||12,this.R=t.type,this.g=("Point"===(n=this.R)||"MultiPoint"===n?e=Ag:"LineString"===n||"MultiLineString"===n?e=Cg:"Polygon"===n||"MultiPolygon"===n?e=jg:"Circle"===n&&(e=Lg),e),this.Sa=t.minPoints||(this.g===jg?3:2),this.va=t.maxPoints||1/0,this.Cf=t.finishCondition||tr;var o,i,r,n=(n=t.geometryFunction)||("Circle"===this.R?function(t,e){return(e=e||new w([NaN,NaN])).Ng(t[0],Math.sqrt(Yi(t[0],t[1]))),e}:((i=this.g)===Ag?o=p:i===Cg?o=m:i===jg&&(o=s),function(t,e){return e?i===jg?e.ma([t[0].concat([t[0][0]])]):e.ma(t):e=new o(t),e}));this.Za=n,this.I=this.C=this.a=this.B=this.j=this.l=null,this.ad=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.pa=new S({source:new P({useSpatialIndex:!1,wrapX:t.wrapX||!1}),style:t.style||(r=Ua(),function(t){return r[t.V().U()]})}),this.xb=t.geometryName,this.vk=t.condition||Br,this.Df=t.freehand?tr:t.freehandCondition||Kr,g(this,ro("active"),this.ri,this)}function mg(t){this.u=this.g!==Ag&&this.Df(t);var e=!this.u;return this.u&&"pointerdrag"===t.type&&null!==this.j?(Mg(this,t),e=!1):"pointermove"===t.type?e=wg(this,t):"dblclick"===t.type&&(e=!1),Zr.call(this,t)&&e}function bg(t){return this.T=!this.u,this.u?(this.fa=t.pixel,this.l||Pg(this,t),!0):!!this.vk(t)&&(this.fa=t.pixel,!0)}function xg(t){var e=!0,o=(wg(this,t),this.g===Lg);return this.T?(this.l?this.u||o?this.Pd():Sg(this,t)?this.Cf(t)&&this.Pd():Mg(this,t):(Pg(this,t),this.g===Ag&&this.Pd()),e=!1):this.u&&(this.l=null,Tg(this)),e}function wg(t,e){var o,i,r;return t.fa&&(!t.u&&t.T||t.u&&!t.T)&&(o=e.pixel,r=(r=(i=t.fa)[0]-o[0])*r+(i=i[1]-o[1])*i,t.T=t.u?t.ad<r:r<=t.ad),t.l?(r=e.coordinate,i=t.j.V(),t.g===Ag?o=t.a:t.g===jg?(o=(o=t.a[0])[o.length-1],Sg(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 s&&t.g!==jg?(t.C||(t.C=new v(new m(null))),r=i.Ch(0),(e=t.C.V()).ba(r.ja,r.ga())):t.I&&(e=t.C.V()).ma(t.I),Eg(t)):(e=e.coordinate.slice(),t.B?t.B.V().ma(e):(t.B=new v(new p(e)),Eg(t))),!0}function Sg(t,e){var o=!1;if(t.j){var i=!1,r=[t.l];if(t.g===Cg?i=t.a.length>t.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<p;n++){var s=r[n],a=i.Ja(s),l=e.pixel,o=l[0]-a[0],a=l[1]-a[1];if(o=Math.sqrt(o*o+a*a)<=(t.u?1:t.wk)){t.l=s;break}}}return o}function Pg(t,e){e=e.coordinate,t.l=e,t.g===Ag?t.a=e.slice():t.g===jg?(t.a=[[e.slice(),e.slice()]],t.I=t.a[0]):(t.a=[e.slice(),e.slice()],t.g===Lg&&(t.I=t.a)),t.I&&(t.C=new v(new m(t.I))),e=t.Za(t.a),t.j=new v,t.xb&&t.j.Tc(t.xb),t.j.Ra(e),Eg(t),t.b(new Rg("drawstart",t.j))}function Mg(t,e){e=e.coordinate;var o,i,r=t.j.V();t.g===Cg?(t.l=e.slice(),(i=t.a).length>=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?o<e?r[1]:r[0]:n}return null}function Bg(t,e){var o=t.B;o?o.V().ma(e):(o=new v(new p(e)),t.B=o,t.I.ha().yb(o))}function Kg(t){_e.call(this,Wg),this.b=t}e(Rg,_e),e(Fg,zr),Fg.prototype.setMap=function(t){this.u.setMap(t),this.I.setMap(t),zr.prototype.setMap.call(this,t)},Fg.prototype.G=function(){return this.j},Fg.prototype.g=function(t){this.j=t||null;var e=this.l;e?t?e.Ra(xr(t)):e.Ra(void 0):(this.l=e=new v(t?xr(t):{}),this.u.ha().yb(e)),this.b(new Kg(this.j))},e(Kg,_e);var Wg="extentchanged";function Vg(t){var e;zr.call(this,{handleDownEvent:Zg,handleDragEvent:qg,handleEvent:Yg,handleUpEvent:Jg}),this.ad=t.condition||Xr,this.$a=function(t){return Br(t)&&Gr(t)},this.xb=t.deleteCondition||this.$a,this.Yb=t.insertVertexCondition||tr,this.Sa=this.g=null,this.va=[0,0],this.C=this.I=!1,this.a=new Ns,this.fa=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.l=this.pa=!1,this.j=[],this.B=new S({source:new P({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style||(e=Ua(),function(){return e.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.T={Point:this.Dn,LineString:this.ti,LinearRing:this.ti,Polygon:this.En,MultiPoint:this.Bn,MultiLineString:this.An,MultiPolygon:this.Cn,Circle:this.yn,GeometryCollection:this.zn},this.u=t.features,this.u.forEach(this.kg,this),g(this.u,"add",this.wn,this),g(this.u,"remove",this.xn,this),this.R=null}function Xg(t,e){t.C||(t.C=!0,t.b(new t0("modifystart",t.u,e)))}function zg(t,e){var o=t.g;o?o.V().ma(e):(o=new v(new p(e)),t.g=o,t.B.ha().yb(o))}function Hg(t,e){return t.index-e.index}function Zg(t){if(!this.ad(t))return!1;_g(this,t.pixel,t.map);var e=t.map.Wa(t.pixel);if(this.j.length=0,this.C=!1,o=this.g){var o,i=[],r=lt([o=o.V().X()]),n={};(r=ks(this.a,r)).sort(Hg);for(var p=0,s=r.length;p<s;++p){var a=r[p],l=a.la,h=q(a.feature),y=a.depth;y&&(h+="-"+y.join("-")),n[h]||(n[h]=Array(2)),"Circle"===a.geometry.U()&&1===a.index?Zi(l=Qg(e,a),o)&&!n[h][0]&&(this.j.push([a,0]),n[h][0]=a):Zi(l[0],o)&&!n[h][0]?(this.j.push([a,0]),n[h][0]=a):Zi(l[1],o)&&!n[h][1]?("LineString"===a.geometry.U()||"MultiLineString"===a.geometry.U())&&n[h][0]&&0===n[h][0].index||(this.j.push([a,1]),n[h][1]=a):this.Yb(t)&&q(l)in this.Sa&&!n[h][0]&&!n[h][1]&&i.push([a,o])}for(i.length&&Xg(this,t),t=i.length-1;0<=t;--t)this.bm.apply(this,i[t])}return!!this.g}function qg(t){this.I=!1,Xg(this,t),t=t.coordinate;for(var e=0,o=this.j.length;e<o;++e){for(var i,r=(a=this.j[e])[0],n=r.depth,p=r.geometry,s=r.la,a=a[1];t.length<p.qa();)t.push(s[a][t.length]);switch(p.U()){case"Point":i=t,s[0]=s[1]=t;break;case"MultiPoint":(i=p.X())[r.index]=t,s[0]=s[1]=t;break;case"LineString":(i=p.X())[r.index+a]=t,s[a]=t;break;case"MultiLineString":case"Polygon":(i=p.X())[n[0]][r.index+a]=t,s[a]=t;break;case"MultiPolygon":(i=p.X())[n[1]][n[0]][r.index+a]=t,s[a]=t;break;case"Circle":s[0]=s[1]=t,0===r.index?(this.l=!0,p.ob(t)):(this.l=!0,p.Uc(_i(p.wa(),t))),this.l=!1}i&&(r=p,n=i,this.l=!0,r.ma(n),this.l=!1)}zg(this,t)}function Jg(t){for(var e,o,i,r,n=this.j.length-1;0<=n;--n)"Circle"===(e=(r=this.j[n][0]).geometry).U()?(o=e.wa(),i=r.Pf[0],r=r.Pf[1],i.la[0]=i.la[1]=o,r.la[0]=r.la[1]=o,Is(this.a,bt(o),i),Is(this.a,e.G(),r)):Is(this.a,lt(r.la),r);return this.C&&(this.b(new t0("modifyend",this.u,t)),this.C=!1),!1}function Yg(t){var e;return!(t instanceof ci)||(Tr((this.R=t).map.Z())[1]||"pointermove"!=t.type||this.D||(this.va=t.pixel,_g(this,t.pixel,t.map)),this.g&&this.xb(t)&&(e=!("singleclick"!=t.type||!this.I)||this.hj()),"singleclick"==t.type&&(this.I=!1),Zr.call(this,t)&&!e)}function _g(t,e,o){var i=o.Wa(e),r=ht(bt(i),o.Z().Pa()*t.fa);if(0<(r=ks(t.a,r)).length){r.sort(function(t,e){return $g(i,t)-$g(i,e)});var n,p=r[0],s=p.la,a=Qg(i,p),l=o.Ja(a);if(_i(e,l)<=t.fa){if(e={},"Circle"===p.geometry.U()&&1===p.index)t.pa=!0,zg(t,a);else for(n=o.Ja(s[0]),p=o.Ja(s[1]),o=Yi(l,n),l=Yi(l,p),n=Math.sqrt(Math.min(o,l)),t.pa=n<=t.fa,zg(t,a=t.pa?l<o?s[1]:s[0]:a),l=1,o=r.length;l<o&&(a=r[l].la,Zi(s[0],a[0])&&Zi(s[1],a[1])||Zi(s[0],a[1])&&Zi(s[1],a[0]));++l)e[q(a)]=!0;return e[q(s)]=!0,void(t.Sa=e)}}t.g&&(t.B.ha().Gb(t.g),t.g=null)}function $g(t,e){var o=e.geometry;return"Circle"===o.U()&&1===e.index?(t=Yi(o.wa(),t),(o=Math.sqrt(t)-o.pd())*o):$i(t,e.la)}function Qg(t,e){var o=e.geometry;return"Circle"===o.U()&&1===e.index?o.Ab(t):Xi(t,e.la)}function t0(t,e,o){_e.call(this,t),this.features=e,this.mapBrowserEvent=o}function e0(t){var e,o;Lr.call(this,{handleEvent:o0}),this.C=(t=t||{}).condition||Gr,this.D=t.addCondition||er,this.B=t.removeCondition||er,this.I=t.toggleCondition||Kr,this.l=t.multi||!1,this.o=t.filter||tr,this.j=t.hitTolerance||0,this.g=new S({source:new P({useSpatialIndex:!1,features:t.features,wrapX:t.wrapX}),style:t.style||(K((e=Ua()).Polygon,e.LineString),K(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 G(o,t)}):tr,this.u=t,this.a={},g(t=this.g.ha().f,"add",this.Fn,this),g(t,"remove",this.Jn,this)}function o0(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,p=this.g.ha().f,s=[],a=[];if(e){for(Bt(this.a),n.we(t.pixel,function(t,e){if(this.o(t,e))return a.push(t),t=q(t),this.a[t]=e,!this.l}.bind(this),{layerFilter:this.u,hitTolerance:this.j}),e=p.dc()-1;0<=e;--e){var n=p.item(e),l=a.indexOf(n);-1<l?a.splice(l,1):(p.remove(n),s.push(n))}a.length&&p.fg(a)}else{for(n.we(t.pixel,function(t,e){if(this.o(t,e))return!o&&!r||G(p.a,t)?(i||r)&&G(p.a,t)&&(s.push(t),e=q(t),delete this.a[e]):(a.push(t),t=q(t),this.a[t]=e),!this.l}.bind(this),{layerFilter:this.u,hitTolerance:this.j}),e=s.length-1;0<=e;--e)p.remove(s[e]);p.fg(a)}return(0<a.length||0<s.length)&&this.b(new i0(r0,a,s,t)),Ur(t)}function i0(t,e,o,i){_e.call(this,t),this.selected=e,this.deselected=o,this.mapBrowserEvent=i}e(Vg,zr),Vg.prototype.kg=function(t){var e=t.V();e&&e.U()in this.T&&this.T[e.U()].call(this,t,e),(e=this.v)&&e.c&&this.c()&&_g(this,this.va,e),g(t,"change",this.si,this)},e(t0,_e),e(e0,Lr),e0.prototype.Gn=function(){return this.g.ha().f},e(i0,_e);var r0="select";function n0(t){zr.call(this,{handleEvent:s0,handleDownEvent:tr,handleUpEvent:a0}),this.l=(t=t||{}).source||null,this.R=void 0===t.vertex||t.vertex,this.C=void 0===t.edge||t.edge,this.j=t.features||null,this.pa=[],this.B={},this.T={},this.u={},this.I=null,this.g=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.va=function(t,e){return $i(this.I,t.la)-$i(this.I,e.la)}.bind(this),this.a=new Ns,this.fa={Point:this.Rn,LineString:this.wi,LinearRing:this.wi,Polygon:this.Sn,MultiPoint:this.Pn,MultiLineString:this.On,MultiPolygon:this.Qn,GeometryCollection:this.Nn,Circle:this.Mn}}function p0(t,e,o,i){var r,n,p,s,a,l,h=i.Wa([e[0]-t.g,e[1]+t.g]),y=i.Wa([e[0]+t.g,e[1]-t.g]),h=lt([h,y]),u=ks(t.a,h),c=!1,h=!1,f=y=null;return 0<(u=t.R&&!t.C?u.filter(function(t){return"Circle"!==t.feature.V().U()}):u).length&&(t.I=o,u.sort(t.va),r=u[0].la,c="Circle"===u[0].feature.V().U(),t.R&&!t.C?(o=i.Ja(r[0]),c=i.Ja(r[1]),o=Yi(e,o),e=Yi(e,c),(c=(c=Math.sqrt(Math.min(o,e)))<=t.g)&&(h=!0,y=e<o?r[1]:r[0],f=i.Ja(y))):t.C&&(y=c?(n=o,u=u[0].feature.V(),p=u.pd(),u=(s=u.wa())[0],s=s[1],a=n[0]-u,n=n[1]-s,a||n||(a=1),l=Math.sqrt(a*a+n*n),[u+p*a/l,s+p*n/l]):Xi(o,r),_i(e,f=i.Ja(y))<=t.g)&&(h=!0,t.R)&&!c&&(o=i.Ja(r[0]),c=i.Ja(r[1]),o=Yi(f,o),e=Yi(f,c),c=(c=Math.sqrt(Math.min(o,e)))<=t.g)&&(y=e<o?r[1]:r[0],f=i.Ja(y)),h)&&(f=[Math.round(f[0]),Math.round(f[1])]),{nq:h,vertex:y,wq:f}}function s0(t){var e=p0(this,t.pixel,t.coordinate,t.map);return e.nq&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.wq),Zr.call(this,t)}function a0(){var t=Kt(this.u);return t.length&&(t.forEach(this.Dj,this),this.u={}),!1}function l0(t){var e,o;zr.call(this,{handleDownEvent:h0,handleDragEvent:u0,handleMoveEvent:c0,handleUpEvent:y0}),t=t||{},this.a=null,this.j=void 0!==t.features?t.features:null,o=t.layers?"function"==typeof t.layers?t.layers:(e=t.layers,function(t){return G(e,t)}):tr,this.C=o,this.l=t.hitTolerance||0,this.g=null,g(this,ro("active"),this.u,this)}function h0(t){var e;return this.g=f0(this,t.pixel,t.map),!(this.a||!this.g||(this.a=t.coordinate,c0.call(this,t),e=this.j||new y([this.g]),this.b(new g0("translatestart",e,t.coordinate)),0))}function y0(t){var e;return!!this.a&&(this.a=null,c0.call(this,t),e=this.j||new y([this.g]),this.b(new g0("translateend",e,t.coordinate)),!0)}function u0(t){var o,i,e;this.a&&(o=(t=t.coordinate)[0]-this.a[0],i=t[1]-this.a[1],(e=this.j||new y([this.g])).forEach(function(t){var e=t.V();e.translate(o,i),t.Ra(e)}),this.a=t,this.b(new g0("translating",e,t)))}function c0(t){var e=t.map.a;f0(this,t.pixel,t.map)?(e.classList.remove(this.a?"ol-grab":"ol-grabbing"),e.classList.add(this.a?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}function f0(t,e,o){return o.we(e,function(t){if(!this.j||G(this.j.a,t))return t}.bind(t),{layerFilter:t.C,hitTolerance:t.l})}function d0(t,e){var o=t.v;t=t.c(),o&&t||(o=o||e).a.classList.remove("ol-grab","ol-grabbing")}function g0(t,e,o){_e.call(this,t),this.features=e,this.coordinate=o}function M(t){var e=Gt({},t=t||{}),o=(delete e.gradient,delete e.radius,delete e.blur,delete e.shadow,delete e.weight,S.call(this,e),this.j=null,this.R=void 0!==t.shadow?t.shadow:250,this.I=void 0,this.B=null,g(this,ro(b0),this.Bl,this),this.pj(t.gradient||v0),this.jj(void 0!==t.blur?t.blur:15),this.Uc(void 0!==t.radius?t.radius:8),g(this,ro(m0),this.cg,this),g(this,ro(x0),this.cg,this),this.cg(),t.weight||"weight"),i="string"==typeof o?function(t){return t.get(o)}:o;this.g(function(t){var e=255*(t=void 0!==(t=i(t))?et(t,0,1):1)|0,o=this.B[e];return o||(o=[new Ia({image:new vy({opacity:t,src:this.I})})],this.B[e]=o),o}.bind(this)),this.set(ag,null),g(this,"render",this.Sl,this)}e(n0,zr),n0.prototype.yb=function(t,e){e=void 0===e||e;var o,i=q(t),r=t.V();r&&(o=this.fa[r.U()])&&(this.T[i]=r.G(gt()),o.call(this,t,r)),e&&(this.B[i]=g(t,"change",this.Ln,this))},e(l0,zr),l0.prototype.B=function(){return this.l},l0.prototype.I=function(t){this.l=t},l0.prototype.setMap=function(t){var e=this.v;zr.prototype.setMap.call(this,t),d0(this,e)},l0.prototype.u=function(){d0(this,null)},e(g0,_e),e(M,S);var v0=["#00f","#0ff","#0f0","#ff0","#f00"],m0=(M.prototype.uh=function(){return this.get(m0)},"blur"),b0="gradient",x0="radius";function w0(t){zd.call(this,t),this.v=Kn(),this.j=null}function S0(t){w0.call(this,t),this.M=null,this.c=Kn()}function P0(t,e,o,i){var r=Se(o,e,t);return o=he(e,i,o),void 0!==(e=e.sc())&&(o*=e),void 0!==(e=t.sc())&&(o/=e),t=he(t,o,r)/o,isFinite(t)&&0<t&&(o/=t),o}function M0(t,e,o,i){t=o-t,e=i-e;var r=Math.sqrt(t*t+e*e);return[Math.round(o+t/r),Math.round(i+e/r)]}function T0(t,e,d,g,o,v,i,r,n,p,s){var m,b,a,x,w=xo(Math.round(d*t),Math.round(d*e));return n.length&&(w.scale(d,d),m=gt(),n.forEach(function(t){St(m,t.extent)}),b=xo(Math.round(d*It(m)/g),Math.round(d*Lt(m)/g)),a=d/g,n.forEach(function(t){b.drawImage(t.image,p,p,t.image.width-2*p,t.image.height-2*p,(t.extent[0]-m[0])*a,-(t.extent[3]-m[3])*a,It(t.extent)*a,Lt(t.extent)*a)}),x=Ft(i),r.c.forEach(function(t){var e=t.source,o=t.target,i=e[1][0],r=e[1][1],n=e[2][0],p=e[2][1],s=(t=(o[0][0]-x[0])/v,-(o[0][1]-x[1])/v),a=(o[1][0]-x[0])/v,l=-(o[1][1]-x[1])/v,h=(o[2][0]-x[0])/v,y=-(o[2][1]-x[1])/v;t:{for(r=(i=[[i=i-(o=e[0][0]),r=r-(e=e[0][1]),0,0,a-t],[n=n-o,p=p-e,0,0,h-t],[0,0,i,r,l-s],[0,0,n,p,y-s]]).length,n=0;n<r;n++){for(var p=n,u=Math.abs(i[n][n]),c=n+1;c<r;c++){var f=Math.abs(i[c][n]);u<f&&(u=f,p=c)}if(!u){i=null;break t}for(u=i[p],i[p]=i[n],i[n]=u,p=n+1;p<r;p++)for(u=-i[p][n]/i[n][n],c=n;c<r+1;c++)i[p][c]=n==c?0:i[p][c]+u*i[n][c]}for(n=Array(r),p=r-1;0<=p;p--)for(n[p]=i[p][r]/i[p][p],u=p-1;0<=u;u--)i[u][r]-=i[u][p]*n[p];i=n}i&&(w.save(),w.beginPath(),r=M0(n=(t+a+h)/3,p=(s+l+y)/3,t,s),a=M0(n,p,a,l),h=M0(n,p,h,y),w.moveTo(a[0],a[1]),w.lineTo(r[0],r[1]),w.lineTo(h[0],h[1]),w.clip(),w.transform(i[0],i[2],i[1],i[3],t,s),w.translate(m[0]-o,m[3]-e),w.scale(g/d,-g/d),w.drawImage(b.canvas,0,0),w.restore())}),s)&&(w.save(),w.strokeStyle="black",w.lineWidth=1,r.c.forEach(function(t){t=((n=t.target)[0][0]-x[0])/v;var e=-(n[0][1]-x[1])/v,o=(n[1][0]-x[0])/v,i=-(n[1][1]-x[1])/v,r=(n[2][0]-x[0])/v,n=-(n[2][1]-x[1])/v;w.beginPath(),w.moveTo(o,i),w.lineTo(t,e),w.lineTo(r,n),w.closePath(),w.stroke()}),w.restore()),w.canvas}function E0(t,e,o,i,r){this.i=t,this.f=e;var n,p={},s=me(this.f,this.i),a=(this.a=function(t){var e=t[0]+"/"+t[1];return p[e]||(p[e]=s(t)),p[e]},this.g=i,this.v=r*r,this.c=[],this.o=!1,this.l=this.i.i&&!!i&&!!this.i.G()&&It(i)==It(this.i.G()),this.b=this.i.G()?It(this.i.G()):null,this.j=this.f.G()?It(this.f.G()):null,t=Ft(o),e=Nt(o),i=At(o),o=Et(o),r=this.a(t),this.a(e)),l=this.a(i),h=this.a(o);!function t(e,o,i,r,n,p,s,a,l,h){var y=lt([p,s,a,l]),u=e.b?It(y)/e.b:null,c=e.b,f=e.i.i&&.5<u&&u<1,d=!1;{var g;0<h&&(e.f.c&&e.j&&(g=lt([o,i,r,n]),d|=.25<It(g)/e.j),!f)&&e.i.c&&u&&(d|=.25<u)}if(d||!e.g||kt(y,e.g)){if(!(d||isFinite(p[0])&&isFinite(p[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(l[0])&&isFinite(l[1]))){if(!(0<h))return;d=!0}if(0<h&&(d||(y=e.a([(o[0]+r[0])/2,(o[1]+r[1])/2]),c=f?(rt(p[0],c)+rt(a[0],c))/2-rt(y[0],c):(p[0]+a[0])/2-y[0],y=(p[1]+a[1])/2-y[1],d=c*c+y*y>e.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])<this.b/2)&&(t.source=e)},this)),p={}}function A0(t){var e=gt();return t.c.forEach(function(t){t=t.source,Pt(e,t[0]),Pt(e,t[1]),Pt(e,t[2])}),e}function C0(t,e,o,i,r,n){this.v=e,this.l=t.G();var p=(s=e.G())?Rt(o,s):o,s=P0(t,e,Ct(p),i);this.j=new E0(t,e,p,this.l,.5*s),this.c=i,this.i=o,t=A0(this.j),this.o=(this.Hb=n(t,s,r))?this.Hb.a:1,this.ee=this.g=null,r=2,n=[],this.Hb&&(r=0,n=this.Hb.f),ed.call(this,o,i,this.o,r,n)}function j0(t){hg.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state}),this.C=void 0!==t.resolutions?t.resolutions:null,this.a=null,this.fa=0}function L0(t,e){return e=t.C?t.C[B(t.C,e,0)]:e}function R0(t,e){t.Y().src=e}function F0(t,e){_e.call(this,t),this.image=e}e(w0,zd),w0.prototype.S=function(t,e,o){Zd(this,"precompose",o,t,void 0);var i,r,n,p=this.Y();p&&((i=void 0!==(r=e.extent)&&!ct(r,t.extent)&&kt(r,t.extent))&&Hd(o,t,r),r=this.C(),n=o.globalAlpha,o.globalAlpha=e.opacity,o.drawImage(p,0,0,+p.width,+p.height,Math.round(r[4]),Math.round(r[5]),Math.round(p.width*r[0]),Math.round(p.height*r[3])),o.globalAlpha=n,i)&&o.restore(),this.ef(o,t,e)},w0.prototype.Ea=function(t,e,o,i,r){var n=this.a;return n.ha().Ea(t,e.viewState.resolution,e.viewState.rotation,o,e.skippedFeatureUids,function(t){return i.call(r,t,n)})},w0.prototype.u=function(t,e,o,i){if(this.Y())return this.a.ha().Ea!==Z?zd.prototype.u.apply(this,arguments):(Ji(t=Hn(this.v,t.slice()),e.viewState.resolution/this.f),this.j||(this.j=xo(1,1)),this.j.clearRect(0,0,1,1),this.j.drawImage(this.Y(),t[0],t[1],1,1,0,0,1,1),0<(t=this.j.getImageData(0,0,1,1).data)[3]?o.call(i,this.a,t):void 0)},e(S0,w0),S0.prototype.Y=function(){return this.M?this.M.Y():null},S0.prototype.C=function(){return this.c},S0.prototype.sd=function(t,e){var o,i=t.pixelRatio,r=t.size,n=t.viewState,p=n.center,s=n.resolution,a=this.a.ha(),l=t.viewHints,h=t.extent;return void 0!==e.extent&&(h=Rt(h,e.extent)),l[0]||l[1]||Ot(h)||(e=a.Y(h,s,i,n.projection))&&Ud(this,e)&&(this.M=e),this.M&&(l=(e=this.M).G(),o=i*(h=e.resolution)/(s*(n=e.a)),l=Yn(this.c,i*r[0]/2,i*r[1]/2,o,o,0,n*(l[0]-p[0])/h,n*(p[1]-l[3])/h),Yn(this.v,i*r[0]/2-l[4],i*r[1]/2-l[5],i/s,-i/s,0,-p[0],-p[1]),Kd(t.attributions,e.f),Wd(t,a),this.f=s*i/n),!!this.M},e(C0,ed),C0.prototype.ka=function(){1==this.state&&(Ze(this.ee),this.ee=null),ed.prototype.ka.call(this)},C0.prototype.Y=function(){return this.g},C0.prototype.de=function(){var t=this.Hb.getState();2==t&&(this.g=T0(It(this.i)/this.c,Lt(this.i)/this.c,this.o,this.Hb.resolution,0,this.c,this.i,this.j,[{extent:this.Hb.G(),image:this.Hb.Y()}],0)),this.state=t,this.s()},C0.prototype.load=function(){var t;0==this.state&&(this.state=1,this.s(),2==(t=this.Hb.getState())||3==t?this.de():(this.ee=g(this.Hb,"change",function(){var t=this.Hb.getState();2!=t&&3!=t||(Ze(this.ee),this.ee=null,this.de())},this),this.Hb.load()))},e(j0,hg),j0.prototype.Y=function(t,e,o,i){var r=this.c;if(r&&i&&!ve(r,i)){if(this.a){if(this.fa==this.i&&ve(this.a.v,i)&&this.a.resolution==e&&this.a.a==o&&wt(this.a.G(),t))return this.a;Ye(this.a),this.a=null}return this.a=new C0(r,i,t,e,o,function(t,e,o){return this.Jc(t,e,o,r)}.bind(this)),this.fa=this.i,this.a}return this.Jc(t,e,o,i=r?r:i)},j0.prototype.o=function(t){switch((t=t.target).getState()){case 1:this.b(new F0(N0,t));break;case 2:this.b(new F0(I0,t));break;case 3:this.b(new F0(k0,t))}},e(F0,_e);var N0="imageloadstart",I0="imageloadend",k0="imageloaderror";function O0(t){j0.call(this,{attributions:t.attributions,logo:t.logo,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.pa=t.canvasFunction,this.R=null,this.T=0,this.va=void 0!==t.ratio?t.ratio:1.5}function D0(t){this.f=t.source,this.$a=Kn(),this.g=xo(),this.l=[0,0],this.Sa=null==t.renderBuffer?100:t.renderBuffer,this.B=null,O0.call(this,{attributions:t.attributions,canvasFunction:this.tk.bind(this),logo:t.logo,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:this.f.getState()}),this.I=null,this.v=void 0,this.Ii(t.style),g(this.f,"change",this.ro,this)}function U0(t,e){ng.call(this,t,e),this.o=this.f=this.M=null}function G0(t){o.call(this,t||{})}function B0(t){w0.call(this,t),this.c=null===this.c?null:xo(),this.o=null,this.g=[],this.l=gt(),this.va=new $(0,0,0,0),this.B=Kn(),this.T=0}function K0(t,e){return e=e.getState(),t=t.a.kd(),2==e||4==e||3==e&&!t}function W0(){this.b="precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"}e(O0,j0),O0.prototype.Jc=function(t,e,o,i){e=L0(this,e);var r=this.R;return r&&this.T==this.i&&r.resolution==e&&r.a==o&&ct(r.G(),t)||(Dt(t=t.slice(),this.va),(i=this.pa(t,e,o,[It(t)/e*o,Lt(t)/e*o],i))&&(r=new id(t,e,o,this.j,i)),this.R=r,this.T=this.i),r},e(D0,O0),D0.prototype.tk=function(t,n,p,e,o){var i,r,s=new Rd(.5*n/p,t,n,this.f.T,this.Sa),a=(this.f.Yd(t,n,o),!1);return this.f.$b(t,function(t){var e;if(!(i=a))if((i=t.Lc())?e=i.call(t,n):this.v&&(e=this.v(t,n)),e){for(var o=!1,i=0,r=(e=Array.isArray(e)?e:[e]).length;i<r;++i)o=_d(s,t,e[i],Yd(n,p),this.qo,this)||o;i=o}else i=!1;a=i},this),Id(s),a?null:(this.l[0]!=e[0]||this.l[1]!=e[1]?(this.g.canvas.width=e[0],this.g.canvas.height=e[1],this.l[0]=e[0],this.l[1]=e[1]):this.g.clearRect(0,0,e[0],e[1]),o=this,i=Ct(t),r=p/(r=n),t=Yn(o.$a,e[0]/2,e[1]/2,r,-r,0,-i[0],-i[1]),s.La(this.g,p,t,0,{}),this.B=s,this.g.canvas)},e(U0,ng),U0.prototype.Ea=function(t,e,o,i,r){var n=this.a;return n.ha().Ea(t,e.viewState.resolution,e.viewState.rotation,o,e.skippedFeatureUids,function(t){return i.call(r,t,n)})},U0.prototype.ng=function(t,e){var o=this.c.i,i=t.pixelRatio,r=t.viewState,n=r.center,p=r.resolution,s=r.rotation,a=this.M,l=this.Ib,h=this.a.ha(),y=t.viewHints,u=t.extent;return void 0!==e.extent&&(u=Rt(u,e.extent)),y[0]||y[1]||Ot(u)||(e=h.Y(u,p,i,r.projection))&&Ud(this,e)&&(y=this,u=(u=a=e).Y(),l=Kp(y.c.i,u),this.Ib)&&t.postRenderFunctions.push(function(t,e){t.isContextLost()||t.deleteTexture(e)}.bind(null,o,this.Ib)),a&&(o=this.c.f.j,r=this,e=o.width,y=o.height,u=i,o=n,n=p,p=s,s=a.G(),e*=n,y*=n,Wn(r=r.S),qn(r,2*u/e,2*u/y),Zn(r,-p),Jn(r,s[0]-o[0],s[1]-o[1]),qn(r,(s[2]-s[0])/2,(s[3]-s[1])/2),Jn(r,1,1),this.o=null,Wn(i=this.v),qn(i,1,-1),Jn(i,0,-1),this.M=a,this.Ib=l,Kd(t.attributions,a.f),Wd(t,h)),!!a},U0.prototype.Ue=function(t,e){return void 0!==this.Ea(t,e,0,tr,this)},U0.prototype.lg=function(t,e,o,i){if(this.M&&this.M.Y())if(this.a.ha()instanceof D0){var r=Hn(e.pixelToCoordinateTransform,t.slice());if(this.Ea(r,e,0,tr,this))return o.call(i,this.a,null)}else{var n,p,r=[this.M.Y().width,this.M.Y().height];if(this.o||(n=e.size,Jn(e=Kn(),-1,-1),qn(e,2/n[0],2/n[1]),Jn(e,0,n[1]),qn(e,1,-1),n=_n(this.S.slice()),Jn(p=Kn(),0,r[1]),qn(p,1,-1),qn(p,r[0]/2,r[1]/2),Jn(p,1,1),Vn(p,n),Vn(p,e),this.o=p),!((t=Hn(this.o,t.slice()))[0]<0||t[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&&16<Date.now()-t.time&&j||!S&&this.o&&ct(this.o,f)&&this.mf==l&&c==this.R&&(j||u*o/v*c==this.f))){(j=this.c)&&(L=a.Xd(y,o,r),P=Math.round((d.$-d.ca+1)*L[0]/c),L=Math.round((d.ia-d.da+1)*L[1]/c),(S=j.canvas).width!=P||S.height!=L?(this.R=c,S.width=P,S.height=L):(j.clearRect(0,0,P,L),c=this.R)),this.g.length=0,(S=Object.keys(m).map(Number)).sort(U);for(var w=0,M=S.length;w<M;++w){j=S[w];var T,b=a.Xd(j,o,r),E=(P=h.Da(j))/u,A=v*a.Wf(r),C=m[j];for(T in C){var P=C[T],j=((L=h.Aa(P.ta,x))[0]-g[0])/u*v/c,L=(g[3]-L[3])/u*v/c,R=b[0]*E/c,F=b[1]*E/c;this.Of(P,t,e,j,L,R,F,A),this.g.push(P)}}this.mf=l,this.f=u*o/v*c,this.o=g}return e=this.f/n,e=Yn(this.B,o*i[0]/2,o*i[1]/2,e,e,0,(this.o[0]-p[0])/this.f*o,(p[1]-this.o[3])/this.f*o),Yn(this.v,o*i[0]/2-e[4],o*i[1]/2-e[5],o/n,-o/n,0,-p[0],-p[1]),Vd(t.usedTiles,a,y,d),Xd(t,a,h,o,r,f,y,s.Ud()),Bd(t,a),Wd(t,a),0<this.g.length},B0.prototype.Of=function(t,e,o,i,r,n,p,s){this.a.ha().Zf(e.viewState.projection)||this.c.clearRect(i,r,n,p),(t=t.Y())&&this.c.drawImage(t,s,s,t.width-2*s,t.height-2*s,i,r,n,p)},B0.prototype.Y=function(){var t=this.c;return t?t.canvas:null},B0.prototype.C=function(){return this.B},e(W0,bp);var V0=new W0;function X0(){this.b="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}"}e(X0,xp);var z0=new X0;function H0(t,e){ng.call(this,t,e),this.I=V0,this.fa=z0,this.f=null,this.B=new Cp([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.D=this.o=null,this.l=-1,this.R=[0,0]}function T(t){var e=Gt({},t=t||{});delete e.preload,delete e.useInterimTilesOnError,o.call(this,e),this.zi(void 0!==t.preload?t.preload:0),this.Ai(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}function Z0(t){this.c=null,B0.call(this,t),this.I=!1,this.D=Kn(),this.T="vector"==t.j?1:0}e(H0,ng),H0.prototype.ka=function(){kp(this.c.f,this.B),ng.prototype.ka.call(this)},e(T,o),T.prototype.Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new B0(this):"webgl"===o&&(e=new H0(t,this)),e},e(Z0,B0);function E(t){var e=Gt({},t=t||{});delete e.preload,delete e.useInterimTilesOnError,S.call(this,e),this.Bi(t.preload||0),this.Ci(t.useInterimTilesOnError||!0),_(null==t.renderMode||"image"==t.renderMode||"hybrid"==t.renderMode||"vector"==t.renderMode,28),this.j=t.renderMode||"hybrid"}function q0(t,e,o,i){function r(){delete window[p],n.parentNode.removeChild(n)}var n=document.createElement("script"),p="olc_"+q(e),s=(n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+p,setTimeout(function(){r(),o&&o()},1e4));window[p]=function(t){clearTimeout(s),r(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}function J0(t,e,o,i,r,n,p,s,a,l,h){if(rd.call(this,r,0),this.D=void 0!==h&&h,this.S=p,this.u=s,this.v=null,this.c=e,this.j=i,this.o=n||r,this.a=[],this.yd=null,this.g=0,n=i.Aa(this.o),s=this.j.G(),r=this.c.G(),Tt(n=s?Rt(n,s):n))if((s=t.G())&&(r=r?Rt(r,s):s),i=P0(t,o,Ct(n),i.Da(this.o[0])),!isFinite(i)||i<=0)this.state=4;else if(this.l=new E0(t,o,n,r,i*(void 0!==l?l:.5)),this.l.c.length)if(this.g=e.tc(i),o=A0(this.l),r&&(t.i?(o[1]=et(o[1],r[1],r[3]),o[3]=et(o[3],r[1],r[3])):o=Rt(o,r)),Tt(o)){for(e=(t=Re(e,o,this.g)).ca;e<=t.$;e++)for(o=t.da;o<=t.ia;o++)(l=a(this.g,e,o,p))&&this.a.push(l);this.a.length||(this.state=4)}else this.state=4;else this.state=4;else this.state=4}function Y0(i){return 1===i.length?i[0]:function(t,e,o){if(t)return i[rt((t[1]<<t[0])+t[2],i.length)](t,e,o)}}function _0(){}function $0(t){var e=[],o=/\{([a-z])-([a-z])\}/.exec(t);if(o)for(var i=o[2].charCodeAt(0),r=o[1].charCodeAt(0);r<=i;++r)e.push(t.replace(o[0],String.fromCharCode(r)));else if(o=/\{(\d+)-(\d+)\}/.exec(t))for(i=parseInt(o[2],10),r=parseInt(o[1],10);r<=i;r++)e.push(t.replace(o[0],r.toString()));else e.push(t);return e}function Q0(t){oa.call(this),this.highWaterMark=void 0!==t?t:2048}function tv(t){return t.c>t.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.maxZoom<i)&&(!(o=(r=o.G())?Re(o,r,i):o.a?o.a[i]:null)||Q(o,n,t)))?e:null}function nv(t,e){_e.call(this,t),this.tile=e}function pv(t){ev.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):_0,this.urls=null,t.urls?this.eb(t.urls):t.url&&this.jb(t.url),t.tileUrlFunction&&this.cb(t.tileUrlFunction)}function A(t){pv.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||sv,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||sd,this.g={},this.v={},this.Sa=t.reprojectionErrorThreshold,this.I=!1}function sv(t,e){t.Y().src=e}function C(t){this.B=void 0!==t.hidpi&&t.hidpi,A.call(this,{cacheSize:t.cacheSize,crossOrigin:"anonymous",opaque:!0,projection:ge("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,q0("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.l+"?uriScheme=https&include=ImageryProviders&key="+this.f,this.pa.bind(this),void 0,"jsonp")}Z0.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=xo()),this.c)&&"vector"==o&&(this.c=null),this.pa=i,B0.prototype.sd.apply(this,arguments)},e(E,S),E.prototype.Fd=function(t){var e=null;return e="canvas"===t.U()?new Z0(this):e},e(J0,rd),J0.prototype.ka=function(){1==this.state&&(this.yd.forEach(Ze),this.yd=null),rd.prototype.ka.call(this)},J0.prototype.Y=function(){return this.v},J0.prototype.de=function(){var t,e,o,i,r,n=[];this.a.forEach(function(t){t&&2==t.getState()&&n.push({extent:this.c.Aa(t.ta),image:t.Y()})},this),this.a.length=0,n.length?(o=this.o[0],t="number"==typeof(e=this.j.gb(o))?e:e[0],e="number"==typeof e?e:e[1],o=this.j.Da(o),i=this.c.Da(this.g),r=this.j.Aa(this.o),this.v=T0(t,e,this.S,i,this.c.G(),o,r,this.l,n,this.u,this.D),this.state=2):this.state=3,this.s()},J0.prototype.load=function(){var i;0==this.state&&(this.state=1,this.s(),i=0,this.yd=[],this.a.forEach(function(e){var o,t=e.getState();0!=t&&1!=t||(i++,o=g(e,"change",function(){var t=e.getState();2!=t&&3!=t&&4!=t||(Ze(o),--i)||(this.yd.forEach(Ze),this.yd=null,this.de())},this),this.yd.push(o))},this),this.a.forEach(function(t){0==t.getState()&&t.load()}),i||setTimeout(this.de.bind(this),0))},e(Q0,oa),Q0.prototype.fd=function(t){for(var e,o,i;tv(this);){if((e=(i=(o=this.a.Yc).ta[0].toString())in t)&&(o=o.ta,e=Q(t[i],o[1],o[2])),e)break;Ye(this.pop())}},e(ev,hg),ev.prototype.Ki=function(){return tv(this.a)},e(nv,_e),e(pv,ev),pv.prototype.pb=function(){return this.tileLoadFunction},e(A,pv),A.prototype.Ki=function(){if(tv(this.a))return!0;for(var t in this.g)if(tv(this.g[t]))return!0;return!1},e(C,A);var av=new Ue({html:'<a class="ol-attribution-bing-tos" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'});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<<e-1,r=0;r<e;++r){var n=48;t[1]&i&&(n+=1),t[2]&i&&(n+=2),o[r]=String.fromCharCode(n),i>>=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:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> 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;t<n;++t){var s=t,a=new Uint8ClampedArray(e[t]),l=i,h=r,a=u?new ImageData(a,l,h):{data:a,width:l,height:h};p[s]=a}i=y(p,o).data}else{for(i=new Uint8ClampedArray(p),r=Array(n),s=Array(n),t=0;t<n;++t)r[t]=new Uint8ClampedArray(e[t]),s[t]=[0,0,0,0];for(e=0;e<p;e+=4){for(t=0;t<n;++t)a=r[t],s[t][0]=a[e],s[t][1]=a[e+1],s[t][2]=a[e+2],s[t][3]=a[e+3];t=y(s,o),i[e]=t[0],i[e+1]=t[1],i[e+2]=t[2],i[e+3]=t[3]}}return i.buffer}}function Sv(t){this.Ff=!!t.$l;var e,o,i,r,n=[];if(e=0===t.threads?0:!this.Ff&&t.threads||1)for(var p=0;p<e;++p)n[p]=function(e,t){var o=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+wv.toString()+")(",e.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),o=URL.createObjectURL(new Blob(o,{type:"text/javascript"}));return(o=new Worker(o)).addEventListener("message",t),o}(t,this.gh.bind(this,p));else n[0]=(o=t,i=this.gh.bind(this,0),r=wv(o.operation),{postMessage:function(t){setTimeout(function(){i({data:{buffer:r(t),meta:t.meta}})},0)}});this.qe=n,this.Ed=[],this.fk=t.rp||1/0,this.oe=0,this.bd={},this.Gf=null}var Pv=!0;try{new ImageData(10,10)}catch(t){Pv=!1}var Mv=document.createElement("canvas").getContext("2d");function Tv(t){this.B=null,this.va=void 0!==t.operationType?t.operationType:"pixel",this.Sa=void 0!==t.threads?t.threads:1,this.g=function(t){for(var e=t.length,o=Array(e),i=0;i<e;++i){var r=i,n=t[i],p=null;n instanceof ev?(n=new T({source:n}),p=new B0(n)):n instanceof j0&&(n=new G0({source:n}),p=new S0(n)),o[r]=p}return o}(t.sources);for(var e=0,o=this.g.length;e<o;++e)g(this.g[e],"change",this.s,this);this.T=new Di(function(){return 1},this.s.bind(this));for(var o={},i=0,r=(e=this.g.map(function(t){return In(t.a)})).length;i<r;++i)o[q(e[i].layer)]=e[i];this.f=null,this.I={animate:!1,attributions:{},coordinateToPixelTransform:Kn(),extent:null,focus:null,index:0,layerStates:o,layerStatesArray:e,logos:{},pixelRatio:1,pixelToCoordinateTransform:Kn(),postRenderFunctions:[],size:[0,0],skippedFeatureUids:{},tileQueue:this.T,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},j0.call(this,{}),t.operation&&this.v(t.operation,t.lib)}Sv.prototype.pp=function(t,e,o){this.dk({inputs:t,Qh:e,callback:o}),this.dh()},Sv.prototype.dk=function(t){for(this.Ed.push(t);this.Ed.length>this.fk;)this.Ed.shift().callback(null,null)},Sv.prototype.dh=function(){if(0===this.oe&&0<this.Ed.length){var t=this.Gf=this.Ed.shift(),e=t.inputs[0].width,o=t.inputs[0].height,i=t.inputs.map(function(t){return t.data.buffer}),r=this.qe.length;if(1===(this.oe=r))this.qe[0].postMessage({buffers:i,meta:t.Qh,imageOps:this.Ff,width:e,height:o},i);else for(var n=4*Math.ceil(t.inputs[0].data.length/4/r),p=0;p<r;++p){for(var s=p*n,a=[],l=0,h=i.length;l<h;++l)a.push(i[p].slice(s,s+n));this.qe[p].postMessage({buffers:a,meta:t.Qh,imageOps:this.Ff,width:e,height:o},a)}}},Sv.prototype.gh=function(t,e){this.Jq||(this.bd[t]=e.data,--this.oe,0===this.oe&&this.gk())},Sv.prototype.gk=function(){var t,e,o=this.Gf,i=this.qe.length;if(1===i)var r=new Uint8ClampedArray(this.bd[0].buffer),n=this.bd[0].meta;else for(var p=o.inputs[0].data.length,r=new Uint8ClampedArray(p),n=Array(p),p=4*Math.ceil(p/4/i),s=0;s<i;++s){var a=s*p;r.set(new Uint8ClampedArray(this.bd[s].buffer),a),n[s]=this.bd[s].meta}this.Gf=null,this.bd={},o.callback(null,(t=r,e=o.inputs[0].width,o=o.inputs[0].height,Pv?new ImageData(t,e,o):((e=Mv.createImageData(e,o)).data.set(t),e)),n),this.dh()},pi.default={Af:Sv},pi.Af=Sv,e(Tv,j0),Tv.prototype.v=function(t,e){this.B=new ms.df.Af({operation:t,$l:"image"===this.va,rp:1,lib:e,threads:this.Sa}),this.s()},Tv.prototype.Y=function(t,e,o,i){o=!0;for(var r=0,n=this.g.length;r<n;++r)if("ready"!==(l=this.g[r].a.ha()).getState()){o=!1;break}if(!o)return null;if((o=Gt({},this.I)).viewState=Gt({},o.viewState),l=Ct(t),o.extent=t.slice(),o.focus=l,o.size[0]=Math.round(It(t)/e),o.size[1]=Math.round(Lt(t)/e),(r=o.viewState).center=l,r.projection=i,r.resolution=e,Ui((this.l=o).tileQueue,16,16),this.f&&(i=this.f.resolution,o=this.f.G(),e===i&&wt(t,o)||(this.f=null)),!this.f||this.i!==this.R)t:{for(t=this.l,i=this.g.length,e=Array(i),o=0;o<i;++o){var p,s,a,l=this.g[o],r=t,n=t.layerStatesArray[o];if(!(l=l.sd(r,n)?(p=r.size[0],s=r.size[1],!Ev||(a=Ev.canvas).width!==p||a.height!==s?Ev=xo(p,s):Ev.clearRect(0,0,p,s),l.S(r,n,Ev),Ev.getImageData(0,0,p,s)):null))break t;e[o]=l}this.b(new Av(Cv,t,i={})),this.B.pp(e,i,this.pa.bind(this,t))}return this.f},Tv.prototype.pa=function(t,e,o,i){var r,n;!e&&o&&(e=t.extent,(r=t.viewState.resolution)===this.l.viewState.resolution)&&wt(e,this.l.extent)&&(this.f?n=this.f.Y().getContext("2d"):(n=xo(Math.round(It(e)/r),Math.round(Lt(e)/r)),this.f=new id(e,r,1,this.j,n.canvas)),n.putImageData(o,0,0),this.s(),this.R=this.i,this.b(new Av(jv,t,i)))};var Ev=null;function Av(t,e,o){_e.call(this,t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=o}e(Av,_e),Tv.prototype.Jc=function(){return null};var Cv="beforeoperations",jv="afteroperations";function Lv(t){var e=t.layer.indexOf("-"),e=Nv[-1==e?t.layer:t.layer.slice(0,e)],o=Fv[t.layer];j.call(this,{attributions:Rv,cacheSize:t.cacheSize,crossOrigin:"anonymous",maxZoom:(null!=t.maxZoom?t:e).maxZoom,minZoom:(null!=t.minZoom?t:e).minZoom,opaque:o.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+o.Lb,wrapX:t.wrapX})}e(Lv,j);var Rv=[new Ue({html:'Map tiles by <a href="http://stamen.com/">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.'}),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]<<e[0])+e[2],s.length)],p)}}function Bv(t){var e=0,o=[];if(t.urls)for(var i=0,r=t.urls.length;i<r;++i)o[e++]=t.urls[i];t.R=o.join("#")}function Kv(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function Wv(t){t.l=0<=Wi(t.f.VERSION||"1.3.0")}function Vv(t,e,o,i,r,n,p,s,a,l,h,y,u,c){var f,d;rd.call(this,t,e),this.j=null,this.o={Nd:!1,Kg:null,mf:-1,Lg:-1},this.c=l,this.a=[],this.u=o,this.v=n,this.g=[],this.l=[],n&&(f=a.Aa(n),d=a.Da(t[0]),s.Rf(f,s.tc(d),function(t){var e,o=Rt(f,s.Aa(t));.5<=It(o)/d&&.5<=Lt(o)/d&&(o=t.toString(),(e=l[o])||(e=p(t,h,y),e=l[o]=new u(t,null==e?4:0,null==e?"":e,i,r),this.l.push(g(e,"change",c))),e.j++,this.a.push(o))}.bind(this)))}function Xv(t,e){t.Pg(il(e,t.o,t.$o.bind(t),t.Zo.bind(t)))}function zv(t,e,o,i,r){rd.call(this,t,e),this.j=0,this.o=i,this.g=null,this.c={},this.u=r,this.l=o}function Hv(t){pv.call(this,{attributions:t.attributions,cacheSize:void 0!==t.cacheSize?t.cacheSize:128,extent:t.extent,logo:t.logo,opaque:!1,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction||Xv,tileUrlFunction:t.tileUrlFunction,tilePixelRatio:t.tilePixelRatio,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.g=t.format||null,this.v={},this.l=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass||zv,this.f={},this.tileGrid||(this.tileGrid=this.Ta(ge(t.projection||"EPSG:3857")))}function Zv(t){this.o=t.matrixIds,Ee.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})}function qv(t,e,o){var r=[],n=[],p=[],s=[],a=[],l=void 0!==o?o:[],h=(o=ge(t.SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))).sc(),y="ne"==o.b.substr(0,2);return t.TileMatrix.sort(function(t,e){return e.ScaleDenominator-t.ScaleDenominator}),t.TileMatrix.forEach(function(e){var t,o,i;(t=!(0<l.length)||V(l,function(t){return e.Identifier==t.TileMatrix}))&&(n.push(e.Identifier),t=28e-5*e.ScaleDenominator/h,o=e.TileWidth,i=e.TileHeight,p.push(y?[e.TopLeftCorner[1],e.TopLeftCorner[0]]:e.TopLeftCorner),r.push(t),s.push(o==i?o:[o,i]),a.push([e.MatrixWidth,-e.MatrixHeight]))}),new Zv({extent:e,origins:p,resolutions:r,matrixIds:n,tileSizes:s,sizes:a})}function k(t){this.fa=void 0!==t.version?t.version:"1.0.0",this.C=void 0!==t.format?t.format:"image/jpeg",this.f=t.dimensions||{},this.B=t.layer,this.l=t.matrixSet,this.R=t.style;var e=t.urls,i=(void 0===e&&void 0!==t.url&&(e=$0(t.url)),this.T=void 0!==t.requestEncoding?t.requestEncoding:"KVP"),r=t.tileGrid,o={layer:this.B,style:this.R,tilematrixset:this.l},n=("KVP"==i&&Gt(o,{Service:"WMTS",Request:"GetTile",Version:this.fa,Format:this.C}),this.f),p=e&&0<e.length?Y0(e.map(function(e){return e="KVP"==i?yv(e,o):e.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in o?o[e.toLowerCase()]:t}),function(t){var o;if(t)return o={TileMatrix:r.o[t[0]],TileCol:t[1],TileRow:-t[2]-1},Gt(o,n),t=e,"KVP"==i?yv(t,o):t.replace(/\{(\w+?)\}/g,function(t,e){return o[e]})}})):_0;A.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:r,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:p,urls:e,wrapX:void 0!==t.wrapX&&t.wrapX}),iv(this,Jv(this))}function Jv(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function Yv(t){var e=(t=t||{}).size,o=e[0],i=e[1],n=[],r=256;switch(void 0!==t.tierSizeCalculation?t.tierSizeCalculation:$v){case $v:for(;r<o||r<i;)n.push([Math.ceil(o/r),Math.ceil(i/r)]),r+=r;break;case Qv:for(;r<o||r<i;)n.push([Math.ceil(o/r),Math.ceil(i/r)]),o>>=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<o;i++)r.push(1<<i),p.push(n[i-1][0]*n[i-1][1]+p[i-1]);r.reverse(),e=new Ee({extent:e=[0,-e[1],e[0],0],origin:Ft(e),resolutions:r}),(r=t.url)&&-1==r.indexOf("{TileGroup}")&&(r+="{TileGroup}/{z}-{x}-{y}.jpg"),r=Y0((r=$0(r)).map(function(r){return function(t){var e,o,i;if(t)return e=t[0],i={z:e,x:o=t[1],y:t=-t[2]-1,TileGroup:"TileGroup"+((o+t*n[e][0]+p[e])/256|0)},r.replace(/\{(\w+?)\}/g,function(t,e){return i[e]})}})),A.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:_v,tileGrid:e,tileUrlFunction:r})}function _v(t,e,o,i,r){sd.call(this,t,e,o,i,r),this.a=null}e(F,A),F.prototype.C=function(){return this.f},F.prototype.nb=function(t){return t},F.prototype.Fc=function(t,e,o){var i,r,n,p=this.tileGrid;if(!((p=p||this.Ta(o)).b.length<=t[0]))return i=p.Aa(t,this.l),r=at(p.gb(t[0]),this.o),1!=e&&(r=st(r,e,this.o)),Gt(p={F:"image",FORMAT:"PNG32",TRANSPARENT:!0},this.f),(n=this.urls)?(o=o.mb.split(":").pop(),p.SIZE=r[0]+","+r[1],p.BBOX=i.join(","),p.BBOXSR=o,p.IMAGESR=o,p.DPI=Math.round(p.DPI?p.DPI*e:90*e),yv(t=(1==n.length?n[0]:n[rt((t[1]<<t[0])+t[2],n.length)]).replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),p)):void 0},F.prototype.B=function(t){Gt(this.f,t),iv(this,Iv(this))},e(kv,ev),kv.prototype.Nc=function(t,e,o){var i,r=this.Sb(t,e,o);return this.a.b.hasOwnProperty(r)?this.a.get(r):(i=at(this.tileGrid.gb(t)),i=new Ov(t=[t,e,o],i,e=(e=rv(this,t))?rv(this,e).toString():""),this.a.set(r,i),i)},e(Ov,rd),Ov.prototype.Y=function(){var t,e;return this.a||((e=xo((t=this.c)[0],t[1])).strokeStyle="black",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.fillText(this.Ia,t[0]/2,t[1]/2),this.a=e.canvas)},Ov.prototype.load=function(){},e(N,A),N.prototype.Ao=function(t){if(!(t=t.target).status||200<=t.status&&t.status<300){try{var e=JSON.parse(t.responseText)}catch(t){return void this.Ve()}this.og(e)}else this.Ve()},e(Dv,ev),Dv.prototype.Eo=function(t){if(!(t=t.target).status||200<=t.status&&t.status<300){try{var e=JSON.parse(t.responseText)}catch(t){return void this.We()}this.pg(e)}else this.We()},e(Uv,rd),Uv.prototype.Y=function(){return null},e(I,A),I.prototype.Fo=function(t,e,o,i){o=ge(o);var r,n,p,s=this.tileGrid;if(e=(s=s||this.Ta(o)).Be(t,e),!(s.b.length<=e[0]))return r=s.Da(e[0]),n=s.Aa(e,this.fa),s=at(s.gb(e[0]),this.o),(p=this.C)&&(s=pt(s,p,this.o),n=ht(n,r*p,n)),p={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.f.LAYERS},Gt(p,this.f,i),i=Math.floor((n[3]-t[1])/r),p[this.l?"I":"X"]=Math.floor((t[0]-n[0])/r),p[this.l?"J":"Y"]=i,Gv(this,e,s,n,1,o,p)},e(Vv,rd),Vv.prototype.ka=function(){for(var t=0,e=this.a.length;t<e;++t){var o=this.a[t],i=this.c[o];i.j--,i.j||(delete this.c[o],Ye(i))}this.a.length=0,this.c=null,1==this.state&&(this.g.forEach(Ze),this.g.length=0),this.i&&Ye(this.i),this.state=5,this.s(),this.l.forEach(Ze),this.l.length=0,rd.prototype.ka.call(this)},Vv.prototype.Y=function(){return-1==this.o.Lg?null:this.j.canvas},Vv.prototype.bb=function(){return this.a.join("/")+"/"+this.u},Vv.prototype.load=function(){var r=0,n=!1;0==this.state&&pd(this,1),1==this.state&&this.a.forEach(function(e){var o,i=this.c[e];0==i.state?(i.Pg(this.S),i.load()):3==i.state?n=!0:4==i.state&&W(this.a,e),1==i.state&&(o=g(i,"change",function(){var t=i.getState();2!=t&&3!=t||(--r,Ze(o),W(this.g,o),3==t&&(W(this.a,e),n=!0),r)||pd(this,0<this.a.length?2:3)}.bind(this)),this.g.push(o),++r)}.bind(this)),r||setTimeout(function(){pd(this,0<this.a.length?2:n?3:4)}.bind(this),0)},e(zv,rd),zv.prototype.ka=function(){this.g=null,this.c={},this.state=5,this.s(),rd.prototype.ka.call(this)},e(Hv,pv),Hv.prototype.Nc=function(t,e,o,i,r){var n=this.Sb(t,e,o);return this.a.b.hasOwnProperty(n)?this.a.get(n):(i=new Vv(t=[t,e,o],void 0!==(o=(e=rv(this,t,r))?this.tileUrlFunction(e,i,r):void 0)?0:4,void 0!==o?o:"",this.g,this.tileLoadFunction,e,this.tileUrlFunction,this.tileGrid,this.Ta(r),this.v,i,r,this.tileClass,this.Li.bind(this)),this.a.set(n,i),i)},Hv.prototype.Ta=function(t){var e=t.mb,o=this.f[e];return o||(o=this.tileGrid,o=this.f[e]=Oe(t,void 0,o?o.gb(o.minZoom):void 0)),o},Hv.prototype.nb=function(t){return null==t?pv.prototype.nb.call(this,t):t},Hv.prototype.Xd=function(t,e,o){return t=at(this.Ta(o).gb(t)),[Math.round(t[0]*e),Math.round(t[1]*e)]},e(Zv,Ee),Zv.prototype.l=function(){return this.o},e(k,A),k.prototype.Mk=function(){return this.f},e(Yv,A),e(_v,sd),_v.prototype.Y=function(){var t,e;return this.a||(t=sd.prototype.Y.call(this),2==this.state?256==t.width&&256==t.height?this.a=t:((e=xo(256,256)).drawImage(t,0,0),this.a=e.canvas):t)};var $v="default",Qv="truncated";function tm(t,e){this.b=e,this.a=[{x:0,y:0,width:t,height:t}],this.c={},this.i=xo(t,t),this.f=this.i.canvas}function em(t,e,o,i){e=[e,1],0<o.width&&0<o.height&&e.push(o),0<i.width&&0<i.height&&e.push(i),t.a.splice.apply(t.a,e)}function om(t){this.a=void 0!==(t=t||{}).initialSize?t.initialSize:256,this.i=void 0!==t.maxSize?t.maxSize:void 0!==yi?yi:2048,this.b=void 0!==t.space?t.space:1,this.f=[new tm(this.a,this.b)],this.c=this.a,this.g=[new tm(this.c,this.b)]}function im(t,e,o,i,r,n,p){for(var s=e?t.g:t.f,a=0,l=s.length;a<l;++a){var h=s[a];if(h=h.add(o,i,r,n,p))return h;h||a!==l-1||(e?(h=Math.min(2*t.c,t.i),t.c=h):(h=Math.min(2*t.a,t.i),t.a=h),h=new tm(h,t.b),s.push(h),++l)}return null}return tm.prototype.get=function(t){return this.c[t]||null},tm.prototype.add=function(t,e,o,i,r){for(var n=0,p=this.a.length;n<p;++n){var s=this.a[n];if(s.width>=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<o;++e)Ze(t[e]);else Ze(t)}),eo.prototype.changed=eo.prototype.s,eo.prototype.dispatchEvent=eo.prototype.b,eo.prototype.getRevision=eo.prototype.L,eo.prototype.on=eo.prototype.J,eo.prototype.un=eo.prototype.K,t("ol.Overlay",sa),sa.prototype.getElement=sa.prototype.Rd,sa.prototype.getId=sa.prototype.Jm,sa.prototype.getMap=sa.prototype.Me,sa.prototype.getOffset=sa.prototype.Dh,sa.prototype.getPosition=sa.prototype.Yh,sa.prototype.getPositioning=sa.prototype.Eh,sa.prototype.setElement=sa.prototype.lj,sa.prototype.setOffset=sa.prototype.rj,sa.prototype.setPosition=sa.prototype.Ne,sa.prototype.setPositioning=sa.prototype.uj,t("ol.proj.METERS_PER_UNIT",zt),t("ol.proj.setProj4",function(t){Ht=t}),t("ol.proj.getPointResolution",he),t("ol.proj.addEquivalentProjections",ye),t("ol.proj.addProjection",ue),t("ol.proj.addCoordinateTransforms",fe),t("ol.proj.fromLonLat",function(t,e){return Se(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}),t("ol.proj.toLonLat",function(t,e){return Se(t,void 0!==e?e:"EPSG:3857","EPSG:4326")}),t("ol.proj.get",ge),t("ol.proj.equivalent",ve),t("ol.proj.getTransform",me),t("ol.proj.transform",Se),t("ol.proj.transformExtent",Pe),t("ol.render.toContext",function(t,e){var o=t.canvas,i=e||{};return e=i.pixelRatio||Qo,(i=i.size)&&(o.width=i[0]*e,o.height=i[1]*e,o.style.width=i[0]+"px",o.style.height=i[1]+"px"),new hp(t,e,o=[0,0,o.width,o.height],qn(Kn(),e,e),0)}),t("ol.size.toSize",at),t("ol.Sphere",Vt),Vt.prototype.geodesicArea=Vt.prototype.a,Vt.prototype.haversineDistance=Vt.prototype.b,rd.prototype.getTileCoord=rd.prototype.f,t("ol.tilegrid.createXYZ",Ie),zv.prototype.getFormat=zv.prototype.Lm,zv.prototype.getFeatures=zv.prototype.Km,zv.prototype.getProjection=zv.prototype.Mm,zv.prototype.setFeatures=zv.prototype.mj,zv.prototype.setProjection=zv.prototype.ig,zv.prototype.setLoader=zv.prototype.Pg,t("ol.View",l),l.prototype.getAnimating=l.prototype.Ic,l.prototype.getInteracting=l.prototype.Rk,l.prototype.cancelAnimations=l.prototype.ed,l.prototype.constrainCenter=l.prototype.Ec,l.prototype.getCenter=l.prototype.wa,l.prototype.calculateExtent=l.prototype.dd,l.prototype.getMaxResolution=l.prototype.Nm,l.prototype.getMinResolution=l.prototype.Pm,l.prototype.getMaxZoom=l.prototype.Om,l.prototype.setMaxZoom=l.prototype.eq,l.prototype.getMinZoom=l.prototype.Qm,l.prototype.setMinZoom=l.prototype.fq,l.prototype.getProjection=l.prototype.Rm,l.prototype.getResolution=l.prototype.Pa,l.prototype.getResolutions=l.prototype.Sm,l.prototype.getResolutionForExtent=l.prototype.ze,l.prototype.getRotation=l.prototype.Qa,l.prototype.getZoom=l.prototype.Hh,l.prototype.getZoomForResolution=l.prototype.Ce,l.prototype.fit=l.prototype.Qf,l.prototype.centerOn=l.prototype.uk,l.prototype.setCenter=l.prototype.ob,l.prototype.setResolution=l.prototype.Vc,l.prototype.setRotation=l.prototype.Oe,l.prototype.setZoom=l.prototype.lq,t("ol.xml.getAllTextContent",Wa),t("ol.xml.parse",za),Np.prototype.getGL=Np.prototype.Wo,Np.prototype.useProgram=Np.prototype.Qc,t("ol.tilegrid.TileGrid",Ee),Ee.prototype.forEachTileCoord=Ee.prototype.Rf,Ee.prototype.getMaxZoom=Ee.prototype.Ti,Ee.prototype.getMinZoom=Ee.prototype.Ui,Ee.prototype.getOrigin=Ee.prototype.Pc,Ee.prototype.getResolution=Ee.prototype.Da,Ee.prototype.getResolutions=Ee.prototype.Vi,Ee.prototype.getTileCoordExtent=Ee.prototype.Aa,Ee.prototype.getTileCoordForCoordAndResolution=Ee.prototype.Be,Ee.prototype.getTileCoordForCoordAndZ=Ee.prototype.bg,Ee.prototype.getTileSize=Ee.prototype.gb,Ee.prototype.getZForResolution=Ee.prototype.tc,t("ol.tilegrid.WMTS",Zv),Zv.prototype.getMatrixIds=Zv.prototype.l,t("ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet",qv),t("ol.style.AtlasManager",om),t("ol.style.Circle",Fa),Fa.prototype.setRadius=Fa.prototype.Uc,t("ol.style.Fill",Na),Na.prototype.getColor=Na.prototype.i,Na.prototype.setColor=Na.prototype.c,t("ol.style.Icon",vy),vy.prototype.getAnchor=vy.prototype.Hc,vy.prototype.getColor=vy.prototype.Lo,vy.prototype.getImage=vy.prototype.Y,vy.prototype.getOrigin=vy.prototype.Oc,vy.prototype.getSrc=vy.prototype.Mo,vy.prototype.getSize=vy.prototype.ic,t("ol.style.Image",ja),ja.prototype.getOpacity=ja.prototype.Ze,ja.prototype.getRotateWithView=ja.prototype.$e,ja.prototype.getRotation=ja.prototype.af,ja.prototype.getScale=ja.prototype.bf,ja.prototype.getSnapToPixel=ja.prototype.Ae,ja.prototype.setOpacity=ja.prototype.td,ja.prototype.setRotation=ja.prototype.cf,ja.prototype.setScale=ja.prototype.ud,t("ol.style.RegularShape",La),La.prototype.getAnchor=La.prototype.Hc,La.prototype.getAngle=La.prototype.Pi,La.prototype.getFill=La.prototype.Fa,La.prototype.getImage=La.prototype.Y,La.prototype.getOrigin=La.prototype.Oc,La.prototype.getPoints=La.prototype.Qi,La.prototype.getRadius=La.prototype.Ri,La.prototype.getRadius2=La.prototype.Fh,La.prototype.getSize=La.prototype.ic,La.prototype.getStroke=La.prototype.Ga,t("ol.style.Stroke",as),as.prototype.getColor=as.prototype.No,as.prototype.getLineCap=as.prototype.Vk,as.prototype.getLineDash=as.prototype.Oo,as.prototype.getLineDashOffset=as.prototype.Wk,as.prototype.getLineJoin=as.prototype.Xk,as.prototype.getMiterLimit=as.prototype.bl,as.prototype.getWidth=as.prototype.Po,as.prototype.setColor=as.prototype.Qo,as.prototype.setLineCap=as.prototype.aq,as.prototype.setLineDashOffset=as.prototype.bq,as.prototype.setLineJoin=as.prototype.cq,as.prototype.setMiterLimit=as.prototype.gq,as.prototype.setWidth=as.prototype.jq,t("ol.style.Style",Ia),Ia.prototype.getGeometry=Ia.prototype.V,Ia.prototype.getGeometryFunction=Ia.prototype.Pk,Ia.prototype.getFill=Ia.prototype.Fa,Ia.prototype.setFill=Ia.prototype.pf,Ia.prototype.getImage=Ia.prototype.Y,Ia.prototype.setImage=Ia.prototype.Og,Ia.prototype.getStroke=Ia.prototype.Ga,Ia.prototype.setStroke=Ia.prototype.qf,Ia.prototype.getText=Ia.prototype.Na,Ia.prototype.setText=Ia.prototype.xd,Ia.prototype.getZIndex=Ia.prototype.Ba,Ia.prototype.setGeometry=Ia.prototype.Ra,Ia.prototype.setZIndex=Ia.prototype.Vb,t("ol.style.Text",my),my.prototype.getFont=my.prototype.Nk,my.prototype.getOffsetX=my.prototype.cl,my.prototype.getOffsetY=my.prototype.dl,my.prototype.getFill=my.prototype.Fa,my.prototype.getRotateWithView=my.prototype.Ro,my.prototype.getRotation=my.prototype.So,my.prototype.getScale=my.prototype.To,my.prototype.getStroke=my.prototype.Ga,my.prototype.getText=my.prototype.Na,my.prototype.getTextAlign=my.prototype.nl,my.prototype.getTextBaseline=my.prototype.ol,my.prototype.setFont=my.prototype.nj,my.prototype.setOffsetX=my.prototype.sj,my.prototype.setOffsetY=my.prototype.tj,my.prototype.setFill=my.prototype.pf,my.prototype.setRotation=my.prototype.Uo,my.prototype.setScale=my.prototype.Si,my.prototype.setStroke=my.prototype.qf,my.prototype.setText=my.prototype.xd,my.prototype.setTextAlign=my.prototype.vj,my.prototype.setTextBaseline=my.prototype.hq,t("ol.source.BingMaps",C),t("ol.source.BingMaps.TOS_ATTRIBUTION",av),C.prototype.getApiKey=C.prototype.T,C.prototype.getImagerySet=C.prototype.fa,t("ol.source.CartoDB",L),L.prototype.getConfig=L.prototype.Kk,L.prototype.updateConfig=L.prototype.tq,L.prototype.setConfig=L.prototype.Xp,t("ol.source.Cluster",R),R.prototype.getDistance=R.prototype.$n,R.prototype.getSource=R.prototype.ao,R.prototype.setDistance=R.prototype.Yp,t("ol.source.Image",j0),t("ol.source.ImageArcGISRest",uv),uv.prototype.getParams=uv.prototype.co,uv.prototype.getImageLoadFunction=uv.prototype.bo,uv.prototype.getUrl=uv.prototype.eo,uv.prototype.setImageLoadFunction=uv.prototype.fo,uv.prototype.setUrl=uv.prototype.ho,uv.prototype.updateParams=uv.prototype.io,t("ol.source.ImageCanvas",O0),t("ol.source.ImageMapGuide",cv),cv.prototype.getParams=cv.prototype.ko,cv.prototype.getImageLoadFunction=cv.prototype.jo,cv.prototype.updateParams=cv.prototype.mo,cv.prototype.setImageLoadFunction=cv.prototype.lo,t("ol.source.ImageStatic",fv),t("ol.source.ImageVector",D0),D0.prototype.getSource=D0.prototype.no,D0.prototype.getStyle=D0.prototype.oo,D0.prototype.getStyleFunction=D0.prototype.po,D0.prototype.setStyle=D0.prototype.Ii,t("ol.source.ImageWMS",dv),dv.prototype.getGetFeatureInfoUrl=dv.prototype.so,dv.prototype.getParams=dv.prototype.uo,dv.prototype.getImageLoadFunction=dv.prototype.to,dv.prototype.getUrl=dv.prototype.vo,dv.prototype.setImageLoadFunction=dv.prototype.wo,dv.prototype.setUrl=dv.prototype.xo,dv.prototype.updateParams=dv.prototype.yo,t("ol.source.OSM",bv),t("ol.source.OSM.ATTRIBUTION",xv),t("ol.source.Raster",Tv),Tv.prototype.setOperation=Tv.prototype.v,t("ol.source.Source",hg),hg.prototype.getAttributions=hg.prototype.ya,hg.prototype.getLogo=hg.prototype.xa,hg.prototype.getProjection=hg.prototype.za,hg.prototype.refresh=hg.prototype.sa,hg.prototype.setAttributions=hg.prototype.ua,t("ol.source.Stamen",Lv),t("ol.source.Tile",ev),ev.prototype.getTileGrid=ev.prototype.ab,t("ol.source.TileArcGISRest",F),F.prototype.getParams=F.prototype.C,F.prototype.updateParams=F.prototype.B,t("ol.source.TileDebug",kv),t("ol.source.TileImage",A),A.prototype.setRenderReprojectionEdges=A.prototype.Pb,A.prototype.setTileGridForProjection=A.prototype.Qb,t("ol.source.TileJSON",N),N.prototype.getTileJSON=N.prototype.pl,t("ol.source.TileUTFGrid",Dv),Dv.prototype.getTemplate=Dv.prototype.ml,Dv.prototype.forDataAtCoordinateAndResolution=Dv.prototype.zk,t("ol.source.TileWMS",I),I.prototype.getGetFeatureInfoUrl=I.prototype.Fo,I.prototype.getParams=I.prototype.Go,I.prototype.updateParams=I.prototype.Ho,pv.prototype.getTileLoadFunction=pv.prototype.pb,pv.prototype.getTileUrlFunction=pv.prototype.qb,pv.prototype.getUrls=pv.prototype.rb,pv.prototype.setTileLoadFunction=pv.prototype.vb,pv.prototype.setTileUrlFunction=pv.prototype.cb,pv.prototype.setUrl=pv.prototype.jb,pv.prototype.setUrls=pv.prototype.eb,t("ol.source.Vector",P),P.prototype.addFeature=P.prototype.yb,P.prototype.addFeatures=P.prototype.cd,P.prototype.forEachFeature=P.prototype.sh,P.prototype.forEachFeatureInExtent=P.prototype.$b,P.prototype.forEachFeatureIntersectingExtent=P.prototype.th,P.prototype.getFeaturesCollection=P.prototype.Ah,P.prototype.getFeatures=P.prototype.Xe,P.prototype.getFeaturesAtCoordinate=P.prototype.zh,P.prototype.getFeaturesInExtent=P.prototype.Uf,P.prototype.getClosestFeatureToCoordinate=P.prototype.vh,P.prototype.getExtent=P.prototype.G,P.prototype.getFeatureById=P.prototype.yh,P.prototype.getFormat=P.prototype.Mi,P.prototype.getUrl=P.prototype.Ni,P.prototype.removeFeature=P.prototype.Gb,t("ol.source.VectorTile",Hv),t("ol.source.WMTS",k),k.prototype.getDimensions=k.prototype.Mk,k.prototype.getFormat=k.prototype.Io,k.prototype.getLayer=k.prototype.Jo,k.prototype.getMatrixSet=k.prototype.$k,k.prototype.getRequestEncoding=k.prototype.kl,k.prototype.getStyle=k.prototype.Ko,k.prototype.getVersion=k.prototype.rl,k.prototype.updateDimensions=k.prototype.uq,t("ol.source.WMTS.optionsFromCapabilities",function(t,r){var e=V(t.Contents.Layer,function(t){return t.Identifier==r.layer});if(null===e)return null;var o,i,n=t.Contents.TileMatrixSet,p=1<e.TileMatrixSetLink.length?"projection"in r?H(e.TileMatrixSetLink,function(e){var t=V(n,function(t){return t.Identifier==e.TileMatrixSet}).SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"),o=ge(t),i=ge(r.projection);return o&&i?ve(o,i):t==r.projection}):H(e.TileMatrixSetLink,function(t){return t.TileMatrixSet==r.matrixSet}):0,s=e.TileMatrixSetLink[p=p<0?0:p].TileMatrixSet,a=e.TileMatrixSetLink[p].TileMatrixSetLimits,l=e.Format[0],h=("format"in r&&(l=r.format),p=H(e.Style,function(t){return"style"in r?t.Title==r.style:t.isDefault}),p=e.Style[p=p<0?0:p].Identifier,{}),y=("Dimension"in e&&e.Dimension.forEach(function(t){var e=t.Identifier,o=t.Default;void 0===o&&(o=t.Value[0]),h[e]=o}),V(t.Contents.TileMatrixSet,function(t){return t.Identifier==s})),u="projection"in r?ge(r.projection):ge(y.SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3")),c=e.WGS84BoundingBox,f=(a=qv(y,i=void 0!==c&&(o=ge("EPSG:4326").G(),o=c[0]==o[0]&&c[2]==o[2],i=Pe(c,"EPSG:4326",u),c=u.G())&&!ct(c,i)?void 0:i,a),[]),y=void 0!==(y=r.requestEncoding)?y:"";if("OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(i=0,c=(t=t.OperationsMetadata.GetTile.DCP.HTTP.Get).length;i<c;++i){var d=V(t[i].Constraint,function(t){return"GetEncoding"==t.name}).AllowedValues.Value;if("KVP"!==(y=""===y?d[0]:y))break;G(d,"KVP")&&f.push(t[i].href)}return f.length||(y="REST",e.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(l=t.format,f.push(t.template))})),{urls:f,layer:r.layer,matrixSet:s,format:l,projection:u,requestEncoding:y,tileGrid:a,style:p,dimensions:h,wrapX:o,crossOrigin:r.crossOrigin}}),t("ol.source.XYZ",j),t("ol.source.Zoomify",Yv),ac.prototype.getExtent=ac.prototype.G,ac.prototype.getId=ac.prototype.Wn,ac.prototype.getGeometry=ac.prototype.V,ac.prototype.getProperties=ac.prototype.Xn,ac.prototype.getType=ac.prototype.U,t("ol.render.VectorContext",lp),ea.prototype.setStyle=ea.prototype.rd,ea.prototype.drawGeometry=ea.prototype.zb,ea.prototype.drawFeature=ea.prototype.te,hp.prototype.drawCircle=hp.prototype.Zb,hp.prototype.setStyle=hp.prototype.rd,hp.prototype.drawGeometry=hp.prototype.zb,hp.prototype.drawFeature=hp.prototype.te,t("ol.proj.common.add",Me),t("ol.proj.Projection",Zt),Zt.prototype.getCode=Zt.prototype.Jk,Zt.prototype.getExtent=Zt.prototype.G,Zt.prototype.getUnits=Zt.prototype.Un,Zt.prototype.getMetersPerUnit=Zt.prototype.sc,Zt.prototype.getWorldExtent=Zt.prototype.tl,Zt.prototype.isGlobal=Zt.prototype.dm,Zt.prototype.setGlobal=Zt.prototype.$p,Zt.prototype.setExtent=Zt.prototype.Vn,Zt.prototype.setWorldExtent=Zt.prototype.kq,Zt.prototype.setGetPointResolution=Zt.prototype.Zp,t("ol.proj.Units.METERS_PER_UNIT",zt),t("ol.layer.Base",Nn),Nn.prototype.getExtent=Nn.prototype.G,Nn.prototype.getMaxResolution=Nn.prototype.fc,Nn.prototype.getMinResolution=Nn.prototype.gc,Nn.prototype.getOpacity=Nn.prototype.hc,Nn.prototype.getVisible=Nn.prototype.Mb,Nn.prototype.getZIndex=Nn.prototype.Ba,Nn.prototype.setExtent=Nn.prototype.vc,Nn.prototype.setMaxResolution=Nn.prototype.Ac,Nn.prototype.setMinResolution=Nn.prototype.Bc,Nn.prototype.setOpacity=Nn.prototype.wc,Nn.prototype.setVisible=Nn.prototype.xc,Nn.prototype.setZIndex=Nn.prototype.Vb,t("ol.layer.Group",kn),kn.prototype.getLayers=kn.prototype.qd,kn.prototype.setLayers=kn.prototype.xi,t("ol.layer.Heatmap",M),M.prototype.getBlur=M.prototype.uh,M.prototype.getGradient=M.prototype.Bh,M.prototype.getRadius=M.prototype.yi,M.prototype.setBlur=M.prototype.jj,M.prototype.setGradient=M.prototype.pj,M.prototype.setRadius=M.prototype.Uc,t("ol.layer.Image",G0),G0.prototype.getSource=G0.prototype.ha,t("ol.layer.Layer",o),o.prototype.getSource=o.prototype.ha,o.prototype.setSource=o.prototype.Wc,t("ol.layer.Tile",T),T.prototype.getPreload=T.prototype.Ud,T.prototype.getSource=T.prototype.ha,T.prototype.setPreload=T.prototype.zi,T.prototype.getUseInterimTilesOnError=T.prototype.kd,T.prototype.setUseInterimTilesOnError=T.prototype.Ai,t("ol.layer.Vector",S),S.prototype.getSource=S.prototype.ha,S.prototype.getStyle=S.prototype.D,S.prototype.getStyleFunction=S.prototype.C,S.prototype.setStyle=S.prototype.g,t("ol.layer.VectorTile",E),E.prototype.getPreload=E.prototype.Ud,E.prototype.getUseInterimTilesOnError=E.prototype.kd,E.prototype.setPreload=E.prototype.Bi,E.prototype.setUseInterimTilesOnError=E.prototype.Ci,t("ol.interaction.DoubleClickZoom",Ir),t("ol.interaction.DoubleClickZoom.handleEvent",kr),t("ol.interaction.DragAndDrop",ld),t("ol.interaction.DragAndDrop.handleEvent",tr),t("ol.interaction.DragBox",pn),pn.prototype.getGeometry=pn.prototype.V,t("ol.interaction.DragPan",qr),t("ol.interaction.DragRotate",$r),t("ol.interaction.DragRotateAndZoom",gd),t("ol.interaction.DragZoom",dn),t("ol.interaction.Draw",vg),t("ol.interaction.Draw.handleEvent",mg),vg.prototype.removeLastPoint=vg.prototype.Op,vg.prototype.finishDrawing=vg.prototype.Pd,vg.prototype.extend=vg.prototype.vn,t("ol.interaction.Draw.createRegularPolygon",function(r,n){return function(t,e){var o=t[0],i=(t=t[1],Math.sqrt(Yi(o,t)));return Sr(e=e||wr(new w(o),r),o,i,n||Math.atan((t[1]-o[1])/(t[0]-o[0]))),e}}),t("ol.interaction.Draw.createBox",function(){return function(t,e){return t=lt(t),(e=e||new s(null)).ma([[Et(t),At(t),Nt(t),Ft(t),Et(t)]]),e}}),t("ol.interaction.Extent",Fg),Fg.prototype.getExtent=Fg.prototype.G,Fg.prototype.setExtent=Fg.prototype.g,Kg.prototype.extent_=Kg.prototype.b,t("ol.interaction.Interaction",Lr),Lr.prototype.getActive=Lr.prototype.c,Lr.prototype.getMap=Lr.prototype.f,Lr.prototype.setActive=Lr.prototype.Ha,t("ol.interaction.KeyboardPan",gn),t("ol.interaction.KeyboardPan.handleEvent",vn),t("ol.interaction.KeyboardZoom",mn),t("ol.interaction.KeyboardZoom.handleEvent",bn),t("ol.interaction.Modify",Vg),t("ol.interaction.Modify.handleEvent",Yg),Vg.prototype.removePoint=Vg.prototype.hj,t("ol.interaction.MouseWheelZoom",xn),t("ol.interaction.MouseWheelZoom.handleEvent",wn),xn.prototype.setMouseAnchor=xn.prototype.T,t("ol.interaction.PinchRotate",Mn),t("ol.interaction.PinchZoom",Cn),t("ol.interaction.Pointer",zr),t("ol.interaction.Pointer.handleEvent",Zr),t("ol.interaction.Select",e0),e0.prototype.getFeatures=e0.prototype.Gn,e0.prototype.getHitTolerance=e0.prototype.Hn,e0.prototype.getLayer=e0.prototype.In,t("ol.interaction.Select.handleEvent",o0),e0.prototype.setHitTolerance=e0.prototype.Kn,t("ol.interaction.Snap",n0),n0.prototype.addFeature=n0.prototype.yb,n0.prototype.removeFeature=n0.prototype.Gb,t("ol.interaction.Translate",l0),l0.prototype.getHitTolerance=l0.prototype.B,l0.prototype.setHitTolerance=l0.prototype.I,t("ol.geom.Circle",w),w.prototype.getCenter=w.prototype.wa,w.prototype.getRadius=w.prototype.pd,w.prototype.getType=w.prototype.U,w.prototype.intersectsExtent=w.prototype.Xa,w.prototype.setCenter=w.prototype.ob,w.prototype.setCenterAndRadius=w.prototype.Ng,w.prototype.setRadius=w.prototype.Uc,w.prototype.transform=w.prototype.tb,t("ol.geom.Geometry",or),or.prototype.getClosestPoint=or.prototype.Ab,or.prototype.intersectsCoordinate=or.prototype.sb,or.prototype.getExtent=or.prototype.G,or.prototype.simplify=or.prototype.Rb,or.prototype.transform=or.prototype.tb,t("ol.geom.GeometryCollection",zl),zl.prototype.getGeometries=zl.prototype.Vf,zl.prototype.getType=zl.prototype.U,zl.prototype.intersectsExtent=zl.prototype.Xa,zl.prototype.setGeometries=zl.prototype.oj,zl.prototype.applyTransform=zl.prototype.Dc,t("ol.geom.LinearRing",lr),lr.prototype.getArea=lr.prototype.qn,lr.prototype.getCoordinates=lr.prototype.X,lr.prototype.getType=lr.prototype.U,lr.prototype.setCoordinates=lr.prototype.ma,t("ol.geom.LineString",m),m.prototype.appendCoordinate=m.prototype.mk,m.prototype.forEachSegment=m.prototype.Ck,m.prototype.getCoordinateAtM=m.prototype.nn,m.prototype.getCoordinates=m.prototype.X,m.prototype.getCoordinateAt=m.prototype.wh,m.prototype.getLength=m.prototype.pn,m.prototype.getType=m.prototype.U,m.prototype.intersectsExtent=m.prototype.Xa,m.prototype.setCoordinates=m.prototype.ma,t("ol.geom.MultiLineString",a),a.prototype.appendLineString=a.prototype.nk,a.prototype.getCoordinateAtM=a.prototype.rn,a.prototype.getCoordinates=a.prototype.X,a.prototype.getLineString=a.prototype.Yk,a.prototype.getLineStrings=a.prototype.gd,a.prototype.getType=a.prototype.U,a.prototype.intersectsExtent=a.prototype.Xa,a.prototype.setCoordinates=a.prototype.ma,t("ol.geom.MultiPoint",f),f.prototype.appendPoint=f.prototype.qk,f.prototype.getCoordinates=f.prototype.X,f.prototype.getPoint=f.prototype.il,f.prototype.getPoints=f.prototype.Zd,f.prototype.getType=f.prototype.U,f.prototype.intersectsExtent=f.prototype.Xa,f.prototype.setCoordinates=f.prototype.ma,t("ol.geom.MultiPolygon",b),b.prototype.appendPolygon=b.prototype.rk,b.prototype.getArea=b.prototype.sn,b.prototype.getCoordinates=b.prototype.X,b.prototype.getInteriorPoints=b.prototype.Uk,b.prototype.getPolygon=b.prototype.jl,b.prototype.getPolygons=b.prototype.Td,b.prototype.getType=b.prototype.U,b.prototype.intersectsExtent=b.prototype.Xa,b.prototype.setCoordinates=b.prototype.ma,t("ol.geom.Point",p),p.prototype.getCoordinates=p.prototype.X,p.prototype.getType=p.prototype.U,p.prototype.intersectsExtent=p.prototype.Xa,p.prototype.setCoordinates=p.prototype.ma,t("ol.geom.Polygon",s),s.prototype.appendLinearRing=s.prototype.pk,s.prototype.getArea=s.prototype.tn,s.prototype.getCoordinates=s.prototype.X,s.prototype.getInteriorPoint=s.prototype.Tk,s.prototype.getLinearRingCount=s.prototype.Zk,s.prototype.getLinearRing=s.prototype.Ch,s.prototype.getLinearRings=s.prototype.Sd,s.prototype.getType=s.prototype.U,s.prototype.intersectsExtent=s.prototype.Xa,s.prototype.setCoordinates=s.prototype.ma,t("ol.geom.Polygon.circular",br),t("ol.geom.Polygon.fromExtent",xr),t("ol.geom.Polygon.fromCircle",wr),t("ol.geom.SimpleGeometry",i),i.prototype.getFirstCoordinate=i.prototype.ac,i.prototype.getLastCoordinate=i.prototype.bc,i.prototype.getLayout=i.prototype.cc,i.prototype.applyTransform=i.prototype.Dc,t("ol.format.EsriJSON",ml),ml.prototype.readFeature=ml.prototype.Tb,ml.prototype.readFeatures=ml.prototype.Oa,ml.prototype.readGeometry=ml.prototype.Sc,ml.prototype.readProjection=ml.prototype.kb,ml.prototype.writeGeometry=ml.prototype.$c,ml.prototype.writeGeometryObject=ml.prototype.je,ml.prototype.writeFeature=ml.prototype.Bd,ml.prototype.writeFeatureObject=ml.prototype.Zc,ml.prototype.writeFeatures=ml.prototype.Wb,ml.prototype.writeFeaturesObject=ml.prototype.he,t("ol.format.Feature",nl),t("ol.format.filter.and",Vl),t("ol.format.filter.or",function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Kl,e))}),t("ol.format.filter.not",function(t){return new Gl(t)}),t("ol.format.filter.bbox",Xl),t("ol.format.filter.intersects",function(t,e,o){return new Nl(t,e,o)}),t("ol.format.filter.within",function(t,e,o){return new Wl(t,e,o)}),t("ol.format.filter.equalTo",function(t,e,o){return new jl(t,e,o)}),t("ol.format.filter.notEqualTo",function(t,e,o){return new Bl(t,e,o)}),t("ol.format.filter.lessThan",function(t,e){return new Dl(t,e)}),t("ol.format.filter.lessThanOrEqualTo",function(t,e){return new Ul(t,e)}),t("ol.format.filter.greaterThan",function(t,e){return new Ll(t,e)}),t("ol.format.filter.greaterThanOrEqualTo",function(t,e){return new Rl(t,e)}),t("ol.format.filter.isNull",function(t){return new Ol(t)}),t("ol.format.filter.between",function(t,e,o){return new Il(t,e,o)}),t("ol.format.filter.like",function(t,e,o,i,r,n){return new kl(t,e,o,i,r,n)}),t("ol.format.filter.during",function(t,e,o){return new Al(t,e,o)}),t("ol.format.GeoJSON",Zl),Zl.prototype.readFeature=Zl.prototype.Tb,Zl.prototype.readFeatures=Zl.prototype.Oa,Zl.prototype.readGeometry=Zl.prototype.Sc,Zl.prototype.readProjection=Zl.prototype.kb,Zl.prototype.writeFeature=Zl.prototype.Bd,Zl.prototype.writeFeatureObject=Zl.prototype.Zc,Zl.prototype.writeFeatures=Zl.prototype.Wb,Zl.prototype.writeFeaturesObject=Zl.prototype.he,Zl.prototype.writeGeometry=Zl.prototype.$c,Zl.prototype.writeGeometryObject=Zl.prototype.je,t("ol.format.GML",x),x.prototype.writeFeatures=x.prototype.Wb,x.prototype.writeFeaturesNode=x.prototype.Xb,t("ol.format.GML2",yh),t("ol.format.GML3",x),x.prototype.writeGeometryNode=x.prototype.ie,x.prototype.writeFeatures=x.prototype.Wb,x.prototype.writeFeaturesNode=x.prototype.Xb,_l.prototype.readFeatures=_l.prototype.Oa,t("ol.format.GPX",ch),ch.prototype.readFeature=ch.prototype.Tb,ch.prototype.readFeatures=ch.prototype.Oa,ch.prototype.readProjection=ch.prototype.kb,ch.prototype.writeFeatures=ch.prototype.Wb,ch.prototype.writeFeaturesNode=ch.prototype.Xb,t("ol.format.IGC",Jh),Jh.prototype.readFeature=Jh.prototype.Tb,Jh.prototype.readFeatures=Jh.prototype.Oa,Jh.prototype.readProjection=Jh.prototype.kb,t("ol.format.KML",by),by.prototype.readFeature=by.prototype.Tb,by.prototype.readFeatures=by.prototype.Oa,by.prototype.readName=by.prototype.Cp,by.prototype.readNetworkLinks=by.prototype.Dp,by.prototype.readRegion=by.prototype.Gp,by.prototype.readRegionFromNode=by.prototype.lf,by.prototype.readProjection=by.prototype.kb,by.prototype.writeFeatures=by.prototype.Wb,by.prototype.writeFeaturesNode=by.prototype.Xb,t("ol.format.MVT",lc),lc.prototype.readFeatures=lc.prototype.Oa,lc.prototype.readProjection=lc.prototype.kb,lc.prototype.setLayers=lc.prototype.mn,t("ol.format.OSMXML",hc),hc.prototype.readFeatures=hc.prototype.Oa,hc.prototype.readProjection=hc.prototype.kb,t("ol.format.Polyline",Fc),t("ol.format.Polyline.encodeDeltas",Nc),t("ol.format.Polyline.decodeDeltas",Ic),t("ol.format.Polyline.encodeFloats",kc),t("ol.format.Polyline.decodeFloats",Oc),Fc.prototype.readFeature=Fc.prototype.Tb,Fc.prototype.readFeatures=Fc.prototype.Oa,Fc.prototype.readGeometry=Fc.prototype.Sc,Fc.prototype.readProjection=Fc.prototype.kb,Fc.prototype.writeGeometry=Fc.prototype.$c,t("ol.format.TopoJSON",Dc),Dc.prototype.readFeatures=Dc.prototype.Oa,Dc.prototype.readProjection=Dc.prototype.kb,t("ol.format.WFS",Wc),Wc.prototype.readFeatures=Wc.prototype.Oa,Wc.prototype.readTransactionResponse=Wc.prototype.j,Wc.prototype.readFeatureCollectionMetadata=Wc.prototype.g,t("ol.format.WFS.writeFilter",function(t){var e=Ka("http://www.opengis.net/ogc","Filter");return ol({node:e},lf,_a(t.kc),[t],[]),e}),Wc.prototype.writeGetFeature=Wc.prototype.l,Wc.prototype.writeTransaction=Wc.prototype.v,Wc.prototype.readProjection=Wc.prototype.kb,t("ol.format.WKT",hf),hf.prototype.readFeature=hf.prototype.Tb,hf.prototype.readFeatures=hf.prototype.Oa,hf.prototype.readGeometry=hf.prototype.Sc,hf.prototype.writeFeature=hf.prototype.Bd,hf.prototype.writeFeatures=hf.prototype.Wb,hf.prototype.writeGeometry=hf.prototype.$c,t("ol.format.WMSCapabilities",gf),t("ol.format.WMSGetFeatureInfo",Uf),Uf.prototype.readFeatures=Uf.prototype.Oa,t("ol.format.WMTSCapabilities",Gf),t("ol.format.filter.And",Ml),t("ol.format.filter.Bbox",Tl),t("ol.format.filter.Comparison",El),t("ol.format.filter.ComparisonBinary",Cl),t("ol.format.filter.During",Al),t("ol.format.filter.EqualTo",jl),t("ol.format.filter.Filter",Sl),t("ol.format.filter.GreaterThan",Ll),t("ol.format.filter.GreaterThanOrEqualTo",Rl),t("ol.format.filter.Intersects",Nl),t("ol.format.filter.IsBetween",Il),t("ol.format.filter.IsLike",kl),t("ol.format.filter.IsNull",Ol),t("ol.format.filter.LessThan",Dl),t("ol.format.filter.LessThanOrEqualTo",Ul),t("ol.format.filter.Not",Gl),t("ol.format.filter.NotEqualTo",Bl),t("ol.format.filter.Or",Kl),t("ol.format.filter.Spatial",Fl),t("ol.format.filter.Within",Wl),t("ol.events.condition.altKeyOnly",function(t){return(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey}),t("ol.events.condition.altShiftKeysOnly",Or),t("ol.events.condition.always",tr),t("ol.events.condition.click",function(t){return"click"==t.type}),t("ol.events.condition.never",er),t("ol.events.condition.pointerMove",Ur),t("ol.events.condition.singleClick",Gr),t("ol.events.condition.doubleClick",function(t){return"dblclick"==t.type}),t("ol.events.condition.noModifierKeys",Br),t("ol.events.condition.platformModifierKeyOnly",function(t){return!(t=t.originalEvent).altKey&&($o?t.metaKey:t.ctrlKey)&&!t.shiftKey}),t("ol.events.condition.shiftKeyOnly",Kr),t("ol.events.condition.targetNotEditable",Wr),t("ol.events.condition.mouseOnly",Vr),t("ol.events.condition.primaryAction",Xr),t("ol.control.Attribution",Mo),t("ol.control.Attribution.render",To),Mo.prototype.getCollapsible=Mo.prototype.Um,Mo.prototype.setCollapsible=Mo.prototype.Xm,Mo.prototype.setCollapsed=Mo.prototype.Wm,Mo.prototype.getCollapsed=Mo.prototype.Tm,t("ol.control.Control",Po),Po.prototype.getMap=Po.prototype.g,Po.prototype.setTarget=Po.prototype.f,t("ol.control.FullScreen",ko),t("ol.control.MousePosition",Ko),t("ol.control.MousePosition.render",Wo),Ko.prototype.getCoordinateFormat=Ko.prototype.xh,Ko.prototype.getProjection=Ko.prototype.Zh,Ko.prototype.setCoordinateFormat=Ko.prototype.kj,Ko.prototype.setProjection=Ko.prototype.$h,t("ol.control.OverviewMap",ca),t("ol.control.OverviewMap.render",fa),ca.prototype.getCollapsible=ca.prototype.$m,ca.prototype.setCollapsible=ca.prototype.cn,ca.prototype.setCollapsed=ca.prototype.bn,ca.prototype.getCollapsed=ca.prototype.Zm,ca.prototype.getOverviewMap=ca.prototype.gl,t("ol.control.Rotate",Ro),t("ol.control.Rotate.render",Fo),t("ol.control.ScaleLine",va),va.prototype.getUnits=va.prototype.C,t("ol.control.ScaleLine.render",ba),va.prototype.setUnits=va.prototype.I,t("ol.control.Zoom",No),t("ol.control.ZoomSlider",Sa),t("ol.control.ZoomSlider.render",Ma),t("ol.control.ZoomToExtent",Ea),oo.prototype.changed=oo.prototype.s,oo.prototype.dispatchEvent=oo.prototype.b,oo.prototype.getRevision=oo.prototype.L,oo.prototype.on=oo.prototype.J,oo.prototype.un=oo.prototype.K,y.prototype.getKeys=y.prototype.O,y.prototype.getProperties=y.prototype.N,y.prototype.setProperties=y.prototype.H,y.prototype.unset=y.prototype.P,y.prototype.changed=y.prototype.s,y.prototype.dispatchEvent=y.prototype.b,y.prototype.getRevision=y.prototype.L,y.prototype.on=y.prototype.J,y.prototype.un=y.prototype.K,Aa.prototype.getKeys=Aa.prototype.O,Aa.prototype.getProperties=Aa.prototype.N,Aa.prototype.setProperties=Aa.prototype.H,Aa.prototype.unset=Aa.prototype.P,Aa.prototype.changed=Aa.prototype.s,Aa.prototype.dispatchEvent=Aa.prototype.b,Aa.prototype.getRevision=Aa.prototype.L,Aa.prototype.on=Aa.prototype.J,Aa.prototype.un=Aa.prototype.K,v.prototype.getKeys=v.prototype.O,v.prototype.getProperties=v.prototype.N,v.prototype.setProperties=v.prototype.H,v.prototype.unset=v.prototype.P,v.prototype.changed=v.prototype.s,v.prototype.dispatchEvent=v.prototype.b,v.prototype.getRevision=v.prototype.L,v.prototype.on=v.prototype.J,v.prototype.un=v.prototype.K,$f.prototype.getKeys=$f.prototype.O,$f.prototype.getProperties=$f.prototype.N,$f.prototype.setProperties=$f.prototype.H,$f.prototype.unset=$f.prototype.P,$f.prototype.changed=$f.prototype.s,$f.prototype.dispatchEvent=$f.prototype.b,$f.prototype.getRevision=$f.prototype.L,$f.prototype.on=$f.prototype.J,$f.prototype.un=$f.prototype.K,sd.prototype.getTileCoord=sd.prototype.f,u.prototype.getKeys=u.prototype.O,u.prototype.getProperties=u.prototype.N,u.prototype.setProperties=u.prototype.H,u.prototype.unset=u.prototype.P,u.prototype.changed=u.prototype.s,u.prototype.dispatchEvent=u.prototype.b,u.prototype.getRevision=u.prototype.L,u.prototype.on=u.prototype.J,u.prototype.un=u.prototype.K,sa.prototype.getKeys=sa.prototype.O,sa.prototype.getProperties=sa.prototype.N,sa.prototype.setProperties=sa.prototype.H,sa.prototype.unset=sa.prototype.P,sa.prototype.changed=sa.prototype.s,sa.prototype.dispatchEvent=sa.prototype.b,sa.prototype.getRevision=sa.prototype.L,sa.prototype.on=sa.prototype.J,sa.prototype.un=sa.prototype.K,Vv.prototype.getTileCoord=Vv.prototype.f,zv.prototype.getTileCoord=zv.prototype.f,l.prototype.getKeys=l.prototype.O,l.prototype.getProperties=l.prototype.N,l.prototype.setProperties=l.prototype.H,l.prototype.unset=l.prototype.P,l.prototype.changed=l.prototype.s,l.prototype.dispatchEvent=l.prototype.b,l.prototype.getRevision=l.prototype.L,l.prototype.on=l.prototype.J,l.prototype.un=l.prototype.K,Zv.prototype.forEachTileCoord=Zv.prototype.Rf,Zv.prototype.getMaxZoom=Zv.prototype.Ti,Zv.prototype.getMinZoom=Zv.prototype.Ui,Zv.prototype.getOrigin=Zv.prototype.Pc,Zv.prototype.getResolution=Zv.prototype.Da,Zv.prototype.getResolutions=Zv.prototype.Vi,Zv.prototype.getTileCoordExtent=Zv.prototype.Aa,Zv.prototype.getTileCoordForCoordAndResolution=Zv.prototype.Be,Zv.prototype.getTileCoordForCoordAndZ=Zv.prototype.bg,Zv.prototype.getTileSize=Zv.prototype.gb,Zv.prototype.getZForResolution=Zv.prototype.tc,La.prototype.getOpacity=La.prototype.Ze,La.prototype.getRotateWithView=La.prototype.$e,La.prototype.getRotation=La.prototype.af,La.prototype.getScale=La.prototype.bf,La.prototype.getSnapToPixel=La.prototype.Ae,La.prototype.setOpacity=La.prototype.td,La.prototype.setRotation=La.prototype.cf,La.prototype.setScale=La.prototype.ud,Fa.prototype.getAngle=Fa.prototype.Pi,Fa.prototype.getFill=Fa.prototype.Fa,Fa.prototype.getPoints=Fa.prototype.Qi,Fa.prototype.getRadius=Fa.prototype.Ri,Fa.prototype.getRadius2=Fa.prototype.Fh,Fa.prototype.getStroke=Fa.prototype.Ga,Fa.prototype.getOpacity=Fa.prototype.Ze,Fa.prototype.getRotateWithView=Fa.prototype.$e,Fa.prototype.getRotation=Fa.prototype.af,Fa.prototype.getScale=Fa.prototype.bf,Fa.prototype.getSnapToPixel=Fa.prototype.Ae,Fa.prototype.setOpacity=Fa.prototype.td,Fa.prototype.setRotation=Fa.prototype.cf,Fa.prototype.setScale=Fa.prototype.ud,vy.prototype.getOpacity=vy.prototype.Ze,vy.prototype.getRotateWithView=vy.prototype.$e,vy.prototype.getRotation=vy.prototype.af,vy.prototype.getScale=vy.prototype.bf,vy.prototype.getSnapToPixel=vy.prototype.Ae,vy.prototype.setOpacity=vy.prototype.td,vy.prototype.setRotation=vy.prototype.cf,vy.prototype.setScale=vy.prototype.ud,hg.prototype.getKeys=hg.prototype.O,hg.prototype.getProperties=hg.prototype.N,hg.prototype.setProperties=hg.prototype.H,hg.prototype.unset=hg.prototype.P,hg.prototype.changed=hg.prototype.s,hg.prototype.dispatchEvent=hg.prototype.b,hg.prototype.getRevision=hg.prototype.L,hg.prototype.on=hg.prototype.J,hg.prototype.un=hg.prototype.K,ev.prototype.getAttributions=ev.prototype.ya,ev.prototype.getLogo=ev.prototype.xa,ev.prototype.getProjection=ev.prototype.za,ev.prototype.refresh=ev.prototype.sa,ev.prototype.setAttributions=ev.prototype.ua,ev.prototype.getKeys=ev.prototype.O,ev.prototype.getProperties=ev.prototype.N,ev.prototype.setProperties=ev.prototype.H,ev.prototype.unset=ev.prototype.P,ev.prototype.changed=ev.prototype.s,ev.prototype.dispatchEvent=ev.prototype.b,ev.prototype.getRevision=ev.prototype.L,ev.prototype.on=ev.prototype.J,ev.prototype.un=ev.prototype.K,pv.prototype.getTileGrid=pv.prototype.ab,pv.prototype.refresh=pv.prototype.sa,pv.prototype.getAttributions=pv.prototype.ya,pv.prototype.getLogo=pv.prototype.xa,pv.prototype.getProjection=pv.prototype.za,pv.prototype.setAttributions=pv.prototype.ua,pv.prototype.getKeys=pv.prototype.O,pv.prototype.getProperties=pv.prototype.N,pv.prototype.setProperties=pv.prototype.H,pv.prototype.unset=pv.prototype.P,pv.prototype.changed=pv.prototype.s,pv.prototype.dispatchEvent=pv.prototype.b,pv.prototype.getRevision=pv.prototype.L,pv.prototype.on=pv.prototype.J,pv.prototype.un=pv.prototype.K,A.prototype.getTileLoadFunction=A.prototype.pb,A.prototype.getTileUrlFunction=A.prototype.qb,A.prototype.getUrls=A.prototype.rb,A.prototype.setTileLoadFunction=A.prototype.vb,A.prototype.setTileUrlFunction=A.prototype.cb,A.prototype.setUrl=A.prototype.jb,A.prototype.setUrls=A.prototype.eb,A.prototype.getTileGrid=A.prototype.ab,A.prototype.refresh=A.prototype.sa,A.prototype.getAttributions=A.prototype.ya,A.prototype.getLogo=A.prototype.xa,A.prototype.getProjection=A.prototype.za,A.prototype.setAttributions=A.prototype.ua,A.prototype.getKeys=A.prototype.O,A.prototype.getProperties=A.prototype.N,A.prototype.setProperties=A.prototype.H,A.prototype.unset=A.prototype.P,A.prototype.changed=A.prototype.s,A.prototype.dispatchEvent=A.prototype.b,A.prototype.getRevision=A.prototype.L,A.prototype.on=A.prototype.J,A.prototype.un=A.prototype.K,C.prototype.setRenderReprojectionEdges=C.prototype.Pb,C.prototype.setTileGridForProjection=C.prototype.Qb,C.prototype.getTileLoadFunction=C.prototype.pb,C.prototype.getTileUrlFunction=C.prototype.qb,C.prototype.getUrls=C.prototype.rb,C.prototype.setTileLoadFunction=C.prototype.vb,C.prototype.setTileUrlFunction=C.prototype.cb,C.prototype.setUrl=C.prototype.jb,C.prototype.setUrls=C.prototype.eb,C.prototype.getTileGrid=C.prototype.ab,C.prototype.refresh=C.prototype.sa,C.prototype.getAttributions=C.prototype.ya,C.prototype.getLogo=C.prototype.xa,C.prototype.getProjection=C.prototype.za,C.prototype.setAttributions=C.prototype.ua,C.prototype.getKeys=C.prototype.O,C.prototype.getProperties=C.prototype.N,C.prototype.setProperties=C.prototype.H,C.prototype.unset=C.prototype.P,C.prototype.changed=C.prototype.s,C.prototype.dispatchEvent=C.prototype.b,C.prototype.getRevision=C.prototype.L,C.prototype.on=C.prototype.J,C.prototype.un=C.prototype.K,j.prototype.setRenderReprojectionEdges=j.prototype.Pb,j.prototype.setTileGridForProjection=j.prototype.Qb,j.prototype.getTileLoadFunction=j.prototype.pb,j.prototype.getTileUrlFunction=j.prototype.qb,j.prototype.getUrls=j.prototype.rb,j.prototype.setTileLoadFunction=j.prototype.vb,j.prototype.setTileUrlFunction=j.prototype.cb,j.prototype.setUrl=j.prototype.jb,j.prototype.setUrls=j.prototype.eb,j.prototype.getTileGrid=j.prototype.ab,j.prototype.refresh=j.prototype.sa,j.prototype.getAttributions=j.prototype.ya,j.prototype.getLogo=j.prototype.xa,j.prototype.getProjection=j.prototype.za,j.prototype.setAttributions=j.prototype.ua,j.prototype.getKeys=j.prototype.O,j.prototype.getProperties=j.prototype.N,j.prototype.setProperties=j.prototype.H,j.prototype.unset=j.prototype.P,j.prototype.changed=j.prototype.s,j.prototype.dispatchEvent=j.prototype.b,j.prototype.getRevision=j.prototype.L,j.prototype.on=j.prototype.J,j.prototype.un=j.prototype.K,L.prototype.setRenderReprojectionEdges=L.prototype.Pb,L.prototype.setTileGridForProjection=L.prototype.Qb,L.prototype.getTileLoadFunction=L.prototype.pb,L.prototype.getTileUrlFunction=L.prototype.qb,L.prototype.getUrls=L.prototype.rb,L.prototype.setTileLoadFunction=L.prototype.vb,L.prototype.setTileUrlFunction=L.prototype.cb,L.prototype.setUrl=L.prototype.jb,L.prototype.setUrls=L.prototype.eb,L.prototype.getTileGrid=L.prototype.ab,L.prototype.refresh=L.prototype.sa,L.prototype.getAttributions=L.prototype.ya,L.prototype.getLogo=L.prototype.xa,L.prototype.getProjection=L.prototype.za,L.prototype.setAttributions=L.prototype.ua,L.prototype.getKeys=L.prototype.O,L.prototype.getProperties=L.prototype.N,L.prototype.setProperties=L.prototype.H,L.prototype.unset=L.prototype.P,L.prototype.changed=L.prototype.s,L.prototype.dispatchEvent=L.prototype.b,L.prototype.getRevision=L.prototype.L,L.prototype.on=L.prototype.J,L.prototype.un=L.prototype.K,P.prototype.getAttributions=P.prototype.ya,P.prototype.getLogo=P.prototype.xa,P.prototype.getProjection=P.prototype.za,P.prototype.refresh=P.prototype.sa,P.prototype.setAttributions=P.prototype.ua,P.prototype.getKeys=P.prototype.O,P.prototype.getProperties=P.prototype.N,P.prototype.setProperties=P.prototype.H,P.prototype.unset=P.prototype.P,P.prototype.changed=P.prototype.s,P.prototype.dispatchEvent=P.prototype.b,P.prototype.getRevision=P.prototype.L,P.prototype.on=P.prototype.J,P.prototype.un=P.prototype.K,R.prototype.addFeature=R.prototype.yb,R.prototype.addFeatures=R.prototype.cd,R.prototype.forEachFeature=R.prototype.sh,R.prototype.forEachFeatureInExtent=R.prototype.$b,R.prototype.forEachFeatureIntersectingExtent=R.prototype.th,R.prototype.getFeaturesCollection=R.prototype.Ah,R.prototype.getFeatures=R.prototype.Xe,R.prototype.getFeaturesAtCoordinate=R.prototype.zh,R.prototype.getFeaturesInExtent=R.prototype.Uf,R.prototype.getClosestFeatureToCoordinate=R.prototype.vh,R.prototype.getExtent=R.prototype.G,R.prototype.getFeatureById=R.prototype.yh,R.prototype.getFormat=R.prototype.Mi,R.prototype.getUrl=R.prototype.Ni,R.prototype.removeFeature=R.prototype.Gb,R.prototype.getAttributions=R.prototype.ya,R.prototype.getLogo=R.prototype.xa,R.prototype.getProjection=R.prototype.za,R.prototype.refresh=R.prototype.sa,R.prototype.setAttributions=R.prototype.ua,R.prototype.getKeys=R.prototype.O,R.prototype.getProperties=R.prototype.N,R.prototype.setProperties=R.prototype.H,R.prototype.unset=R.prototype.P,R.prototype.changed=R.prototype.s,R.prototype.dispatchEvent=R.prototype.b,R.prototype.getRevision=R.prototype.L,R.prototype.on=R.prototype.J,R.prototype.un=R.prototype.K,j0.prototype.getAttributions=j0.prototype.ya,j0.prototype.getLogo=j0.prototype.xa,j0.prototype.getProjection=j0.prototype.za,j0.prototype.refresh=j0.prototype.sa,j0.prototype.setAttributions=j0.prototype.ua,j0.prototype.getKeys=j0.prototype.O,j0.prototype.getProperties=j0.prototype.N,j0.prototype.setProperties=j0.prototype.H,j0.prototype.unset=j0.prototype.P,j0.prototype.changed=j0.prototype.s,j0.prototype.dispatchEvent=j0.prototype.b,j0.prototype.getRevision=j0.prototype.L,j0.prototype.on=j0.prototype.J,j0.prototype.un=j0.prototype.K,uv.prototype.getAttributions=uv.prototype.ya,uv.prototype.getLogo=uv.prototype.xa,uv.prototype.getProjection=uv.prototype.za,uv.prototype.refresh=uv.prototype.sa,uv.prototype.setAttributions=uv.prototype.ua,uv.prototype.getKeys=uv.prototype.O,uv.prototype.getProperties=uv.prototype.N,uv.prototype.setProperties=uv.prototype.H,uv.prototype.unset=uv.prototype.P,uv.prototype.changed=uv.prototype.s,uv.prototype.dispatchEvent=uv.prototype.b,uv.prototype.getRevision=uv.prototype.L,uv.prototype.on=uv.prototype.J,uv.prototype.un=uv.prototype.K,O0.prototype.getAttributions=O0.prototype.ya,O0.prototype.getLogo=O0.prototype.xa,O0.prototype.getProjection=O0.prototype.za,O0.prototype.refresh=O0.prototype.sa,O0.prototype.setAttributions=O0.prototype.ua,O0.prototype.getKeys=O0.prototype.O,O0.prototype.getProperties=O0.prototype.N,O0.prototype.setProperties=O0.prototype.H,O0.prototype.unset=O0.prototype.P,O0.prototype.changed=O0.prototype.s,O0.prototype.dispatchEvent=O0.prototype.b,O0.prototype.getRevision=O0.prototype.L,O0.prototype.on=O0.prototype.J,O0.prototype.un=O0.prototype.K,cv.prototype.getAttributions=cv.prototype.ya,cv.prototype.getLogo=cv.prototype.xa,cv.prototype.getProjection=cv.prototype.za,cv.prototype.refresh=cv.prototype.sa,cv.prototype.setAttributions=cv.prototype.ua,cv.prototype.getKeys=cv.prototype.O,cv.prototype.getProperties=cv.prototype.N,cv.prototype.setProperties=cv.prototype.H,cv.prototype.unset=cv.prototype.P,cv.prototype.changed=cv.prototype.s,cv.prototype.dispatchEvent=cv.prototype.b,cv.prototype.getRevision=cv.prototype.L,cv.prototype.on=cv.prototype.J,cv.prototype.un=cv.prototype.K,fv.prototype.getAttributions=fv.prototype.ya,fv.prototype.getLogo=fv.prototype.xa,fv.prototype.getProjection=fv.prototype.za,fv.prototype.refresh=fv.prototype.sa,fv.prototype.setAttributions=fv.prototype.ua,fv.prototype.getKeys=fv.prototype.O,fv.prototype.getProperties=fv.prototype.N,fv.prototype.setProperties=fv.prototype.H,fv.prototype.unset=fv.prototype.P,fv.prototype.changed=fv.prototype.s,fv.prototype.dispatchEvent=fv.prototype.b,fv.prototype.getRevision=fv.prototype.L,fv.prototype.on=fv.prototype.J,fv.prototype.un=fv.prototype.K,D0.prototype.getAttributions=D0.prototype.ya,D0.prototype.getLogo=D0.prototype.xa,D0.prototype.getProjection=D0.prototype.za,D0.prototype.refresh=D0.prototype.sa,D0.prototype.setAttributions=D0.prototype.ua,D0.prototype.getKeys=D0.prototype.O,D0.prototype.getProperties=D0.prototype.N,D0.prototype.setProperties=D0.prototype.H,D0.prototype.unset=D0.prototype.P,D0.prototype.changed=D0.prototype.s,D0.prototype.dispatchEvent=D0.prototype.b,D0.prototype.getRevision=D0.prototype.L,D0.prototype.on=D0.prototype.J,D0.prototype.un=D0.prototype.K,dv.prototype.getAttributions=dv.prototype.ya,dv.prototype.getLogo=dv.prototype.xa,dv.prototype.getProjection=dv.prototype.za,dv.prototype.refresh=dv.prototype.sa,dv.prototype.setAttributions=dv.prototype.ua,dv.prototype.getKeys=dv.prototype.O,dv.prototype.getProperties=dv.prototype.N,dv.prototype.setProperties=dv.prototype.H,dv.prototype.unset=dv.prototype.P,dv.prototype.changed=dv.prototype.s,dv.prototype.dispatchEvent=dv.prototype.b,dv.prototype.getRevision=dv.prototype.L,dv.prototype.on=dv.prototype.J,dv.prototype.un=dv.prototype.K,bv.prototype.setRenderReprojectionEdges=bv.prototype.Pb,bv.prototype.setTileGridForProjection=bv.prototype.Qb,bv.prototype.getTileLoadFunction=bv.prototype.pb,bv.prototype.getTileUrlFunction=bv.prototype.qb,bv.prototype.getUrls=bv.prototype.rb,bv.prototype.setTileLoadFunction=bv.prototype.vb,bv.prototype.setTileUrlFunction=bv.prototype.cb,bv.prototype.setUrl=bv.prototype.jb,bv.prototype.setUrls=bv.prototype.eb,bv.prototype.getTileGrid=bv.prototype.ab,bv.prototype.refresh=bv.prototype.sa,bv.prototype.getAttributions=bv.prototype.ya,bv.prototype.getLogo=bv.prototype.xa,bv.prototype.getProjection=bv.prototype.za,bv.prototype.setAttributions=bv.prototype.ua,bv.prototype.getKeys=bv.prototype.O,bv.prototype.getProperties=bv.prototype.N,bv.prototype.setProperties=bv.prototype.H,bv.prototype.unset=bv.prototype.P,bv.prototype.changed=bv.prototype.s,bv.prototype.dispatchEvent=bv.prototype.b,bv.prototype.getRevision=bv.prototype.L,bv.prototype.on=bv.prototype.J,bv.prototype.un=bv.prototype.K,Tv.prototype.getAttributions=Tv.prototype.ya,Tv.prototype.getLogo=Tv.prototype.xa,Tv.prototype.getProjection=Tv.prototype.za,Tv.prototype.refresh=Tv.prototype.sa,Tv.prototype.setAttributions=Tv.prototype.ua,Tv.prototype.getKeys=Tv.prototype.O,Tv.prototype.getProperties=Tv.prototype.N,Tv.prototype.setProperties=Tv.prototype.H,Tv.prototype.unset=Tv.prototype.P,Tv.prototype.changed=Tv.prototype.s,Tv.prototype.dispatchEvent=Tv.prototype.b,Tv.prototype.getRevision=Tv.prototype.L,Tv.prototype.on=Tv.prototype.J,Tv.prototype.un=Tv.prototype.K,Lv.prototype.setRenderReprojectionEdges=Lv.prototype.Pb,Lv.prototype.setTileGridForProjection=Lv.prototype.Qb,Lv.prototype.getTileLoadFunction=Lv.prototype.pb,Lv.prototype.getTileUrlFunction=Lv.prototype.qb,Lv.prototype.getUrls=Lv.prototype.rb,Lv.prototype.setTileLoadFunction=Lv.prototype.vb,Lv.prototype.setTileUrlFunction=Lv.prototype.cb,Lv.prototype.setUrl=Lv.prototype.jb,Lv.prototype.setUrls=Lv.prototype.eb,Lv.prototype.getTileGrid=Lv.prototype.ab,Lv.prototype.refresh=Lv.prototype.sa,Lv.prototype.getAttributions=Lv.prototype.ya,Lv.prototype.getLogo=Lv.prototype.xa,Lv.prototype.getProjection=Lv.prototype.za,Lv.prototype.setAttributions=Lv.prototype.ua,Lv.prototype.getKeys=Lv.prototype.O,Lv.prototype.getProperties=Lv.prototype.N,Lv.prototype.setProperties=Lv.prototype.H,Lv.prototype.unset=Lv.prototype.P,Lv.prototype.changed=Lv.prototype.s,Lv.prototype.dispatchEvent=Lv.prototype.b,Lv.prototype.getRevision=Lv.prototype.L,Lv.prototype.on=Lv.prototype.J,Lv.prototype.un=Lv.prototype.K,F.prototype.setRenderReprojectionEdges=F.prototype.Pb,F.prototype.setTileGridForProjection=F.prototype.Qb,F.prototype.getTileLoadFunction=F.prototype.pb,F.prototype.getTileUrlFunction=F.prototype.qb,F.prototype.getUrls=F.prototype.rb,F.prototype.setTileLoadFunction=F.prototype.vb,F.prototype.setTileUrlFunction=F.prototype.cb,F.prototype.setUrl=F.prototype.jb,F.prototype.setUrls=F.prototype.eb,F.prototype.getTileGrid=F.prototype.ab,F.prototype.refresh=F.prototype.sa,F.prototype.getAttributions=F.prototype.ya,F.prototype.getLogo=F.prototype.xa,F.prototype.getProjection=F.prototype.za,F.prototype.setAttributions=F.prototype.ua,F.prototype.getKeys=F.prototype.O,F.prototype.getProperties=F.prototype.N,F.prototype.setProperties=F.prototype.H,F.prototype.unset=F.prototype.P,F.prototype.changed=F.prototype.s,F.prototype.dispatchEvent=F.prototype.b,F.prototype.getRevision=F.prototype.L,F.prototype.on=F.prototype.J,F.prototype.un=F.prototype.K,kv.prototype.getTileGrid=kv.prototype.ab,kv.prototype.refresh=kv.prototype.sa,kv.prototype.getAttributions=kv.prototype.ya,kv.prototype.getLogo=kv.prototype.xa,kv.prototype.getProjection=kv.prototype.za,kv.prototype.setAttributions=kv.prototype.ua,kv.prototype.getKeys=kv.prototype.O,kv.prototype.getProperties=kv.prototype.N,kv.prototype.setProperties=kv.prototype.H,kv.prototype.unset=kv.prototype.P,kv.prototype.changed=kv.prototype.s,kv.prototype.dispatchEvent=kv.prototype.b,kv.prototype.getRevision=kv.prototype.L,kv.prototype.on=kv.prototype.J,kv.prototype.un=kv.prototype.K,N.prototype.setRenderReprojectionEdges=N.prototype.Pb,N.prototype.setTileGridForProjection=N.prototype.Qb,N.prototype.getTileLoadFunction=N.prototype.pb,N.prototype.getTileUrlFunction=N.prototype.qb,N.prototype.getUrls=N.prototype.rb,N.prototype.setTileLoadFunction=N.prototype.vb,N.prototype.setTileUrlFunction=N.prototype.cb,N.prototype.setUrl=N.prototype.jb,N.prototype.setUrls=N.prototype.eb,N.prototype.getTileGrid=N.prototype.ab,N.prototype.refresh=N.prototype.sa,N.prototype.getAttributions=N.prototype.ya,N.prototype.getLogo=N.prototype.xa,N.prototype.getProjection=N.prototype.za,N.prototype.setAttributions=N.prototype.ua,N.prototype.getKeys=N.prototype.O,N.prototype.getProperties=N.prototype.N,N.prototype.setProperties=N.prototype.H,N.prototype.unset=N.prototype.P,N.prototype.changed=N.prototype.s,N.prototype.dispatchEvent=N.prototype.b,N.prototype.getRevision=N.prototype.L,N.prototype.on=N.prototype.J,N.prototype.un=N.prototype.K,Dv.prototype.getTileGrid=Dv.prototype.ab,Dv.prototype.refresh=Dv.prototype.sa,Dv.prototype.getAttributions=Dv.prototype.ya,Dv.prototype.getLogo=Dv.prototype.xa,Dv.prototype.getProjection=Dv.prototype.za,Dv.prototype.setAttributions=Dv.prototype.ua,Dv.prototype.getKeys=Dv.prototype.O,Dv.prototype.getProperties=Dv.prototype.N,Dv.prototype.setProperties=Dv.prototype.H,Dv.prototype.unset=Dv.prototype.P,Dv.prototype.changed=Dv.prototype.s,Dv.prototype.dispatchEvent=Dv.prototype.b,Dv.prototype.getRevision=Dv.prototype.L,Dv.prototype.on=Dv.prototype.J,Dv.prototype.un=Dv.prototype.K,I.prototype.setRenderReprojectionEdges=I.prototype.Pb,I.prototype.setTileGridForProjection=I.prototype.Qb,I.prototype.getTileLoadFunction=I.prototype.pb,I.prototype.getTileUrlFunction=I.prototype.qb,I.prototype.getUrls=I.prototype.rb,I.prototype.setTileLoadFunction=I.prototype.vb,I.prototype.setTileUrlFunction=I.prototype.cb,I.prototype.setUrl=I.prototype.jb,I.prototype.setUrls=I.prototype.eb,I.prototype.getTileGrid=I.prototype.ab,I.prototype.refresh=I.prototype.sa,I.prototype.getAttributions=I.prototype.ya,I.prototype.getLogo=I.prototype.xa,I.prototype.getProjection=I.prototype.za,I.prototype.setAttributions=I.prototype.ua,I.prototype.getKeys=I.prototype.O,I.prototype.getProperties=I.prototype.N,I.prototype.setProperties=I.prototype.H,I.prototype.unset=I.prototype.P,I.prototype.changed=I.prototype.s,I.prototype.dispatchEvent=I.prototype.b,I.prototype.getRevision=I.prototype.L,I.prototype.on=I.prototype.J,I.prototype.un=I.prototype.K,Hv.prototype.getTileLoadFunction=Hv.prototype.pb,Hv.prototype.getTileUrlFunction=Hv.prototype.qb,Hv.prototype.getUrls=Hv.prototype.rb,Hv.prototype.setTileLoadFunction=Hv.prototype.vb,Hv.prototype.setTileUrlFunction=Hv.prototype.cb,Hv.prototype.setUrl=Hv.prototype.jb,Hv.prototype.setUrls=Hv.prototype.eb,Hv.prototype.getTileGrid=Hv.prototype.ab,Hv.prototype.refresh=Hv.prototype.sa,Hv.prototype.getAttributions=Hv.prototype.ya,Hv.prototype.getLogo=Hv.prototype.xa,Hv.prototype.getProjection=Hv.prototype.za,Hv.prototype.setAttributions=Hv.prototype.ua,Hv.prototype.getKeys=Hv.prototype.O,Hv.prototype.getProperties=Hv.prototype.N,Hv.prototype.setProperties=Hv.prototype.H,Hv.prototype.unset=Hv.prototype.P,Hv.prototype.changed=Hv.prototype.s,Hv.prototype.dispatchEvent=Hv.prototype.b,Hv.prototype.getRevision=Hv.prototype.L,Hv.prototype.on=Hv.prototype.J,Hv.prototype.un=Hv.prototype.K,k.prototype.setRenderReprojectionEdges=k.prototype.Pb,k.prototype.setTileGridForProjection=k.prototype.Qb,k.prototype.getTileLoadFunction=k.prototype.pb,k.prototype.getTileUrlFunction=k.prototype.qb,k.prototype.getUrls=k.prototype.rb,k.prototype.setTileLoadFunction=k.prototype.vb,k.prototype.setTileUrlFunction=k.prototype.cb,k.prototype.setUrl=k.prototype.jb,k.prototype.setUrls=k.prototype.eb,k.prototype.getTileGrid=k.prototype.ab,k.prototype.refresh=k.prototype.sa,k.prototype.getAttributions=k.prototype.ya,k.prototype.getLogo=k.prototype.xa,k.prototype.getProjection=k.prototype.za,k.prototype.setAttributions=k.prototype.ua,k.prototype.getKeys=k.prototype.O,k.prototype.getProperties=k.prototype.N,k.prototype.setProperties=k.prototype.H,k.prototype.unset=k.prototype.P,k.prototype.changed=k.prototype.s,k.prototype.dispatchEvent=k.prototype.b,k.prototype.getRevision=k.prototype.L,k.prototype.on=k.prototype.J,k.prototype.un=k.prototype.K,Yv.prototype.setRenderReprojectionEdges=Yv.prototype.Pb,Yv.prototype.setTileGridForProjection=Yv.prototype.Qb,Yv.prototype.getTileLoadFunction=Yv.prototype.pb,Yv.prototype.getTileUrlFunction=Yv.prototype.qb,Yv.prototype.getUrls=Yv.prototype.rb,Yv.prototype.setTileLoadFunction=Yv.prototype.vb,Yv.prototype.setTileUrlFunction=Yv.prototype.cb,Yv.prototype.setUrl=Yv.prototype.jb,Yv.prototype.setUrls=Yv.prototype.eb,Yv.prototype.getTileGrid=Yv.prototype.ab,Yv.prototype.refresh=Yv.prototype.sa,Yv.prototype.getAttributions=Yv.prototype.ya,Yv.prototype.getLogo=Yv.prototype.xa,Yv.prototype.getProjection=Yv.prototype.za,Yv.prototype.setAttributions=Yv.prototype.ua,Yv.prototype.getKeys=Yv.prototype.O,Yv.prototype.getProperties=Yv.prototype.N,Yv.prototype.setProperties=Yv.prototype.H,Yv.prototype.unset=Yv.prototype.P,Yv.prototype.changed=Yv.prototype.s,Yv.prototype.dispatchEvent=Yv.prototype.b,Yv.prototype.getRevision=Yv.prototype.L,Yv.prototype.on=Yv.prototype.J,Yv.prototype.un=Yv.prototype.K,J0.prototype.getTileCoord=J0.prototype.f,Dd.prototype.changed=Dd.prototype.s,Dd.prototype.dispatchEvent=Dd.prototype.b,Dd.prototype.getRevision=Dd.prototype.L,Dd.prototype.on=Dd.prototype.J,Dd.prototype.un=Dd.prototype.K,ng.prototype.changed=ng.prototype.s,ng.prototype.dispatchEvent=ng.prototype.b,ng.prototype.getRevision=ng.prototype.L,ng.prototype.on=ng.prototype.J,ng.prototype.un=ng.prototype.K,U0.prototype.changed=U0.prototype.s,U0.prototype.dispatchEvent=U0.prototype.b,U0.prototype.getRevision=U0.prototype.L,U0.prototype.on=U0.prototype.J,U0.prototype.un=U0.prototype.K,H0.prototype.changed=H0.prototype.s,H0.prototype.dispatchEvent=H0.prototype.b,H0.prototype.getRevision=H0.prototype.L,H0.prototype.on=H0.prototype.J,H0.prototype.un=H0.prototype.K,sg.prototype.changed=sg.prototype.s,sg.prototype.dispatchEvent=sg.prototype.b,sg.prototype.getRevision=sg.prototype.L,sg.prototype.on=sg.prototype.J,sg.prototype.un=sg.prototype.K,zd.prototype.changed=zd.prototype.s,zd.prototype.dispatchEvent=zd.prototype.b,zd.prototype.getRevision=zd.prototype.L,zd.prototype.on=zd.prototype.J,zd.prototype.un=zd.prototype.K,w0.prototype.changed=w0.prototype.s,w0.prototype.dispatchEvent=w0.prototype.b,w0.prototype.getRevision=w0.prototype.L,w0.prototype.on=w0.prototype.J,w0.prototype.un=w0.prototype.K,S0.prototype.changed=S0.prototype.s,S0.prototype.dispatchEvent=S0.prototype.b,S0.prototype.getRevision=S0.prototype.L,S0.prototype.on=S0.prototype.J,S0.prototype.un=S0.prototype.K,B0.prototype.changed=B0.prototype.s,B0.prototype.dispatchEvent=B0.prototype.b,B0.prototype.getRevision=B0.prototype.L,B0.prototype.on=B0.prototype.J,B0.prototype.un=B0.prototype.K,Qd.prototype.changed=Qd.prototype.s,Qd.prototype.dispatchEvent=Qd.prototype.b,Qd.prototype.getRevision=Qd.prototype.L,Qd.prototype.on=Qd.prototype.J,Qd.prototype.un=Qd.prototype.K,Z0.prototype.changed=Z0.prototype.s,Z0.prototype.dispatchEvent=Z0.prototype.b,Z0.prototype.getRevision=Z0.prototype.L,Z0.prototype.on=Z0.prototype.J,Z0.prototype.un=Z0.prototype.K,Nn.prototype.getKeys=Nn.prototype.O,Nn.prototype.getProperties=Nn.prototype.N,Nn.prototype.setProperties=Nn.prototype.H,Nn.prototype.unset=Nn.prototype.P,Nn.prototype.changed=Nn.prototype.s,Nn.prototype.dispatchEvent=Nn.prototype.b,Nn.prototype.getRevision=Nn.prototype.L,Nn.prototype.on=Nn.prototype.J,Nn.prototype.un=Nn.prototype.K,kn.prototype.getExtent=kn.prototype.G,kn.prototype.getMaxResolution=kn.prototype.fc,kn.prototype.getMinResolution=kn.prototype.gc,kn.prototype.getOpacity=kn.prototype.hc,kn.prototype.getVisible=kn.prototype.Mb,kn.prototype.getZIndex=kn.prototype.Ba,kn.prototype.setExtent=kn.prototype.vc,kn.prototype.setMaxResolution=kn.prototype.Ac,kn.prototype.setMinResolution=kn.prototype.Bc,kn.prototype.setOpacity=kn.prototype.wc,kn.prototype.setVisible=kn.prototype.xc,kn.prototype.setZIndex=kn.prototype.Vb,kn.prototype.getKeys=kn.prototype.O,kn.prototype.getProperties=kn.prototype.N,kn.prototype.setProperties=kn.prototype.H,kn.prototype.unset=kn.prototype.P,kn.prototype.changed=kn.prototype.s,kn.prototype.dispatchEvent=kn.prototype.b,kn.prototype.getRevision=kn.prototype.L,kn.prototype.on=kn.prototype.J,kn.prototype.un=kn.prototype.K,o.prototype.getExtent=o.prototype.G,o.prototype.getMaxResolution=o.prototype.fc,o.prototype.getMinResolution=o.prototype.gc,o.prototype.getOpacity=o.prototype.hc,o.prototype.getVisible=o.prototype.Mb,o.prototype.getZIndex=o.prototype.Ba,o.prototype.setExtent=o.prototype.vc,o.prototype.setMaxResolution=o.prototype.Ac,o.prototype.setMinResolution=o.prototype.Bc,o.prototype.setOpacity=o.prototype.wc,o.prototype.setVisible=o.prototype.xc,o.prototype.setZIndex=o.prototype.Vb,o.prototype.getKeys=o.prototype.O,o.prototype.getProperties=o.prototype.N,o.prototype.setProperties=o.prototype.H,o.prototype.unset=o.prototype.P,o.prototype.changed=o.prototype.s,o.prototype.dispatchEvent=o.prototype.b,o.prototype.getRevision=o.prototype.L,o.prototype.on=o.prototype.J,o.prototype.un=o.prototype.K,S.prototype.setSource=S.prototype.Wc,S.prototype.getExtent=S.prototype.G,S.prototype.getMaxResolution=S.prototype.fc,S.prototype.getMinResolution=S.prototype.gc,S.prototype.getOpacity=S.prototype.hc,S.prototype.getVisible=S.prototype.Mb,S.prototype.getZIndex=S.prototype.Ba,S.prototype.setExtent=S.prototype.vc,S.prototype.setMaxResolution=S.prototype.Ac,S.prototype.setMinResolution=S.prototype.Bc,S.prototype.setOpacity=S.prototype.wc,S.prototype.setVisible=S.prototype.xc,S.prototype.setZIndex=S.prototype.Vb,S.prototype.getKeys=S.prototype.O,S.prototype.getProperties=S.prototype.N,S.prototype.setProperties=S.prototype.H,S.prototype.unset=S.prototype.P,S.prototype.changed=S.prototype.s,S.prototype.dispatchEvent=S.prototype.b,S.prototype.getRevision=S.prototype.L,S.prototype.on=S.prototype.J,S.prototype.un=S.prototype.K,M.prototype.getSource=M.prototype.ha,M.prototype.getStyle=M.prototype.D,M.prototype.getStyleFunction=M.prototype.C,M.prototype.setStyle=M.prototype.g,M.prototype.setSource=M.prototype.Wc,M.prototype.getExtent=M.prototype.G,M.prototype.getMaxResolution=M.prototype.fc,M.prototype.getMinResolution=M.prototype.gc,M.prototype.getOpacity=M.prototype.hc,M.prototype.getVisible=M.prototype.Mb,M.prototype.getZIndex=M.prototype.Ba,M.prototype.setExtent=M.prototype.vc,M.prototype.setMaxResolution=M.prototype.Ac,M.prototype.setMinResolution=M.prototype.Bc,M.prototype.setOpacity=M.prototype.wc,M.prototype.setVisible=M.prototype.xc,M.prototype.setZIndex=M.prototype.Vb,M.prototype.getKeys=M.prototype.O,M.prototype.getProperties=M.prototype.N,M.prototype.setProperties=M.prototype.H,M.prototype.unset=M.prototype.P,M.prototype.changed=M.prototype.s,M.prototype.dispatchEvent=M.prototype.b,M.prototype.getRevision=M.prototype.L,M.prototype.on=M.prototype.J,M.prototype.un=M.prototype.K,G0.prototype.setSource=G0.prototype.Wc,G0.prototype.getExtent=G0.prototype.G,G0.prototype.getMaxResolution=G0.prototype.fc,G0.prototype.getMinResolution=G0.prototype.gc,G0.prototype.getOpacity=G0.prototype.hc,G0.prototype.getVisible=G0.prototype.Mb,G0.prototype.getZIndex=G0.prototype.Ba,G0.prototype.setExtent=G0.prototype.vc,G0.prototype.setMaxResolution=G0.prototype.Ac,G0.prototype.setMinResolution=G0.prototype.Bc,G0.prototype.setOpacity=G0.prototype.wc,G0.prototype.setVisible=G0.prototype.xc,G0.prototype.setZIndex=G0.prototype.Vb,G0.prototype.getKeys=G0.prototype.O,G0.prototype.getProperties=G0.prototype.N,G0.prototype.setProperties=G0.prototype.H,G0.prototype.unset=G0.prototype.P,G0.prototype.changed=G0.prototype.s,G0.prototype.dispatchEvent=G0.prototype.b,G0.prototype.getRevision=G0.prototype.L,G0.prototype.on=G0.prototype.J,G0.prototype.un=G0.prototype.K,T.prototype.setSource=T.prototype.Wc,T.prototype.getExtent=T.prototype.G,T.prototype.getMaxResolution=T.prototype.fc,T.prototype.getMinResolution=T.prototype.gc,T.prototype.getOpacity=T.prototype.hc,T.prototype.getVisible=T.prototype.Mb,T.prototype.getZIndex=T.prototype.Ba,T.prototype.setExtent=T.prototype.vc,T.prototype.setMaxResolution=T.prototype.Ac,T.prototype.setMinResolution=T.prototype.Bc,T.prototype.setOpacity=T.prototype.wc,T.prototype.setVisible=T.prototype.xc,T.prototype.setZIndex=T.prototype.Vb,T.prototype.getKeys=T.prototype.O,T.prototype.getProperties=T.prototype.N,T.prototype.setProperties=T.prototype.H,T.prototype.unset=T.prototype.P,T.prototype.changed=T.prototype.s,T.prototype.dispatchEvent=T.prototype.b,T.prototype.getRevision=T.prototype.L,T.prototype.on=T.prototype.J,T.prototype.un=T.prototype.K,E.prototype.getSource=E.prototype.ha,E.prototype.getStyle=E.prototype.D,E.prototype.getStyleFunction=E.prototype.C,E.prototype.setStyle=E.prototype.g,E.prototype.setSource=E.prototype.Wc,E.prototype.getExtent=E.prototype.G,E.prototype.getMaxResolution=E.prototype.fc,E.prototype.getMinResolution=E.prototype.gc,E.prototype.getOpacity=E.prototype.hc,E.prototype.getVisible=E.prototype.Mb,E.prototype.getZIndex=E.prototype.Ba,E.prototype.setExtent=E.prototype.vc,E.prototype.setMaxResolution=E.prototype.Ac,E.prototype.setMinResolution=E.prototype.Bc,E.prototype.setOpacity=E.prototype.wc,E.prototype.setVisible=E.prototype.xc,E.prototype.setZIndex=E.prototype.Vb,E.prototype.getKeys=E.prototype.O,E.prototype.getProperties=E.prototype.N,E.prototype.setProperties=E.prototype.H,E.prototype.unset=E.prototype.P,E.prototype.changed=E.prototype.s,E.prototype.dispatchEvent=E.prototype.b,E.prototype.getRevision=E.prototype.L,E.prototype.on=E.prototype.J,E.prototype.un=E.prototype.K,Lr.prototype.getKeys=Lr.prototype.O,Lr.prototype.getProperties=Lr.prototype.N,Lr.prototype.setProperties=Lr.prototype.H,Lr.prototype.unset=Lr.prototype.P,Lr.prototype.changed=Lr.prototype.s,Lr.prototype.dispatchEvent=Lr.prototype.b,Lr.prototype.getRevision=Lr.prototype.L,Lr.prototype.on=Lr.prototype.J,Lr.prototype.un=Lr.prototype.K,Ir.prototype.getActive=Ir.prototype.c,Ir.prototype.getMap=Ir.prototype.f,Ir.prototype.setActive=Ir.prototype.Ha,Ir.prototype.getKeys=Ir.prototype.O,Ir.prototype.getProperties=Ir.prototype.N,Ir.prototype.setProperties=Ir.prototype.H,Ir.prototype.unset=Ir.prototype.P,Ir.prototype.changed=Ir.prototype.s,Ir.prototype.dispatchEvent=Ir.prototype.b,Ir.prototype.getRevision=Ir.prototype.L,Ir.prototype.on=Ir.prototype.J,Ir.prototype.un=Ir.prototype.K,ld.prototype.getActive=ld.prototype.c,ld.prototype.getMap=ld.prototype.f,ld.prototype.setActive=ld.prototype.Ha,ld.prototype.getKeys=ld.prototype.O,ld.prototype.getProperties=ld.prototype.N,ld.prototype.setProperties=ld.prototype.H,ld.prototype.unset=ld.prototype.P,ld.prototype.changed=ld.prototype.s,ld.prototype.dispatchEvent=ld.prototype.b,ld.prototype.getRevision=ld.prototype.L,ld.prototype.on=ld.prototype.J,ld.prototype.un=ld.prototype.K,zr.prototype.getActive=zr.prototype.c,zr.prototype.getMap=zr.prototype.f,zr.prototype.setActive=zr.prototype.Ha,zr.prototype.getKeys=zr.prototype.O,zr.prototype.getProperties=zr.prototype.N,zr.prototype.setProperties=zr.prototype.H,zr.prototype.unset=zr.prototype.P,zr.prototype.changed=zr.prototype.s,zr.prototype.dispatchEvent=zr.prototype.b,zr.prototype.getRevision=zr.prototype.L,zr.prototype.on=zr.prototype.J,zr.prototype.un=zr.prototype.K,pn.prototype.getActive=pn.prototype.c,pn.prototype.getMap=pn.prototype.f,pn.prototype.setActive=pn.prototype.Ha,pn.prototype.getKeys=pn.prototype.O,pn.prototype.getProperties=pn.prototype.N,pn.prototype.setProperties=pn.prototype.H,pn.prototype.unset=pn.prototype.P,pn.prototype.changed=pn.prototype.s,pn.prototype.dispatchEvent=pn.prototype.b,pn.prototype.getRevision=pn.prototype.L,pn.prototype.on=pn.prototype.J,pn.prototype.un=pn.prototype.K,qr.prototype.getActive=qr.prototype.c,qr.prototype.getMap=qr.prototype.f,qr.prototype.setActive=qr.prototype.Ha,qr.prototype.getKeys=qr.prototype.O,qr.prototype.getProperties=qr.prototype.N,qr.prototype.setProperties=qr.prototype.H,qr.prototype.unset=qr.prototype.P,qr.prototype.changed=qr.prototype.s,qr.prototype.dispatchEvent=qr.prototype.b,qr.prototype.getRevision=qr.prototype.L,qr.prototype.on=qr.prototype.J,qr.prototype.un=qr.prototype.K,$r.prototype.getActive=$r.prototype.c,$r.prototype.getMap=$r.prototype.f,$r.prototype.setActive=$r.prototype.Ha,$r.prototype.getKeys=$r.prototype.O,$r.prototype.getProperties=$r.prototype.N,$r.prototype.setProperties=$r.prototype.H,$r.prototype.unset=$r.prototype.P,$r.prototype.changed=$r.prototype.s,$r.prototype.dispatchEvent=$r.prototype.b,$r.prototype.getRevision=$r.prototype.L,$r.prototype.on=$r.prototype.J,$r.prototype.un=$r.prototype.K,gd.prototype.getActive=gd.prototype.c,gd.prototype.getMap=gd.prototype.f,gd.prototype.setActive=gd.prototype.Ha,gd.prototype.getKeys=gd.prototype.O,gd.prototype.getProperties=gd.prototype.N,gd.prototype.setProperties=gd.prototype.H,gd.prototype.unset=gd.prototype.P,gd.prototype.changed=gd.prototype.s,gd.prototype.dispatchEvent=gd.prototype.b,gd.prototype.getRevision=gd.prototype.L,gd.prototype.on=gd.prototype.J,gd.prototype.un=gd.prototype.K,dn.prototype.getGeometry=dn.prototype.V,dn.prototype.getActive=dn.prototype.c,dn.prototype.getMap=dn.prototype.f,dn.prototype.setActive=dn.prototype.Ha,dn.prototype.getKeys=dn.prototype.O,dn.prototype.getProperties=dn.prototype.N,dn.prototype.setProperties=dn.prototype.H,dn.prototype.unset=dn.prototype.P,dn.prototype.changed=dn.prototype.s,dn.prototype.dispatchEvent=dn.prototype.b,dn.prototype.getRevision=dn.prototype.L,dn.prototype.on=dn.prototype.J,dn.prototype.un=dn.prototype.K,vg.prototype.getActive=vg.prototype.c,vg.prototype.getMap=vg.prototype.f,vg.prototype.setActive=vg.prototype.Ha,vg.prototype.getKeys=vg.prototype.O,vg.prototype.getProperties=vg.prototype.N,vg.prototype.setProperties=vg.prototype.H,vg.prototype.unset=vg.prototype.P,vg.prototype.changed=vg.prototype.s,vg.prototype.dispatchEvent=vg.prototype.b,vg.prototype.getRevision=vg.prototype.L,vg.prototype.on=vg.prototype.J,vg.prototype.un=vg.prototype.K,Fg.prototype.getActive=Fg.prototype.c,Fg.prototype.getMap=Fg.prototype.f,Fg.prototype.setActive=Fg.prototype.Ha,Fg.prototype.getKeys=Fg.prototype.O,Fg.prototype.getProperties=Fg.prototype.N,Fg.prototype.setProperties=Fg.prototype.H,Fg.prototype.unset=Fg.prototype.P,Fg.prototype.changed=Fg.prototype.s,Fg.prototype.dispatchEvent=Fg.prototype.b,Fg.prototype.getRevision=Fg.prototype.L,Fg.prototype.on=Fg.prototype.J,Fg.prototype.un=Fg.prototype.K,gn.prototype.getActive=gn.prototype.c,gn.prototype.getMap=gn.prototype.f,gn.prototype.setActive=gn.prototype.Ha,gn.prototype.getKeys=gn.prototype.O,gn.prototype.getProperties=gn.prototype.N,gn.prototype.setProperties=gn.prototype.H,gn.prototype.unset=gn.prototype.P,gn.prototype.changed=gn.prototype.s,gn.prototype.dispatchEvent=gn.prototype.b,gn.prototype.getRevision=gn.prototype.L,gn.prototype.on=gn.prototype.J,gn.prototype.un=gn.prototype.K,mn.prototype.getActive=mn.prototype.c,mn.prototype.getMap=mn.prototype.f,mn.prototype.setActive=mn.prototype.Ha,mn.prototype.getKeys=mn.prototype.O,mn.prototype.getProperties=mn.prototype.N,mn.prototype.setProperties=mn.prototype.H,mn.prototype.unset=mn.prototype.P,mn.prototype.changed=mn.prototype.s,mn.prototype.dispatchEvent=mn.prototype.b,mn.prototype.getRevision=mn.prototype.L,mn.prototype.on=mn.prototype.J,mn.prototype.un=mn.prototype.K,Vg.prototype.getActive=Vg.prototype.c,Vg.prototype.getMap=Vg.prototype.f,Vg.prototype.setActive=Vg.prototype.Ha,Vg.prototype.getKeys=Vg.prototype.O,Vg.prototype.getProperties=Vg.prototype.N,Vg.prototype.setProperties=Vg.prototype.H,Vg.prototype.unset=Vg.prototype.P,Vg.prototype.changed=Vg.prototype.s,Vg.prototype.dispatchEvent=Vg.prototype.b,Vg.prototype.getRevision=Vg.prototype.L,Vg.prototype.on=Vg.prototype.J,Vg.prototype.un=Vg.prototype.K,xn.prototype.getActive=xn.prototype.c,xn.prototype.getMap=xn.prototype.f,xn.prototype.setActive=xn.prototype.Ha,xn.prototype.getKeys=xn.prototype.O,xn.prototype.getProperties=xn.prototype.N,xn.prototype.setProperties=xn.prototype.H,xn.prototype.unset=xn.prototype.P,xn.prototype.changed=xn.prototype.s,xn.prototype.dispatchEvent=xn.prototype.b,xn.prototype.getRevision=xn.prototype.L,xn.prototype.on=xn.prototype.J,xn.prototype.un=xn.prototype.K,Mn.prototype.getActive=Mn.prototype.c,Mn.prototype.getMap=Mn.prototype.f,Mn.prototype.setActive=Mn.prototype.Ha,Mn.prototype.getKeys=Mn.prototype.O,Mn.prototype.getProperties=Mn.prototype.N,Mn.prototype.setProperties=Mn.prototype.H,Mn.prototype.unset=Mn.prototype.P,Mn.prototype.changed=Mn.prototype.s,Mn.prototype.dispatchEvent=Mn.prototype.b,Mn.prototype.getRevision=Mn.prototype.L,Mn.prototype.on=Mn.prototype.J,Mn.prototype.un=Mn.prototype.K,Cn.prototype.getActive=Cn.prototype.c,Cn.prototype.getMap=Cn.prototype.f,Cn.prototype.setActive=Cn.prototype.Ha,Cn.prototype.getKeys=Cn.prototype.O,Cn.prototype.getProperties=Cn.prototype.N,Cn.prototype.setProperties=Cn.prototype.H,Cn.prototype.unset=Cn.prototype.P,Cn.prototype.changed=Cn.prototype.s,Cn.prototype.dispatchEvent=Cn.prototype.b,Cn.prototype.getRevision=Cn.prototype.L,Cn.prototype.on=Cn.prototype.J,Cn.prototype.un=Cn.prototype.K,e0.prototype.getActive=e0.prototype.c,e0.prototype.getMap=e0.prototype.f,e0.prototype.setActive=e0.prototype.Ha,e0.prototype.getKeys=e0.prototype.O,e0.prototype.getProperties=e0.prototype.N,e0.prototype.setProperties=e0.prototype.H,e0.prototype.unset=e0.prototype.P,e0.prototype.changed=e0.prototype.s,e0.prototype.dispatchEvent=e0.prototype.b,e0.prototype.getRevision=e0.prototype.L,e0.prototype.on=e0.prototype.J,e0.prototype.un=e0.prototype.K,n0.prototype.getActive=n0.prototype.c,n0.prototype.getMap=n0.prototype.f,n0.prototype.setActive=n0.prototype.Ha,n0.prototype.getKeys=n0.prototype.O,n0.prototype.getProperties=n0.prototype.N,n0.prototype.setProperties=n0.prototype.H,n0.prototype.unset=n0.prototype.P,n0.prototype.changed=n0.prototype.s,n0.prototype.dispatchEvent=n0.prototype.b,n0.prototype.getRevision=n0.prototype.L,n0.prototype.on=n0.prototype.J,n0.prototype.un=n0.prototype.K,l0.prototype.getActive=l0.prototype.c,l0.prototype.getMap=l0.prototype.f,l0.prototype.setActive=l0.prototype.Ha,l0.prototype.getKeys=l0.prototype.O,l0.prototype.getProperties=l0.prototype.N,l0.prototype.setProperties=l0.prototype.H,l0.prototype.unset=l0.prototype.P,l0.prototype.changed=l0.prototype.s,l0.prototype.dispatchEvent=l0.prototype.b,l0.prototype.getRevision=l0.prototype.L,l0.prototype.on=l0.prototype.J,l0.prototype.un=l0.prototype.K,or.prototype.getKeys=or.prototype.O,or.prototype.getProperties=or.prototype.N,or.prototype.setProperties=or.prototype.H,or.prototype.unset=or.prototype.P,or.prototype.changed=or.prototype.s,or.prototype.dispatchEvent=or.prototype.b,or.prototype.getRevision=or.prototype.L,or.prototype.on=or.prototype.J,or.prototype.un=or.prototype.K,i.prototype.getClosestPoint=i.prototype.Ab,i.prototype.intersectsCoordinate=i.prototype.sb,i.prototype.getExtent=i.prototype.G,i.prototype.simplify=i.prototype.Rb,i.prototype.transform=i.prototype.tb,i.prototype.getKeys=i.prototype.O,i.prototype.getProperties=i.prototype.N,i.prototype.setProperties=i.prototype.H,i.prototype.unset=i.prototype.P,i.prototype.changed=i.prototype.s,i.prototype.dispatchEvent=i.prototype.b,i.prototype.getRevision=i.prototype.L,i.prototype.on=i.prototype.J,i.prototype.un=i.prototype.K,w.prototype.getFirstCoordinate=w.prototype.ac,w.prototype.getLastCoordinate=w.prototype.bc,w.prototype.getLayout=w.prototype.cc,w.prototype.getClosestPoint=w.prototype.Ab,w.prototype.intersectsCoordinate=w.prototype.sb,w.prototype.getExtent=w.prototype.G,w.prototype.simplify=w.prototype.Rb,w.prototype.getKeys=w.prototype.O,w.prototype.getProperties=w.prototype.N,w.prototype.setProperties=w.prototype.H,w.prototype.unset=w.prototype.P,w.prototype.changed=w.prototype.s,w.prototype.dispatchEvent=w.prototype.b,w.prototype.getRevision=w.prototype.L,w.prototype.on=w.prototype.J,w.prototype.un=w.prototype.K,zl.prototype.getClosestPoint=zl.prototype.Ab,zl.prototype.intersectsCoordinate=zl.prototype.sb,zl.prototype.getExtent=zl.prototype.G,zl.prototype.simplify=zl.prototype.Rb,zl.prototype.transform=zl.prototype.tb,zl.prototype.getKeys=zl.prototype.O,zl.prototype.getProperties=zl.prototype.N,zl.prototype.setProperties=zl.prototype.H,zl.prototype.unset=zl.prototype.P,zl.prototype.changed=zl.prototype.s,zl.prototype.dispatchEvent=zl.prototype.b,zl.prototype.getRevision=zl.prototype.L,zl.prototype.on=zl.prototype.J,zl.prototype.un=zl.prototype.K,lr.prototype.getFirstCoordinate=lr.prototype.ac,lr.prototype.getLastCoordinate=lr.prototype.bc,lr.prototype.getLayout=lr.prototype.cc,lr.prototype.getClosestPoint=lr.prototype.Ab,lr.prototype.intersectsCoordinate=lr.prototype.sb,lr.prototype.getExtent=lr.prototype.G,lr.prototype.simplify=lr.prototype.Rb,lr.prototype.transform=lr.prototype.tb,lr.prototype.getKeys=lr.prototype.O,lr.prototype.getProperties=lr.prototype.N,lr.prototype.setProperties=lr.prototype.H,lr.prototype.unset=lr.prototype.P,lr.prototype.changed=lr.prototype.s,lr.prototype.dispatchEvent=lr.prototype.b,lr.prototype.getRevision=lr.prototype.L,lr.prototype.on=lr.prototype.J,lr.prototype.un=lr.prototype.K,m.prototype.getFirstCoordinate=m.prototype.ac,m.prototype.getLastCoordinate=m.prototype.bc,m.prototype.getLayout=m.prototype.cc,m.prototype.getClosestPoint=m.prototype.Ab,m.prototype.intersectsCoordinate=m.prototype.sb,m.prototype.getExtent=m.prototype.G,m.prototype.simplify=m.prototype.Rb,m.prototype.transform=m.prototype.tb,m.prototype.getKeys=m.prototype.O,m.prototype.getProperties=m.prototype.N,m.prototype.setProperties=m.prototype.H,m.prototype.unset=m.prototype.P,m.prototype.changed=m.prototype.s,m.prototype.dispatchEvent=m.prototype.b,m.prototype.getRevision=m.prototype.L,m.prototype.on=m.prototype.J,m.prototype.un=m.prototype.K,a.prototype.getFirstCoordinate=a.prototype.ac,a.prototype.getLastCoordinate=a.prototype.bc,a.prototype.getLayout=a.prototype.cc,a.prototype.getClosestPoint=a.prototype.Ab,a.prototype.intersectsCoordinate=a.prototype.sb,a.prototype.getExtent=a.prototype.G,a.prototype.simplify=a.prototype.Rb,a.prototype.transform=a.prototype.tb,a.prototype.getKeys=a.prototype.O,a.prototype.getProperties=a.prototype.N,a.prototype.setProperties=a.prototype.H,a.prototype.unset=a.prototype.P,a.prototype.changed=a.prototype.s,a.prototype.dispatchEvent=a.prototype.b,a.prototype.getRevision=a.prototype.L,a.prototype.on=a.prototype.J,a.prototype.un=a.prototype.K,f.prototype.getFirstCoordinate=f.prototype.ac,f.prototype.getLastCoordinate=f.prototype.bc,f.prototype.getLayout=f.prototype.cc,f.prototype.getClosestPoint=f.prototype.Ab,f.prototype.intersectsCoordinate=f.prototype.sb,f.prototype.getExtent=f.prototype.G,f.prototype.simplify=f.prototype.Rb,f.prototype.transform=f.prototype.tb,f.prototype.getKeys=f.prototype.O,f.prototype.getProperties=f.prototype.N,f.prototype.setProperties=f.prototype.H,f.prototype.unset=f.prototype.P,f.prototype.changed=f.prototype.s,f.prototype.dispatchEvent=f.prototype.b,f.prototype.getRevision=f.prototype.L,f.prototype.on=f.prototype.J,f.prototype.un=f.prototype.K,b.prototype.getFirstCoordinate=b.prototype.ac,b.prototype.getLastCoordinate=b.prototype.bc,b.prototype.getLayout=b.prototype.cc,b.prototype.getClosestPoint=b.prototype.Ab,b.prototype.intersectsCoordinate=b.prototype.sb,b.prototype.getExtent=b.prototype.G,b.prototype.simplify=b.prototype.Rb,b.prototype.transform=b.prototype.tb,b.prototype.getKeys=b.prototype.O,b.prototype.getProperties=b.prototype.N,b.prototype.setProperties=b.prototype.H,b.prototype.unset=b.prototype.P,b.prototype.changed=b.prototype.s,b.prototype.dispatchEvent=b.prototype.b,b.prototype.getRevision=b.prototype.L,b.prototype.on=b.prototype.J,b.prototype.un=b.prototype.K,p.prototype.getFirstCoordinate=p.prototype.ac,p.prototype.getLastCoordinate=p.prototype.bc,p.prototype.getLayout=p.prototype.cc,p.prototype.getClosestPoint=p.prototype.Ab,p.prototype.intersectsCoordinate=p.prototype.sb,p.prototype.getExtent=p.prototype.G,p.prototype.simplify=p.prototype.Rb,p.prototype.transform=p.prototype.tb,p.prototype.getKeys=p.prototype.O,p.prototype.getProperties=p.prototype.N,p.prototype.setProperties=p.prototype.H,p.prototype.unset=p.prototype.P,p.prototype.changed=p.prototype.s,p.prototype.dispatchEvent=p.prototype.b,p.prototype.getRevision=p.prototype.L,p.prototype.on=p.prototype.J,p.prototype.un=p.prototype.K,s.prototype.getFirstCoordinate=s.prototype.ac,s.prototype.getLastCoordinate=s.prototype.bc,s.prototype.getLayout=s.prototype.cc,s.prototype.getClosestPoint=s.prototype.Ab,s.prototype.intersectsCoordinate=s.prototype.sb,s.prototype.getExtent=s.prototype.G,s.prototype.simplify=s.prototype.Rb,s.prototype.transform=s.prototype.tb,s.prototype.getKeys=s.prototype.O,s.prototype.getProperties=s.prototype.N,s.prototype.setProperties=s.prototype.H,s.prototype.unset=s.prototype.P,s.prototype.changed=s.prototype.s,s.prototype.dispatchEvent=s.prototype.b,s.prototype.getRevision=s.prototype.L,s.prototype.on=s.prototype.J,s.prototype.un=s.prototype.K,x.prototype.readFeatures=x.prototype.Oa,yh.prototype.readFeatures=yh.prototype.Oa,x.prototype.readFeatures=x.prototype.Oa,Po.prototype.getKeys=Po.prototype.O,Po.prototype.getProperties=Po.prototype.N,Po.prototype.setProperties=Po.prototype.H,Po.prototype.unset=Po.prototype.P,Po.prototype.changed=Po.prototype.s,Po.prototype.dispatchEvent=Po.prototype.b,Po.prototype.getRevision=Po.prototype.L,Po.prototype.on=Po.prototype.J,Po.prototype.un=Po.prototype.K,Mo.prototype.getMap=Mo.prototype.g,Mo.prototype.setTarget=Mo.prototype.f,Mo.prototype.getKeys=Mo.prototype.O,Mo.prototype.getProperties=Mo.prototype.N,Mo.prototype.setProperties=Mo.prototype.H,Mo.prototype.unset=Mo.prototype.P,Mo.prototype.changed=Mo.prototype.s,Mo.prototype.dispatchEvent=Mo.prototype.b,Mo.prototype.getRevision=Mo.prototype.L,Mo.prototype.on=Mo.prototype.J,Mo.prototype.un=Mo.prototype.K,ko.prototype.getMap=ko.prototype.g,ko.prototype.setTarget=ko.prototype.f,ko.prototype.getKeys=ko.prototype.O,ko.prototype.getProperties=ko.prototype.N,ko.prototype.setProperties=ko.prototype.H,ko.prototype.unset=ko.prototype.P,ko.prototype.changed=ko.prototype.s,ko.prototype.dispatchEvent=ko.prototype.b,ko.prototype.getRevision=ko.prototype.L,ko.prototype.on=ko.prototype.J,ko.prototype.un=ko.prototype.K,Ko.prototype.getMap=Ko.prototype.g,Ko.prototype.setTarget=Ko.prototype.f,Ko.prototype.getKeys=Ko.prototype.O,Ko.prototype.getProperties=Ko.prototype.N,Ko.prototype.setProperties=Ko.prototype.H,Ko.prototype.unset=Ko.prototype.P,Ko.prototype.changed=Ko.prototype.s,Ko.prototype.dispatchEvent=Ko.prototype.b,Ko.prototype.getRevision=Ko.prototype.L,Ko.prototype.on=Ko.prototype.J,Ko.prototype.un=Ko.prototype.K,ca.prototype.getMap=ca.prototype.g,ca.prototype.setTarget=ca.prototype.f,ca.prototype.getKeys=ca.prototype.O,ca.prototype.getProperties=ca.prototype.N,ca.prototype.setProperties=ca.prototype.H,ca.prototype.unset=ca.prototype.P,ca.prototype.changed=ca.prototype.s,ca.prototype.dispatchEvent=ca.prototype.b,ca.prototype.getRevision=ca.prototype.L,ca.prototype.on=ca.prototype.J,ca.prototype.un=ca.prototype.K,Ro.prototype.getMap=Ro.prototype.g,Ro.prototype.setTarget=Ro.prototype.f,Ro.prototype.getKeys=Ro.prototype.O,Ro.prototype.getProperties=Ro.prototype.N,Ro.prototype.setProperties=Ro.prototype.H,Ro.prototype.unset=Ro.prototype.P,Ro.prototype.changed=Ro.prototype.s,Ro.prototype.dispatchEvent=Ro.prototype.b,Ro.prototype.getRevision=Ro.prototype.L,Ro.prototype.on=Ro.prototype.J,Ro.prototype.un=Ro.prototype.K,va.prototype.getMap=va.prototype.g,va.prototype.setTarget=va.prototype.f,va.prototype.getKeys=va.prototype.O,va.prototype.getProperties=va.prototype.N,va.prototype.setProperties=va.prototype.H,va.prototype.unset=va.prototype.P,va.prototype.changed=va.prototype.s,va.prototype.dispatchEvent=va.prototype.b,va.prototype.getRevision=va.prototype.L,va.prototype.on=va.prototype.J,va.prototype.un=va.prototype.K,No.prototype.getMap=No.prototype.g,No.prototype.setMap=No.prototype.setMap,No.prototype.setTarget=No.prototype.f,No.prototype.get=No.prototype.get,No.prototype.getKeys=No.prototype.O,No.prototype.getProperties=No.prototype.N,No.prototype.set=No.prototype.set,No.prototype.setProperties=No.prototype.H,No.prototype.unset=No.prototype.P,No.prototype.changed=No.prototype.s,No.prototype.dispatchEvent=No.prototype.b,No.prototype.getRevision=No.prototype.L,No.prototype.on=No.prototype.J,No.prototype.once=No.prototype.once,No.prototype.un=No.prototype.K,Sa.prototype.getMap=Sa.prototype.g,Sa.prototype.setTarget=Sa.prototype.f,Sa.prototype.getKeys=Sa.prototype.O,Sa.prototype.getProperties=Sa.prototype.N,Sa.prototype.setProperties=Sa.prototype.H,Sa.prototype.unset=Sa.prototype.P,Sa.prototype.changed=Sa.prototype.s,Sa.prototype.dispatchEvent=Sa.prototype.b,Sa.prototype.getRevision=Sa.prototype.L,Sa.prototype.on=Sa.prototype.J,Sa.prototype.un=Sa.prototype.K,Ea.prototype.getMap=Ea.prototype.g,Ea.prototype.setTarget=Ea.prototype.f,Ea.prototype.getKeys=Ea.prototype.O,Ea.prototype.getProperties=Ea.prototype.N,Ea.prototype.setProperties=Ea.prototype.H,Ea.prototype.unset=Ea.prototype.P,Ea.prototype.changed=Ea.prototype.s,Ea.prototype.dispatchEvent=Ea.prototype.b,Ea.prototype.getRevision=Ea.prototype.L,Ea.prototype.on=Ea.prototype.J,Ea.prototype.un=Ea.prototype.K,O.ol})
\ No newline at end of file
1
+!function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define([],e):t.ol=e()}(this,function(){var F={},k=this;function t(t,e){var o,i=F;(t=t.split("."))[0]in(i=i||k)||!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 G(t,e){return e<t?1:t<e?-1:0}function D(t,e){return 0<=t.indexOf(e)}function B(t,e,o){var i=t.length;if(t[0]<=e)return 0;if(!(e<=t[i-1]))if(0<o){for(o=1;o<i;++o)if(t[o]<e)return o-1}else if(o<0){for(o=1;o<i;++o)if(t[o]<=e)return o}else for(o=1;o<i;++o){if(t[o]==e)return o;if(t[o]<e)return t[o-1]-e<e-t[o]?o-1:o}return i-1}function X(t,e){var o=Array.isArray(e)?e:[e],i=o.length;for(e=0;e<i;e++)t[t.length]=o[e]}function V(t,e){-1<(e=t.indexOf(e))&&t.splice(e,1)}function W(t,e){for(var o,i=t.length>>>0,r=0;r<i;r++)if(e(o=t[r],r,t))return o;return null}function Z(t,e){var o=t.length;if(o===e.length){for(var i=0;i<o;i++)if(t[i]!==e[i])return;return 1}}function K(t){for(var o=ks,e=t.length,i=Array(t.length),r=0;r<e;r++)i[r]={index:r,value:t[r]};for(i.sort(function(t,e){return o(t.value,e.value)||t.index-e.index}),r=0;r<t.length;r++)t[r]=i[r].value}function z(o,i){var r;return o.every(function(t,e){return!i(t,r=e,o)})?-1:r}function e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function Y(){}function U(t){return t.Vo||(t.Vo=++H)}var H=0;function q(t){this.message="Assertion failed. See https://openlayers.org/en/v4.2.0/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"}function O(t,e){if(!t)throw new q(e)}function J(t,e,o,i){this.ca=t,this.$=e,this.da=o,this.ia=i}function _(t,e,o){return t.ca<=e&&e<=t.$&&t.da<=o&&o<=t.ia}function $(t,e){return t.ca<=e.$&&t.$>=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):0<s&&(o+=a*s,i+=p*s)),ot(t,e,o,i)}function ot(t,e,o,i){return(t=o-t)*t+(e=i-e)*e}function it(t){return t*Math.PI/180}function rt(t,e){return(t%=e)*e<0?t+e:t}function nt(t,e,o){return t+o*(e-t)}function st(t,e,o){return(o=void 0===o?[0,0]:o)[0]=t[0]+2*e,o[1]=t[1]+2*e,o}function at(t,e,o){return(o=void 0===o?[0,0]:o)[0]=t[0]*e+.5|0,o[1]=t[1]*e+.5|0,o}function pt(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}function ht(t){for(var e=vt(),o=0,i=t.length;o<i;++o)Pt(e,t[o]);return e}function lt(t,e,o){return o?(o[0]=t[0]-e,o[1]=t[1]-e,o[2]=t[2]+e,o[3]=t[3]+e,o):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function ut(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function ct(t,e,o){return(e=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*e+(t=o<t[1]?t[1]-o:t[3]<o?o-t[3]:0)*t}function ft(t,e){return gt(t,e[0],e[1])}function yt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function gt(t,e,o){return t[0]<=e&&e<=t[2]&&t[1]<=o&&o<=t[3]}function dt(t,e){var o=t[1],i=t[2],r=t[3],n=e[0],s=(e=e[1],0);return n<t[0]?s|=16:i<n&&(s|=4),e<o?s|=8:r<e&&(s|=2),s=s||1}function vt(){return[1/0,1/0,-1/0,-1/0]}function bt(t,e,o,i,r){return r?(r[0]=t,r[1]=e,r[2]=o,r[3]=i,r):[t,e,o,i]}function mt(t){return bt(1/0,1/0,-1/0,-1/0,t)}function wt(t,e){var o=t[0];return bt(o,t=t[1],o,t,e)}function xt(t,e,o,i,r){return At(r=mt(r),t,e,o,i)}function St(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Mt(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function Pt(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function At(t,e,o,i,r){for(;o<i;o+=r){var n=t,s=e[o],a=e[o+1];n[0]=Math.min(n[0],s),n[1]=Math.min(n[1],a),n[2]=Math.max(n[2],s),n[3]=Math.max(n[3],a)}return t}function Et(t,e,o){return e.call(o,jt(t))||e.call(o,Ct(t))||e.call(o,kt(t))||e.call(o,Ft(t))||!1}function Tt(t){var e=0;return e=Ut(t)?e:Dt(t)*It(t)}function jt(t){return[t[0],t[1]]}function Ct(t){return[t[2],t[1]]}function Lt(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Rt(t,e,o,i,r){var n=e*i[0]/2,s=(i=e*i[1]/2,e=Math.cos(o),Math.sin(o)),a=(o=n*e,n*=s,e*=i,i*s),p=t[0],h=t[1],a=(t=p-o+a,i=p-o-a,s=p+o-a,o=p+o+a,h-n-e),p=h-n+e,l=h+n+e,n=h+n-e;return bt(Math.min(t,i,s,o),Math.min(a,p,l,n),Math.max(t,i,s,o),Math.max(a,p,l,n),r)}function It(t){return t[3]-t[1]}function Nt(t,e,o){return o=o||vt(),Ot(t,e)&&(o[0]=(t[0]>e[0]?t:e)[0],o[1]=(t[1]>e[1]?t:e)[1],o[2]=(t[2]<e[2]?t:e)[2],o[3]=(t[3]<e[3]?t:e)[3]),o}function Ft(t){return[t[0],t[3]]}function kt(t){return[t[2],t[3]]}function Dt(t){return t[2]-t[0]}function Ot(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ut(t){return t[2]<t[0]||t[3]<t[1]}function Gt(t,e){var o=(t[2]-t[0])/2*(e-1);e=(t[3]-t[1])/2*(e-1),t[0]-=o,t[2]+=o,t[1]-=e,t[3]+=e}function Bt(t,e,o){e(t=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]],t,2);var i=[t[0],t[2],t[4],t[6]],r=[t[1],t[3],t[5],t[7]];return bt(e=Math.min.apply(null,i),t=Math.min.apply(null,r),Math.max.apply(null,i),Math.max.apply(null,r),o)}var Xt="function"==typeof Object.assign?Object.assign:function(t,e){if(!t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),i=1,r=arguments.length;i<r;++i){var n=arguments[i];if(null!=n)for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s])}return o};function Vt(t){for(var e in t)delete t[e]}function Wt(t){var e,o=[];for(e in t)o.push(t[e]);return o}function Zt(t){for(var e in t)return!1;return!e}function Kt(t){this.radius=t}Kt.prototype.a=function(t){for(var e=0,o=t.length,i=t[o-1][0],r=t[o-1][1],n=0;n<o;n++)var s=t[n][0],a=t[n][1],e=e+it(s-i)*(2+Math.sin(it(r))+Math.sin(it(a))),i=s,r=a;return e*this.radius*this.radius/2},Kt.prototype.b=function(t,e){var o=it(t[1]),i=it(e[1]),r=(i-o)/2;return t=it(e[0]-t[0])/2,o=Math.sin(r)*Math.sin(r)+Math.sin(t)*Math.sin(t)*Math.cos(o)*Math.cos(i),2*this.radius*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))},Kt.prototype.offset=function(t,e,o){var i=it(t[1]),r=(e/=this.radius,Math.asin(Math.sin(i)*Math.cos(e)+Math.cos(i)*Math.sin(e)*Math.cos(o)));return[180*(it(t[0])+Math.atan2(Math.sin(o)*Math.sin(e)*Math.cos(i),Math.cos(e)-Math.sin(i)*Math.sin(r)))/Math.PI,180*r/Math.PI]};var zt=new Kt(6370997),Yt={},Ht=(Yt.degrees=2*Math.PI*zt.radius/360,Yt.ft=.3048,Yt.m=1,Yt["us-ft"]=1200/3937,null);function qt(t){this.mb=t.code,this.a=t.units,this.f=void 0!==t.extent?t.extent:null,this.g=void 0!==t.worldExtent?t.worldExtent:null,this.b=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.c=void 0!==t.global&&t.global,this.i=!(!this.c||!this.f),this.o=t.getPointResolution,this.j=null,this.l=t.metersPerUnit;var e=t.code,o=Ht||window.proj4;"function"==typeof o&&void 0!==(e=o.defs(e))&&(void 0!==e.axis&&void 0===t.axisOrientation&&(this.b=e.axis),void 0===t.metersPerUnit&&(this.l=e.to_meter),void 0===t.units)&&(this.a=e.units)}function Jt(t){qt.call(this,{code:t,units:"m",extent:$t,global:!0,worldExtent:Qt,getPointResolution:function(t,e){return t/tt(e[1]/6378137)}})}(r=qt.prototype).Jk=function(){return this.mb},r.G=function(){return this.f},r.Un=function(){return this.a},r.sc=function(){return this.l||Yt[this.a]},r.tl=function(){return this.g},r.dm=function(){return this.c},r.$p=function(t){this.c=t,this.i=!(!t||!this.f)},r.Vn=function(t){this.f=t,this.i=!(!this.c||!t)},r.kq=function(t){this.g=t},r.Zp=function(t){this.o=t},e(Jt,qt);var _t=6378137*Math.PI,$t=[-_t,-_t,_t,_t],Qt=[-180,-85,180,85],te="EPSG:3857 EPSG:102100 EPSG:102113 EPSG:900913 urn:ogc:def:crs:EPSG:6.18:3:3857 urn:ogc:def:crs:EPSG::3857 http://www.opengis.net/gml/srs/epsg.xml#3857".split(" ").map(function(t){return new Jt(t)});function ee(t,e,o){var i=t.length;o=1<o?o:2,void 0===e&&(e=2<o?t.slice():Array(i));for(var r=0;r<i;r+=o){e[r]=_t*t[r]/180;var n=6378137*Math.log(Math.tan(Math.PI*(t[r+1]+90)/360));_t<n?n=_t:n<-_t&&(n=-_t),e[r+1]=n}return e}function oe(t,e,o){var i=t.length;o=1<o?o:2,void 0===e&&(e=2<o?t.slice():Array(i));for(var r=0;r<i;r+=o)e[r]=180*t[r]/_t,e[r+1]=360*Math.atan(Math.exp(t[r+1]/6378137))/Math.PI-90;return e}var ie=new Kt(6378137);function re(t,e){qt.call(this,{code:t,units:"degrees",extent:ne,axisOrientation:e,global:!0,metersPerUnit:se,worldExtent:ne})}e(re,qt);var ne=[-180,-90,180,90],se=Math.PI*ie.radius/180,ae=[new re("CRS:84"),new re("EPSG:4326","neu"),new re("urn:ogc:def:crs:EPSG::4326","neu"),new re("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new re("urn:ogc:def:crs:OGC:1.3:CRS84"),new re("urn:ogc:def:crs:OGC:2:84"),new re("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new re("urn:x-ogc:def:crs:EPSG:4326","neu")],pe={},he={};function le(t,e,o){t=t.mb,e=e.mb,t in he||(he[t]={}),he[t][e]=o}function ue(t,e){var o;return o=t in he&&e in he[t]?he[t][e]:o}function ce(t,e,o){var i=(t=v(t)).o;return i?e=i(e,o):"degrees"!=t.a&&(e=(i=we(t,v("EPSG:4326")))(e=[o[0]-e/2,o[1],o[0]+e/2,o[1],o[0],o[1]-e/2,o[0],o[1]+e/2],e,2),e=(zt.b(e.slice(0,2),e.slice(2,4))+zt.b(e.slice(4,6),e.slice(6,8)))/2,void 0!==(t=t.sc()))&&(e/=t),e}function fe(t){t.forEach(ye),t.forEach(function(e){t.forEach(function(t){e!==t&&le(e,t,Se)})})}function ye(t){le(pe[t.mb]=t,t,Se)}function ge(t){return t?"string"==typeof t?v(t):t:v("EPSG:3857")}function de(t,e,o,i){le(t=v(t),e=v(e),ve(o)),le(e,t,ve(i))}function ve(s){return function(t,e,o){var i,r=t.length;for(o=void 0!==o?o:2,e=void 0!==e?e:Array(r),i=0;i<r;i+=o){var n=s([t[i],t[i+1]]);for(e[i]=n[0],e[i+1]=n[1],n=o-1;2<=n;--n)e[i+n]=t[i+n]}return e}}function v(t){var e,o=null;return t instanceof qt?o=t:"string"==typeof t&&(o=pe[t]||null,e=Ht||window.proj4,o||"function"!=typeof e||void 0===e.defs(t)||ye(o=new qt({code:t}))),o}function be(t,e){var o;return t===e||(o=t.a===e.a,(t.mb===e.mb||we(t,e)===Se)&&o)}function me(t,e){return we(t=v(t),e=v(e))}function we(t,e){var o,i,r,n=t.mb,s=e.mb,a=ue(n,s);return a||"function"==typeof(o=Ht||window.proj4)&&(i=o.defs(n),r=o.defs(s),void 0!==i)&&void 0!==r&&(i===r?fe([e,t]):de(e,t,(a=o(s,n)).forward,a.inverse),a=ue(n,s)),a=a||xe}function xe(t,e){if(void 0!==e&&t!==e){for(var o=0,i=t.length;o<i;++o)e[o]=t[o];t=e}return t}function Se(t,e){if(void 0!==e){for(var o=0,i=t.length;o<i;++o)e[o]=t[o];t=e}else t=t.slice();return t}function Me(t,e,o){return me(e,o)(t,void 0,t.length)}function Pe(t,e,o){return Bt(t,e=me(e,o))}function Ae(){fe(te),fe(ae),ae.forEach(function(e){te.forEach(function(t){le(e,t,ee),le(t,e,oe)})})}function Ee(t,e,o,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=o,i):[t,e,o]}function Te(t){this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.b=t.resolutions,O((o=this.b,i=function(t,e){return e-t}||G,o.every(function(t,e){return!e||!(0<(t=i(o[e-1],t))||0===t)})),17),this.maxZoom=this.b.length-1,this.i=void 0!==t.origin?t.origin:null,this.c=null,void 0!==t.origins&&(this.c=t.origins,O(this.c.length==this.b.length,20));var o,i,e=t.extent;if(void 0===e||this.i||this.c||(this.i=Ft(e)),O(!this.i&&this.c||this.i&&!this.c,18),this.f=null,void 0!==t.tileSizes&&(this.f=t.tileSizes,O(this.f.length==this.b.length,19)),this.g=void 0!==t.tileSize?t.tileSize:this.f?null:256,O(!this.g&&this.f||this.g&&!this.f,22),this.v=void 0!==e?e:null,this.a=null,this.j=[0,0],void 0!==t.sizes)this.a=t.sizes.map(function(t){return new J(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))},this);else if(e){for(var r=this,n=e,s=r.b.length,a=Array(s),p=r.minZoom;p<s;++p)a[p]=Ie(r,n,p);r.a=a}}Ae();var je=[0,0,0];function Ce(t,e,o,i,r){for(r=t.Aa(e,r),e=e[0]-1;e>=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.maxZoom?(i=t.Aa(e,i),Ie(t,i,e[0]+1,o)):null}function Re(t,e,o,i){Fe(t,e[0],e[1],o,!1,je);var r=je[1],n=je[2];return Fe(t,e[2],e[3],o,!0,je),t=je[1],e=je[2],void 0!==i?(i.ca=r,i.$=t,i.da=n,i.ia=e):i=new J(r,t,n,e),i}function Ie(t,e,o,i){return Re(t,e,t.Da(o),i)}function Ne(t,e){var o=t.Pc(e[0]),i=t.Da(e[0]);return t=pt(t.gb(e[0]),t.j),[o[0]+(e[1]+.5)*t[0]*i,o[1]+(e[2]+.5)*t[1]*i]}function Fe(t,e,o,i,r,n){var s=t.tc(i),a=i/t.Da(s),p=t.Pc(s);return t=pt(t.gb(s),t.j),e=a*Math.floor((e-p[0])/i+(r?.5:0))/t[0],o=a*Math.floor((o-p[1])/i+(r?0:.5))/t[1],o=r?(e=Math.ceil(e)-1,Math.ceil(o)-1):(e=Math.floor(e),Math.floor(o)),Ee(s,e,o,n)}function ke(t){var e=t.j;return e||(e=Ue(t),t.j=e),e}function De(t){var e={};return Xt(e,t||{}),void 0===e.extent&&(e.extent=v("EPSG:3857").G()),e.resolutions=Oe(e.extent,e.maxZoom,e.tileSize),delete e.maxZoom,new Te(e)}function Oe(t,e,o){e=void 0!==e?e:42;var i=It(t);for(t=Dt(t),o=pt(void 0!==o?o:256),o=Math.max(t/o[0],i/o[1]),e+=1,i=Array(e),t=0;t<e;++t)i[t]=o/Math.pow(2,t);return i}function Ue(t,e,o){return e=Oe(t=Ge(t),e,o),new Te({extent:t,origin:Ft(t),resolutions:e,tileSize:o})}function Ge(t){var e=(t=v(t)).G();return e=e?e:bt(-(t=180*Yt.degrees/t.sc()),-t,t,t)}function Be(t){this.b=t.html,this.a=t.tileRanges||null}function Xe(t){return t}function Ve(i){return i.mh=function(t){var e=i.listener,o=i.lh||i.target;return i.nh&&qe(i),e.call(o,t)}}function We(t,e,o,i){for(var r,n=0,s=t.length;n<s;++n)if((r=t[n]).listener===e&&r.lh===o)return i&&(r.deleteIndex=n),r}function Ze(t,e){return(t=t.fb)?t[e]:void 0}function Ke(t){return t.fb||(t.fb={})}function ze(t,e){var o=Ze(t,e);if(o){for(var i=0,r=o.length;i<r;++i)t.removeEventListener(e,o[i].mh),Vt(o[i]);o.length=0,(o=t.fb)&&(delete o[e],Object.keys(o).length||delete t.fb)}}function d(t,e,o,i,r){var n=Ke(t),s=n[e];return(n=We(s=s||(n[e]=[]),o,i,!1))?r||(n.nh=!1):(t.addEventListener(e,Ve(n={lh:i,nh:!!r,listener:o,target:t,type:e})),s.push(n)),n}function Ye(t,e,o,i){return d(t,e,o,i,!0)}function He(t,e,o,i){(t=Ze(t,e))&&(o=We(t,o,i,!0))&&qe(o)}function qe(t){var e,o;t&&t.target&&(t.target.removeEventListener(t.type,t.mh),(e=Ze(t.target,t.type))&&(-1!==(o="deleteIndex"in t?t.deleteIndex:e.indexOf(t))&&e.splice(o,1),e.length||ze(t.target,t.type)),Vt(t))}function Je(t){for(var e in Ke(t))ze(t,e)}function _e(){}function $e(t){t.Jb||(t.Jb=!0,t.ka())}function Qe(t){this.type=t,this.target=null}function to(t){t.stopPropagation()}function eo(){this.Ua={},this.ra={},this.oa={}}function oo(t,e){return e?e in t.oa:0<Object.keys(t.oa).length}function io(){eo.call(this),this.i=0}function ro(t){io.call(this),U(this),this.S={},void 0!==t&&this.H(t)}(r=Te.prototype).Rf=function(t,e,o){for(var i=(t=Ie(this,t,e)).ca,r=t.$;i<=r;++i)for(var n=t.da,s=t.ia;n<=s;++n)o([e,i,n])},r.G=function(){return this.v},r.Ti=function(){return this.maxZoom},r.Ui=function(){return this.minZoom},r.Pc=function(t){return this.i||this.c[t]},r.Da=function(t){return this.b[t]},r.Vi=function(){return this.b},r.Aa=function(t,e){var o=this.Pc(t[0]),i=this.Da(t[0]),r=pt(this.gb(t[0]),this.j),n=o[0]+t[1]*r[0]*i;return bt(n,t=o[1]+t[2]*r[1]*i,n+r[0]*i,t+r[1]*i,e)},r.Be=function(t,e,o){return Fe(this,t[0],t[1],e,!1,o)},r.bg=function(t,e,o){return Fe(this,t[0],t[1],this.Da(e),!1,o)},r.gb=function(t){return this.g||this.f[t]},r.tc=function(t,e){return Q(B(this.b,t,e||0),this.minZoom,this.maxZoom)},_e.prototype.Jb=!(Be.prototype.i=function(){return this.b}),_e.prototype.ka=Y,Qe.prototype.preventDefault=Qe.prototype.stopPropagation=function(){this.qp=!0},e(eo,_e),eo.prototype.addEventListener=function(t,e){var o=this.oa[t];-1===(o=o||(this.oa[t]=[])).indexOf(e)&&o.push(e)},eo.prototype.b=function(t){var e="string"==typeof t?new Qe(t):t,o=(t=e.type,(e.target=this).oa[t]);if(o){t in this.ra||(this.ra[t]=0,this.Ua[t]=0),++this.ra[t];for(var i=0,r=o.length;i<r;++i)if(!1===o[i].call(this,e)||e.qp){var n=!1;break}if(--this.ra[t],!this.ra[t]){for(e=this.Ua[t],delete this.Ua[t];e--;)this.removeEventListener(t,Y);delete this.ra[t]}return n}},eo.prototype.ka=function(){Je(this)},eo.prototype.removeEventListener=function(t,e){var o=this.oa[t];o&&(e=o.indexOf(e),t in this.Ua?(o[e]=Y,++this.Ua[t]):(o.splice(e,1),o.length||delete this.oa[t]))},e(io,eo),(r=io.prototype).s=function(){++this.i,this.b("change")},r.L=function(){return this.i},r.J=function(t,e,o){if(Array.isArray(t)){for(var i=t.length,r=Array(i),n=0;n<i;++n)r[n]=d(this,t[n],e,o);return r}return d(this,t,e,o)},r.once=function(t,e,o){if(Array.isArray(t)){for(var i=t.length,r=Array(i),n=0;n<i;++n)r[n]=Ye(this,t[n],e,o);return r}return Ye(this,t,e,o)},r.K=function(t,e,o){if(Array.isArray(t))for(var i=0,r=t.length;i<r;++i)He(this,t[i],e,o);else He(this,t,e,o)},e(ro,io);var no={};function so(t){return no.hasOwnProperty(t)?no[t]:no[t]="change:"+t}function ao(t,e,o){var i=so(e);t.b(new po(i,e,o)),t.b(new po("propertychange",e,o))}function po(t,e,o){Qe.call(this,t),this.key=e,this.oldValue=o}function ho(t,e){if(ro.call(this),this.c=!!(e||{}).unique,this.a=t||[],this.c)for(t=0,e=this.a.length;t<e;++t)uo(this,this.a[t],t);lo(this)}function lo(t){t.set(co,t.a.length)}function uo(t,e,o){for(var i=0,r=t.a.length;i<r;++i)if(t.a[i]===e&&i!==o)throw new q(58)}(r=ro.prototype).get=function(t){var e;return e=this.S.hasOwnProperty(t)?this.S[t]:e},r.O=function(){return Object.keys(this.S)},r.N=function(){return Xt({},this.S)},r.set=function(t,e,o){o?this.S[t]=e:(o=this.S[t])!==(this.S[t]=e)&&ao(this,t,o)},r.H=function(t,e){for(var o in t)this.set(o,t[o],e)},r.P=function(t,e){var o;t in this.S&&(o=this.S[t],delete this.S[t],e||ao(this,t,o))},e(po,Qe),e(ho,ro),(r=ho.prototype).clear=function(){for(;0<this.dc();)this.pop()},r.fg=function(t){for(var e=0,o=t.length;e<o;++e)this.push(t[e]);return this},r.forEach=function(t,e){this.a.forEach(t,e)},r.tm=function(){return this.a},r.item=function(t){return this.a[t]},r.dc=function(){return this.get(co)},r.He=function(t,e){this.c&&uo(this,e),this.a.splice(t,0,e),lo(this),this.b(new fo("add",e))},r.pop=function(){return this.Hg(this.dc()-1)},r.push=function(t){this.c&&uo(this,t);var e=this.dc();return this.He(e,t),this.dc()},r.remove=function(t){for(var e=this.a,o=0,i=e.length;o<i;++o)if(e[o]===t)return this.Hg(o)},r.Hg=function(t){var e=this.a[t];return this.a.splice(t,1),lo(this),this.b(new fo("remove",e)),e},r.Wp=function(t,e){var o=this.dc();if(t<o)this.c&&uo(this,e,t),o=this.a[t],this.a[t]=e,this.b(new fo("remove",o)),this.b(new fo("add",e));else{for(;o<t;++o)this.He(o,void 0);this.He(t,e)}};var co="length";function fo(t,e){Qe.call(this,t),this.element=e}e(fo,Qe);var yo=/^#(?:[0-9a-f]{3}){1,2}$/i,go=/^([a-z]*)$/i;function vo(t){return Array.isArray(t)?t:xo(t)}function bo(t){var e;return t="string"!=typeof t?"rgba("+(e=(e=t[0])!=(0|e)?e+.5|0:e)+","+(e=(e=t[1])!=(0|e)?e+.5|0:e)+","+(e=(e=t[2])!=(0|e)?e+.5|0:e)+","+(void 0===t[3]?1:t[3])+")":t}mo={},wo=0;var mo,wo,xo=function(t){if(mo.hasOwnProperty(t))var e=mo[t];else{if(1024<=wo)for(var o in e=0,mo)3&e++||(delete mo[o],--wo);var i,r;go.exec(e=t)&&((o=document.createElement("div")).style.color=e,document.body.appendChild(o),e=getComputedStyle(o).color,document.body.removeChild(o)),yo.exec(e)?(O(3==(r=e.length-1)||6==r,54),i=3==r?1:2,r=parseInt(e.substr(1+0*i,i),16),o=parseInt(e.substr(1+i,i),16),e=parseInt(e.substr(1+2*i,i),16),1==i&&(r=(r<<4)+r,o=(o<<4)+o,e=(e<<4)+e),r=[r,o,e,1]):e.indexOf("rgba(")?e.indexOf("rgb(")?O(!1,14):((e=e.slice(4,-1).split(",").map(Number)).push(1),r=So(e)):r=So(e=e.slice(5,-1).split(",").map(Number)),e=r,mo[t]=e,++wo}return e};function So(t){var e=[];return e[0]=Q(t[0]+.5|0,0,255),e[1]=Q(t[1]+.5|0,0,255),e[2]=Q(t[2]+.5|0,0,255),e[3]=Q(t[3],0,1),e}function Mo(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient?t:bo(t)}function Po(t,e){var o=document.createElement("CANVAS");return t&&(o.width=t),e&&(o.height=e),o.getContext("2d")}function Ao(t,e){var o=e.parentNode;o&&o.replaceChild(t,e)}function Eo(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function To(t){ro.call(this),this.element=t.element||null,this.a=this.R=null,this.v=[],this.render=t.render||Y,t.target&&this.f(t.target)}function jo(t){t=t||{},this.I=document.createElement("UL"),this.u=document.createElement("LI"),this.I.appendChild(this.u),this.u.style.display="none",this.c=void 0===t.collapsed||t.collapsed,this.o=void 0===t.collapsible||t.collapsible,this.o||(this.c=!1);var e=void 0!==t.className?t.className:"ol-attribution",o=void 0!==t.tipLabel?t.tipLabel:"Attributions",i=void 0!==t.collapseLabel?t.collapseLabel:"»",r=("string"==typeof i?(this.D=document.createElement("span"),this.D.textContent=i):this.D=i,"string"==typeof(i=void 0!==t.label?t.label:"i")?(this.C=document.createElement("span"),this.C.textContent=i):this.C=i,this.o&&!this.c?this.D:this.C);(i=document.createElement("button")).setAttribute("type","button"),i.title=o,i.appendChild(r),d(i,"click",this.Vm,this),(o=document.createElement("div")).className=e+" ol-unselectable ol-control"+(this.c&&this.o?" ol-collapsed":"")+(this.o?"":" ol-uncollapsible"),o.appendChild(this.I),o.appendChild(i),To.call(this,{element:o,render:t.render||Co,target:t.target}),this.B=!0,this.l={},this.j={},this.T={}}function Co(t){if(t=t.frameState){var e,o,i,r,n,s,a,p=t.layerStatesArray,h=Xt({},t.attributions),l={},u={},c=t.viewState.projection,f=0;for(a=p.length;f<a;f++)if(o=p[f].layer.ha()){var y=U(o).toString();if(i=o.j)for(var g=0,d=i.length;g<d;g++){var v=i[g],b=U(v).toString();if(!(b in h)){if(e=t.usedTiles[y])t:{var m=void 0,w=v,x=M=o.Ta(c),S=c;if(w.a){for(m in e)if(m in w.a)for(var M=e[m],P=0,A=w.a[m].length;P<A;++P){var E=w.a[m][P];if($(E,M)){m=!0;break t}var T=Ie(x,Ge(S),parseInt(m,10)),j=T.$-T.ca+1;if((M.ca<T.ca||M.$>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<o;++e)qe(this.v[e]);this.v.length=0,(this.a=t)&&((this.R||t.D).appendChild(this.element),this.render!==Y&&this.v.push(d(t,"postrender",this.render,this)),t.render())},To.prototype.f=function(t){this.R="string"==typeof t?document.getElementById(t):t},e(jo,To),(r=jo.prototype).Vm=function(t){t.preventDefault(),Lo(this)},r.Um=function(){return this.o},r.Xm=function(t){this.o!==t&&(this.o=t,this.element.classList.toggle("ol-uncollapsible"),!t)&&this.c&&Lo(this)},r.Wm=function(t){this.o&&this.c!==t&&Lo(this)},r.Tm=function(){return this.c},e(ko,To),ko.prototype.D=function(t){t.preventDefault(),this.o?this.o():(t=this.a.Z())&&void 0!==t.Qa()&&(0<this.l?t.animate({rotation:0,duration:this.l,easing:Io}):t.Oe(0))},e(Oo,To),Oo.prototype.j=function(t,e){var o;e.preventDefault(),(e=this.a.Z())&&(o=e.Pa())&&(t=e.constrainResolution(o,t),0<this.c?(e.Ic()&&e.ed(),e.animate({resolution:t,duration:this.c,easing:Io})):e.Vc(t))},e(Go,To),Go.prototype.C=function(t){t.preventDefault(),Bo()&&(t=this.a)&&(Xo()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(t=this.j?"string"==typeof this.j?document.getElementById(this.j):this.j:t.jd(),this.D?t.mozRequestFullScreenWithKeys?t.mozRequestFullScreenWithKeys():t.webkitRequestFullscreen?t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):Vo(t):Vo(t)))},Go.prototype.u=function(){var t=this.element.firstElementChild,e=this.a;Xo()?(t.className=this.c+"-true",Ao(this.l,this.o)):(t.className=this.c+"-false",Ao(this.o,this.l)),e&&e.Ad()},Go.prototype.setMap=function(t){To.prototype.setMap.call(this,t),t&&this.v.push(d(document,Zo(),this.u,this))};var Wo,Zo=function(){var t;return Wo||((t=document.body).webkitRequestFullscreen?Wo="webkitfullscreenchange":t.mozRequestFullScreen?Wo="mozfullscreenchange":t.msRequestFullscreen?Wo="MSFullscreenChange":t.requestFullscreen&&(Wo="fullscreenchange")),Wo};function Ko(t){t=t||{};var e=document.createElement("DIV");e.className=void 0!==t.className?t.className:"ol-mouse-position",To.call(this,{element:e,render:t.render||zo,target:t.target}),d(this,so(Ho),this.Ym,this),t.coordinateFormat&&this.kj(t.coordinateFormat),t.projection&&this.$h(t.projection),this.u=void 0!==t.undefinedHTML?t.undefinedHTML:"",this.l=e.innerHTML,this.o=this.j=this.c=null}function zo(t){(t=t.frameState)?this.c!=t.viewState.projection&&(this.c=t.viewState.projection,this.j=null):this.c=null,Yo(this,this.o)}function Yo(t,e){var o,i=t.u;e&&t.c&&(t.j||(o=t.Zh(),t.j=o?we(t.c,o):xe),e=t.a.Wa(e))&&(t.j(e,e),i=(i=t.xh())?i(e):e.toString()),t.l&&i==t.l||(t.element.innerHTML=i,t.l=i)}e(Ko,To),(r=Ko.prototype).Ym=function(){this.j=null},r.xh=function(){return this.get(qo)},r.Zh=function(){return this.get(Ho)},r.Ll=function(t){this.o=this.a.xe(t),Yo(this,this.o)},r.Ml=function(){Yo(this,null),this.o=null},r.setMap=function(t){To.prototype.setMap.call(this,t),t&&(t=t.a,this.v.push(d(t,"mousemove",this.Ll,this),d(t,"mouseout",this.Ml,this)))},r.kj=function(t){this.set(qo,t)},r.$h=function(t){this.set(Ho,v(t))};var Ho="projection",qo="coordinateFormat";function Jo(t,e,o){Qe.call(this,t),this.map=e,this.frameState=void 0!==o?o:null}function _o(t,e,o,i,r){Jo.call(this,t,e,r),this.originalEvent=o,this.pixel=e.xe(o),this.coordinate=e.Wa(this.pixel),this.dragging=void 0!==i&&i}e(Jo,Qe),e(_o,Jo),_o.prototype.preventDefault=function(){Jo.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},_o.prototype.stopPropagation=function(){Jo.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var $o=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Qo(t,e){for(var o,i=$o.length,r=0;r<i;++r)try{if(o=t.getContext($o[r],e))return o}catch(t){}return null}var ti="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",ei=-1!==ti.indexOf("firefox"),oi=-1!==ti.indexOf("safari")&&-1==ti.indexOf("chrom"),ii=-1!==ti.indexOf("webkit")&&-1==ti.indexOf("edge"),ri=-1!==ti.indexOf("macintosh"),ni=window.devicePixelRatio||1,si=!1,ai=function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(si=!0),!0)}catch(t){return!1}}(),pi="DeviceOrientationEvent"in window,hi="geolocation"in navigator,li="ontouchstart"in window,ui="PointerEvent"in window,ci=!!navigator.msPointerEnabled,ti=!1,fi=[];if("WebGLRenderingContext"in window)try{var yi=Qo(document.createElement("CANVAS"),{failIfMajorPerformanceCaveat:!0});yi&&(ti=!0,By=yi.getParameter(yi.MAX_TEXTURE_SIZE),fi=yi.getSupportedExtensions())}catch(t){}var gi=ti,di=fi,vi=By,bi={Iq:"singleclick",xq:"click",yq:"dblclick",Bq:"pointerdrag",Eq:"pointermove",Aq:"pointerdown",Hq:"pointerup",Gq:"pointerover",Fq:"pointerout",Cq:"pointerenter",Dq:"pointerleave",zq:"pointercancel"};function mi(t,e,o,i,r){_o.call(this,t,e,o.b,i,r),this.b=o}function wi(t,e){this.b=t,this.f=e}function xi(t){wi.call(this,t,{mousedown:this.fm,mousemove:this.gm,mouseup:this.jm,mouseover:this.im,mouseout:this.hm}),this.a=t.i,this.i=[]}function Si(t,e){t=t.i;var o=e.clientX;e=e.clientY;for(var i,r=0,n=t.length;r<n&&(i=t[r]);r++){var s=Math.abs(e-i[1]);if(Math.abs(o-i[0])<=25&&s<=25)return 1}}function Mi(t){var e=Fi(t,t),o=e.preventDefault;return e.preventDefault=function(){t.preventDefault(),o()},e.pointerId=1,e.isPrimary=!0,e.pointerType="mouse",e}function Pi(t){wi.call(this,t,{MSPointerDown:this.om,MSPointerMove:this.pm,MSPointerUp:this.sm,MSPointerOut:this.qm,MSPointerOver:this.rm,MSPointerCancel:this.nm,MSGotPointerCapture:this.lm,MSLostPointerCapture:this.mm}),this.a=t.i,this.i=["","unavailable","touch","pen","mouse"]}function Ai(t,e){var o=e;return"number"==typeof e.pointerType&&((o=Fi(e,e)).pointerType=t.i[e.pointerType]),o}function Ei(t){wi.call(this,t,{pointerdown:this.ip,pointermove:this.jp,pointerup:this.mp,pointerout:this.kp,pointerover:this.lp,pointercancel:this.hp,gotpointercapture:this.ul,lostpointercapture:this.em})}function Ti(t,e,o){var i;Qe.call(this,t),this.b=e,this.buttons=function(t){if(t.buttons||ji)t=t.buttons;else switch(t.which){case 1:t=1;break;case 2:t=4;break;case 3:t=2;break;default:t=0}return t}(t=o||{}),this.pressure=(o=t,i=this.buttons,o.pressure||(i?.5:0)),this.bubbles="bubbles"in t&&t.bubbles,this.cancelable="cancelable"in t&&t.cancelable,this.view="view"in t?t.view:null,this.detail="detail"in t?t.detail:null,this.screenX="screenX"in t?t.screenX:0,this.screenY="screenY"in t?t.screenY:0,this.clientX="clientX"in t?t.clientX:0,this.clientY="clientY"in t?t.clientY:0,this.ctrlKey="ctrlKey"in t&&t.ctrlKey,this.altKey="altKey"in t&&t.altKey,this.shiftKey="shiftKey"in t&&t.shiftKey,this.metaKey="metaKey"in t&&t.metaKey,this.button="button"in t?t.button:0,this.relatedTarget="relatedTarget"in t?t.relatedTarget:null,this.pointerId="pointerId"in t?t.pointerId:0,this.width="width"in t?t.width:0,this.height="height"in t?t.height:0,this.tiltX="tiltX"in t?t.tiltX:0,this.tiltY="tiltY"in t?t.tiltY:0,this.pointerType="pointerType"in t?t.pointerType:"",this.isPrimary="isPrimary"in t&&t.isPrimary,e.preventDefault&&(this.preventDefault=function(){e.preventDefault()})}e(mi,_o),e(xi,wi),(r=xi.prototype).fm=function(t){var e;Si(this,t)||(1..toString()in this.a&&this.cancel(t),e=Mi(t),this.a[1..toString()]=t,Ui(this.b,"pointerdown",e,t))},r.gm=function(t){var e;Si(this,t)||(e=Mi(t),Ui(this.b,"pointermove",e,t))},r.jm=function(t){var e;Si(this,t)||(e=this.a[1..toString()])&&e.button===t.button&&(e=Mi(t),Ui(this.b,"pointerup",e,t),delete this.a[1..toString()])},r.im=function(t){var e;Si(this,t)||(e=Mi(t),Oi(this.b,e,t))},r.hm=function(t){var e;Si(this,t)||(e=Mi(t),Di(this.b,e,t))},r.cancel=function(t){var e=Mi(t);this.b.cancel(e,t),delete this.a[1..toString()]},e(Pi,wi),(r=Pi.prototype).om=function(t){this.a[t.pointerId.toString()]=t;var e=Ai(this,t);Ui(this.b,"pointerdown",e,t)},r.pm=function(t){var e=Ai(this,t);Ui(this.b,"pointermove",e,t)},r.sm=function(t){var e=Ai(this,t);Ui(this.b,"pointerup",e,t),delete this.a[t.pointerId.toString()]},r.qm=function(t){var e=Ai(this,t);Di(this.b,e,t)},r.rm=function(t){var e=Ai(this,t);Oi(this.b,e,t)},r.nm=function(t){var e=Ai(this,t);this.b.cancel(e,t),delete this.a[t.pointerId.toString()]},r.mm=function(t){this.b.b(new Ti("lostpointercapture",t,t))},r.lm=function(t){this.b.b(new Ti("gotpointercapture",t,t))},e(Ei,wi),(r=Ei.prototype).ip=function(t){Gi(this.b,t)},r.jp=function(t){Gi(this.b,t)},r.mp=function(t){Gi(this.b,t)},r.kp=function(t){Gi(this.b,t)},r.lp=function(t){Gi(this.b,t)},r.hp=function(t){Gi(this.b,t)},r.em=function(t){Gi(this.b,t)},r.ul=function(t){Gi(this.b,t)},e(Ti,Qe);var ji=!1;try{ji=1===new MouseEvent("click",{buttons:1}).buttons}catch(t){}function Ci(t,e){wi.call(this,t,{touchstart:this.rq,touchmove:this.qq,touchend:this.pq,touchcancel:this.oq}),this.a=t.i,this.j=e,this.i=void 0,this.g=0,this.c=void 0}function Li(t,e,o){function i(){e.preventDefault()}for(var r,n,s=Array.prototype.slice.call(e.changedTouches),a=s.length,p=0;p<a;++p){h=t,r=e,n=s[p],(r=Fi(r,n)).pointerId=n.identifier+2,r.bubbles=!0,r.cancelable=!0,r.detail=h.g,r.button=0,r.buttons=1,r.width=n.webkitRadiusX||n.radiusX||0,r.height=n.webkitRadiusY||n.radiusY||0,r.pressure=n.webkitForce||n.force||.5,r.isPrimary=h.i===n.identifier,r.pointerType="touch",r.clientX=n.clientX,r.clientY=n.clientY,r.screenX=n.screenX,r.screenY=n.screenY;var h=r;h.preventDefault=i,o.call(t,e,h)}}function Ri(t,e){var o,i=t.j.i;e=e.changedTouches[0],t.i===e.identifier&&(o=[e.clientX,e.clientY],i.push(o),setTimeout(function(){V(i,o)},2500))}function Ii(t){eo.call(this),this.g=t,this.i={},this.f={},this.a=[],ui?Ni(this,new Ei(this)):ci?Ni(this,new Pi(this)):(Ni(this,t=new xi(this)),li&&Ni(this,new Ci(this,t))),t=this.a.length;for(var e,o,i=0;i<t;i++)e=this.a[i],o=this,Object.keys(e.f).forEach(function(t){d(this.g,t,this.c,this)},o)}function Ni(t,o){var e=Object.keys(o.f);e&&(e.forEach(function(t){var e=o.f[t];e&&(this.f[t]=e.bind(o))},t),t.a.push(o))}function Fi(t,e){for(var o,i={},r=0,n=Bi.length;r<n;r++)i[o=Bi[r][0]]=t[o]||e[o]||Bi[r][1];return i}function ki(t,e,o){e.bubbles=!1,Ui(t,"pointerleave",e,o)}function Di(t,e,o){t.out(e,o);var i=e.target,r=e.relatedTarget;i&&r&&i.contains(r)||ki(t,e,o)}function Oi(t,e,o){e.bubbles=!0,Ui(t,"pointerover",e,o);var i=e.target,r=e.relatedTarget;i&&r&&i.contains(r)||(e.bubbles=!1,Ui(t,"pointerenter",e,o))}function Ui(t,e,o,i){t.b(new Ti(e,i,o))}function Gi(t,e){t.b(new Ti(e.type,e,e))}e(Ci,wi),(r=Ci.prototype).ij=function(){this.g=0,this.c=void 0},r.rq=function(t){var e=t.touches,o=Object.keys(this.a),i=o.length;if(i>=e.length){for(var r=[],n=0;n<i;++n){var s,a=o[n],p=this.a[a];if(!(s=1==a))t:{for(var h=e.length,l=0;l<h;l++)if((s=e[l]).identifier===a-2){s=!0;break t}s=!1}s||r.push(p.out)}for(n=0;n<r.length;++n)this.Kf(t,r[n])}e=t.changedTouches[0],(!(o=Object.keys(this.a).length)||1===o&&1..toString()in this.a)&&(this.i=e.identifier,void 0!==this.c)&&clearTimeout(this.c),Ri(this,t),this.g++,Li(this,t,this.cp)},r.cp=function(t,e){this.a[e.pointerId]={target:e.target,out:e,Wi:e.target};var o=this.b;e.bubbles=!0,Ui(o,"pointerover",e,t),o=this.b,e.bubbles=!1,Ui(o,"pointerenter",e,t),Ui(this.b,"pointerdown",e,t)},r.qq=function(t){t.preventDefault(),Li(this,t,this.km)},r.km=function(t,e){var o,i,r=this.a[e.pointerId];r&&(o=r.out,i=r.Wi,Ui(this.b,"pointermove",e,t),o&&i!==e.target&&(o.relatedTarget=e.target,e.relatedTarget=i,o.target=i,e.target?(Di(this.b,o,t),Oi(this.b,e,t)):(e.target=i,e.relatedTarget=null,this.Kf(t,e))),r.out=e,r.Wi=e.target)},r.pq=function(t){Ri(this,t),Li(this,t,this.sq)},r.sq=function(t,e){Ui(this.b,"pointerup",e,t),this.b.out(e,t),ki(this.b,e,t),delete this.a[e.pointerId],e.isPrimary&&(this.i=void 0,this.c=setTimeout(this.ij.bind(this),200))},r.oq=function(t){Li(this,t,this.Kf)},r.Kf=function(t,e){this.b.cancel(e,t),this.b.out(e,t),ki(this.b,e,t),delete this.a[e.pointerId],e.isPrimary&&(this.i=void 0,this.c=setTimeout(this.ij.bind(this),200))},e(Ii,eo),Ii.prototype.c=function(t){var e=this.f[t.type];e&&e(t)},Ii.prototype.out=function(t,e){t.bubbles=!0,Ui(this,"pointerout",t,e)},Ii.prototype.cancel=function(t,e){Ui(this,"pointercancel",t,e)};var Bi=[["bubbles",!(Ii.prototype.ka=function(){for(var t,e,o=this.a.length,i=0;i<o;i++)t=this.a[i],e=this,Object.keys(t.f).forEach(function(t){He(this.g,t,this.c,this)},e);eo.prototype.ka.call(this)})],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];function Xi(t,e){eo.call(this),this.i=t,this.j=0,this.o=!1,this.f=[],this.D=e?e*ni:ni,this.c=null,t=this.i.a,this.S=0,this.u={},this.g=new Ii(t),this.a=null,this.l=d(this.g,"pointerdown",this.Ol,this),this.v=d(this.g,"pointermove",this.Lp,this)}function Vi(t,e){"pointerup"==e.type||"pointercancel"==e.type?delete t.u[e.pointerId]:"pointerdown"==e.type&&(t.u[e.pointerId]=!0),t.S=Object.keys(t.u).length}function Wi(t,e){return Math.abs(e.clientX-t.c.clientX)>t.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<r>>1;){var p=2*e+1,h=2*e+2,p=h<r&&i[h]<i[p]?h:p;o[e]=o[p],i[e]=i[p],e=p}o[e]=n,i[e]=s,Yi(t,a,e)}function Yi(t,e,o){var i=t.b;t=t.i;for(var r=i[o],n=t[o];e<o;){var s=o-1>>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<n;++s){var a=o[s],p=e(a);1/0==p?delete t.a[t.c(a)]:(i[r]=p,o[r++]=a)}for(o.length=r,i.length=r,e=(t.b.length>>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<e&&n<o&&0<t.b.length;)r=(i=Ki(t)[0]).bb(),0!==i.getState()||r in t.g||(t.g[r]=!0,++t.j,++n,i.load())}function _i(t){if(void 0!==t)return 0}function $i(t,e){if(void 0!==t)return t+e}function Qi(t,e){return 2<(e=-1===(e=(t=void 0!==e?t.toFixed(e):""+t).indexOf("."))?t.length:e)?t:Array(3-e).join("0")+t}function tr(t){t=(""+t).split(".");for(var e=["1","3"],o=0;o<Math.max(t.length,e.length);o++){var i=parseInt(t[o]||"0",10),r=parseInt(e[o]||"0",10);if(r<i)return 1;if(i<r)return-1}return 0}function er(t,e){return t[0]+=e[0],t[1]+=e[1],t}function or(t,e){var o=t[0],i=(t=t[1],e[0]),r=e[1],i=(e=i[0],i[1]),n=r[0],s=n-e,a=(r=r[1])-i;return o=(o=s||a?(s*(o-e)+a*(t-i))/(s*s+a*a||0):0)<=0?(t=e,i):1<=o?(t=n,r):(t=e+o*s,i+o*a),[t,o]}function ir(t,e,o){e=rt(e+180,360)-180;var i=Math.abs(3600*e),r=(o=o||0,Math.pow(10,o)),n=Math.floor(i/3600),s=Math.floor((i-3600*n)/60);return 60<=(i=Math.ceil((i-3600*n-60*s)*r)/r)&&(i=0,s+=1),60<=s&&(s=0,n+=1),n+"° "+Qi(s)+"′ "+Qi(i,o)+"″"+(e?" "+t.charAt(e<0?1:0):"")}function rr(t,e,o){return t?e.replace("{x}",t[0].toFixed(o)).replace("{y}",t[1].toFixed(o)):""}function nr(t,e){for(var o=!0,i=t.length-1;0<=i;--i)if(t[i]!=e[i]){o=!1;break}return o}function sr(t,e){var o=Math.cos(e),i=(e=Math.sin(e),t[1]*o+t[0]*e);return t[0]=t[0]*o-t[1]*e,t[1]=i,t}function ar(t,e){t[0]*=e,t[1]*=e}function pr(t,e){var o=t[0]-e[0];return o*o+(t=t[1]-e[1])*t}function hr(t,e){return Math.sqrt(pr(t,e))}function lr(t,e){return pr(t,or(t,e))}function ur(t,e){return rr(t,"{x}, {y}",e)}function cr(){return!0}function fr(){return!1}function yr(){ro.call(this),this.l=vt(),this.v=-1,this.f={},this.o=this.g=0}function gr(t,e,o,i,r,n){for(var s=n||[],a=0;e<o;e+=i){var p=t[e],h=t[e+1];s[a++]=r[0]*p+r[2]*h+r[4],s[a++]=r[1]*p+r[3]*h+r[5]}return n&&s.length!=a&&(s.length=a),s}function dr(t,e,o,i,r,n,s){for(var a,p=s||[],h=0;e<o;e+=i)for(p[h++]=t[e]+r,p[h++]=t[e+1]+n,a=e+2;a<e+i;++a)p[h++]=t[a];return s&&p.length!=h&&(p.length=h),p}function b(){yr.call(this),this.ja="XY",this.a=2,this.A=null}function vr(t){var e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function br(t,e,o){t.a=vr(e),t.ja=e,t.A=o}function mr(t,e,o,i){if(e)o=vr(e);else{for(e=0;e<i;++e){if(!o.length)return t.ja="XY",void(t.a=2);o=o[0]}var r;2==(o=o.length)?r="XY":3==o?r="XYZ":4==o&&(r="XYZM"),e=r}t.ja=e,t.a=o}function wr(t,e,o,i){for(var r=0,n=t[o-i],s=t[o-i+1];e<o;e+=i)var a=t[e],p=t[e+1],r=r+(s*a-n*p),n=a,s=p;return r/2}function xr(t,e,o,i){for(var r=0,n=0,s=o.length;n<s;++n){var a=o[n],r=r+wr(t,e,a,i);e=a}return r}function Sr(t,e,o,i,r,n,s){var a=t[e],p=t[e+1],h=t[o]-a,l=t[o+1]-p;if(h||l)if(1<(n=((r-a)*h+(n-p)*l)/(h*h+l*l)))e=o;else if(0<n){for(r=0;r<i;++r)s[r]=nt(t[e+r],t[o+r],n);return void(s.length=i)}for(r=0;r<i;++r)s[r]=t[e+r];s.length=i}function Mr(t,e,o,i,r){var n=t[e],s=t[e+1];for(e+=i;e<o;e+=i){var a=t[e],p=t[e+1];r<(n=ot(n,s,a,p))&&(r=n),n=a,s=p}return r}function Pr(t,e,o,i,r){for(var n=0,s=o.length;n<s;++n){var a=o[n];r=Mr(t,e,a,i,r),e=a}return r}function Ar(t,e,o,i,r,n,s,a,p,h,l){if(e!=o)if(r){for(var u=l||[NaN,NaN],c=e+i;c<o;)if(Sr(t,c-i,c,i,s,a,u),(f=ot(s,a,u[0],u[1]))<h){for(h=f,l=0;l<i;++l)p[l]=u[l];c+=p.length=i}else c+=i*Math.max((Math.sqrt(f)-Math.sqrt(h))/r|0,1);if(n&&(Sr(t,o-i,e,i,s,a,u),(f=ot(s,a,u[0],u[1]))<h)){for(h=f,l=0;l<i;++l)p[l]=u[l];p.length=i}}else{var f=ot(s,a,t[e],t[e+1]);if(f<h){for(l=0;l<i;++l)p[l]=t[e+l];return p.length=i,f}}return h}function Er(t,e,o,i,r,n,s,a,p,h,l){l=l||[NaN,NaN];for(var u=0,c=o.length;u<c;++u){var f=o[u];h=Ar(t,e,f,i,r,n,s,a,p,h,l),e=f}return h}function Tr(t,e){for(var o=0,i=0,r=e.length;i<r;++i)t[o++]=e[i];return o}function jr(t,e,o,i){for(var r=0,n=o.length;r<n;++r)for(var s=o[r],a=0;a<i;++a)t[e++]=s[a];return e}function Cr(t,e,o,i,r){r=r||[];for(var n=0,s=0,a=o.length;s<a;++s)e=jr(t,e,o[s],i),r[n++]=e;return r.length=n,r}function Lr(t,e,o,i,r){r=void 0!==r?r:[];for(var n=0;e<o;e+=i)r[n++]=t.slice(e,e+i);return r.length=n,r}function Rr(t,e,o,i,r){r=void 0!==r?r:[];for(var n=0,s=0,a=o.length;s<a;++s){var p=o[s];r[n++]=Lr(t,e,p,i,r[n]),e=p}return r.length=n,r}function Ir(t,e,o,i,r,n,s){var a=(o-e)/i;if(a<3)for(;e<o;e+=i)n[s++]=t[e],n[s++]=t[e+1];else{var p=Array(a);p[0]=1,p[a-1]=1,o=[e,o-i];for(var h=0;0<o.length;){for(var l=o.pop(),u=o.pop(),c=0,f=t[u],y=t[u+1],g=t[l],d=t[l+1],v=u+i;v<l;v+=i){var b=et(t[v],t[v+1],f,y,g,d);c<b&&(h=v,c=b)}r<c&&(p[(h-e)/i]=1,u+i<h&&o.push(u,h),h+i<l)&&o.push(h,l)}for(v=0;v<a;++v)p[v]&&(n[s++]=t[e+v*i],n[s++]=t[e+v*i+1])}return s}function Nr(t,e,o,i,r,n,s,a){for(var p=0,h=o.length;p<h;++p){var l=o[p];t:{var u=t,c=l,f=i,y=r,g=n,d=s;if(e!=c){var v=y*Math.round(u[e]/y),b=y*Math.round(u[e+1]/y);e+=f,g[d++]=v,g[d++]=b;do{var m=y*Math.round(u[e]/y);if(s=y*Math.round(u[e+1]/y),(e+=f)==c){g[d++]=m,g[d++]=s,s=d;break t}}while(m==v&&s==b);for(;e<c;){var w,x,S,M,P=y*Math.round(u[e]/y),A=y*Math.round(u[e+1]/y);e+=f,P==m&&A==s||((w=m-v)*(M=A-b)==(x=s-b)*(S=P-v)&&(w<0&&S<w||w==S||0<w&&w<S)&&(x<0&&M<x||x==M||0<x&&x<M)||(v=g[d++]=m,b=g[d++]=s),m=P,s=A)}g[d++]=m,g[d++]=s}s=d}a.push(s),e=l}return s}function Fr(t,e){b.call(this),this.c=this.j=-1,this.ma(t,e)}function kr(t,e,o){br(t,e,o),t.s()}function m(t,e){b.call(this),this.ma(t,e)}function Dr(t,e,o,i,r,n){for(var s=0,a=t[o-i],p=t[o-i+1];e<o;e+=i){var h=t[e],l=t[e+1];p<=n?n<l&&0<(h-a)*(n-p)-(r-a)*(l-p)&&s++:l<=n&&(h-a)*(n-p)-(r-a)*(l-p)<0&&s--,a=h,p=l}return s}function Or(t,e,o,i,r,n){if(!o.length||!Dr(t,e,o[0],i,r,n))return!1;var s;for(e=1,s=o.length;e<s;++e)if(Dr(t,o[e-1],o[e],i,r,n))return!1;return!0}function Ur(t,e,o,i,r,n,s){for(var a=r[n+1],p=[],h=o[0],l=t[h-i],u=t[h-i+1],c=e;c<h;c+=i){var f=t[c],y=t[c+1];(a<=u&&y<=a||u<=a&&a<=y)&&p.push(l=(a-u)/(y-u)*(f-l)+l),l=f,u=y}for(h=NaN,u=-1/0,p.sort(G),l=p[0],c=1,y=p.length;c<y;++c){var f=p[c],g=Math.abs(f-l);u<g&&Or(t,e,o,i,l=(l+f)/2,a)&&(h=l,u=g),l=f}return isNaN(h)&&(h=r[n]),s?(s.push(h,a),s):[h,a]}function Gr(t,e,o,i,r,n){for(var s,a=[t[e],t[e+1]],p=[];e+i<o;e+=i){if(p[0]=t[e+i],p[1]=t[e+i+1],s=r.call(n,a,p))return s;a[0]=p[0],a[1]=p[1]}return!1}function Br(t,e,o,i,l){var r=At(vt(),t,e,o,i);return!!Ot(l,r)&&(!!(yt(l,r)||r[0]>=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;e<n;++e)if(function(e,o,i,r,t){return!Et(t,function(t){return!Dr(e,o,i,r,t[0],t[1])})}(t,o[e-1],o[e],i,r))return!1;return!0}function Vr(t,e,o,i){for(var r=0,n=t[o-i],s=t[o-i+1];e<o;e+=i)var a=t[e],p=t[e+1],r=r+(a-n)*(p+s),n=a,s=p;return 0<r}function Wr(t,e,o,i){for(var r=0,n=(i=void 0!==i&&i,0),s=e.length;n<s;++n){var a=e[n],r=Vr(t,r,a,o);if(n){if(i&&!r||!i&&r)return}else if(i&&r||!i&&!r)return;r=a}return 1}function Zr(t,e,o,i,r){r=void 0!==r&&r;for(var n=0,s=o.length;n<s;++n){var a=o[n],p=Vr(t,e,a,i);if(n?r&&!p||!r&&p:r&&p||!r&&!p)for(var p=t,h=a,l=i;e<h-l;){for(var u=0;u<l;++u){var c=p[e+u];p[e+u]=p[h-l+u],p[h-l+u]=c}e+=l,h-=l}e=a}return e}function Kr(t,e,o,i){for(var r=0,n=0,s=e.length;n<s;++n)r=Zr(t,r,e[n],o,i);return r}function w(t,e){b.call(this),this.c=[],this.u=-1,this.D=null,this.I=this.C=this.B=-1,this.j=null,this.ma(t,e)}function zr(t){var e;return t.u!=t.i&&(e=Lt(t.G()),t.D=Ur(t.ec(),0,t.c,t.a,e,0),t.u=t.i),t.D}function Yr(t,e,o,i){var r,n=i||32;for(i=[],r=0;r<n;++r)X(i,t.offset(e,o,2*Math.PI*r/n));return i.push(i[0],i[1]),(t=new w(null)).ba("XY",i,[i.length]),t}function Hr(t){var e=t[0],o=t[1],i=t[2],e=[e,o,e,t=t[3],i,t,i,o,e,o];return(o=new w(null)).ba("XY",e,[e.length]),o}function qr(t,e,o){for(var i=e||32,r=t.qa(),n=new w(null,e=t.ja),i=r*(i+1),r=Array(i),s=0;s<i;s++)r[s]=0;return n.ba(e,r,[r.length]),Jr(n,t.wa(),t.pd(),o),n}function Jr(t,e,o,i){var r=t.ga(),n=t.ja,s=t.qa(),a=t.Bb(),p=r.length/s-1;i=i||0;for(var h,l,u=0;u<=p;++u)l=u*s,h=i+2*rt(u,p)*Math.PI/p,r[l]=e[0]+o*Math.cos(h),r[1+l]=e[1]+o*Math.sin(h);t.ba(n,r,a)}function h(t){ro.call(this),t=Xt({},t),this.o=[0,0],this.c=[],this.wf=this.wf.bind(this),this.v=ge(t.projection),_r(this,t)}function _r(t,e){var o,i,r,n,s,a,p,h,l,u,c,f={},y=(f.center=void 0!==e.center?e.center:null,void 0!==e.minZoom?e.minZoom:0),g=void 0!==e.maxZoom?e.maxZoom:28,d=void 0!==e.zoomFactor?e.zoomFactor:2;g=void 0!==e.resolutions?(o=(g=e.resolutions)[0],i=g[g.length-1],p=g,function(t,e,o){if(void 0!==t)return(t=Q((t=B(p,t,o))+e,0,p.length-1))!=(e=Math.floor(t))&&e<p.length-1?p[e]/Math.pow(p[e]/p[e+1],t-e):p[e]}):(r=(h=((i=(o=ge(e.projection)).G())?Math.max(Dt(i),It(i)):360*Yt.degrees/o.sc())/256/Math.pow(2,0))/Math.pow(2,28),void 0!==(o=e.maxResolution)?y=0:o=h/Math.pow(d,y),void 0===(i=e.minResolution)&&(i=void 0!==e.maxZoom?void 0!==e.maxResolution?o/Math.pow(d,g):h/Math.pow(d,g):r),g=y+Math.floor(Math.log(o/i)/Math.log(d)),i=o/Math.pow(d,g-y),n=d,s=o,a=g-y,function(t,e,o){if(void 0!==t)return t=Math.max(Math.floor(Math.log(s/t)/Math.log(n)+(-o/2+.5))+e,0),void 0!==a&&(t=Math.min(t,a)),s/Math.pow(n,t)}),t.a=o,t.f=i,t.C=d,t.j=e.resolutions,t.l=y,y=void 0===e.enableRotation||e.enableRotation?void 0===(y=e.constrainRotation)||!0===y?(u=it(5),function(t,e){if(void 0!==t)return Math.abs(t+e)<=u?0:t+e}):!1!==y&&"number"==typeof y?(h=y,l=2*Math.PI/h,function(t,e){if(void 0!==t)return Math.floor((t+e)/l+.5)*l}):$i:_i,t.g={center:void 0!==e.extent?(c=e.extent,function(t){if(t)return[Q(t[0],c[0],c[2]),Q(t[1],c[1],c[3])]}):Xe,resolution:g,rotation:y},void 0!==e.resolution?f.resolution=e.resolution:void 0!==e.zoom&&(f.resolution=t.constrainResolution(t.a,e.zoom-t.l)),f.rotation=void 0!==e.rotation?e.rotation:0,t.H(f),t.D=e}function $r(t,e){var o=Xt({},t.D);return void 0!==o.resolution?o.resolution=t.Pa():o.zoom=t.Hh(),o.center=t.wa(),o.rotation=t.Qa(),Xt({},o,e)}function Qr(t,e,o){var i,r=t.wa();return void 0!==r&&(sr(i=[r[0]-o[0],r[1]-o[1]],e-t.Qa()),er(i,o)),i}function tn(t,e,o){var i,r=t.wa();return t=t.Pa(),i=void 0!==r&&void 0!==t?[o[0]-e*(o[0]-r[0])/t,o[1]-e*(o[1]-r[1])/t]:i}function en(t){var e=[100,100];return t='.ol-viewport[data-view="'+U(t)+'"]',(t=document.querySelector(t))&&(t=getComputedStyle(t),e[0]=parseInt(t.width,10),e[1]=parseInt(t.height,10)),e}function on(t,e){return void 0!==e?(e[0]=t.o[0],e[1]=t.o[1],e):t.o.slice()}function rn(t){return t.wa()&&void 0!==t.Pa()}function nn(t,e,o){t.o[e]+=o,t.s()}function sn(t,e,o){this.f=t,this.c=e,this.g=o,this.b=[],this.a=this.i=0}function an(t){t.b.length=0,t.i=0,t.a=0}function pn(t){ro.call(this),this.v=null,this.Ha(!0),this.handleEvent=t.handleEvent}function hn(t,e,o,i){var r,n;void 0!==e&&(r=t.Qa(),n=t.wa(),void 0!==r&&n&&0<i?t.animate({rotation:e,anchor:o,duration:i,easing:Io}):t.rotate(e,o))}function ln(t,e,o,i){var r,n=t.Pa();e=t.constrainResolution(n,e,0),o&&void 0!==e&&e!==n&&(r=t.wa(),o=tn(t,e,o),o=t.Ec(o),o=[(e*r[0]-n*o[0])/(e-n),(e*r[1]-n*o[1])/(e-n)]),un(t,e,o,i)}function un(t,e,o,i){var r,n;e&&(r=t.Pa(),n=t.wa(),void 0!==r&&n&&e!==r&&i?t.animate({resolution:e,anchor:o,duration:i,easing:Io}):(o&&(o=tn(t,e,o),t.ob(o)),t.Vc(e)))}function cn(t){this.a=(t=t||{}).delta||1,pn.call(this,{handleEvent:fn}),this.g=void 0!==t.duration?t.duration:250}function fn(t){var e=!1,o=t.originalEvent;return"dblclick"==t.type&&(e=t.coordinate,o=o.shiftKey?-this.a:this.a,ln(t.map.Z(),o,e,this.g),t.preventDefault(),e=!0),!e}function yn(t){return(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey}function gn(t){return!((t=t.originalEvent).button||ii&&ri&&t.ctrlKey)}function dn(t){return"pointermove"==t.type}function vn(t){return"singleclick"==t.type}function bn(t){return!(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey}function mn(t){return!(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey}function wn(t){return"INPUT"!==(t=t.originalEvent.target.tagName)&&"SELECT"!==t&&"TEXTAREA"!==t}function xn(t){return O(t.b,56),"mouse"==t.b.pointerType}function Sn(t){return(t=t.b).isPrimary&&0===t.button}function Mn(t){pn.call(this,{handleEvent:(t=t||{}).handleEvent||An}),this.yf=t.handleDownEvent||fr,this.If=t.handleDragEvent||Y,this.Jf=t.handleMoveEvent||Y,this.sk=t.handleUpEvent||fr,this.D=!1,this.na={},this.o=[]}function Pn(t){for(var e=t.length,o=0,i=0,r=0;r<e;r++)o+=t[r].clientX,i+=t[r].clientY;return[o/e,i/e]}function An(t){var e,o;return!(t instanceof mi&&(e=!1,"pointerdown"!==(o=t.type)&&"pointerdrag"!==o&&"pointerup"!==o||(o=t.b,"pointerup"==t.type?delete this.na[o.pointerId]:("pointerdown"==t.type||o.pointerId in this.na)&&(this.na[o.pointerId]=o),this.o=Wt(this.na)),this.D?"pointerdrag"==t.type?this.If(t):"pointerup"==t.type&&(this.D=this.sk(t)&&0<this.o.length):"pointerdown"==t.type?(this.D=t=this.yf(t),e=this.Xc(t)):"pointermove"==t.type&&this.Jf(t),e))}function En(t){Mn.call(this,{handleDownEvent:Cn,handleDragEvent:Tn,handleUpEvent:jn}),this.a=(t=t||{}).kinetic,this.g=null,this.u=t.condition||bn,this.j=!1}function Tn(t){var e,o,i=this.o,r=Pn(i);i.length==this.l?(this.a&&this.a.b.push(r[0],r[1],Date.now()),this.g&&(ar(o=[o=this.g[0]-r[0],r[1]-this.g[1]],(e=(t=t.map.Z()).getState()).resolution),sr(o,e.rotation),er(o,e.center),o=t.Ec(o),t.ob(o))):this.a&&an(this.a),this.g=r,this.l=i.length}function jn(t){var e,o,i,r=t.map;return t=r.Z(),this.o.length?(this.a&&an(this.a),!(this.g=null)):(!this.j&&this.a&&function(t){if(!(t.b.length<6)){var e=Date.now()-t.g,o=t.b.length-3;if(!(t.b[2+o]<e)){for(var i,r=o-3;0<r&&t.b[r+2]>e;)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.o.length&&this.u(t))&&(e=t.map.Z(),this.g=null,this.D||nn(e,1,1),on(e)[0]&&e.ob(t.frameState.viewState.center),this.a&&an(this.a),this.j=1<this.o.length,!0)}function Ln(t){t=t||{},Mn.call(this,{handleDownEvent:Nn,handleDragEvent:Rn,handleUpEvent:In}),this.g=t.condition||yn,this.a=void 0,this.j=void 0!==t.duration?t.duration:250}function Rn(t){var e,o,i;xn(t)&&(e=(o=t.map).Z()).g.rotation!==_i&&(o=o.Ob(),t=t.pixel,t=Math.atan2(o[1]/2-t[1],t[0]-o[0]/2),void 0!==this.a&&(o=t-this.a,i=e.Qa(),hn(e,i-o)),this.a=t)}function In(t){if(!xn(t))return!0;nn(t=t.map.Z(),1,-1);var e=t.Qa(),o=this.j,e=t.constrainRotation(e,0);return hn(t,e,void 0,o),!1}function Nn(t){return!!(xn(t)&&gn(t)&&this.g(t))&&(nn(t.map.Z(),1,1),!(this.a=void 0))}function Fn(t){this.Gc=null,this.a=document.createElement("div"),this.a.style.position="absolute",this.a.className="ol-box "+t,this.i=this.c=this.b=null}function kn(t){var e=t.c,o=t.i;(t=t.a.style).left=Math.min(e[0],o[0])+"px",t.top=Math.min(e[1],o[1])+"px",t.width=Math.abs(o[0]-e[0])+"px",t.height=Math.abs(o[1]-e[1])+"px"}function Dn(t){var e=t.c,o=t.i;(e=[e,[e[0],o[1]],o,[o[0],e[1]]].map(t.b.Wa,t.b))[4]=e[0].slice(),t.Gc?t.Gc.ma([e]):t.Gc=new w([e])}function On(t){Mn.call(this,{handleDownEvent:Xn,handleDragEvent:Gn,handleUpEvent:Bn}),this.a=new Fn((t=t||{}).className||"ol-dragbox"),this.u=void 0!==t.minArea?t.minArea:64,this.g=null,this.C=t.condition||cr,this.l=t.boxEndCondition||Un}function Un(t,e,o){return(t=o[0]-e[0])*t+(e=o[1]-e[1])*e>=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.A.length)return this.f[e]=o;this.g=t}return this},r.hd=function(){return this},r.qa=function(){return this.a},r.Dc=function(t){this.A&&(t(this.A,this.A,this.a),this.s())},r.rotate=function(t,e){var o=this.ga();if(o){var i=o.length,r=this.qa(),n=o||[],s=Math.cos(t),a=(t=Math.sin(t),e[0]);e=e[1];for(var p=0,h=0;h<i;h+=r){var l=o[h]-a,u=o[h+1]-e;for(n[p++]=a+l*s-u*t,n[p++]=e+l*t+u*s,l=h+2;l<h+r;++l)n[p++]=o[l]}o&&n.length!=p&&(n.length=p),this.s()}},r.scale=function(t,e,o){var i=void 0===e?t:e;if(a=(a=o)||Lt(this.G()),o=this.ga()){e=o.length;for(var r=this.qa(),n=o||[],s=a[0],a=a[1],p=0,h=0;h<e;h+=r){var l=o[h]-s,u=o[h+1]-a;for(n[p++]=s+t*l,n[p++]=a+i*u,l=h+2;l<h+r;++l)n[p++]=o[l]}o&&n.length!=p&&(n.length=p),this.s()}},r.translate=function(t,e){var o=this.ga();o&&(dr(o,0,o.length,this.qa(),t,e,o),this.s())},e(Fr,b),(r=Fr.prototype).clone=function(){var t=new Fr(null);return kr(t,this.ja,this.A.slice()),t},r.Kb=function(t,e,o,i){return i<ct(this.G(),t,e)?i:(this.c!=this.i&&(this.j=Math.sqrt(Mr(this.A,0,this.A.length,this.a,0)),this.c=this.i),Ar(this.A,0,this.A.length,this.a,this.j,!0,t,e,o,i))},r.qn=function(){return wr(this.A,0,this.A.length,this.a)},r.X=function(){return Lr(this.A,0,this.A.length,this.a)},r.hd=function(t){var e=[];return e.length=Ir(this.A,0,this.A.length,this.a,t,e,0),kr(t=new Fr(null),"XY",e),t},r.U=function(){return"LinearRing"},r.Xa=function(){},r.ma=function(t,e){t?(mr(this,e,t,1),this.A||(this.A=[]),this.A.length=jr(this.A,0,t,this.a),this.s()):kr(this,"XY",null)},e(m,b),(r=m.prototype).clone=function(){var t=new m(null);return t.ba(this.ja,this.A.slice()),t},r.Kb=function(t,e,o,i){var r=this.A;if((t=ot(t,e,r[0],r[1]))<i){for(i=this.a,e=0;e<i;++e)o[e]=r[e];return o.length=i,t}return i},r.X=function(){return this.A?this.A.slice():[]},r.se=function(t){return wt(this.A,t)},r.U=function(){return"Point"},r.Xa=function(t){return gt(t,this.A[0],this.A[1])},r.ma=function(t,e){t?(mr(this,e,t,0),this.A||(this.A=[]),this.A.length=Tr(this.A,t),this.s()):this.ba("XY",null)},r.ba=function(t,e){br(this,t,e),this.s()},e(w,b),(r=w.prototype).pk=function(t){this.A?X(this.A,t.ga()):this.A=t.ga().slice(),this.c.push(this.A.length),this.s()},r.clone=function(){var t=new w(null);return t.ba(this.ja,this.A.slice(),this.c.slice()),t},r.Kb=function(t,e,o,i){return i<ct(this.G(),t,e)?i:(this.C!=this.i&&(this.B=Math.sqrt(Pr(this.A,0,this.c,this.a,0)),this.C=this.i),Er(this.A,0,this.c,this.a,this.B,!0,t,e,o,i))},r.Mc=function(t,e){return Or(this.ec(),0,this.c,this.a,t,e)},r.tn=function(){return xr(this.ec(),0,this.c,this.a)},r.X=function(t){var e;return void 0!==t?Zr(e=this.ec().slice(),0,this.c,this.a,t):e=this.A,Rr(e,0,this.c,this.a)},r.Bb=function(){return this.c},r.Tk=function(){return new m(zr(this))},r.Zk=function(){return this.c.length},r.Ch=function(t){var e;return t<0||this.c.length<=t?null:(kr(e=new Fr(null),this.ja,this.A.slice(t?this.c[t-1]:0,this.c[t])),e)},r.Sd=function(){for(var t=this.ja,e=this.A,o=this.c,i=[],r=0,n=0,s=o.length;n<s;++n){var a=o[n],p=new Fr(null);kr(p,t,e.slice(r,a)),i.push(p),r=a}return i},r.ec=function(){var t;return this.I!=this.i&&(Wr(t=this.A,this.c,this.a)?this.j=t:(this.j=t.slice(),this.j.length=Zr(this.j,0,this.c,this.a)),this.I=this.i),this.j},r.hd=function(t){var e=[],o=[];return e.length=Nr(this.A,0,this.c,this.a,Math.sqrt(t),e,0,o),(t=new w(null)).ba("XY",e,o),t},r.U=function(){return"Polygon"},r.Xa=function(t){return Xr(this.ec(),0,this.c,this.a,t)},r.ma=function(t,e){t?(mr(this,e,t,2),this.A||(this.A=[]),t=Cr(this.A,0,t,this.a,this.c),this.A.length=t.length?t[t.length-1]:0,this.s()):this.ba("XY",null,this.c)},r.ba=function(t,e,o){br(this,t,e),this.c=o,this.s()},e(h,ro),(r=h.prototype).animate=function(t){var e,o=Date.now(),i=this.wa().slice(),r=this.Pa(),n=this.Qa(),s=arguments.length;1<s&&"function"==typeof arguments[s-1]&&(e=arguments[s-1],--s);for(var a=[],p=0;p<s;++p){var h=arguments[p],l={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||No};h.center&&(l.Rg=i,l.Tg=h.center,i=l.Tg),void 0!==h.zoom?(l.tf=r,l.zd=this.constrainResolution(this.a,h.zoom-this.l,0),r=l.zd):h.resolution&&(l.tf=r,l.zd=h.resolution,r=l.zd),void 0!==h.rotation&&(l.Sg=n,l.uf=h.rotation,n=l.uf),l.callback=e,o+=l.duration,a.push(l)}this.c.push(a),nn(this,0,1),this.wf()},r.Ic=function(){return 0<on(this)[0]},r.Rk=function(){return 0<on(this)[1]},r.ed=function(){nn(this,0,-on(this)[0]);for(var t=0,e=this.c.length;t<e;++t){var o=this.c[t];o[0].callback&&o[0].callback(!1)}this.c.length=0},r.wf=function(){if(void 0!==this.u&&(cancelAnimationFrame(this.u),this.u=void 0),this.Ic()){for(var t=Date.now(),e=!1,o=this.c.length-1;0<=o;--o){for(var i=this.c[o],r=!0,n=0,s=i.length;n<s;++n){var a=i[n];if(!a.complete){var p,h,e=t-a.start;if(1<=(e=0<a.duration?e/a.duration:1)?(a.complete=!0,e=1):r=!1,e=a.easing(e),a.Rg&&(p=a.Rg[0],h=a.Rg[1],this.set("center",[p+e*(a.Tg[0]-p),h+e*(a.Tg[1]-h)])),a.tf&&a.zd&&(p=1===e?a.zd:a.tf+e*(a.zd-a.tf),a.anchor&&this.set("center",tn(this,p,a.anchor)),this.set("resolution",p)),void 0!==a.Sg&&void 0!==a.uf&&(e=1===e?a.uf:a.Sg+e*(a.uf-a.Sg),a.anchor&&this.set("center",Qr(this,e,a.anchor)),this.set("rotation",e)),e=!0,!a.complete)break}}r&&(this.c[o]=null,nn(this,0,-1),i=i[0].callback)&&i(!0)}this.c=this.c.filter(Boolean),e&&void 0===this.u&&(this.u=requestAnimationFrame(this.wf))}},r.Ec=function(t){return this.g.center(t)},r.constrainResolution=function(t,e,o){return this.g.resolution(t,e||0,o||0)},r.constrainRotation=function(t,e){return this.g.rotation(t,e||0)},r.wa=function(){return this.get("center")},r.dd=function(t){t=t||en(this);var e=this.wa(),o=(O(e,1),this.Pa()),i=(O(void 0!==o,2),this.Qa());return O(void 0!==i,3),Rt(e,o,i,t)},r.Nm=function(){return this.a},r.Pm=function(){return this.f},r.Om=function(){return this.Ce(this.f)},r.eq=function(t){_r(this,$r(this,{maxZoom:t}))},r.Qm=function(){return this.Ce(this.a)},r.fq=function(t){_r(this,$r(this,{minZoom:t}))},r.Rm=function(){return this.v},r.Pa=function(){return this.get("resolution")},r.Sm=function(){return this.j},r.ze=function(t,e){return e=e||en(this),Math.max(Dt(t)/e[0],It(t)/e[1])},r.Qa=function(){return this.get("rotation")},r.getState=function(){var t=this.wa(),e=this.v,o=this.Pa(),i=this.Qa();return{center:t.slice(),projection:void 0!==e?e:null,resolution:o,rotation:i}},r.Hh=function(){var t,e=this.Pa();return t=void 0!==e?this.Ce(e):t},r.Ce=function(t){if(t>=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;y<g;y+=f)var d=a[y]*t-a[y+1]*p,v=a[y]*p+a[y+1]*t,h=Math.min(h,d),l=Math.min(l,v),u=Math.max(u,d),c=Math.max(c,v);o=this.ze([h,l,u,c],[o[0]-i[1]-i[3],o[1]-i[0]-i[2]]),o=isNaN(o)?s:Math.max(o,s),r&&(s=this.constrainResolution(o,0,0),o=s=!n&&s<o?this.constrainResolution(s,-1,0):s),t=[(s=(h+u)/2+(i[1]-i[3])/2*o)*t-(i=(l+c)/2+(i[0]-i[2])/2*o)*(p=-p),i*t+s*p],i=e.callback||Y,void 0!==e.duration?this.animate({resolution:o,center:t,duration:e.duration,easing:e.easing},i):(this.Vc(o),this.ob(t),setTimeout(i.bind(void 0,!0),0))},r.uk=function(t,e,o){var i=this.Qa(),r=Math.cos(-i),i=Math.sin(-i),n=t[0]*r-t[1]*i,s=(t=t[1]*r+t[0]*i,this.Pa()),n=n+(e[0]/2-o[0])*s;t+=(o[1]-e[1]/2)*s,this.ob([n*r-t*(i=-i),t*r+n*i])},r.rotate=function(t,e){void 0!==e&&(e=Qr(this,t,e),this.ob(e)),this.Oe(t)},r.ob=function(t){this.set("center",t),this.Ic()&&this.ed()},r.Vc=function(t){this.set("resolution",t),this.Ic()&&this.ed()},r.Oe=function(t){this.set("rotation",t),this.Ic()&&this.ed()},r.lq=function(t){t=this.constrainResolution(this.a,t-this.l,0),this.Vc(t)},e(pn,ro),pn.prototype.c=function(){return this.get("active")},pn.prototype.f=function(){return this.v},pn.prototype.Ha=function(t){this.set("active",t)},pn.prototype.setMap=function(t){this.v=t},e(cn,pn),e(Mn,pn),Mn.prototype.Xc=function(t){return t},e(En,Mn),En.prototype.Xc=fr,e(Ln,Mn),Ln.prototype.Xc=fr,e(Fn,_e),Fn.prototype.ka=function(){this.setMap(null)},Fn.prototype.setMap=function(t){var e;this.b&&(this.b.C.removeChild(this.a),(e=this.a.style).left=e.top=e.width=e.height="inherit"),(this.b=t)&&this.b.C.appendChild(this.a)},Fn.prototype.V=function(){return this.Gc},e(On,Mn),On.prototype.V=function(){return this.a.V()},On.prototype.j=Y;var Vn="boxstart",Wn="boxdrag",Zn="boxend";function Kn(t,e,o){Qe.call(this,t),this.coordinate=e,this.mapBrowserEvent=o}function zn(t){var e=(t=t||{}).condition||mn;this.B=void 0!==t.duration?t.duration:200,this.I=void 0!==t.out&&t.out,On.call(this,{condition:e,className:t.className||"ol-dragzoom"})}function Yn(t){pn.call(this,{handleEvent:Hn}),t=t||{},this.a=function(t){return bn(t)&&wn(t)},this.g=t.condition||this.a,this.j=void 0!==t.duration?t.duration:100,this.o=void 0!==t.pixelDelta?t.pixelDelta:128}function Hn(t){var e,o,i,r,n=!1;return"keydown"==t.type&&(e=t.originalEvent.keyCode,!this.g(t)||40!=e&&37!=e&&39!=e&&38!=e||(o=(n=t.map.Z()).Pa()*this.o,r=i=0,40==e?r=-o:37==e?i=-o:39==e?i=o:r=o,sr(o=[i,r],n.Qa()),e=this.j,(i=n.wa())&&(o=n.Ec([i[0]+o[0],i[1]+o[1]]),e?n.animate({duration:e,easing:Fo,center:o}):n.ob(o)),t.preventDefault(),n=!0)),!n}function qn(t){pn.call(this,{handleEvent:Jn}),this.g=(t=t||{}).condition||wn,this.a=t.delta||1,this.j=void 0!==t.duration?t.duration:100}function Jn(t){var e,o=!1;return"keydown"!=t.type&&"keypress"!=t.type||(e=t.originalEvent.charCode,!this.g(t))||43!=e&&45!=e||(o=43==e?this.a:-this.a,ln(e=t.map.Z(),o,void 0,this.j),t.preventDefault(),o=!0),!o}function _n(t){pn.call(this,{handleEvent:$n}),t=t||{},this.j=0,this.D=void 0!==t.duration?t.duration:250,this.na=void 0!==t.timeout?t.timeout:80,this.C=void 0===t.useAnchor||t.useAnchor,this.R=t.constrainResolution||!1,this.a=null,this.l=this.o=this.u=this.g=void 0}function $n(t){if("wheel"!==(s=t.type)&&"mousewheel"!==s)return!0;t.preventDefault();var e,o,i,r,n,s=t.map,a=t.originalEvent;return this.C&&(this.a=t.coordinate),"wheel"==t.type?(e=a.deltaY,ei&&a.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=ni),a.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"==t.type&&(e=-a.wheelDeltaY,oi)&&(e/=3),0!==e&&(t=Date.now(),void 0===this.g&&(this.g=t),(!this.o||400<t-this.g)&&(this.o=Math.abs(e)<4?Qn:ts),this.o===Qn?(s=s.Z(),this.l?clearTimeout(this.l):nn(s,1,1),this.l=setTimeout(this.B.bind(this),400),a=s.Pa()*Math.pow(2,e/300),o=s.f,i=s.a,r=0,a<o?(a=Math.max(a,o/1.5),r=1):i<a&&(a=Math.min(a,1.5*i),r=-1),this.a&&(n=tn(s,a,this.a),s.ob(s.Ec(n))),s.Vc(a),!r&&this.R&&s.animate({resolution:s.constrainResolution(a,0<e?-1:1),easing:Io,anchor:this.a,duration:this.D}),0<r?s.animate({resolution:o,easing:Io,anchor:this.a,duration:500}):r<0&&s.animate({resolution:i,easing:Io,anchor:this.a,duration:500}),this.g=t):(this.j+=e,e=Math.max(this.na-(t-this.g),0),clearTimeout(this.u),this.u=setTimeout(this.I.bind(this,s),e))),!1}e(Kn,Qe),e(zn,On),zn.prototype.j=function(){var t=(r=this.v).Z(),e=r.Ob(),o=this.V().G();if(this.I){for(var i=t.dd(e),o=[r.Ja(jt(o)),r.Ja(kt(o))],r=mt(void 0),n=0,s=o.length;n<s;++n)Pt(r,o[n]);Gt(i,1/(o=t.ze(r,e))),o=i}e=t.constrainResolution(t.ze(o,e)),i=Lt(o),i=t.Ec(i),t.animate({resolution:e,center:i,duration:this.B,easing:Io})},e(Yn,pn),e(qn,pn),e(_n,pn),_n.prototype.B=function(){this.l=void 0,nn(this.v.Z(),1,-1)},_n.prototype.I=function(t){(t=t.Z()).Ic()&&t.ed(),ln(t,-Q(this.j,-1,1),this.a,this.D),this.o=void 0,this.j=0,this.a=null,this.u=this.g=void 0},_n.prototype.T=function(t){(this.C=t)||(this.a=null)};var Qn="trackpad",ts="wheel";function es(t){Mn.call(this,{handleDownEvent:rs,handleDragEvent:os,handleUpEvent:is}),t=t||{},this.g=null,this.j=void 0,this.a=!1,this.l=0,this.C=void 0!==t.threshold?t.threshold:.3,this.u=void 0!==t.duration?t.duration:250}function os(t){var e,o=0,i=this.o[0],r=this.o[1],i=Math.atan2(r.clientY-i.clientY,r.clientX-i.clientX);void 0!==this.j&&(o=i-this.j,this.l+=o,!this.a)&&Math.abs(this.l)>this.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):o<s&&(e=s/i,o=s),1!=e&&(this.j=e),e=t.a.getBoundingClientRect(),(i=Pn(this.o))[0]-=e.left,i[1]-=e.top,this.g=t.Wa(i),t.render(),un(r,o,this.g)}function as(t){var e,o,i;return!(this.o.length<2&&(nn(t=t.map.Z(),1,-1),i=t.Pa(),(this.l||i<t.f||i>t.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<o;e++){var i=t[e];this.c[U(i).toString()]=[d(i,"propertychange",this.Fe,this),d(i,"change",this.Fe,this)]}this.s()},r.Gl=function(t){var e=U(t=t.element).toString();this.c[e]=[d(t,"propertychange",this.Fe,this),d(t,"change",this.Fe,this)],this.s()},r.Il=function(t){t=U(t.element).toString(),this.c[t].forEach(qe),delete this.c[t],this.s()},r.qd=function(){return this.get(fs)},r.xi=function(t){this.set(fs,t)},r.Yf=function(t){var e,o=void 0!==t?t:[],i=o.length;for(this.qd().forEach(function(t){t.Yf(o)}),t=us(this),e=o.length;i<e;i++){var r=o[i];r.opacity*=t.opacity,r.visible=r.visible&&t.visible,r.maxResolution=Math.min(r.maxResolution,t.maxResolution),r.minResolution=Math.max(r.minResolution,t.minResolution),void 0!==t.extent&&(r.extent=void 0!==r.extent?Nt(r.extent,t.extent):t.extent)}return o},r.$f=function(){return"ready"};var fs="layers";function ys(t){var e=Xt({},t);delete e.source,ls.call(this,e),this.v=this.l=this.o=null,t.map&&this.setMap(t.map),d(this,so("source"),this.Ul,this),this.Wc(t.source||null)}function gs(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}function ds(){this.b={},this.a=0}e(ys,ls),(r=ys.prototype).Yf=function(t){return(t=t||[]).push(us(this)),t},r.ha=function(){return this.get("source")||null},r.$f=function(){var t=this.ha();return t?t.getState():"undefined"},r.Tn=function(){this.s()},r.Ul=function(){this.v&&(qe(this.v),this.v=null);var t=this.ha();t&&(this.v=d(t,"change",this.Tn,this)),this.s()},r.setMap=function(t){this.o&&(qe(this.o),this.o=null),t||this.s(),this.l&&(qe(this.l),this.l=null),t&&(this.o=d(t,"precompose",function(t){var e=us(this);e.Je=!1,e.zIndex=1/0,t.frameState.layerStatesArray.push(e),t.frameState.layerStates[U(this)]=e},this),this.l=d(this,"change",t.render,t),this.s())},r.Wc=function(t){this.set("source",t)},ds.prototype.clear=function(){this.b={},this.a=0},ds.prototype.get=function(t,e,o){return(t=e+":"+t+":"+(o?bo(o):"null"))in this.b?this.b[t]:null},ds.prototype.set=function(t,e,o,i){this.b[e+":"+t+":"+(o?bo(o):"null")]=i,++this.a};var vs=new ds,bs=Array(6);function ms(){return[1,0,0,1,0,0]}function ws(t){return Ss(t,1,0,0,1,0,0)}function xs(t,e){var o=t[0],i=t[1],r=t[2],n=t[3],s=t[4],a=t[5],p=e[0],h=e[1],l=e[2],u=e[3],c=e[4];return e=e[5],t[0]=o*p+r*h,t[1]=i*p+n*h,t[2]=o*l+r*u,t[3]=i*l+n*u,t[4]=o*c+r*e+s,t[5]=i*c+n*e+a,t}function Ss(t,e,o,i,r,n,s){return t[0]=e,t[1]=o,t[2]=i,t[3]=r,t[4]=n,t[5]=s,t}function Ms(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Ps(t,e){var o=e[0],i=e[1];return e[0]=t[0]*o+t[2]*i+t[4],e[1]=t[1]*o+t[3]*i+t[5],e}function As(t,e){var o=Math.cos(e);e=Math.sin(e),xs(t,Ss(bs,o,e,-e,o,0,0))}function Es(t,e,o){return xs(t,Ss(bs,e,0,0,o,0,0))}function Ts(t,e,o){xs(t,Ss(bs,1,0,0,1,e,o))}function js(t,e,o,i,r,n,s,a){var p=Math.sin(n);return n=Math.cos(n),t[0]=i*n,t[1]=r*p,t[2]=-i*p,t[3]=r*n,t[4]=s*i*n-a*i*p+e,t[5]=s*r*p+a*r*n+o,t}function Cs(t){var e=t[0]*t[3]-t[1]*t[2],o=(O(!!e,32),t[0]),i=t[1],r=t[2],n=t[3],s=t[4],a=t[5];return t[0]=n/e,t[1]=-i/e,t[2]=-r/e,t[3]=o/e,t[4]=(r*a-n*s)/e,t[5]=-(o*a-i*s)/e,t}function Ls(t,e){this.o=e,this.c={},this.v={}}function Rs(t){var e=t.viewState,o=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;js(o,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Cs(Ms(i,o))}function Is(){if(32<vs.a){var t,e=0;for(t in vs.b){var o=vs.b[t];3&e++||oo(o)||(delete vs.b[t],--vs.a)}}}function Ns(t,e){var o=U(e).toString();return o in t.c?t.c[o]:(e=e.Fd(t),t.c[o]=e,t.v[o]=d(e,"change",t.Fl,t),e)}function Fs(t,e){for(var o in t.c)if(!(o in e.layerStates)){e.postRenderFunctions.push(t.Rp.bind(t));break}}function ks(t,e){return t.zIndex-e.zIndex}function Ds(t,e,o,i,r){Qe.call(this,t),this.vectorContext=e,this.frameState=o,this.context=i,this.glContext=r}e(Ls,_e),(r=Ls.prototype).ka=function(){for(var t in this.c)$e(this.c[t])},r.Ea=function(t,r,e,n,s,o,i){function a(t,e){var o=U(t).toString(),i=r.layerStates[U(e)].Je;if(!(o in r.skippedFeatureUids)||i)return n.call(s,t,i?e:null)}var p,h,l=(c=r.viewState).resolution,u=c.projection,c=t;for(u.i&&(h=Dt(u=u.G()),(y=t[0])<u[0]||y>u[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;s+=2){var p,h,l=e[s]-t.D,u=e[s+1]-t.C;t.pa&&(l=Math.round(l),u=Math.round(u)),!n&&1==t.f||(js(i,p=l+t.D,h=u+t.C,t.f,t.f,n,-p,-h),o.setTransform.apply(o,i)),o.drawImage(t.M,t.T,t.na,t.oa,t.B,l,u,t.oa,t.B)}!n&&1==t.f||o.setTransform(1,0,0,1,0,0),1!=t.l&&(o.globalAlpha=r)}}function Zs(t,e,o,i){var r=0;if(t.ra&&""!==t.Ia){t.g&&Ys(t,t.g),t.o&&Hs(t,t.o);var n=t.ra,s=t.i;for((p=t.Ua)?(p.font!=n.font&&(p.font=s.font=n.font),p.textAlign!=n.textAlign&&(p.textAlign=s.textAlign=n.textAlign),p.textBaseline!=n.textBaseline&&(p.textBaseline=s.textBaseline=n.textBaseline)):(s.font=n.font,s.textAlign=n.textAlign,s.textBaseline=n.textBaseline,t.Ua={font:n.font,textAlign:n.textAlign,textBaseline:n.textBaseline}),e=gr(e,r,o,i,t.S,t.v),n=t.i,s=t.$a,t.Sa&&(s+=t.Yb);r<o;r+=i){var a,p=e[r]+t.Jb,h=e[r+1]+t.va;!s&&1==t.j||(a=js(t.xb,p,h,t.j,t.j,s,-p,-h),n.setTransform.apply(n,a)),t.o&&n.strokeText(t.Ia,p,h),t.g&&n.fillText(t.Ia,p,h)}!s&&1==t.j||n.setTransform(1,0,0,1,0,0)}}function Ks(t,e,o,i,r,n){var s=t.i;for(t=gr(e,o,i,r,t.S,t.v),s.moveTo(t[0],t[1]),e=t.length,n&&(e-=2),o=2;o<e;o+=2)s.lineTo(t[o],t[o+1]);return n&&s.closePath(),i}function zs(t,e,o,i,r){for(var n=0,s=i.length;n<s;++n)o=Ks(t,e,o,i[n],r,!0);return o}function Ys(t,e){var o=t.i,i=t.I;i?i.fillStyle!=e.fillStyle&&(i.fillStyle=o.fillStyle=e.fillStyle):(o.fillStyle=e.fillStyle,t.I={fillStyle:e.fillStyle})}function Hs(t,e){var o=t.i,i=t.R;i?(i.lineCap!=e.lineCap&&(i.lineCap=o.lineCap=e.lineCap),si&&!Z(i.lineDash,e.lineDash)&&o.setLineDash(i.lineDash=e.lineDash),i.lineJoin!=e.lineJoin&&(i.lineJoin=o.lineJoin=e.lineJoin),i.lineWidth!=e.lineWidth&&(i.lineWidth=o.lineWidth=e.lineWidth),i.miterLimit!=e.miterLimit&&(i.miterLimit=o.miterLimit=e.miterLimit),i.strokeStyle!=e.strokeStyle&&(i.strokeStyle=o.strokeStyle=e.strokeStyle)):(o.lineCap=e.lineCap,si&&o.setLineDash(e.lineDash),o.lineJoin=e.lineJoin,o.lineWidth=e.lineWidth,o.miterLimit=e.miterLimit,o.strokeStyle=e.strokeStyle,t.R={lineCap:e.lineCap,lineDash:e.lineDash,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}function qs(t,e){Ls.call(this,0,e),this.i=Po(),this.b=this.i.canvas,this.b.style.width="100%",this.b.style.height="100%",this.b.style.display="block",this.b.className="ol-unselectable",t.insertBefore(this.b,t.childNodes[0]||null),this.a=!0,this.f=ms()}function Js(t,e,o){var i,r,n,s,a,p=t.o,h=t.i;oo(p,e)&&(i=o.extent,r=o.pixelRatio,n=o.viewState.rotation,s=o.viewState,a=o.pixelRatio/s.resolution,t=js(t.f,t.b.width/2,t.b.height/2,a,-a,-s.rotation,-s.center[0],-s.center[1]),p.b(new Ds(e,new Vs(h,r,i,t,n),o,h,null)))}(r=Xs.prototype).zb=function(){},r.rd=function(){},r.Zb=function(){},r.te=function(){},r.ue=function(){},r.mc=function(){},r.nc=function(){},r.oc=function(){},r.pc=function(){},r.qc=function(){},r.rc=function(){},r.yc=function(){},r.Ma=function(){},r.Ub=function(){},r.Cb=function(){},e(Vs,Xs),(r=Vs.prototype).Zb=function(t){var e,o,i;Ot(this.c,t.G())&&((this.a||this.b)&&(this.a&&Ys(this,this.a),this.b&&Hs(this,this.b),e=this.S,o=this.v,o=(e=(i=t.ga())?gr(i,0,i.length,t.qa(),e,o):null)[2]-e[0],i=e[3]-e[1],o=Math.sqrt(o*o+i*i),(i=this.i).beginPath(),i.arc(e[0],e[1],o,0,2*Math.PI),this.a&&i.fill(),this.b)&&i.stroke(),""!==this.Ia)&&Zs(this,t.wa(),2,2)},r.rd=function(t){this.Ma(t.Fa(),t.Ga()),this.Ub(t.Y()),this.Cb(t.Na())},r.zb=function(t){switch(t.U()){case"Point":this.qc(t);break;case"LineString":this.mc(t);break;case"Polygon":this.rc(t);break;case"MultiPoint":this.oc(t);break;case"MultiLineString":this.nc(t);break;case"MultiPolygon":this.pc(t);break;case"GeometryCollection":this.ue(t);break;case"Circle":this.Zb(t)}},r.te=function(t,e){(t=(0,e.Za)(t))&&Ot(this.c,t.G())&&(this.rd(e),this.zb(t))},r.ue=function(t){for(var e=0,o=(t=t.a).length;e<o;++e)this.zb(t[e])},r.qc=function(t){var e=t.ga();t=t.qa(),this.M&&Ws(this,e,e.length),""!==this.Ia&&Zs(this,e,e.length,t)},r.oc=function(t){var e=t.ga();t=t.qa(),this.M&&Ws(this,e,e.length),""!==this.Ia&&Zs(this,e,e.length,t)},r.mc=function(t){var e,o;Ot(this.c,t.G())&&(this.b&&(Hs(this,this.b),e=this.i,o=t.ga(),e.beginPath(),Ks(this,o,0,o.length,t.qa(),!1),e.stroke()),""!==this.Ia)&&Zs(this,t=jl(t),2,2)},r.nc=function(t){var e=t.G();if(Ot(this.c,e)){if(this.b){Hs(this,this.b);for(var e=this.i,o=t.ga(),i=0,r=t.Bb(),n=t.qa(),s=(e.beginPath(),0),a=r.length;s<a;++s)i=Ks(this,o,i,r[s],n,!1);e.stroke()}""!==this.Ia&&Zs(this,t=Cl(t),t.length,2)}},r.rc=function(t){var e;Ot(this.c,t.G())&&((this.b||this.a)&&(this.a&&Ys(this,this.a),this.b&&Hs(this,this.b),(e=this.i).beginPath(),zs(this,t.ec(),0,t.Bb(),t.qa()),this.a&&e.fill(),this.b)&&e.stroke(),""!==this.Ia)&&Zs(this,t=zr(t),2,2)},r.pc=function(t){if(Ot(this.c,t.G())){if(this.b||this.a){this.a&&Ys(this,this.a),this.b&&Hs(this,this.b);for(var e=this.i,o=Il(t),i=0,r=t.c,n=t.qa(),s=(e.beginPath(),0),a=r.length;s<a;++s)i=zs(this,o,i,r[s],n);this.a&&e.fill(),this.b&&e.stroke()}""!==this.Ia&&Zs(this,t=Rl(t),t.length,2)}},r.Ma=function(t,e){var o,i,r,n,s;t?(t=t.b,this.a={fillStyle:Mo(t||Os)}):this.a=null,e?(t=e.a,o=e.f,i=e.i,r=e.g,n=e.j,s=e.c,e=e.o,this.b={lineCap:void 0!==o?o:"round",lineDash:i||Us,lineDashOffset:r||0,lineJoin:void 0!==n?n:"round",lineWidth:this.u*(void 0!==s?s:1),miterLimit:void 0!==e?e:10,strokeStyle:Mo(t||Gs)}):this.b=null},r.Ub=function(t){var e,o,i,r;t?(e=t.Hc(),o=t.Y(1),i=t.Oc(),r=t.ic(),this.D=e[0],this.C=e[1],this.B=r[1],this.M=o,this.l=t.f,this.T=i[0],this.na=i[1],this.fa=t.l,this.fb=t.g,this.f=t.a,this.pa=t.v,this.oa=r[0]):this.M=null},r.Cb=function(t){var e,o,i,r,n,s,a,p;t?((e=t.Fa())?(e=e.b,this.g={fillStyle:Mo(e||Os)}):this.g=null,(a=t.Ga())?(e=a.a,o=a.f,i=a.i,r=a.g,n=a.j,s=a.c,a=a.o,this.o={lineCap:void 0!==o?o:"round",lineDash:i||Us,lineDashOffset:r||0,lineJoin:void 0!==n?n:"round",lineWidth:void 0!==s?s:1,miterLimit:void 0!==a?a:10,strokeStyle:Mo(e||Gs)}):this.o=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,t=t.j,this.ra={font:void 0!==e?e:"10px sans-serif",textAlign:void 0!==p?p:"center",textBaseline:void 0!==t?t:"middle"},this.Ia=void 0!==a?a:"",this.Jb=void 0!==o?this.u*o:0,this.va=void 0!==i?this.u*i:0,this.Sa=void 0!==r&&r,this.$a=void 0!==n?n:0,this.j=this.u*(void 0!==s?s:1)):this.Ia=""},e(qs,Ls),qs.prototype.U=function(){return"canvas"},qs.prototype.Jg=function(t){if(t){for(var e=this.i,o=t.pixelRatio,i=Math.round(t.size[0]*o),r=Math.round(t.size[1]*o),n=(this.b.width!=i||this.b.height!=r?(this.b.width=i,this.b.height=r):e.clearRect(0,0,i,r),o=t.viewState.rotation,Rs(t),Js(this,"precompose",t),t.layerStatesArray),i=(K(n),o&&(e.save(),Bs(e,o,i/2,r/2)),t.viewState.resolution),r=0,s=n.length;r<s;++r){var a=n[r],p=Ns(this,p=a.layer);gs(a,i)&&"ready"==a.yj&&p.sd(t,a)&&p.S(t,a,e)}o&&e.restore(),Js(this,"postcompose",t),this.a||(this.b.style.display="",this.a=!0),Fs(this,t),t.postRenderFunctions.push(Is)}else this.a&&(this.b.style.display="none",this.a=!1)},qs.prototype.Di=function(t,e,o,i,r,n){var s=e.viewState.resolution,a=e.layerStatesArray,p=a.length;for(t=Ps(e.pixelToCoordinateTransform,t.slice()),--p;0<=p;--p){var h=a[p],l=h.layer;if(gs(h,s)&&r.call(n,l)&&(h=Ns(this,l).u(t,e,o,i)))return h}};var _s=["Polygon","Circle","LineString","Image","Text"];function $s(){}function Qs(t){this.b=t}function ta(t){this.b=t}function ea(t){this.b=t}function oa(){this.b="precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"}e(ta,Qs),ta.prototype.U=function(){return 35632},e(ea,Qs),ea.prototype.U=function(){return 35633},e(oa,ta);var ia=new oa;function ra(){this.b="varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;if(f==0.0){offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}"}e(ra,ea);var na=new ra;function sa(t,e){this.B=t.getUniformLocation(e,"n"),this.oa=t.getUniformLocation(e,"k"),this.c=t.getUniformLocation(e,"j"),this.f=t.getUniformLocation(e,"i"),this.a=t.getUniformLocation(e,"m"),this.ra=t.getUniformLocation(e,"l"),this.i=t.getUniformLocation(e,"h"),this.I=t.getUniformLocation(e,"p"),this.R=t.getUniformLocation(e,"o"),this.j=t.getAttribLocation(e,"f"),this.b=t.getAttribLocation(e,"e"),this.S=t.getAttribLocation(e,"g")}function aa(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pa(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}function ha(t,e){this.origin=Lt(e),this.xb=ms(),this.Sa=ms(),this.$a=ms(),this.Jb=aa(),this.b=[],this.o=null,this.i=[],this.f=[],this.a=[],this.l=null,this.g=void 0}function la(t,e,o,i){t.drawElements(4,i-o,e.g?5125:5123,o*(e.g?4:2))}e(ha,Xs),ha.prototype.La=function(t,e,o,i,r,n,s,a,p,h,l){var u,c,f,y,g,d,v,b,m,w=t.b,x=(this.g&&(u=w.isEnabled(w.STENCIL_TEST),c=w.getParameter(w.STENCIL_FUNC),f=w.getParameter(w.STENCIL_VALUE_MASK),y=w.getParameter(w.STENCIL_REF),g=w.getParameter(w.STENCIL_WRITEMASK),d=w.getParameter(w.STENCIL_FAIL),v=w.getParameter(w.STENCIL_PASS_DEPTH_PASS),b=w.getParameter(w.STENCIL_PASS_DEPTH_FAIL),w.enable(w.STENCIL_TEST),w.clear(w.STENCIL_BUFFER_BIT),w.stencilMask(255),w.stencilFunc(w.ALWAYS,1,255),w.stencilOp(w.KEEP,w.KEEP,w.REPLACE),this.g.La(t,e,o,i,r,n,s,a,p,h,l),w.stencilMask(0),w.stencilFunc(w.NOTEQUAL,1,255)),Ea(t,34962,this.l),Ea(t,34963,this.o),n=this.rf(w,t,r,n),ws(this.xb));return Es(x,2/(o*r[0]),2/(o*r[1])),As(x,-i),Ts(x,-(e[0]-this.origin[0]),-(e[1]-this.origin[1])),Es(e=ws(this.$a),2/r[0],2/r[1]),r=ws(this.Sa),i&&As(r,-i),w.uniformMatrix4fv(n.i,!1,pa(this.Jb,x)),w.uniformMatrix4fv(n.f,!1,pa(this.Jb,e)),w.uniformMatrix4fv(n.c,!1,pa(this.Jb,r)),w.uniform1f(n.a,s),p?m=t=h?this.ve(w,t,a,p,l):(w.clear(w.COLOR_BUFFER_BIT|w.DEPTH_BUFFER_BIT),this.Od(w,t,a,!0),(t=p(null))||void 0):this.Od(w,t,a,!1),this.sf(w,n),this.g&&(u||w.disable(w.STENCIL_TEST),w.clear(w.STENCIL_BUFFER_BIT),w.stencilFunc(c,y,f),w.stencilMask(g),w.stencilOp(d,b,v)),m};var ua=[0,0,0,1],ca=[],fa=[0,0,0,1];function ya(t,e,o,i,r,n){return(t=(o-t)*(n-e)-(r-t)*(i-e))<=ga&&-ga<=t?void 0:0<t}var ga=Number.EPSILON||2220446049250313e-31;function da(t){this.b=void 0!==t?t:[],this.a=va}var va=35044;function ba(t,e){ha.call(this,0,e),this.v=null,this.j=[],this.u=[],this.S=0,this.c={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,s:!1}}function ma(t,e,o,i){e.uniform4fv(t.v.R,o),e.uniform1f(t.v.oa,i)}function wa(){this.b="precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"}e(ba,ha),(r=ba.prototype).Zb=function(t,e){var o=t.pd(),i=t.qa();if(o){this.i.push(this.b.length),this.f.push(e),this.c.s&&(this.u.push(this.b.length),this.c.s=!1),this.S=o,t=dr(t=t.ga(),0,2,i,-this.origin[0],-this.origin[1]),e=this.a.length;for(var o=this.b.length,r=e/4,n=0;n<2;n+=i)this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=0,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=1,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=2,this.a[e++]=this.S,this.a[e++]=t[n],this.a[e++]=t[n+1],this.a[e++]=3,this.a[e++]=this.S,this.b[o++]=r,this.b[o++]=r+1,this.b[o++]=r+2,this.b[o++]=r+2,this.b[o++]=r+3,this.b[o++]=r,r+=4}else this.c.s&&(this.j.pop(),this.j.length)&&(i=this.j[this.j.length-1],this.c.fillColor=i[0],this.c.strokeColor=i[1],this.c.lineWidth=i[2],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.u.length&&0<this.j.length&&(this.j=[]),this.b=this.a=null},r.Eb=function(t){var e=this.l,o=this.o;return function(){Ta(t,e),Ta(t,o)}},r.rf=function(t,e,o,i){var r,n=La(e,ia,na);return this.v?r=this.v:this.v=r=new sa(t,n),e.Qc(n),t.enableVertexAttribArray(r.b),t.vertexAttribPointer(r.b,2,5126,!1,16,0),t.enableVertexAttribArray(r.j),t.vertexAttribPointer(r.j,1,5126,!1,16,8),t.enableVertexAttribArray(r.S),t.vertexAttribPointer(r.S,1,5126,!1,16,12),t.uniform2fv(r.I,o),t.uniform1f(r.ra,i),r},r.sf=function(t,e){t.disableVertexAttribArray(e.b),t.disableVertexAttribArray(e.j),t.disableVertexAttribArray(e.S)},r.Od=function(t,e,o){if(Zt(o)){var i=this.i[this.i.length-1];for(o=this.u.length-1;0<=o;--o){var r=this.u[o],n=this.j[o];t.uniform4fv(this.v.B,n[0]),ma(this,t,n[1],n[2]),la(t,e,r,i),i=r}}else for(var s=this.i.length-2,n=i=this.i[s+1],r=this.u.length-1;0<=r;--r){var a=this.j[r];for(t.uniform4fv(this.v.B,a[0]),ma(this,t,a[1],a[2]),a=this.u[r];0<=s&&this.i[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<o;m+=i){var w=e[m]-t.origin[0],x=e[m+1]-t.origin[1],S=b/8,M=-y*r,P=-y*(s-n);t.a[b++]=w,t.a[b++]=x,t.a[b++]=M*d-P*f,t.a[b++]=M*f+P*d,t.a[b++]=l/p,t.a[b++]=(u+s)/a,t.a[b++]=h,t.a[b++]=c,M=y*(g-r),P=-y*(s-n),t.a[b++]=w,t.a[b++]=x,t.a[b++]=M*d-P*f,t.a[b++]=M*f+P*d,t.a[b++]=(l+g)/p,t.a[b++]=(u+s)/a,t.a[b++]=h,t.a[b++]=c,M=y*(g-r),P=y*n,t.a[b++]=w,t.a[b++]=x,t.a[b++]=M*d-P*f,t.a[b++]=M*f+P*d,t.a[b++]=(l+g)/p,t.a[b++]=u/a,t.a[b++]=h,t.a[b++]=c,M=-y*r,P=y*n,t.a[b++]=w,t.a[b++]=x,t.a[b++]=M*d-P*f,t.a[b++]=M*f+P*d,t.a[b++]=l/p,t.a[b++]=u/a,t.a[b++]=h,t.a[b++]=c,t.b[v++]=S,t.b[v++]=1+S,t.b[v++]=2+S,t.b[v++]=S,t.b[v++]=2+S,t.b[v++]=3+S}}function Da(t,e,o,i){for(var r=e.length,n=0;n<r;++n){var s=e[n],a=U(s).toString();a in o?s=o[a]:(s=Na(i,s),o[a]=s),t[n]=s}}function Oa(t,e,o){var i=e-o;return t[0]===t[i]&&t[1]===t[1+i]&&3<+e/o&&!!wr(t,0,e,o)}function Ua(){this.b="precision mediump float;varying float a;varying vec2 b;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((b.x+1.0)/2.0*o.x*p,(b.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"}e(Aa,_e),(r=Aa.prototype).ka=function(){Je(this.j);var t=this.b;if(!t.isContextLost()){for(var e in this.a)t.deleteBuffer(this.a[e].buffer);for(e in this.i)t.deleteProgram(this.i[e]);for(e in this.c)t.deleteShader(this.c[e]);t.deleteFramebuffer(this.f),t.deleteRenderbuffer(this.l),t.deleteTexture(this.v)}},r.Wo=function(){return this.b},r.Xo=function(){Vt(this.a),Vt(this.c),Vt(this.i),this.l=this.v=this.f=this.o=null},r.Yo=function(){},r.Qc=function(t){return t!=this.o&&(this.b.useProgram(t),this.o=t,!0)},e(Fa,ha),(r=Fa.prototype).Eb=function(o){var i=this.l,r=this.o,n=this.va,s=this.u,a=o.b;return function(){if(!a.isContextLost()){for(var t=0,e=n.length;t<e;++t)a.deleteTexture(n[t]);for(t=0,e=s.length;t<e;++t)a.deleteTexture(s[t])}Ta(o,i),Ta(o,r)}},r.oc=function(t,e){this.i.push(this.b.length),this.f.push(e),ka(this,e=t.ga(),e.length,t.qa())},r.qc=function(t,e){this.i.push(this.b.length),this.f.push(e),ka(this,e=t.ga(),e.length,t.qa())},r.Db=function(t){t=t.b,this.S.push(this.b.length),this.v.push(this.b.length),this.l=new da(this.a),this.o=new da(this.b);var e={};Da(this.va,this.j,e,t),Da(this.u,this.c,e,t),this.oa=this.C=this.D=void 0,this.c=this.j=null,this.I=this.ra=void 0,this.b=null,this.fb=this.fa=this.na=this.T=this.Ua=this.R=void 0,this.a=null,this.pa=void 0},r.rf=function(t,e){var o,i=La(e,xa,Ma);return this.B?o=this.B:this.B=o=new Pa(t,i),e.Qc(i),t.enableVertexAttribArray(o.b),t.vertexAttribPointer(o.b,2,5126,!1,32,0),t.enableVertexAttribArray(o.v),t.vertexAttribPointer(o.v,2,5126,!1,32,8),t.enableVertexAttribArray(o.C),t.vertexAttribPointer(o.C,2,5126,!1,32,16),t.enableVertexAttribArray(o.u),t.vertexAttribPointer(o.u,1,5126,!1,32,24),t.enableVertexAttribArray(o.D),t.vertexAttribPointer(o.D,1,5126,!1,32,28),o},r.sf=function(t,e){t.disableVertexAttribArray(e.b),t.disableVertexAttribArray(e.v),t.disableVertexAttribArray(e.C),t.disableVertexAttribArray(e.u),t.disableVertexAttribArray(e.D)},r.Od=function(t,e,o,i){var r=i?this.u:this.va;if(i=i?this.v:this.S,Zt(o))for(var n=r.length,s=o=0;o<n;++o){t.bindTexture(3553,r[o]);var a=i[o];la(t,e,s,a),s=a}else for(s=n=0,a=r.length;s<a;++s){t.bindTexture(3553,r[s]);for(var p=0<s?i[s-1]:0,h=i[s],l=p;n<this.i.length&&this.i[n]<=h;){p=void 0!==o[U(this.f[n]).toString()]?(l!==p&&la(t,e,l,p),l=n===this.i.length-1?h:this.i[n+1]):n===this.i.length-1?h:this.i[n+1];n++}l!==p&&la(t,e,l,p)}},r.ve=function(t,e,o,i,r){for(var n=this.i.length-1,s=this.u.length-1;0<=s;--s){t.bindTexture(3553,this.u[s]);for(var a=0<s?this.v[s-1]:0,p=this.v[s];0<=n&&this.i[n]>=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;u<o;u+=i){var c,f=r/7,y=g,g=c||[e[u],e[u+1]];if(u){if(u===o-i){p?c=d:(r=Ka(t,y=y||[0,0],g,[0,0],l*_a*(a||1),r),r=Ka(t,y,g,[0,0],-l*_a*(a||1),r),t.b[n++]=f,t.b[n++]=h-1,t.b[n++]=h,t.b[n++]=h,t.b[n++]=f+1,t.b[n++]=f,a&&(r=Ka(t,y,g,[0,0],l*Qa*a,r),r=Ka(t,y,g,[0,0],-l*Qa*a,r),t.b[n++]=f+2,t.b[n++]=f,t.b[n++]=f+1,t.b[n++]=f+1,t.b[n++]=f+3,t.b[n++]=f+2));break}c=[e[u+i],e[u+i+1]]}else{if(c=[e[u+i],e[u+i+1]],+o==2*i&&Z(g,c))break;if(!p){a&&(r=Ka(t,[0,0],g,c,l*$a*a,r),r=Ka(t,[0,0],g,c,-l*$a*a,r),t.b[n++]=f+2,t.b[n++]=f,t.b[n++]=f+1,t.b[n++]=f+1,t.b[n++]=f+3,t.b[n++]=f+2),r=Ka(t,[0,0],g,c,l*Ja*(a||1),r),h=(r=Ka(t,[0,0],g,c,-l*Ja*(a||1),r))/7-1;continue}var y=[e[o-2*i],e[o-2*i+1]],d=c}var v=ya(y[0],y[1],g[0],g[1],c[0],c[1])?-1:1,r=Ka(t,y,g,c,v*tp*(s||1),r);r=Ka(t,y,g,c,v*ep*(s||1),r),r=Ka(t,y,g,c,-v*op*(s||1),r),0<u&&(t.b[n++]=f,t.b[n++]=h-1,t.b[n++]=h,t.b[n++]=f+2,t.b[n++]=f,t.b[n++]=0<l*v?h:h-1),t.b[n++]=f,t.b[n++]=f+2,t.b[n++]=f+1,h=f+2,l=v,s&&(r=Ka(t,y,g,c,v*ip*s,r),t.b[n++]=f+1,t.b[n++]=f+3,t.b[n++]=f)}p&&(f=f||r/7,r=Ka(t,y,g,c,(v=Vr([y[0],y[1],g[0],g[1],c[0],c[1]],0,6,2)?1:-1)*tp*(s||1),r),Ka(t,y,g,c,-v*op*(s||1),r),t.b[n++]=f,t.b[n++]=h-1,t.b[n++]=h,t.b[n++]=f+1,t.b[n++]=f,t.b[n++]=0<l*v?h:h-1)}function Ka(t,e,o,i,r,n){return t.a[n++]=e[0],t.a[n++]=e[1],t.a[n++]=o[0],t.a[n++]=o[1],t.a[n++]=i[0],t.a[n++]=i[1],t.a[n++]=r,n}function za(t,e,o,i){return!((o-=e)<2*i||o===2*i&&Z([t[e],t[e+1]],[t[e+i],t[e+i+1]]))}function Ya(t,e,o,i){var r;if(Oa(e,e.length,i)||(e.push(e[0]),e.push(e[1])),Za(t,e,e.length,i),o.length)for(e=0,r=o.length;e<r;++e)Oa(o[e],o[e].length,i)||(o[e].push(o[e][0]),o[e].push(o[e][1])),Za(t,o[e],o[e].length,i)}function Ha(t,e,o){o=void 0===o?t.b.length:o,t.i.push(o),t.f.push(e),t.c.s&&(t.j.push(o),t.c.s=!1)}function qa(t,e,o,i,r){e.uniform4fv(t.v.B,o),e.uniform1f(t.v.oa,i),e.uniform1f(t.v.R,r)}e(Wa,ha),(r=Wa.prototype).mc=function(t,e){var o=t.ga();t=t.qa(),za(o,0,o.length,t)&&(o=dr(o,0,o.length,t,-this.origin[0],-this.origin[1]),this.c.s&&(this.j.push(this.b.length),this.c.s=!1),this.i.push(this.b.length),this.f.push(e),Za(this,o,o.length,t))},r.nc=function(t,e){var o=this.b.length,i=t.Bb(),r=(i.unshift(0),t.ga());if(t=t.qa(),1<i.length)for(var n,s=1,a=i.length;s<a;++s)za(r,i[s-1],i[s],t)&&Za(this,n=dr(r,i[s-1],i[s],t,-this.origin[0],-this.origin[1]),n.length,t);this.b.length>o&&(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<this.u.length&&(this.u=[]),this.b=this.a=null},r.Eb=function(t){var e=this.l,o=this.o;return function(){Ta(t,e),Ta(t,o)}},r.rf=function(t,e,o,i){var r,n=La(e,Ga,Xa);return this.v?r=this.v:this.v=r=new Va(t,n),e.Qc(n),t.enableVertexAttribArray(r.o),t.vertexAttribPointer(r.o,2,5126,!1,28,0),t.enableVertexAttribArray(r.b),t.vertexAttribPointer(r.b,2,5126,!1,28,8),t.enableVertexAttribArray(r.l),t.vertexAttribPointer(r.l,2,5126,!1,28,16),t.enableVertexAttribArray(r.g),t.vertexAttribPointer(r.g,1,5126,!1,28,24),t.uniform2fv(r.I,o),t.uniform1f(r.ra,i),r},r.sf=function(t,e){t.disableVertexAttribArray(e.o),t.disableVertexAttribArray(e.b),t.disableVertexAttribArray(e.l),t.disableVertexAttribArray(e.g)},r.Od=function(t,e,o,i){var r=t.getParameter(t.DEPTH_FUNC),n=t.getParameter(t.DEPTH_WRITEMASK);if(i||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Zt(o)){var s=this.i[this.i.length-1];for(o=this.j.length-1;0<=o;--o){var a=this.j[o],p=this.u[o];qa(this,t,p[0],p[1],p[2]),la(t,e,a,s),t.clear(t.DEPTH_BUFFER_BIT),s=a}}else for(var h=this.i.length-2,p=s=this.i[h+1],a=this.j.length-1;0<=a;--a){var l=this.u[a];for(qa(this,t,l[0],l[1],l[2]),l=this.j[a];0<=h&&this.i[h]>=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<e?-1:e<t?1:0}function Sp(t,e){if(!(this instanceof Sp))return new Sp(t,e);this.Hf=Math.max(4,t||9),this.fh=Math.max(2,Math.ceil(.4*this.Hf)),e&&this.ek(e),this.clear()}function Mp(t,e){Pp(t,0,t.children.length,e,t)}function Pp(t,e,o,i,r){(r=r||Ip(null)).ca=1/0,r.da=1/0,r.$=-1/0,r.ia=-1/0;for(var n;e<o;e++)n=t.children[e],Ap(r,t.ib?i(n):n);return r}function Ap(t,e){t.ca=Math.min(t.ca,e.ca),t.da=Math.min(t.da,e.da),t.$=Math.max(t.$,e.$),t.ia=Math.max(t.ia,e.ia)}function Ep(t,e){return t.ca-e.ca}function Tp(t,e){return t.da-e.da}function jp(t){return(t.$-t.ca)*(t.ia-t.da)}function Cp(t){return t.$-t.ca+(t.ia-t.da)}function Lp(t,e){return t.ca<=e.ca&&t.da<=e.da&&e.$<=t.$&&e.ia<=t.ia}function Rp(t,e){return e.ca<=t.$&&e.da<=t.ia&&e.$>=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;r<n&&!(i=e.call(o,t[r]));r++);return i}function Bp(t,e){ha.call(this,0,e),this.g=new Wa(0,e),this.v=null,this.u=[],this.c=[],this.j={fillColor:null,s:!1}}function Xp(t,e,o,i){var r=new lp,n=new Fp;if(e=Vp(t,e,i,r,n,!0),o.length){for(var s=[],a=0,p=o.length;a<p;++a){var h={list:new lp,$:void 0,Mg:new Fp};s.push(h),h.$=Vp(t,o[a],i,h.list,h.Mg,!1)}for(s.sort(function(t,e){return e.$[0]===t.$[0]?t.$[1]-e.$[1]:e.$[0]-t.$[0]}),a=0;a<s.length;++a){p=i=cp(o=s[a].list);do{if(_p(p,n).length){var l=!0;break}}while(i!==(p=fp(o)));l||(Wp(o,s[a].Mg,!0),function(t,e,o,i,r){for(var n=cp(t);n.W.x!==e;)n=fp(t);e=n.W,i={x:i,y:e.y,hb:-1};var s,a=1/0,p=_p({aa:e,W:i},r,!0),h=0;for(s=p.length;h<s;++h){var l,u=p[h],c=$p(e,i,u.aa,u.W,!0),f=Math.abs(e.x-c[0]);f<a&&void 0!==ya(e.x,e.y,u.aa.x,u.aa.y,u.W.x,u.W.y)&&(a=f,l={x:c[0],y:c[1],hb:-1},n=u)}if(1/0===a)return;if(p=n.W,0<a&&(n=Jp(e,l,n.W,r)).length)for(l=1/0,h=0,s=n.length;h<s;++h)a=n[h],((u=Math.atan2(e.y-a.y,i.x-a.x))<l||u===l&&a.x<p.x)&&(l=u,p=a);for(n=cp(o);n.W.x!==p.x||n.W.y!==p.y;)n=fp(o);return i={x:e.x,y:e.y,hb:e.hb,Fb:void 0},h={x:n.W.x,y:n.W.y,hb:n.W.hb,Fb:void 0},yp(t).aa=i,Hp(e,n.W,t,r),Hp(h,i,t,r),n.W=h,t.f&&t.b&&(t.i=t.b,t.a=t.b.ub),o.concat(t),1}(o,s[a].$[0],r,e[0],n)&&(n.concat(s[a].Mg),Wp(r,n,!1)))}}else Wp(r,n,!1);!function t(e,o,i){for(var r=!1,n=zp(o,i);3<o.c;)if(n){if(!Zp(e,o,i,n,r)&&!Wp(o,i,r)&&!Kp(e,o,i,!0))break}else if(!Zp(e,o,i,n,r)&&!Wp(o,i,r)&&!Kp(e,o,i)){if(!(n=zp(o,i))){n=e,s=a=cp(r=o);do{if((p=_p(s,i)).length){for(a=p[0],p=$p(s.aa,s.W,a.aa,a.W),p=Yp(n,p[0],p[1],n.a.length/2),h=new lp,l=new Fp,Hp(p,s.W,h,l),s.W=p,kp(i,[Math.min(s.aa.x,p.x),Math.min(s.aa.y,p.y),Math.max(s.aa.x,p.x),Math.max(s.aa.y,p.y)],s),s=fp(r);s!==a;)Hp(s.aa,s.W,h,l),i.remove(s),up(r),s=vp(r);Hp(a.aa,p,h,l),a.aa=p,kp(i,[Math.min(a.W.x,p.x),Math.min(a.W.y,p.y),Math.max(a.W.x,p.x),Math.max(a.W.y,p.y)],a),Wp(r,i,!1),t(n,r,i),Wp(h,l,!1),t(n,h,l);break}}while((s=fp(r))!==a);break}for(var s=2*(r=o).c,a=Array(s),p=cp(r),h=p,l=0;a[l++]=h.aa.x,a[l++]=h.aa.y,(h=fp(r))!==p;);r=!Vr(a,0,s,2),Wp(o,i,r)}3===o.c&&(n=e.b.length,e.b[n++]=dp(o).aa.hb,e.b[n++]=vp(o).aa.hb,e.b[n++]=yp(o).aa.hb)}(t,r,n)}function Vp(t,e,o,i,r,n){var s,a=t.a.length/2,p=[],h=[];if(n===Vr(e,0,e.length,o))for(var l=s=Yp(t,e[0],e[1],a++),u=(n=e[0],e[1]),c=o,f=e.length;c<f;c+=o){var 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}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<e.c);return u}function Kp(t,e,o,i){var r=cp(e),n=(fp(e),r),s=fp(e),a=!1;do{var p=$p(n.aa,n.W,s.aa,s.W,i);if(p){var a=t.b.length,h=t.a.length/2,l=gp(e),u=(up(e),o.remove(l),l===r);if(i?(u=p[0]===n.aa.x&&p[1]===n.aa.y?(gp(e),p=n.aa,s.aa=p,o.remove(n),u||n===r):(p=s.W,n.W=p,o.remove(s),u||s===r),up(e)):(p=Yp(t,p[0],p[1],h),n.W=p,s.aa=p,kp(o,[Math.min(n.aa.x,n.W.x),Math.min(n.aa.y,n.W.y),Math.max(n.aa.x,n.W.x),Math.max(n.aa.y,n.W.y)],n),kp(o,[Math.min(s.aa.x,s.W.x),Math.min(s.aa.y,s.W.y),Math.max(s.aa.x,s.W.x),Math.max(s.aa.y,s.W.y)],s)),t.b[a++]=l.aa.hb,t.b[a++]=l.W.hb,t.b[a++]=p.hb,a=!0,u)break}}while(n=dp(e),s=fp(e),n!==r);return a}function zp(t,e){var o=cp(t),i=o;do{if(_p(i,e).length)return!1}while((i=fp(t))!==o);return!0}function Yp(t,e,o,i){var r=t.a.length;return{x:t.a[r++]=e,y:t.a[+r]=o,hb:i,Fb:void 0}}function Hp(t,e,o,i){var r,n={aa:t,W:e},s={ub:void 0,next:void 0,data:n},a=o.b;return a?(r=a.next,s.ub=a,s.next=r,a.next=s,r&&(r.ub=s),a===o.a&&(o.a=s)):(o.i=s,o.a=s,o.f&&((s.next=s).ub=s)),o.b=s,o.c++,i&&i.Ca([Math.min(t.x,e.x),Math.min(t.y,e.y),Math.max(t.x,e.x),Math.max(t.y,e.y)],n),n}function qp(t,e,o,i){vp(o)===e&&(up(o),t.W=e.W,i.remove(e),kp(i,[Math.min(t.aa.x,t.W.x),Math.min(t.aa.y,t.W.y),Math.max(t.aa.x,t.W.x),Math.max(t.aa.y,t.W.y)],t))}function Jp(t,e,o,i,r){var n,s,a=[],p=Op(i,[Math.min(t.x,e.x,o.x),Math.min(t.y,e.y,o.y),Math.max(t.x,e.x,o.x),Math.max(t.y,e.y,o.y)]);for(i=0,n=p.length;i<n;++i)for(s in p[i]){var h=p[i][s];"object"!=typeof h||r&&!h.Fb||h.x===t.x&&h.y===t.y||h.x===e.x&&h.y===e.y||h.x===o.x&&h.y===o.y||-1!==a.indexOf(h)||!Dr([t.x,t.y,e.x,e.y,o.x,o.y],0,6,2,h.x,h.y)||a.push(h)}return a}function _p(t,e,o){for(var i=t.aa,r=t.W,n=[],s=0,a=(e=Op(e,[Math.min(i.x,r.x),Math.min(i.y,r.y),Math.max(i.x,r.x),Math.max(i.y,r.y)])).length;s<a;++s){var p=e[s];t!==p&&(o||p.aa!==r||p.W!==i)&&$p(i,r,p.aa,p.W,o)&&n.push(p)}return n}function $p(t,e,o,i,r){var n=(i.y-o.y)*(e.x-t.x)-(i.x-o.x)*(e.y-t.y);if(n&&(i=((i.x-o.x)*(t.y-o.y)-(i.y-o.y)*(t.x-o.x))/n,o=((e.x-t.x)*(t.y-o.y)-(e.y-t.y)*(t.x-o.x))/n,!r&&ga<i&&i<1-ga&&ga<o&&o<1-ga||r&&0<=i&&i<=1&&0<=o&&o<=1))return[t.x+i*(e.x-t.x),t.y+i*(e.y-t.y)]}function Qp(t,e,o,i,r){var n;return void 0!==e.Fb&&void 0!==i.Fb&&(n=(o.x-i.x)*(e.y-i.y)>(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;o<e;o++)t=i[o].apply(this,arguments);return t}}function ih(t,e,o,i,r,n,s,a,p,h,l){for(var u=rh,c=Object.keys(t.a).map(Number),f=(c.sort(function(t,e){return e-t}),0),y=c.length;f<y;++f)for(var g=t.a[c[f].toString()],d=_s.length-1;0<=d;--d){var v=g[_s[d]];if(void 0!==v&&(v=v.La(e,o,i,r,u,n,s,a,p,h,l)))return v}}yi=mp.$d=mp.$d||{},bp=function t(e,o,i,r,n){for(i=i||0,r=r||e.length-1,n=n||xp;i<r;){var s,a,p,h;for(600<r-i&&(s=r-i+1,a=o-i+1,h=Math.log(s),p=.5*Math.exp(2*h/3),h=.5*Math.sqrt(h*p*(s-p)/s)*(a-s/2<0?-1:1),t(e,o,Math.max(i,Math.floor(o-a*p/s+h)),Math.min(r,Math.floor(o+(s-a)*p/s+h)),n)),s=e[o],p=r,wp(e,a=i,o),0<n(e[r],s)&&wp(e,i,r);a<p;){for(wp(e,a,p),a++,p--;n(e[a],s)<0;)a++;for(;0<n(e[p],s);)p--}0===n(e[i],s)?wp(e,i,p):wp(e,++p,r),p<=o&&(i=p+1),o<=p&&(r=p-1)}},Sp.prototype={all:function(){return this.$g(this.data,[])},search:function(t){var e=this.data,o=[],i=this.wb;if(Rp(t,e))for(var r,n,s,a,p=[];e;){for(r=0,n=e.children.length;r<n;r++)s=e.children[r],Rp(t,a=e.ib?i(s):s)&&(e.ib?o.push(s):Lp(t,a)?this.$g(s,o):p.push(s));e=p.pop()}return o},load:function(t){if(t&&t.length)if(t.length<this.fh)for(var e=0,o=t.length;e<o;e++)this.Ca(t[e]);else t=this.bh(t.slice(),0,t.length-1,0),this.data.children.length?this.data.height===t.height?this.hh(this.data,t):(this.data.height<t.height&&(e=this.data,this.data=t,t=e),this.eh(t,this.data.height-t.height-1,!0)):this.data=t;return this},Ca:function(t){return t&&this.eh(t,this.data.height-1),this},clear:function(){return this.data=Ip([]),this},remove:function(t,e){if(t)for(var o,i,r,n=this.data,s=this.wb(t),a=[],p=[];n||a.length;){if(n||(n=a.pop(),i=a[a.length-1],o=p.pop(),r=!0),n.ib){t:{var h=t,l=n.children,u=e;if(u){for(var c=0;c<l.length;c++)if(u(h,l[c])){h=c;break t}h=-1}else h=l.indexOf(h)}if(-1!==h){n.children.splice(h,1),a.push(n),this.ck(a);break}}r||n.ib||!Lp(n,s)?i?(o++,n=i.children[o],r=!1):n=null:(a.push(n),p.push(o),n=(i=n).children[o=0])}return this},wb:function(t){return t},Lf:Ep,Mf:Tp,toJSON:function(){return this.data},$g:function(t,e){for(var o=[];t;)t.ib?e.push.apply(e,t.children):o.push.apply(o,t.children),t=o.pop();return e},bh:function(t,e,o,i){var r,n,s=o-e+1,a=this.Hf;if(s<=a)Mp(r=Ip(t.slice(e,o+1)),this.wb);else{for(i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(r=Ip([])).ib=!1,r.height=i,Np(t,e,o,a=(s=Math.ceil(s/a))*Math.ceil(Math.sqrt(a)),this.Lf);e<=o;e+=a){var p=Math.min(e+a-1,o);for(Np(t,e,p,s,this.Mf),n=e;n<=p;n+=s){var h=Math.min(n+s-1,p);r.children.push(this.bh(t,n,h,i-1))}}Mp(r,this.wb)}return r},bk:function(t,e,o,i){for(var r,n,s,a,p,h,l,u;i.push(e),!e.ib&&i.length-1!==o;){for(l=u=1/0,r=0,n=e.children.length;r<n;r++)p=jp(s=e.children[r]),(h=(Math.max(s.$,t.$)-Math.min(s.ca,t.ca))*(Math.max(s.ia,t.ia)-Math.min(s.da,t.da))-p)<u?(u=h,l=p<l?p:l,a=s):h===u&&p<l&&(l=p,a=s);e=a||e.children[0]}return e},eh:function(t,e,o){var i=this.wb,i=(o=o?t:i(t),[]),r=this.bk(o,this.data,e,i);for(r.children.push(t),Ap(r,o);0<=e&&i[e].children.length>this.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);h<i?(i=h,n=r,s=a<s?a:s):h===i&&a<s&&(s=a,n=r)}return n},$j:function(t,e,o){var i=t.ib?this.Lf:Ep,r=t.ib?this.Mf:Tp;this.ah(t,e,o,i)<(e=this.ah(t,e,o,r))&&t.children.sort(i)},ah:function(t,e,o,i){t.children.sort(i);for(var r=Pp(t,0,e,i=this.wb),n=Pp(t,o-e,o,i),s=Cp(r)+Cp(n),a=e;a<o-e;a++){var p=t.children[a];Ap(r,t.ib?i(p):p),s+=Cp(r)}for(a=o-e-1;e<=a;a--)p=t.children[a],Ap(n,t.ib?i(p):p),s+=Cp(n);return s},Zj:function(t,e,o){for(;0<=o;o--)Ap(e[o],t)},ck:function(t){for(var e,o=t.length-1;0<=o;o--)0===t[o].children.length?0<o?(e=t[o-1].children).splice(e.indexOf(t[o]),1):this.clear():Mp(t[o],this.wb)},ek:function(t){var e=["return a"," - b",";"];this.Lf=new Function("a","b",e.join(t[0])),this.Mf=new Function("a","b",e.join(t[1])),this.wb=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},yi.default=Sp,mp.$d=mp.$d.default,(r=Fp.prototype).Ca=function(t,e){t={ca:t[0],da:t[1],$:t[2],ia:t[3],value:e},this.a.Ca(t),this.b[U(e)]=t},r.load=function(t,e){for(var o=Array(e.length),i=0,r=e.length;i<r;i++){var n=t[i],s=e[i],n={ca:n[0],da:n[1],$:n[2],ia:n[3],value:s};o[i]=n,this.b[U(s)]=n}this.a.load(o)},r.remove=function(t){t=U(t);var e=this.b[t];return delete this.b[t],null!==this.a.remove(e)},r.forEach=function(t,e){return Gp(Dp(this),t,e)},r.clear=function(){this.a.clear(),this.b={}},r.G=function(t){var e=this.a.data;return bt(e.ca,e.da,e.$,e.ia,t)},r.concat=function(t){for(var e in this.a.load(t.a.all()),t.b)this.b[0|e]=t.b[0|e]},e(Bp,ha),(r=Bp.prototype).pc=function(t,e){for(var o=t.c,i=t.qa(),r=this.b.length,n=this.g.b.length,s=(t=t.ga(),c=0),a=o.length;s<a;++s){var p=o[s];if(0<p.length){var h=dr(t,c,p[0],i,-this.origin[0],-this.origin[1]);if(h.length){for(var l,u=[],c=1,f=p.length;c<f;++c)p[c]!==p[c-1]&&(l=dr(t,p[c-1],p[c],i,-this.origin[0],-this.origin[1]),u.push(l));Ya(this.g,h,u,i),Xp(this,h,u,i)}}c=p[p.length-1]}this.b.length>r&&(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<o.length){var r=dr(t=t.ga().map(Number),0,o[0],i,-this.origin[0],-this.origin[1]);if(r.length){for(var n,s=[],a=1,p=o.length;a<p;++a)o[a]!==o[a-1]&&(n=dr(t,o[a-1],o[a],i,-this.origin[0],-this.origin[1]),s.push(n));this.i.push(this.b.length),this.f.push(e),this.j.s&&(this.c.push(this.b.length),this.j.s=!1),Ha(this.g,e),Ya(this.g,r,s,i),Xp(this,r,s,i)}}},r.Db=function(t){this.l=new da(this.a),this.o=new da(this.b),this.i.push(this.b.length),this.g.Db(t),!this.c.length&&0<this.u.length&&(this.u=[]),this.b=this.a=null},r.Eb=function(t){var e=this.l,o=this.o,i=this.g.Eb(t);return function(){Ta(t,e),Ta(t,o),i()}},r.rf=function(t,e){var o,i=La(e,np,ap);return this.v?o=this.v:this.v=o=new pp(t,i),e.Qc(i),t.enableVertexAttribArray(o.b),t.vertexAttribPointer(o.b,2,5126,!1,8,0),o},r.sf=function(t,e){t.disableVertexAttribArray(e.b)},r.Od=function(t,e,o,i){var r=t.getParameter(t.DEPTH_FUNC),n=t.getParameter(t.DEPTH_WRITEMASK);if(i||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Zt(o)){var s=this.i[this.i.length-1];for(o=this.c.length-1;0<=o;--o){var a=this.c[o],p=this.u[o];t.uniform4fv(this.v.B,p),la(t,e,a,s),s=a}}else for(var h=this.i.length-2,p=s=this.i[h+1],a=this.c.length-1;0<=a;--a){var l=this.u[a];for(t.uniform4fv(this.v.B,l),l=this.c[a];0<=h&&this.i[h]>=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<l;++h)for(var u=this.a[p[h].toString()],c=0,f=_s.length;c<f;++c){var y=u[_s[c]];void 0!==y&&y.La(t,e,o,i,r,n,s,a,void 0,!1)}},eh.prototype.Ea=function(t,e,o,i,r,n,s,a,p,h){var l,u=e.b;return u.bindFramebuffer(u.FRAMEBUFFER,ja(e)),ih(this,e,t,i,r,s,a,p,function(t){var e=new Uint8Array(4);if(u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,e),0<e[3]&&(t=h(t)))return t},!0,l=void 0!==this.c?lt(wt(t),i*this.c):l)};var rh=[1,1],nh={Circle:ba,Image:Fa,LineString:Wa,Polygon:Bp,Text:th};function sh(t,e,o,i,r,n,s){this.b=t,this.i=e,this.a=n,this.c=s,this.j=r,this.g=i,this.f=o,this.o=this.l=this.v=null}function ah(){this.c=0,this.b={},this.i=this.a=null}function ph(t,e){Ls.call(this,0,e),this.b=document.createElement("CANVAS"),this.b.style.width="100%",this.b.style.height="100%",this.b.style.display="block",this.b.className="ol-unselectable",t.insertBefore(this.b,t.childNodes[0]||null),this.S=this.D=0,this.C=Po(),this.l=!0,this.i=Qo(this.b,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.f=new Aa(this.b,this.i),d(this.b,"webglcontextlost",this.Yn,this),d(this.b,"webglcontextrestored",this.Zn,this),this.a=new ah,this.u=null,this.j=new Zi(function(t){var e=t[1],o=(t=t[2],e[0]-this.u[0]),e=e[1]-this.u[1];return 65536*Math.log(t)+Math.sqrt(o*o+e*e)/t}.bind(this),function(t){return t[0].bb()}),this.B=function(){var t;return this.j.b.length&&(Hi(this.j),hh(this,(t=Ki(this.j))[0],t[3],t[4])),!1}.bind(this),this.g=0,uh(this)}function hh(t,e,o,i){var r,n,s,a=t.i,p=e.bb();t.a.b.hasOwnProperty(p)?(t=t.a.get(p),a.bindTexture(3553,t.Ib),9729!=t.Ph&&(a.texParameteri(3553,10240,9729),t.Ph=9729),9729!=t.Rh&&(a.texParameteri(3553,10241,9729),t.Rh=9729)):(r=a.createTexture(),a.bindTexture(3553,r),0<i?(n=t.C.canvas,s=t.C,t.D!==o[0]||t.S!==o[1]?(n.width=o[0],n.height=o[1],t.D=o[0],t.S=o[1]):s.clearRect(0,0,o[0],o[1]),s.drawImage(e.Y(),i,i,o[0],o[1],0,0,o[0],o[1]),a.texImage2D(3553,0,6408,6408,5121,n)):a.texImage2D(3553,0,6408,6408,5121,e.Y()),a.texParameteri(3553,10240,9729),a.texParameteri(3553,10241,9729),a.texParameteri(3553,10242,33071),a.texParameteri(3553,10243,33071),t.a.set(p,{Ib:r,Ph:9729,Rh:9729}))}function lh(t,e,o){var i,r=t.o;oo(r,e)&&(t=t.f,i=o.viewState,r.b(new Ds(e,new sh(t,i.center,i.resolution,i.rotation,o.size,o.extent,o.pixelRatio),o,null,t)))}function uh(t){(t=t.i).activeTexture(33984),t.blendFuncSeparate(770,771,1,771),t.disable(2884),t.disable(2929),t.disable(3089),t.disable(2960)}e(sh,Xs),(r=sh.prototype).rd=function(t){this.Ma(t.Fa(),t.Ga()),this.Ub(t.Y())},r.zb=function(t){switch(t.U()){case"Point":this.qc(t,null);break;case"LineString":this.mc(t,null);break;case"Polygon":this.rc(t,null);break;case"MultiPoint":this.oc(t,null);break;case"MultiLineString":this.nc(t,null);break;case"MultiPolygon":this.pc(t,null);break;case"GeometryCollection":this.ue(t,null);break;case"Circle":this.Zb(t,null)}},r.te=function(t,e){(t=(0,e.Za)(t))&&Ot(this.a,t.G())&&(this.rd(e),this.zb(t))},r.ue=function(t){for(var e=0,o=(t=t.a).length;e<o;++e)this.zb(t[e])},r.qc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"Image");i.Ub(this.v),i.qc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.oc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"Image");i.Ub(this.v),i.oc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.mc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"LineString");i.Ma(null,this.o),i.mc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.nc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"LineString");i.Ma(null,this.o),i.nc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.rc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"Polygon");i.Ma(this.l,this.o),i.rc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.pc=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"Polygon");i.Ma(this.l,this.o),i.pc(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.Zb=function(t,e){var o=this.b,i=new eh(1,this.a).b(0,"Circle");i.Ma(this.l,this.o),i.Zb(t,e),i.Db(o),i.La(this.b,this.i,this.f,this.g,this.j,this.c,1,{},void 0,!1),i.Eb(o)()},r.Ub=function(t){this.v=t},r.Ma=function(t,e){this.l=t,this.o=e},(r=ah.prototype).clear=function(){this.c=0,this.b={},this.i=this.a=null},r.forEach=function(t,e){for(var o=this.a;o;)t.call(e,o.Yc,o.uc,this),o=o.Nb},r.get=function(t){return O(!!(t=this.b[t]),15),t!==this.i&&(t===this.a?(this.a=this.a.Nb,this.a.vd=null):(t.Nb.vd=t.vd,t.vd.Nb=t.Nb),t.Nb=null,t.vd=this.i,this.i=this.i.Nb=t),t.Yc},r.pop=function(){var t=this.a;return delete this.b[t.uc],t.Nb&&(t.Nb.vd=null),this.a=t.Nb,this.a||(this.i=null),--this.c,t.Yc},r.replace=function(t,e){this.get(t),this.b[t].Yc=e},r.set=function(t,e){O(!(t in this.b),16),e={uc:t,Nb:null,vd:this.i,Yc:e},this.i?this.i.Nb=e:this.a=e,this.i=e,this.b[t]=e,++this.c},e(ph,Ls),(r=ph.prototype).ka=function(){var e=this.i;e.isContextLost()||this.a.forEach(function(t){t&&e.deleteTexture(t.Ib)}),$e(this.f),Ls.prototype.ka.call(this)},r.xk=function(t,e){t=this.i;for(var o;1024<this.a.c-this.g;){if(o=this.a.a.Yc)t.deleteTexture(o.Ib);else{if(+this.a.a.uc==e.index)break;--this.g}this.a.pop()}},r.U=function(){return"webgl"},r.Yn=function(t){for(var e in t.preventDefault(),this.a.clear(),this.g=0,t=this.c)t[e].mg()},r.Zn=function(){uh(this),this.o.render()},r.Jg=function(t){var e=this.f,o=this.i;if(o.isContextLost())return!1;if(!t)return this.l&&(this.b.style.display="none",this.l=!1),!1;this.u=t.focus,this.a.set((-t.index).toString(),null),++this.g,lh(this,"precompose",t);for(var i=[],r=t.layerStatesArray,n=(K(r),t.viewState.resolution),s=0,a=r.length;s<a;++s){var p=r[s];gs(p,n)&&"ready"==p.yj&&Ns(this,p.layer).ng(t,p,e)&&i.push(p)}for(r=t.size[0]*t.pixelRatio,n=t.size[1]*t.pixelRatio,this.b.width==r&&this.b.height==n||(this.b.width=r,this.b.height=n),o.bindFramebuffer(36160,null),o.clearColor(0,0,0,0),o.clear(16384),o.enable(3042),o.viewport(0,0,this.b.width,this.b.height),s=0,a=i.length;s<a;++s)Ns(this,(p=i[s]).layer).Gi(t,p,e);this.l||(this.b.style.display="",this.l=!0),Rs(t),1024<this.a.c-this.g&&t.postRenderFunctions.push(this.xk.bind(this)),this.j.b.length&&(t.postRenderFunctions.push(this.B),t.animate=!0),lh(this,"postcompose",t),Fs(this,t),t.postRenderFunctions.push(Is)},r.Ea=function(t,e,o,i,r,n,s){if(this.i.isContextLost())return!1;for(var a=e.viewState,p=e.layerStatesArray,h=p.length-1;0<=h;--h){var l=p[h],u=l.layer;if(gs(l,a.resolution)&&n.call(s,u)&&(l=Ns(this,u).Ea(t,e,o,i,r)))return l}},r.Ei=function(t,e,o,i,r){if(o=!1,this.i.isContextLost())return!1;for(var n=e.viewState,s=e.layerStatesArray,a=s.length-1;0<=a;--a){var p=s[a],h=p.layer;if(gs(p,n.resolution)&&i.call(r,h)&&(o=Ns(this,h).Ue(t,e)))return!0}return o},r.Di=function(t,e,o,i,r){if(this.i.isContextLost())return!1;for(var n=e.viewState,s=e.layerStatesArray,a=s.length-1;0<=a;--a){var p=s[a],h=p.layer;if(gs(p,n.resolution)&&r.call(i,h)&&(p=Ns(this,h).lg(t,e,o,i)))return p}};var ch=["canvas","webgl"];function u(t){ro.call(this);var e=function(t){var e=null,o=(void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget),{}),i={};void 0===t.logo||"boolean"==typeof t.logo&&t.logo?i["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC"]="https://openlayers.org/":"string"==typeof(s=t.logo)?i[s]="":s instanceof HTMLElement?i[U(s).toString()]=s:s&&(O("string"==typeof s.href,44),O("string"==typeof s.src,45),i[s.src]=s.href);s=t.layers instanceof cs?t.layers:new cs({layers:t.layers}),o.layergroup=s,o.target=t.target,o.view=void 0!==t.view?t.view:new h;var r,n,s=Ls,a=(void 0!==t.renderer?(Array.isArray(t.renderer)?r=t.renderer:"string"==typeof t.renderer?r=[t.renderer]:O(!1,46),0<=r.indexOf("dom")&&(r=r.concat(ch))):r=ch,0);for(n=r.length;a<n;++a){var p=r[a];if("canvas"==p){if(ai){s=qs;break}}else if("webgl"==p&&gi){s=ph;break}}return r=void 0!==t.controls?Array.isArray(t.controls)?new ho(t.controls.slice()):(O(t.controls instanceof ho,47),t.controls):Uo(),a=void 0!==t.interactions?Array.isArray(t.interactions)?new ho(t.interactions.slice()):(O(t.interactions instanceof ho,48),t.interactions):hs(),t=void 0!==t.overlays?Array.isArray(t.overlays)?new ho(t.overlays.slice()):(O(t.overlays instanceof ho,49),t.overlays):new ho,{controls:r,interactions:a,keyboardEventTarget:e,logos:i,overlays:t,Up:s,values:o}}(t);this.Cf=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.Df=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.If=void 0!==t.pixelRatio?t.pixelRatio:ni,this.yf=e.logos,this.pa=function(){this.j=void 0,this.Sp.call(this,Date.now())}.bind(this),this.Yb=ms(),this.Jf=ms(),this.ad=0,this.I=this.R=this.T=this.g=this.c=null,this.a=document.createElement("DIV"),this.a.className="ol-viewport"+(li?" ol-touch":""),this.a.style.position="relative",this.a.style.overflow="hidden",this.a.style.width="100%",this.a.style.height="100%",this.a.style.msTouchAction="none",this.a.style.touchAction="none",this.C=document.createElement("DIV"),this.C.className="ol-overlaycontainer",this.a.appendChild(this.C),this.D=document.createElement("DIV"),this.D.className="ol-overlaycontainer-stopevent";for(var o,i="click dblclick mousedown touchstart MSPointerDown pointerdown mousewheel wheel".split(" "),r=0,n=i.length;r<n;++r)d(this.D,i[r],to);for(o in this.a.appendChild(this.D),this.Sa=new Xi(this,t.moveTolerance),bi)d(this.Sa,bi[o],this.Ih,this);this.va=e.keyboardEventTarget,this.u=null,d(this.a,"wheel",this.ld,this),d(this.a,"mousewheel",this.ld,this),this.l=e.controls,this.o=e.interactions,this.v=e.overlays,this.rg={},this.B=new e.Up(this.a,this),this.na=null,this.xb=[],this.$a=new qi(this.ql.bind(this),this.Wl.bind(this)),this.fa={},d(this,so("layergroup"),this.El,this),d(this,so("view"),this.Xl,this),d(this,so("size"),this.Tl,this),d(this,so("target"),this.Vl,this),this.H(e.values),this.l.forEach(function(t){t.setMap(this)},this),d(this.l,"add",function(t){t.element.setMap(this)},this),d(this.l,"remove",function(t){t.element.setMap(null)},this),this.o.forEach(function(t){t.setMap(this)},this),d(this.o,"add",function(t){t.element.setMap(this)},this),d(this.o,"remove",function(t){t.element.setMap(null)},this),this.v.forEach(this.kh,this),d(this.v,"add",function(t){this.kh(t.element)},this),d(this.v,"remove",function(t){var e=t.element.g;void 0!==e&&delete this.rg[e.toString()],t.element.setMap(null)},this)}function fh(t){ro.call(this),this.g=t.id,this.l=void 0===t.insertFirst||t.insertFirst,this.v=void 0===t.stopEvent||t.stopEvent,this.c=document.createElement("DIV"),this.c.className="ol-overlay-container ol-selectable",this.c.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.j=t.autoPanAnimation||{},this.o=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.a={re:"",Ie:"",nf:"",vf:"",visible:!0},this.f=null,d(this,so(vh),this.zl,this),d(this,so(bh),this.Jl,this),d(this,so(mh),this.Nl,this),d(this,so(wh),this.Pl,this),d(this,so(xh),this.Ql,this),void 0!==t.element&&this.lj(t.element),this.rj(void 0!==t.offset?t.offset:[0,0]),this.uj(void 0!==t.positioning?t.positioning:"top-left"),void 0!==t.position&&this.Ne(t.position)}function yh(t,e){var o=t.getBoundingClientRect();return[t=o.left+window.pageXOffset,o=o.top+window.pageYOffset,t+e[0],o+e[1]]}function gh(t,e){t.a.visible!==e&&(t.c.style.display=e?"":"none",t.a.visible=e)}function dh(t){var e,o,i,r,n=t.Me(),s=t.Yh();n&&n.c&&s?(s=n.Ja(s),e=n.Ob(),n=t.c.style,r=t.Dh(),o=t.Eh(),gh(t,!0),i=r[0],r=r[1],"bottom-right"==o||"center-right"==o||"top-right"==o?(""!==t.a.Ie&&(t.a.Ie=n.left=""),i=Math.round(e[0]-s[0]-i)+"px",t.a.nf!=i&&(t.a.nf=n.right=i)):(""!==t.a.nf&&(t.a.nf=n.right=""),"bottom-center"!=o&&"center-center"!=o&&"top-center"!=o||(i-=t.c.offsetWidth/2),i=Math.round(s[0]+i)+"px",t.a.Ie!=i&&(t.a.Ie=n.left=i)),"bottom-left"==o||"bottom-center"==o||"bottom-right"==o?(""!==t.a.vf&&(t.a.vf=n.top=""),s=Math.round(e[1]-s[1]-r)+"px",t.a.re!=s&&(t.a.re=n.bottom=s)):(""!==t.a.re&&(t.a.re=n.bottom=""),"center-left"!=o&&"center-center"!=o&&"center-right"!=o||(r-=t.c.offsetHeight/2),s=Math.round(s[1]+r)+"px",t.a.vf!=s&&(t.a.vf=n.top=s))):gh(t,!1)}e(u,ro),(r=u.prototype).kk=function(t){this.l.push(t)},r.lk=function(t){this.o.push(t)},r.ih=function(t){this.Kc().qd().push(t)},r.jh=function(t){this.v.push(t)},r.kh=function(t){var e=t.g;void 0!==e&&(this.rg[e.toString()]=t),t.setMap(this)},r.ka=function(){$e(this.Sa),$e(this.B),He(this.a,"wheel",this.ld,this),He(this.a,"mousewheel",this.ld,this),this.f&&(window.removeEventListener("resize",this.f,!1),this.f=void 0),this.j&&(cancelAnimationFrame(this.j),this.j=void 0),this.Le(null),ro.prototype.ka.call(this)},r.we=function(t,e,o){if(this.c)return t=this.Wa(t),this.B.Ea(t,this.c,void 0!==(o=o||{}).hitTolerance?o.hitTolerance*this.c.pixelRatio:0,e,null,o.layerFilter||cr,null)},r.Im=function(t,e,o,i,r){if(this.c)return this.B.Di(t,this.c,e,void 0!==o?o:null,i||cr,void 0!==r?r:null)},r.Yl=function(t,e){return!!this.c&&(t=this.Wa(t),this.B.Ei(t,this.c,void 0!==(e=e||{}).hitTolerance?e.hitTolerance*this.c.pixelRatio:0,e.layerFilter||cr,null))},r.Tf=function(t){return this.Wa(this.xe(t))},r.xe=function(t){var e=this.a.getBoundingClientRect();return[(t=t.changedTouches?t.changedTouches[0]:t).clientX-e.left,t.clientY-e.top]},r.ag=function(){return this.get("target")},r.jd=function(){var t=this.ag();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},r.Wa=function(t){var e=this.c;return e?Ps(e.pixelToCoordinateTransform,t.slice()):null},r.Lk=function(){return this.l},r.fl=function(){return this.v},r.el=function(t){return void 0!==(t=this.rg[t.toString()])?t:null},r.Sk=function(){return this.o},r.Kc=function(){return this.get("layergroup")},r.Xh=function(){return this.Kc().qd()},r.Ja=function(t){var e=this.c;return e?Ps(e.coordinateToPixelTransform,t.slice(0,2)):null},r.Ob=function(){return this.get("size")},r.Z=function(){return this.get("view")},r.sl=function(){return this.a},r.ql=function(t,e,o,i){var r=this.c;return r&&e in r.wantedTiles&&r.wantedTiles[e][t.bb()]?(t=o[0]-r.focus[0],o=o[1]-r.focus[1],65536*Math.log(i)+Math.sqrt(t*t+o*o)/i):1/0},r.ld=function(t,e){t=new _o(e||t.type,this,t),this.Ih(t)},r.Ih=function(t){if(this.c){this.na=t.coordinate,t.frameState=this.c;var e,o=this.o.a;if(!1!==this.b(t))for(e=o.length-1;0<=e;e--){var i=o[e];if(i.c()&&!i.handleEvent(t))break}}},r.Rl=function(){var t,e,o,i=this.c,r=this.$a;for(r.b.length&&(e=t=16,i&&((o=i.viewHints)[0]&&(t=this.Cf?8:0,e=2),o[1])&&(t=this.Df?8:0,e=2),r.j<t)&&(Hi(r),Ji(r,t,e)),t=0,e=(r=this.xb).length;t<e;++t)r[t](this,i);r.length=0},r.Tl=function(){this.render()},r.Vl=function(){var t;if(this.ag()&&(t=this.jd()),this.u){for(var e=0,o=this.u.length;e<o;++e)qe(this.u[e]);this.u=null}t?(t.appendChild(this.a),t=this.va||t,this.u=[d(t,"keydown",this.ld,this),d(t,"keypress",this.ld,this)],this.f||(this.f=this.Ad.bind(this),window.addEventListener("resize",this.f,!1))):(Eo(this.a),this.f&&(window.removeEventListener("resize",this.f,!1),this.f=void 0)),this.Ad()},r.Wl=function(){this.render()},r.Lh=function(){this.render()},r.Xl=function(){this.T&&(qe(this.T),this.T=null),this.R&&(qe(this.R),this.R=null);var t=this.Z();t&&(this.a.setAttribute("data-view",U(t)),this.T=d(t,"propertychange",this.Lh,this),this.R=d(t,"change",this.Lh,this)),this.render()},r.El=function(){this.I&&(this.I.forEach(qe),this.I=null);var t=this.Kc();t&&(this.I=[d(t,"propertychange",this.render,this),d(t,"change",this.render,this)]),this.render()},r.Tp=function(){this.j&&cancelAnimationFrame(this.j),this.pa()},r.render=function(){void 0===this.j&&(this.j=requestAnimationFrame(this.pa))},r.Mp=function(t){return this.l.remove(t)},r.Np=function(t){return this.o.remove(t)},r.Pp=function(t){return this.Kc().qd().remove(t)},r.Qp=function(t){return this.v.remove(t)},r.Sp=function(t){var e=this.Ob(),o=this.Z(),i=vt(),r=this.c,n=null;if(void 0!==e&&0<e[0]&&0<e[1]&&o&&rn(o)){for(var n=on(o,this.c?this.c.viewHints:void 0),s=this.Kc().Yf(),a={},p=0,h=s.length;p<h;++p)a[U(s[p].layer)]=s[p];p=o.getState(),n={animate:!1,attributions:{},coordinateToPixelTransform:this.Yb,extent:i,focus:this.na||p.center,index:this.ad++,layerStates:a,layerStatesArray:s,logos:Xt({},this.yf),pixelRatio:this.If,pixelToCoordinateTransform:this.Jf,postRenderFunctions:[],size:e,skippedFeatureUids:this.fa,tileQueue:this.$a,time:t,usedTiles:{},viewState:p,viewHints:n,wantedTiles:{}}}n&&(n.extent=Rt(p.center,p.resolution,p.rotation,n.size,i)),this.c=n,this.B.Jg(n),n&&(n.animate&&this.render(),Array.prototype.push.apply(this.xb,n.postRenderFunctions),!r||this.g&&(Ut(this.g)||St(n.extent,this.g))||(this.b(new Jo("movestart",this,r)),this.g=mt(this.g)),!this.g||n.viewHints[0]||n.viewHints[1]||St(n.extent,this.g)||(this.b(new Jo("moveend",this,n)),ut(n.extent,this.g))),this.b(new Jo("postrender",this,n)),setTimeout(this.Rl.bind(this),0)},r.qj=function(t){this.set("layergroup",t)},r.Qg=function(t){this.set("size",t)},r.Le=function(t){this.set("target",t)},r.iq=function(t){this.set("view",t)},r.xj=function(t){t=U(t).toString(),this.fa[t]=!0,this.render()},r.Ad=function(){var t,e=this.jd();e?(t=getComputedStyle(e),this.Qg([e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)])):this.Qg(void 0)},r.Cj=function(t){t=U(t).toString(),delete this.fa[t],this.render()},e(fh,ro),(r=fh.prototype).Rd=function(){return this.get(vh)},r.Jm=function(){return this.g},r.Me=function(){return this.get(bh)},r.Dh=function(){return this.get(mh)},r.Yh=function(){return this.get(wh)},r.Eh=function(){return this.get(xh)},r.zl=function(){for(var t=this.c;t.lastChild;)t.removeChild(t.lastChild);(t=this.Rd())&&this.c.appendChild(t)},r.Jl=function(){this.f&&(Eo(this.c),qe(this.f),this.f=null);var t=this.Me();t&&(this.f=d(t,"postrender",this.render,this),dh(this),t=this.v?t.D:t.C,this.l?t.insertBefore(this.c,t.childNodes[0]||null):t.appendChild(this.c))},r.render=function(){dh(this)},r.Nl=function(){dh(this)},r.Pl=function(){var t,e,o,i,r,n,s;dh(this),this.get(wh)&&this.autoPan&&(t=this.Me())&&t.jd()&&(e=yh(t.jd(),t.Ob()),o=(s=this.Rd()).offsetWidth,r=getComputedStyle(s),o+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10),r=s.offsetHeight,i=getComputedStyle(s),n=yh(s,[o,r=r+(parseInt(i.marginTop,10)+parseInt(i.marginBottom,10))]),s=this.o,yt(e,n)||(o=n[0]-e[0],r=e[2]-n[2],i=n[1]-e[1],n=e[3]-n[3],e=[0,0],o<0?e[0]=o-s:r<0&&(e[0]=Math.abs(r)+s),i<0?e[1]=i-s:n<0&&(e[1]=Math.abs(n)+s),0===e[0]&&0===e[1])||(s=t.Z().wa(),e=[(s=t.Ja(s))[0]+e[0],s[1]+e[1]],t.Z().animate({center:t.Wa(e),duration:this.j.duration,easing:this.j.easing})))},r.Ql=function(){dh(this)},r.lj=function(t){this.set(vh,t)},r.setMap=function(t){this.set(bh,t)},r.rj=function(t){this.set(mh,t)},r.Ne=function(t){this.set(wh,t)},r.uj=function(t){this.set(xh,t)};var vh="element",bh="map",mh="offset",wh="position",xh="positioning";function Sh(t){function e(t){t=a.Tf(t),p.a.Z().ob(t),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",e)}function o(t){t=a.Tf({clientX:t.clientX-l.offsetWidth/2,clientY:t.clientY+l.offsetHeight/2}),h.Ne(t)}this.j=void 0===(t=t||{}).collapsed||t.collapsed,this.o=void 0===t.collapsible||t.collapsible,this.o||(this.j=!1);var i=void 0!==t.className?t.className:"ol-overviewmap",r=void 0!==t.tipLabel?t.tipLabel:"Overview map",n=void 0!==t.collapseLabel?t.collapseLabel:"«",s=("string"==typeof n?(this.u=document.createElement("span"),this.u.textContent=n):this.u=n,"string"==typeof(n=void 0!==t.label?t.label:"»")?(this.D=document.createElement("span"),this.D.textContent=n):this.D=n,this.o&&!this.j?this.u:this.D),a=((n=document.createElement("button")).setAttribute("type","button"),n.title=r,n.appendChild(s),d(n,"click",this.an,this),this.C=document.createElement("DIV"),this.C.className="ol-overviewmap-map",this.c=new u({controls:new ho,interactions:new ho,view:t.view})),p=(t.layers&&t.layers.forEach(function(t){a.ih(t)},this),(r=document.createElement("DIV")).className="ol-overviewmap-box",r.style.boxSizing="border-box",this.l=new fh({position:[0,0],positioning:"bottom-left",element:r}),this.c.jh(this.l),(r=document.createElement("div")).className=i+" ol-unselectable ol-control"+(this.j&&this.o?" ol-collapsed":"")+(this.o?"":" ol-uncollapsible"),r.appendChild(this.C),r.appendChild(n),To.call(this,{element:r,render:t.render||Mh,target:t.target}),this),h=this.l,l=this.l.Rd();l.addEventListener("mousedown",function(){window.addEventListener("mousemove",o),window.addEventListener("mouseup",e)})}function Mh(){var t,e,o,i,r=this.a,n=this.c;r.c&&n.c&&(t=r.Ob(),r=r.Z().dd(t),i=n.Ob(),t=n.Z().dd(i),e=n.Ja(Ft(r)),o=n.Ja(Ct(r)),n=Math.abs(e[0]-o[0]),e=Math.abs(e[1]-o[1]),o=i[0],i=i[1],n<.1*o||e<.1*i||.75*o<n||.75*i<e?Ph(this):yt(t,r)||(r=this.c,t=this.a.Z(),r.Z().ob(t.wa()))),Ah(this)}function Ph(t){var e=t.a,o=(t=t.c,e.Ob()),e=e.Z().dd(o);t=t.Z(),Gt(e,1/(.1*Math.pow(2,Math.log(7.5)/Math.LN2/2))),t.Qf(e)}function Ah(t){var e,o,i,r,n,s,a=t.a,p=t.c;a.c&&p.c&&(i=a.Ob(),r=a.Z(),n=p.Z(),p=r.Qa(),a=t.l,e=t.l.Rd(),o=r.dd(i),i=n.Pa(),r=jt(o),n=kt(o),(t=t.a.Z().wa())&&(sr(s=[r[0]-t[0],r[1]-t[1]],p),er(s,t)),a.Ne(s),e)&&(e.style.width=Math.abs((r[0]-n[0])/i)+"px",e.style.height=Math.abs((n[1]-r[1])/i)+"px")}function Eh(t){t.element.classList.toggle("ol-collapsed"),t.j?Ao(t.u,t.D):Ao(t.D,t.u),t.j=!t.j;var e=t.c;t.j||e.c||(e.Ad(),Ph(t),Ye(e,"postrender",function(){Ah(this)},t))}function Th(t){var e=void 0!==(t=t||{}).className?t.className:"ol-scale-line";this.o=document.createElement("DIV"),this.o.className=e+"-inner",this.c=document.createElement("DIV"),this.c.className=e+" ol-unselectable",this.c.appendChild(this.o),this.u=null,this.l=void 0!==t.minWidth?t.minWidth:64,this.j=!1,this.B=void 0,this.D="",To.call(this,{element:this.c,render:t.render||Ch,target:t.target}),d(this,so(Rh),this.T,this),this.I(t.units||"metric")}e(Sh,To),(r=Sh.prototype).setMap=function(t){var e=this.a;t!==e&&(e&&((e=e.Z())&&He(e,so("rotation"),this.Ge,this),this.c.Le(null)),To.prototype.setMap.call(this,t),t)&&(this.c.Le(this.C),this.v.push(d(t,"propertychange",this.Kl,this)),this.c.Xh().dc()||this.c.qj(t.Kc()),t=t.Z())&&(d(t,so("rotation"),this.Ge,this),rn(t)&&(this.c.Ad(),Ph(this)))},r.Kl=function(t){"view"===t.key&&((t=t.oldValue)&&He(t,so("rotation"),this.Ge,this),d(t=this.a.Z(),so("rotation"),this.Ge,this))},r.Ge=function(){this.c.Z().Oe(this.a.Z().Qa())},r.an=function(t){t.preventDefault(),Eh(this)},r.$m=function(){return this.o},r.cn=function(t){this.o!==t&&(this.o=t,this.element.classList.toggle("ol-uncollapsible"),!t)&&this.j&&Eh(this)},r.bn=function(t){this.o&&this.j!==t&&Eh(this)},r.Zm=function(){return this.j},r.gl=function(){return this.c},e(Th,To);var jh=[1,2,5];function Ch(t){(t=t.frameState)?this.u=t.viewState:this.u=null,Lh(this)}function Lh(t){if(o=t.u){var e=(i=o.projection).sc(),o=ce(i,o.resolution,o.center)*e,e=t.l*o,i="";"degrees"==(n=t.C())?(o/=i=Yt.degrees,e<i/60?(i="″",o*=3600):e<i?(i="′",o*=60):i="°"):"imperial"==n?e<.9144?(i="in",o/=.0254):e<1609.344?(i="ft",o/=.3048):(i="mi",o/=1609.344):"nautical"==n?(o/=1852,i="nm"):"metric"==n?e<.001?(i="μm",o*=1e6):e<1?(i="mm",o*=1e3):e<1e3?i="m":(i="km",o/=1e3):"us"==n?e<.9144?(i="in",o*=39.37):e<1609.344?(i="ft",o/=.30480061):(i="mi",o/=1609.3472):O(!1,33);for(var r,n=3*Math.floor(Math.log(t.l*o)/Math.log(10));;){if(r=jh[(n%3+3)%3]*Math.pow(10,Math.floor(n/3)),e=Math.round(r/o),isNaN(e))return t.c.style.display="none",void(t.j=!1);if(e>=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<e?(this.j=1,this.D=e-r):(this.j=Nh,this.l=o-n),this.na=!0),(t=t.frameState.viewState.resolution)!==this.c)&&(this.c=t,kh(this,t))}function kh(t,e){e=1-(r=t.a.Z(),o=r.a,i=Math.log(o/r.f)/Math.log(2),function(t){return Math.log(o/t)/Math.log(2)/i}(e));var o,i,r=t.element.firstElementChild;1==t.j?r.style.left=t.D*e+"px":r.style.top=t.l*e+"px"}function Dh(t,e){t=t.a.Z(),o=t.a,t=Math.log(o/t.f)/Math.log(2);var o,e=1-e;return o/Math.pow(2,e*t)}function Oh(t){this.c=(t=t||{}).extent||null;var e=void 0!==t.className?t.className:"ol-zoom-extent",o=void 0!==t.label?t.label:"E",i=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",r=document.createElement("button");r.setAttribute("type","button"),r.title=i,r.appendChild("string"==typeof o?document.createTextNode(o):o),d(r,"click",this.j,this),(o=document.createElement("div")).className=e+" ol-unselectable ol-control",o.appendChild(r),To.call(this,{element:o,target:t.target})}function Uh(t){ro.call(this),t=t||{},this.a=null,d(this,so(Wh),this.vm,this),this.gg(void 0!==t.tracking&&t.tracking)}(r=Ih.prototype).setMap=function(t){To.prototype.setMap.call(this,t),t&&t.render()},r.vl=function(t){var e=this.a.Z();t=Dh(this,Q(1===this.j?(t.offsetX-this.I[0]/2)/this.D:(t.offsetY-this.I[1]/2)/this.l,0,1)),e.animate({resolution:e.constrainResolution(t),duration:this.T,easing:Io})},r.yl=function(t){this.u||t.b.target!==this.element.firstElementChild||(nn(this.a.Z(),1,1),this.C=t.clientX,this.B=t.clientY,this.u=!0)},r.wl=function(t){var e;this.u&&(e=this.element.firstElementChild,this.c=Dh(this,Q(1===this.j?(t.clientX-this.C+parseInt(e.style.left,10))/this.D:(t.clientY-this.B+parseInt(e.style.top,10))/this.l,0,1)),this.a.Z().Vc(this.c),kh(this,this.c),this.C=t.clientX,this.B=t.clientY)},r.xl=function(){var t;this.u&&(nn(t=this.a.Z(),1,-1),t.animate({resolution:t.constrainResolution(this.c),duration:this.T,easing:Io}),this.u=!1,this.B=this.C=void 0)},e(Oh,To),Oh.prototype.j=function(t){t.preventDefault(),t=this.a.Z();var e=this.c||t.v.G();t.Qf(e)},e(Uh,ro),(r=Uh.prototype).ka=function(){this.gg(!1),ro.prototype.ka.call(this)},r.ap=function(t){var e;null!==t.alpha&&(e=it(t.alpha),this.set(Gh,e),"boolean"==typeof t.absolute&&t.absolute?this.set(Vh,e):"number"==typeof t.webkitCompassHeading&&-1!=t.webkitCompassAccuracy&&this.set(Vh,it(t.webkitCompassHeading))),null!==t.beta&&this.set(Bh,it(t.beta)),null!==t.gamma&&this.set(Xh,it(t.gamma)),this.s()},r.Fk=function(){return this.get(Gh)},r.Ik=function(){return this.get(Bh)},r.Ok=function(){return this.get(Xh)},r.um=function(){return this.get(Vh)},r.Th=function(){return this.get(Wh)},r.vm=function(){var t;pi&&((t=this.Th())&&!this.a?this.a=d(window,"deviceorientation",this.ap,this):t||null===this.a||(qe(this.a),this.a=null))},r.gg=function(t){this.set(Wh,t)};var Gh="alpha",Bh="beta",Xh="gamma",Vh="heading",Wh="tracking";function Zh(t){this.f=t.opacity,this.l=t.rotateWithView,this.g=t.rotation,this.a=t.scale,this.v=t.snapToPixel}function Kh(t){this.D=this.u=this.c=null,this.Va=void 0!==t.fill?t.fill:null,this.oa=[0,0],this.o=t.points,this.b=void 0!==t.radius?t.radius:t.radius1,this.i=t.radius2,this.j=void 0!==t.angle?t.angle:0,this.Ya=void 0!==t.stroke?t.stroke:null,this.B=this.ra=this.C=null,this.S=t.atlasManager,zh(this,this.S),Zh.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})}function zh(t,e){var o,i,r="",n="",s=0,a=null,p=0,h=(t.Ya&&(o=Mo(o=null===(o=t.Ya.a)?Gs:o),void 0===(p=t.Ya.c)&&(p=1),a=t.Ya.i,si||(a=null),void 0===(n=t.Ya.j)&&(n="round"),void 0===(r=t.Ya.f)&&(r="round"),void 0===(s=t.Ya.o))&&(s=10),2*(t.b+p)+1),r={strokeStyle:o,zj:p,size:h,lineCap:r,lineDash:a,lineJoin:n,miterLimit:s};void 0===e?(i=Po(h,h),t.u=i.canvas,e=h=t.u.width,t.rh(r,i,0,0),t.Va?t.D=t.u:(i=Po(r.size,r.size),t.D=i.canvas,t.qh(r,i,0,0))):(h=Math.round(h),(n=!t.Va)&&(i=t.qh.bind(t,r)),s=t.Ya?(void 0===(s=t.Ya).b&&(s.b="s",s.b=s.a?"string"==typeof s.a?s.b+s.a:s.b+U(s.a).toString():s.b+"-",s.b+=","+(void 0!==s.f?s.f.toString():"-")+","+(s.i?s.i.toString():"-")+","+(void 0!==s.g?s.g:"-")+","+(void 0!==s.j?s.j:"-")+","+(void 0!==s.o?s.o.toString():"-")+","+(void 0!==s.c?s.c.toString():"-")),s.b):"-",a=t.Va?(void 0===(a=t.Va).a&&(a.a=a.b instanceof CanvasPattern||a.b instanceof CanvasGradient?U(a.b).toString():"f"+(a.b?bo(a.b):"-")),a.a):"-",t.c&&s==t.c[1]&&a==t.c[2]&&t.b==t.c[3]&&t.i==t.c[4]&&t.j==t.c[5]&&t.o==t.c[6]||(t.c=["r"+s+a+(void 0!==t.b?t.b.toString():"-")+(void 0!==t.i?t.i.toString():"-")+(void 0!==t.j?t.j.toString():"-")+(void 0!==t.o?t.o.toString():"-"),s,a,t.b,t.i,t.j,t.o]),i=e.add(t.c[0],h,h,t.rh.bind(t,r),i),t.u=i.image,t.oa=[i.offsetX,i.offsetY],e=i.image.width,t.D=n?i.Zl:t.u),t.C=[h/2,h/2],t.ra=[h,h],t.B=[e,e]}function Yh(t){Kh.call(this,{points:1/0,fill:(t=t||{}).fill,radius:t.radius,snapToPixel:t.snapToPixel,stroke:t.stroke,atlasManager:t.atlasManager})}function Hh(t){this.b=void 0!==(t=t||{}).color?t.color:null,this.a=void 0}function qh(t){t=t||{},this.Gc=null,this.Za=tl,void 0!==t.geometry&&this.Ra(t.geometry),this.Va=void 0!==t.fill?t.fill:null,this.M=void 0!==t.image?t.image:null,this.Ya=void 0!==t.stroke?t.stroke:null,this.Ia=void 0!==t.text?t.text:null,this.Fj=t.zIndex}function Jh(t){var e;return"function"!=typeof t&&(e=Array.isArray(t)?t:(O(t instanceof qh,41),[t]),t=function(){return e}),t}(r=Zh.prototype).Ze=function(){return this.f},r.$e=function(){return this.l},r.af=function(){return this.g},r.bf=function(){return this.a},r.Ae=function(){return this.v},r.td=function(t){this.f=t},r.cf=function(t){this.g=t},r.ud=function(t){this.a=t},e(Kh,Zh),(r=Kh.prototype).clone=function(){var t=new Kh({fill:this.Fa()?this.Fa().clone():void 0,points:this.o,radius:this.b,radius2:this.i,angle:this.j,snapToPixel:this.v,stroke:this.Ga()?this.Ga().clone():void 0,rotation:this.g,rotateWithView:this.l,atlasManager:this.S});return t.td(this.f),t.ud(this.a),t},r.Hc=function(){return this.C},r.Pi=function(){return this.j},r.Fa=function(){return this.Va},r.qg=function(){return this.D},r.Y=function(){return this.u},r.ye=function(){return this.B},r.Ye=function(){return 2},r.Oc=function(){return this.oa},r.Qi=function(){return this.o},r.Ri=function(){return this.b},r.Fh=function(){return this.i},r.ic=function(){return this.ra},r.Ga=function(){return this.Ya},r.Nh=function(){},r.load=function(){},r.Bj=function(){},r.rh=function(t,e,o,i){e.setTransform(1,0,0,1,0,0),e.translate(o,i),e.beginPath();var r=this.o;if(1/0===r)e.arc(t.size/2,t.size/2,this.b,0,2*Math.PI,!0);else{var n=void 0!==this.i?this.i:this.b;for(n!==this.b&&(r*=2),o=0;o<=r;o++){i=2*o*Math.PI/r-Math.PI/2+this.j;var s=o%2?n:this.b;e.lineTo(t.size/2+s*Math.cos(i),t.size/2+s*Math.sin(i))}}this.Va&&(o=this.Va.b,e.fillStyle=Mo(o=null===o?Os:o),e.fill()),this.Ya&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.zj,t.lineDash&&e.setLineDash(t.lineDash),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},r.qh=function(t,e,o,i){var r;if(e.setTransform(1,0,0,1,0,0),e.translate(o,i),e.beginPath(),1/0===(o=this.o))e.arc(t.size/2,t.size/2,this.b,0,2*Math.PI,!0);else for((i=void 0!==this.i?this.i:this.b)!==this.b&&(o*=2),r=0;r<=o;r++){var n=2*r*Math.PI/o-Math.PI/2+this.j,s=r%2?i:this.b;e.lineTo(t.size/2+s*Math.cos(n),t.size/2+s*Math.sin(n))}e.fillStyle=Os,e.fill(),this.Ya&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.zj,t.lineDash&&e.setLineDash(t.lineDash),e.stroke()),e.closePath()},e(Yh,Kh),Yh.prototype.clone=function(){var t=new Yh({fill:this.Fa()?this.Fa().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,radius:this.b,snapToPixel:this.v,atlasManager:this.S});return t.td(this.f),t.ud(this.a),t},Yh.prototype.Uc=function(t){this.b=t,zh(this,this.S)},Hh.prototype.clone=function(){var t=this.b;return new Hh({color:t&&t.slice?t.slice():t||void 0})},Hh.prototype.i=function(){return this.b},Hh.prototype.c=function(t){this.b=t,this.a=void 0},(r=qh.prototype).clone=function(){var t=this.V();return new qh({geometry:t=t&&t.clone?t.clone():t,fill:this.Fa()?this.Fa().clone():void 0,image:this.Y()?this.Y().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,text:this.Na()?this.Na().clone():void 0,zIndex:this.Ba()})},r.V=function(){return this.Gc},r.Pk=function(){return this.Za},r.Fa=function(){return this.Va},r.pf=function(t){this.Va=t},r.Y=function(){return this.M},r.Og=function(t){this.M=t},r.Ga=function(){return this.Ya},r.qf=function(t){this.Ya=t},r.Na=function(){return this.Ia},r.xd=function(t){this.Ia=t},r.Ba=function(){return this.Fj},r.Ra=function(e){this.Za="function"==typeof e?e:"string"==typeof e?function(t){return t.get(e)}:e?function(){return e}:tl,this.Gc=e},r.Vb=function(t){this.Fj=t};var _h=null;function $h(){var t,e;return _h||(t=new Hh({color:"rgba(255,255,255,0.4)"}),e=new hp({color:"#3399CC",width:1.25}),_h=[new qh({image:new Yh({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]),_h}function Qh(){var t={},e=[255,255,255,1],o=[0,153,255,1];return t.Polygon=[new qh({fill:new Hh({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new qh({stroke:new hp({color:e,width:5})}),new qh({stroke:new hp({color:o,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new qh({image:new Yh({radius:6,fill:new Hh({color:o}),stroke:new hp({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function tl(t){return t.V()}function x(t){ro.call(this),this.a=void 0,this.c="geometry",this.g=null,this.j=void 0,this.f=null,d(this,so(this.c),this.Ee,this),void 0!==t&&(t instanceof yr||!t?this.Ra(t):this.H(t))}e(x,ro),(r=x.prototype).clone=function(){var t=new x(this.N()),e=(t.Tc(this.c),this.V());return e&&t.Ra(e.clone()),(e=this.g)&&t.hg(e),t},r.V=function(){return this.get(this.c)},r.wm=function(){return this.a},r.Qk=function(){return this.c},r.xm=function(){return this.g},r.Lc=function(){return this.j},r.Al=function(){this.s()},r.Ee=function(){this.f&&(qe(this.f),this.f=null);var t=this.V();t&&(this.f=d(t,"change",this.Al,this)),this.s()},r.Ra=function(t){this.set(this.c,t)},r.hg=function(t){this.j=(this.g=t)?function(e){var t;{var o;t="function"==typeof e?2==e.length?function(t){return e(this,t)}:e:(o=Array.isArray(e)?e:(O(e instanceof qh,41),[e]),function(){return o})}return t}(t):void 0,this.s()},r.jc=function(t){this.a=t,this.s()},r.Tc=function(t){He(this,so(this.c),this.Ee,this),this.c=t,d(this,so(this.c),this.Ee,this),this.Ee()};var el=document.implementation.createDocument("","",null);function ol(t,e){return el.createElementNS(t,e)}function il(t,e){return function t(e,o,i){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)o?i.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(e.nodeValue);else for(e=e.firstChild;e;e=e.nextSibling)t(e,o,i);return i}(t,e,[]).join("")}function rl(t){return t instanceof Document}function nl(t){return t instanceof Node}function sl(t){return(new DOMParser).parseFromString(t,"application/xml")}function al(o,i){return function(t,e){void 0!==(t=o.call(i,t,e))&&X(e[e.length-1],t)}}function pl(o,i){return function(t,e){void 0!==(t=o.call(void 0!==i?i:this,t,e))&&e[e.length-1].push(t)}}function hl(o,i){return function(t,e){void 0!==(t=o.call(void 0!==i?i:this,t,e))&&(e[e.length-1]=t)}}function ll(i){return function(t,e){var o=i.call(this,t,e);void 0!==o&&(e=e[e.length-1],((t=t.localName)in e?e[t]:e[t]=[]).push(o))}}function o(i,r){return function(t,e){var o=i.call(this,t,e);void 0!==o&&(e[e.length-1][void 0!==r?r:t.localName]=o)}}function c(i,r){return function(t,e,o){i.call(void 0!==r?r:this,t,e,o),o[o.length-1].node.appendChild(t)}}function ul(r){var n,s;return function(t,e,o){var i;n||(n={},(i={})[t.localName]=r,n[t.namespaceURI]=i,s=cl(t.localName)),dl(n,s,e,o)}}function cl(i,r){return function(t,e,o){return t=e[e.length-1].node,void 0===(e=i)&&(e=o),ol(o=void 0===(o=r)?t.namespaceURI:r,e)}}var fl=cl();function yl(t,e){for(var o=e.length,i=Array(o),r=0;r<o;++r)i[r]=t[e[r]];return i}function l(t,e,o){o=void 0!==o?o:{};for(var i=0,r=t.length;i<r;++i)o[t[i]]=e;return o}function gl(t,e,o,i){for(e=e.firstElementChild;e;e=e.nextElementSibling){var r=t[e.namespaceURI];void 0!==r&&(r=r[e.localName])&&r.call(i,e,o)}}function g(t,e,o,i,r){return i.push(t),gl(e,o,i,r),i.pop()}function dl(t,e,o,i,r,n){for(var s,a,p=(void 0!==r?r:o).length,h=0;h<p;++h)void 0!==(s=o[h])&&void 0!==(a=e.call(n,s,i,void 0!==r?r[h]:void 0))&&t[a.namespaceURI][a.localName].call(n,a,s,i)}function vl(t,e,o,i,r,n,s){r.push(t),dl(e,o,i,r,n,s),r.pop()}function bl(r,n,s,a){return function(t,e,o){var i=new XMLHttpRequest;i.open("GET","function"==typeof r?r(t,e,o):r,!0),"arraybuffer"==n.U()&&(i.responseType="arraybuffer"),i.onload=function(){var t,e;(!i.status||200<=i.status&&i.status<300)&&("json"==(t=n.U())||"text"==t?e=i.responseText:"xml"==t?e=(e=i.responseXML)||sl(i.responseText):"arraybuffer"==t&&(e=i.response),e)?s.call(this,n.Oa(e,{featureProjection:o}),n.kb(e)):a.call(this)}.bind(this),i.onerror=function(){a.call(this)}.bind(this),i.send()}}function ml(t,e){return bl(t,e,function(t){this.cd(t)},Y)}function wl(){this.f=this.defaultDataProjection=null}function xl(t,e,o){var i;return o&&(i={dataProjection:o.dataProjection||t.kb(e),featureProjection:o.featureProjection}),Sl(t,i)}function Sl(t,e){return Xt({dataProjection:t.defaultDataProjection,featureProjection:t.f},e)}function Ml(t,e,o){var i,r=o?v(o.featureProjection):null,n=o?v(o.dataProjection):null,n=r&&n&&!be(r,n)?t instanceof yr?(e?t.clone():t).tb(e?r:n,e?n:r):Pe(t,n,r):t;return e&&o&&void 0!==o.decimals&&(i=Math.pow(10,o.decimals),(n=n===t?n.clone():n).Dc(function(t){for(var e=0,o=t.length;e<o;++e)t[e]=Math.round(t[e]*i)/i;return t})),n}function Pl(){wl.call(this)}function Al(t){return"string"==typeof t?(t=JSON.parse(t))||null:null!==t?t:null}function El(t,e,o,i,r,n){var s=NaN,a=NaN;if(1===(p=(o-e)/i))s=t[e],a=t[e+1];else if(2==p)s=(1-r)*t[e]+r*t[e+i],a=(1-r)*t[e+1]+r*t[e+i+1];else if(p){for(var a=t[e],p=t[e+1],h=0,s=[0],l=e+i;l<o;l+=i){var u=t[l],c=t[l+1],h=h+Math.sqrt((u-a)*(u-a)+(c-p)*(c-p));s.push(h),a=u,p=c}for(o=r*h,p=0,h=s.length,l=!1;p<h;)(a=+G(s[r=p+(h-p>>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<t[e+i-1])return n?((o=t.slice(e,e+i))[i-1]=r,o):null;if(t[o-1]<r)return n?((o=t.slice(o-i,o))[i-1]=r,o):null;if(r==t[e+i-1])return t.slice(e,e+i);for(e/=i,o/=i;e<o;)r<t[((n=e+o>>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<i-1;++s)o.push(nt(t[(e-1)*i+s],t[e*i+s],n));return o.push(r),o}function S(t,e){b.call(this),this.c=null,this.u=this.D=this.j=-1,this.ma(t,e)}function jl(t){return t.j!=t.i&&(t.c=t.wh(.5,t.c),t.j=t.i),t.c}function M(t,e){b.call(this),this.c=[],this.j=this.u=-1,this.ma(t,e)}function Cl(t){for(var e=[],o=t.A,i=0,r=t.c,n=(t=t.a,0),s=r.length;n<s;++n){var a=r[n];X(e,i=El(o,i,a,t,.5)),i=a}return e}function Ll(t,e){for(var o=t.ja,i=[],r=[],n=0,s=e.length;n<s;++n){var a=e[n];n||(o=a.ja),X(i,a.ga()),r.push(i.length)}t.ba(o,i,r)}function P(t,e){b.call(this),this.ma(t,e)}function f(t,e){b.call(this),this.c=[],this.u=-1,this.D=null,this.I=this.C=this.B=-1,this.j=null,this.ma(t,e)}function Rl(t){if(t.u!=t.i){var e=t.A,o=t.c,i=t.a,r=0,n=[],s=0;for(h=o.length;s<h;++s){var a=o[s],r=xt(e,r,a[0],i);n.push((r[0]+r[2])/2,(r[1]+r[3])/2),r=a[a.length-1]}for(e=Il(t),o=t.c,i=t.a,h=[],a=s=0,r=o.length;a<r;++a)var p=o[a],h=Ur(e,s,p,i,n,2*a,h),s=p[p.length-1];t.D=h,t.u=t.i}return t.D}function Il(t){if(t.I!=t.i){var e=t.A;t:{for(var o=t.c,i=0,r=o.length;i<r;++i)if(!Wr(e,o[i],t.a,void 0)){o=!1;break t}o=!0}o?t.j=e:(t.j=e.slice(),t.j.length=Kr(t.j,t.c,t.a)),t.I=t.i}return t.j}function Nl(t,e,o,i){br(t,e,o),t.c=i,t.s()}function Fl(t,e){for(var o=t.ja,i=[],r=[],n=0,s=e.length;n<s;++n){for(var a=e[n],p=(n||(o=a.ja),i.length),h=a.Bb(),l=0,u=h.length;l<u;++l)h[l]+=p;X(i,a.ga()),r.push(h)}Nl(t,o,i,r)}function kl(t){t=t||{},wl.call(this),this.b=t.geometryName}function Dl(t,e){if(!t)return null;if("number"==typeof t.x&&"number"==typeof t.y)var o="Point";else if(t.points)o="MultiPoint";else if(t.paths)o=1===t.paths.length?"LineString":"MultiLineString";else if(t.rings){for(var i=t.rings,r=Ol(t),n=[],s=[],o=[],a=0,p=i.length;a<p;++a)n.length=0,jr(n,0,i[a],r.length),Vr(n,0,n.length,r.length)?s.push([i[a]]):o.push(i[a]);for(;o.length;){for(i=o.shift(),r=!1,a=s.length-1;0<=a;a--)if(yt(new Fr(s[a][0]).G(),new Fr(i).G())){s[a].push(i),r=!0;break}r||s.push([i.reverse()])}t=Xt({},t),1===s.length?(o="Polygon",t.rings=s[0]):(o="MultiPolygon",t.rings=s)}return Ml((0,Gl[o])(t),!1,e)}function Ol(t){var e="XY";return!0===t.hasZ&&!0===t.hasM?e="XYZM":!0===t.hasZ?e="XYZ":!0===t.hasM&&(e="XYM"),e}function Ul(t){return{hasZ:"XYZ"===(t=t.ja)||"XYZM"===t,hasM:"XYM"===t||"XYZM"===t}}e(Pl,wl),(r=Pl.prototype).U=function(){return"json"},r.Tb=function(t,e){return this.Rc(Al(t),xl(this,t,e))},r.Oa=function(t,e){return this.yg(Al(t),xl(this,t,e))},r.Sc=function(t,e){return this.Cg(Al(t),xl(this,t,e))},r.kb=function(t){return this.Fg(Al(t))},r.Bd=function(t,e){return JSON.stringify(this.Zc(t,e))},r.Wb=function(t,e){return JSON.stringify(this.he(t,e))},r.$c=function(t,e){return JSON.stringify(this.je(t,e))},e(S,b),(r=S.prototype).mk=function(t){this.A?X(this.A,t):this.A=t.slice(),this.s()},r.clone=function(){var t=new S(null);return t.ba(this.ja,this.A.slice()),t},r.Kb=function(t,e,o,i){return i<ct(this.G(),t,e)?i:(this.u!=this.i&&(this.D=Math.sqrt(Mr(this.A,0,this.A.length,this.a,0)),this.u=this.i),Ar(this.A,0,this.A.length,this.a,this.D,!1,t,e,o,i))},r.Ck=function(t,e){return Gr(this.A,0,this.A.length,this.a,t,e)},r.nn=function(t,e){return"XYM"!=this.ja&&"XYZM"!=this.ja?null:Tl(this.A,0,this.A.length,this.a,t,void 0!==e&&e)},r.X=function(){return Lr(this.A,0,this.A.length,this.a)},r.wh=function(t,e){return El(this.A,0,this.A.length,this.a,t,e)},r.pn=function(){for(var t=this.A,e=this.a,o=t[0],i=t[1],r=0,n=0+e;n<this.A.length;n+=e)var s=t[n],a=t[n+1],r=r+Math.sqrt((s-o)*(s-o)+(a-i)*(a-i)),o=s,i=a;return r},r.hd=function(t){var e=[];return e.length=Ir(this.A,0,this.A.length,this.a,t,e,0),(t=new S(null)).ba("XY",e),t},r.U=function(){return"LineString"},r.Xa=function(t){return Br(this.A,0,this.A.length,this.a,t)},r.ma=function(t,e){t?(mr(this,e,t,1),this.A||(this.A=[]),this.A.length=jr(this.A,0,t,this.a),this.s()):this.ba("XY",null)},r.ba=function(t,e){br(this,t,e),this.s()},e(M,b),(r=M.prototype).nk=function(t){this.A?X(this.A,t.ga().slice()):this.A=t.ga().slice(),this.c.push(this.A.length),this.s()},r.clone=function(){var t=new M(null);return t.ba(this.ja,this.A.slice(),this.c.slice()),t},r.Kb=function(t,e,o,i){return i<ct(this.G(),t,e)?i:(this.j!=this.i&&(this.u=Math.sqrt(Pr(this.A,0,this.c,this.a,0)),this.j=this.i),Er(this.A,0,this.c,this.a,this.u,!1,t,e,o,i))},r.rn=function(t,e,o){if(("XYM"==this.ja||"XYZM"==this.ja)&&this.A.length){var i=this.A,r=this.c,n=this.a,s=t,a=void 0!==e&&e,p=void 0!==o&&o,h=0;if(p)return Tl(i,h,r[r.length-1],n,s,a);if(s<i[n-1])return a?((i=i.slice(0,n))[n-1]=s,i):null;if(i[i.length-1]<s)return a?((i=i.slice(i.length-n))[n-1]=s,i):null;for(a=0,p=r.length;a<p;++a){var l=r[a];if(h!=l){if(s<i[h+n-1])break;if(s<=i[l-1])return Tl(i,h,l,n,s,!1);h=l}}}return null},r.X=function(){return Rr(this.A,0,this.c,this.a)},r.Bb=function(){return this.c},r.Yk=function(t){var e;return t<0||this.c.length<=t?null:((e=new S(null)).ba(this.ja,this.A.slice(t?this.c[t-1]:0,this.c[t])),e)},r.gd=function(){for(var t=this.A,e=this.c,o=this.ja,i=[],r=0,n=0,s=e.length;n<s;++n){var a=e[n],p=new S(null);p.ba(o,t.slice(r,a)),i.push(p),r=a}return i},r.hd=function(t){for(var e=[],o=[],i=this.A,r=this.c,n=this.a,s=0,a=0,p=0,h=r.length;p<h;++p){var l=r[p],a=Ir(i,s,l,n,t,e,a);o.push(a),s=l}return e.length=a,(t=new M(null)).ba("XY",e,o),t},r.U=function(){return"MultiLineString"},r.Xa=function(t){t:{for(var e=this.A,o=this.c,i=this.a,r=0,n=0,s=o.length;n<s;++n){if(Br(e,r,o[n],i,t)){t=!0;break t}r=o[n]}t=!1}return t},r.ma=function(t,e){t?(mr(this,e,t,2),this.A||(this.A=[]),t=Cr(this.A,0,t,this.a,this.c),this.A.length=t.length?t[t.length-1]:0,this.s()):this.ba("XY",null,this.c)},r.ba=function(t,e,o){br(this,t,e),this.c=o,this.s()},e(P,b),(r=P.prototype).qk=function(t){this.A?X(this.A,t.ga()):this.A=t.ga().slice(),this.s()},r.clone=function(){var t=new P(null);return t.ba(this.ja,this.A.slice()),t},r.Kb=function(t,e,o,i){if(!(i<ct(this.G(),t,e)))for(var r=this.A,n=this.a,s=0,a=r.length;s<a;s+=n){var p=ot(t,e,r[s],r[s+1]);if(p<i){for(i=p,p=0;p<n;++p)o[p]=r[s+p];o.length=n}}return i},r.X=function(){return Lr(this.A,0,this.A.length,this.a)},r.il=function(t){var e=this.A?this.A.length/this.a:0;return t<0||e<=t?null:((e=new m(null)).ba(this.ja,this.A.slice(t*this.a,(t+1)*this.a)),e)},r.Zd=function(){for(var t=this.A,e=this.ja,o=this.a,i=[],r=0,n=t.length;r<n;r+=o){var s=new m(null);s.ba(e,t.slice(r,r+o)),i.push(s)}return i},r.U=function(){return"MultiPoint"},r.Xa=function(t){for(var e=this.A,o=this.a,i=0,r=e.length;i<r;i+=o)if(gt(t,e[i],e[i+1]))return!0;return!1},r.ma=function(t,e){t?(mr(this,e,t,1),this.A||(this.A=[]),this.A.length=jr(this.A,0,t,this.a),this.s()):this.ba("XY",null)},r.ba=function(t,e){br(this,t,e),this.s()},e(f,b),(r=f.prototype).rk=function(t){if(this.A)for(var e=this.A.length,o=(X(this.A,t.ga()),0),i=(t=t.Bb().slice()).length;o<i;++o)t[o]+=e;else this.A=t.ga().slice(),t=t.Bb().slice(),this.c.push();this.c.push(t),this.s()},r.clone=function(){for(var t=new f(null),e=this.c.length,o=Array(e),i=0;i<e;++i)o[i]=this.c[i].slice();return Nl(t,this.ja,this.A.slice(),o),t},r.Kb=function(t,e,o,i){if(!(i<ct(this.G(),t,e))){if(this.C!=this.i){for(var r=this.c,n=0,s=0,a=0,p=r.length;a<p;++a)var h=r[a],s=Pr(this.A,n,h,this.a,s),n=h[h.length-1];this.B=Math.sqrt(s),this.C=this.i}r=Il(this),n=this.c,s=this.a;for(var a=this.B,h=[NaN,NaN],l=p=0,u=n.length;l<u;++l){var c=n[l];i=Er(r,p,c,s,a,!0,t,e,o,i,h),p=c[c.length-1]}}return i},r.Mc=function(t,e){t:{var o=Il(this),i=this.c,r=0;if(i.length)for(var n=0,s=i.length;n<s;++n){var a=i[n];if(Or(o,r,a,this.a,t,e)){t=!0;break t}r=a[a.length-1]}t=!1}return t},r.sn=function(){for(var t=Il(this),e=this.c,o=0,i=0,r=0,n=e.length;r<n;++r)var s=e[r],i=i+xr(t,o,s,this.a),o=s[s.length-1];return i},r.X=function(t){void 0!==t?Kr(e=Il(this).slice(),this.c,this.a,t):e=this.A,t=e,e=this.c;for(var e,o=this.a,i=0,r=[],n=0,s=0,a=e.length;s<a;++s){var p=e[s];r[n++]=Rr(t,i,p,o,r[n]),i=p[p.length-1]}return r.length=n,r},r.Uk=function(){var t=new P(null);return t.ba("XY",Rl(this).slice()),t},r.hd=function(t){for(var e=[],o=[],i=this.A,r=this.c,n=this.a,s=(t=Math.sqrt(t),0),a=0,p=0,h=r.length;p<h;++p){var l=r[p],u=[],a=Nr(i,s,l,n,t,e,a,u);o.push(u),s=l[l.length-1]}return e.length=a,Nl(i=new f(null),"XY",e,o),i},r.jl=function(t){if(t<0||this.c.length<=t)return null;e=t?(e=this.c[t-1])[e.length-1]:0;var e,o=(t=this.c[t].slice())[t.length-1];if(e)for(var i=0,r=t.length;i<r;++i)t[i]-=e;return(i=new w(null)).ba(this.ja,this.A.slice(e,o),t),i},r.Td=function(){for(var t=this.ja,e=this.A,o=this.c,i=[],r=0,n=0,s=o.length;n<s;++n){var a=o[n].slice(),p=a[a.length-1];if(r)for(var h=0,l=a.length;h<l;++h)a[h]-=r;(h=new w(null)).ba(t,e.slice(r,p),a),i.push(h),r=p}return i},r.U=function(){return"MultiPolygon"},r.Xa=function(t){t:{for(var e=Il(this),o=this.c,i=this.a,r=0,n=0,s=o.length;n<s;++n){var a=o[n];if(Xr(e,r,a,i,t)){t=!0;break t}r=a[a.length-1]}t=!1}return t},r.ma=function(t,e){if(t){mr(this,e,t,3),this.A||(this.A=[]),e=this.A;for(var o=this.a,i=0,r=(r=this.c)||[],n=0,s=0,a=t.length;s<a;++s)i=Cr(e,i,t[s],o,r[n]),i=(r[n++]=i)[i.length-1];r.length=n,r.length?(t=r[r.length-1],this.A.length=t.length?t[t.length-1]:0):this.A.length=0,this.s()}else Nl(this,"XY",null,this.c)},e(kl,Pl);var Gl={Point:function(t){return void 0!==t.m&&void 0!==t.z?new m([t.x,t.y,t.z,t.m],"XYZM"):void 0!==t.z?new m([t.x,t.y,t.z],"XYZ"):void 0!==t.m?new m([t.x,t.y,t.m],"XYM"):new m([t.x,t.y])},LineString:function(t){return new S(t.paths[0],Ol(t))},Polygon:function(t){return new w(t.rings,Ol(t))},MultiPoint:function(t){return new P(t.points,Ol(t))},MultiLineString:function(t){return new M(t.paths,Ol(t))},MultiPolygon:function(t){return new f(t.rings,Ol(t))}},Bl={Point:function(t){var e,o=t.X();return"XYZ"===(t=t.ja)?e={x:o[0],y:o[1],z:o[2]}:"XYM"===t?e={x:o[0],y:o[1],m:o[2]}:"XYZM"===t?e={x:o[0],y:o[1],z:o[2],m:o[3]}:"XY"===t?e={x:o[0],y:o[1]}:O(!1,34),e},LineString:function(t){var e=Ul(t);return{hasZ:e.hasZ,hasM:e.hasM,paths:[t.X()]}},Polygon:function(t){var e=Ul(t);return{hasZ:e.hasZ,hasM:e.hasM,rings:t.X(!1)}},MultiPoint:function(t){var e=Ul(t);return{hasZ:e.hasZ,hasM:e.hasM,points:t.X()}},MultiLineString:function(t){var e=Ul(t);return{hasZ:e.hasZ,hasM:e.hasM,paths:t.X()}},MultiPolygon:function(t){var e=Ul(t);t=t.X(!1);for(var o=[],i=0;i<t.length;i++)for(var r=t[i].length-1;0<=r;r--)o.push(t[i][r]);return{hasZ:e.hasZ,hasM:e.hasM,rings:o}}};function Xl(t,e){return(0,Bl[t.U()])(Ml(t,!0,e),e)}function Vl(t){this.kc=t}function Wl(t,e){this.kc=t,this.b=Array.prototype.slice.call(arguments,1),O(2<=this.b.length,57)}function Zl(t){var e=["And"].concat(Array.prototype.slice.call(arguments));Wl.apply(this,e)}function Kl(t,e,o){this.kc="BBOX",this.geometryName=t,this.extent=e,this.srsName=o}function zl(t,e){this.kc=t,this.b=e}function Yl(t,e,o){zl.call(this,"During",t),this.a=e,this.i=o}function Hl(t,e,o,i){zl.call(this,t,e),this.i=o,this.a=i}function ql(t,e,o){Hl.call(this,"PropertyIsEqualTo",t,e,o)}function Jl(t,e){Hl.call(this,"PropertyIsGreaterThan",t,e)}function _l(t,e){Hl.call(this,"PropertyIsGreaterThanOrEqualTo",t,e)}function $l(t,e,o,i){this.kc=t,this.geometryName=e||"the_geom",this.geometry=o,this.srsName=i}function Ql(t,e,o){$l.call(this,"Intersects",t,e,o)}function tu(t,e,o){zl.call(this,"PropertyIsBetween",t),this.a=e,this.i=o}function eu(t,e,o,i,r,n){zl.call(this,"PropertyIsLike",t),this.c=e,this.g=void 0!==o?o:"*",this.f=void 0!==i?i:".",this.i=void 0!==r?r:"!",this.a=n}function ou(t){zl.call(this,"PropertyIsNull",t)}function iu(t,e){Hl.call(this,"PropertyIsLessThan",t,e)}function ru(t,e){Hl.call(this,"PropertyIsLessThanOrEqualTo",t,e)}function nu(t){this.kc="Not",this.condition=t}function su(t,e,o){Hl.call(this,"PropertyIsNotEqualTo",t,e,o)}function au(t){var e=["Or"].concat(Array.prototype.slice.call(arguments));Wl.apply(this,e)}function pu(t,e,o){$l.call(this,"Within",t,e,o)}function hu(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Zl,e))}function lu(t,e,o){return new Kl(t,e,o)}function uu(t){yr.call(this),this.a=t||null,yu(this)}function cu(t){for(var e=[],o=0,i=t.length;o<i;++o)e.push(t[o].clone());return e}function fu(t){if(t.a)for(var e=0,o=t.a.length;e<o;++e)He(t.a[e],"change",t.s,t)}function yu(t){if(t.a)for(var e=0,o=t.a.length;e<o;++e)d(t.a[e],"change",t.s,t)}function gu(t){t=t||{},wl.call(this),this.defaultDataProjection=v(t.defaultDataProjection||"EPSG:4326"),t.featureProjection&&(this.f=v(t.featureProjection)),this.b=t.geometryName}function du(t,e){return t?Ml((0,bu[t.type])(t),!1,e):null}function vu(t,e){return(0,mu[t.U()])(Ml(t,!0,e),e)}(r=kl.prototype).Rc=function(t,e){var o=Dl(t.geometry,e),i=new x;return this.b&&i.Tc(this.b),i.Ra(o),e&&e.dg&&t.attributes[e.dg]&&i.jc(t.attributes[e.dg]),t.attributes&&i.H(t.attributes),i},r.yg=function(t,e){if(e=e||{},t.features){var o,i=[],r=t.features;for(e.dg=t.objectIdFieldName,t=0,o=r.length;t<o;++t)i.push(this.Rc(r[t],e));return i}return[this.Rc(t,e)]},r.Cg=Dl,r.Fg=function(t){return t.spatialReference&&t.spatialReference.wkid?v("EPSG:"+t.spatialReference.wkid):null},r.je=function(t,e){return Xl(t,Sl(this,e))},r.Zc=function(t,e){e=Sl(this,e);var o={},i=t.V();return i&&(o.geometry=Xl(i,e)),delete(i=t.N())[t.c],o.attributes=Zt(i)?{}:i,e&&e.featureProjection&&(o.spatialReference={wkid:v(e.featureProjection).mb.split(":").pop()}),o},r.he=function(t,e){e=Sl(this,e);for(var o=[],i=0,r=t.length;i<r;++i)o.push(this.Zc(t[i],e));return{features:o}},e(Wl,Vl),e(Zl,Wl),e(Kl,Vl),e(zl,Vl),e(Yl,zl),e(Hl,zl),e(ql,Hl),e(Jl,Hl),e(_l,Hl),e($l,Vl),e(Ql,$l),e(tu,zl),e(eu,zl),e(ou,zl),e(iu,Hl),e(ru,Hl),e(nu,Vl),e(su,Hl),e(au,Wl),e(pu,$l),e(uu,yr),(r=uu.prototype).clone=function(){var t=new uu(null);return t.oj(this.a),t},r.Kb=function(t,e,o,i){if(!(i<ct(this.G(),t,e)))for(var r=this.a,n=0,s=r.length;n<s;++n)i=r[n].Kb(t,e,o,i);return i},r.Mc=function(t,e){for(var o=this.a,i=0,r=o.length;i<r;++i)if(o[i].Mc(t,e))return!0;return!1},r.se=function(t){mt(t);for(var e=this.a,o=0,i=e.length;o<i;++o)Mt(t,e[o].G());return t},r.Vf=function(){return cu(this.a)},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];for(var o=[],i=this.a,r=!1,n=0,s=i.length;n<s;++n){var a=i[n],p=a.Vd(t);o.push(p),p!==a&&(r=!0)}if(r)return fu(t=new uu(null)),t.a=o,yu(t),t.s(),this.f[e]=t;this.g=t}return this},r.U=function(){return"GeometryCollection"},r.Xa=function(t){for(var e=this.a,o=0,i=e.length;o<i;++o)if(e[o].Xa(t))return!0;return!1},r.rotate=function(t,e){for(var o=this.a,i=0,r=o.length;i<r;++i)o[i].rotate(t,e);this.s()},r.scale=function(t,e,o){o=o||Lt(this.G());for(var i=this.a,r=0,n=i.length;r<n;++r)i[r].scale(t,e,o);this.s()},r.oj=function(t){t=cu(t),fu(this),this.a=t,yu(this),this.s()},r.Dc=function(t){for(var e=this.a,o=0,i=e.length;o<i;++o)e[o].Dc(t);this.s()},r.translate=function(t,e){for(var o=this.a,i=0,r=o.length;i<r;++i)o[i].translate(t,e);this.s()},r.ka=function(){fu(this),yr.prototype.ka.call(this)},e(gu,Pl);var bu={Point:function(t){return new m(t.coordinates)},LineString:function(t){return new S(t.coordinates)},Polygon:function(t){return new w(t.coordinates)},MultiPoint:function(t){return new P(t.coordinates)},MultiLineString:function(t){return new M(t.coordinates)},MultiPolygon:function(t){return new f(t.coordinates)},GeometryCollection:function(t,e){return new uu(t=t.geometries.map(function(t){return du(t,e)}))}},mu={Point:function(t){return{type:"Point",coordinates:t.X()}},LineString:function(t){return{type:"LineString",coordinates:t.X()}},Polygon:function(t,e){var o;return e&&(o=e.rightHanded),{type:"Polygon",coordinates:t.X(o)}},MultiPoint:function(t){return{type:"MultiPoint",coordinates:t.X()}},MultiLineString:function(t){return{type:"MultiLineString",coordinates:t.X()}},MultiPolygon:function(t,e){var o;return e&&(o=e.rightHanded),{type:"MultiPolygon",coordinates:t.X(o)}},GeometryCollection:function(t,o){return{type:"GeometryCollection",geometries:t.a.map(function(t){var e=Xt({},o);return delete e.featureProjection,vu(t,e)})}},Circle:function(){return{type:"GeometryCollection",geometries:[]}}};function wu(){this.i=new XMLSerializer,wl.call(this)}function xu(t,e,o){return 0<(t=Su(t,e,o)).length?t[0]:null}function Su(t,e,o){var i=[];for(e=e.firstChild;e;e=e.nextSibling)e.nodeType==Node.ELEMENT_NODE&&X(i,t.zc(e,o));return i}function Mu(t){this.featureType=(t=t||{}).featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.b={},this.b["http://www.opengis.net/gml"]={featureMember:hl(Mu.prototype.be),featureMembers:hl(Mu.prototype.be)},wu.call(this)}(r=gu.prototype).Rc=function(t,e){e=du((t="Feature"===t.type?t:{type:"Feature",geometry:t}).geometry,e);var o=new x;return this.b&&o.Tc(this.b),o.Ra(e),void 0!==t.id&&o.jc(t.id),t.properties&&o.H(t.properties),o},r.yg=function(t,e){if("FeatureCollection"===t.type)for(var o=[],i=0,r=(t=t.features).length;i<r;++i)o.push(this.Rc(t[i],e));else o=[this.Rc(t,e)];return o},r.Cg=du,r.Fg=function(t){var e;return(t=t.crs)?"name"==t.type?e=v(t.properties.name):"EPSG"==t.type?e=v("EPSG:"+t.properties.code):O(!1,36):e=this.defaultDataProjection,e},r.Zc=function(t,e){e=Sl(this,e);var o={type:"Feature"},i=t.a;return void 0!==i&&(o.id=i),(i=t.V())?o.geometry=vu(i,e):o.geometry=null,delete(e=t.N())[t.c],Zt(e)?o.properties=null:o.properties=e,o},r.he=function(t,e){e=Sl(this,e);for(var o=[],i=0,r=t.length;i<r;++i)o.push(this.Zc(t[i],e));return{type:"FeatureCollection",features:o}},r.je=function(t,e){return vu(t,Sl(this,e))},e(wu,wl),(r=wu.prototype).U=function(){return"xml"},r.Tb=function(t,e){return rl(t)?xu(this,t,e):nl(t)?this.xg(t,e):"string"==typeof t?xu(this,t=sl(t),e):null},r.xg=function(){return null},r.Oa=function(t,e){return rl(t)?Su(this,t,e):nl(t)?this.zc(t,e):"string"==typeof t?Su(this,t=sl(t),e):[]},r.Sc=function(t,e){if(!rl(t)){if(nl(t))return this.aj(t,e);"string"==typeof t&&sl(t)}return null},r.aj=function(){return null},r.kb=function(t){return rl(t)?this.Eg(t):nl(t)?this.kf(t):"string"==typeof t?(t=sl(t),this.Eg(t)):null},r.Eg=function(){return this.defaultDataProjection},r.kf=function(){return this.defaultDataProjection},r.Bd=function(t,e){return this.i.serializeToString(this.Vg(t,e))},r.Vg=function(){return null},r.Wb=function(t,e){return t=this.Xb(t,e),this.i.serializeToString(t)},r.Xb=function(){return null},r.$c=function(t,e){return t=this.ie(t,e),this.i.serializeToString(t)},r.ie=function(){return null},e(Mu,wu);var Pu=/^[\s\xa0]*$/;function Au(t){return Eu(t=il(t,!1))}function Eu(t){if(t=/^\s*(true|1)|(false|0)\s*$/.exec(t))return void 0!==t[1]||!1}function Tu(t){return t=il(t,!1),t=Date.parse(t),isNaN(t)?void 0:t/1e3}function ju(t){return Cu(t=il(t,!1))}function Cu(t){if(t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t))return parseFloat(t[1])}function Lu(t){return Ru(t=il(t,!1))}function Ru(t){if(t=/^\s*(\d+)\s*$/.exec(t))return parseInt(t[1],10)}function i(t){return il(t,!1).trim()}function Iu(t,e){ku(t,e?"1":"0")}function Nu(t,e){t.appendChild(el.createTextNode(e.toPrecision()))}function Fu(t,e){t.appendChild(el.createTextNode(e.toString()))}function ku(t,e){t.appendChild(el.createTextNode(e))}function y(t){Mu.call(this,t=t||{}),this.l=void 0!==t.surface&&t.surface,this.c=void 0!==t.curve&&t.curve,this.g=void 0===t.multiCurve||t.multiCurve,this.j=void 0===t.multiSurface||t.multiSurface,this.schemaLocation=t.schemaLocation||"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd"}function Du(t,e,o){o=(i=o[o.length-1]).hasZ;for(var i=i.srsName,r=(e=e.X()).length,n=Array(r),s=0;s<r;++s){var a=e[s],p=s,h=o,l="enu",l="en"===(l=i?v(i).b:l).substr(0,2)?a[0]+" "+a[1]:a[1]+" "+a[0];h&&(l+=" "+(a[2]||0)),n[p]=l}ku(t,n.join(" "))}(r=Mu.prototype).be=function(t,e){var o=t.localName,i=null;if("FeatureCollection"==o)i="http://www.opengis.net/wfs"===t.namespaceURI?g([],this.b,t,e,this):g(null,this.b,t,e,this);else if("featureMembers"==o||"featureMember"==o){var r=(y=e[0]).featureType,n=y.featureNS;if(!r&&t.childNodes){r=[];for(var n={},s=0,a=t.childNodes.length;s<a;++s)if(1===(c=t.childNodes[s]).nodeType){var p=c.nodeName.split(":").pop();if(-1===r.indexOf(p)){var h,l="",u=0,c=c.namespaceURI;for(h in n){if(n[h]===c){l=h;break}++u}l||(n[l="p"+u]=c),r.push(l+":"+p)}}"featureMember"!=o&&(y.featureType=r,y.featureNS=n)}"string"==typeof n&&(s=n,(n={}).p0=s);var f,y={},r=Array.isArray(r)?r:[r];for(f in n){for(p={},s=0,a=r.length;s<a;++s)(-1===r[s].indexOf(":")?"p0":r[s].split(":")[0])===f&&(p[r[s].split(":").pop()]=("featureMembers"==o?pl:hl)(this.wg,this));y[n[f]]=p}i=g("featureMember"==o?void 0:[],y,t,e)}return i=null===i?[]:i},r.gf=function(t,e){var o=e[0];if(o.srsName=t.firstElementChild.getAttribute("srsName"),t=g(null,this.Zg,t,e,this))return Ml(t,!1,o)},r.wg=function(t,e){var o,i=(i=t.getAttribute("fid"))||t.getAttributeNS("http://www.opengis.net/gml","id")||"",r={};for(t=t.firstElementChild;t;t=t.nextElementSibling){var n,s=t.localName;0===t.childNodes.length||1===t.childNodes.length&&(3===t.firstChild.nodeType||4===t.firstChild.nodeType)?(n=il(t,!1),Pu.test(n)&&(n=void 0),r[s]=n):("boundedBy"!==s&&(o=s),r[s]=this.gf(t,e))}return e=new x(r),o&&e.Tc(o),i&&e.jc(i),e},r.fj=function(t,e){if(t=this.ff(t,e))return(e=new m(null)).ba("XYZ",t),e},r.dj=function(t,e){if(t=g([],this.Nj,t,e,this))return new P(t)},r.cj=function(t,e){if(t=g([],this.Mj,t,e,this))return Ll(e=new M(null),t),e},r.ej=function(t,e){if(t=g([],this.Oj,t,e,this))return Fl(e=new f(null),t),e},r.Xi=function(t,e){gl(this.Rj,t,e,this)},r.Mh=function(t,e){gl(this.Kj,t,e,this)},r.Yi=function(t,e){gl(this.Sj,t,e,this)},r.hf=function(t,e){if(t=this.ff(t,e))return(e=new S(null)).ba("XYZ",t),e},r.wp=function(t,e){if(t=g(null,this.ke,t,e,this))return t},r.bj=function(t,e){if(t=this.ff(t,e))return kr(e=new Fr(null),"XYZ",t),e},r.jf=function(t,e){if((t=g([null],this.zf,t,e,this))&&t[0]){e=new w(null);for(var o=t[0],i=[o.length],r=1,n=t.length;r<n;++r)X(o,t[r]),i.push(o.length);return e.ba("XYZ",o,i),e}},r.ff=function(t,e){return g(null,this.ke,t,e,this)},r.Nj={"http://www.opengis.net/gml":{pointMember:pl(Mu.prototype.Xi),pointMembers:pl(Mu.prototype.Xi)}},r.Mj={"http://www.opengis.net/gml":{lineStringMember:pl(Mu.prototype.Mh),lineStringMembers:pl(Mu.prototype.Mh)}},r.Oj={"http://www.opengis.net/gml":{polygonMember:pl(Mu.prototype.Yi),polygonMembers:pl(Mu.prototype.Yi)}},r.Rj={"http://www.opengis.net/gml":{Point:pl(Mu.prototype.ff)}},r.Kj={"http://www.opengis.net/gml":{LineString:pl(Mu.prototype.hf)}},r.Sj={"http://www.opengis.net/gml":{Polygon:pl(Mu.prototype.jf)}},r.le={"http://www.opengis.net/gml":{LinearRing:hl(Mu.prototype.wp)}},r.aj=function(t,e){return(t=this.gf(t,[xl(this,t,e||{})]))||null},r.zc=function(t,e){var o={featureType:this.featureType,featureNS:this.featureNS};return e&&Xt(o,xl(this,t,e)),this.be(t,[o])||[]},r.kf=function(t){return v(this.srsName||t.firstElementChild.getAttribute("srsName"))},e(y,Mu),(r=y.prototype).Ap=function(t,e){if(t=g([],this.Lj,t,e,this))return Ll(e=new M(null),t),e},r.Bp=function(t,e){if(t=g([],this.Pj,t,e,this))return Fl(e=new f(null),t),e},r.ph=function(t,e){gl(this.Hj,t,e,this)},r.Aj=function(t,e){gl(this.Uj,t,e,this)},r.Ep=function(t,e){return g([null],this.Qj,t,e,this)},r.Hp=function(t,e){return g([null],this.Tj,t,e,this)},r.Fp=function(t,e){return g([null],this.zf,t,e,this)},r.zp=function(t,e){return g([null],this.ke,t,e,this)},r.cm=function(t,e){(t=g(void 0,this.le,t,e,this))&&e[e.length-1].push(t)},r.yk=function(t,e){(t=g(void 0,this.le,t,e,this))&&(e[e.length-1][0]=t)},r.gj=function(t,e){if((t=g([null],this.Vj,t,e,this))&&t[0]){e=new w(null);for(var o=t[0],i=[o.length],r=1,n=t.length;r<n;++r)X(o,t[r]),i.push(o.length);return e.ba("XYZ",o,i),e}},r.Zi=function(t,e){if(t=g([null],this.Ij,t,e,this))return(e=new S(null)).ba("XYZ",t),e},r.vp=function(t,e){return bt((t=g([null],this.Jj,t,e,this))[1][0],t[1][1],t[2][0],t[2][1])},r.xp=function(t,e){var o,i=il(t,!1),r=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/;for(t=[];o=r.exec(i);)t.push(parseFloat(o[1])),i=i.substr(o[0].length);if(""===i){if(i="enu","neu"===(i=(e=e[0].srsName)?v(e).b:i))for(e=0,i=t.length;e<i;e+=3)r=t[e],t[e]=t[e+1],t[e+1]=r;if(2==(e=t.length)&&t.push(0),e)return t}},r.Bg=function(t,e){var o=il(t,!1).replace(/^\s*|\s*$/g,""),i=e[0].srsName,r=t.parentNode.getAttribute("srsDimension");e="enu",i&&(e=v(i).b),o=o.split(/\s+/),i=2,t.getAttribute("srsDimension")?i=Ru(t.getAttribute("srsDimension")):t.getAttribute("dimension")?i=Ru(t.getAttribute("dimension")):r&&(i=Ru(r));for(var n,s=[],a=0,p=o.length;a<p;a+=i)t=parseFloat(o[a]),r=parseFloat(o[a+1]),n=3===i?parseFloat(o[a+2]):0,"en"===e.substr(0,2)?s.push(t,r,n):s.push(r,t,n);return s},r.ke={"http://www.opengis.net/gml":{pos:hl(y.prototype.xp),posList:hl(y.prototype.Bg)}},r.zf={"http://www.opengis.net/gml":{interior:y.prototype.cm,exterior:y.prototype.yk}},r.Zg={"http://www.opengis.net/gml":{Point:hl(Mu.prototype.fj),MultiPoint:hl(Mu.prototype.dj),LineString:hl(Mu.prototype.hf),MultiLineString:hl(Mu.prototype.cj),LinearRing:hl(Mu.prototype.bj),Polygon:hl(Mu.prototype.jf),MultiPolygon:hl(Mu.prototype.ej),Surface:hl(y.prototype.gj),MultiSurface:hl(y.prototype.Bp),Curve:hl(y.prototype.Zi),MultiCurve:hl(y.prototype.Ap),Envelope:hl(y.prototype.vp)}},r.Lj={"http://www.opengis.net/gml":{curveMember:pl(y.prototype.ph),curveMembers:pl(y.prototype.ph)}},r.Pj={"http://www.opengis.net/gml":{surfaceMember:pl(y.prototype.Aj),surfaceMembers:pl(y.prototype.Aj)}},r.Hj={"http://www.opengis.net/gml":{LineString:pl(Mu.prototype.hf),Curve:pl(y.prototype.Zi)}},r.Uj={"http://www.opengis.net/gml":{Polygon:pl(Mu.prototype.jf),Surface:pl(y.prototype.gj)}},r.Vj={"http://www.opengis.net/gml":{patches:hl(y.prototype.Ep)}},r.Ij={"http://www.opengis.net/gml":{segments:hl(y.prototype.Hp)}},r.Jj={"http://www.opengis.net/gml":{lowerCorner:pl(y.prototype.Bg),upperCorner:pl(y.prototype.Bg)}},r.Qj={"http://www.opengis.net/gml":{PolygonPatch:hl(y.prototype.Fp)}},r.Tj={"http://www.opengis.net/gml":{LineStringSegment:hl(y.prototype.zp)}},r.ni=function(t,e,o){var i=o[o.length-1].srsName,r=(i&&t.setAttribute("srsName",i),i=ol(t.namespaceURI,"pos"),t.appendChild(i),t=(o=o[o.length-1]).hasZ,o.srsName);o="enu",r&&(o=v(r).b),e=e.X(),o="en"===o.substr(0,2)?e[0]+" "+e[1]:e[1]+" "+e[0],t&&(o+=" "+(e[2]||0)),ku(i,o)};var r,Ou={"http://www.opengis.net/gml":{lowerCorner:c(ku),upperCorner:c(ku)}},Uu=((r=y.prototype).jn=function(t,e,o){var i=o[o.length-1].srsName;i&&t.setAttribute("srsName",i),vl({node:t},Ou,fl,[e[0]+" "+e[1],e[2]+" "+e[3]],o,["lowerCorner","upperCorner"],this)},r.ki=function(t,e,o){var i=o[o.length-1].srsName;i&&t.setAttribute("srsName",i),i=ol(t.namespaceURI,"posList"),t.appendChild(i),Du(i,e,o)},r.hn=function(t,e){e=(t=e[e.length-1]).node;var o=t.exteriorWritten;return void 0===o&&(t.exteriorWritten=!0),ol(e.namespaceURI,void 0!==o?"interior":"exterior")},r.Se=function(t,e,o){var i=(r=o[o.length-1]).hasZ,r=r.srsName;"PolygonPatch"!==t.nodeName&&r&&t.setAttribute("srsName",r),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName?(e=e.Sd(),vl({node:t,hasZ:i,srsName:r},Xu,this.hn,e,o,void 0,this)):"Surface"===t.nodeName&&(i=ol(t.namespaceURI,"patches"),t.appendChild(i),t=ol(i.namespaceURI,"PolygonPatch"),i.appendChild(t),this.Se(t,e,o))},r.Re=function(t,e,o){var i=o[o.length-1].srsName;"LineStringSegment"!==t.nodeName&&i&&t.setAttribute("srsName",i),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName?(i=ol(t.namespaceURI,"posList"),t.appendChild(i),Du(i,e,o)):"Curve"===t.nodeName&&(i=ol(t.namespaceURI,"segments"),t.appendChild(i),t=ol(i.namespaceURI,"LineStringSegment"),i.appendChild(t),this.Re(t,e,o))},r.mi=function(t,e,o){var i=(n=o[o.length-1]).hasZ,r=n.srsName,n=n.surface;r&&t.setAttribute("srsName",r),e=e.Td(),vl({node:t,hasZ:i,srsName:r,surface:n},Uu,this.o,e,o,void 0,this)},r.kn=function(t,e,o){var i=(r=o[o.length-1]).srsName,r=r.hasZ;i&&t.setAttribute("srsName",i),e=e.Zd(),vl({node:t,hasZ:r,srsName:i},Gu,cl("pointMember"),e,o,void 0,this)},r.li=function(t,e,o){var i=(n=o[o.length-1]).hasZ,r=n.srsName,n=n.curve;r&&t.setAttribute("srsName",r),e=e.gd(),vl({node:t,hasZ:i,srsName:r,curve:n},Bu,this.o,e,o,void 0,this)},r.oi=function(t,e,o){var i=ol(t.namespaceURI,"LinearRing");t.appendChild(i),this.ki(i,e,o)},r.pi=function(t,e,o){var i=this.a(e,o);i&&(t.appendChild(i),this.Se(i,e,o))},r.ln=function(t,e,o){var i=ol(t.namespaceURI,"Point");t.appendChild(i),this.ni(i,e,o)},r.ji=function(t,e,o){var i=this.a(e,o);i&&(t.appendChild(i),this.Re(i,e,o))},r.od=function(t,e,o){var i=o[o.length-1],r=Xt({},i);r.node=t,t=Array.isArray(e)?i.dataProjection?Pe(e,i.featureProjection,i.dataProjection):e:Ml(e,!0,i),vl(r,Vu,this.a,[t],o,void 0,this)},r.ii=function(t,e,o){var i=e.a;i&&t.setAttribute("fid",i);var r=(i=o[o.length-1]).featureNS,n=e.c,s=(i.lb||(i.lb={},i.lb[r]={}),e.N()),a=(e=[],[]);for(h in s){var p=s[h];null!==p&&(e.push(h),a.push(p),h==n||p instanceof yr?h in i.lb[r]||(i.lb[r][h]=c(this.od,this)):h in i.lb[r]||(i.lb[r][h]=c(ku)))}var h=Xt({},i);h.node=t,vl(h,i.lb,cl(void 0,r),a,o,e)},{"http://www.opengis.net/gml":{surfaceMember:c(y.prototype.pi),polygonMember:c(y.prototype.pi)}}),Gu={"http://www.opengis.net/gml":{pointMember:c(y.prototype.ln)}},Bu={"http://www.opengis.net/gml":{lineStringMember:c(y.prototype.ji),curveMember:c(y.prototype.ji)}},Xu={"http://www.opengis.net/gml":{exterior:c(y.prototype.oi),interior:c(y.prototype.oi)}},Vu={"http://www.opengis.net/gml":{Curve:c(y.prototype.Re),MultiCurve:c(y.prototype.li),Point:c(y.prototype.ni),MultiPoint:c(y.prototype.kn),LineString:c(y.prototype.Re),MultiLineString:c(y.prototype.li),LinearRing:c(y.prototype.ki),Polygon:c(y.prototype.Se),MultiPolygon:c(y.prototype.mi),Surface:c(y.prototype.Se),MultiSurface:c(y.prototype.mi),Envelope:c(y.prototype.jn)}},Wu={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};function Zu(t){Mu.call(this,t=t||{}),this.b["http://www.opengis.net/gml"].featureMember=pl(Mu.prototype.be),this.schemaLocation=t.schemaLocation||"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd"}function Ku(t){return(t=ol(t,"coordinates")).setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," "),t}function zu(t,e,o){o=(r=o[o.length-1]).hasZ;for(var i,r=r.srsName,n=(e=e.X()).length,s=Array(n),a=0;a<n;++a)i=e[a],s[a]=Yu(i,r,o);ku(t,s.join(" "))}function Yu(t,e,o){var i="enu";return e="en"===(i=e?v(e).b:i).substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0],o&&(e+=","+(t[2]||0)),e}y.prototype.o=function(t,e){return ol("http://www.opengis.net/gml",Wu[e[e.length-1].node.nodeName])},y.prototype.a=function(t,e){e=(r=e[e.length-1]).multiSurface;var o=r.surface,i=r.curve,r=r.multiCurve;return Array.isArray(t)?t="Envelope":"MultiPolygon"===(t=t.U())&&!0===e?t="MultiSurface":"Polygon"===t&&!0===o?t="Surface":"LineString"===t&&!0===i?t="Curve":"MultiLineString"===t&&!0===r&&(t="MultiCurve"),ol("http://www.opengis.net/gml",t)},y.prototype.ie=function(t,e){e=Sl(this,e);var o=ol("http://www.opengis.net/gml","geom"),i={node:o,hasZ:this.hasZ,srsName:this.srsName,curve:this.c,surface:this.l,multiSurface:this.j,multiCurve:this.g};return e&&Xt(i,e),this.od(o,t,[i]),o},y.prototype.Xb=function(t,e){e=Sl(this,e);var o=ol("http://www.opengis.net/gml","featureMembers"),i=(o.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",this.schemaLocation),{srsName:this.srsName,hasZ:this.hasZ,curve:this.c,surface:this.l,multiSurface:this.j,multiCurve:this.g,featureNS:this.featureNS,featureType:this.featureType}),r=(e&&Xt(i,e),(e=[i])[e.length-1]),i=r.featureType,n=r.featureNS,s={};return s[n]={},s[n][i]=c(this.ii,this),(r=Xt({},r)).node=o,vl(r,s,cl(i,n),t,e),o},e(Zu,Mu),(r=Zu.prototype).$i=function(t,e){t=il(t,!1).replace(/^\s*|\s*$/g,"");var o=e[0].srsName;e="enu",(o=o&&v(o))&&(e=o.b);for(var i,r,n=[],s=0,a=(t=t.trim().split(/\s+/)).length;s<a;s++)r=t[s].split(/,+/),o=parseFloat(r[0]),i=parseFloat(r[1]),r=3===r.length?parseFloat(r[2]):0,"en"===e.substr(0,2)?n.push(o,i,r):n.push(i,o,r);return n},r.tp=function(t,e){return bt((t=g([null],this.Gj,t,e,this))[1][0],t[1][1],t[1][3],t[1][4])},r.am=function(t,e){(t=g(void 0,this.le,t,e,this))&&e[e.length-1].push(t)},r.bp=function(t,e){(t=g(void 0,this.le,t,e,this))&&(e[e.length-1][0]=t)},r.ke={"http://www.opengis.net/gml":{coordinates:hl(Zu.prototype.$i)}},r.zf={"http://www.opengis.net/gml":{innerBoundaryIs:Zu.prototype.am,outerBoundaryIs:Zu.prototype.bp}},r.Gj={"http://www.opengis.net/gml":{coordinates:pl(Zu.prototype.$i)}},r.Zg={"http://www.opengis.net/gml":{Point:hl(Mu.prototype.fj),MultiPoint:hl(Mu.prototype.dj),LineString:hl(Mu.prototype.hf),MultiLineString:hl(Mu.prototype.cj),LinearRing:hl(Mu.prototype.bj),Polygon:hl(Mu.prototype.jf),MultiPolygon:hl(Mu.prototype.ej),Box:hl(Zu.prototype.tp)}},r.jg=function(t,e){e=(i=e[e.length-1]).multiSurface;var o=i.surface,i=i.multiCurve;return Array.isArray(t)?t="Envelope":"MultiPolygon"===(t=t.U())&&!0===e?t="MultiSurface":"Polygon"===t&&!0===o?t="Surface":"MultiLineString"===t&&!0===i&&(t="MultiCurve"),ol("http://www.opengis.net/gml",t)},r.ai=function(t,e,o){var i=o[o.length-1],r=Xt({},i);r.node=t,t=Array.isArray(e)?i.dataProjection?Pe(e,i.featureProjection,i.dataProjection):e:Ml(e,!0,i),vl(r,Hu,this.jg,[t],o,void 0,this)},r.Pe=function(t,e,o){var i=o[o.length-1].srsName;"LineStringSegment"!==t.nodeName&&i&&t.setAttribute("srsName",i),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName?(i=Ku(t.namespaceURI),t.appendChild(i),zu(i,e,o)):"Curve"===t.nodeName&&(i=ol(t.namespaceURI,"segments"),t.appendChild(i),t=ol(i.namespaceURI,"LineStringSegment"),i.appendChild(t),this.Pe(t,e,o))},r.Qe=function(t,e,o){var i=(r=o[o.length-1]).hasZ,r=r.srsName;"PolygonPatch"!==t.nodeName&&r&&t.setAttribute("srsName",r),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName?(e=e.Sd(),vl({node:t,hasZ:i,srsName:r},qu,this.dn,e,o,void 0,this)):"Surface"===t.nodeName&&(i=ol(t.namespaceURI,"patches"),t.appendChild(i),t=ol(i.namespaceURI,"PolygonPatch"),i.appendChild(t),this.Qe(t,e,o))},r.dn=function(t,e){e=(t=e[e.length-1]).node;var o=t.exteriorWritten;return void 0===o&&(t.exteriorWritten=!0),ol(e.namespaceURI,void 0!==o?"innerBoundaryIs":"outerBoundaryIs")},r.gi=function(t,e,o){var i=ol(t.namespaceURI,"LinearRing");t.appendChild(i),this.ci(i,e,o)},r.di=function(t,e,o){var i=(n=o[o.length-1]).hasZ,r=n.srsName,n=n.curve;r&&t.setAttribute("srsName",r),e=e.gd(),vl({node:t,hasZ:i,srsName:r,curve:n},_u,this.a,e,o,void 0,this)},r.fi=function(t,e,o){var i=o[o.length-1],r=(o=i.hasZ,i.srsName);r&&t.setAttribute("srsName",r),i=Ku(t.namespaceURI),t.appendChild(i),ku(i,t=Yu(t=e.X(),r,o))},r.fn=function(t,e,o){var i=o[o.length-1],r=i.hasZ;(i=i.srsName)&&t.setAttribute("srsName",i),e=e.Zd(),vl({node:t,hasZ:r,srsName:i},Ju,cl("pointMember"),e,o,void 0,this)},r.gn=function(t,e,o){var i=ol(t.namespaceURI,"Point");t.appendChild(i),this.fi(i,e,o)},r.bi=function(t,e,o){var i=this.jg(e,o);i&&(t.appendChild(i),this.Pe(i,e,o))},r.ci=function(t,e,o){var i=o[o.length-1].srsName;i&&t.setAttribute("srsName",i),i=Ku(t.namespaceURI),t.appendChild(i),zu(i,e,o)},r.ei=function(t,e,o){var i=(n=o[o.length-1]).hasZ,r=n.srsName,n=n.surface;r&&t.setAttribute("srsName",r),e=e.Td(),vl({node:t,hasZ:i,srsName:r,surface:n},Qu,this.a,e,o,void 0,this)},r.hi=function(t,e,o){var i=this.jg(e,o);i&&(t.appendChild(i),this.Qe(i,e,o))},r.en=function(t,e,o){var i=o[o.length-1].srsName;i&&t.setAttribute("srsName",i),vl({node:t},tc,fl,[e[0]+" "+e[1],e[2]+" "+e[3]],o,["lowerCorner","upperCorner"],this)};var Hu={"http://www.opengis.net/gml":{Curve:c(Zu.prototype.Pe),MultiCurve:c(Zu.prototype.di),Point:c(Zu.prototype.fi),MultiPoint:c(Zu.prototype.fn),LineString:c(Zu.prototype.Pe),MultiLineString:c(Zu.prototype.di),LinearRing:c(Zu.prototype.ci),Polygon:c(Zu.prototype.Qe),MultiPolygon:c(Zu.prototype.ei),Surface:c(Zu.prototype.Qe),MultiSurface:c(Zu.prototype.ei),Envelope:c(Zu.prototype.en)}},qu={"http://www.opengis.net/gml":{outerBoundaryIs:c(Zu.prototype.gi),innerBoundaryIs:c(Zu.prototype.gi)}},Ju={"http://www.opengis.net/gml":{pointMember:c(Zu.prototype.gn)}},_u={"http://www.opengis.net/gml":{lineStringMember:c(Zu.prototype.bi),curveMember:c(Zu.prototype.bi)}},$u=(Zu.prototype.a=function(t,e){return ol("http://www.opengis.net/gml",$u[e[e.length-1].node.nodeName])},{MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"}),Qu={"http://www.opengis.net/gml":{surfaceMember:c(Zu.prototype.hi),polygonMember:c(Zu.prototype.hi)}},tc={"http://www.opengis.net/gml":{lowerCorner:c(ku),upperCorner:c(ku)}};function ec(t){t=t||{},wu.call(this),this.defaultDataProjection=v("EPSG:4326"),this.b=t.readExtensions}e(ec,wu);var oc=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"];function ic(t,e,o,i){return t.push(parseFloat(o.getAttribute("lon")),parseFloat(o.getAttribute("lat"))),"ele"in i?(t.push(i.ele),delete i.ele,e.hasZ=!0):t.push(0),"time"in i?(t.push(i.time),delete i.time,e.hasM=!0):t.push(0),t}function rc(t,e,o){var i="XY",r=2;if(t.hasZ&&t.hasM?(i="XYZM",r=4):t.hasZ?(i="XYZ",r=3):t.hasM&&(i="XYM",r=3),4!==r){for(var n=0,s=e.length/4;n<s;n++)e[n*r]=e[4*n],e[n*r+1]=e[4*n+1],t.hasZ&&(e[n*r+2]=e[4*n+2]),t.hasM&&(e[n*r+2]=e[4*n+3]);if(e.length=e.length/4*r,o)for(n=0,s=o.length;n<s;n++)o[n]=o[n]/4*r}return i}function nc(t,e){var o=e[e.length-1],i=t.getAttribute("href");null!==i&&(o.link=i),gl(cc,t,e)}function sc(t,e){e[e.length-1].extensionsNode_=t}function ac(t,e){var o,i,r=e[0];if(t=g({flatCoordinates:[],layoutOptions:{}},fc,t,e))return e=t.flatCoordinates,delete t.flatCoordinates,o=t.layoutOptions,delete t.layoutOptions,o=rc(o,e),(i=new S(null)).ba(o,e),Ml(i,!1,r),(r=new x(i)).H(t),r}function pc(t,e){var o,i,r,n=e[0];if(t=g({flatCoordinates:[],ends:[],layoutOptions:{}},gc,t,e))return e=t.flatCoordinates,delete t.flatCoordinates,o=t.ends,delete t.ends,i=t.layoutOptions,delete t.layoutOptions,i=rc(i,e,o),(r=new M(null)).ba(i,e,o),Ml(r,!1,n),(n=new x(r)).H(t),n}function hc(t,e){var o,i=e[0];if(e=g({},bc,t,e))return Ml(t=new m(t=ic([],o={},t,e),o=rc(o,t)),!1,i),(i=new x(t)).H(e),i}var lc={rte:ac,trk:pc,wpt:hc},uc=l(oc,{rte:pl(ac),trk:pl(pc),wpt:pl(hc)}),cc=l(oc,{text:o(i,"linkText"),type:o(i,"linkType")}),fc=l(oc,{name:o(i),cmt:o(i),desc:o(i),src:o(i),link:nc,number:o(Lu),extensions:sc,type:o(i),rtept:function(t,e){var o=g({},yc,t,e);o&&ic((e=e[e.length-1]).flatCoordinates,e.layoutOptions,t,o)}}),yc=l(oc,{ele:o(ju),time:o(Tu)}),gc=l(oc,{name:o(i),cmt:o(i),desc:o(i),src:o(i),link:nc,number:o(Lu),type:o(i),extensions:sc,trkseg:function(t,e){var o=e[e.length-1];gl(dc,t,e),o.ends.push(o.flatCoordinates.length)}}),dc=l(oc,{trkpt:function(t,e){var o=g({},vc,t,e);o&&ic((e=e[e.length-1]).flatCoordinates,e.layoutOptions,t,o)}}),vc=l(oc,{ele:o(ju),time:o(Tu)}),bc=l(oc,{ele:o(ju),time:o(Tu),magvar:o(ju),geoidheight:o(ju),name:o(i),cmt:o(i),desc:o(i),src:o(i),link:nc,sym:o(i),type:o(i),fix:o(i),sat:o(Lu),hdop:o(ju),vdop:o(ju),pdop:o(ju),ageofdgpsdata:o(ju),dgpsid:o(Lu),extensions:sc});function mc(t,e){for(var o=0,i=(e=e||[]).length;o<i;++o){var r,n=e[o];t.b&&(r=n.get("extensionsNode_")||null,t.b(n,r)),n.set("extensionsNode_",void 0)}}function wc(t,e,o){t.setAttribute("href",e),e=o[o.length-1].properties,vl({node:t},Mc,fl,[e.linkText,e.linkType],o,Sc)}function xc(t,e,o){var i=o[o.length-1],r=i.node.namespaceURI,n=i.properties;switch(t.setAttributeNS(null,"lat",e[1]),t.setAttributeNS(null,"lon",e[0]),i.geometryLayout){case"XYZM":e[3]&&(n.time=e[3]);case"XYZ":e[2]&&(n.ele=e[2]);break;case"XYM":e[2]&&(n.time=e[2])}i=yl(n,e=("rtept"==t.nodeName?Ec:Rc)[r]),vl({node:t,properties:n},Ic,fl,i,o,e)}ec.prototype.xg=function(t,e){var o;return D(oc,t.namespaceURI)&&(o=lc[t.localName])&&(t=o(t,[xl(this,t,e)]))?(mc(this,[t]),t):null},ec.prototype.zc=function(t,e){return D(oc,t.namespaceURI)&&"gpx"==t.localName&&(t=g([],uc,t,[xl(this,t,e)]))?(mc(this,t),t):[]};var Sc=["text","type"],Mc=l(oc,{text:c(ku),type:c(ku)}),Pc=l(oc,"name cmt desc src link number type rtept".split(" ")),Ac=l(oc,{name:c(ku),cmt:c(ku),desc:c(ku),src:c(ku),link:c(wc),number:c(Fu),type:c(ku),rtept:ul(c(xc))}),Ec=l(oc,["ele","time"]),Tc=l(oc,"name cmt desc src link number type trkseg".split(" ")),jc=l(oc,{name:c(ku),cmt:c(ku),desc:c(ku),src:c(ku),link:c(wc),number:c(Fu),type:c(ku),trkseg:ul(c(function(t,e,o){vl({node:t,geometryLayout:e.ja,properties:{}},Lc,Cc,e.X(),o)}))}),Cc=cl("trkpt"),Lc=l(oc,{trkpt:c(xc)}),Rc=l(oc,"ele time magvar geoidheight name cmt desc src link sym type fix sat hdop vdop pdop ageofdgpsdata dgpsid".split(" ")),Ic=l(oc,{ele:c(Nu),time:c(function(t,e){e=new Date(1e3*e),t.appendChild(el.createTextNode(e.getUTCFullYear()+"-"+Qi(e.getUTCMonth()+1)+"-"+Qi(e.getUTCDate())+"T"+Qi(e.getUTCHours())+":"+Qi(e.getUTCMinutes())+":"+Qi(e.getUTCSeconds())+"Z"))}),magvar:c(Nu),geoidheight:c(Nu),name:c(ku),cmt:c(ku),desc:c(ku),src:c(ku),link:c(wc),sym:c(ku),type:c(ku),fix:c(ku),sat:c(Fu),hdop:c(Nu),vdop:c(Nu),pdop:c(Nu),ageofdgpsdata:c(Nu),dgpsid:c(Fu)}),Nc={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Fc(t,e){if(t=(t=t.V())&&Nc[t.U()])return ol(e[e.length-1].node.namespaceURI,t)}var kc=l(oc,{rte:c(function(t,e,o){var i=o[0],r=e.N();t={node:t,properties:r},(e=e.V())&&(e=Ml(e,!0,i),t.geometryLayout=e.ja,r.rtept=e.X()),r=yl(r,i=Pc[o[o.length-1].node.namespaceURI]),vl(t,Ac,fl,r,o,i)}),trk:c(function(t,e,o){var i=o[0],r=e.N();t={node:t,properties:r},(e=e.V())&&(e=Ml(e,!0,i),r.trkseg=e.gd()),r=yl(r,i=Tc[o[o.length-1].node.namespaceURI]),vl(t,jc,fl,r,o,i)}),wpt:c(function(t,e,o){var i=o[0],r=o[o.length-1];r.properties=e.N(),(e=e.V())&&(e=Ml(e,!0,i),r.geometryLayout=e.ja,xc(t,e.X(),o))})});function Dc(){wl.call(this)}function Oc(t){return"string"==typeof t?t:""}function Uc(t){t=t||{},wl.call(this),this.defaultDataProjection=v("EPSG:4326"),this.b=t.altitudeMode||"none"}ec.prototype.Xb=function(t,e){e=Sl(this,e);var o=ol("http://www.topografix.com/GPX/1/1","gpx");return 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.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),o.setAttribute("version","1.1"),o.setAttribute("creator","OpenLayers"),vl({node:o},kc,Fc,t,[e]),o},e(Dc,wl),(r=Dc.prototype).U=function(){return"text"},r.Tb=function(t,e){return this.ae(Oc(t),Sl(this,e))},r.Oa=function(t,e){return this.zg(Oc(t),Sl(this,e))},r.Sc=function(t,e){return this.wd(Oc(t),Sl(this,e))},r.kb=function(){return this.defaultDataProjection},r.Bd=function(t,e){return this.ge(t,Sl(this,e))},r.Wb=function(t,e){return this.Wg(t,Sl(this,e))},r.$c=function(t,e){return this.Cd(t,Sl(this,e))},e(Uc,Dc);var Gc,Bc,Xc,Vc,Wc,Zc,Kc,zc,Yc,Hc,qc,Jc,_c,$c,Qc,tf=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,ef=/^H.([A-Z]{3}).*?:(.*)/,of=/^HFDTE(\d{2})(\d{2})(\d{2})/,rf=/\r\n|\r|\n/;function nf(t,e,o,i,r,n){eo.call(this),this.j=null,this.M=t||new Image,null!==i&&(this.M.crossOrigin=i),this.c=n?document.createElement("CANVAS"):null,this.g=n,this.f=null,this.i=r,this.a=o,this.o=e,this.l=!1,2==this.i&&sf(this)}function sf(e){var t=Po(1,1);try{t.drawImage(e.M,0,0),t.getImageData(0,0,1,1)}catch(t){e.l=!0}}function af(t){this.o=void 0!==(t=t||{}).anchor?t.anchor:[.5,.5],this.u=null,this.i=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.C=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.B=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.ra=void 0!==t.crossOrigin?t.crossOrigin:null;var e=void 0!==t.img?t.img:null,o=void 0!==t.imgSize?t.imgSize:null,i=t.src,r=(O(!(void 0!==i&&e),4),O(!e||o,5),O(void 0!==(i=void 0!==i&&i.length||!e?i:e.src||U(e).toString())&&0<i.length,6),void 0!==t.src?0:2),n=(this.j=void 0!==t.color?vo(t.color):null,this.ra),s=this.j,a=vs.get(i,n,s);a||(a=new nf(e,i,o,n,r,s),vs.set(i,n,s,a)),this.b=a,this.oa=void 0!==t.offset?t.offset:[0,0],this.c=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.S=null,this.D=void 0!==t.size?t.size:null,Zh.call(this,{opacity:void 0!==t.opacity?t.opacity:1,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView})}function pf(t){this.a=(t=t||{}).font,this.f=t.rotation,this.o=t.rotateWithView,this.b=t.scale,this.Ia=t.text,this.g=t.textAlign,this.j=t.textBaseline,this.Va=void 0!==t.fill?t.fill:new Hh({color:"#333"}),this.Ya=void 0!==t.stroke?t.stroke:null,this.i=void 0!==t.offsetX?t.offsetX:0,this.c=void 0!==t.offsetY?t.offsetY:0}function hf(t){t=t||{},wu.call(this),Gc||(Xc=new Hh({color:Bc=[255,255,255,1]}),Zc=Wc="pixels",Hc=new af({anchor:Vc=[20,2],anchorOrigin:"bottom-left",anchorXUnits:Wc,anchorYUnits:Zc,crossOrigin:"anonymous",rotation:0,scale:Yc=.5,size:Kc=[64,64],src:zc="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"}),qc="NO_IMAGE",Jc=new hp({color:Bc,width:1}),_c=new hp({color:[51,51,51,1],width:2}),$c=new pf({font:"bold 16px Helvetica",fill:Xc,stroke:_c,scale:.8}),Qc=new qh({fill:Xc,image:Hc,text:$c,stroke:Jc,zIndex:0}),Gc=[Qc]),this.defaultDataProjection=v("EPSG:4326"),this.a=t.defaultStyle||Gc,this.c=void 0===t.extractStyles||t.extractStyles,this.j=void 0===t.writeStyles||t.writeStyles,this.b={},this.g=void 0===t.showPointNames||t.showPointNames}(r=Uc.prototype).ae=function(t,e){for(var o=this.b,i=t.split(rf),r=(t={},[]),n=2e3,s=0,a=1,p=-1,h=0,l=i.length;h<l;++h){var u,c,f,y,g,d=i[h];"B"==d.charAt(0)?(u=tf.exec(d))&&(d=parseInt(u[1],10),c=parseInt(u[2],10),f=parseInt(u[3],10),y=parseInt(u[4],10)+parseInt(u[5],10)/6e4,"S"==u[6]&&(y=-y),g=parseInt(u[7],10)+parseInt(u[8],10)/6e4,"W"==u[9]&&(g=-g),r.push(g,y),"none"!=o&&r.push("gps"==o?parseInt(u[11],10):"barometric"==o?parseInt(u[12],10):0),(u=Date.UTC(n,s,a,d,c,f))<p&&(u=Date.UTC(n,s,a+1,d,c,f)),r.push(u/1e3),p=u):"H"==d.charAt(0)&&((u=of.exec(d))?(a=parseInt(u[1],10),s=parseInt(u[2],10)-1,n=2e3+parseInt(u[3],10)):(u=ef.exec(d))&&(t[u[1]]=u[2].trim()))}return r.length?((i=new S(null)).ba("none"==o?"XYM":"XYZM",r),(e=new x(Ml(i,!1,e))).H(t),e):null},r.zg=function(t,e){return(t=this.ae(t,e))?[t]:[]},r.ge=function(){},r.Wg=function(){},r.Cd=function(){},r.wd=function(){},e(nf,eo),nf.prototype.v=function(){this.i=3,this.f.forEach(qe),this.f=null,this.b("change")},nf.prototype.u=function(){if(this.i=2,this.a&&(this.M.width=this.a[0],this.M.height=this.a[1]),this.a=[this.M.width,this.M.height],this.f.forEach(qe),this.f=null,sf(this),!this.l&&null!==this.g){this.c.width=this.M.width,this.c.height=this.M.height;var t=this.c.getContext("2d");t.drawImage(this.M,0,0);for(var e=t.getImageData(0,0,this.M.width,this.M.height),o=e.data,i=this.g[0]/255,r=this.g[1]/255,n=this.g[2]/255,s=0,a=o.length;s<a;s+=4)o[s]*=i,o[s+1]*=r,o[s+2]*=n;t.putImageData(e,0,0)}this.b("change")},nf.prototype.Y=function(){return this.c||this.M},nf.prototype.load=function(){if(0==this.i){this.i=1,this.f=[Ye(this.M,"error",this.v,this),Ye(this.M,"load",this.u,this)];try{this.M.src=this.o}catch(t){this.v()}}},e(af,Zh),(r=af.prototype).clone=function(){var t,e,o=this.Y(1);return 2===this.b.i&&("IMG"===o.tagName.toUpperCase()?t=o.cloneNode(!0):(e=(t=document.createElement("canvas")).getContext("2d"),t.width=o.width,t.height=o.height,e.drawImage(o,0,0))),new af({anchor:this.o.slice(),anchorOrigin:this.i,anchorXUnits:this.C,anchorYUnits:this.B,crossOrigin:this.ra,color:this.j&&this.j.slice?this.j.slice():this.j||void 0,img:t||void 0,imgSize:t?this.b.a.slice():void 0,src:t?void 0:this.b.o,offset:this.oa.slice(),offsetOrigin:this.c,size:null!==this.D?this.D.slice():void 0,opacity:this.f,scale:this.a,snapToPixel:this.v,rotation:this.g,rotateWithView:this.l})},r.Hc=function(){if(this.u)return this.u;var t=this.o,e=this.ic();if("fraction"==this.C||"fraction"==this.B){if(!e)return null;t=this.o.slice(),"fraction"==this.C&&(t[0]*=e[0]),"fraction"==this.B&&(t[1]*=e[1])}if("top-left"!=this.i){if(!e)return null;t===this.o&&(t=this.o.slice()),"top-right"!=this.i&&"bottom-right"!=this.i||(t[0]=-t[0]+e[0]),"bottom-left"!=this.i&&"bottom-right"!=this.i||(t[1]=-t[1]+e[1])}return this.u=t},r.Lo=function(){return this.j},r.Y=function(t){return this.b.Y(t)},r.ye=function(){return this.b.a},r.Ye=function(){return this.b.i},r.qg=function(){var t,e,o,i=this.b;return i.j||(i.l?((o=Po(t=i.a[0],e=i.a[1])).fillRect(0,0,t,e),i.j=o.canvas):i.j=i.M),i.j},r.Oc=function(){if(this.S)return this.S;var t=this.oa;if("top-left"!=this.c){var e=this.ic(),o=this.b.a;if(!e||!o)return null;t=t.slice(),"top-right"!=this.c&&"bottom-right"!=this.c||(t[0]=o[0]-e[0]-t[0]),"bottom-left"!=this.c&&"bottom-right"!=this.c||(t[1]=o[1]-e[1]-t[1])}return this.S=t},r.Mo=function(){return this.b.o},r.ic=function(){return this.D||this.b.a},r.Nh=function(t,e){return d(this.b,"change",t,e)},r.load=function(){this.b.load()},r.Bj=function(t,e){He(this.b,"change",t,e)},(r=pf.prototype).clone=function(){return new pf({font:this.a,rotation:this.f,rotateWithView:this.o,scale:this.b,text:this.Na(),textAlign:this.g,textBaseline:this.j,fill:this.Fa()?this.Fa().clone():void 0,stroke:this.Ga()?this.Ga().clone():void 0,offsetX:this.i,offsetY:this.c})},r.Nk=function(){return this.a},r.cl=function(){return this.i},r.dl=function(){return this.c},r.Fa=function(){return this.Va},r.Ro=function(){return this.o},r.So=function(){return this.f},r.To=function(){return this.b},r.Ga=function(){return this.Ya},r.Na=function(){return this.Ia},r.nl=function(){return this.g},r.ol=function(){return this.j},r.nj=function(t){this.a=t},r.sj=function(t){this.i=t},r.tj=function(t){this.c=t},r.pf=function(t){this.Va=t},r.Uo=function(t){this.f=t},r.Si=function(t){this.b=t},r.qf=function(t){this.Ya=t},r.xd=function(t){this.Ia=t},r.vj=function(t){this.g=t},r.hq=function(t){this.j=t},e(hf,wu);var lf=["http://www.google.com/kml/ext/2.2"],n=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],uf={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"};function cf(t,e){var o,i=[0,0],r="start";return t.Y()&&2==(o=null===(o=t.Y().ye())?Kc:o).length&&(r=t.Y().a,i[0]=r*o[0]/2,i[1]=-r*o[1]/2,r="left"),null!==t.Na()?((t=(o=t.Na()).clone()).nj(o.a||$c.a),t.Si(o.b||$c.b),t.pf(o.Fa()||$c.Fa()),t.qf(o.Ga()||_c)):t=$c.clone(),t.xd(e),t.sj(i[0]),t.tj(i[1]),t.vj(r),new qh({text:t})}function ff(i,r,n,s,a){return function(){var t,e=a,o="";return(e=e&&this.V()?"Point"===this.V().U():e)&&(o=this.get("name"),e=e&&o),i?e?(e=cf(i[0],o),i.concat(e)):i:r?(t=function t(e,o,i){return Array.isArray(e)?e:"string"==typeof e?(!(e in i)&&"#"+e in i&&(e="#"+e),t(i[e],o,i)):o}(r,n,s),e?(e=cf(t[0],o),t.concat(e)):t):e?(e=cf(n[0],o),n.concat(e)):n}}function yf(t){if(t=il(t,!1),t=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t))return t=t[1],[parseInt(t.substr(6,2),16),parseInt(t.substr(4,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(0,2),16)/255]}function gf(t){t=il(t,!1);for(var e,o=[],i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s*,\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?))?\s*/i;e=i.exec(t);)o.push(parseFloat(e[1]),parseFloat(e[2]),e[3]?parseFloat(e[3]):0),t=t.substr(e[0].length);if(""===t)return o}function df(t){var e=il(t,!1).trim();return t.baseURI&&"about:blank"!==t.baseURI?new URL(e,t.baseURI).href:e}function vf(t){return ju(t)}function bf(t,e){return g(null,kf,t,e)}function mf(t,e){if(e=g({A:[],Ej:[]},Of,t,e)){t=e.A,e=e.Ej;for(var o=0,i=Math.min(t.length,e.length);o<i;++o)t[4*o+3]=e[o];return(e=new S(null)).ba("XYZM",t),e}}function wf(t,e){var o=g({},Ff,t,e);if(t=g(null,Uf,t,e))return(e=new S(null)).ba("XYZ",t),e.H(o),e}function xf(t,e){var o=g({},Ff,t,e);if(t=g(null,Uf,t,e))return(e=new w(null)).ba("XYZ",t,[t.length]),e.H(o),e}function Sf(t,e){if(!(t=g([],Zf,t,e)))return null;if(!t.length)return new uu(t);var o=!0,i=t[0].U(),r=1;for(s=t.length;r<s;++r)if((e=t[r]).U()!=i){o=!1;break}if(o)if("Point"==i){for(var n=t[0],o=n.ja,i=n.ga(),r=1,s=t.length;r<s;++r)X(i,(e=t[r]).ga());(n=new P(null)).ba(o,i),Ef(n,t)}else"LineString"==i?(Ll(n=new M(null),t),Ef(n,t)):"Polygon"==i?(Fl(n=new f(null),t),Ef(n,t)):"GeometryCollection"==i?n=new uu(t):O(!1,37);else n=new uu(t);return n}function Mf(t,e){var o=g({},Ff,t,e);if(t=g(null,Uf,t,e))return(e=new m(null)).ba("XYZ",t),e.H(o),e}function Pf(t,e){var o=g({},Ff,t,e);if((t=g([null],Df,t,e))&&t[0]){e=new w(null);for(var i=t[0],r=[i.length],n=1,s=t.length;n<s;++n)X(i,t[n]),r.push(i.length);return e.ba("XYZ",i,r),e.H(o),e}}function Af(t,e){if(!(e=g({},Qf,t,e)))return null;t="fillStyle"in e?e.fillStyle:Xc;var o=e.fill,i=(void 0===o||o||(t=null),(o="imageStyle"in e?e.imageStyle:Hc)==qc&&(o=void 0),"textStyle"in e?e.textStyle:$c),r="strokeStyle"in e?e.strokeStyle:Jc;return[new qh({fill:t,image:o,stroke:r=void 0===(e=e.outline)||e?r:null,text:i,zIndex:void 0})]}function Ef(t,e){for(var o,i=e.length,r=Array(e.length),n=Array(e.length),s=o=!1,a=0;a<i;++a){var p=e[a];r[a]=p.get("extrude"),n[a]=p.get("altitudeMode"),s=s||void 0!==r[a],o=o||n[a]}s&&t.set("extrude",r),o&&t.set("altitudeMode",n)}function Tf(t,e){gl(Lf,t,e)}function jf(t,e){gl(Rf,t,e)}var Cf=l(n,{displayName:o(i),value:o(i)}),Lf=l(n,{Data:function(t,e){var o=t.getAttribute("name");gl(Cf,t,e),t=e[e.length-1],null!==o?t[o]=t.value:null!==t.displayName&&(t[t.displayName]=t.value)},SchemaData:function(t,e){gl($f,t,e)}}),Rf=l(n,{LatLonAltBox:function(t,e){(t=g({},If,t,e))&&((e=e[e.length-1]).extent=[parseFloat(t.west),parseFloat(t.south),parseFloat(t.east),parseFloat(t.north)],e.altitudeMode=t.altitudeMode,e.minAltitude=parseFloat(t.minAltitude),e.maxAltitude=parseFloat(t.maxAltitude))},Lod:function(t,e){(t=g({},Nf,t,e))&&((e=e[e.length-1]).minLodPixels=parseFloat(t.minLodPixels),e.maxLodPixels=parseFloat(t.maxLodPixels),e.minFadeExtent=parseFloat(t.minFadeExtent),e.maxFadeExtent=parseFloat(t.maxFadeExtent))}}),If=l(n,{altitudeMode:o(i),minAltitude:o(ju),maxAltitude:o(ju),north:o(ju),south:o(ju),east:o(ju),west:o(ju)}),Nf=l(n,{minLodPixels:o(ju),maxLodPixels:o(ju),minFadeExtent:o(ju),maxFadeExtent:o(ju)}),Ff=l(n,{extrude:o(Au),altitudeMode:o(i)}),kf=l(n,{coordinates:hl(gf)}),Df=l(n,{innerBoundaryIs:function(t,e){(t=g(void 0,Xf,t,e))&&e[e.length-1].push(t)},outerBoundaryIs:function(t,e){(t=g(void 0,Hf,t,e))&&(e[e.length-1][0]=t)}}),Of=l(n,{when:function(t,e){e=e[e.length-1].Ej,t=il(t,!1),t=Date.parse(t),e.push(isNaN(t)?0:t)}},l(lf,{coord:function(t,e){e=e[e.length-1].A,t=il(t,!1),(t=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(t))?e.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),0):e.push(0,0,0,0)}})),Uf=l(n,{coordinates:hl(gf)}),Gf=l(n,{href:o(df)},l(lf,{x:o(ju),y:o(ju),w:o(ju),h:o(ju)})),Bf=l(n,{Icon:o(function(t,e){return(t=g({},Gf,t,e))||null}),heading:o(ju),hotSpot:o(function(t){var e=t.getAttribute("xunits"),o=t.getAttribute("yunits"),i="insetPixels"!==e?"insetPixels"!==o?"bottom-left":"top-left":"insetPixels"!==o?"bottom-right":"top-right";return{x:parseFloat(t.getAttribute("x")),Xg:uf[e],y:parseFloat(t.getAttribute("y")),Yg:uf[o],origin:i}}),scale:o(vf)}),Xf=l(n,{LinearRing:hl(bf)}),Vf=l(n,{color:o(yf),scale:o(vf)}),Wf=l(n,{color:o(yf),width:o(ju)}),Zf=l(n,{LineString:pl(wf),LinearRing:pl(xf),MultiGeometry:pl(Sf),Point:pl(Mf),Polygon:pl(Pf)}),Kf=l(lf,{Track:pl(mf)}),zf=l(n,{ExtendedData:Tf,Region:jf,Link:function(t,e){gl(Yf,t,e)},address:o(i),description:o(i),name:o(i),open:o(Au),phoneNumber:o(i),visibility:o(Au)}),Yf=l(n,{href:o(df)}),Hf=l(n,{LinearRing:hl(bf)}),qf=l(n,{Style:o(Af),key:o(i),styleUrl:o(df)}),Jf=l(n,{ExtendedData:Tf,Region:jf,MultiGeometry:o(Sf,"geometry"),LineString:o(wf,"geometry"),LinearRing:o(xf,"geometry"),Point:o(Mf,"geometry"),Polygon:o(Pf,"geometry"),Style:o(Af),StyleMap:function(t,e){(t=g(void 0,ty,t,e))&&(e=e[e.length-1],Array.isArray(t)?e.Style=t:"string"==typeof t?e.styleUrl=t:O(!1,38))},address:o(i),description:o(i),name:o(i),open:o(Au),phoneNumber:o(i),styleUrl:o(df),visibility:o(Au)},l(lf,{MultiTrack:o(function(t,e){if(t=g([],Kf,t,e))return Ll(e=new M(null),t),e},"geometry"),Track:o(mf,"geometry")})),_f=l(n,{color:o(yf),fill:o(Au),outline:o(Au)}),$f=l(n,{SimpleData:function(t,e){var o=t.getAttribute("name");null!==o&&(t=i(t),e[e.length-1][o]=t)}}),Qf=l(n,{IconStyle:function(t,e){var o,i,r,n,s,a,p,h,l,u,c,f;(t=g({},Bf,t,e))&&(e=e[e.length-1],f="Icon"in t?t.Icon:{},o=!("Icon"in t)||0<Object.keys(f).length,(r=f.href)?i=r:o&&(i=zc),r="bottom-left",(u=t.hotSpot)?(n=[u.x,u.y],s=u.Xg,a=u.Yg,r=u.origin):i===zc?(n=Vc,s=Wc,a=Zc):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(n=[.5,0],a=s="fraction"),u=f.x,h=f.y,void 0!==u&&void 0!==h&&(p=[u,h]),u=f.w,f=f.h,void 0!==u&&void 0!==f&&(l=[u,f]),void 0!==(f=t.heading)&&(c=it(f)),t=t.scale,o?(i=new af({anchor:n,anchorOrigin:r,anchorXUnits:s,anchorYUnits:a,crossOrigin:"anonymous",offset:p,offsetOrigin:"bottom-left",rotation:c,scale:t=i==zc&&(l=Kc,void 0===t)?Yc:t,size:l,src:i}),e.imageStyle=i):e.imageStyle=qc)},LabelStyle:function(t,e){(t=g({},Vf,t,e))&&(e[e.length-1].textStyle=new pf({fill:new Hh({color:"color"in t?t.color:Bc}),scale:t.scale}))},LineStyle:function(t,e){(t=g({},Wf,t,e))&&(e[e.length-1].strokeStyle=new hp({color:"color"in t?t.color:Bc,width:"width"in t?t.width:1}))},PolyStyle:function(t,e){var o;(t=g({},_f,t,e))&&((e=e[e.length-1]).fillStyle=new Hh({color:"color"in t?t.color:Bc}),void 0!==(o=t.fill)&&(e.fill=o),void 0!==(t=t.outline))&&(e.outline=t)}}),ty=l(n,{Pair:function(t,e){var o;(t=g({},qf,t,e))&&(o=t.key)&&"normal"==o&&((o=t.styleUrl)&&(e[e.length-1]=o),t=t.Style)&&(e[e.length-1]=t)}});function ey(t,e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var o=oy(t,e);if(o)return o}}function oy(t,e){for(var o=e.firstElementChild;o;o=o.nextElementSibling)if(D(n,o.namespaceURI)&&"name"==o.localName)return i(o);for(o=e.firstElementChild;o;o=o.nextElementSibling)if(e=o.localName,D(n,o.namespaceURI)&&("Document"==e||"Folder"==e||"Placemark"==e||"kml"==e)&&(e=oy(t,o)))return e}function iy(t,e){var o=[];for(e=e.firstChild;e;e=e.nextSibling)e.nodeType==Node.ELEMENT_NODE&&X(o,ry(t,e));return o}function ry(t,e){for(var o,i=[],r=e.firstElementChild;r;r=r.nextElementSibling)D(n,r.namespaceURI)&&"NetworkLink"==r.localName&&(o=g({},zf,r,[]),i.push(o));for(r=e.firstElementChild;r;r=r.nextElementSibling)e=r.localName,!D(n,r.namespaceURI)||"Document"!=e&&"Folder"!=e&&"kml"!=e||X(i,ry(t,r));return i}function ny(t,e){var o=[];for(e=e.firstChild;e;e=e.nextSibling)e.nodeType==Node.ELEMENT_NODE&&X(o,t.lf(e));return o}function sy(t,e){var o;for(e=[255*(4==(e=vo(e)).length?e[3]:1),e[2],e[1],e[0]],o=0;o<4;++o){var i=parseInt(e[o],10).toString(16);e[o]=1==i.length?"0"+i:i}ku(t,e.join(""))}function ay(t,e,o){t={node:t};var i,r,n=e.U();"GeometryCollection"==n?(i=e.Vf(),r=Oy):"MultiPoint"==n?(i=e.Zd(),r=zy):"MultiLineString"==n?(i=e.gd(),r=Yy):"MultiPolygon"==n?(i=e.Td(),r=qy):O(!1,39),vl(t,Ty,r,i,o)}function py(t,e,o){vl({node:t},Ey,Hy,[e],o)}function hy(t,e,o){var i,r={node:t},n=(e.a&&t.setAttribute("id",e.a),t=e.N(),{address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1}),s=(n[e.c]=1,Object.keys(t||{}).sort().filter(function(t){return!n[t]}));0<s.length&&(i=yl(t,s),vl(r,Cy,Zy,[{names:s,values:i}],o)),(s=(s=e.Lc())&&s.call(e,0))&&(s=Array.isArray(s)?s[0]:s,this.j&&(t.Style=s),s=s.Na())&&(t.name=s.Na()),t=yl(t,s=jy[o[o.length-1].node.namespaceURI]),vl(r,Cy,fl,t,o,s),t=o[0],e=(e=e.V())&&Ml(e,!0,t),vl(r,Cy,Oy,[e],o)}function ly(t,e,o){var i=e.ga();(t={node:t}).layout=e.ja,t.stride=e.qa(),vl(t,Ly,Vy,[i],o)}function uy(t,e,o){var i=(e=e.Sd()).shift();vl(t={node:t},Ry,Ky,e,o),vl(t,Ry,Jy,[i],o)}function cy(t,e){Nu(t,Math.round(1e6*e)/1e6)}(r=hf.prototype).vg=function(t,e){if(t=g([],l(n,{Document:al(this.vg,this),Folder:al(this.vg,this),Placemark:pl(this.Dg,this),Style:this.Jp.bind(this),StyleMap:this.Ip.bind(this)}),t,e,this))return t},r.Dg=function(t,e){var o,i=g({geometry:null},Jf,t,e);if(i)return o=new x,null!==(t=t.getAttribute("id"))&&o.jc(t),e=e[0],(t=i.geometry)&&Ml(t,!1,e),o.Ra(t),delete i.geometry,this.c&&o.hg(ff(i.Style,i.styleUrl,this.a,this.b,this.g)),delete i.Style,o.H(i),o},r.Jp=function(t,e){var o=t.getAttribute("id");null!==o&&(e=Af(t,e))&&(t=t.baseURI&&"about:blank"!==t.baseURI?new URL("#"+o,t.baseURI).href:"#"+o,this.b[t]=e)},r.Ip=function(t,e){var o=t.getAttribute("id");null!==o&&(e=g(void 0,ty,t,e))&&(t=t.baseURI&&"about:blank"!==t.baseURI?new URL("#"+o,t.baseURI).href:"#"+o,this.b[t]=e)},r.xg=function(t,e){return D(n,t.namespaceURI)&&(t=this.Dg(t,[xl(this,t,e)]))||null},r.zc=function(t,e){if(!D(n,t.namespaceURI))return[];var o=t.localName;if("Document"==o||"Folder"==o)return(o=this.vg(t,[xl(this,t,e)]))||[];if("Placemark"==o)return(e=this.Dg(t,[xl(this,t,e)]))?[e]:[];if("kml"!=o)return[];for(o=[],t=t.firstElementChild;t;t=t.nextElementSibling){var i=this.zc(t,e);i&&X(o,i)}return o},r.Cp=function(t){return rl(t)?ey(this,t):nl(t)?oy(this,t):"string"==typeof t?ey(this,t=sl(t)):void 0},r.Dp=function(t){var e=[];return rl(t)?X(e,iy(this,t)):nl(t)?X(e,ry(this,t)):"string"==typeof t&&X(e,iy(this,t=sl(t))),e},r.Gp=function(t){var e=[];return rl(t)?X(e,ny(this,t)):nl(t)?X(e,this.lf(t)):"string"==typeof t&&X(e,ny(this,t=sl(t))),e},r.lf=function(t){for(var e,o=[],i=t.firstElementChild;i;i=i.nextElementSibling)D(n,i.namespaceURI)&&"Region"==i.localName&&(e=g({},Rf,i,[]),o.push(e));for(i=t.firstElementChild;i;i=i.nextElementSibling)t=i.localName,!D(n,i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||X(o,this.lf(i));return o};var fy=l(n,["Document","Placemark"]),yy=l(n,{Document:c(function(t,e,o){vl({node:t},gy,Dy,e,o,void 0,this)}),Placemark:c(hy)}),gy=l(n,{Placemark:c(hy)}),dy=l(n,{Data:c(function(t,e,o){t.setAttribute("name",e.name),t={node:t},"object"==typeof(e=e.value)?(null!==e&&e.displayName&&vl(t,dy,fl,[e.displayName],o,["displayName"]),null!==e&&e.value&&vl(t,dy,fl,[e.value],o,["value"])):vl(t,dy,fl,[e],o,["value"])}),value:c(function(t,e){ku(t,e)}),displayName:c(function(t,e){t.appendChild(el.createCDATASection(e))})}),vy={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},by=l(n,["href"],l(lf,["x","y","w","h"])),my=l(n,{href:c(ku)},l(lf,{x:c(Nu),y:c(Nu),w:c(Nu),h:c(Nu)})),wy=l(n,["scale","heading","Icon","hotSpot"]),xy=l(n,{Icon:c(function(t,e,o){t={node:t};var i=by[o[o.length-1].node.namespaceURI],r=yl(e,i);vl(t,my,fl,r,o,i),r=yl(e,i=by[lf[0]]),vl(t,my,ky,r,o,i)}),heading:c(Nu),hotSpot:c(function(t,e){t.setAttribute("x",e.x),t.setAttribute("y",e.y),t.setAttribute("xunits",e.Xg),t.setAttribute("yunits",e.Yg)}),scale:c(cy)}),Sy=l(n,["color","scale"]),My=l(n,{color:c(sy),scale:c(cy)}),Py=l(n,["color","width"]),Ay=l(n,{color:c(sy),width:c(Nu)}),Ey=l(n,{LinearRing:c(ly)}),Ty=l(n,{LineString:c(ly),Point:c(ly),Polygon:c(uy),GeometryCollection:c(ay)}),jy=l(n,"name open visibility address phoneNumber description styleUrl Style".split(" ")),Cy=l(n,{ExtendedData:c(function(t,e,o){t={node:t};var i=e.names;e=e.values;for(var r=i.length,n=0;n<r;n++)vl(t,dy,Wy,[{name:i[n],value:e[n]}],o)}),MultiGeometry:c(ay),LineString:c(ly),LinearRing:c(ly),Point:c(ly),Polygon:c(uy),Style:c(function(t,e,o){t={node:t};var i={},r=e.Fa(),n=e.Ga(),s=e.Y();e=e.Na(),s instanceof af&&(i.IconStyle=s),e&&(i.LabelStyle=e),n&&(i.LineStyle=n),r&&(i.PolyStyle=r),i=yl(i,e=Ny[o[o.length-1].node.namespaceURI]),vl(t,Fy,fl,i,o,e)}),address:c(ku),description:c(ku),name:c(ku),open:c(Iu),phoneNumber:c(ku),styleUrl:c(ku),visibility:c(Iu)}),Ly=l(n,{coordinates:c(function(t,e,o){var i,r=(o=o[o.length-1]).layout;o=o.stride,"XY"==r||"XYM"==r?i=2:"XYZ"==r||"XYZM"==r?i=3:O(!1,34);var n,s=e.length,a="";if(0<s){for(a+=e[0],r=1;r<i;++r)a+=","+e[r];for(n=o;n<s;n+=o)for(a+=" "+e[n],r=1;r<i;++r)a+=","+e[n+r]}ku(t,a)})}),Ry=l(n,{outerBoundaryIs:c(py),innerBoundaryIs:c(py)}),Iy=l(n,{color:c(sy)}),Ny=l(n,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Fy=l(n,{IconStyle:c(function(t,e,o){t={node:t};var i,r,n={},s=e.ic(),a=e.ye(),p={href:e.b.o};s&&(p.w=s[0],p.h=s[1],i=e.Hc(),(r=e.Oc())&&a&&r[0]&&r[1]!==s[1]&&(p.x=r[0],p.y=a[1]-(r[1]+s[1])),i)&&i[0]&&i[1]!==s[1]&&(n.hotSpot={x:i[0],Xg:"pixels",y:s[1]-i[1],Yg:"pixels"}),n.Icon=p,1!==(s=e.a)&&(n.scale=s),(e=e.g)&&(n.heading=e),n=yl(n,e=wy[o[o.length-1].node.namespaceURI]),vl(t,xy,fl,n,o,e)}),LabelStyle:c(function(t,e,o){t={node:t};var i={},r=e.Fa();r&&(i.color=r.b),(e=e.b)&&1!==e&&(i.scale=e),i=yl(i,e=Sy[o[o.length-1].node.namespaceURI]),vl(t,My,fl,i,o,e)}),LineStyle:c(function(t,e,o){t={node:t};var i=Py[o[o.length-1].node.namespaceURI];e=yl({color:e.a,width:e.c},i),vl(t,Ay,fl,e,o,i)}),PolyStyle:c(function(t,e,o){vl({node:t},Iy,Xy,[e.b],o)})});function ky(t,e,o){return ol(lf[0],"gx:"+o)}function Dy(t,e){return ol(e[e.length-1].node.namespaceURI,"Placemark")}function Oy(t,e){if(t)return ol(e[e.length-1].node.namespaceURI,vy[t.U()])}var Uy,Gy,By,Xy=cl("color"),Vy=cl("coordinates"),Wy=cl("Data"),Zy=cl("ExtendedData"),Ky=cl("innerBoundaryIs"),zy=cl("Point"),Yy=cl("LineString"),Hy=cl("LinearRing"),qy=cl("Polygon"),Jy=cl("outerBoundaryIs");function _y(t){this.lc=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.type=this.ea=0,this.length=this.lc.length}function $y(t,e,o){return o?4294967296*e+(t>>>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<t;){var i=e.ne[o.Ka()],r=e.pe[o.Ka()];e.properties[i]=r}else 3==t?e.type=o.Ka():4==t&&(e.Ef=o.ea)}function ig(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Cc=t,this.ne=[],this.pe=[],this.me=[],t.Ag(rg,this,e),this.length=this.me.length}function rg(t,e,o){15===t?e.version=o.Ka():1===t?e.name=o.Gg():5===t?e.extent=o.Ka():2===t?e.me.push(o.ea):3===t?e.ne.push(o.Gg()):4===t&&e.pe.push(function(t){for(var e=null,o=t.Ka()+t.ea;t.ea<o;)e=1==(e=t.Ka()>>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<n;++r){for(var s=t[r],a=0,p=s.length;a<p;++a){var h=s[a];e.push(h.x,h.y)}i+=2*a,o.push(i)}}function hg(){wu.call(this),this.defaultDataProjection=v("EPSG:4326")}function lg(t,e){e[e.length-1].fe[t.getAttribute("k")]=t.getAttribute("v")}hf.prototype.Xb=function(t,e){e=Sl(this,e);var o=ol(n[4],"kml"),i=(o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:gx",lf[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<t.length?r.Document=t:1==t.length&&(r.Placemark=t[0]),r=yl(r,t=fy[o.namespaceURI]),vl(i,yy,fl,r,[e],t,this),o},mp.Dd=function(){},ti=mp.Dd=mp.Dd||{},Uy=function(t,e,o,i,r){var n=8*r-i-1,s=(1<<n)-1,a=s>>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;o=256*o+t[e+r],r+=h,p-=8);for(n=o&(1<<-p)-1,o>>=-p,p+=i;0<p;n=256*n+t[e+r],r+=h,p-=8);if(0===o)o=1-a;else{if(o===s)return n?NaN:1/0*(l?-1:1);n+=Math.pow(2,i),o-=a}return(l?-1:1)*n*Math.pow(2,o-i)},_y.c=0,_y.i=1,_y.b=2,_y.a=5,_y.prototype={Ag:function(t,e,o){for(o=o||this.length;this.ea<o;){var i=this.Ka(),r=i>>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<t;){var r,n,s,a=e[i],p=null,h=239<a?4:223<a?3:191<a?2:1;if(t<i+h)break;1===h?a<128&&(p=a):2===h?128==(192&(r=e[i+1]))&&(p=(31&a)<<6|63&r)<=127&&(p=null):3===h?(r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&((p=(15&a)<<12|(63&r)<<6|63&n)<=2047||55296<=p&&p<=57343)&&(p=null)):4===h&&(r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r))&&128==(192&n)&&128==(192&s)&&((p=(15&a)<<18|(63&r)<<12|(63&n)<<6|63&s)<=65535||1114112<=p)&&(p=null),null===p?(p=65533,h=1):65535<p&&(p-=65536,o+=String.fromCharCode(p>>>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<this.lc[this.ea++];);else if(t===_y.b)this.ea=this.Ka()+this.ea;else if(t===_y.a)this.ea+=4;else{if(t!==_y.i)throw Error("Unimplemented type: "+t);this.ea+=8}}},ti.default=_y,mp.Dd=mp.Dd.default,mp.xf={},mp.xf.Bf=function(){},fi=mp.xf=mp.xf||{},tg.prototype={clone:function(){return new tg(this.x,this.y)},add:function(t){return this.clone().Yj(t)},rotate:function(t){return this.clone().hk(t)},round:function(){return this.clone().ik()},angle:function(){return Math.atan2(this.y,this.x)},Yj:function(t){return this.x+=t.x,this.y+=t.y,this},hk:function(t){var e=Math.cos(t),o=(t=Math.sin(t))*this.x+e*this.y;return this.x=e*this.x-t*this.y,this.y=o,this},ik:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},tg.Kq=function(t){return!(t instanceof tg)&&Array.isArray(t)?new tg(t[0],t[1]):t},eg.b=["Unknown","Point","LineString","Polygon"],eg.prototype.Oh=function(){var t=this.Cc;t.ea=this.Ef;for(var e,o=t.Ka()+t.ea,i=1,r=0,n=0,s=0,a=[];t.ea<o;)if(r||(i=7&(r=t.Ka()),r>>=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<e;)if(i||(o=7&(i=t.Ka()),i>>=3),i--,1===o||2===o)(r+=t.ce())<s&&(s=r),a<r&&(a=r),(n+=t.ce())<p&&(p=n),h<n&&(h=n);else if(7!==o)throw Error("unknown command "+o);return[s,p,a,h]},(Gy=ig).prototype.feature=function(t){if(t<0||t>=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<v;++d)n===sg?(s=void 0,p=o,pg(h=(a=g.feature(d)).Oh(),u=[],l=[]),1===(c=a.type)?s=1===h.length?"Point":"MultiPoint":2===c?s=1===h.length?"LineString":"MultiLineString":3===c&&(s="Polygon"),(h=a.properties)[this.i]=p,s=new this.b(s,u,l,h,a.id)):(c=g.feature(d),u=o,l=e,s=new this.b,a=c.id,(p=c.properties)[this.i]=u,this.a&&s.Tc(this.a),u=void 0,0===(h=c.type)?u=null:(f=[],y=[],pg(c=c.Oh(),y,f),1===h?u=new(1===c.length?m:P)(null):2===h?u=new(1===c.length?S:M)(null):3===h&&(u=new w(null)),u.ba("XY",y,f)),l=Ml(u,!1,Sl(this,l)),s.Ra(l),s.jc(a),s.H(p)),r.push(s);return r},r.kb=function(){return this.defaultDataProjection},r.mn=function(t){this.c=t},r.Tb=function(){},r.Sc=function(){},r.Bd=function(){},r.$c=function(){},r.Wb=function(){},e(hg,wu);var ti=[null],ug=l(ti,{nd:function(t,e){e[e.length-1].md.push(t.getAttribute("ref"))},tag:lg}),cg=l(ti,{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,Zt((t=g({fe:{}},fg,t,e)).fe)||(Ml(n=new m(n),!1,o),(o=new x(n)).jc(r),o.H(t.fe),i.features.push(o))},way:function(t,e){var o=e[0],i=t.getAttribute("id");t=g({md:[],fe:{}},ug,t,e),e=e[e.length-1];for(var r=[],n=0,s=t.md.length;n<s;n++)X(r,e.Sh[t.md[n]]);t.md[0]==t.md[t.md.length-1]?(n=new w(null)).ba("XY",r,[r.length]):(n=new S(null)).ba("XY",r),Ml(n,!1,o),(o=new x(n)).jc(i),o.H(t.fe),e.features.push(o)}}),fg=l(ti,{tag:lg});function yg(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}function gg(){}function dg(){}hg.prototype.zc=function(t,e){return e=xl(this,t,e),"osm"==t.localName&&(t=g({Sh:{},features:[]},cg,t,[e])).features?t.features:[]},hg.prototype.Vg=function(){},hg.prototype.Xb=function(){},hg.prototype.ie=function(){},gg.prototype.read=function(t){return rl(t)?this.a(t):nl(t)?this.b(t):"string"==typeof t?(t=sl(t),this.a(t)):null},e(dg,gg),dg.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},dg.prototype.b=function(t){return(t=g({},vg,t,[]))||null};var fi=[null,"http://www.opengis.net/ows/1.1"],vg=l(fi,{ServiceIdentification:o(function(t,e){return g({},Cg,t,e)}),ServiceProvider:o(function(t,e){return g({},Lg,t,e)}),OperationsMetadata:o(function(t,e){return g({},Ag,t,e)})}),bg=l(fi,{DeliveryPoint:o(i),City:o(i),AdministrativeArea:o(i),PostalCode:o(i),Country:o(i),ElectronicMailAddress:o(i)}),mg=l(fi,{Value:ll(i)}),wg=l(fi,{AllowedValues:o(function(t,e){return g({},mg,t,e)})}),xg=l(fi,{Phone:o(function(t,e){return g({},Eg,t,e)}),Address:o(function(t,e){return g({},bg,t,e)})}),Sg=l(fi,{HTTP:o(function(t,e){return g({},Mg,t,e)})}),Mg=l(fi,{Get:ll(function(t,e){var o=yg(t);if(o)return g({href:o},Tg,t,e)}),Post:void 0}),Pg=l(fi,{DCP:o(function(t,e){return g({},Sg,t,e)})}),Ag=l(fi,{Operation:function(t,e){var o=t.getAttribute("name");(t=g({},Pg,t,e))&&(e[e.length-1][o]=t)}}),Eg=l(fi,{Voice:o(i),Facsimile:o(i)}),Tg=l(fi,{Constraint:ll(function(t,e){var o=t.getAttribute("name");if(o)return g({name:o},wg,t,e)})}),jg=l(fi,{IndividualName:o(i),PositionName:o(i),ContactInfo:o(function(t,e){return g({},xg,t,e)})}),Cg=l(fi,{Title:o(i),ServiceTypeVersion:o(i),ServiceType:o(i)}),Lg=l(fi,{ProviderName:o(i),ProviderSite:o(yg),ServiceContact:o(function(t,e){return g({},jg,t,e)})});function Rg(t,e,o,i){for(var r=void 0!==i?i:[],n=i=0;n<e;){var s=t[n++];for(r[i++]=t[n++],r[i++]=s,s=2;s<o;++s)r[i++]=t[n++]}r.length=i}function Ig(t){t=t||{},wl.call(this),this.defaultDataProjection=v("EPSG:4326"),this.b=t.factor||1e5,this.a=t.geometryLayout||"XY"}function Ng(t,e,o){for(var i=Array(e),r=0;r<e;++r)i[r]=0;for(var n=0,s=t.length;n<s;)for(r=0;r<e;++r,++n){var a=t[n],p=a-i[r];i[r]=a,t[n]=p}return kg(t,o||1e5)}function Fg(t,e,o){for(var i,r=Array(e),n=0;n<e;++n)r[n]=0;for(t=Dg(t,o||1e5),o=0,i=t.length;o<i;)for(n=0;n<e;++n,++o)r[n]+=t[o],t[o]=r[n];return t}function kg(t,e){e=e||1e5;for(var o=0,i=t.length;o<i;++o)t[o]=Math.round(t[o]*e);for(e=0,o=t.length;e<o;++e)i=t[e],t[e]=i<0?~(i<<1):i<<1;for(e="",o=0,i=t.length;o<i;++o){for(var r=t[o],n="";32<=r;)n+=String.fromCharCode(63+(32|31&r)),r>>=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<s;++n){var a=t.charCodeAt(n)-63,i=i|(31&a)<<r;a<32?(o.push(i),r=i=0):r+=5}for(t=0,i=o.length;t<i;++t)o[t]=1&(r=o[t])?~(r>>1):r>>1;for(t=0,i=o.length;t<i;++t)o[t]/=e;return o}function Og(t){t=t||{},wl.call(this),this.a=t.layerName,this.b=t.layers||null,this.defaultDataProjection=v(t.defaultDataProjection||"EPSG:4326")}function Ug(t,e){for(var o=[],i=0,r=t.length;i<r;++i){var n=t[i];0<i&&o.pop(),n=0<=n?e[n]:e[~n].slice().reverse(),o.push.apply(o,n)}for(t=0,e=o.length;t<e;++t)o[t]=o[t].slice();return o}function Gg(t,e,o,i,r,n,s){var a=t.type,p=Xg[a];return o="Point"===a||"MultiPoint"===a?p(t,o,i):p(t,e),(e=new x).Ra(Ml(o,!1,s)),void 0!==t.id&&e.jc(t.id),t=t.properties,r&&((t=t||{})[r]=n),t&&e.H(t),e}function Bg(t,e,o){t[0]=t[0]*e[0]+o[0],t[1]=t[1]*e[1]+o[1]}e(Ig,Dc),(r=Ig.prototype).ae=function(t,e){return new x(t=this.wd(t,e))},r.zg=function(t,e){return[this.ae(t,e)]},r.wd=function(t,e){var o=vr(this.a);return Rg(t=Fg(t,o,this.b),t.length,o,t),Ml(new S(Lr(t,0,t.length,o),this.a),!1,Sl(this,e))},r.ge=function(t,e){return(t=t.V())?this.Cd(t,e):(O(!1,40),"")},r.Wg=function(t,e){return this.ge(t[0],e)},r.Cd=function(t,e){return e=(t=Ml(t,!0,Sl(this,e))).ga(),t=t.qa(),Rg(e,e.length,t,e),Ng(e,t,this.b)},e(Og,Pl),Og.prototype.yg=function(t,e){if("Topology"!=t.type)return[];var o=null,i=null,r=(t.transform&&(o=(n=t.transform).scale,i=n.translate),t.arcs);if(n)for(var n=o,s=i,a=0,p=r.length;a<p;++a)for(var h=r[a],l=n,u=s,c=0,f=0,y=0,g=h.length;y<g;++y){var d=h[y];c+=d[0],f+=d[1],d[0]=c,d[1]=f,Bg(d,l,u)}n=[],t=t.objects;var v,s=this.a;for(v in t)this.b&&-1==this.b.indexOf(v)||("GeometryCollection"===t[v].type?(a=t[v],n.push.apply(n,function(t,e,o,i,r,n,s){for(var a=[],p=0,h=(t=t.geometries).length;p<h;++p)a[p]=Gg(t[p],e,o,i,r,n,s);return a}(a,r,o,i,s,v,e))):(a=t[v],n.push(Gg(a,r,o,i,s,v,e))));return n},Og.prototype.Fg=function(){return this.defaultDataProjection};var Xg={Point:function(t,e,o){return t=t.coordinates,e&&o&&Bg(t,e,o),new m(t)},LineString:function(t,e){return new S(t=Ug(t.arcs,e))},Polygon:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i)o[i]=Ug(t.arcs[i],e);return new w(o)},MultiPoint:function(t,e,o){if(t=t.coordinates,e&&o)for(var i=0,r=t.length;i<r;++i)Bg(t[i],e,o);return new P(t)},MultiLineString:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i)o[i]=Ug(t.arcs[i],e);return new M(o)},MultiPolygon:function(t,e){for(var o=[],i=0,r=t.arcs.length;i<r;++i){for(var n=t.arcs[i],s=[],a=0,p=n.length;a<p;++a)s[a]=Ug(n[a],e);o[i]=s}return new f(o)}};function Vg(t){this.c=(t=t||{}).featureType,this.a=t.featureNS,this.b=t.gmlFormat||new y,this.o=t.schemaLocation||Wg["1.1.0"],wu.call(this)}(r=Og.prototype).Zc=function(){},r.he=function(){},r.je=function(){},r.Cg=function(){},r.Rc=function(){},e(Vg,wu);var Wg={"1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"};function Zg(t,e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return zg(t,e)}Vg.prototype.zc=function(t,e){var o={featureType:this.c,featureNS:this.a};return Xt(o,xl(this,t,e||{})),e=[o],this.b.b["http://www.opengis.net/gml"].featureMember=pl(Mu.prototype.be),t=(t=g([],this.b.b,t,e,this.b))||[]},Vg.prototype.j=function(t){return rl(t)?_g(t):nl(t)?g({},Jg,t,[]):"string"==typeof t?_g(t=sl(t)):void 0},Vg.prototype.g=function(t){return rl(t)?Zg(this,t):nl(t)?zg(this,t):"string"==typeof t?Zg(this,t=sl(t)):void 0};var Kg={"http://www.opengis.net/gml":{boundedBy:o(Mu.prototype.gf,"bounds")}};function zg(t,e){var o={},i=Ru(e.getAttribute("numberOfFeatures"));return o.numberOfFeatures=i,g(o,Kg,e,[],t.b)}var Yg={"http://www.opengis.net/wfs":{totalInserted:o(Lu),totalUpdated:o(Lu),totalDeleted:o(Lu)}},Hg={"http://www.opengis.net/ogc":{FeatureId:pl(function(t){return t.getAttribute("fid")})}},qg={"http://www.opengis.net/wfs":{Feature:function(t,e){gl(Hg,t,e)}}},Jg={"http://www.opengis.net/wfs":{TransactionSummary:o(function(t,e){return g({},Yg,t,e)},"transactionSummary"),InsertResults:o(function(t,e){return g([],qg,t,e)},"insertIds")}};function _g(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return g({},Jg,t,[])}var $g={"http://www.opengis.net/wfs":{PropertyName:c(ku)}};function Qg(t,e){var o=ol("http://www.opengis.net/ogc","Filter"),i=ol("http://www.opengis.net/ogc","FeatureId");o.appendChild(i),i.setAttribute("fid",e),t.appendChild(o)}function td(t,e){return e.indexOf(t=(t||"feature")+":")?t+e:e}var ed={"http://www.opengis.net/wfs":{Insert:c(function(t,e,o){var i=(r=o[o.length-1]).gmlVersion,r=ol(r.featureNS,r.featureType);if(t.appendChild(r),2===i){t=Zu.prototype,(i=e.a)&&r.setAttribute("fid",i);var n=(i=o[o.length-1]).featureNS,s=e.c,a=(i.lb||(i.lb={},i.lb[n]={}),e.N()),p=(e=[],[]);for(l in a){var h=a[l];null!==h&&(e.push(l),p.push(h),l==s||h instanceof yr?l in i.lb[n]||(i.lb[n][l]=c(t.ai,t)):l in i.lb[n]||(i.lb[n][l]=c(ku)))}var l=Xt({},i);l.node=r,vl(l,i.lb,cl(void 0,n),p,o,e)}else y.prototype.ii(r,e,o)}),Update:c(function(t,e,o){var i=o[o.length-1],r=(O(void 0!==e.a,27),i.featurePrefix),n=i.featureNS;if(t.setAttribute("typeName",td(r,i.featureType)),t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+r,n),void 0!==(r=e.a)){for(var s=[],a=0,p=(n=e.O()).length;a<p;a++){var h=e.get(n[a]);void 0!==h&&s.push({name:n[a],value:h})}vl({gmlVersion:i.gmlVersion,node:t,hasZ:i.hasZ,srsName:i.srsName},ed,cl("Property"),s,o),Qg(t,r)}}),Delete:c(function(t,e,o){o=o[o.length-1],O(void 0!==e.a,26);var i=o.featurePrefix,r=o.featureNS;t.setAttribute("typeName",td(i,o.featureType)),t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+i,r),void 0!==(e=e.a)&&Qg(t,e)}),Property:c(function(t,e,o){var i=ol("http://www.opengis.net/wfs","Name"),r=o[o.length-1].gmlVersion;t.appendChild(i),ku(i,e.name),void 0!==e.value&&null!==e.value&&(i=ol("http://www.opengis.net/wfs","Value"),t.appendChild(i),e.value instanceof yr?2===r?Zu.prototype.ai(i,e.value,o):y.prototype.od(i,e.value,o):ku(i,e.value))}),Native:c(function(t,e){e.vq&&t.setAttribute("vendorId",e.vq),void 0!==e.Vp&&t.setAttribute("safeToIgnore",e.Vp),void 0!==e.value&&ku(t,e.value)})}};function od(t,e,o){var i={node:t};e.b.forEach(function(t){vl(i,pd,cl(t.kc),[t],o)})}function id(t,e){void 0!==e.a&&t.setAttribute("matchCase",e.a.toString()),nd(t,e.b),sd(t,""+e.i)}function rd(t,e,o){ku(t=ol("http://www.opengis.net/ogc",t),o),e.appendChild(t)}function nd(t,e){rd("PropertyName",t,e)}function sd(t,e){rd("Literal",t,e)}function ad(t,e){var o=ol("http://www.opengis.net/gml","TimeInstant");t.appendChild(o),t=ol("http://www.opengis.net/gml","timePosition"),o.appendChild(t),ku(t,e)}var pd={"http://www.opengis.net/wfs":{Query:c(function(t,e,o){var i=o[o.length-1],r=i.featurePrefix,n=i.featureNS,s=i.propertyNames,a=i.srsName;t.setAttribute("typeName",r?td(r,e):e),a&&t.setAttribute("srsName",a),n&&t.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:"+r,n),(e=Xt({},i)).node=t,vl(e,$g,cl("PropertyName"),s,o),(i=i.filter)&&(s=ol("http://www.opengis.net/ogc","Filter"),t.appendChild(s),vl({node:s},pd,cl(i.kc),[i],o))})},"http://www.opengis.net/ogc":{During:c(function(t,e){var o=ol("http://www.opengis.net/fes","ValueReference");ku(o,e.b),t.appendChild(o),o=ol("http://www.opengis.net/gml","TimePeriod"),t.appendChild(o),t=ol("http://www.opengis.net/gml","begin"),o.appendChild(t),ad(t,e.a),t=ol("http://www.opengis.net/gml","end"),o.appendChild(t),ad(t,e.i)}),And:c(od),Or:c(od),Not:c(function(t,e,o){e=e.condition,vl({node:t},pd,cl(e.kc),[e],o)}),BBOX:c(function(t,e,o){o[o.length-1].srsName=e.srsName,nd(t,e.geometryName),y.prototype.od(t,e.extent,o)}),Intersects:c(function(t,e,o){o[o.length-1].srsName=e.srsName,nd(t,e.geometryName),y.prototype.od(t,e.geometry,o)}),Within:c(function(t,e,o){o[o.length-1].srsName=e.srsName,nd(t,e.geometryName),y.prototype.od(t,e.geometry,o)}),PropertyIsEqualTo:c(id),PropertyIsNotEqualTo:c(id),PropertyIsLessThan:c(id),PropertyIsLessThanOrEqualTo:c(id),PropertyIsGreaterThan:c(id),PropertyIsGreaterThanOrEqualTo:c(id),PropertyIsNull:c(function(t,e){nd(t,e.b)}),PropertyIsBetween:c(function(t,e){nd(t,e.b);var o=ol("http://www.opengis.net/ogc","LowerBoundary");t.appendChild(o),sd(o,""+e.a),o=ol("http://www.opengis.net/ogc","UpperBoundary"),t.appendChild(o),sd(o,""+e.i)}),PropertyIsLike:c(function(t,e){t.setAttribute("wildCard",e.g),t.setAttribute("singleChar",e.f),t.setAttribute("escapeChar",e.i),void 0!==e.a&&t.setAttribute("matchCase",e.a.toString()),nd(t,e.b),sd(t,""+e.c)})}};function hd(t){t=t||{},wl.call(this),this.b=void 0!==t.splitCollection&&t.splitCollection}function ld(t){return(t=t.X()).length?t.join(" "):""}function ud(t){for(var e=[],o=0,i=(t=t.X()).length;o<i;++o)e.push(t[o].join(" "));return e.join(",")}function cd(t){for(var e=[],o=0,i=(t=t.Sd()).length;o<i;++o)e.push("("+ud(t[o])+")");return e.join(",")}function fd(t){var e,o=t.U(),i=(0,yd[o])(t),o=o.toUpperCase();return t instanceof b&&(e="","XYZ"!==(t=t.ja)&&"XYZM"!==t||(e+="Z"),"XYM"!==t&&"XYZM"!==t||(e+="M"),0<(t=e).length)&&(o+=" "+t),i.length?o+"("+i+")":o+" EMPTY"}Vg.prototype.l=function(t){var e,o,i=ol("http://www.opengis.net/wfs","GetFeature");return i.setAttribute("service","WFS"),i.setAttribute("version","1.1.0"),t&&(t.handle&&i.setAttribute("handle",t.handle),t.outputFormat&&i.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&i.setAttribute("maxFeatures",t.maxFeatures),t.resultType&&i.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&i.setAttribute("startIndex",t.startIndex),void 0!==t.count&&i.setAttribute("count",t.count),o=t.filter,t.bbox)&&(O(t.geometryName,12),e=lu(t.geometryName,t.bbox,t.srsName),o=o?hu(o,e):e),i.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",this.o),o={node:i,srsName:t.srsName,featureNS:t.featureNS||this.a,featurePrefix:t.featurePrefix,geometryName:t.geometryName,filter:o,propertyNames:t.propertyNames||[]},O(Array.isArray(t.featureTypes),11),t=t.featureTypes,(e=Xt({},(o=[o])[o.length-1])).node=i,vl(e,pd,cl("Query"),t,o),i},Vg.prototype.v=function(t,e,o,i){var r,n=[],s=ol("http://www.opengis.net/wfs","Transaction"),a=i.version||"1.1.0",p="1.0.0"===a?2:3;return s.setAttribute("service","WFS"),s.setAttribute("version",a),i&&(r=i.gmlOptions||{},i.handle)&&s.setAttribute("handle",i.handle),s.setAttributeNS("http://www.w3.org/2001/XMLSchema-instance","xsi:schemaLocation",Wg[a]),t&&(a={node:s,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:p,hasZ:i.hasZ,srsName:i.srsName},Xt(a,r),vl(a,ed,cl("Insert"),t,n)),e&&(a={node:s,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:p,hasZ:i.hasZ,srsName:i.srsName},Xt(a,r),vl(a,ed,cl("Update"),e,n)),o&&vl({node:s,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:p,srsName:i.srsName},ed,cl("Delete"),o,n),i.nativeElements&&vl({node:s,featureNS:i.featureNS,featureType:i.featureType,featurePrefix:i.featurePrefix,gmlVersion:p,srsName:i.srsName},ed,cl("Native"),i.nativeElements,n),s},Vg.prototype.Eg=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.kf(t);return null},Vg.prototype.kf=function(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(t=(t=t.firstElementChild.firstElementChild).firstElementChild;t;t=t.nextElementSibling){var e;if(0!==t.childNodes.length&&(1!==t.childNodes.length||3!==t.firstChild.nodeType))return this.b.gf(t,e=[{}]),v(e.pop().srsName)}return null},e(hd,Dc);var yd={Point:ld,LineString:ud,Polygon:cd,MultiPoint:function(t){for(var e=[],o=0,i=(t=t.Zd()).length;o<i;++o)e.push("("+ld(t[o])+")");return e.join(",")},MultiLineString:function(t){for(var e=[],o=0,i=(t=t.gd()).length;o<i;++o)e.push("("+ud(t[o])+")");return e.join(",")},MultiPolygon:function(t){for(var e=[],o=0,i=(t=t.Td()).length;o<i;++o)e.push("("+cd(t[o])+")");return e.join(",")},GeometryCollection:function(t){for(var e=[],o=0,i=(t=t.Vf()).length;o<i;++o)e.push(fd(t[o]));return e.join(",")}};function gd(t){this.a=t,this.b=-1}function dd(t){this.i=t,this.a="XY"}function vd(t){t.b=function t(e){var o=e.a.charAt(++e.b),i={position:e.b,value:o};if("("==o)i.type=2;else if(","==o)i.type=5;else if(")"==o)i.type=3;else if("0"<=o&&o<="9"||"."==o||"-"==o){var o=e.b,r=!(i.type=4),n=!1;do{"."==s?r=!0:"e"!=s&&"E"!=s||(n=!0);var s=e.a.charAt(++e.b)}while("0"<=s&&s<="9"||"."==s&&(void 0===r||!r)||!n&&("e"==s||"E"==s)||n&&("-"==s||"+"==s));e=parseFloat(e.a.substring(o,e.b--)),i.value=e}else if("a"<=o&&o<="z"||"A"<=o&&o<="Z"){for(i.type=1,o=e.b;"a"<=(s=e.a.charAt(++e.b))&&s<="z"||"A"<=s&&s<="Z";);e=e.a.substring(o,e.b--).toUpperCase(),i.value=e}else{if(" "==o||"\t"==o||"\r"==o||"\n"==o)return t(e);if(""!==o)throw Error("Unexpected character: "+o);i.type=6}return i}(t.i)}function bd(t,e){return(e=t.b.type==e)&&vd(t),e}function md(t){for(var e=[],o=t.a.length,i=0;i<o;++i){var r=t.b;if(!bd(t,4))break;e.push(r.value)}if(e.length==o)return e;throw Error(Md(t))}function wd(t){for(var e=[md(t)];bd(t,5);)e.push(md(t));return e}function xd(t){for(var e=[t.sg()];bd(t,5);)e.push(t.sg());return e}function Sd(t){var e=1==t.b.type&&"EMPTY"==t.b.value;return e&&vd(t),e}function Md(t){return"Unexpected `"+t.b.value+"` at position "+t.b.position+" in `"+t.i.a+"`"}(r=hd.prototype).ae=function(t,e){return(t=this.wd(t,e))?((e=new x).Ra(t),e):null},r.zg=function(t,e){var o=[];t=this.wd(t,e),e=[];for(var i=0,r=(o=this.b&&"GeometryCollection"==t.U()?t.a:[t]).length;i<r;++i)(t=new x).Ra(o[i]),e.push(t);return e},r.wd=function(t,e){return vd(t=new dd(new gd(t))),(t=function t(e){var o=e.b;if(bd(e,1)){var o=o.value,i="XY",r=e.b;if(1==e.b.type&&("Z"===(r=r.value)?i="XYZ":"M"===r?i="XYM":"ZM"===r&&(i="XYZM"),"XY"!==i)&&vd(e),e.a=i,"GEOMETRYCOLLECTION"==o){t:{if(bd(e,2)){for(o=[];o.push(t(e)),bd(e,5););if(bd(e,3)){e=o;break t}}else if(Sd(e)){e=[];break t}throw Error(Md(e))}return new uu(e)}if(r=Ad[o],i=Pd[o],r&&i)return o=r.call(e),new i(o,e.a);throw Error("Invalid geometry type: "+o)}throw Error(Md(e))}(t))?Ml(t,!1,e):null},r.ge=function(t,e){return(t=t.V())?this.Cd(t,e):""},r.Wg=function(t,e){if(1==t.length)return this.ge(t[0],e);for(var o=[],i=0,r=t.length;i<r;++i)o.push(t[i].V());return t=new uu(o),this.Cd(t,e)},r.Cd=function(t,e){return fd(Ml(t,!0,e))},(r=dd.prototype).tg=function(){if(bd(this,2)){var t=md(this);if(bd(this,3))return t}else if(Sd(this))return null;throw Error(Md(this))},r.sg=function(){if(bd(this,2)){var t=wd(this);if(bd(this,3))return t}else if(Sd(this))return[];throw Error(Md(this))},r.ug=function(){if(bd(this,2)){var t=xd(this);if(bd(this,3))return t}else if(Sd(this))return[];throw Error(Md(this))},r.fp=function(){if(bd(this,2)){var t;if(2==this.b.type)for(t=[this.tg()];bd(this,5);)t.push(this.tg());else t=wd(this);if(bd(this,3))return t}else if(Sd(this))return[];throw Error(Md(this))},r.ep=function(){if(bd(this,2)){var t=xd(this);if(bd(this,3))return t}else if(Sd(this))return[];throw Error(Md(this))},r.gp=function(){if(bd(this,2)){for(var t=[this.ug()];bd(this,5);)t.push(this.ug());if(bd(this,3))return t}else if(Sd(this))return[];throw Error(Md(this))};var Pd={POINT:m,LINESTRING:S,POLYGON:w,MULTIPOINT:P,MULTILINESTRING:M,MULTIPOLYGON:f},Ad={POINT:dd.prototype.tg,LINESTRING:dd.prototype.sg,POLYGON:dd.prototype.ug,MULTIPOINT:dd.prototype.fp,MULTILINESTRING:dd.prototype.ep,MULTIPOLYGON:dd.prototype.gp};function Ed(){this.version=void 0}function Td(t,e){return g({},zd,t,e)}function jd(t,e){return g({},Vd,t,e)}function Cd(t,e){if(e=Td(t,e))return t=[Ru(t.getAttribute("width")),Ru(t.getAttribute("height"))],e.size=t,e}function Ld(t,e){return g([],Yd,t,e)}e(Ed,gg),Ed.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},Ed.prototype.b=function(t){return this.version=t.getAttribute("version").trim(),(t=g({version:this.version},Rd,t,[]))||null};var ti=[null,"http://www.opengis.net/wms"],Rd=l(ti,{Service:o(function(t,e){return g({},Nd,t,e)}),Capability:o(function(t,e){return g({},Id,t,e)})}),Id=l(ti,{Request:o(function(t,e){return g({},Xd,t,e)}),Exception:o(function(t,e){return g([],Od,t,e)}),Layer:o(function(t,e){return g({},Ud,t,e)})}),Nd=l(ti,{Name:o(i),Title:o(i),Abstract:o(i),KeywordList:o(Ld),OnlineResource:o(yg),ContactInformation:o(function(t,e){return g({},Fd,t,e)}),Fees:o(i),AccessConstraints:o(i),LayerLimit:o(Lu),MaxWidth:o(Lu),MaxHeight:o(Lu)}),Fd=l(ti,{ContactPersonPrimary:o(function(t,e){return g({},kd,t,e)}),ContactPosition:o(i),ContactAddress:o(function(t,e){return g({},Dd,t,e)}),ContactVoiceTelephone:o(i),ContactFacsimileTelephone:o(i),ContactElectronicMailAddress:o(i)}),kd=l(ti,{ContactPerson:o(i),ContactOrganization:o(i)}),Dd=l(ti,{AddressType:o(i),Address:o(i),City:o(i),StateOrProvince:o(i),PostCode:o(i),Country:o(i)}),Od=l(ti,{Format:pl(i)}),Ud=l(ti,{Name:o(i),Title:o(i),Abstract:o(i),KeywordList:o(Ld),CRS:ll(i),EX_GeographicBoundingBox:o(function(t,e){if(i=g({},Bd,t,e)){t=i.westBoundLongitude,e=i.southBoundLatitude;var o=i.eastBoundLongitude,i=i.northBoundLatitude;if(void 0!==t&&void 0!==e&&void 0!==o&&void 0!==i)return[t,e,o,i]}}),BoundingBox:ll(function(t){var e=[Cu(t.getAttribute("minx")),Cu(t.getAttribute("miny")),Cu(t.getAttribute("maxx")),Cu(t.getAttribute("maxy"))],o=[Cu(t.getAttribute("resx")),Cu(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:e,res:o}}),Dimension:ll(function(t){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:Eu(t.getAttribute("multipleValues")),nearestValue:Eu(t.getAttribute("nearestValue")),current:Eu(t.getAttribute("current")),values:i(t)}}),Attribution:o(function(t,e){return g({},Gd,t,e)}),AuthorityURL:ll(function(t,e){if(e=Td(t,e))return e.name=t.getAttribute("name"),e}),Identifier:ll(i),MetadataURL:ll(function(t,e){if(e=Td(t,e))return e.type=t.getAttribute("type"),e}),DataURL:ll(Td),FeatureListURL:ll(Td),Style:ll(function(t,e){return g({},Kd,t,e)}),MinScaleDenominator:o(ju),MaxScaleDenominator:o(ju),Layer:ll(function(t,e){var o=e[e.length-1],i=g({},Ud,t,e);if(i)return void 0===(e=Eu(t.getAttribute("queryable")))&&(e=o.queryable),i.queryable=void 0!==e&&e,void 0===(e=Ru(t.getAttribute("cascaded")))&&(e=o.cascaded),i.cascaded=e,void 0===(e=Eu(t.getAttribute("opaque")))&&(e=o.opaque),i.opaque=void 0!==e&&e,void 0===(e=Eu(t.getAttribute("noSubsets")))&&(e=o.noSubsets),i.noSubsets=void 0!==e&&e,e=(e=Cu(t.getAttribute("fixedWidth")))||o.fixedWidth,i.fixedWidth=e,t=(t=Cu(t.getAttribute("fixedHeight")))||o.fixedHeight,i.fixedHeight=t,["Style","CRS","AuthorityURL"].forEach(function(t){t in o&&(i[t]=(i[t]||[]).concat(o[t]))}),"EX_GeographicBoundingBox BoundingBox Dimension Attribution MinScaleDenominator MaxScaleDenominator".split(" ").forEach(function(t){t in i||(i[t]=o[t])}),i})}),Gd=l(ti,{Title:o(i),OnlineResource:o(yg),LogoURL:o(Cd)}),Bd=l(ti,{westBoundLongitude:o(ju),eastBoundLongitude:o(ju),southBoundLatitude:o(ju),northBoundLatitude:o(ju)}),Xd=l(ti,{GetCapabilities:o(jd),GetMap:o(jd),GetFeatureInfo:o(jd)}),Vd=l(ti,{Format:ll(i),DCPType:ll(function(t,e){return g({},Wd,t,e)})}),Wd=l(ti,{HTTP:o(function(t,e){return g({},Zd,t,e)})}),Zd=l(ti,{Get:o(Td),Post:o(Td)}),Kd=l(ti,{Name:o(i),Title:o(i),Abstract:o(i),LegendURL:ll(Cd),StyleSheetURL:o(Td),StyleURL:o(Td)}),zd=l(ti,{Format:o(i),OnlineResource:o(yg)}),Yd=l(ti,{Keyword:pl(i)});function Hd(t){t=t||{},this.a="http://mapserver.gis.umn.edu/mapserver",this.b=new Zu,this.c=t.layers||null,wu.call(this)}function qd(){this.i=new dg}function Jd(t){var e=i(t).split(" ");if(e&&2==e.length&&(t=+e[0],e=+e[1],!isNaN(t))&&!isNaN(e))return[t,e]}e(Hd,wu),Hd.prototype.zc=function(t,e){var o={},i=(e&&Xt(o,xl(this,t,e)),o=[o],t.setAttribute("namespaceURI",this.a),t.localName);if(e=[],t.childNodes.length){if("msGMLOutput"==i)for(var r=0,n=t.childNodes.length;r<n;r++){var s,a,p,h=t.childNodes[r];h.nodeType===Node.ELEMENT_NODE&&(s=o[0],a=h.localName.replace("_layer",""),!this.c||D(this.c,a))&&(a+="_feature",s.featureType=a,s.featureNS=this.a,(p={})[a]=pl(this.b.wg,this.b),s=l([s.featureNS,null],p),h.setAttribute("namespaceURI",this.a),h=g([],s,h,o,this.b))&&X(e,h)}"FeatureCollection"==i&&(t=g([],this.b.b,t,[{}],this.b))&&(e=t)}return e},Hd.prototype.Vg=function(){},Hd.prototype.Xb=function(){},Hd.prototype.ie=function(){},e(qd,gg),qd.prototype.a=function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE)return this.b(t);return null},qd.prototype.b=function(t){var e=t.getAttribute("version").trim(),o=this.i.b(t);return o&&(o.version=e,o=g(o,_d,t,[]))||null};var fi=[null,"http://www.opengis.net/wmts/1.0"],ti=[null,"http://www.opengis.net/ows/1.1"],_d=l(fi,{Contents:o(function(t,e){return g({},$d,t,e)})}),$d=l(fi,{Layer:ll(function(t,e){return g({},Qd,t,e)}),TileMatrixSet:ll(function(t,e){return g({},s0,t,e)})}),Qd=l(fi,{Style:ll(function(t,e){if(e=g({},t0,t,e))return t="true"===t.getAttribute("isDefault"),e.isDefault=t,e}),Format:ll(i),TileMatrixSetLink:ll(function(t,e){return g({},e0,t,e)}),Dimension:ll(function(t,e){return g({},r0,t,e)}),ResourceURL:ll(function(t){var e=t.getAttribute("format"),o=t.getAttribute("template"),i=(t=t.getAttribute("resourceType"),{});return e&&(i.format=e),o&&(i.template=o),t&&(i.resourceType=t),i})},l(ti,{Title:o(i),Abstract:o(i),WGS84BoundingBox:o(function(t,e){if(2==(t=g([],n0,t,e)).length)return ht(t)}),Identifier:o(i)})),t0=l(fi,{LegendURL:ll(function(t){var e={};return e.format=t.getAttribute("format"),e.href=yg(t),e})},l(ti,{Title:o(i),Identifier:o(i)})),e0=l(fi,{TileMatrixSet:o(i),TileMatrixSetLimits:o(function(t,e){return g([],o0,t,e)})}),o0=l(fi,{TileMatrixLimits:pl(function(t,e){return g({},i0,t,e)})}),i0=l(fi,{TileMatrix:o(i),MinTileRow:o(Lu),MaxTileRow:o(Lu),MinTileCol:o(Lu),MaxTileCol:o(Lu)}),r0=l(fi,{Default:o(i),Value:ll(i)},l(ti,{Identifier:o(i)})),n0=l(ti,{LowerCorner:pl(Jd),UpperCorner:pl(Jd)}),s0=l(fi,{WellKnownScaleSet:o(i),TileMatrix:ll(function(t,e){return g({},a0,t,e)})},l(ti,{SupportedCRS:o(i),Identifier:o(i)})),a0=l(fi,{TopLeftCorner:o(Jd),ScaleDenominator:o(ju),TileWidth:o(Lu),TileHeight:o(Lu),MatrixWidth:o(Lu),MatrixHeight:o(Lu)},l(ti,{Identifier:o(i)}));function p0(t){ro.call(this),t=t||{},this.a=null,this.f=xe,this.c=void 0,d(this,so("projection"),this.Am,this),d(this,so("tracking"),this.Bm,this),void 0!==t.projection&&this.Wh(t.projection),void 0!==t.trackingOptions&&this.wj(t.trackingOptions),this.Ke(void 0!==t.tracking&&t.tracking)}function h0(t,e,o){b.call(this),this.Ng(t,e||0,o)}function l0(t){var e=t.A[t.a]-t.A[0];return e*e+(t=t.A[t.a+1]-t.A[1])*t}function u0(t,e,o){for(var i,r,n,s,a,p,h=[],l=t(0),u=t(1),c=e(l),f=[u,l],y=[e(u),c],g=[1,0],d={},v=1e5;0<--v&&0<g.length;)s=g.pop(),l=f.pop(),c=y.pop(),(u=s.toString())in d||(h.push(c[0],c[1]),d[u]=!0),a=g.pop(),u=f.pop(),i=y.pop(),et((n=e(r=t(p=(s+a)/2)))[0],n[1],c[0],c[1],i[0],i[1])<o?(h.push(i[0],i[1]),d[u=a.toString()]=!0):(g.push(a,p,p,s),y.push(i,n,n,c),f.push(u,r,r,l));return h}function c0(t){t=t||{},this.j=this.v=null,this.f=this.o=1/0,this.g=this.l=-1/0,this.ra=this.oa=1/0,this.R=this.I=-1/0,this.Jb=void 0!==t.targetSize?t.targetSize:100,this.fb=void 0!==t.maxLines?t.maxLines:100,this.i=[],this.c=[],this.pa=void 0!==t.strokeStyle?t.strokeStyle:f0,this.D=this.u=void 0,this.a=this.b=this.S=null,1==t.showLabels&&(this.na=t.lonLabelFormatter||ir.bind(this,"EW"),this.Ua=t.latLabelFormatter||ir.bind(this,"NS"),this.fa=null==t.lonLabelPosition?0:t.lonLabelPosition,this.T=null==t.latLabelPosition?1:t.latLabelPosition,this.B=void 0!==t.lonLabelStyle?t.lonLabelStyle:new pf({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new Hh({color:"rgba(0,0,0,1)"}),stroke:new hp({color:"rgba(255,255,255,1)",width:3})}),this.C=void 0!==t.latLabelStyle?t.latLabelStyle:new pf({font:"12px Calibri,sans-serif",textAlign:"end",fill:new Hh({color:"rgba(0,0,0,1)"}),stroke:new hp({color:"rgba(255,255,255,1)",width:3})}),this.b=[],this.a=[]),this.setMap(void 0!==t.map?t.map:null)}e(p0,ro),(r=p0.prototype).ka=function(){this.Ke(!1),ro.prototype.ka.call(this)},r.Am=function(){var t=this.Uh();t&&(this.f=we(v("EPSG:4326"),t),this.a)&&this.set("position",this.f(this.a))},r.Bm=function(){var t;hi&&((t=this.Vh())&&void 0===this.c?this.c=navigator.geolocation.watchPosition(this.np.bind(this),this.op.bind(this),this.Gh()):t||void 0===this.c||(navigator.geolocation.clearWatch(this.c),this.c=void 0))},r.np=function(t){t=t.coords,this.set("accuracy",t.accuracy),this.set("altitude",null===t.altitude?void 0:t.altitude),this.set("altitudeAccuracy",null===t.altitudeAccuracy?void 0:t.altitudeAccuracy),this.set("heading",null===t.heading?void 0:it(t.heading)),this.a?(this.a[0]=t.longitude,this.a[1]=t.latitude):this.a=[t.longitude,t.latitude];var e=this.f(this.a);this.set("position",e),this.set("speed",null===t.speed?void 0:t.speed),(t=Yr(ie,this.a,t.accuracy)).Dc(this.f),this.set("accuracyGeometry",t),this.s()},r.op=function(t){t.type="error",this.Ke(!1),this.b(t)},r.Dk=function(){return this.get("accuracy")},r.Ek=function(){return this.get("accuracyGeometry")||null},r.Gk=function(){return this.get("altitude")},r.Hk=function(){return this.get("altitudeAccuracy")},r.ym=function(){return this.get("heading")},r.zm=function(){return this.get("position")},r.Uh=function(){return this.get("projection")},r.ll=function(){return this.get("speed")},r.Vh=function(){return this.get("tracking")},r.Gh=function(){return this.get("trackingOptions")},r.Wh=function(t){this.set("projection",v(t))},r.Ke=function(t){this.set("tracking",t)},r.wj=function(t){this.set("trackingOptions",t)},e(h0,b),(r=h0.prototype).clone=function(){var t=new h0(null);return br(t,this.ja,this.A.slice()),t.s(),t},r.Kb=function(t,e,o,i){var r=this.A,n=(t-=r[0],e-r[1]);if((e=t*t+n*n)<i){if(e)for(i=this.pd()/Math.sqrt(e),o[0]=r[0]+i*t,o[1]=r[1]+i*n,i=2;i<this.a;++i)o[i]=r[i];else for(i=0;i<this.a;++i)o[i]=r[i];return o.length=this.a,e}return i},r.Mc=function(t,e){var o=this.A;return(t-=o[0])*t+(e-=o[1])*e<=l0(this)},r.wa=function(){return this.A.slice(0,this.a)},r.se=function(t){var e=this.A,o=e[this.a]-e[0];return bt(e[0]-o,e[1]-o,e[0]+o,e[1]+o,t)},r.pd=function(){return Math.sqrt(l0(this))},r.U=function(){return"Circle"},r.Xa=function(t){var e;return!!Ot(t,this.G())&&(e=this.wa(),t[0]<=e[0]&&t[2]>=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;e<o;++e)i[o+e]=t[e];br(this,this.ja,i),this.s()},r.Ng=function(t,e,o){if(t){var i;for(mr(this,o,t,0),this.A||(this.A=[]),t=Tr(o=this.A,t),o[t++]=o[0]+e,e=1,i=this.a;e<i;++e)o[t++]=o[e];o.length=t}else br(this,"XY",null);this.s()},r.X=function(){},r.ma=function(){},r.Uc=function(t){this.A[this.a]=this.A[0]+t,this.s()};var f0=new hp({color:"rgba(0,0,0,0.2)"}),y0=[90,45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001];function g0(t,e,o,i,r,n,s){var a,p,h,l,u=s;return a=e,p=o,h=i,l=t.j,r=r,o=u0(function(t){return[a,p+(h-p)*t]},me(v("EPSG:4326"),l),r),(u=void 0!==t.i[u]?t.i[u]:new S(null)).ba("XY",o),Ot(u.G(),n)&&(t.b&&(o=s,n=[(i=u.ga())[0],Q(n[1]+Math.abs(n[1]-n[3])*t.fa,Math.max(n[1],i[1]),Math.min(n[3],i[i.length-1]))],(o=t.b[o]?t.b[o].Qd:new m(null)).ma(n),t.b[s]={Qd:o,text:t.na(e)}),t.i[s++]=u),s}function d0(t,e,o,i,r){var n,s,a,p,h,l=r;return n=e,s=t.g,a=t.f,h=t.j,p=o,o=u0(function(t){return[s+(a-s)*t,n]},me(v("EPSG:4326"),h),p),(l=void 0!==t.c[l]?t.c[l]:new S(null)).ba("XY",o),Ot(l.G(),i)&&(t.a&&(o=r,h=l.ga(),i=[Q(i[0]+Math.abs(i[0]-i[2])*t.T,Math.max(i[0],h[0]),Math.min(i[2],h[h.length-2])),h[1]],(o=t.a[o]?t.a[o].Qd:new m(null)).ma(i),t.a[r]={Qd:o,text:t.Ua(e)}),t.c[r++]=l),r}function v0(t,e,o,i,r){eo.call(this),this.f=r,this.extent=t,this.a=o,this.resolution=e,this.state=i}function b0(t,e,o,i,r,n,s){v0.call(this,t,e,o,0,i),this.j=r,this.M=new Image,null!==n&&(this.M.crossOrigin=n),this.c={},this.i=null,this.state=0,this.g=s}function m0(t,e,o,i,r,n){this.c=n||null,v0.call(this,t,e,o,n?0:2,i),this.i=r}function w0(t,e){eo.call(this),this.ta=t,this.state=e,this.i=null,this.key=""}function x0(t){if(t.i){var e=t.i;do{if(2==e.getState())return e}while(e=e.i)}return t}function S0(t,e){t.state=e,t.s()}function M0(t,e,o,i,r){w0.call(this,t,e),this.g=o,this.M=new Image,null!==i&&(this.M.crossOrigin=i),this.c=null,this.j=r}function P0(t){t.c.forEach(qe),t.c=null}(r=c0.prototype).Cm=function(){return this.v},r.al=function(){return this.i},r.hl=function(){return this.c},r.Kh=function(t){var e,o,i,r,n,s,a,p,h,l,u=t.vectorContext,c=t.frameState,f=c.extent,y=(t=c.viewState).center,g=t.projection,d=t.resolution;for(t=d*d/(4*(t=c.pixelRatio)*t),this.j&&be(this.j,g)||(e=v("EPSG:4326"),o=g.G(),l=Pe(i=g.g,e,g),r=i[2],n=i[1],s=i[0],a=l[3],p=l[2],h=l[1],l=l[0],this.o=i[3],this.f=r,this.l=n,this.g=s,this.oa=a,this.ra=p,this.I=h,this.R=l,this.u=me(e,g),this.D=me(g,e),this.S=this.D(Lt(o)),this.j=g),g.i&&(e=Dt(g=g.G()),(c=c.focus[0])<g[0]||c>g[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;d<o&&(r[0]=c-(s=y0[d]/2),r[1]=g-s,n[0]=c+s,n[1]=g+s,this.u(r,r),this.u(n,n),!((s=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2))<=i));++d)e=y0[d];if(-1==(d=e))this.i.length=this.c.length=0,this.b&&(this.b.length=0),this.a&&(this.a.length=0);else{for(y=(c=this.D(y))[0],c=c[1],g=this.fb,i=(e=Pe(e=[Math.max(f[0],this.R),Math.max(f[1],this.I),Math.min(f[2],this.ra),Math.min(f[3],this.oa)],this.j,"EPSG:4326"))[3],n=e[1],o=g0(this,r=Q(y=Math.floor(y/d)*d,this.g,this.f),n,i,t,f,0),e=0;r!=this.g&&e++<g;)o=g0(this,r=Math.max(r-d,this.g),n,i,t,f,o);for(r=Q(y,this.g,this.f),e=0;r!=this.f&&e++<g;)o=g0(this,r=Math.min(r+d,this.f),n,i,t,f,o);for(this.i.length=o,this.b&&(this.b.length=o),o=d0(this,y=Q(c=Math.floor(c/d)*d,this.l,this.o),t,f,0),e=0;y!=this.l&&e++<g;)o=d0(this,y=Math.max(y-d,this.l),t,f,o);for(y=Q(c,this.l,this.o),e=0;y!=this.o&&e++<g;)o=d0(this,y=Math.min(y+d,this.o),t,f,o);this.c.length=o,this.a&&(this.a.length=o)}for(u.Ma(null,this.pa),t=0,y=this.i.length;t<y;++t)d=this.i[t],u.zb(d);for(t=0,y=this.c.length;t<y;++t)d=this.c[t],u.zb(d);if(this.b)for(t=0,y=this.b.length;t<y;++t)d=this.b[t],this.B.xd(d.text),u.Cb(this.B),u.zb(d.Qd);if(this.a)for(t=0,y=this.a.length;t<y;++t)d=this.a[t],this.C.xd(d.text),u.Cb(this.C),u.zb(d.Qd)},r.setMap=function(t){this.v&&(this.v.K("postcompose",this.Kh,this),this.v.render()),t&&(t.J("postcompose",this.Kh,this),t.render()),this.v=t},e(v0,eo),v0.prototype.s=function(){this.b("change")},v0.prototype.G=function(){return this.extent},v0.prototype.getState=function(){return this.state},e(b0,v0),(r=b0.prototype).Y=function(t){var e;return void 0!==t?(t=U(t))in this.c?this.c[t]:(e=Zt(this.c)?this.M:this.M.cloneNode(!1),this.c[t]=e):this.M},r.Fm=function(){this.state=3,this.i.forEach(qe),this.i=null,this.s()},r.Gm=function(){void 0===this.resolution&&(this.resolution=It(this.extent)/this.M.height),this.state=2,this.i.forEach(qe),this.i=null,this.s()},r.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.s(),this.i=[Ye(this.M,"error",this.Fm,this),Ye(this.M,"load",this.Gm,this)],this.g(this,this.j))},r.Og=function(t){this.M=t},e(m0,v0),m0.prototype.g=function(t){this.state=t?3:2,this.s()},m0.prototype.load=function(){0==this.state&&(this.state=1,this.s(),this.c(this.g.bind(this)))},m0.prototype.Y=function(){return this.i},e(w0,eo),w0.prototype.s=function(){this.b("change")},w0.prototype.bb=function(){return this.key+"/"+this.ta},w0.prototype.f=function(){return this.ta},w0.prototype.getState=function(){return this.state},e(M0,w0),(r=M0.prototype).ka=function(){1==this.state&&P0(this),this.i&&$e(this.i),this.state=5,this.s(),w0.prototype.ka.call(this)},r.Y=function(){return this.M},r.bb=function(){return this.g},r.Dm=function(){this.state=3,this.M=A0,P0(this),this.s()},r.Em=function(){this.state=this.M.naturalWidth&&this.M.naturalHeight?2:4,P0(this),this.s()},r.load=function(){0!=this.state&&3!=this.state||(this.state=1,this.s(),this.c=[Ye(this.M,"error",this.Dm,this),Ye(this.M,"load",this.Em,this)],this.j(this,this.g))};var A0=new Image;function E0(t){t=t||{},pn.call(this,{handleEvent:cr}),this.g=t.formatConstructors||[],this.o=t.projection?v(t.projection):null,this.a=null,this.target=t.target||null}function T0(t){for(var e=0,o=(t=t.dataTransfer.files).length;e<o;++e){var i=t.item(e),r=new FileReader;r.addEventListener("load",this.j.bind(this,i)),r.readAsText(i)}}function j0(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}function C0(t){var e=t.v;e&&(e=t.target||e.a,t.a=[d(e,"drop",T0,t),d(e,"dragenter",j0,t),d(e,"dragover",j0,t),d(e,"drop",j0,t)])}function L0(t){t.a&&(t.a.forEach(qe),t.a=null)}A0.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e(E0,pn),E0.prototype.j=function(t,e){e=e.target.result;for(var o=this.v,i=(i=this.o)||o.Z().v,r=[],n=0,s=(o=this.g).length;n<s;++n){var a=new o[n],p={featureProjection:i};try{r=a.Oa(e,p)}catch(t){r=null}if(r&&0<r.length)break}this.b(new I0(R0,t,r,i))},E0.prototype.Ha=function(t){pn.prototype.Ha.call(this,t),(t?C0:L0)(this)},E0.prototype.setMap=function(t){L0(this),pn.prototype.setMap.call(this,t),this.c()&&C0(this)};var R0="addfeatures";function I0(t,e,o,i){Qe.call(this,t),this.features=o,this.file=e,this.projection=i}function N0(t){t=t||{},Mn.call(this,{handleDownEvent:D0,handleDragEvent:F0,handleUpEvent:k0}),this.l=t.condition||mn,this.a=this.g=void 0,this.j=0,this.u=void 0!==t.duration?t.duration:400}function F0(t){var e,o,i;xn(t)&&(o=(e=t.map).Ob(),t=(i=t.pixel)[0]-o[0]/2,i=o[1]/2-i[1],o=Math.atan2(i,t),t=Math.sqrt(t*t+i*i),(e=e.Z()).g.rotation!==_i&&void 0!==this.g&&(i=o-this.g,hn(e,e.Qa()-i)),this.g=o,void 0!==this.a&&(o=this.a*(e.Pa()/t),un(e,o)),void 0!==this.a&&(this.j=this.a/t),this.a=t)}function k0(t){if(!xn(t))return!0;nn(t=t.map.Z(),1,-1);var e=this.j-1,o=t.Qa(),o=t.constrainRotation(o,0),o=(hn(t,o,void 0,void 0),t.Pa()),i=this.u,o=t.constrainResolution(o,0,e);return un(t,o,void 0,i),this.j=0,!1}function D0(t){return!(!xn(t)||!this.l(t)||(nn(t.map.Z(),1,1),this.a=this.g=void 0))}function O0(t,e,o,i){this.fb=t,this.Ua=e,this.overlaps=i,this.c=0,this.resolution=o,this.ra=this.oa=null,this.a=[],this.coordinates=[],this.T=ms(),this.b=[],this.B=null,this.fa=ms(),this.na=ms()}function U0(t,e,o,i,r,n,s){for(var a=t.coordinates.length,p=t.Sf(),h=(s&&(o+=r),s=[e[o],e[o+1]],[NaN,NaN]),l=!0,u=o+r;u<i;u+=r){h[0]=e[u],h[1]=e[u+1];var c=dt(p,h),l=c!==f?(l&&(t.coordinates[a++]=s[0],t.coordinates[a++]=s[1]),t.coordinates[a++]=h[0],t.coordinates[a++]=h[1],!1):1!==c||(t.coordinates[a++]=h[0],t.coordinates[a++]=h[1],!1),f=(s[0]=h[0],s[1]=h[1],c)}return(n&&l||u===o+r)&&(t.coordinates[a++]=s[0],t.coordinates[a++]=s[1]),a}function G0(t,e){t.oa=[0,e,0],t.a.push(t.oa),t.ra=[0,e,0],t.b.push(t.ra)}function B0(t,e,o,i,r,n,s,a,p){var h;t.B&&Z(i,t.T)?h=t.B:(t.B||(t.B=[]),h=gr(t.coordinates,0,t.coordinates.length,2,i,t.B),Ms(t.T,i)),i=!Zt(n);for(var l,u,c=0,D=s.length,f=0,y=t.fa,g=t.na,d=0,v=0,b=t.a!=s||t.overlaps?0:200;c<D;)switch((N=s[c])[0]){case 0:f=N[1],i&&n[U(f).toString()]||!f.V()?c=N[2]:void 0===p||Ot(p,f.V().G())?++c:c=N[2]+1;break;case 1:b<d&&(t.Va(e,r),d=0),b<v&&(e.stroke(),v=0),d||v||(e.beginPath(),l=u=NaN),++c;break;case 2:m=h[f=N[1]],N=h[f+1],j=h[f+2]-m,f=h[f+3]-N,f=Math.sqrt(j*j+f*f),e.moveTo(m+f,N),e.arc(m,N,f,0,2*Math.PI,!0),++c;break;case 3:e.closePath(),++c;break;case 4:f=N[1];var m=N[2],w=N[3],x=N[4]*o,S=N[5]*o,M=N[6],P=N[7],A=N[8],E=N[9],T=N[10],j=N[11],C=N[12],L=N[13],R=N[14];for(T&&(j+=r);f<m;f+=2){var I,N=h[f]-x,T=h[f+1]-S,F=(L&&(N=Math.round(N),T=Math.round(T)),1==C&&!j||(js(y,I=N+x,F=T+S,C,C,j,-I,-F),e.setTransform.apply(e,y)),I=e.globalAlpha,1!=P&&(e.globalAlpha=I*P),R+A>w.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);f<m;f+=2){for(N=h[f]+M,T=h[f+1]+P,1==C&&!j||(js(y,N,T,C,C,j,-N,-T),e.setTransform.apply(e,y)),1<(E=(A=S.split("\n")).length)?T-=(E-1)/2*(L=Math.round(1.5*e.measureText("M").width)):L=0,R=0;R<E;R++)I=A[R],x&&e.strokeText(I,N,T),w&&e.fillText(I,N,T),T+=L;1==C&&!j||e.setTransform.apply(e,g)}++c;break;case 6:if(a&&(f=a(f=N[1])))return f;++c;break;case 7:b?d++:t.Va(e,r),++c;break;case 8:for(f=N[1],m=N[2],N=h[f],C=(T=h[f+1])+.5|0,(j=N+.5|0)===l&&C===u||(e.moveTo(N,T),l=j,u=C),f+=2;f<m;f+=2)j=(N=h[f])+.5|0,C=(T=h[f+1])+.5|0,f!=m-2&&j===l&&C===u||(e.lineTo(N,T),l=j,u=C);++c;break;case 9:t.R=N[2],d&&(t.Va(e,r),d=0,v)&&(e.stroke(),v=0),e.fillStyle=N[1],++c;break;case 10:var f=void 0===N[8]||N[8],k=N[9];m=N[2],v&&(e.stroke(),v=0),e.strokeStyle=N[1],e.lineWidth=f?m*o:m,e.lineCap=N[3],e.lineJoin=N[4],e.miterLimit=N[5],si&&(m=N[6],j=N[7],f&&o!==k&&(m=m.map(function(t){return t*o/k}),j*=o/k,N[6]=m,N[7]=j,N[9]=o),e.lineDashOffset=j,e.setLineDash(m)),++c;break;case 11:e.font=N[1],e.textAlign=N[2],e.textBaseline=N[3],++c;break;case 12:b?v++:e.stroke(),++c;break;default:++c}d&&t.Va(e,r),v&&e.stroke()}function X0(t){var e=t.b;e.reverse();for(var o=e.length,i=-1,r=0;r<o;++r){var n=e[r],s=n[0];if(6==s)i=r;else if(0==s){for(n[2]=r,n=t.b,s=r;i<s;){var a=n[i];n[i]=n[s],n[s]=a,++i,--s}i=-1}}}function V0(t,e){t.oa[2]=t.a.length,t.oa=null,t.ra[2]=t.b.length,t.ra=null,t.a.push(e=[6,e]),t.b.push(e)}function W0(t,e,o,i){O0.call(this,t,e,o,i),this.M=this.I=null,this.C=this.D=this.S=this.u=this.v=this.l=this.o=this.j=this.g=this.f=this.i=void 0}function Z0(t,e,o,i){O0.call(this,t,e,o,i),this.f=null,this.i={Md:void 0,Gd:void 0,Hd:null,Id:void 0,Jd:void 0,Kd:void 0,Ld:void 0,eg:0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}}function K0(t,e,o,i,r){var n=t.coordinates.length;return e=U0(t,e,o,i,r,!1,!1),t.a.push(n=[8,n,e]),t.b.push(n),i}function z0(t){var e=t.i,o=e.strokeStyle,i=e.lineCap,r=e.lineDash,n=e.lineDashOffset,s=e.lineJoin,a=e.lineWidth,p=e.miterLimit;e.Md==o&&e.Gd==i&&Z(e.Hd,r)&&e.Id==n&&e.Jd==s&&e.Kd==a&&e.Ld==p||(e.eg!=t.coordinates.length&&(t.a.push([12]),e.eg=t.coordinates.length),t.a.push([10,o,a,i,s,p,r,n,!0,1],[1]),e.Md=o,e.Gd=i,e.Hd=r,e.Id=n,e.Jd=s,e.Kd=a,e.Ld=p)}function Y0(t,e,o,i){O0.call(this,t,e,o,i),this.f=null,this.i={oh:void 0,Md:void 0,Gd:void 0,Hd:null,Id:void 0,Jd:void 0,Kd:void 0,Ld:void 0,fillStyle:void 0,strokeStyle:void 0,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0}}function H0(t,e,o,i,r){var n=void 0!==(s=t.i).fillStyle,s=null!=s.strokeStyle,a=i.length,p=[1];for(t.a.push(p),t.b.push(p),p=0;p<a;++p){var h=i[p],l=t.coordinates.length;o=U0(t,e,o,h,r,!0,!s),t.a.push(o=[8,l,o]),t.b.push(o),s&&(t.a.push(o=[3]),t.b.push(o)),o=h}return t.b.push(e=[7]),n&&t.a.push(e),s&&(t.a.push(n=[12]),t.b.push(n)),o}function q0(t,e){var o,i=t.i,r=i.fillStyle,n=i.strokeStyle,s=i.lineCap,a=i.lineDash,p=i.lineDashOffset,h=i.lineJoin,l=i.lineWidth,u=i.miterLimit;void 0===r||"string"==typeof r&&i.oh==r||(o=[9,r],"string"!=typeof r&&(e=e.G(),o.push([e[0],e[3]])),t.a.push(o),i.oh=i.fillStyle),void 0===n||i.Md==n&&i.Gd==s&&Z(i.Hd,a)&&i.Id==p&&i.Jd==h&&i.Kd==l&&i.Ld==u||(t.a.push([10,n,l,s,h,u,a,p,!0,1]),i.Md=n,i.Gd=s,i.Hd=a,i.Id=p,i.Jd=h,i.Kd=l,i.Ld=u)}function J0(t,e,o,i){O0.call(this,t,e,o,i),this.C=this.D=this.S=null,this.Ia="",this.o=this.j=0,this.l=void 0,this.u=this.v=0,this.g=this.f=this.i=null}function _0(t,e,o,i,r){this.v=t,this.c=e,this.o=i,this.l=o,this.f=r,this.a={},this.g=Po(1,1),this.j=ms()}e(I0,Qe),e(N0,Mn),e(O0,Xs),O0.prototype.Va=function(t,e){var o;this.R&&(o=Ps(this.T,this.R.slice()),t.translate(o[0],o[1]),t.rotate(e)),t.fill(),this.R&&t.setTransform.apply(t,this.na)},O0.prototype.La=function(t,e,o,i,r){B0(this,t,e,o,i,r,this.a,void 0,void 0)},O0.prototype.Te=Y,O0.prototype.Sf=function(){return this.Ua},e(W0,O0),W0.prototype.qc=function(t,e){var o,i;this.M&&(G0(this,e),o=t.ga(),i=this.coordinates.length,t=U0(this,o,0,o.length,t.qa(),!1,!1),this.a.push([4,i,t,this.M,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),this.b.push([4,i,t,this.I,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),V0(this,e))},W0.prototype.oc=function(t,e){var o,i;this.M&&(G0(this,e),o=t.ga(),i=this.coordinates.length,t=U0(this,o,0,o.length,t.qa(),!1,!1),this.a.push([4,i,t,this.M,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),this.b.push([4,i,t,this.I,this.i,this.f,this.g,this.j,this.o,this.l,this.v,this.u,this.S,this.D,this.C]),V0(this,e))},W0.prototype.Te=function(){X0(this),this.f=this.i=void 0,this.M=this.I=null,this.C=this.D=this.u=this.v=this.l=this.o=this.j=this.S=this.g=void 0},W0.prototype.Ub=function(t){var e=t.Hc(),o=t.ic(),i=t.qg(1),r=t.Y(1),n=t.Oc();this.i=e[0],this.f=e[1],this.I=i,this.M=r,this.g=o[1],this.j=t.f,this.o=n[0],this.l=n[1],this.v=t.l,this.u=t.g,this.S=t.a,this.D=t.v,this.C=o[0]},e(Z0,O0),(r=Z0.prototype).Sf=function(){return this.f||(this.f=ut(this.Ua),0<this.c&<(this.f,this.resolution*(this.c+1)/2,this.f)),this.f},r.mc=function(t,e){var o=this.i,i=o.lineWidth;void 0!==o.strokeStyle&&void 0!==i&&(z0(this),G0(this,e),this.b.push([10,o.strokeStyle,o.lineWidth,o.lineCap,o.lineJoin,o.miterLimit,o.lineDash,o.lineDashOffset,!0,1],[1]),K0(this,o=t.ga(),0,o.length,t.qa()),this.b.push([12]),V0(this,e))},r.nc=function(t,e){var o=this.i,i=o.lineWidth;if(void 0!==o.strokeStyle&&void 0!==i){z0(this),G0(this,e),this.b.push([10,o.strokeStyle,o.lineWidth,o.lineCap,o.lineJoin,o.miterLimit,o.lineDash,o.lineDashOffset,!0,1],[1]),o=t.Bb(),i=t.ga(),t=t.qa();for(var r=0,n=0,s=o.length;n<s;++n)r=K0(this,i,r,o[n],t);this.b.push([12]),V0(this,e)}},r.Te=function(){this.i.eg!=this.coordinates.length&&this.a.push([12]),X0(this),this.i=null},r.Ma=function(t,e){t=e.a,this.i.strokeStyle=Mo(t||Gs),t=e.f,this.i.lineCap=void 0!==t?t:"round",t=e.i,this.i.lineDash=t||Us,t=e.g,this.i.lineDashOffset=t||0,t=e.j,this.i.lineJoin=void 0!==t?t:"round",t=e.c,this.i.lineWidth=void 0!==t?t:1,e=e.o,this.i.miterLimit=void 0!==e?e:10,this.i.lineWidth>this.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;n<s;++n)r=H0(this,i,r,o[n],t);V0(this,e)}},r.Te=function(){X0(this),this.i=null;var t=this.fb;if(t)for(var e=this.coordinates,o=0,i=e.length;o<i;++o)e[o]=t*Math.round(e[o]/t)},r.Sf=function(){return this.f||(this.f=ut(this.Ua),0<this.c&<(this.f,this.resolution*(this.c+1)/2,this.f)),this.f},r.Ma=function(t,e){var o=this.i;t?(t=t.b,o.fillStyle=Mo(t||Os)):o.fillStyle=void 0,e?(t=e.a,o.strokeStyle=Mo(t||Gs),t=e.f,o.lineCap=void 0!==t?t:"round",t=e.i,o.lineDash=t?t.slice():Us,t=e.g,o.lineDashOffset=t||0,t=e.j,o.lineJoin=void 0!==t?t:"round",t=e.c,o.lineWidth=void 0!==t?t:1,e=e.o,o.miterLimit=void 0!==e?e:10,o.lineWidth>this.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;i<e;i++)t[i][o]=!0;else if(e<r)for(i=e+1;i<r;i++)t[i][o]=!0}function tv(t){for(var e in t.a){var o,i=t.a[e];for(o in i)i[o].Te()}}function ev(t,e){var o=t.c,i=(t=o[0],o[1]),r=o[2];return gr(t=[t,i,t,o=o[3],r,o,r,i],0,8,2,e,t),t}_0.prototype.Ea=function(t,e,o,i,r,n){var s,a,p,h=2*(i=Math.round(i))+1,l=js(this.j,i+.5,i+.5,1/e,-1/e,-o,-t[0],-t[1]),u=this.g,c=(u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.f&&(Pt(s=vt(),t),lt(s,e*(this.f+i),s)),function(t){if(void 0!==$0[t])return $0[t];for(var e=2*t+1,o=Array(e),i=0;i<e;i++)o[i]=Array(e);for(var e=t,r=i=0;i<=e;)Q0(o,t+e,t+i),Q0(o,t+i,t+e),Q0(o,t-i,t+e),Q0(o,t-e,t+i),Q0(o,t-e,t-i),Q0(o,t-i,t-e),Q0(o,t+i,t-e),Q0(o,t+e,t-i),0<2*((r+=1+2*++i)-e)+1&&(r+=1-2*--e);return $0[t]=o}(i)),f=this,y=u,g=l,d=o,v=r,b=function(t){for(var e=u.getImageData(0,0,h,h).data,o=0;o<h;o++)for(var i=0;i<h;i++)if(c[o][i]&&0<e[4*(i*h+o)+3])return(t=n(t))||void u.clearRect(0,0,h,h)},m=s,w=Object.keys(f.a).map(Number),x=(w.sort(function(t,e){return e-t}),0);for(a=w.length;x<a;++x){var S=f.a[w[x].toString()];for(p=_s.length-1;0<=p;--p){var M=S[_s[p]];if(void 0!==M&&(M=B0(M,y,1,g,d,v,M.b,b,m)))return M}}},_0.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 ov[e](this.v,this.c,this.l,this.o),t[e]=o),o},_0.prototype.i=function(){return Zt(this.a)},_0.prototype.La=function(t,e,o,i,r,n){var s=Object.keys(this.a).map(Number),a=(s.sort(G),ev(this,o));t.save(),t.beginPath(),t.moveTo(a[0],a[1]),t.lineTo(a[2],a[3]),t.lineTo(a[4],a[5]),t.lineTo(a[6],a[7]),t.clip(),n=n||_s;for(var a=0,p=s.length;a<p;++a)for(var h=this.a[s[a].toString()],l=0,u=n.length;l<u;++l){var c=h[n[l]];void 0!==c&&c.La(t,e,o,i,r)}t.restore()};var ov={Circle:Y0,Image:W0,LineString:Z0,Polygon:Y0,Text:J0};function iv(t){io.call(this),this.a=t}function rv(t,e){var o=e.getState();return 2!=o&&3!=o&&d(e,"change",t.na,t),0==o&&(e.load(),o=e.getState()),2==o}function nv(t){var e=t.a;e.Mb()&&"ready"==e.$f()&&t.s()}function sv(t,e){e.Ki()&&t.postRenderFunctions.push(function(t,e,o){e=U(t).toString(),t.fd(o.viewState.projection,o.usedTiles[e])}.bind(null,e))}function av(t,e){if(e)for(var o=0,i=e.length;o<i;++o){var r=e[o];t[U(r).toString()]=r}}function pv(t,e){void 0!==(e=e.D)&&("string"==typeof e?t.logos[e]="":e&&(O("string"==typeof e.href,44),O("string"==typeof e.src,45),t.logos[e.src]=e.href))}function hv(t,e,o,i){e=U(e).toString(),o=o.toString(),e in t?o in t[e]?(t=t[e][o],i.ca<t.ca&&(t.ca=i.ca),i.$>t.$&&(t.$=i.$),i.da<t.da&&(t.da=i.da),i.ia>t.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;r<n;++r)(0,bv[e[r].U()])(t,e[r],o,i)},Circle:function(t,e,o,i){var r,n=o.Fa(),s=o.Ga();(n||s)&&((r=t.b(o.Ba(),"Circle")).Ma(n,s),r.Zb(e,i)),(n=o.Na())&&((t=t.b(o.Ba(),"Text")).Cb(n),t.yc(e.wa(),0,2,2,e,i))}};function mv(t){uv.call(this,t),this.c=!1,this.v=-1,this.l=NaN,this.j=vt(),this.f=this.o=null,this.g=Po()}function wv(){this.b="precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"}e(mv,uv),mv.prototype.S=function(t,e,o){var i=t.extent,r=t.pixelRatio,n=e.Je?t.skippedFeatureUids:{},s=(a=t.viewState).projection,a=a.rotation,p=s.G(),h=this.a.ha(),l=yv(this,t,0),u=(fv(this,"precompose",o,t,l),e.extent),c=void 0!==u;if(c&&cv(o,t,u),(u=this.f)&&!u.i()){var f,y,g=0,d=0,v=(f=(y=oo(this.a,"render")?(y=o.canvas.width,f=o.canvas.height,a&&(g=((v=Math.round(Math.sqrt(y*y+f*f)))-y)/2,d=(v-f)/2,y=f=v),this.g.canvas.width=y,this.g.canvas.height=f,this.g):o).globalAlpha,y.globalAlpha=e.opacity,y!=o&&y.translate(g,d),t.size[0]*r),b=t.size[1]*r;if(Bs(y,-a,v/2,b/2),u.La(y,r,l,a,n),h.u&&s.i&&!yt(p,i)){for(var s=i[0],h=Dt(p),m=0;s<p[0];)l=yv(this,t,l=h*--m),u.La(y,r,l,a,n),s+=h;for(m=0,s=i[2];s>p[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;i<r;++i)o=vv(a,t,e[i],dv(n,s),this.D,this)||o;else o=vv(a,t,e,dv(n,s),this.D,this)||o;t=o,this.c=this.c||t}}var o,n,s,i,a,r,p=this.a,h=p.ha(),l=(av(t.attributions,h.j),pv(t,h),t.viewHints[0]),u=t.viewHints[1],c=p.T,f=p.na;return!this.c&&!c&&l||!f&&u||(o=t.extent,l=(f=t.viewState).projection,n=f.resolution,s=t.pixelRatio,u=p.i,i=p.c,void 0===(c=p.get(jv))&&(c=gv),o=lt(o,i*n),i=f.projection.G(),h.u&&f.projection.i&&!yt(i,t.extent)&&(t=Math.max(Dt(o)/2,Dt(i)),o[0]=i[0]-t,o[2]=i[2]+t),!this.c&&this.l==n&&this.v==u&&this.o==c&&yt(this.j,o))||(this.f=null,this.c=!1,a=new _0(.5*n/s,o,n,h.T,p.c),h.Yd(o,n,l),c?(r=[],h.$b(o,function(t){r.push(t)},this),r.sort(c),r.forEach(e,this)):h.$b(o,e,this),tv(a),this.l=n,this.v=u,this.o=c,this.j=o,this.f=a),!0},e(wv,ta);var xv=new wv;function Sv(){this.b="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}"}e(Sv,ea);var Mv=new Sv;function Pv(t,e){this.i=t.getUniformLocation(e,"f"),this.c=t.getUniformLocation(e,"e"),this.g=t.getUniformLocation(e,"d"),this.f=t.getUniformLocation(e,"g"),this.b=t.getAttribLocation(e,"b"),this.a=t.getAttribLocation(e,"c")}function Av(t,e){iv.call(this,e),this.c=t,this.T=new da([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.g=this.Ib=null,this.j=void 0,this.v=ms(),this.S=ms(),this.C=aa(),this.u=null}function Ev(t,e,o,i){var r;oo(t=t.a,e)&&(r=i.viewState,t.b(new Ds(e,new sh(o,r.center,r.resolution,r.rotation,i.size,i.extent,i.pixelRatio),i,null,o)))}function Tv(t,e){Av.call(this,t,e),this.l=!1,this.R=-1,this.I=NaN,this.D=vt(),this.o=this.f=this.B=null}function s(t){var e=Xt({},t=t||{});delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,ys.call(this,e),this.c=void 0!==t.renderBuffer?t.renderBuffer:100,this.u=null,this.f=void 0,this.g(t.style),this.T=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.na=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}e(Av,iv),Av.prototype.Gi=function(t,e,o){Ev(this,"precompose",o,t),Ea(o,34962,this.T);var i,r=o.b,n=La(o,xv,Mv);this.u?i=this.u:this.u=i=new Pv(r,n),o.Qc(n)&&(r.enableVertexAttribArray(i.b),r.vertexAttribPointer(i.b,2,5126,!1,16,0),r.enableVertexAttribArray(i.a),r.vertexAttribPointer(i.a,2,5126,!1,16,8),r.uniform1i(i.f,0)),r.uniformMatrix4fv(i.g,!1,pa(this.C,this.v)),r.uniformMatrix4fv(i.c,!1,pa(this.C,this.S)),r.uniform1f(i.i,e.opacity),r.bindTexture(3553,this.Ib),r.drawArrays(5,0,4),Ev(this,"postcompose",o,t)},Av.prototype.mg=function(){this.g=this.Ib=null,this.j=void 0},e(Tv,Av),(r=Tv.prototype).Gi=function(t,e,o){this.o=e;var i=t.viewState,r=this.f,n=t.size,s=t.pixelRatio,a=this.c.i;r&&!r.i()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,n[0]*s,n[1]*s),r.La(o,i.center,i.resolution,i.rotation,n,s,e.opacity,e.Je?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},r.ka=function(){var t=this.f;t&&(oh(t,this.c.f)(),this.f=null),Av.prototype.ka.call(this)},r.Ea=function(t,e,o,i,r){var n,s;if(this.f&&this.o)return o=e.viewState,n=this.a,s={},this.f.Ea(t,this.c.f,o.center,o.resolution,o.rotation,e.size,e.pixelRatio,this.o.opacity,{},function(t){var e=U(t).toString();if(!(e in s))return s[e]=!0,i.call(r,t,n)})},r.Ue=function(t,e){var o,i,r,n,s,a,p;return!(!this.f||!this.o)&&(n=e.viewState,o=this.f,t=t,i=this.c.f,r=n.resolution,n=n.rotation,s=e.pixelRatio,a=this.o.opacity,e=e.skippedFeatureUids,(p=i.b).bindFramebuffer(p.FRAMEBUFFER,ja(i)),void 0!==ih(o,i,t,r,n,s,a,e,function(){var t=new Uint8Array(4);return p.readPixels(0,0,1,1,p.RGBA,p.UNSIGNED_BYTE,t),0<t[3]},!1))},r.lg=function(t,e,o,i){if(t=Ps(e.pixelToCoordinateTransform,t.slice()),this.Ue(t,e))return o.call(i,this.a,null)},r.Hi=function(){nv(this)},r.ng=function(t,e,o){function i(t){var e,o=t.Lc();if(o?e=o.call(t,h):(o=r.f)&&(e=o(t,h)),e){if(o=!1,Array.isArray(e))for(var i=e.length-1;0<=i;--i)o=vv(y,t,e[i],dv(h,l),this.Hi,this)||o;else o=vv(y,t,e,dv(h,l),this.Hi,this)||o;t=o,this.l=this.l||t}}var r=this.a,n=(e=r.ha(),av(t.attributions,e.j),pv(t,e),t.viewHints[0]),s=t.viewHints[1],a=r.T,p=r.na;if(!(!this.l&&!a&&n||!p&&s)){var s=t.extent,n=(a=t.viewState).projection,h=a.resolution,l=t.pixelRatio,a=r.i,u=r.c,p=r.get(jv);if(void 0===p&&(p=gv),s=lt(s,u*h),this.l||this.I!=h||this.R!=a||this.B!=p||!yt(this.D,s)){this.f&&t.postRenderFunctions.push(oh(this.f,o)),this.l=!1;var c,f,y=new eh(.5*h/l,s,r.c),g=(e.Yd(s,h,n),p?(c=[],e.$b(s,function(t){c.push(t)},this),c.sort(p),c.forEach(i,this)):e.$b(s,i,this),y),d=o;for(f in g.a){var v,b=g.a[f];for(v in b)b[v].Db(d)}this.I=h,this.R=a,this.B=p,this.D=s,this.f=y}}return!0},e(s,ys),s.prototype.Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new mv(this):"webgl"===o&&(e=new Tv(t,this)),e},s.prototype.D=function(){return this.u},s.prototype.C=function(){return this.f},s.prototype.g=function(t){this.u=void 0!==t?t:$h,this.f=null===t?void 0:Jh(this.u),this.s()};var jv="renderOrder";function Cv(){return[[-1/0,-1/0,1/0,1/0]]}function Lv(t){ro.call(this),this.c=v(t.projection),this.j=Rv(t.attributions),this.D=t.logo,this.na=void 0!==t.state?t.state:"ready",this.u=void 0!==t.wrapX&&t.wrapX}function Rv(t){if("string"==typeof t)return[new Be({html:t})];if(t instanceof Be)return[t];if(Array.isArray(t)){for(var e=t.length,o=Array(e),i=0;i<e;i++){var r=t[i];o[i]="string"==typeof r?new Be({html:r}):r}return o}return null}function Iv(t,e){t.na=e,t.s()}function a(t){Lv.call(this,{attributions:(t=t||{}).attributions,logo:t.logo,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.B=Y,this.C=t.format,this.T=null==t.overlaps||t.overlaps,this.I=t.url,t.loader?this.B=t.loader:void 0!==this.I&&(O(this.C,7),this.B=ml(this.I,this.C)),this.fa=t.strategy||Cv;var e,o,i,r,n=void 0===t.useSpatialIndex||t.useSpatialIndex;this.a=n?new Fp:null,this.R=new Fp,this.g={},this.o={},this.l={},this.v={},this.f=null,t.features instanceof ho?o=(e=t.features).a:Array.isArray(t.features)&&(o=t.features),n||(e=e||new ho(o)),o&&kv(this,o),e&&(i=e,r=!1,d(t=this,"addfeature",function(t){r||(r=!0,i.push(t.feature),r=!1)}),d(t,"removefeature",function(t){r||(r=!0,i.remove(t.feature),r=!1)}),d(i,"add",function(t){r||(r=!0,this.yb(t.element),r=!1)},t),d(i,"remove",function(t){r||(r=!0,this.Gb(t.element),r=!1)},t),t.f=i)}function Nv(t,e,o){t.v[e]=[d(o,"change",t.Oi,t),d(o,"propertychange",t.Oi,t)]}function Fv(t,e,o){var i=!0,r=o.a;return void 0!==r?r.toString()in t.o?i=!1:t.o[r.toString()]=o:(O(!(e in t.l),30),t.l[e]=o),i}function kv(t,e){for(var o=[],i=[],r=[],n=0,s=e.length;n<s;n++){var a=e[n],p=U(a).toString();Fv(t,p,a)&&i.push(a)}for(n=0,s=i.length;n<s;n++)Nv(t,p=U(a=i[n]).toString(),a),(e=a.V())?(p=e.G(),o.push(p),r.push(a)):t.g[p]=a;for(t.a&&t.a.load(o,r),n=0,s=i.length;n<s;n++)t.b(new Ov("addfeature",i[n]))}function Dv(t,e){for(var o in t.o)if(t.o[o]===e){delete t.o[o];break}}function Ov(t,e){Qe.call(this,t),this.feature=e}function Uv(t){var e;Mn.call(this,{handleDownEvent:Bv,handleEvent:Gv,handleUpEvent:Xv}),this.T=!1,this.fa=null,this.u=!1,this.Yb=t.source||null,this.$a=t.features||null,this.wk=t.snapTolerance||12,this.R=t.type,this.g=("Point"===(n=this.R)||"MultiPoint"===n?e=Hv:"LineString"===n||"MultiLineString"===n?e=qv:"Polygon"===n||"MultiPolygon"===n?e=Jv:"Circle"===n&&(e=_v),e),this.Sa=t.minPoints||(this.g===Jv?3:2),this.va=t.maxPoints||1/0,this.Cf=t.finishCondition||cr;var o,i,r,n=(n=t.geometryFunction)||("Circle"===this.R?function(t,e){return(e=e||new h0([NaN,NaN])).Ng(t[0],Math.sqrt(pr(t[0],t[1]))),e}:((i=this.g)===Hv?o=m:i===qv?o=S:i===Jv&&(o=w),function(t,e){return e?i===Jv?e.ma([t[0].concat([t[0][0]])]):e.ma(t):e=new o(t),e}));this.Za=n,this.I=this.C=this.a=this.B=this.j=this.l=null,this.ad=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.pa=new s({source:new a({useSpatialIndex:!1,wrapX:t.wrapX||!1}),style:t.style||(r=Qh(),function(t){return r[t.V().U()]})}),this.xb=t.geometryName,this.vk=t.condition||bn,this.Df=t.freehand?cr:t.freehandCondition||mn,d(this,so("active"),this.ri,this)}function Gv(t){this.u=this.g!==Hv&&this.Df(t);var e=!this.u;return this.u&&"pointerdrag"===t.type&&null!==this.j?(Kv(this,t),e=!1):"pointermove"===t.type?e=Vv(this,t):"dblclick"===t.type&&(e=!1),An.call(this,t)&&e}function Bv(t){return this.T=!this.u,this.u?(this.fa=t.pixel,this.l||Zv(this,t),!0):!!this.vk(t)&&(this.fa=t.pixel,!0)}function Xv(t){var e=!0,o=(Vv(this,t),this.g===_v);return this.T?(this.l?this.u||o?this.Pd():Wv(this,t)?this.Cf(t)&&this.Pd():Kv(this,t):(Zv(this,t),this.g===Hv&&this.Pd()),e=!1):this.u&&(this.l=null,zv(this)),e}function Vv(t,e){var o,i,r;return t.fa&&(!t.u&&t.T||t.u&&!t.T)&&(i=t.fa,o=e.pixel,r=(r=i[0]-o[0])*r+(i=i[1]-o[1])*i,t.T=t.u?r>t.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<s;n++){var a=r[n],p=i.Ja(a),h=e.pixel,o=h[0]-p[0],p=h[1]-p[1];if(o=Math.sqrt(o*o+p*p)<=(t.u?1:t.wk)){t.l=a;break}}}return o}function Zv(t,e){e=e.coordinate,t.l=e,t.g===Hv?t.a=e.slice():t.g===Jv?(t.a=[[e.slice(),e.slice()]],t.I=t.a[0]):(t.a=[e.slice(),e.slice()],t.g===_v&&(t.I=t.a)),t.I&&(t.C=new x(new S(t.I))),e=t.Za(t.a),t.j=new x,t.xb&&t.j.Tc(t.xb),t.j.Ra(e),Yv(t),t.b(new $v("drawstart",t.j))}function Kv(t,e){e=e.coordinate;var o,i,r=t.j.V();t.g===qv?(t.l=e.slice(),(i=t.a).length>=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)&&(n=t,t=Math.sqrt(a),p[0]=i-t,p[1]=r-t,p[2]=i+t,p[3]=r+t)}),n},r.G=function(t){return this.a.G(t)},r.yh=function(t){return void 0!==(t=this.o[t.toString()])?t:null},r.Mi=function(){return this.C},r.Ni=function(){return this.I},r.Oi=function(t){var e=U(t=t.target).toString(),o=t.V();o?(o=o.G(),e in this.g?(delete this.g[e],this.a&&this.a.Ca(o,t)):this.a&&kp(this.a,o,t)):e in this.g||(this.a&&this.a.remove(t),this.g[e]=t),void 0!==(o=t.a)?(o=o.toString(),e in this.l?(delete this.l[e],this.o[o]=t):this.o[o]!==t&&(Dv(this,t),this.o[o]=t)):e in this.l||(Dv(this,t),this.l[e]=t),this.s(),this.b(new Ov("changefeature",t))},r.Yd=function(t,e,o){for(var i=this.R,r=0,n=(t=this.fa(t,e)).length;r<n;++r){var s=t[r];Up(i,s,function(t){return yt(t.extent,s)})||(this.B.call(this,s,e,o),i.Ca(s,{extent:s.slice()}))}},r.Gb=function(t){var e=U(t).toString();e in this.g?delete this.g[e]:this.a&&this.a.remove(t),this.Ig(t),this.s()},r.Ig=function(t){var e=U(t).toString(),o=(this.v[e].forEach(qe),delete this.v[e],t.a);void 0!==o?delete this.o[o.toString()]:delete this.l[e],this.b(new Ov("removefeature",t))},e(Ov,Qe),e(Uv,Mn),(r=Uv.prototype).setMap=function(t){Mn.prototype.setMap.call(this,t),this.ri()},r.Op=function(){var t,e;this.j&&(t=this.j.V(),this.g===qv?((e=this.a).splice(-2,1),this.Za(e,t),2<=e.length&&(this.l=e[e.length-2].slice())):this.g===Jv&&((e=this.a[0]).splice(-2,1),this.C.V().ma(e),this.Za(this.a,t)),0===e.length&&(this.l=null),Yv(this))},r.Pd=function(){var t=zv(this),e=this.a,o=t.V();this.g===qv?(e.pop(),this.Za(e,o)):this.g===Jv&&(e[0].pop(),this.Za(e,o),e=o.X()),"MultiPoint"===this.R?t.Ra(new P([e])):"MultiLineString"===this.R?t.Ra(new M([e])):"MultiPolygon"===this.R&&t.Ra(new f([e])),this.b(new $v("drawend",t)),this.$a&&this.$a.push(t),this.Yb&&this.Yb.yb(t)},r.vn=function(t){var e=t.V();this.j=t,this.a=e.X(),t=this.a[this.a.length-1],this.l=t.slice(),this.a.push(t.slice()),Yv(this),this.b(new $v("drawstart",this.j))},r.Xc=fr,r.ri=function(){var t=this.v,e=this.c();t&&e||zv(this),this.pa.setMap(e?t:null)};var Hv="Point",qv="LineString",Jv="Polygon",_v="Circle";function $v(t,e){Qe.call(this,t),this.feature=e}function Qv(t){var e,o;this.a=this.j=null,this.C=!1,this.B=this.l=null,(t=t||{}).extent&&this.g(t.extent),Mn.call(this,{handleDownEvent:eb,handleDragEvent:ob,handleEvent:tb,handleUpEvent:ib}),this.u=new s({source:new a({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle||(e=Qh(),function(){return e.Polygon}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.I=new s({source:new a({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle||(o=Qh(),function(){return o.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0})}function tb(t){var e,o;return!(t instanceof mi&&("pointermove"!=t.type||this.D||ab(this,sb(this,e=t.pixel,o=t.map)||o.Wa(e)),An.call(this,t),1))}function eb(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=sb(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=rb(e(t)):null!==o?this.a=nb(e([o,r[1]]),e([o,r[3]])):null!==i&&(this.a=nb(e([r[0],i]),e([r[2],i])))):(t=i.Wa(o),this.g([t[0],t[1],t[0],t[1]]),this.a=rb(t)),!0}function ob(t){return this.a&&(t=t.coordinate,this.g(this.a(t)),ab(this,t)),!0}function ib(){this.a=null;var t=this.G();return t&&Tt(t)||this.g(null),!1}function rb(e){return function(t){return ht([e,t])}}function nb(e,o){return e[0]==o[0]?function(t){return ht([e,[t[0],o[1]]])}:e[1]==o[1]?function(t){return ht([e,[o[0],t[1]]])}:null}function sb(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 lr(i,t)-lr(i,e)});var r=r[0],n=or(i,r),s=o.Ja(n);if(hr(e,s)<=10)return e=o.Ja(r[0]),o=o.Ja(r[1]),e=pr(s,e),o=pr(s,o),t.C=Math.sqrt(Math.min(e,o))<=10,n=t.C?o<e?r[1]:r[0]:n}return null}function ab(t,e){var o=t.B;o?o.V().ma(e):(o=new x(new m(e)),t.B=o,t.I.ha().yb(o))}function pb(t){Qe.call(this,hb),this.b=t}e($v,Qe),e(Qv,Mn),Qv.prototype.setMap=function(t){this.u.setMap(t),this.I.setMap(t),Mn.prototype.setMap.call(this,t)},Qv.prototype.G=function(){return this.j},Qv.prototype.g=function(t){this.j=t||null;var e=this.l;e?t?e.Ra(Hr(t)):e.Ra(void 0):(this.l=e=new x(t?Hr(t):{}),this.u.ha().yb(e)),this.b(new pb(this.j))},e(pb,Qe);var hb="extentchanged";function lb(t){var e;Mn.call(this,{handleDownEvent:gb,handleDragEvent:db,handleEvent:bb,handleUpEvent:vb}),this.ad=t.condition||Sn,this.$a=function(t){return bn(t)&&vn(t)},this.xb=t.deleteCondition||this.$a,this.Yb=t.insertVertexCondition||cr,this.Sa=this.g=null,this.va=[0,0],this.C=this.I=!1,this.a=new Fp,this.fa=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.l=this.pa=!1,this.j=[],this.B=new s({source:new a({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style||(e=Qh(),function(){return e.Point}),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.T={Point:this.Dn,LineString:this.ti,LinearRing:this.ti,Polygon:this.En,MultiPoint:this.Bn,MultiLineString:this.An,MultiPolygon:this.Cn,Circle:this.yn,GeometryCollection:this.zn},this.u=t.features,this.u.forEach(this.kg,this),d(this.u,"add",this.wn,this),d(this.u,"remove",this.xn,this),this.R=null}function ub(t,e){t.C||(t.C=!0,t.b(new Mb("modifystart",t.u,e)))}function cb(t,e){var o=t,i=e,r=(o=o.a,[]);o.forEach(function(t){i===t.feature&&r.push(t)});for(var n=r.length-1;0<=n;--n)o.remove(r[n]);t.g&&!t.u.dc()&&(t.B.ha().Gb(t.g),t.g=null),He(e,"change",t.si,t)}function fb(t,e){var o=t.g;o?o.V().ma(e):(o=new x(new m(e)),t.g=o,t.B.ha().yb(o))}function yb(t,e){return t.index-e.index}function gb(t){if(!this.ad(t))return!1;mb(this,t.pixel,t.map);var e=t.map.Wa(t.pixel);if(this.j.length=0,this.C=!1,o=this.g){var o,i=[],r=ht([o=o.V().X()]),n={};(r=Op(this.a,r)).sort(yb);for(var s=0,a=r.length;s<a;++s){var p=r[s],h=p.la,l=U(p.feature),u=p.depth;u&&(l+="-"+u.join("-")),n[l]||(n[l]=Array(2)),"Circle"===p.geometry.U()&&1===p.index?nr(h=xb(e,p),o)&&!n[l][0]&&(this.j.push([p,0]),n[l][0]=p):nr(h[0],o)&&!n[l][0]?(this.j.push([p,0]),n[l][0]=p):nr(h[1],o)&&!n[l][1]?("LineString"===p.geometry.U()||"MultiLineString"===p.geometry.U())&&n[l][0]&&0===n[l][0].index||(this.j.push([p,1]),n[l][1]=p):this.Yb(t)&&U(h)in this.Sa&&!n[l][0]&&!n[l][1]&&i.push([p,o])}for(i.length&&ub(this,t),t=i.length-1;0<=t;--t)this.bm.apply(this,i[t])}return!!this.g}function db(t){this.I=!1,ub(this,t),t=t.coordinate;for(var e=0,o=this.j.length;e<o;++e){for(var i,r=(p=this.j[e])[0],n=r.depth,s=r.geometry,a=r.la,p=p[1];t.length<s.qa();)t.push(a[p][t.length]);switch(s.U()){case"Point":i=t,a[0]=a[1]=t;break;case"MultiPoint":(i=s.X())[r.index]=t,a[0]=a[1]=t;break;case"LineString":(i=s.X())[r.index+p]=t,a[p]=t;break;case"MultiLineString":case"Polygon":(i=s.X())[n[0]][r.index+p]=t,a[p]=t;break;case"MultiPolygon":(i=s.X())[n[1]][n[0]][r.index+p]=t,a[p]=t;break;case"Circle":a[0]=a[1]=t,0===r.index?(this.l=!0,s.ob(t)):(this.l=!0,s.Uc(hr(s.wa(),t))),this.l=!1}i&&(r=s,n=i,this.l=!0,r.ma(n),this.l=!1)}fb(this,t)}function vb(t){for(var e,o,i,r,n=this.j.length-1;0<=n;--n)"Circle"===(e=(r=this.j[n][0]).geometry).U()?(o=e.wa(),i=r.Pf[0],r=r.Pf[1],i.la[0]=i.la[1]=o,r.la[0]=r.la[1]=o,kp(this.a,wt(o),i),kp(this.a,e.G(),r)):kp(this.a,ht(r.la),r);return this.C&&(this.b(new Mb("modifyend",this.u,t)),this.C=!1),!1}function bb(t){var e;return!(t instanceof mi)||(on((this.R=t).map.Z())[1]||"pointermove"!=t.type||this.D||(this.va=t.pixel,mb(this,t.pixel,t.map)),this.g&&this.xb(t)&&(e=!("singleclick"!=t.type||!this.I)||this.hj()),"singleclick"==t.type&&(this.I=!1),An.call(this,t)&&!e)}function mb(t,e,o){var i=o.Wa(e),r=lt(wt(i),o.Z().Pa()*t.fa);if(0<(r=Op(t.a,r)).length){r.sort(function(t,e){return wb(i,t)-wb(i,e)});var n,s=r[0],a=s.la,p=xb(i,s),h=o.Ja(p);if(hr(e,h)<=t.fa){if(e={},"Circle"===s.geometry.U()&&1===s.index)t.pa=!0,fb(t,p);else for(n=o.Ja(a[0]),s=o.Ja(a[1]),o=pr(h,n),h=pr(h,s),n=Math.sqrt(Math.min(o,h)),t.pa=n<=t.fa,fb(t,p=t.pa?h<o?a[1]:a[0]:p),h=1,o=r.length;h<o&&(p=r[h].la,nr(a[0],p[0])&&nr(a[1],p[1])||nr(a[0],p[1])&&nr(a[1],p[0]));++h)e[U(p)]=!0;return e[U(a)]=!0,void(t.Sa=e)}}t.g&&(t.B.ha().Gb(t.g),t.g=null)}function wb(t,e){var o=e.geometry;return"Circle"===o.U()&&1===e.index?(t=pr(o.wa(),t),(o=Math.sqrt(t)-o.pd())*o):lr(t,e.la)}function xb(t,e){var o=e.geometry;return"Circle"===o.U()&&1===e.index?o.Ab(t):or(t,e.la)}function Sb(t,e,o,i,r){Up(t.a,e.G(),function(t){t.geometry===e&&(void 0===i||void 0===t.depth||Z(t.depth,i))&&t.index>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);-1<h?p.splice(h,1):(s.remove(n),a.push(n))}p.length&&s.fg(p)}else{for(n.we(t.pixel,function(t,e){if(this.o(t,e))return!o&&!r||D(s.a,t)?(i||r)&&D(s.a,t)&&(a.push(t),e=U(t),delete this.a[e]):(p.push(t),t=U(t),this.a[t]=e),!this.l}.bind(this),{layerFilter:this.u,hitTolerance:this.j}),e=a.length-1;0<=e;--e)s.remove(a[e]);s.fg(p)}return(0<p.length||0<a.length)&&this.b(new Eb(Tb,p,a,t)),dn(t)}function Eb(t,e,o,i){Qe.call(this,t),this.selected=e,this.deselected=o,this.mapBrowserEvent=i}e(lb,Mn),(r=lb.prototype).kg=function(t){var e=t.V();e&&e.U()in this.T&&this.T[e.U()].call(this,t,e),(e=this.v)&&e.c&&this.c()&&mb(this,this.va,e),d(t,"change",this.si,this)},r.Ha=function(t){this.g&&!t&&(this.B.ha().Gb(this.g),this.g=null),Mn.prototype.Ha.call(this,t)},r.setMap=function(t){this.B.setMap(t),Mn.prototype.setMap.call(this,t)},r.wn=function(t){this.kg(t.element)},r.si=function(t){this.l||(cb(this,t=t.target),this.kg(t))},r.xn=function(t){cb(this,t.element)},r.Dn=function(t,e){var o=e.X();t={feature:t,geometry:e,la:[o,o]},this.a.Ca(e.G(),t)},r.Bn=function(t,e){for(var o=e.X(),i=0,r=o.length;i<r;++i){var n={feature:t,geometry:e,depth:[i],index:i,la:[n=o[i],n]};this.a.Ca(e.G(),n)}},r.ti=function(t,e){for(var o=e.X(),i=0,r=o.length-1;i<r;++i){var n=o.slice(i,i+2),s={feature:t,geometry:e,index:i,la:n};this.a.Ca(ht(n),s)}},r.An=function(t,e){for(var o=e.X(),i=0,r=o.length;i<r;++i)for(var n=o[i],s=0,a=n.length-1;s<a;++s){var p=n.slice(s,s+2),h={feature:t,geometry:e,depth:[i],index:s,la:p};this.a.Ca(ht(p),h)}},r.En=function(t,e){for(var o=e.X(),i=0,r=o.length;i<r;++i)for(var n=o[i],s=0,a=n.length-1;s<a;++s){var p=n.slice(s,s+2),h={feature:t,geometry:e,depth:[i],index:s,la:p};this.a.Ca(ht(p),h)}},r.Cn=function(t,e){for(var o=e.X(),i=0,r=o.length;i<r;++i)for(var n=o[i],s=0,a=n.length;s<a;++s)for(var p=n[s],h=0,l=p.length-1;h<l;++h){var u=p.slice(h,h+2),c={feature:t,geometry:e,depth:[s,i],index:h,la:u};this.a.Ca(ht(u),c)}},r.yn=function(t,e){var o=e.wa(),i={feature:t,geometry:e,index:0,la:[o,o]};i.Pf=(t={feature:t,geometry:e,index:1,la:[o,o]}).Pf=[i,t],this.a.Ca(wt(o),i),this.a.Ca(e.G(),t)},r.zn=function(t,e){var o=e.a;for(e=0;e<o.length;++e)this.T[o[e].U()].call(this,t,o[e])},r.bm=function(t,e){for(var o,i=t.la,r=t.feature,n=t.geometry,s=t.depth,a=t.index;e.length<n.qa();)e.push(0);switch(n.U()){case"MultiLineString":case"Polygon":(o=n.X())[s[0]].splice(a+1,0,e);break;case"MultiPolygon":(o=n.X())[s[1]][s[0]].splice(a+1,0,e);break;case"LineString":(o=n.X()).splice(a+1,0,e);break;default:return}this.l=!0,n.ma(o),this.l=!1,(o=this.a).remove(t),Sb(this,n,a,s,1),t={la:[i[0],e],feature:r,geometry:n,depth:s,index:a},o.Ca(ht(t.la),t),this.j.push([t,1]),e={la:[e,i[1]],feature:r,geometry:n,depth:s,index:a+1},o.Ca(ht(e.la),e),this.j.push([e,0]),this.I=!0},r.hj=function(){if(this.R&&"pointerdrag"!=this.R.type){var t,e=this.R,o=(ub(this,e),this.j),i={};for(a=o.length-1;0<=a;--a){var r=o[a],n=r[0],s=U(n.feature);n.depth&&(s+="-"+n.depth.join("-")),s in i||(i[s]={}),0===r[1]?(i[s].right=n,i[s].index=n.index):1==r[1]&&(i[s].left=n,i[s].index=n.index+1)}for(s in i){var a,p=i[s].right,h=i[s].left,l=(a=i[s].index)-1;l<0&&(l=0);var u=t=(r=(n=void 0!==h?h:p).geometry).X(),c=!1;switch(r.U()){case"MultiLineString":2<t[n.depth[0]].length&&(t[n.depth[0]].splice(a,1),c=!0);break;case"LineString":2<t.length&&(t.splice(a,1),c=!0);break;case"MultiPolygon":u=u[n.depth[1]];case"Polygon":4<(u=u[n.depth[0]]).length&&(a==u.length-1&&(a=0),u.splice(a,1),c=!0,0===a)&&(u.pop(),u.push(u[0]),l=u.length-1)}c&&(c=r,this.l=!0,c.ma(t),this.l=!1,t=[],void 0!==h&&(this.a.remove(h),t.push(h.la[0])),void 0!==p&&(this.a.remove(p),t.push(p.la[1])),void 0!==h&&void 0!==p&&(h={depth:n.depth,feature:n.feature,geometry:n.geometry,index:l,la:t},this.a.Ca(ht(h.la),h)),Sb(this,r,a,n.depth,-1),this.g&&(this.B.ha().Gb(this.g),this.g=null),o.length=0)}return this.b(new Mb("modifyend",this.u,e)),!(this.C=!1)}return!1},e(Mb,Qe),e(Pb,pn),(r=Pb.prototype).Gn=function(){return this.g.ha().f},r.Hn=function(){return this.j},r.In=function(t){return t=U(t),this.a[t]},r.Kn=function(t){this.j=t},r.setMap=function(t){var e=this.v,o=this.g.ha().f;e&&o.forEach(e.Cj,e),pn.prototype.setMap.call(this,t),this.g.setMap(t),t&&o.forEach(t.xj,t)},r.Fn=function(t){var e=this.v;e&&e.xj(t.element)},r.Jn=function(t){var e=this.v;e&&e.Cj(t.element)},e(Eb,Qe);var Tb="select";function jb(t){Mn.call(this,{handleEvent:Lb,handleDownEvent:cr,handleUpEvent:Rb}),this.l=(t=t||{}).source||null,this.R=void 0===t.vertex||t.vertex,this.C=void 0===t.edge||t.edge,this.j=t.features||null,this.pa=[],this.B={},this.T={},this.u={},this.I=null,this.g=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.va=function(t,e){return lr(this.I,t.la)-lr(this.I,e.la)}.bind(this),this.a=new Fp,this.fa={Point:this.Rn,LineString:this.wi,LinearRing:this.wi,Polygon:this.Sn,MultiPoint:this.Pn,MultiLineString:this.On,MultiPolygon:this.Qn,GeometryCollection:this.Nn,Circle:this.Mn}}function Cb(t,e,o,i){var r,n,s,a,p,h,l=i.Wa([e[0]-t.g,e[1]+t.g]),u=i.Wa([e[0]+t.g,e[1]-t.g]),l=ht([l,u]),c=Op(t.a,l),f=!1,l=!1,y=u=null;return 0<(c=t.R&&!t.C?c.filter(function(t){return"Circle"!==t.feature.V().U()}):c).length&&(t.I=o,c.sort(t.va),r=c[0].la,f="Circle"===c[0].feature.V().U(),t.R&&!t.C?(o=i.Ja(r[0]),f=i.Ja(r[1]),o=pr(e,o),e=pr(e,f),(f=(f=Math.sqrt(Math.min(o,e)))<=t.g)&&(l=!0,u=e<o?r[1]:r[0],y=i.Ja(u))):t.C&&(u=f?(n=o,c=c[0].feature.V(),s=c.pd(),c=(a=c.wa())[0],a=a[1],p=n[0]-c,n=n[1]-a,p||n||(p=1),h=Math.sqrt(p*p+n*n),[c+s*p/h,a+s*n/h]):or(o,r),hr(e,y=i.Ja(u))<=t.g)&&(l=!0,t.R)&&!f&&(o=i.Ja(r[0]),f=i.Ja(r[1]),o=pr(y,o),e=pr(y,f),f=(f=Math.sqrt(Math.min(o,e)))<=t.g)&&(u=e<o?r[1]:r[0],y=i.Ja(u)),l)&&(y=[Math.round(y[0]),Math.round(y[1])]),{nq:l,vertex:u,wq:y}}function Lb(t){var e=Cb(this,t.pixel,t.coordinate,t.map);return e.nq&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.wq),An.call(this,t)}function Rb(){var t=Wt(this.u);return t.length&&(t.forEach(this.Dj,this),this.u={}),!1}function Ib(t){var e,o;Mn.call(this,{handleDownEvent:Nb,handleDragEvent:kb,handleMoveEvent:Db,handleUpEvent:Fb}),t=t||{},this.a=null,this.j=void 0!==t.features?t.features:null,o=t.layers?"function"==typeof t.layers?t.layers:(e=t.layers,function(t){return D(e,t)}):cr,this.C=o,this.l=t.hitTolerance||0,this.g=null,d(this,so("active"),this.u,this)}function Nb(t){var e;return this.g=Ob(this,t.pixel,t.map),!(this.a||!this.g||(this.a=t.coordinate,Db.call(this,t),e=this.j||new ho([this.g]),this.b(new Gb("translatestart",e,t.coordinate)),0))}function Fb(t){var e;return!!this.a&&(this.a=null,Db.call(this,t),e=this.j||new ho([this.g]),this.b(new Gb("translateend",e,t.coordinate)),!0)}function kb(t){var o,i,e;this.a&&(o=(t=t.coordinate)[0]-this.a[0],i=t[1]-this.a[1],(e=this.j||new ho([this.g])).forEach(function(t){var e=t.V();e.translate(o,i),t.Ra(e)}),this.a=t,this.b(new Gb("translating",e,t)))}function Db(t){var e=t.map.a;Ob(this,t.pixel,t.map)?(e.classList.remove(this.a?"ol-grab":"ol-grabbing"),e.classList.add(this.a?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}function Ob(t,e,o){return o.we(e,function(t){if(!this.j||D(this.j.a,t))return t}.bind(t),{layerFilter:t.C,hitTolerance:t.l})}function Ub(t,e){var o=t.v;t=t.c(),o&&t||(o=o||e).a.classList.remove("ol-grab","ol-grabbing")}function Gb(t,e,o){Qe.call(this,t),this.features=e,this.coordinate=o}function p(t){var e=Xt({},t=t||{}),o=(delete e.gradient,delete e.radius,delete e.blur,delete e.shadow,delete e.weight,s.call(this,e),this.j=null,this.R=void 0!==t.shadow?t.shadow:250,this.I=void 0,this.B=null,d(this,so(Vb),this.Bl,this),this.pj(t.gradient||Bb),this.jj(void 0!==t.blur?t.blur:15),this.Uc(void 0!==t.radius?t.radius:8),d(this,so(Xb),this.cg,this),d(this,so(Wb),this.cg,this),this.cg(),t.weight||"weight"),i="string"==typeof o?function(t){return t.get(o)}:o;this.g(function(t){var e=255*(t=void 0!==(t=i(t))?Q(t,0,1):1)|0,o=this.B[e];return o||(o=[new qh({image:new af({opacity:t,src:this.I})})],this.B[e]=o),o}.bind(this)),this.set(jv,null),d(this,"render",this.Sl,this)}e(jb,Mn),(r=jb.prototype).yb=function(t,e){e=void 0===e||e;var o,i=U(t),r=t.V();r&&(o=this.fa[r.U()])&&(this.T[i]=r.G(vt()),o.call(this,t,r)),e&&(this.B[i]=d(t,"change",this.Ln,this))},r.Ak=function(t){this.yb(t)},r.Bk=function(t){this.Gb(t)},r.ui=function(t){var e;t instanceof Ov?e=t.feature:t instanceof fo&&(e=t.element),this.yb(e)},r.vi=function(t){var e;t instanceof Ov?e=t.feature:t instanceof fo&&(e=t.element),this.Gb(e)},r.Ln=function(t){var e;t=t.target,this.D?(e=U(t))in this.u||(this.u[e]=t):this.Dj(t)},r.Gb=function(e,t){t=void 0===t||t;var o=U(e),i=this.T[o];if(i){var r=this.a,n=[];for(Up(r,i,function(t){e===t.feature&&n.push(t)}),i=n.length-1;0<=i;--i)r.remove(n[i])}t&&(qe(this.B[o]),delete this.B[o])},r.setMap=function(t){var e,o=this.v,i=this.pa;this.j?e=this.j:this.l&&(e=this.l.Xe()),o&&(i.forEach(qe),i.length=0,e.forEach(this.Bk,this)),Mn.prototype.setMap.call(this,t),t&&(this.j?i.push(d(this.j,"add",this.ui,this),d(this.j,"remove",this.vi,this)):this.l&&i.push(d(this.l,"addfeature",this.ui,this),d(this.l,"removefeature",this.vi,this)),e.forEach(this.Ak,this))},r.Xc=fr,r.Dj=function(t){this.Gb(t,!1),this.yb(t,!1)},r.Mn=function(t,e){for(var o=0,i=(e=qr(e).X()[0]).length-1;o<i;++o){var r=e.slice(o,o+2),n={feature:t,la:r};this.a.Ca(ht(r),n)}},r.Nn=function(t,e){var o=e.a;for(e=0;e<o.length;++e){var i=this.fa[o[e].U()];i&&i.call(this,t,o[e])}},r.wi=function(t,e){for(var o=0,i=(e=e.X()).length-1;o<i;++o){var r=e.slice(o,o+2),n={feature:t,la:r};this.a.Ca(ht(r),n)}},r.On=function(t,e){for(var o=0,i=(e=e.X()).length;o<i;++o)for(var r=e[o],n=0,s=r.length-1;n<s;++n){var a=r.slice(n,n+2),p={feature:t,la:a};this.a.Ca(ht(a),p)}},r.Pn=function(t,e){for(var o=e.X(),i=0,r=o.length;i<r;++i){var n={feature:t,la:[n=o[i],n]};this.a.Ca(e.G(),n)}},r.Qn=function(t,e){for(var o=0,i=(e=e.X()).length;o<i;++o)for(var r=e[o],n=0,s=r.length;n<s;++n)for(var a=r[n],p=0,h=a.length-1;p<h;++p){var l=a.slice(p,p+2),u={feature:t,la:l};this.a.Ca(ht(l),u)}},r.Rn=function(t,e){var o=e.X();t={feature:t,la:[o,o]},this.a.Ca(e.G(),t)},r.Sn=function(t,e){for(var o=0,i=(e=e.X()).length;o<i;++o)for(var r=e[o],n=0,s=r.length-1;n<s;++n){var a=r.slice(n,n+2),p={feature:t,la:a};this.a.Ca(ht(a),p)}},e(Ib,Mn),Ib.prototype.B=function(){return this.l},Ib.prototype.I=function(t){this.l=t},Ib.prototype.setMap=function(t){var e=this.v;Mn.prototype.setMap.call(this,t),Ub(this,e)},Ib.prototype.u=function(){Ub(this,null)},e(Gb,Qe),e(p,s);var Bb=["#00f","#0ff","#0f0","#ff0","#f00"],Xb=((r=p.prototype).uh=function(){return this.get(Xb)},r.Bh=function(){return this.get(Vb)},r.yi=function(){return this.get(Wb)},r.Bl=function(){for(var t=this.Bh(),e=Po(1,256),o=e.createLinearGradient(0,0,1,256),i=1/(t.length-1),r=0,n=t.length;r<n;++r)o.addColorStop(r*i,t[r]);e.fillStyle=o,e.fillRect(0,0,1,256),this.j=e.getImageData(0,0,1,256).data},r.cg=function(){var t=this.yi(),e=this.uh(),o=t+e+1,i=2*o;(i=Po(i,i)).shadowOffsetX=i.shadowOffsetY=this.R,i.shadowBlur=e,i.shadowColor="#000",i.beginPath(),e=o-this.R,i.arc(e,e,t,0,2*Math.PI,!0),i.fill(),this.I=i.canvas.toDataURL(),this.B=Array(256),this.s()},r.Sl=function(t){for(var e,o=(t=t.context).canvas,i=(o=t.getImageData(0,0,o.width,o.height)).data,r=0,n=i.length;r<n;r+=4)(e=4*i[r+3])&&(i[r]=this.j[e],i[r+1]=this.j[1+e],i[r+2]=this.j[2+e]);t.putImageData(o,0,0)},r.jj=function(t){this.set(Xb,t)},r.pj=function(t){this.set(Vb,t)},r.Uc=function(t){this.set(Wb,t)},"blur"),Vb="gradient",Wb="radius";function Zb(t){uv.call(this,t),this.v=ms(),this.j=null}function Kb(t){Zb.call(this,t),this.M=null,this.c=ms()}function zb(t,e,o,i){var r=Me(o,e,t);return o=ce(e,i,o),void 0!==(e=e.sc())&&(o*=e),void 0!==(e=t.sc())&&(o/=e),t=ce(t,o,r)/o,isFinite(t)&&0<t&&(o/=t),o}function Yb(t,e,o,i){t=o-t,e=i-e;var r=Math.sqrt(t*t+e*e);return[Math.round(o+t/r),Math.round(i+e/r)]}function Hb(t,e,g,d,o,v,i,r,n,s,a){var b,m,p,w,x=Po(Math.round(g*t),Math.round(g*e));return n.length&&(x.scale(g,g),b=vt(),n.forEach(function(t){Mt(b,t.extent)}),m=Po(Math.round(g*Dt(b)/d),Math.round(g*It(b)/d)),p=g/d,n.forEach(function(t){m.drawImage(t.image,s,s,t.image.width-2*s,t.image.height-2*s,(t.extent[0]-b[0])*p,-(t.extent[3]-b[3])*p,Dt(t.extent)*p,It(t.extent)*p)}),w=Ft(i),r.c.forEach(function(t){var e=t.source,o=t.target,i=e[1][0],r=e[1][1],n=e[2][0],s=e[2][1],a=(t=(o[0][0]-w[0])/v,-(o[0][1]-w[1])/v),p=(o[1][0]-w[0])/v,h=-(o[1][1]-w[1])/v,l=(o[2][0]-w[0])/v,u=-(o[2][1]-w[1])/v;t:{for(r=(i=[[i=i-(o=e[0][0]),r=r-(e=e[0][1]),0,0,p-t],[n=n-o,s=s-e,0,0,l-t],[0,0,i,r,h-a],[0,0,n,s,u-a]]).length,n=0;n<r;n++){for(var s=n,c=Math.abs(i[n][n]),f=n+1;f<r;f++){var y=Math.abs(i[f][n]);c<y&&(c=y,s=f)}if(!c){i=null;break t}for(c=i[s],i[s]=i[n],i[n]=c,s=n+1;s<r;s++)for(c=-i[s][n]/i[n][n],f=n;f<r+1;f++)i[s][f]=n==f?0:i[s][f]+c*i[n][f]}for(n=Array(r),s=r-1;0<=s;s--)for(n[s]=i[s][r]/i[s][s],c=s-1;0<=c;c--)i[c][r]-=i[c][s]*n[s];i=n}i&&(x.save(),x.beginPath(),r=Yb(n=(t+p+l)/3,s=(a+h+u)/3,t,a),p=Yb(n,s,p,h),l=Yb(n,s,l,u),x.moveTo(p[0],p[1]),x.lineTo(r[0],r[1]),x.lineTo(l[0],l[1]),x.clip(),x.transform(i[0],i[2],i[1],i[3],t,a),x.translate(b[0]-o,b[3]-e),x.scale(d/g,-d/g),x.drawImage(m.canvas,0,0),x.restore())}),a)&&(x.save(),x.strokeStyle="black",x.lineWidth=1,r.c.forEach(function(t){t=((n=t.target)[0][0]-w[0])/v;var e=-(n[0][1]-w[1])/v,o=(n[1][0]-w[0])/v,i=-(n[1][1]-w[1])/v,r=(n[2][0]-w[0])/v,n=-(n[2][1]-w[1])/v;x.beginPath(),x.moveTo(o,i),x.lineTo(t,e),x.lineTo(r,n),x.closePath(),x.stroke()}),x.restore()),x.canvas}function qb(t,e,o,i,r){this.i=t,this.f=e;var n,s={},a=me(this.f,this.i),p=(this.a=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.g=i,this.v=r*r,this.c=[],this.o=!1,this.l=this.i.i&&!!i&&!!this.i.G()&&Dt(i)==Dt(this.i.G()),this.b=this.i.G()?Dt(this.i.G()):null,this.j=this.f.G()?Dt(this.f.G()):null,t=Ft(o),e=kt(o),i=Ct(o),o=jt(o),r=this.a(t),this.a(e)),h=this.a(i),l=this.a(o);!function t(e,o,i,r,n,s,a,p,h,l){var u=ht([s,a,p,h]),c=e.b?Dt(u)/e.b:null,f=e.b,y=e.i.i&&.5<c&&c<1,g=!1;{var d;0<l&&(e.f.c&&e.j&&(d=ht([o,i,r,n]),g|=.25<Dt(d)/e.j),!y)&&e.i.c&&c&&(g|=.25<c)}if(g||!e.g||Ot(u,e.g)){if(!(g||isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(p[0])&&isFinite(p[1])&&isFinite(h[0])&&isFinite(h[1]))){if(!(0<l))return;g=!0}if(0<l&&(g||(u=e.a([(o[0]+r[0])/2,(o[1]+r[1])/2]),f=y?(rt(s[0],f)+rt(p[0],f))/2-rt(u[0],f):(s[0]+p[0])/2-u[0],u=(s[1]+p[1])/2-u[1],g=f*f+u*u>e.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])<this.b/2)&&(t.source=e)},this)),s={}}function Jb(t){var e=vt();return t.c.forEach(function(t){t=t.source,Pt(e,t[0]),Pt(e,t[1]),Pt(e,t[2])}),e}function _b(t,e,o,i,r,n){this.v=e,this.l=t.G();var s=(a=e.G())?Nt(o,a):o,a=zb(t,e,Lt(s),i);this.j=new qb(t,e,s,this.l,.5*a),this.c=i,this.i=o,t=Jb(this.j),this.o=(this.Hb=n(t,a,r))?this.Hb.a:1,this.ee=this.g=null,r=2,n=[],this.Hb&&(r=0,n=this.Hb.f),v0.call(this,o,i,this.o,r,n)}function $b(t){Lv.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state}),this.C=void 0!==t.resolutions?t.resolutions:null,this.a=null,this.fa=0}function Qb(t,e){return e=t.C?t.C[B(t.C,e,0)]:e}function tm(t,e){t.Y().src=e}function em(t,e){Qe.call(this,t),this.image=e}e(Zb,uv),Zb.prototype.S=function(t,e,o){fv(this,"precompose",o,t,void 0);var i,r,n,s=this.Y();s&&((i=void 0!==(r=e.extent)&&!yt(r,t.extent)&&Ot(r,t.extent))&&cv(o,t,r),r=this.C(),n=o.globalAlpha,o.globalAlpha=e.opacity,o.drawImage(s,0,0,+s.width,+s.height,Math.round(r[4]),Math.round(r[5]),Math.round(s.width*r[0]),Math.round(s.height*r[3])),o.globalAlpha=n,i)&&o.restore(),this.ef(o,t,e)},Zb.prototype.Ea=function(t,e,o,i,r){var n=this.a;return n.ha().Ea(t,e.viewState.resolution,e.viewState.rotation,o,e.skippedFeatureUids,function(t){return i.call(r,t,n)})},Zb.prototype.u=function(t,e,o,i){if(this.Y())return this.a.ha().Ea!==Y?uv.prototype.u.apply(this,arguments):(ar(t=Ps(this.v,t.slice()),e.viewState.resolution/this.f),this.j||(this.j=Po(1,1)),this.j.clearRect(0,0,1,1),this.j.drawImage(this.Y(),t[0],t[1],1,1,0,0,1,1),0<(t=this.j.getImageData(0,0,1,1).data)[3]?o.call(i,this.a,t):void 0)},e(Kb,Zb),Kb.prototype.Y=function(){return this.M?this.M.Y():null},Kb.prototype.C=function(){return this.c},Kb.prototype.sd=function(t,e){var o,i=t.pixelRatio,r=t.size,n=t.viewState,s=n.center,a=n.resolution,p=this.a.ha(),h=t.viewHints,l=t.extent;return void 0!==e.extent&&(l=Nt(l,e.extent)),h[0]||h[1]||Ut(l)||(e=p.Y(l,a,i,n.projection))&&rv(this,e)&&(this.M=e),this.M&&(h=(e=this.M).G(),o=i*(l=e.resolution)/(a*(n=e.a)),h=js(this.c,i*r[0]/2,i*r[1]/2,o,o,0,n*(h[0]-s[0])/l,n*(s[1]-h[3])/l),js(this.v,i*r[0]/2-h[4],i*r[1]/2-h[5],i/a,-i/a,0,-s[0],-s[1]),av(t.attributions,e.f),pv(t,p),this.f=a*i/n),!!this.M},e(_b,v0),_b.prototype.ka=function(){1==this.state&&(qe(this.ee),this.ee=null),v0.prototype.ka.call(this)},_b.prototype.Y=function(){return this.g},_b.prototype.de=function(){var t=this.Hb.getState();2==t&&(this.g=Hb(Dt(this.i)/this.c,It(this.i)/this.c,this.o,this.Hb.resolution,0,this.c,this.i,this.j,[{extent:this.Hb.G(),image:this.Hb.Y()}],0)),this.state=t,this.s()},_b.prototype.load=function(){var t;0==this.state&&(this.state=1,this.s(),2==(t=this.Hb.getState())||3==t?this.de():(this.ee=d(this.Hb,"change",function(){var t=this.Hb.getState();2!=t&&3!=t||(qe(this.ee),this.ee=null,this.de())},this),this.Hb.load()))},e($b,Lv),$b.prototype.Y=function(t,e,o,i){var r=this.c;if(r&&i&&!be(r,i)){if(this.a){if(this.fa==this.i&&be(this.a.v,i)&&this.a.resolution==e&&this.a.a==o&&St(this.a.G(),t))return this.a;$e(this.a),this.a=null}return this.a=new _b(r,i,t,e,o,function(t,e,o){return this.Jc(t,e,o,r)}.bind(this)),this.fa=this.i,this.a}return this.Jc(t,e,o,i=r?r:i)},$b.prototype.o=function(t){switch((t=t.target).getState()){case 1:this.b(new em(om,t));break;case 2:this.b(new em(im,t));break;case 3:this.b(new em(rm,t))}},e(em,Qe);var om="imageloadstart",im="imageloadend",rm="imageloaderror";function nm(t){$b.call(this,{attributions:t.attributions,logo:t.logo,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.pa=t.canvasFunction,this.R=null,this.T=0,this.va=void 0!==t.ratio?t.ratio:1.5}function sm(t){this.f=t.source,this.$a=ms(),this.g=Po(),this.l=[0,0],this.Sa=null==t.renderBuffer?100:t.renderBuffer,this.B=null,nm.call(this,{attributions:t.attributions,canvasFunction:this.tk.bind(this),logo:t.logo,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:this.f.getState()}),this.I=null,this.v=void 0,this.Ii(t.style),d(this.f,"change",this.ro,this)}function am(t,e){Av.call(this,t,e),this.o=this.f=this.M=null}function pm(t){ys.call(this,t||{})}function hm(t){Zb.call(this,t),this.c=null===this.c?null:Po(),this.o=null,this.g=[],this.l=vt(),this.va=new J(0,0,0,0),this.B=ms(),this.T=0}function lm(t,e){return e=e.getState(),t=t.a.kd(),2==e||4==e||3==e&&!t}function um(){this.b="precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"}e(nm,$b),nm.prototype.Jc=function(t,e,o,i){e=Qb(this,e);var r=this.R;return r&&this.T==this.i&&r.resolution==e&&r.a==o&&yt(r.G(),t)||(Gt(t=t.slice(),this.va),(i=this.pa(t,e,o,[Dt(t)/e*o,It(t)/e*o],i))&&(r=new m0(t,e,o,this.j,i)),this.R=r,this.T=this.i),r},e(sm,nm),(r=sm.prototype).tk=function(t,n,s,e,o){var i,r,a=new _0(.5*n/s,t,n,this.f.T,this.Sa),p=(this.f.Yd(t,n,o),!1);return this.f.$b(t,function(t){var e;if(!(i=p))if((i=t.Lc())?e=i.call(t,n):this.v&&(e=this.v(t,n)),e){for(var o=!1,i=0,r=(e=Array.isArray(e)?e:[e]).length;i<r;++i)o=vv(a,t,e[i],dv(n,s),this.qo,this)||o;i=o}else i=!1;p=i},this),tv(a),p?null:(this.l[0]!=e[0]||this.l[1]!=e[1]?(this.g.canvas.width=e[0],this.g.canvas.height=e[1],this.l[0]=e[0],this.l[1]=e[1]):this.g.clearRect(0,0,e[0],e[1]),o=this,i=Lt(t),r=s/(r=n),t=js(o.$a,e[0]/2,e[1]/2,r,-r,0,-i[0],-i[1]),a.La(this.g,s,t,0,{}),this.B=a,this.g.canvas)},r.Ea=function(t,e,o,i,r,n){var s;if(this.B)return s={},this.B.Ea(t,e,0,i,r,function(t){var e=U(t).toString();if(!(e in s))return s[e]=!0,n(t)})},r.no=function(){return this.f},r.oo=function(){return this.I},r.po=function(){return this.v},r.qo=function(){this.s()},r.ro=function(){Iv(this,this.f.getState())},r.Ii=function(t){this.I=void 0!==t?t:$h,this.v=t?Jh(this.I):void 0,this.s()},e(am,Av),am.prototype.Ea=function(t,e,o,i,r){var n=this.a;return n.ha().Ea(t,e.viewState.resolution,e.viewState.rotation,o,e.skippedFeatureUids,function(t){return i.call(r,t,n)})},am.prototype.ng=function(t,e){var o=this.c.i,i=t.pixelRatio,r=t.viewState,n=r.center,s=r.resolution,a=r.rotation,p=this.M,h=this.Ib,l=this.a.ha(),u=t.viewHints,c=t.extent;return void 0!==e.extent&&(c=Nt(c,e.extent)),u[0]||u[1]||Ut(c)||(e=l.Y(c,s,i,r.projection))&&rv(this,e)&&(u=this,c=(c=p=e).Y(),h=Na(u.c.i,c),this.Ib)&&t.postRenderFunctions.push(function(t,e){t.isContextLost()||t.deleteTexture(e)}.bind(null,o,this.Ib)),p&&(o=this.c.f.j,r=this,e=o.width,u=o.height,c=i,o=n,n=s,s=a,a=p.G(),e*=n,u*=n,ws(r=r.S),Es(r,2*c/e,2*c/u),As(r,-s),Ts(r,a[0]-o[0],a[1]-o[1]),Es(r,(a[2]-a[0])/2,(a[3]-a[1])/2),Ts(r,1,1),this.o=null,ws(i=this.v),Es(i,1,-1),Ts(i,0,-1),this.M=p,this.Ib=h,av(t.attributions,p.f),pv(t,l)),!!p},am.prototype.Ue=function(t,e){return void 0!==this.Ea(t,e,0,cr,this)},am.prototype.lg=function(t,e,o,i){if(this.M&&this.M.Y())if(this.a.ha()instanceof sm){var r=Ps(e.pixelToCoordinateTransform,t.slice());if(this.Ea(r,e,0,cr,this))return o.call(i,this.a,null)}else{var n,s,r=[this.M.Y().width,this.M.Y().height];if(this.o||(n=e.size,Ts(e=ms(),-1,-1),Es(e,2/n[0],2/n[1]),Ts(e,0,n[1]),Es(e,1,-1),n=Cs(this.S.slice()),Ts(s=ms(),0,r[1]),Es(s,1,-1),Es(s,r[0]/2,r[1]/2),Ts(s,1,1),xs(s,n),xs(s,e),this.o=s),!((t=Ps(this.o,t.slice()))[0]<0||t[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&&16<Date.now()-t.time&&C||!S&&this.o&&yt(this.o,y)&&this.mf==h&&f==this.R&&(C||c*o/v*f==this.f))){(C=this.c)&&(L=p.Xd(u,o,r),M=Math.round((g.$-g.ca+1)*L[0]/f),L=Math.round((g.ia-g.da+1)*L[1]/f),(S=C.canvas).width!=M||S.height!=L?(this.R=f,S.width=M,S.height=L):(C.clearRect(0,0,M,L),f=this.R)),this.g.length=0,(S=Object.keys(b).map(Number)).sort(G);for(var x=0,P=S.length;x<P;++x){C=S[x];var A,m=p.Xd(C,o,r),E=(M=l.Da(C))/c,T=v*p.Wf(r),j=b[C];for(A in j){var M=j[A],C=((L=l.Aa(M.ta,w))[0]-d[0])/c*v/f,L=(d[3]-L[3])/c*v/f,R=m[0]*E/f,I=m[1]*E/f;this.Of(M,t,e,C,L,R,I,T),this.g.push(M)}}this.mf=h,this.f=c*o/v*f,this.o=d}return e=this.f/n,e=js(this.B,o*i[0]/2,o*i[1]/2,e,e,0,(this.o[0]-s[0])/this.f*o,(s[1]-this.o[3])/this.f*o),js(this.v,o*i[0]/2-e[4],o*i[1]/2-e[5],o/n,-o/n,0,-s[0],-s[1]),hv(t.usedTiles,p,u,g),lv(t,p,l,o,r,y,u,a.Ud()),sv(t,p),pv(t,p),0<this.g.length},hm.prototype.Of=function(t,e,o,i,r,n,s,a){this.a.ha().Zf(e.viewState.projection)||this.c.clearRect(i,r,n,s),(t=t.Y())&&this.c.drawImage(t,a,a,t.width-2*a,t.height-2*a,i,r,n,s)},hm.prototype.Y=function(){var t=this.c;return t?t.canvas:null},hm.prototype.C=function(){return this.B},e(um,ta);var cm=new um;function fm(){this.b="varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}"}e(fm,ea);var ym=new fm;function gm(t,e){this.i=t.getUniformLocation(e,"e"),this.c=t.getUniformLocation(e,"d"),this.b=t.getAttribLocation(e,"b"),this.a=t.getAttribLocation(e,"c")}function dm(t,e){Av.call(this,t,e),this.I=cm,this.fa=ym,this.f=null,this.B=new da([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.D=this.o=null,this.l=-1,this.R=[0,0]}function A(t){var e=Xt({},t=t||{});delete e.preload,delete e.useInterimTilesOnError,ys.call(this,e),this.zi(void 0!==t.preload?t.preload:0),this.Ai(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}function vm(t){this.c=null,hm.call(this,t),this.I=!1,this.D=ms(),this.T="vector"==t.j?1:0}e(dm,Av),(r=dm.prototype).ka=function(){Ta(this.c.f,this.B),Av.prototype.ka.call(this)},r.Nf=function(e,i,r){var n=this.c;return function(o,t){return Cm(e,i,o,t,function(t){var e=n.a.b.hasOwnProperty(t.bb());return e&&(r[o]||(r[o]={}),r[o][t.ta.toString()]=t),e})}},r.mg=function(){Av.prototype.mg.call(this),this.f=null},r.ng=function(t,e,o){var i,r,n,s,a,p,h=this.c,l=o.b,u=t.viewState,c=u.projection,f=this.a,y=f.ha(),g=y.Ta(c),d=g.tc(u.resolution),v=g.Da(d),b=y.Xd(d,t.pixelRatio,c),m=b[0]/pt(g.gb(d),this.R)[0],w=v/m,x=y.nb(m)*y.Wf(c),S=u.center,M=t.extent,P=Re(g,M,v);if(this.o&&(a=this.o,p=P,a.ca==p.ca)&&a.da==p.da&&a.$==p.$&&a.ia==p.ia&&this.l==y.i)w=this.D;else{var A=[P.$-P.ca+1,P.ia-P.da+1];O(0<(a=Math.max(A[0]*b[0],A[1]*b[1])),29);for(var E,A=w*(L=Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))),T=g.Pc(d),w=[R=T[0]+P.ca*b[0]*w,w=T[1]+P.da*b[1]*w,R+A,w+A],j=(p=t,r=L,s=(i=this).c.i,void 0===i.j||i.j!=r?(p.postRenderFunctions.push(function(t,e,o){t.isContextLost()||(t.deleteFramebuffer(e),t.deleteTexture(o))}.bind(null,s,i.g,i.Ib)),p=Ia(s,r,r),n=s.createFramebuffer(),s.bindFramebuffer(36160,n),s.framebufferTexture2D(36160,36064,3553,p,0),i.Ib=p,i.g=n,i.j=r):s.bindFramebuffer(36160,i.g),l.viewport(0,0,L,L),l.clearColor(0,0,0,0),l.clear(16384),l.disable(3042),L=La(o,this.I,this.fa),o.Qc(L),this.f||(this.f=new gm(l,L)),Ea(o,34962,this.B),l.enableVertexAttribArray(this.f.b),l.vertexAttribPointer(this.f.b,2,5126,!1,16,0),l.enableVertexAttribArray(this.f.a),l.vertexAttribPointer(this.f.a,2,5126,!1,16,8),l.uniform1i(this.f.i,0),(o={})[d]={},this.Nf(y,c,o)),C=f.kd(),L=!0,R=vt(),I=new J(0,0,0,0),N=P.ca;N<=P.$;++N)for(E=P.da;E<=P.ia;++E){if(T=y.Nc(d,N,E,m,c),void 0!==e.extent){var F=g.Aa(T.ta,R);if(!Ot(F,e.extent))continue}if(2==(F=(T=(F=2==(F=T.getState())||4==F||3==F&&!C)?T:x0(T)).getState())){if(h.a.b.hasOwnProperty(T.bb())){o[d][T.ta.toString()]=T;continue}}else if(4==F||3==F&&!C)continue;L=!1,(F=Ce(g,T.ta,j,I,R))||(T=Le(g,T.ta,I,R))&&j(d+1,T)}(e=Object.keys(o).map(Number)).sort(G);for(var k,j=new Float32Array(4),C=0,I=e.length;C<I;++C)for(k in N=o[e[C]])T=N[k],F=g.Aa(T.ta,R),j[0]=2*(F[2]-F[0])/A,j[1]=2*(F[3]-F[1])/A,j[2]=2*(F[0]-w[0])/A-1,j[3]=2*(F[1]-w[1])/A-1,l.uniform4fv(this.f.c,j),hh(h,T,b,x*m),l.drawArrays(5,0,4);L?(this.o=P,this.D=w,this.l=y.i):(this.D=this.o=null,this.l=-1,t.animate=!0)}hv(t.usedTiles,y,d,P);var D=h.j;return lv(t,y,g,m,c,M,d,f.Ud(),function(t){2!=t.getState()||h.a.b.hasOwnProperty(t.bb())||t.bb()in D.a||D.f([t,Ne(g,t.ta),g.Da(t.ta[0]),b,x*m])},this),sv(t,y),pv(t,y),ws(l=this.v),Ts(l,(Math.round(S[0]/v)*v-w[0])/(w[2]-w[0]),(Math.round(S[1]/v)*v-w[1])/(w[3]-w[1])),u.rotation&&As(l,u.rotation),Es(l,t.size[0]*u.resolution/(w[2]-w[0]),t.size[1]*u.resolution/(w[3]-w[1])),Ts(l,-.5,-.5),!0},r.lg=function(t,e,o,i){if(this.g){t=[(t=Ps(this.v,[t[0]/e.size[0],(e.size[1]-t[1])/e.size[1]].slice()))[0]*this.j,t[1]*this.j],(e=this.c.f.b).bindFramebuffer(e.FRAMEBUFFER,this.g);var r=new Uint8Array(4);if(e.readPixels(t[0],t[1],1,1,e.RGBA,e.UNSIGNED_BYTE,r),0<r[3])return o.call(i,this.a,r)}},e(A,ys),(r=A.prototype).Fd=function(t){var e=null,o=t.U();return"canvas"===o?e=new hm(this):"webgl"===o&&(e=new dm(t,this)),e},r.Ud=function(){return this.get("preload")},r.zi=function(t){this.set("preload",t)},r.kd=function(){return this.get("useInterimTilesOnError")},r.Ai=function(t){this.set("useInterimTilesOnError",t)},e(vm,hm);var bm={image:_s,hybrid:["Polygon","LineString"]},mm={hybrid:["Image","Text"],vector:_s};function E(t){var e=Xt({},t=t||{});delete e.preload,delete e.useInterimTilesOnError,s.call(this,e),this.Bi(t.preload||0),this.Ci(t.useInterimTilesOnError||!0),O(null==t.renderMode||"image"==t.renderMode||"hybrid"==t.renderMode||"vector"==t.renderMode,28),this.j=t.renderMode||"hybrid"}function wm(t,e,o,i){function r(){delete window[s],n.parentNode.removeChild(n)}var n=document.createElement("script"),s="olc_"+U(e),a=(n.async=!0,n.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+s,setTimeout(function(){r(),o&&o()},1e4));window[s]=function(t){clearTimeout(a),r(),e(t)},document.getElementsByTagName("head")[0].appendChild(n)}function xm(t,e,o,i,r,n,s,a,p,h,l){if(w0.call(this,r,0),this.D=void 0!==l&&l,this.S=s,this.u=a,this.v=null,this.c=e,this.j=i,this.o=n||r,this.a=[],this.yd=null,this.g=0,n=i.Aa(this.o),a=this.j.G(),r=this.c.G(),Tt(n=a?Nt(n,a):n))if((a=t.G())&&(r=r?Nt(r,a):a),i=zb(t,o,Lt(n),i.Da(this.o[0])),!isFinite(i)||i<=0)this.state=4;else if(this.l=new qb(t,o,n,r,i*(void 0!==h?h:.5)),this.l.c.length)if(this.g=e.tc(i),o=Jb(this.l),r&&(t.i?(o[1]=Q(o[1],r[1],r[3]),o[3]=Q(o[3],r[1],r[3])):o=Nt(o,r)),Tt(o)){for(e=(t=Ie(e,o,this.g)).ca;e<=t.$;e++)for(o=t.da;o<=t.ia;o++)(h=p(this.g,e,o,s))&&this.a.push(h);this.a.length||(this.state=4)}else this.state=4;else this.state=4;else this.state=4}function Sm(t,e){for(var o=t.length,i=Array(o),r=0;r<o;++r)i[r]=function(t,o){var i=/\{z\}/g,r=/\{x\}/g,n=/\{y\}/g,s=/\{-y\}/g;return function(e){if(e)return t.replace(i,e[0].toString()).replace(r,e[1].toString()).replace(n,function(){return(-e[2]-1).toString()}).replace(s,function(){var t=o.a?o.a[e[0]]:null;return O(t,55),(t.ia-t.da+1+e[2]).toString()})}}(t[r],e);return Mm(i)}function Mm(i){return 1===i.length?i[0]:function(t,e,o){if(t)return i[rt((t[1]<<t[0])+t[2],i.length)](t,e,o)}}function Pm(){}function Am(t){var e=[],o=/\{([a-z])-([a-z])\}/.exec(t);if(o)for(var i=o[2].charCodeAt(0),r=o[1].charCodeAt(0);r<=i;++r)e.push(t.replace(o[0],String.fromCharCode(r)));else if(o=/\{(\d+)-(\d+)\}/.exec(t))for(i=parseInt(o[2],10),r=parseInt(o[1],10);r<=i;r++)e.push(t.replace(o[0],r.toString()));else e.push(t);return e}function Em(t){ah.call(this),this.highWaterMark=void 0!==t?t:2048}function Tm(t){return t.c>t.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;g<d;++g){var v,b,m=p.c[p.a[g]],w=(m.S=null,y.Nd=!1,h.ha()),x=w.tileGrid,S=m.ta,M=m.a,P=(E=w.Ta(u)).Da(p.ta[0]),A=x.Da(m.ta[0]),E=Nt(E=E.Aa(p.v),S=x.Aa(S));for("tile-pixels"==M.a?(v=x=w.nb(),A=Ps(A=js(this.D,0,0,1/A*v,-1/A*v,0,-S[0],-S[3]),[E[0],E[3]]).concat(Ps(A,[E[2],E[1]]))):(x=P,A=E,be(u,M)||(b=!0,m.ig(u))),y.Nd=!1,w=new _0(0,A,x,w.l,h.c),A=dv(x,l),x=m.g,f&&f!==y.Kg&&x.sort(f),S=0,E=x.length;S<E;++S){v=x[S],b&&v.V().tb(M,u);var T=void 0;if((j=v.Lc())?T=j.call(v,P):(j=h.f)&&(T=j(v,P)),T){var j=A,C=w;if(T=Array.isArray(T)?T:[T]){var L=!1;if(Array.isArray(T))for(var R=0,I=T.length;R<I;++R)L=vv(C,v,T[R],j,this.Fi,this)||L;else L=vv(C,v,T,j,this.Fi,this)||L;v=L}else v=!1;this.I=this.I||v,y.Nd=y.Nd||v}}tv(w),m.c[p.ta.toString()]=w}y.mf=c,y.Kg=f}if(this.c){if(g=e,u=this.a,l=p.o,c=u.i,(h=bm[u.j])&&l.Lg!==c)for(l.Lg=c,m=(d=p.v)[0],l=g.pixelRatio,u=(P=u.ha()).tileGrid,c=(M=P.Ta(g.viewState.projection)).Da(m),f=P.nb(),p.j||(p.j=Po()),y=p.j,g=P.Xd(m,l,g.viewState.projection),y.canvas.width=g[0],y.canvas.height=g[1],g=M.Aa(d),d=0,m=p.a.length;d<m;++d)w=(M=p.c[p.a[d]]).ta,b=l/c,P=ws(this.D),"tile-pixels"==M.a.a?(b=u.Aa(w,this.l),Es(P,A=l/f*(w=u.Da(w[0]))/c,A),Ts(P,Math.round((b[0]-g[0])/w*f),Math.round((g[3]-b[3])/w*f))):(Es(P,b,-b),Ts(P,-g[0],-g[3])),M.c[p.ta.toString()].La(y,l,P,0,{},h);hm.prototype.Of.apply(this,arguments)}},r.Ea=function(t,e,o,i,r){for(var n=e.viewState.resolution,s=e.viewState.rotation,a=(o=null==o?0:o,this.a),p={},h=this.g,l=a.ha(),u=(e=l.Ta(e.viewState.projection),l.tileGrid),c=0,f=h.length;c<f;++c){var y=h[c],g=y.ta,d=lt(g=e.Aa(g,this.l),o*n,d);if(ft(d,t))for(var g=0,v=y.a.length;g<v;++g)var b,m="tile-pixels"===(w=y.c[y.a[g]]).a.a?(b=w.ta,m=Ft(n=u.Aa(b,this.l)),n=l.nb(),b=u.Da(b[0])/n,[(t[0]-m[0])/b,(m[1]-t[1])/b]):t,w=w.c[y.ta],x=x||w.Ea(m,n,s,o,{},function(t){var e=U(t).toString();if(!(e in p))return p[e]=!0,i.call(r,t,a)})}return x},r.Fi=function(){nv(this)},r.ef=function(t,e,o){var i=(l=this.a).ha(),r=mm[l.j];if(r)for(var n=e.pixelRatio,s=e.viewState.rotation,a=e.size,p=Math.round(n*a[0]/2),a=Math.round(n*a[1]/2),h=this.g,l=l.ha().nb(),u=i.tileGrid,i=i.Ta(e.viewState.projection),c=[],f=[],y=h.length-1;0<=y;--y){var g=h[y];if(5!=g.getState())for(var d=g.ta,v=i.Aa(d)[0]-i.Aa(g.v)[0],b=0,m=g.a.length;b<m;++b){var w,x,S,M,P,A=g.c[g.a[b]],E=A.ta[0],T=u.Da(E),j=A,C=e;for(Ts(C="tile-pixels"==j.a.a?(M=(w=this.a.ha()).tileGrid,P=j.ta,w=M.Da(P[0])/w.nb(),j=C.viewState,x=C.pixelRatio,S=j.resolution/x,P=M.Aa(P,this.l),M=j.center,P=Ft(P),C=C.size,js(this.D,Math.round(x*C[0]/2),Math.round(x*C[1]/2),w/S,w/S,j.rotation,(P[0]-M[0])/w,(M[1]-P[1])/w)):yv(this,C,0),v*l/T,0),T=ev(A=A.c[d.toString()],C),t.save(),t.globalAlpha=o.opacity,Bs(t,-s,p,a),w=0,j=c.length;w<j;++w)x=c[w],E<f[w]&&(t.beginPath(),t.moveTo(T[0],T[1]),t.lineTo(T[2],T[3]),t.lineTo(T[4],T[5]),t.lineTo(T[6],T[7]),t.moveTo(x[6],x[7]),t.lineTo(x[4],x[5]),t.lineTo(x[2],x[3]),t.lineTo(x[0],x[1]),t.clip());A.La(t,n,C,s,{},r),t.restore(),c.push(T),f.push(E)}}hm.prototype.ef.apply(this,arguments)},e(E,s),(r=E.prototype).Fd=function(t){var e=null;return e="canvas"===t.U()?new vm(this):e},r.Ud=function(){return this.get("preload")},r.kd=function(){return this.get("useInterimTilesOnError")},r.Bi=function(t){this.set("preload",t)},r.Ci=function(t){this.set("useInterimTilesOnError",t)},e(xm,w0),xm.prototype.ka=function(){1==this.state&&(this.yd.forEach(qe),this.yd=null),w0.prototype.ka.call(this)},xm.prototype.Y=function(){return this.v},xm.prototype.de=function(){var t,e,o,i,r,n=[];this.a.forEach(function(t){t&&2==t.getState()&&n.push({extent:this.c.Aa(t.ta),image:t.Y()})},this),this.a.length=0,n.length?(o=this.o[0],t="number"==typeof(e=this.j.gb(o))?e:e[0],e="number"==typeof e?e:e[1],o=this.j.Da(o),i=this.c.Da(this.g),r=this.j.Aa(this.o),this.v=Hb(t,e,this.S,i,this.c.G(),o,r,this.l,n,this.u,this.D),this.state=2):this.state=3,this.s()},xm.prototype.load=function(){var i;0==this.state&&(this.state=1,this.s(),i=0,this.yd=[],this.a.forEach(function(e){var o,t=e.getState();0!=t&&1!=t||(i++,o=d(e,"change",function(){var t=e.getState();2!=t&&3!=t&&4!=t||(qe(o),--i)||(this.yd.forEach(qe),this.yd=null,this.de())},this),this.yd.push(o))},this),this.a.forEach(function(t){0==t.getState()&&t.load()}),i||setTimeout(this.de.bind(this),0))},e(Em,ah),Em.prototype.fd=function(t){for(var e,o,i;Tm(this);){if((e=(i=(o=this.a.Yc).ta[0].toString())in t)&&(o=o.ta,e=_(t[i],o[1],o[2])),e)break;$e(this.pop())}},e(jm,Lv),(r=jm.prototype).Ki=function(){return Tm(this.a)},r.fd=function(t,e){(t=this.Wd(t))&&t.fd(e)},r.Wf=function(){return 0},r.Sb=function(t,e,o){return t+"/"+e+"/"+o},r.Zf=function(){return this.va},r.ab=function(){return this.tileGrid},r.Ta=function(t){return this.tileGrid||ke(t)},r.Wd=function(t){var e=this.c;return e&&!be(e,t)?null:this.a},r.nb=function(){return this.$a},r.Xd=function(t,e,o){return o=this.Ta(o),e=this.nb(e),t=pt(o.gb(t),this.o),1==e?t:at(t,e,this.o)},r.sa=function(){this.a.clear(),this.s()},r.Ug=Y,e(Im,Qe),e(Nm,jm),(r=Nm.prototype).pb=function(){return this.tileLoadFunction},r.qb=function(){return this.tileUrlFunction},r.rb=function(){return this.urls},r.Li=function(t){switch((t=t.target).getState()){case 1:this.b(new Im("tileloadstart",t));break;case 2:this.b(new Im("tileloadend",t));break;case 3:this.b(new Im("tileloaderror",t))}},r.vb=function(t){this.a.clear(),this.tileLoadFunction=t,this.s()},r.cb=function(t,e){this.tileUrlFunction=t,void 0!==e?Lm(this,e):this.s()},r.jb=function(t){var e=this.urls=Am(t);this.cb(this.Fc?this.Fc.bind(this):Sm(e,this.tileGrid),t)},r.eb=function(t){var e=(this.urls=t).join("\n");this.cb(this.Fc?this.Fc.bind(this):Sm(t,this.tileGrid),e)},r.Ug=function(t,e,o){t=this.Sb(t,e,o),this.a.b.hasOwnProperty(t)&&this.a.get(t)},e(T,Nm),(r=T.prototype).Ki=function(){if(Tm(this.a))return!0;for(var t in this.g)if(Tm(this.g[t]))return!0;return!1},r.fd=function(t,e){for(var o in t=this.Wd(t),this.a.fd(this.a==t?e:{}),this.g){o=this.g[o];o.fd(o==t?e:{})}},r.Wf=function(t){return this.c&&t&&!be(this.c,t)?0:this.Xf()},r.Xf=function(){return 0},r.Zf=function(t){return!(this.c&&t&&!be(this.c,t))&&Nm.prototype.Zf.call(this,t)},r.Ta=function(t){var e=this.c;return!this.tileGrid||e&&!be(e,t)?((e=U(t).toString())in this.v||(this.v[e]=ke(t)),this.v[e]):this.tileGrid},r.Wd=function(t){var e=this.c;return!e||be(e,t)?this.a:((t=U(t).toString())in this.g||(this.g[t]=new Em(this.a.highWaterMark)),this.g[t])},r.Nc=function(t,e,o,i,r){var n,s,a,p,h,l;return this.c&&r&&!be(this.c,r)?(n=this.Wd(r),t=this.Sb.apply(this,o=[t,e,o]),n.b.hasOwnProperty(t)&&(s=n.get(t)),e=this.uc,s&&s.key==e?s:(a=this.c,p=this.Ta(a),h=this.Ta(r),l=Rm(this,o,r),(i=new xm(a,p,r,h,o,l,this.nb(i),this.Xf(),function(t,e,o,i){return km(this,t,e,o,i,a)}.bind(this),this.Sa,this.I)).key=e,s?(i.i=s,n.replace(t,i)):n.set(t,i),i)):km(this,t,e,o,i,r)},r.Pb=function(t){if(this.I!=t){for(var e in this.I=t,this.g)this.g[e].clear();this.s()}},r.Qb=function(t,e){(t=v(t))&&((t=U(t).toString())in this.v||(this.v[t]=e))},e(j,T);var Om=new Be({html:'<a class="ol-attribution-bing-tos" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a>'});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<s;n++){var a=i[n];U(a).toString()in r||!(a=t.geometryFunction(a))||(wt(a=a.X(),e),lt(e,o,e),a=(a=t.source.Uf(e)).filter(function(t){return!((t=U(t).toString())in r)&&(r[t]=!0)}),t.features.push(function(t,e){for(var o=[0,0],i=e.length-1;0<=i;--i){var r=t.geometryFunction(e[i]);r?er(o,r.X()):e.splice(i,1)}return ar(o,1/e.length),(t=new x(new m(o))).set("features",e),t}(t,a)))}}}function Vm(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 Wm(t){$b.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||tm,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 Zm(t){$b.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||tm,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 Km(t){var e=t.imageExtent,o=void 0!==t.crossOrigin?t.crossOrigin:null,i=t.imageLoadFunction||tm;$b.call(this,{attributions:t.attributions,logo:t.logo,projection:v(t.projection)}),this.M=new b0(e,void 0,1,this.j,t.url,o,i),this.f=t.imageSize||null,d(this.M,"change",this.o,this)}function zm(t){$b.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||tm,this.f=t.params||{},this.l=!0,qm(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}j.prototype.T=function(){return this.f},j.prototype.fa=function(){return this.l},j.prototype.pa=function(t){var e,i,s,a,r,n,p;200!=t.statusCode||"OK"!=t.statusDescription||"ValidCredentials"!=t.authenticationResultCode||1!=t.resourceSets.length||1!=t.resourceSets[0].resources.length?Iv(this,"error"):(-1==(e=t.brandLogoUri).indexOf("https")&&(e=e.replace("http","https")),i=t.resourceSets[0].resources[0],s=-1==this.C?i.zoomMax:this.C,a=De({extent:t=Ge(this.c),minZoom:i.zoomMin,maxZoom:s,tileSize:(i.imageWidth==i.imageHeight?i.imageWidth:[i.imageWidth,i.imageHeight])/this.nb()}),this.tileGrid=a,r=this.R,n=this.B,this.tileUrlFunction=Mm(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 Ee(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<<e-1,r=0;r<e;++r){var n=48;t[1]&i&&(n+=1),t[2]&i&&(n+=2),o[r]=String.fromCharCode(n),i>>=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*s<p*n?n*r/(a*h):s*r/(p*h),SETVIEWCENTERX:i[0],SETVIEWCENTERY:i[1]},Xt(l,this.g),u=Vm(u,l),d(u=new b0(t,e,o,this.j,u,this.R,this.f),"change",this.o,this)):u=null,this.M=u,this.B=this.i),u},r.jo=function(){return this.f},r.mo=function(t){Xt(this.g,t),this.s()},r.lo=function(t){this.M=null,this.f=t,this.s()},e(Km,$b),Km.prototype.Jc=function(t){return Ot(t,this.M.G())?this.M:null},Km.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(Dt(i)/(It(i)/n)))!=o)&&(r=(i=Po(i,n)).canvas,i.drawImage(e,0,0,o,n,0,0,r.width,r.height),this.M.Og(r)),$b.prototype.o.call(this,t)},e(zm,$b);var Ym=[101,101];function Hm(t,e,o,i,r,n){if(O(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:O(!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(","),Vm(t.g,n)}function qm(t){t.l=0<=tr(t.f.VERSION||"1.3.0")}function Jm(t){var e=void 0!==(t=t||{}).attributions?t.attributions:[_m];Um.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})}(r=zm.prototype).so=function(t,e,o,i){var r,n;if(void 0!==this.g)return r=Rt(t,e,0,Ym),n={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.f.LAYERS},Xt(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,Hm(this,r,Ym,1,v(o),n)},r.uo=function(){return this.f},r.Jc=function(t,e,o,i){var r,n,s;return void 0===this.g?null:(r=(e=Qb(this,e))/(o=1==o||this.va&&void 0!==this.T?o:1),s=Rt(n=Lt(t),r,0,[Math.ceil(Dt(t)/r),Math.ceil(It(t)/r)]),t=Rt(n,r,0,[Math.ceil(this.I*Dt(t)/r),Math.ceil(this.I*It(t)/r)]),(n=this.M)&&this.R==this.i&&n.resolution==e&&n.a==o&&yt(n.G(),s)?n:(Xt(s={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0},this.f),this.B[0]=Math.round(Dt(t)/r),this.B[1]=Math.round(It(t)/r),i=Hm(this,t,this.B,o,i,s),this.M=new b0(t,e,o,this.j,i,this.pa,this.v),this.R=this.i,d(this.M,"change",this.o,this),this.M))},r.to=function(){return this.v},r.vo=function(){return this.g},r.wo=function(t){this.M=null,this.v=t,this.s()},r.xo=function(t){t!=this.g&&(this.g=t,this.M=null,this.s())},r.yo=function(t){Xt(this.f,t),qm(this),this.M=null,this.s()},e(Jm,Um);var _m=new Be({html:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> 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;t<n;++t){var a=t,p=new Uint8ClampedArray(e[t]),h=i,l=r,p=c?new ImageData(p,h,l):{data:p,width:h,height:l};s[a]=p}i=u(s,o).data}else{for(i=new Uint8ClampedArray(s),r=Array(n),a=Array(n),t=0;t<n;++t)r[t]=new Uint8ClampedArray(e[t]),a[t]=[0,0,0,0];for(e=0;e<s;e+=4){for(t=0;t<n;++t)p=r[t],a[t][0]=p[e],a[t][1]=p[e+1],a[t][2]=p[e+2],a[t][3]=p[e+3];t=u(a,o),i[e]=t[0],i[e+1]=t[1],i[e+2]=t[2],i[e+3]=t[3]}}return i.buffer}}function Qm(t){this.Ff=!!t.$l;var e,o,i,r,n=[];if(e=0===t.threads?0:!this.Ff&&t.threads||1)for(var s=0;s<e;++s)n[s]=function(e,t){var o=Object.keys(e.lib||{}).map(function(t){return"var "+t+" = "+e.lib[t].toString()+";"}).concat(["var __minion__ = ("+$m.toString()+")(",e.operation.toString(),");",'self.addEventListener("message", function(event) {'," var buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),o=URL.createObjectURL(new Blob(o,{type:"text/javascript"}));return(o=new Worker(o)).addEventListener("message",t),o}(t,this.gh.bind(this,s));else n[0]=(o=t,i=this.gh.bind(this,0),r=$m(o.operation),{postMessage:function(t){setTimeout(function(){i({data:{buffer:r(t),meta:t.meta}})},0)}});this.qe=n,this.Ed=[],this.fk=t.rp||1/0,this.oe=0,this.bd={},this.Gf=null}var t1=!0;try{new ImageData(10,10)}catch(t){t1=!1}var e1=document.createElement("canvas").getContext("2d");function o1(t){this.B=null,this.va=void 0!==t.operationType?t.operationType:"pixel",this.Sa=void 0!==t.threads?t.threads:1,this.g=function(t){for(var e=t.length,o=Array(e),i=0;i<e;++i){var r=i,n=t[i],s=null;n instanceof jm?(n=new A({source:n}),s=new hm(n)):n instanceof $b&&(n=new pm({source:n}),s=new Kb(n)),o[r]=s}return o}(t.sources);for(var e=0,o=this.g.length;e<o;++e)d(this.g[e],"change",this.s,this);this.T=new qi(function(){return 1},this.s.bind(this));for(var o={},i=0,r=(e=this.g.map(function(t){return us(t.a)})).length;i<r;++i)o[U(e[i].layer)]=e[i];this.f=null,this.I={animate:!1,attributions:{},coordinateToPixelTransform:ms(),extent:null,focus:null,index:0,layerStates:o,layerStatesArray:e,logos:{},pixelRatio:1,pixelToCoordinateTransform:ms(),postRenderFunctions:[],size:[0,0],skippedFeatureUids:{},tileQueue:this.T,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{}},$b.call(this,{}),t.operation&&this.v(t.operation,t.lib)}Qm.prototype.pp=function(t,e,o){this.dk({inputs:t,Qh:e,callback:o}),this.dh()},Qm.prototype.dk=function(t){for(this.Ed.push(t);this.Ed.length>this.fk;)this.Ed.shift().callback(null,null)},Qm.prototype.dh=function(){if(0===this.oe&&0<this.Ed.length){var t=this.Gf=this.Ed.shift(),e=t.inputs[0].width,o=t.inputs[0].height,i=t.inputs.map(function(t){return t.data.buffer}),r=this.qe.length;if(1===(this.oe=r))this.qe[0].postMessage({buffers:i,meta:t.Qh,imageOps:this.Ff,width:e,height:o},i);else for(var n=4*Math.ceil(t.inputs[0].data.length/4/r),s=0;s<r;++s){for(var a=s*n,p=[],h=0,l=i.length;h<l;++h)p.push(i[s].slice(a,a+n));this.qe[s].postMessage({buffers:p,meta:t.Qh,imageOps:this.Ff,width:e,height:o},p)}}},Qm.prototype.gh=function(t,e){this.Jq||(this.bd[t]=e.data,--this.oe,0===this.oe&&this.gk())},Qm.prototype.gk=function(){var t,e,o=this.Gf,i=this.qe.length;if(1===i)var r=new Uint8ClampedArray(this.bd[0].buffer),n=this.bd[0].meta;else for(var s=o.inputs[0].data.length,r=new Uint8ClampedArray(s),n=Array(s),s=4*Math.ceil(s/4/i),a=0;a<i;++a){var p=a*s;r.set(new Uint8ClampedArray(this.bd[a].buffer),p),n[a]=this.bd[a].meta}this.Gf=null,this.bd={},o.callback(null,(t=r,e=o.inputs[0].width,o=o.inputs[0].height,t1?new ImageData(t,e,o):((e=e1.createImageData(e,o)).data.set(t),e)),n),this.dh()},fi.default={Af:Qm},fi.Af=Qm,e(o1,$b),o1.prototype.v=function(t,e){this.B=new mp.df.Af({operation:t,$l:"image"===this.va,rp:1,lib:e,threads:this.Sa}),this.s()},o1.prototype.Y=function(t,e,o,i){o=!0;for(var r=0,n=this.g.length;r<n;++r)if("ready"!==(h=this.g[r].a.ha()).getState()){o=!1;break}if(!o)return null;if((o=Xt({},this.I)).viewState=Xt({},o.viewState),h=Lt(t),o.extent=t.slice(),o.focus=h,o.size[0]=Math.round(Dt(t)/e),o.size[1]=Math.round(It(t)/e),(r=o.viewState).center=h,r.projection=i,r.resolution=e,Ji((this.l=o).tileQueue,16,16),this.f&&(i=this.f.resolution,o=this.f.G(),e===i&&St(t,o)||(this.f=null)),!this.f||this.i!==this.R)t:{for(t=this.l,i=this.g.length,e=Array(i),o=0;o<i;++o){var s,a,p,h=this.g[o],r=t,n=t.layerStatesArray[o];if(!(h=h.sd(r,n)?(s=r.size[0],a=r.size[1],!i1||(p=i1.canvas).width!==s||p.height!==a?i1=Po(s,a):i1.clearRect(0,0,s,a),h.S(r,n,i1),i1.getImageData(0,0,s,a)):null))break t;e[o]=h}this.b(new r1(n1,t,i={})),this.B.pp(e,i,this.pa.bind(this,t))}return this.f},o1.prototype.pa=function(t,e,o,i){var r,n;!e&&o&&(e=t.extent,(r=t.viewState.resolution)===this.l.viewState.resolution)&&St(e,this.l.extent)&&(this.f?n=this.f.Y().getContext("2d"):(n=Po(Math.round(Dt(e)/r),Math.round(It(e)/r)),this.f=new m0(e,r,1,this.j,n.canvas)),n.putImageData(o,0,0),this.s(),this.R=this.i,this.b(new r1(s1,t,i)))};var i1=null;function r1(t,e,o){Qe.call(this,t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=o}e(r1,Qe),o1.prototype.Jc=function(){return null};var n1="beforeoperations",s1="afteroperations";function a1(t){var e=t.layer.indexOf("-"),e=l1[-1==e?t.layer:t.layer.slice(0,e)],o=h1[t.layer];Um.call(this,{attributions:p1,cacheSize:t.cacheSize,crossOrigin:"anonymous",maxZoom:(null!=t.maxZoom?t:e).maxZoom,minZoom:(null!=t.minZoom?t:e).minZoom,opaque:o.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,url:void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+o.Lb,wrapX:t.wrapX})}e(a1,Um);var p1=[new Be({html:'Map tiles by <a href="http://stamen.com/">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.'}),_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]<<e[0])+e[2],a.length)],s)}}function m1(t){var e=0,o=[];if(t.urls)for(var i=0,r=t.urls.length;i<r;++i)o[e++]=t.urls[i];t.R=o.join("#")}function w1(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function x1(t){t.l=0<=tr(t.f.VERSION||"1.3.0")}function S1(t,e,o,i,r,n,s,a,p,h,l,u,c,f){var y,g;w0.call(this,t,e),this.j=null,this.o={Nd:!1,Kg:null,mf:-1,Lg:-1},this.c=h,this.a=[],this.u=o,this.v=n,this.g=[],this.l=[],n&&(y=p.Aa(n),g=p.Da(t[0]),a.Rf(y,a.tc(g),function(t){var e,o=Nt(y,a.Aa(t));.5<=Dt(o)/g&&.5<=It(o)/g&&(o=t.toString(),(e=h[o])||(e=s(t,l,u),e=h[o]=new c(t,null==e?4:0,null==e?"":e,i,r),this.l.push(d(e,"change",f))),e.j++,this.a.push(o))}.bind(this)))}function M1(t,e){t.Pg(bl(e,t.o,t.$o.bind(t),t.Zo.bind(t)))}function P1(t,e,o,i,r){w0.call(this,t,e),this.j=0,this.o=i,this.g=null,this.c={},this.u=r,this.l=o}function A1(t){Nm.call(this,{attributions:t.attributions,cacheSize:void 0!==t.cacheSize?t.cacheSize:128,extent:t.extent,logo:t.logo,opaque:!1,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction||M1,tileUrlFunction:t.tileUrlFunction,tilePixelRatio:t.tilePixelRatio,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX}),this.g=t.format||null,this.v={},this.l=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass||P1,this.f={},this.tileGrid||(this.tileGrid=this.Ta(v(t.projection||"EPSG:3857")))}function E1(t){this.o=t.matrixIds,Te.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})}function T1(t,e,o){var r=[],n=[],s=[],a=[],p=[],h=void 0!==o?o:[],l=(o=v(t.SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))).sc(),u="ne"==o.b.substr(0,2);return t.TileMatrix.sort(function(t,e){return e.ScaleDenominator-t.ScaleDenominator}),t.TileMatrix.forEach(function(e){var t,o,i;(t=!(0<h.length)||W(h,function(t){return e.Identifier==t.TileMatrix}))&&(n.push(e.Identifier),t=28e-5*e.ScaleDenominator/l,o=e.TileWidth,i=e.TileHeight,s.push(u?[e.TopLeftCorner[1],e.TopLeftCorner[0]]:e.TopLeftCorner),r.push(t),a.push(o==i?o:[o,i]),p.push([e.MatrixWidth,-e.MatrixHeight]))}),new E1({extent:e,origins:s,resolutions:r,matrixIds:n,tileSizes:a,sizes:p})}function N(t){this.fa=void 0!==t.version?t.version:"1.0.0",this.C=void 0!==t.format?t.format:"image/jpeg",this.f=t.dimensions||{},this.B=t.layer,this.l=t.matrixSet,this.R=t.style;var e=t.urls,i=(void 0===e&&void 0!==t.url&&(e=Am(t.url)),this.T=void 0!==t.requestEncoding?t.requestEncoding:"KVP"),r=t.tileGrid,o={layer:this.B,style:this.R,tilematrixset:this.l},n=("KVP"==i&&Xt(o,{Service:"WMTS",Request:"GetTile",Version:this.fa,Format:this.C}),this.f),s=e&&0<e.length?Mm(e.map(function(e){return e="KVP"==i?Vm(e,o):e.replace(/\{(\w+?)\}/g,function(t,e){return e.toLowerCase()in o?o[e.toLowerCase()]:t}),function(t){var o;if(t)return o={TileMatrix:r.o[t[0]],TileCol:t[1],TileRow:-t[2]-1},Xt(o,n),t=e,"KVP"==i?Vm(t,o):t.replace(/\{(\w+?)\}/g,function(t,e){return o[e]})}})):Pm;T.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:r,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:s,urls:e,wrapX:void 0!==t.wrapX&&t.wrapX}),Lm(this,j1(this))}function j1(t){var e,o=0,i=[];for(e in t.f)i[o++]=e+"-"+t.f[e];return i.join("/")}function C1(t){var e=(t=t||{}).size,o=e[0],i=e[1],n=[],r=256;switch(void 0!==t.tierSizeCalculation?t.tierSizeCalculation:R1){case R1:for(;r<o||r<i;)n.push([Math.ceil(o/r),Math.ceil(i/r)]),r+=r;break;case I1:for(;r<o||r<i;)n.push([Math.ceil(o/r),Math.ceil(i/r)]),o>>=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<o;i++)r.push(1<<i),s.push(n[i-1][0]*n[i-1][1]+s[i-1]);r.reverse(),e=new Te({extent:e=[0,-e[1],e[0],0],origin:Ft(e),resolutions:r}),(r=t.url)&&-1==r.indexOf("{TileGroup}")&&(r+="{TileGroup}/{z}-{x}-{y}.jpg"),r=Mm((r=Am(r)).map(function(r){return function(t){var e,o,i;if(t)return e=t[0],o=t[1],i={z:e,x:o,y:t=-t[2]-1,TileGroup:"TileGroup"+((o+t*n[e][0]+s[e])/256|0)},r.replace(/\{(\w+?)\}/g,function(t,e){return i[e]})}})),T.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:L1,tileGrid:e,tileUrlFunction:r})}function L1(t,e,o,i,r){M0.call(this,t,e,o,i,r),this.a=null}e(R,T),R.prototype.C=function(){return this.f},R.prototype.nb=function(t){return t},R.prototype.Fc=function(t,e,o){var i,r,n,s=this.tileGrid;if(!((s=s||this.Ta(o)).b.length<=t[0]))return i=s.Aa(t,this.l),r=pt(s.gb(t[0]),this.o),1!=e&&(r=at(r,e,this.o)),Xt(s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0},this.f),(n=this.urls)?(o=o.mb.split(":").pop(),s.SIZE=r[0]+","+r[1],s.BBOX=i.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(s.DPI?s.DPI*e:90*e),Vm(t=(1==n.length?n[0]:n[rt((t[1]<<t[0])+t[2],n.length)]).replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),s)):void 0},R.prototype.B=function(t){Xt(this.f,t),Lm(this,u1(this))},e(c1,jm),c1.prototype.Nc=function(t,e,o){var i,r=this.Sb(t,e,o);return this.a.b.hasOwnProperty(r)?this.a.get(r):(i=pt(this.tileGrid.gb(t)),i=new f1(t=[t,e,o],i,e=(e=Rm(this,t))?Rm(this,e).toString():""),this.a.set(r,i),i)},e(f1,w0),f1.prototype.Y=function(){var t,e;return this.a||((e=Po((t=this.c)[0],t[1])).strokeStyle="black",e.strokeRect(.5,.5,t[0]+.5,t[1]+.5),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.font="24px sans-serif",e.fillText(this.Ia,t[0]/2,t[1]/2),this.a=e.canvas)},f1.prototype.load=function(){},e(y1,T),(r=y1.prototype).Ao=function(t){if(!(t=t.target).status||200<=t.status&&t.status<300){try{var e=JSON.parse(t.responseText)}catch(t){return void this.Ve()}this.og(e)}else this.Ve()},r.zo=function(){this.Ve()},r.pl=function(){return this.f},r.og=function(t){var e,o=v("EPSG:4326"),i=this.c,r=(t.bounds&&(n=we(o,i),e=Bt(t.bounds,n)),t.minzoom||0),n=t.maxzoom||22;if(this.tileGrid=i=De({extent:Ge(i),maxZoom:n,minZoom:r}),this.tileUrlFunction=Sm(t.tiles,i),void 0!==t.attribution&&!this.j){o=void 0!==e?e:o.G(),e={};for(;r<=n;++r)e[r.toString()]=[Ie(i,o,r)];this.ua([new Be({html:t.attribution,tileRanges:e})])}this.f=t,Iv(this,"ready")},r.Ve=function(){Iv(this,"error")},e(g1,jm),(r=g1.prototype).Eo=function(t){if(!(t=t.target).status||200<=t.status&&t.status<300){try{var e=JSON.parse(t.responseText)}catch(t){return void this.We()}this.pg(e)}else this.We()},r.Do=function(){this.We()},r.ml=function(){return this.g},r.zk=function(t,e,o,i,r){var n,s,a;this.tileGrid?(e=this.tileGrid.Be(t,e),e=this.Nc(e[0],e[1],e[2],1,this.c),n=t,s=o,a=i,t=r,0==e.state&&!0===t?(Ye(e,"change",function(){s.call(a,this.getData(n))},e),v1(e)):!0===t?setTimeout(function(){s.call(a,this.getData(n))}.bind(e),0):s.call(a,e.getData(n))):!0===r?setTimeout(function(){o.call(i,null)},0):o.call(i,null)},r.We=function(){Iv(this,"error")},r.pg=function(t){var e,o=v("EPSG:4326"),i=this.c,r=(t.bounds&&(n=we(o,i),e=Bt(t.bounds,n)),t.minzoom||0),n=t.maxzoom||22,s=(this.tileGrid=i=De({extent:Ge(i),maxZoom:n,minZoom:r}),this.g=t.template,t.grids);if(s){if(this.l=Sm(s,i),void 0!==t.attribution){for(o=void 0!==e?e:o.G(),e={};r<=n;++r)e[s=r.toString()]=[Ie(i,o,r)];this.ua([new Be({html:t.attribution,tileRanges:e})])}Iv(this,"ready")}else Iv(this,"error")},r.Nc=function(t,e,o,i,r){var n=this.Sb(t,e,o);return this.a.b.hasOwnProperty(n)?this.a.get(n):(e=Rm(this,t=[t,e,o],r),i=new d1(t,void 0!==(i=this.l(e,i,r))?0:4,void 0!==i?i:"",this.tileGrid.Aa(t),this.v,this.f),this.a.set(n,i),i)},r.Ug=function(t,e,o){t=this.Sb(t,e,o),this.a.b.hasOwnProperty(t)&&this.a.get(t)},e(d1,w0),(r=d1.prototype).Y=function(){return null},r.getData=function(t){var e;return!this.g||!this.j||"string"!=typeof(e=this.g[Math.floor((1-(t[1]-this.a[1])/(this.a[3]-this.a[1]))*this.g.length)])?null:(93<=(e=e.charCodeAt(Math.floor((t[0]-this.a[0])/(this.a[2]-this.a[0])*e.length)))&&e--,35<=e&&e--,t=null,(e-=32)in this.j&&(e=this.j[e],t=this.c&&e in this.c?this.c[e]:e),t)},r.bb=function(){return this.o},r.De=function(){this.state=3,this.s()},r.Ji=function(t){this.g=t.grid,this.j=t.keys,this.c=t.data,this.state=4,this.s()},r.Co=function(t){if(!(t=t.target).status||200<=t.status&&t.status<300){try{var e=JSON.parse(t.responseText)}catch(t){return void this.De()}this.Ji(e)}else this.De()},r.Bo=function(){this.De()},r.load=function(){this.v&&v1(this)},e(I,T),(r=I.prototype).Fo=function(t,e,o,i){o=v(o);var r,n,s,a=this.tileGrid;if(e=(a=a||this.Ta(o)).Be(t,e),!(a.b.length<=e[0]))return r=a.Da(e[0]),n=a.Aa(e,this.fa),a=pt(a.gb(e[0]),this.o),(s=this.C)&&(a=st(a,s,this.o),n=lt(n,r*s,n)),s={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.f.LAYERS},Xt(s,this.f,i),i=Math.floor((n[3]-t[1])/r),s[this.l?"I":"X"]=Math.floor((t[0]-n[0])/r),s[this.l?"J":"Y"]=i,b1(this,e,a,n,1,o,s)},r.Xf=function(){return this.C},r.Sb=function(t,e,o){return this.R+T.prototype.Sb.call(this,t,e,o)},r.Go=function(){return this.f},r.nb=function(t){return this.T&&void 0!==this.B?t:1},r.Fc=function(t,e,o){var i,r,n,s=this.tileGrid;if(!((s=s||this.Ta(o)).b.length<=t[0]))return 1==e||this.T&&void 0!==this.B||(e=1),i=s.Da(t[0]),r=s.Aa(t,this.fa),s=pt(s.gb(t[0]),this.o),(n=this.C)&&(s=st(s,n,this.o),r=lt(r,i*n,r)),1!=e&&(s=at(s,e,this.o)),Xt(i={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0},this.f),b1(this,t,s,r,e,o,i)},r.eb=function(t){T.prototype.eb.call(this,t),m1(this)},r.Ho=function(t){Xt(this.f,t),m1(this),x1(this),Lm(this,w1(this))},e(S1,w0),S1.prototype.ka=function(){for(var t=0,e=this.a.length;t<e;++t){var o=this.a[t],i=this.c[o];i.j--,i.j||(delete this.c[o],$e(i))}this.a.length=0,this.c=null,1==this.state&&(this.g.forEach(qe),this.g.length=0),this.i&&$e(this.i),this.state=5,this.s(),this.l.forEach(qe),this.l.length=0,w0.prototype.ka.call(this)},S1.prototype.Y=function(){return-1==this.o.Lg?null:this.j.canvas},S1.prototype.bb=function(){return this.a.join("/")+"/"+this.u},S1.prototype.load=function(){var r=0,n=!1;0==this.state&&S0(this,1),1==this.state&&this.a.forEach(function(e){var o,i=this.c[e];0==i.state?(i.Pg(this.S),i.load()):3==i.state?n=!0:4==i.state&&V(this.a,e),1==i.state&&(o=d(i,"change",function(){var t=i.getState();2!=t&&3!=t||(--r,qe(o),V(this.g,o),3==t&&(V(this.a,e),n=!0),r)||S0(this,0<this.a.length?2:3)}.bind(this)),this.g.push(o),++r)}.bind(this)),r||setTimeout(function(){S0(this,0<this.a.length?2:n?3:4)}.bind(this),0)},e(P1,w0),(r=P1.prototype).ka=function(){this.g=null,this.c={},this.state=5,this.s(),w0.prototype.ka.call(this)},r.Lm=function(){return this.o},r.Km=function(){return this.g},r.bb=function(){return this.l},r.Mm=function(){return this.a},r.load=function(){0==this.state&&(S0(this,1),this.u(this,this.l),this.v(null,NaN,null))},r.$o=function(t,e){this.ig(e),this.mj(t)},r.Zo=function(){S0(this,3)},r.mj=function(t){this.g=t,S0(this,2)},r.ig=function(t){this.a=t},r.Pg=function(t){this.v=t},e(A1,Nm),A1.prototype.Nc=function(t,e,o,i,r){var n=this.Sb(t,e,o);return this.a.b.hasOwnProperty(n)?this.a.get(n):(i=new S1(t=[t,e,o],void 0!==(o=(e=Rm(this,t,r))?this.tileUrlFunction(e,i,r):void 0)?0:4,void 0!==o?o:"",this.g,this.tileLoadFunction,e,this.tileUrlFunction,this.tileGrid,this.Ta(r),this.v,i,r,this.tileClass,this.Li.bind(this)),this.a.set(n,i),i)},A1.prototype.Ta=function(t){var e=t.mb,o=this.f[e];return o||(o=this.tileGrid,o=this.f[e]=Ue(t,void 0,o?o.gb(o.minZoom):void 0)),o},A1.prototype.nb=function(t){return null==t?Nm.prototype.nb.call(this,t):t},A1.prototype.Xd=function(t,e,o){return t=pt(this.Ta(o).gb(t)),[Math.round(t[0]*e),Math.round(t[1]*e)]},e(E1,Te),E1.prototype.l=function(){return this.o},e(N,T),(r=N.prototype).Mk=function(){return this.f},r.Io=function(){return this.C},r.Jo=function(){return this.B},r.$k=function(){return this.l},r.kl=function(){return this.T},r.Ko=function(){return this.R},r.rl=function(){return this.fa},r.uq=function(t){Xt(this.f,t),Lm(this,j1(this))},e(C1,T),e(L1,M0),L1.prototype.Y=function(){var t,e;return this.a||(t=M0.prototype.Y.call(this),2==this.state?256==t.width&&256==t.height?this.a=t:((e=Po(256,256)).drawImage(t,0,0),this.a=e.canvas):t)};var R1="default",I1="truncated";function N1(t,e){this.b=e,this.a=[{x:0,y:0,width:t,height:t}],this.c={},this.i=Po(t,t),this.f=this.i.canvas}function F1(t,e,o,i){e=[e,1],0<o.width&&0<o.height&&e.push(o),0<i.width&&0<i.height&&e.push(i),t.a.splice.apply(t.a,e)}function k1(t){this.a=void 0!==(t=t||{}).initialSize?t.initialSize:256,this.i=void 0!==t.maxSize?t.maxSize:void 0!==vi?vi:2048,this.b=void 0!==t.space?t.space:1,this.f=[new N1(this.a,this.b)],this.c=this.a,this.g=[new N1(this.c,this.b)]}function D1(t,e,o,i,r,n,s){for(var a=e?t.g:t.f,p=0,h=a.length;p<h;++p){var l=a[p];if(l=l.add(o,i,r,n,s))return l;l||p!==h-1||(e?(l=Math.min(2*t.c,t.i),t.c=l):(l=Math.min(2*t.a,t.i),t.a=l),l=new N1(l,t.b),a.push(l),++h)}return null}return N1.prototype.get=function(t){return this.c[t]||null},N1.prototype.add=function(t,e,o,i,r){for(var n=0,s=this.a.length;n<s;++n){var a=this.a[n];if(a.width>=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<o;++e)qe(t[e]);else qe(t)}),io.prototype.changed=io.prototype.s,io.prototype.dispatchEvent=io.prototype.b,io.prototype.getRevision=io.prototype.L,io.prototype.on=io.prototype.J,io.prototype.un=io.prototype.K,t("ol.Overlay",fh),fh.prototype.getElement=fh.prototype.Rd,fh.prototype.getId=fh.prototype.Jm,fh.prototype.getMap=fh.prototype.Me,fh.prototype.getOffset=fh.prototype.Dh,fh.prototype.getPosition=fh.prototype.Yh,fh.prototype.getPositioning=fh.prototype.Eh,fh.prototype.setElement=fh.prototype.lj,fh.prototype.setOffset=fh.prototype.rj,fh.prototype.setPosition=fh.prototype.Ne,fh.prototype.setPositioning=fh.prototype.uj,t("ol.proj.METERS_PER_UNIT",Yt),t("ol.proj.setProj4",function(t){Ht=t}),t("ol.proj.getPointResolution",ce),t("ol.proj.addEquivalentProjections",fe),t("ol.proj.addProjection",ye),t("ol.proj.addCoordinateTransforms",de),t("ol.proj.fromLonLat",function(t,e){return Me(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}),t("ol.proj.toLonLat",function(t,e){return Me(t,void 0!==e?e:"EPSG:3857","EPSG:4326")}),t("ol.proj.get",v),t("ol.proj.equivalent",be),t("ol.proj.getTransform",me),t("ol.proj.transform",Me),t("ol.proj.transformExtent",Pe),t("ol.render.toContext",function(t,e){var o=t.canvas,i=e||{};return e=i.pixelRatio||ni,(i=i.size)&&(o.width=i[0]*e,o.height=i[1]*e,o.style.width=i[0]+"px",o.style.height=i[1]+"px"),new Vs(t,e,o=[0,0,o.width,o.height],Es(ms(),e,e),0)}),t("ol.size.toSize",pt),t("ol.Sphere",Kt),Kt.prototype.geodesicArea=Kt.prototype.a,Kt.prototype.haversineDistance=Kt.prototype.b,w0.prototype.getTileCoord=w0.prototype.f,t("ol.tilegrid.createXYZ",De),P1.prototype.getFormat=P1.prototype.Lm,P1.prototype.getFeatures=P1.prototype.Km,P1.prototype.getProjection=P1.prototype.Mm,P1.prototype.setFeatures=P1.prototype.mj,P1.prototype.setProjection=P1.prototype.ig,P1.prototype.setLoader=P1.prototype.Pg,t("ol.View",h),h.prototype.getAnimating=h.prototype.Ic,h.prototype.getInteracting=h.prototype.Rk,h.prototype.cancelAnimations=h.prototype.ed,h.prototype.constrainCenter=h.prototype.Ec,h.prototype.getCenter=h.prototype.wa,h.prototype.calculateExtent=h.prototype.dd,h.prototype.getMaxResolution=h.prototype.Nm,h.prototype.getMinResolution=h.prototype.Pm,h.prototype.getMaxZoom=h.prototype.Om,h.prototype.setMaxZoom=h.prototype.eq,h.prototype.getMinZoom=h.prototype.Qm,h.prototype.setMinZoom=h.prototype.fq,h.prototype.getProjection=h.prototype.Rm,h.prototype.getResolution=h.prototype.Pa,h.prototype.getResolutions=h.prototype.Sm,h.prototype.getResolutionForExtent=h.prototype.ze,h.prototype.getRotation=h.prototype.Qa,h.prototype.getZoom=h.prototype.Hh,h.prototype.getZoomForResolution=h.prototype.Ce,h.prototype.fit=h.prototype.Qf,h.prototype.centerOn=h.prototype.uk,h.prototype.setCenter=h.prototype.ob,h.prototype.setResolution=h.prototype.Vc,h.prototype.setRotation=h.prototype.Oe,h.prototype.setZoom=h.prototype.lq,t("ol.xml.getAllTextContent",il),t("ol.xml.parse",sl),Aa.prototype.getGL=Aa.prototype.Wo,Aa.prototype.useProgram=Aa.prototype.Qc,t("ol.tilegrid.TileGrid",Te),Te.prototype.forEachTileCoord=Te.prototype.Rf,Te.prototype.getMaxZoom=Te.prototype.Ti,Te.prototype.getMinZoom=Te.prototype.Ui,Te.prototype.getOrigin=Te.prototype.Pc,Te.prototype.getResolution=Te.prototype.Da,Te.prototype.getResolutions=Te.prototype.Vi,Te.prototype.getTileCoordExtent=Te.prototype.Aa,Te.prototype.getTileCoordForCoordAndResolution=Te.prototype.Be,Te.prototype.getTileCoordForCoordAndZ=Te.prototype.bg,Te.prototype.getTileSize=Te.prototype.gb,Te.prototype.getZForResolution=Te.prototype.tc,t("ol.tilegrid.WMTS",E1),E1.prototype.getMatrixIds=E1.prototype.l,t("ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet",T1),t("ol.style.AtlasManager",k1),t("ol.style.Circle",Yh),Yh.prototype.setRadius=Yh.prototype.Uc,t("ol.style.Fill",Hh),Hh.prototype.getColor=Hh.prototype.i,Hh.prototype.setColor=Hh.prototype.c,t("ol.style.Icon",af),af.prototype.getAnchor=af.prototype.Hc,af.prototype.getColor=af.prototype.Lo,af.prototype.getImage=af.prototype.Y,af.prototype.getOrigin=af.prototype.Oc,af.prototype.getSrc=af.prototype.Mo,af.prototype.getSize=af.prototype.ic,t("ol.style.Image",Zh),Zh.prototype.getOpacity=Zh.prototype.Ze,Zh.prototype.getRotateWithView=Zh.prototype.$e,Zh.prototype.getRotation=Zh.prototype.af,Zh.prototype.getScale=Zh.prototype.bf,Zh.prototype.getSnapToPixel=Zh.prototype.Ae,Zh.prototype.setOpacity=Zh.prototype.td,Zh.prototype.setRotation=Zh.prototype.cf,Zh.prototype.setScale=Zh.prototype.ud,t("ol.style.RegularShape",Kh),Kh.prototype.getAnchor=Kh.prototype.Hc,Kh.prototype.getAngle=Kh.prototype.Pi,Kh.prototype.getFill=Kh.prototype.Fa,Kh.prototype.getImage=Kh.prototype.Y,Kh.prototype.getOrigin=Kh.prototype.Oc,Kh.prototype.getPoints=Kh.prototype.Qi,Kh.prototype.getRadius=Kh.prototype.Ri,Kh.prototype.getRadius2=Kh.prototype.Fh,Kh.prototype.getSize=Kh.prototype.ic,Kh.prototype.getStroke=Kh.prototype.Ga,t("ol.style.Stroke",hp),hp.prototype.getColor=hp.prototype.No,hp.prototype.getLineCap=hp.prototype.Vk,hp.prototype.getLineDash=hp.prototype.Oo,hp.prototype.getLineDashOffset=hp.prototype.Wk,hp.prototype.getLineJoin=hp.prototype.Xk,hp.prototype.getMiterLimit=hp.prototype.bl,hp.prototype.getWidth=hp.prototype.Po,hp.prototype.setColor=hp.prototype.Qo,hp.prototype.setLineCap=hp.prototype.aq,hp.prototype.setLineDashOffset=hp.prototype.bq,hp.prototype.setLineJoin=hp.prototype.cq,hp.prototype.setMiterLimit=hp.prototype.gq,hp.prototype.setWidth=hp.prototype.jq,t("ol.style.Style",qh),qh.prototype.getGeometry=qh.prototype.V,qh.prototype.getGeometryFunction=qh.prototype.Pk,qh.prototype.getFill=qh.prototype.Fa,qh.prototype.setFill=qh.prototype.pf,qh.prototype.getImage=qh.prototype.Y,qh.prototype.setImage=qh.prototype.Og,qh.prototype.getStroke=qh.prototype.Ga,qh.prototype.setStroke=qh.prototype.qf,qh.prototype.getText=qh.prototype.Na,qh.prototype.setText=qh.prototype.xd,qh.prototype.getZIndex=qh.prototype.Ba,qh.prototype.setGeometry=qh.prototype.Ra,qh.prototype.setZIndex=qh.prototype.Vb,t("ol.style.Text",pf),pf.prototype.getFont=pf.prototype.Nk,pf.prototype.getOffsetX=pf.prototype.cl,pf.prototype.getOffsetY=pf.prototype.dl,pf.prototype.getFill=pf.prototype.Fa,pf.prototype.getRotateWithView=pf.prototype.Ro,pf.prototype.getRotation=pf.prototype.So,pf.prototype.getScale=pf.prototype.To,pf.prototype.getStroke=pf.prototype.Ga,pf.prototype.getText=pf.prototype.Na,pf.prototype.getTextAlign=pf.prototype.nl,pf.prototype.getTextBaseline=pf.prototype.ol,pf.prototype.setFont=pf.prototype.nj,pf.prototype.setOffsetX=pf.prototype.sj,pf.prototype.setOffsetY=pf.prototype.tj,pf.prototype.setFill=pf.prototype.pf,pf.prototype.setRotation=pf.prototype.Uo,pf.prototype.setScale=pf.prototype.Si,pf.prototype.setStroke=pf.prototype.qf,pf.prototype.setText=pf.prototype.xd,pf.prototype.setTextAlign=pf.prototype.vj,pf.prototype.setTextBaseline=pf.prototype.hq,t("ol.source.BingMaps",j),t("ol.source.BingMaps.TOS_ATTRIBUTION",Om),j.prototype.getApiKey=j.prototype.T,j.prototype.getImagerySet=j.prototype.fa,t("ol.source.CartoDB",C),C.prototype.getConfig=C.prototype.Kk,C.prototype.updateConfig=C.prototype.tq,C.prototype.setConfig=C.prototype.Xp,t("ol.source.Cluster",L),L.prototype.getDistance=L.prototype.$n,L.prototype.getSource=L.prototype.ao,L.prototype.setDistance=L.prototype.Yp,t("ol.source.Image",$b),t("ol.source.ImageArcGISRest",Wm),Wm.prototype.getParams=Wm.prototype.co,Wm.prototype.getImageLoadFunction=Wm.prototype.bo,Wm.prototype.getUrl=Wm.prototype.eo,Wm.prototype.setImageLoadFunction=Wm.prototype.fo,Wm.prototype.setUrl=Wm.prototype.ho,Wm.prototype.updateParams=Wm.prototype.io,t("ol.source.ImageCanvas",nm),t("ol.source.ImageMapGuide",Zm),Zm.prototype.getParams=Zm.prototype.ko,Zm.prototype.getImageLoadFunction=Zm.prototype.jo,Zm.prototype.updateParams=Zm.prototype.mo,Zm.prototype.setImageLoadFunction=Zm.prototype.lo,t("ol.source.ImageStatic",Km),t("ol.source.ImageVector",sm),sm.prototype.getSource=sm.prototype.no,sm.prototype.getStyle=sm.prototype.oo,sm.prototype.getStyleFunction=sm.prototype.po,sm.prototype.setStyle=sm.prototype.Ii,t("ol.source.ImageWMS",zm),zm.prototype.getGetFeatureInfoUrl=zm.prototype.so,zm.prototype.getParams=zm.prototype.uo,zm.prototype.getImageLoadFunction=zm.prototype.to,zm.prototype.getUrl=zm.prototype.vo,zm.prototype.setImageLoadFunction=zm.prototype.wo,zm.prototype.setUrl=zm.prototype.xo,zm.prototype.updateParams=zm.prototype.yo,t("ol.source.OSM",Jm),t("ol.source.OSM.ATTRIBUTION",_m),t("ol.source.Raster",o1),o1.prototype.setOperation=o1.prototype.v,t("ol.source.Source",Lv),Lv.prototype.getAttributions=Lv.prototype.ya,Lv.prototype.getLogo=Lv.prototype.xa,Lv.prototype.getProjection=Lv.prototype.za,Lv.prototype.refresh=Lv.prototype.sa,Lv.prototype.setAttributions=Lv.prototype.ua,t("ol.source.Stamen",a1),t("ol.source.Tile",jm),jm.prototype.getTileGrid=jm.prototype.ab,t("ol.source.TileArcGISRest",R),R.prototype.getParams=R.prototype.C,R.prototype.updateParams=R.prototype.B,t("ol.source.TileDebug",c1),t("ol.source.TileImage",T),T.prototype.setRenderReprojectionEdges=T.prototype.Pb,T.prototype.setTileGridForProjection=T.prototype.Qb,t("ol.source.TileJSON",y1),y1.prototype.getTileJSON=y1.prototype.pl,t("ol.source.TileUTFGrid",g1),g1.prototype.getTemplate=g1.prototype.ml,g1.prototype.forDataAtCoordinateAndResolution=g1.prototype.zk,t("ol.source.TileWMS",I),I.prototype.getGetFeatureInfoUrl=I.prototype.Fo,I.prototype.getParams=I.prototype.Go,I.prototype.updateParams=I.prototype.Ho,Nm.prototype.getTileLoadFunction=Nm.prototype.pb,Nm.prototype.getTileUrlFunction=Nm.prototype.qb,Nm.prototype.getUrls=Nm.prototype.rb,Nm.prototype.setTileLoadFunction=Nm.prototype.vb,Nm.prototype.setTileUrlFunction=Nm.prototype.cb,Nm.prototype.setUrl=Nm.prototype.jb,Nm.prototype.setUrls=Nm.prototype.eb,t("ol.source.Vector",a),a.prototype.addFeature=a.prototype.yb,a.prototype.addFeatures=a.prototype.cd,a.prototype.forEachFeature=a.prototype.sh,a.prototype.forEachFeatureInExtent=a.prototype.$b,a.prototype.forEachFeatureIntersectingExtent=a.prototype.th,a.prototype.getFeaturesCollection=a.prototype.Ah,a.prototype.getFeatures=a.prototype.Xe,a.prototype.getFeaturesAtCoordinate=a.prototype.zh,a.prototype.getFeaturesInExtent=a.prototype.Uf,a.prototype.getClosestFeatureToCoordinate=a.prototype.vh,a.prototype.getExtent=a.prototype.G,a.prototype.getFeatureById=a.prototype.yh,a.prototype.getFormat=a.prototype.Mi,a.prototype.getUrl=a.prototype.Ni,a.prototype.removeFeature=a.prototype.Gb,t("ol.source.VectorTile",A1),t("ol.source.WMTS",N),N.prototype.getDimensions=N.prototype.Mk,N.prototype.getFormat=N.prototype.Io,N.prototype.getLayer=N.prototype.Jo,N.prototype.getMatrixSet=N.prototype.$k,N.prototype.getRequestEncoding=N.prototype.kl,N.prototype.getStyle=N.prototype.Ko,N.prototype.getVersion=N.prototype.rl,N.prototype.updateDimensions=N.prototype.uq,t("ol.source.WMTS.optionsFromCapabilities",function(t,r){var e=W(t.Contents.Layer,function(t){return t.Identifier==r.layer});if(null===e)return null;var o,i,n=t.Contents.TileMatrixSet,s=1<e.TileMatrixSetLink.length?"projection"in r?z(e.TileMatrixSetLink,function(e){var t=W(n,function(t){return t.Identifier==e.TileMatrixSet}).SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"),o=v(t),i=v(r.projection);return o&&i?be(o,i):t==r.projection}):z(e.TileMatrixSetLink,function(t){return t.TileMatrixSet==r.matrixSet}):0,a=e.TileMatrixSetLink[s=s<0?0:s].TileMatrixSet,p=e.TileMatrixSetLink[s].TileMatrixSetLimits,h=e.Format[0],l=("format"in r&&(h=r.format),s=z(e.Style,function(t){return"style"in r?t.Title==r.style:t.isDefault}),s=e.Style[s=s<0?0:s].Identifier,{}),u=("Dimension"in e&&e.Dimension.forEach(function(t){var e=t.Identifier,o=t.Default;void 0===o&&(o=t.Value[0]),l[e]=o}),W(t.Contents.TileMatrixSet,function(t){return t.Identifier==a})),c="projection"in r?v(r.projection):v(u.SupportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3")),f=e.WGS84BoundingBox,y=(p=T1(u,i=void 0!==f&&(o=v("EPSG:4326").G(),o=f[0]==o[0]&&f[2]==o[2],i=Pe(f,"EPSG:4326",c),f=c.G())&&!yt(f,i)?void 0:i,p),[]),u=void 0!==(u=r.requestEncoding)?u:"";if("OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(i=0,f=(t=t.OperationsMetadata.GetTile.DCP.HTTP.Get).length;i<f;++i){var g=W(t[i].Constraint,function(t){return"GetEncoding"==t.name}).AllowedValues.Value;if("KVP"!==(u=""===u?g[0]:u))break;D(g,"KVP")&&y.push(t[i].href)}return y.length||(u="REST",e.ResourceURL.forEach(function(t){"tile"===t.resourceType&&(h=t.format,y.push(t.template))})),{urls:y,layer:r.layer,matrixSet:a,format:h,projection:c,requestEncoding:u,tileGrid:p,style:s,dimensions:l,wrapX:o,crossOrigin:r.crossOrigin}}),t("ol.source.XYZ",Um),t("ol.source.Zoomify",C1),sg.prototype.getExtent=sg.prototype.G,sg.prototype.getId=sg.prototype.Wn,sg.prototype.getGeometry=sg.prototype.V,sg.prototype.getProperties=sg.prototype.Xn,sg.prototype.getType=sg.prototype.U,t("ol.render.VectorContext",Xs),sh.prototype.setStyle=sh.prototype.rd,sh.prototype.drawGeometry=sh.prototype.zb,sh.prototype.drawFeature=sh.prototype.te,Vs.prototype.drawCircle=Vs.prototype.Zb,Vs.prototype.setStyle=Vs.prototype.rd,Vs.prototype.drawGeometry=Vs.prototype.zb,Vs.prototype.drawFeature=Vs.prototype.te,t("ol.proj.common.add",Ae),t("ol.proj.Projection",qt),qt.prototype.getCode=qt.prototype.Jk,qt.prototype.getExtent=qt.prototype.G,qt.prototype.getUnits=qt.prototype.Un,qt.prototype.getMetersPerUnit=qt.prototype.sc,qt.prototype.getWorldExtent=qt.prototype.tl,qt.prototype.isGlobal=qt.prototype.dm,qt.prototype.setGlobal=qt.prototype.$p,qt.prototype.setExtent=qt.prototype.Vn,qt.prototype.setWorldExtent=qt.prototype.kq,qt.prototype.setGetPointResolution=qt.prototype.Zp,t("ol.proj.Units.METERS_PER_UNIT",Yt),t("ol.layer.Base",ls),ls.prototype.getExtent=ls.prototype.G,ls.prototype.getMaxResolution=ls.prototype.fc,ls.prototype.getMinResolution=ls.prototype.gc,ls.prototype.getOpacity=ls.prototype.hc,ls.prototype.getVisible=ls.prototype.Mb,ls.prototype.getZIndex=ls.prototype.Ba,ls.prototype.setExtent=ls.prototype.vc,ls.prototype.setMaxResolution=ls.prototype.Ac,ls.prototype.setMinResolution=ls.prototype.Bc,ls.prototype.setOpacity=ls.prototype.wc,ls.prototype.setVisible=ls.prototype.xc,ls.prototype.setZIndex=ls.prototype.Vb,t("ol.layer.Group",cs),cs.prototype.getLayers=cs.prototype.qd,cs.prototype.setLayers=cs.prototype.xi,t("ol.layer.Heatmap",p),p.prototype.getBlur=p.prototype.uh,p.prototype.getGradient=p.prototype.Bh,p.prototype.getRadius=p.prototype.yi,p.prototype.setBlur=p.prototype.jj,p.prototype.setGradient=p.prototype.pj,p.prototype.setRadius=p.prototype.Uc,t("ol.layer.Image",pm),pm.prototype.getSource=pm.prototype.ha,t("ol.layer.Layer",ys),ys.prototype.getSource=ys.prototype.ha,ys.prototype.setSource=ys.prototype.Wc,t("ol.layer.Tile",A),A.prototype.getPreload=A.prototype.Ud,A.prototype.getSource=A.prototype.ha,A.prototype.setPreload=A.prototype.zi,A.prototype.getUseInterimTilesOnError=A.prototype.kd,A.prototype.setUseInterimTilesOnError=A.prototype.Ai,t("ol.layer.Vector",s),s.prototype.getSource=s.prototype.ha,s.prototype.getStyle=s.prototype.D,s.prototype.getStyleFunction=s.prototype.C,s.prototype.setStyle=s.prototype.g,t("ol.layer.VectorTile",E),E.prototype.getPreload=E.prototype.Ud,E.prototype.getUseInterimTilesOnError=E.prototype.kd,E.prototype.setPreload=E.prototype.Bi,E.prototype.setUseInterimTilesOnError=E.prototype.Ci,t("ol.interaction.DoubleClickZoom",cn),t("ol.interaction.DoubleClickZoom.handleEvent",fn),t("ol.interaction.DragAndDrop",E0),t("ol.interaction.DragAndDrop.handleEvent",cr),t("ol.interaction.DragBox",On),On.prototype.getGeometry=On.prototype.V,t("ol.interaction.DragPan",En),t("ol.interaction.DragRotate",Ln),t("ol.interaction.DragRotateAndZoom",N0),t("ol.interaction.DragZoom",zn),t("ol.interaction.Draw",Uv),t("ol.interaction.Draw.handleEvent",Gv),Uv.prototype.removeLastPoint=Uv.prototype.Op,Uv.prototype.finishDrawing=Uv.prototype.Pd,Uv.prototype.extend=Uv.prototype.vn,t("ol.interaction.Draw.createRegularPolygon",function(r,n){return function(t,e){var o=t[0],i=(t=t[1],Math.sqrt(pr(o,t)));return Jr(e=e||qr(new h0(o),r),o,i,n||Math.atan((t[1]-o[1])/(t[0]-o[0]))),e}}),t("ol.interaction.Draw.createBox",function(){return function(t,e){return t=ht(t),(e=e||new w(null)).ma([[jt(t),Ct(t),kt(t),Ft(t),jt(t)]]),e}}),t("ol.interaction.Extent",Qv),Qv.prototype.getExtent=Qv.prototype.G,Qv.prototype.setExtent=Qv.prototype.g,pb.prototype.extent_=pb.prototype.b,t("ol.interaction.Interaction",pn),pn.prototype.getActive=pn.prototype.c,pn.prototype.getMap=pn.prototype.f,pn.prototype.setActive=pn.prototype.Ha,t("ol.interaction.KeyboardPan",Yn),t("ol.interaction.KeyboardPan.handleEvent",Hn),t("ol.interaction.KeyboardZoom",qn),t("ol.interaction.KeyboardZoom.handleEvent",Jn),t("ol.interaction.Modify",lb),t("ol.interaction.Modify.handleEvent",bb),lb.prototype.removePoint=lb.prototype.hj,t("ol.interaction.MouseWheelZoom",_n),t("ol.interaction.MouseWheelZoom.handleEvent",$n),_n.prototype.setMouseAnchor=_n.prototype.T,t("ol.interaction.PinchRotate",es),t("ol.interaction.PinchZoom",ns),t("ol.interaction.Pointer",Mn),t("ol.interaction.Pointer.handleEvent",An),t("ol.interaction.Select",Pb),Pb.prototype.getFeatures=Pb.prototype.Gn,Pb.prototype.getHitTolerance=Pb.prototype.Hn,Pb.prototype.getLayer=Pb.prototype.In,t("ol.interaction.Select.handleEvent",Ab),Pb.prototype.setHitTolerance=Pb.prototype.Kn,t("ol.interaction.Snap",jb),jb.prototype.addFeature=jb.prototype.yb,jb.prototype.removeFeature=jb.prototype.Gb,t("ol.interaction.Translate",Ib),Ib.prototype.getHitTolerance=Ib.prototype.B,Ib.prototype.setHitTolerance=Ib.prototype.I,t("ol.geom.Circle",h0),h0.prototype.getCenter=h0.prototype.wa,h0.prototype.getRadius=h0.prototype.pd,h0.prototype.getType=h0.prototype.U,h0.prototype.intersectsExtent=h0.prototype.Xa,h0.prototype.setCenter=h0.prototype.ob,h0.prototype.setCenterAndRadius=h0.prototype.Ng,h0.prototype.setRadius=h0.prototype.Uc,h0.prototype.transform=h0.prototype.tb,t("ol.geom.Geometry",yr),yr.prototype.getClosestPoint=yr.prototype.Ab,yr.prototype.intersectsCoordinate=yr.prototype.sb,yr.prototype.getExtent=yr.prototype.G,yr.prototype.simplify=yr.prototype.Rb,yr.prototype.transform=yr.prototype.tb,t("ol.geom.GeometryCollection",uu),uu.prototype.getGeometries=uu.prototype.Vf,uu.prototype.getType=uu.prototype.U,uu.prototype.intersectsExtent=uu.prototype.Xa,uu.prototype.setGeometries=uu.prototype.oj,uu.prototype.applyTransform=uu.prototype.Dc,t("ol.geom.LinearRing",Fr),Fr.prototype.getArea=Fr.prototype.qn,Fr.prototype.getCoordinates=Fr.prototype.X,Fr.prototype.getType=Fr.prototype.U,Fr.prototype.setCoordinates=Fr.prototype.ma,t("ol.geom.LineString",S),S.prototype.appendCoordinate=S.prototype.mk,S.prototype.forEachSegment=S.prototype.Ck,S.prototype.getCoordinateAtM=S.prototype.nn,S.prototype.getCoordinates=S.prototype.X,S.prototype.getCoordinateAt=S.prototype.wh,S.prototype.getLength=S.prototype.pn,S.prototype.getType=S.prototype.U,S.prototype.intersectsExtent=S.prototype.Xa,S.prototype.setCoordinates=S.prototype.ma,t("ol.geom.MultiLineString",M),M.prototype.appendLineString=M.prototype.nk,M.prototype.getCoordinateAtM=M.prototype.rn,M.prototype.getCoordinates=M.prototype.X,M.prototype.getLineString=M.prototype.Yk,M.prototype.getLineStrings=M.prototype.gd,M.prototype.getType=M.prototype.U,M.prototype.intersectsExtent=M.prototype.Xa,M.prototype.setCoordinates=M.prototype.ma,t("ol.geom.MultiPoint",P),P.prototype.appendPoint=P.prototype.qk,P.prototype.getCoordinates=P.prototype.X,P.prototype.getPoint=P.prototype.il,P.prototype.getPoints=P.prototype.Zd,P.prototype.getType=P.prototype.U,P.prototype.intersectsExtent=P.prototype.Xa,P.prototype.setCoordinates=P.prototype.ma,t("ol.geom.MultiPolygon",f),f.prototype.appendPolygon=f.prototype.rk,f.prototype.getArea=f.prototype.sn,f.prototype.getCoordinates=f.prototype.X,f.prototype.getInteriorPoints=f.prototype.Uk,f.prototype.getPolygon=f.prototype.jl,f.prototype.getPolygons=f.prototype.Td,f.prototype.getType=f.prototype.U,f.prototype.intersectsExtent=f.prototype.Xa,f.prototype.setCoordinates=f.prototype.ma,t("ol.geom.Point",m),m.prototype.getCoordinates=m.prototype.X,m.prototype.getType=m.prototype.U,m.prototype.intersectsExtent=m.prototype.Xa,m.prototype.setCoordinates=m.prototype.ma,t("ol.geom.Polygon",w),w.prototype.appendLinearRing=w.prototype.pk,w.prototype.getArea=w.prototype.tn,w.prototype.getCoordinates=w.prototype.X,w.prototype.getInteriorPoint=w.prototype.Tk,w.prototype.getLinearRingCount=w.prototype.Zk,w.prototype.getLinearRing=w.prototype.Ch,w.prototype.getLinearRings=w.prototype.Sd,w.prototype.getType=w.prototype.U,w.prototype.intersectsExtent=w.prototype.Xa,w.prototype.setCoordinates=w.prototype.ma,t("ol.geom.Polygon.circular",Yr),t("ol.geom.Polygon.fromExtent",Hr),t("ol.geom.Polygon.fromCircle",qr),t("ol.geom.SimpleGeometry",b),b.prototype.getFirstCoordinate=b.prototype.ac,b.prototype.getLastCoordinate=b.prototype.bc,b.prototype.getLayout=b.prototype.cc,b.prototype.applyTransform=b.prototype.Dc,t("ol.format.EsriJSON",kl),kl.prototype.readFeature=kl.prototype.Tb,kl.prototype.readFeatures=kl.prototype.Oa,kl.prototype.readGeometry=kl.prototype.Sc,kl.prototype.readProjection=kl.prototype.kb,kl.prototype.writeGeometry=kl.prototype.$c,kl.prototype.writeGeometryObject=kl.prototype.je,kl.prototype.writeFeature=kl.prototype.Bd,kl.prototype.writeFeatureObject=kl.prototype.Zc,kl.prototype.writeFeatures=kl.prototype.Wb,kl.prototype.writeFeaturesObject=kl.prototype.he,t("ol.format.Feature",wl),t("ol.format.filter.and",hu),t("ol.format.filter.or",function(t){var e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(au,e))}),t("ol.format.filter.not",function(t){return new nu(t)}),t("ol.format.filter.bbox",lu),t("ol.format.filter.intersects",function(t,e,o){return new Ql(t,e,o)}),t("ol.format.filter.within",function(t,e,o){return new pu(t,e,o)}),t("ol.format.filter.equalTo",function(t,e,o){return new ql(t,e,o)}),t("ol.format.filter.notEqualTo",function(t,e,o){return new su(t,e,o)}),t("ol.format.filter.lessThan",function(t,e){return new iu(t,e)}),t("ol.format.filter.lessThanOrEqualTo",function(t,e){return new ru(t,e)}),t("ol.format.filter.greaterThan",function(t,e){return new Jl(t,e)}),t("ol.format.filter.greaterThanOrEqualTo",function(t,e){return new _l(t,e)}),t("ol.format.filter.isNull",function(t){return new ou(t)}),t("ol.format.filter.between",function(t,e,o){return new tu(t,e,o)}),t("ol.format.filter.like",function(t,e,o,i,r,n){return new eu(t,e,o,i,r,n)}),t("ol.format.filter.during",function(t,e,o){return new Yl(t,e,o)}),t("ol.format.GeoJSON",gu),gu.prototype.readFeature=gu.prototype.Tb,gu.prototype.readFeatures=gu.prototype.Oa,gu.prototype.readGeometry=gu.prototype.Sc,gu.prototype.readProjection=gu.prototype.kb,gu.prototype.writeFeature=gu.prototype.Bd,gu.prototype.writeFeatureObject=gu.prototype.Zc,gu.prototype.writeFeatures=gu.prototype.Wb,gu.prototype.writeFeaturesObject=gu.prototype.he,gu.prototype.writeGeometry=gu.prototype.$c,gu.prototype.writeGeometryObject=gu.prototype.je,t("ol.format.GML",y),y.prototype.writeFeatures=y.prototype.Wb,y.prototype.writeFeaturesNode=y.prototype.Xb,t("ol.format.GML2",Zu),t("ol.format.GML3",y),y.prototype.writeGeometryNode=y.prototype.ie,y.prototype.writeFeatures=y.prototype.Wb,y.prototype.writeFeaturesNode=y.prototype.Xb,Mu.prototype.readFeatures=Mu.prototype.Oa,t("ol.format.GPX",ec),ec.prototype.readFeature=ec.prototype.Tb,ec.prototype.readFeatures=ec.prototype.Oa,ec.prototype.readProjection=ec.prototype.kb,ec.prototype.writeFeatures=ec.prototype.Wb,ec.prototype.writeFeaturesNode=ec.prototype.Xb,t("ol.format.IGC",Uc),Uc.prototype.readFeature=Uc.prototype.Tb,Uc.prototype.readFeatures=Uc.prototype.Oa,Uc.prototype.readProjection=Uc.prototype.kb,t("ol.format.KML",hf),hf.prototype.readFeature=hf.prototype.Tb,hf.prototype.readFeatures=hf.prototype.Oa,hf.prototype.readName=hf.prototype.Cp,hf.prototype.readNetworkLinks=hf.prototype.Dp,hf.prototype.readRegion=hf.prototype.Gp,hf.prototype.readRegionFromNode=hf.prototype.lf,hf.prototype.readProjection=hf.prototype.kb,hf.prototype.writeFeatures=hf.prototype.Wb,hf.prototype.writeFeaturesNode=hf.prototype.Xb,t("ol.format.MVT",ag),ag.prototype.readFeatures=ag.prototype.Oa,ag.prototype.readProjection=ag.prototype.kb,ag.prototype.setLayers=ag.prototype.mn,t("ol.format.OSMXML",hg),hg.prototype.readFeatures=hg.prototype.Oa,hg.prototype.readProjection=hg.prototype.kb,t("ol.format.Polyline",Ig),t("ol.format.Polyline.encodeDeltas",Ng),t("ol.format.Polyline.decodeDeltas",Fg),t("ol.format.Polyline.encodeFloats",kg),t("ol.format.Polyline.decodeFloats",Dg),Ig.prototype.readFeature=Ig.prototype.Tb,Ig.prototype.readFeatures=Ig.prototype.Oa,Ig.prototype.readGeometry=Ig.prototype.Sc,Ig.prototype.readProjection=Ig.prototype.kb,Ig.prototype.writeGeometry=Ig.prototype.$c,t("ol.format.TopoJSON",Og),Og.prototype.readFeatures=Og.prototype.Oa,Og.prototype.readProjection=Og.prototype.kb,t("ol.format.WFS",Vg),Vg.prototype.readFeatures=Vg.prototype.Oa,Vg.prototype.readTransactionResponse=Vg.prototype.j,Vg.prototype.readFeatureCollectionMetadata=Vg.prototype.g,t("ol.format.WFS.writeFilter",function(t){var e=ol("http://www.opengis.net/ogc","Filter");return vl({node:e},pd,cl(t.kc),[t],[]),e}),Vg.prototype.writeGetFeature=Vg.prototype.l,Vg.prototype.writeTransaction=Vg.prototype.v,Vg.prototype.readProjection=Vg.prototype.kb,t("ol.format.WKT",hd),hd.prototype.readFeature=hd.prototype.Tb,hd.prototype.readFeatures=hd.prototype.Oa,hd.prototype.readGeometry=hd.prototype.Sc,hd.prototype.writeFeature=hd.prototype.Bd,hd.prototype.writeFeatures=hd.prototype.Wb,hd.prototype.writeGeometry=hd.prototype.$c,t("ol.format.WMSCapabilities",Ed),t("ol.format.WMSGetFeatureInfo",Hd),Hd.prototype.readFeatures=Hd.prototype.Oa,t("ol.format.WMTSCapabilities",qd),t("ol.format.filter.And",Zl),t("ol.format.filter.Bbox",Kl),t("ol.format.filter.Comparison",zl),t("ol.format.filter.ComparisonBinary",Hl),t("ol.format.filter.During",Yl),t("ol.format.filter.EqualTo",ql),t("ol.format.filter.Filter",Vl),t("ol.format.filter.GreaterThan",Jl),t("ol.format.filter.GreaterThanOrEqualTo",_l),t("ol.format.filter.Intersects",Ql),t("ol.format.filter.IsBetween",tu),t("ol.format.filter.IsLike",eu),t("ol.format.filter.IsNull",ou),t("ol.format.filter.LessThan",iu),t("ol.format.filter.LessThanOrEqualTo",ru),t("ol.format.filter.Not",nu),t("ol.format.filter.NotEqualTo",su),t("ol.format.filter.Or",au),t("ol.format.filter.Spatial",$l),t("ol.format.filter.Within",pu),t("ol.events.condition.altKeyOnly",function(t){return(t=t.originalEvent).altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey}),t("ol.events.condition.altShiftKeysOnly",yn),t("ol.events.condition.always",cr),t("ol.events.condition.click",function(t){return"click"==t.type}),t("ol.events.condition.never",fr),t("ol.events.condition.pointerMove",dn),t("ol.events.condition.singleClick",vn),t("ol.events.condition.doubleClick",function(t){return"dblclick"==t.type}),t("ol.events.condition.noModifierKeys",bn),t("ol.events.condition.platformModifierKeyOnly",function(t){return!(t=t.originalEvent).altKey&&(ri?t.metaKey:t.ctrlKey)&&!t.shiftKey}),t("ol.events.condition.shiftKeyOnly",mn),t("ol.events.condition.targetNotEditable",wn),t("ol.events.condition.mouseOnly",xn),t("ol.events.condition.primaryAction",Sn),t("ol.control.Attribution",jo),t("ol.control.Attribution.render",Co),jo.prototype.getCollapsible=jo.prototype.Um,jo.prototype.setCollapsible=jo.prototype.Xm,jo.prototype.setCollapsed=jo.prototype.Wm,jo.prototype.getCollapsed=jo.prototype.Tm,t("ol.control.Control",To),To.prototype.getMap=To.prototype.g,To.prototype.setTarget=To.prototype.f,t("ol.control.FullScreen",Go),t("ol.control.MousePosition",Ko),t("ol.control.MousePosition.render",zo),Ko.prototype.getCoordinateFormat=Ko.prototype.xh,Ko.prototype.getProjection=Ko.prototype.Zh,Ko.prototype.setCoordinateFormat=Ko.prototype.kj,Ko.prototype.setProjection=Ko.prototype.$h,t("ol.control.OverviewMap",Sh),t("ol.control.OverviewMap.render",Mh),Sh.prototype.getCollapsible=Sh.prototype.$m,Sh.prototype.setCollapsible=Sh.prototype.cn,Sh.prototype.setCollapsed=Sh.prototype.bn,Sh.prototype.getCollapsed=Sh.prototype.Zm,Sh.prototype.getOverviewMap=Sh.prototype.gl,t("ol.control.Rotate",ko),t("ol.control.Rotate.render",Do),t("ol.control.ScaleLine",Th),Th.prototype.getUnits=Th.prototype.C,t("ol.control.ScaleLine.render",Ch),Th.prototype.setUnits=Th.prototype.I,t("ol.control.Zoom",Oo),t("ol.control.ZoomSlider",Ih),t("ol.control.ZoomSlider.render",Fh),t("ol.control.ZoomToExtent",Oh),ro.prototype.changed=ro.prototype.s,ro.prototype.dispatchEvent=ro.prototype.b,ro.prototype.getRevision=ro.prototype.L,ro.prototype.on=ro.prototype.J,ro.prototype.un=ro.prototype.K,ho.prototype.getKeys=ho.prototype.O,ho.prototype.getProperties=ho.prototype.N,ho.prototype.setProperties=ho.prototype.H,ho.prototype.unset=ho.prototype.P,ho.prototype.changed=ho.prototype.s,ho.prototype.dispatchEvent=ho.prototype.b,ho.prototype.getRevision=ho.prototype.L,ho.prototype.on=ho.prototype.J,ho.prototype.un=ho.prototype.K,Uh.prototype.getKeys=Uh.prototype.O,Uh.prototype.getProperties=Uh.prototype.N,Uh.prototype.setProperties=Uh.prototype.H,Uh.prototype.unset=Uh.prototype.P,Uh.prototype.changed=Uh.prototype.s,Uh.prototype.dispatchEvent=Uh.prototype.b,Uh.prototype.getRevision=Uh.prototype.L,Uh.prototype.on=Uh.prototype.J,Uh.prototype.un=Uh.prototype.K,x.prototype.getKeys=x.prototype.O,x.prototype.getProperties=x.prototype.N,x.prototype.setProperties=x.prototype.H,x.prototype.unset=x.prototype.P,x.prototype.changed=x.prototype.s,x.prototype.dispatchEvent=x.prototype.b,x.prototype.getRevision=x.prototype.L,x.prototype.on=x.prototype.J,x.prototype.un=x.prototype.K,p0.prototype.getKeys=p0.prototype.O,p0.prototype.getProperties=p0.prototype.N,p0.prototype.setProperties=p0.prototype.H,p0.prototype.unset=p0.prototype.P,p0.prototype.changed=p0.prototype.s,p0.prototype.dispatchEvent=p0.prototype.b,p0.prototype.getRevision=p0.prototype.L,p0.prototype.on=p0.prototype.J,p0.prototype.un=p0.prototype.K,M0.prototype.getTileCoord=M0.prototype.f,u.prototype.getKeys=u.prototype.O,u.prototype.getProperties=u.prototype.N,u.prototype.setProperties=u.prototype.H,u.prototype.unset=u.prototype.P,u.prototype.changed=u.prototype.s,u.prototype.dispatchEvent=u.prototype.b,u.prototype.getRevision=u.prototype.L,u.prototype.on=u.prototype.J,u.prototype.un=u.prototype.K,fh.prototype.getKeys=fh.prototype.O,fh.prototype.getProperties=fh.prototype.N,fh.prototype.setProperties=fh.prototype.H,fh.prototype.unset=fh.prototype.P,fh.prototype.changed=fh.prototype.s,fh.prototype.dispatchEvent=fh.prototype.b,fh.prototype.getRevision=fh.prototype.L,fh.prototype.on=fh.prototype.J,fh.prototype.un=fh.prototype.K,S1.prototype.getTileCoord=S1.prototype.f,P1.prototype.getTileCoord=P1.prototype.f,h.prototype.getKeys=h.prototype.O,h.prototype.getProperties=h.prototype.N,h.prototype.setProperties=h.prototype.H,h.prototype.unset=h.prototype.P,h.prototype.changed=h.prototype.s,h.prototype.dispatchEvent=h.prototype.b,h.prototype.getRevision=h.prototype.L,h.prototype.on=h.prototype.J,h.prototype.un=h.prototype.K,E1.prototype.forEachTileCoord=E1.prototype.Rf,E1.prototype.getMaxZoom=E1.prototype.Ti,E1.prototype.getMinZoom=E1.prototype.Ui,E1.prototype.getOrigin=E1.prototype.Pc,E1.prototype.getResolution=E1.prototype.Da,E1.prototype.getResolutions=E1.prototype.Vi,E1.prototype.getTileCoordExtent=E1.prototype.Aa,E1.prototype.getTileCoordForCoordAndResolution=E1.prototype.Be,E1.prototype.getTileCoordForCoordAndZ=E1.prototype.bg,E1.prototype.getTileSize=E1.prototype.gb,E1.prototype.getZForResolution=E1.prototype.tc,Kh.prototype.getOpacity=Kh.prototype.Ze,Kh.prototype.getRotateWithView=Kh.prototype.$e,Kh.prototype.getRotation=Kh.prototype.af,Kh.prototype.getScale=Kh.prototype.bf,Kh.prototype.getSnapToPixel=Kh.prototype.Ae,Kh.prototype.setOpacity=Kh.prototype.td,Kh.prototype.setRotation=Kh.prototype.cf,Kh.prototype.setScale=Kh.prototype.ud,Yh.prototype.getAngle=Yh.prototype.Pi,Yh.prototype.getFill=Yh.prototype.Fa,Yh.prototype.getPoints=Yh.prototype.Qi,Yh.prototype.getRadius=Yh.prototype.Ri,Yh.prototype.getRadius2=Yh.prototype.Fh,Yh.prototype.getStroke=Yh.prototype.Ga,Yh.prototype.getOpacity=Yh.prototype.Ze,Yh.prototype.getRotateWithView=Yh.prototype.$e,Yh.prototype.getRotation=Yh.prototype.af,Yh.prototype.getScale=Yh.prototype.bf,Yh.prototype.getSnapToPixel=Yh.prototype.Ae,Yh.prototype.setOpacity=Yh.prototype.td,Yh.prototype.setRotation=Yh.prototype.cf,Yh.prototype.setScale=Yh.prototype.ud,af.prototype.getOpacity=af.prototype.Ze,af.prototype.getRotateWithView=af.prototype.$e,af.prototype.getRotation=af.prototype.af,af.prototype.getScale=af.prototype.bf,af.prototype.getSnapToPixel=af.prototype.Ae,af.prototype.setOpacity=af.prototype.td,af.prototype.setRotation=af.prototype.cf,af.prototype.setScale=af.prototype.ud,Lv.prototype.getKeys=Lv.prototype.O,Lv.prototype.getProperties=Lv.prototype.N,Lv.prototype.setProperties=Lv.prototype.H,Lv.prototype.unset=Lv.prototype.P,Lv.prototype.changed=Lv.prototype.s,Lv.prototype.dispatchEvent=Lv.prototype.b,Lv.prototype.getRevision=Lv.prototype.L,Lv.prototype.on=Lv.prototype.J,Lv.prototype.un=Lv.prototype.K,jm.prototype.getAttributions=jm.prototype.ya,jm.prototype.getLogo=jm.prototype.xa,jm.prototype.getProjection=jm.prototype.za,jm.prototype.refresh=jm.prototype.sa,jm.prototype.setAttributions=jm.prototype.ua,jm.prototype.getKeys=jm.prototype.O,jm.prototype.getProperties=jm.prototype.N,jm.prototype.setProperties=jm.prototype.H,jm.prototype.unset=jm.prototype.P,jm.prototype.changed=jm.prototype.s,jm.prototype.dispatchEvent=jm.prototype.b,jm.prototype.getRevision=jm.prototype.L,jm.prototype.on=jm.prototype.J,jm.prototype.un=jm.prototype.K,Nm.prototype.getTileGrid=Nm.prototype.ab,Nm.prototype.refresh=Nm.prototype.sa,Nm.prototype.getAttributions=Nm.prototype.ya,Nm.prototype.getLogo=Nm.prototype.xa,Nm.prototype.getProjection=Nm.prototype.za,Nm.prototype.setAttributions=Nm.prototype.ua,Nm.prototype.getKeys=Nm.prototype.O,Nm.prototype.getProperties=Nm.prototype.N,Nm.prototype.setProperties=Nm.prototype.H,Nm.prototype.unset=Nm.prototype.P,Nm.prototype.changed=Nm.prototype.s,Nm.prototype.dispatchEvent=Nm.prototype.b,Nm.prototype.getRevision=Nm.prototype.L,Nm.prototype.on=Nm.prototype.J,Nm.prototype.un=Nm.prototype.K,T.prototype.getTileLoadFunction=T.prototype.pb,T.prototype.getTileUrlFunction=T.prototype.qb,T.prototype.getUrls=T.prototype.rb,T.prototype.setTileLoadFunction=T.prototype.vb,T.prototype.setTileUrlFunction=T.prototype.cb,T.prototype.setUrl=T.prototype.jb,T.prototype.setUrls=T.prototype.eb,T.prototype.getTileGrid=T.prototype.ab,T.prototype.refresh=T.prototype.sa,T.prototype.getAttributions=T.prototype.ya,T.prototype.getLogo=T.prototype.xa,T.prototype.getProjection=T.prototype.za,T.prototype.setAttributions=T.prototype.ua,T.prototype.getKeys=T.prototype.O,T.prototype.getProperties=T.prototype.N,T.prototype.setProperties=T.prototype.H,T.prototype.unset=T.prototype.P,T.prototype.changed=T.prototype.s,T.prototype.dispatchEvent=T.prototype.b,T.prototype.getRevision=T.prototype.L,T.prototype.on=T.prototype.J,T.prototype.un=T.prototype.K,j.prototype.setRenderReprojectionEdges=j.prototype.Pb,j.prototype.setTileGridForProjection=j.prototype.Qb,j.prototype.getTileLoadFunction=j.prototype.pb,j.prototype.getTileUrlFunction=j.prototype.qb,j.prototype.getUrls=j.prototype.rb,j.prototype.setTileLoadFunction=j.prototype.vb,j.prototype.setTileUrlFunction=j.prototype.cb,j.prototype.setUrl=j.prototype.jb,j.prototype.setUrls=j.prototype.eb,j.prototype.getTileGrid=j.prototype.ab,j.prototype.refresh=j.prototype.sa,j.prototype.getAttributions=j.prototype.ya,j.prototype.getLogo=j.prototype.xa,j.prototype.getProjection=j.prototype.za,j.prototype.setAttributions=j.prototype.ua,j.prototype.getKeys=j.prototype.O,j.prototype.getProperties=j.prototype.N,j.prototype.setProperties=j.prototype.H,j.prototype.unset=j.prototype.P,j.prototype.changed=j.prototype.s,j.prototype.dispatchEvent=j.prototype.b,j.prototype.getRevision=j.prototype.L,j.prototype.on=j.prototype.J,j.prototype.un=j.prototype.K,Um.prototype.setRenderReprojectionEdges=Um.prototype.Pb,Um.prototype.setTileGridForProjection=Um.prototype.Qb,Um.prototype.getTileLoadFunction=Um.prototype.pb,Um.prototype.getTileUrlFunction=Um.prototype.qb,Um.prototype.getUrls=Um.prototype.rb,Um.prototype.setTileLoadFunction=Um.prototype.vb,Um.prototype.setTileUrlFunction=Um.prototype.cb,Um.prototype.setUrl=Um.prototype.jb,Um.prototype.setUrls=Um.prototype.eb,Um.prototype.getTileGrid=Um.prototype.ab,Um.prototype.refresh=Um.prototype.sa,Um.prototype.getAttributions=Um.prototype.ya,Um.prototype.getLogo=Um.prototype.xa,Um.prototype.getProjection=Um.prototype.za,Um.prototype.setAttributions=Um.prototype.ua,Um.prototype.getKeys=Um.prototype.O,Um.prototype.getProperties=Um.prototype.N,Um.prototype.setProperties=Um.prototype.H,Um.prototype.unset=Um.prototype.P,Um.prototype.changed=Um.prototype.s,Um.prototype.dispatchEvent=Um.prototype.b,Um.prototype.getRevision=Um.prototype.L,Um.prototype.on=Um.prototype.J,Um.prototype.un=Um.prototype.K,C.prototype.setRenderReprojectionEdges=C.prototype.Pb,C.prototype.setTileGridForProjection=C.prototype.Qb,C.prototype.getTileLoadFunction=C.prototype.pb,C.prototype.getTileUrlFunction=C.prototype.qb,C.prototype.getUrls=C.prototype.rb,C.prototype.setTileLoadFunction=C.prototype.vb,C.prototype.setTileUrlFunction=C.prototype.cb,C.prototype.setUrl=C.prototype.jb,C.prototype.setUrls=C.prototype.eb,C.prototype.getTileGrid=C.prototype.ab,C.prototype.refresh=C.prototype.sa,C.prototype.getAttributions=C.prototype.ya,C.prototype.getLogo=C.prototype.xa,C.prototype.getProjection=C.prototype.za,C.prototype.setAttributions=C.prototype.ua,C.prototype.getKeys=C.prototype.O,C.prototype.getProperties=C.prototype.N,C.prototype.setProperties=C.prototype.H,C.prototype.unset=C.prototype.P,C.prototype.changed=C.prototype.s,C.prototype.dispatchEvent=C.prototype.b,C.prototype.getRevision=C.prototype.L,C.prototype.on=C.prototype.J,C.prototype.un=C.prototype.K,a.prototype.getAttributions=a.prototype.ya,a.prototype.getLogo=a.prototype.xa,a.prototype.getProjection=a.prototype.za,a.prototype.refresh=a.prototype.sa,a.prototype.setAttributions=a.prototype.ua,a.prototype.getKeys=a.prototype.O,a.prototype.getProperties=a.prototype.N,a.prototype.setProperties=a.prototype.H,a.prototype.unset=a.prototype.P,a.prototype.changed=a.prototype.s,a.prototype.dispatchEvent=a.prototype.b,a.prototype.getRevision=a.prototype.L,a.prototype.on=a.prototype.J,a.prototype.un=a.prototype.K,L.prototype.addFeature=L.prototype.yb,L.prototype.addFeatures=L.prototype.cd,L.prototype.forEachFeature=L.prototype.sh,L.prototype.forEachFeatureInExtent=L.prototype.$b,L.prototype.forEachFeatureIntersectingExtent=L.prototype.th,L.prototype.getFeaturesCollection=L.prototype.Ah,L.prototype.getFeatures=L.prototype.Xe,L.prototype.getFeaturesAtCoordinate=L.prototype.zh,L.prototype.getFeaturesInExtent=L.prototype.Uf,L.prototype.getClosestFeatureToCoordinate=L.prototype.vh,L.prototype.getExtent=L.prototype.G,L.prototype.getFeatureById=L.prototype.yh,L.prototype.getFormat=L.prototype.Mi,L.prototype.getUrl=L.prototype.Ni,L.prototype.removeFeature=L.prototype.Gb,L.prototype.getAttributions=L.prototype.ya,L.prototype.getLogo=L.prototype.xa,L.prototype.getProjection=L.prototype.za,L.prototype.refresh=L.prototype.sa,L.prototype.setAttributions=L.prototype.ua,L.prototype.getKeys=L.prototype.O,L.prototype.getProperties=L.prototype.N,L.prototype.setProperties=L.prototype.H,L.prototype.unset=L.prototype.P,L.prototype.changed=L.prototype.s,L.prototype.dispatchEvent=L.prototype.b,L.prototype.getRevision=L.prototype.L,L.prototype.on=L.prototype.J,L.prototype.un=L.prototype.K,$b.prototype.getAttributions=$b.prototype.ya,$b.prototype.getLogo=$b.prototype.xa,$b.prototype.getProjection=$b.prototype.za,$b.prototype.refresh=$b.prototype.sa,$b.prototype.setAttributions=$b.prototype.ua,$b.prototype.getKeys=$b.prototype.O,$b.prototype.getProperties=$b.prototype.N,$b.prototype.setProperties=$b.prototype.H,$b.prototype.unset=$b.prototype.P,$b.prototype.changed=$b.prototype.s,$b.prototype.dispatchEvent=$b.prototype.b,$b.prototype.getRevision=$b.prototype.L,$b.prototype.on=$b.prototype.J,$b.prototype.un=$b.prototype.K,Wm.prototype.getAttributions=Wm.prototype.ya,Wm.prototype.getLogo=Wm.prototype.xa,Wm.prototype.getProjection=Wm.prototype.za,Wm.prototype.refresh=Wm.prototype.sa,Wm.prototype.setAttributions=Wm.prototype.ua,Wm.prototype.getKeys=Wm.prototype.O,Wm.prototype.getProperties=Wm.prototype.N,Wm.prototype.setProperties=Wm.prototype.H,Wm.prototype.unset=Wm.prototype.P,Wm.prototype.changed=Wm.prototype.s,Wm.prototype.dispatchEvent=Wm.prototype.b,Wm.prototype.getRevision=Wm.prototype.L,Wm.prototype.on=Wm.prototype.J,Wm.prototype.un=Wm.prototype.K,nm.prototype.getAttributions=nm.prototype.ya,nm.prototype.getLogo=nm.prototype.xa,nm.prototype.getProjection=nm.prototype.za,nm.prototype.refresh=nm.prototype.sa,nm.prototype.setAttributions=nm.prototype.ua,nm.prototype.getKeys=nm.prototype.O,nm.prototype.getProperties=nm.prototype.N,nm.prototype.setProperties=nm.prototype.H,nm.prototype.unset=nm.prototype.P,nm.prototype.changed=nm.prototype.s,nm.prototype.dispatchEvent=nm.prototype.b,nm.prototype.getRevision=nm.prototype.L,nm.prototype.on=nm.prototype.J,nm.prototype.un=nm.prototype.K,Zm.prototype.getAttributions=Zm.prototype.ya,Zm.prototype.getLogo=Zm.prototype.xa,Zm.prototype.getProjection=Zm.prototype.za,Zm.prototype.refresh=Zm.prototype.sa,Zm.prototype.setAttributions=Zm.prototype.ua,Zm.prototype.getKeys=Zm.prototype.O,Zm.prototype.getProperties=Zm.prototype.N,Zm.prototype.setProperties=Zm.prototype.H,Zm.prototype.unset=Zm.prototype.P,Zm.prototype.changed=Zm.prototype.s,Zm.prototype.dispatchEvent=Zm.prototype.b,Zm.prototype.getRevision=Zm.prototype.L,Zm.prototype.on=Zm.prototype.J,Zm.prototype.un=Zm.prototype.K,Km.prototype.getAttributions=Km.prototype.ya,Km.prototype.getLogo=Km.prototype.xa,Km.prototype.getProjection=Km.prototype.za,Km.prototype.refresh=Km.prototype.sa,Km.prototype.setAttributions=Km.prototype.ua,Km.prototype.getKeys=Km.prototype.O,Km.prototype.getProperties=Km.prototype.N,Km.prototype.setProperties=Km.prototype.H,Km.prototype.unset=Km.prototype.P,Km.prototype.changed=Km.prototype.s,Km.prototype.dispatchEvent=Km.prototype.b,Km.prototype.getRevision=Km.prototype.L,Km.prototype.on=Km.prototype.J,Km.prototype.un=Km.prototype.K,sm.prototype.getAttributions=sm.prototype.ya,sm.prototype.getLogo=sm.prototype.xa,sm.prototype.getProjection=sm.prototype.za,sm.prototype.refresh=sm.prototype.sa,sm.prototype.setAttributions=sm.prototype.ua,sm.prototype.getKeys=sm.prototype.O,sm.prototype.getProperties=sm.prototype.N,sm.prototype.setProperties=sm.prototype.H,sm.prototype.unset=sm.prototype.P,sm.prototype.changed=sm.prototype.s,sm.prototype.dispatchEvent=sm.prototype.b,sm.prototype.getRevision=sm.prototype.L,sm.prototype.on=sm.prototype.J,sm.prototype.un=sm.prototype.K,zm.prototype.getAttributions=zm.prototype.ya,zm.prototype.getLogo=zm.prototype.xa,zm.prototype.getProjection=zm.prototype.za,zm.prototype.refresh=zm.prototype.sa,zm.prototype.setAttributions=zm.prototype.ua,zm.prototype.getKeys=zm.prototype.O,zm.prototype.getProperties=zm.prototype.N,zm.prototype.setProperties=zm.prototype.H,zm.prototype.unset=zm.prototype.P,zm.prototype.changed=zm.prototype.s,zm.prototype.dispatchEvent=zm.prototype.b,zm.prototype.getRevision=zm.prototype.L,zm.prototype.on=zm.prototype.J,zm.prototype.un=zm.prototype.K,Jm.prototype.setRenderReprojectionEdges=Jm.prototype.Pb,Jm.prototype.setTileGridForProjection=Jm.prototype.Qb,Jm.prototype.getTileLoadFunction=Jm.prototype.pb,Jm.prototype.getTileUrlFunction=Jm.prototype.qb,Jm.prototype.getUrls=Jm.prototype.rb,Jm.prototype.setTileLoadFunction=Jm.prototype.vb,Jm.prototype.setTileUrlFunction=Jm.prototype.cb,Jm.prototype.setUrl=Jm.prototype.jb,Jm.prototype.setUrls=Jm.prototype.eb,Jm.prototype.getTileGrid=Jm.prototype.ab,Jm.prototype.refresh=Jm.prototype.sa,Jm.prototype.getAttributions=Jm.prototype.ya,Jm.prototype.getLogo=Jm.prototype.xa,Jm.prototype.getProjection=Jm.prototype.za,Jm.prototype.setAttributions=Jm.prototype.ua,Jm.prototype.getKeys=Jm.prototype.O,Jm.prototype.getProperties=Jm.prototype.N,Jm.prototype.setProperties=Jm.prototype.H,Jm.prototype.unset=Jm.prototype.P,Jm.prototype.changed=Jm.prototype.s,Jm.prototype.dispatchEvent=Jm.prototype.b,Jm.prototype.getRevision=Jm.prototype.L,Jm.prototype.on=Jm.prototype.J,Jm.prototype.un=Jm.prototype.K,o1.prototype.getAttributions=o1.prototype.ya,o1.prototype.getLogo=o1.prototype.xa,o1.prototype.getProjection=o1.prototype.za,o1.prototype.refresh=o1.prototype.sa,o1.prototype.setAttributions=o1.prototype.ua,o1.prototype.getKeys=o1.prototype.O,o1.prototype.getProperties=o1.prototype.N,o1.prototype.setProperties=o1.prototype.H,o1.prototype.unset=o1.prototype.P,o1.prototype.changed=o1.prototype.s,o1.prototype.dispatchEvent=o1.prototype.b,o1.prototype.getRevision=o1.prototype.L,o1.prototype.on=o1.prototype.J,o1.prototype.un=o1.prototype.K,a1.prototype.setRenderReprojectionEdges=a1.prototype.Pb,a1.prototype.setTileGridForProjection=a1.prototype.Qb,a1.prototype.getTileLoadFunction=a1.prototype.pb,a1.prototype.getTileUrlFunction=a1.prototype.qb,a1.prototype.getUrls=a1.prototype.rb,a1.prototype.setTileLoadFunction=a1.prototype.vb,a1.prototype.setTileUrlFunction=a1.prototype.cb,a1.prototype.setUrl=a1.prototype.jb,a1.prototype.setUrls=a1.prototype.eb,a1.prototype.getTileGrid=a1.prototype.ab,a1.prototype.refresh=a1.prototype.sa,a1.prototype.getAttributions=a1.prototype.ya,a1.prototype.getLogo=a1.prototype.xa,a1.prototype.getProjection=a1.prototype.za,a1.prototype.setAttributions=a1.prototype.ua,a1.prototype.getKeys=a1.prototype.O,a1.prototype.getProperties=a1.prototype.N,a1.prototype.setProperties=a1.prototype.H,a1.prototype.unset=a1.prototype.P,a1.prototype.changed=a1.prototype.s,a1.prototype.dispatchEvent=a1.prototype.b,a1.prototype.getRevision=a1.prototype.L,a1.prototype.on=a1.prototype.J,a1.prototype.un=a1.prototype.K,R.prototype.setRenderReprojectionEdges=R.prototype.Pb,R.prototype.setTileGridForProjection=R.prototype.Qb,R.prototype.getTileLoadFunction=R.prototype.pb,R.prototype.getTileUrlFunction=R.prototype.qb,R.prototype.getUrls=R.prototype.rb,R.prototype.setTileLoadFunction=R.prototype.vb,R.prototype.setTileUrlFunction=R.prototype.cb,R.prototype.setUrl=R.prototype.jb,R.prototype.setUrls=R.prototype.eb,R.prototype.getTileGrid=R.prototype.ab,R.prototype.refresh=R.prototype.sa,R.prototype.getAttributions=R.prototype.ya,R.prototype.getLogo=R.prototype.xa,R.prototype.getProjection=R.prototype.za,R.prototype.setAttributions=R.prototype.ua,R.prototype.getKeys=R.prototype.O,R.prototype.getProperties=R.prototype.N,R.prototype.setProperties=R.prototype.H,R.prototype.unset=R.prototype.P,R.prototype.changed=R.prototype.s,R.prototype.dispatchEvent=R.prototype.b,R.prototype.getRevision=R.prototype.L,R.prototype.on=R.prototype.J,R.prototype.un=R.prototype.K,c1.prototype.getTileGrid=c1.prototype.ab,c1.prototype.refresh=c1.prototype.sa,c1.prototype.getAttributions=c1.prototype.ya,c1.prototype.getLogo=c1.prototype.xa,c1.prototype.getProjection=c1.prototype.za,c1.prototype.setAttributions=c1.prototype.ua,c1.prototype.getKeys=c1.prototype.O,c1.prototype.getProperties=c1.prototype.N,c1.prototype.setProperties=c1.prototype.H,c1.prototype.unset=c1.prototype.P,c1.prototype.changed=c1.prototype.s,c1.prototype.dispatchEvent=c1.prototype.b,c1.prototype.getRevision=c1.prototype.L,c1.prototype.on=c1.prototype.J,c1.prototype.un=c1.prototype.K,y1.prototype.setRenderReprojectionEdges=y1.prototype.Pb,y1.prototype.setTileGridForProjection=y1.prototype.Qb,y1.prototype.getTileLoadFunction=y1.prototype.pb,y1.prototype.getTileUrlFunction=y1.prototype.qb,y1.prototype.getUrls=y1.prototype.rb,y1.prototype.setTileLoadFunction=y1.prototype.vb,y1.prototype.setTileUrlFunction=y1.prototype.cb,y1.prototype.setUrl=y1.prototype.jb,y1.prototype.setUrls=y1.prototype.eb,y1.prototype.getTileGrid=y1.prototype.ab,y1.prototype.refresh=y1.prototype.sa,y1.prototype.getAttributions=y1.prototype.ya,y1.prototype.getLogo=y1.prototype.xa,y1.prototype.getProjection=y1.prototype.za,y1.prototype.setAttributions=y1.prototype.ua,y1.prototype.getKeys=y1.prototype.O,y1.prototype.getProperties=y1.prototype.N,y1.prototype.setProperties=y1.prototype.H,y1.prototype.unset=y1.prototype.P,y1.prototype.changed=y1.prototype.s,y1.prototype.dispatchEvent=y1.prototype.b,y1.prototype.getRevision=y1.prototype.L,y1.prototype.on=y1.prototype.J,y1.prototype.un=y1.prototype.K,g1.prototype.getTileGrid=g1.prototype.ab,g1.prototype.refresh=g1.prototype.sa,g1.prototype.getAttributions=g1.prototype.ya,g1.prototype.getLogo=g1.prototype.xa,g1.prototype.getProjection=g1.prototype.za,g1.prototype.setAttributions=g1.prototype.ua,g1.prototype.getKeys=g1.prototype.O,g1.prototype.getProperties=g1.prototype.N,g1.prototype.setProperties=g1.prototype.H,g1.prototype.unset=g1.prototype.P,g1.prototype.changed=g1.prototype.s,g1.prototype.dispatchEvent=g1.prototype.b,g1.prototype.getRevision=g1.prototype.L,g1.prototype.on=g1.prototype.J,g1.prototype.un=g1.prototype.K,I.prototype.setRenderReprojectionEdges=I.prototype.Pb,I.prototype.setTileGridForProjection=I.prototype.Qb,I.prototype.getTileLoadFunction=I.prototype.pb,I.prototype.getTileUrlFunction=I.prototype.qb,I.prototype.getUrls=I.prototype.rb,I.prototype.setTileLoadFunction=I.prototype.vb,I.prototype.setTileUrlFunction=I.prototype.cb,I.prototype.setUrl=I.prototype.jb,I.prototype.setUrls=I.prototype.eb,I.prototype.getTileGrid=I.prototype.ab,I.prototype.refresh=I.prototype.sa,I.prototype.getAttributions=I.prototype.ya,I.prototype.getLogo=I.prototype.xa,I.prototype.getProjection=I.prototype.za,I.prototype.setAttributions=I.prototype.ua,I.prototype.getKeys=I.prototype.O,I.prototype.getProperties=I.prototype.N,I.prototype.setProperties=I.prototype.H,I.prototype.unset=I.prototype.P,I.prototype.changed=I.prototype.s,I.prototype.dispatchEvent=I.prototype.b,I.prototype.getRevision=I.prototype.L,I.prototype.on=I.prototype.J,I.prototype.un=I.prototype.K,A1.prototype.getTileLoadFunction=A1.prototype.pb,A1.prototype.getTileUrlFunction=A1.prototype.qb,A1.prototype.getUrls=A1.prototype.rb,A1.prototype.setTileLoadFunction=A1.prototype.vb,A1.prototype.setTileUrlFunction=A1.prototype.cb,A1.prototype.setUrl=A1.prototype.jb,A1.prototype.setUrls=A1.prototype.eb,A1.prototype.getTileGrid=A1.prototype.ab,A1.prototype.refresh=A1.prototype.sa,A1.prototype.getAttributions=A1.prototype.ya,A1.prototype.getLogo=A1.prototype.xa,A1.prototype.getProjection=A1.prototype.za,A1.prototype.setAttributions=A1.prototype.ua,A1.prototype.getKeys=A1.prototype.O,A1.prototype.getProperties=A1.prototype.N,A1.prototype.setProperties=A1.prototype.H,A1.prototype.unset=A1.prototype.P,A1.prototype.changed=A1.prototype.s,A1.prototype.dispatchEvent=A1.prototype.b,A1.prototype.getRevision=A1.prototype.L,A1.prototype.on=A1.prototype.J,A1.prototype.un=A1.prototype.K,N.prototype.setRenderReprojectionEdges=N.prototype.Pb,N.prototype.setTileGridForProjection=N.prototype.Qb,N.prototype.getTileLoadFunction=N.prototype.pb,N.prototype.getTileUrlFunction=N.prototype.qb,N.prototype.getUrls=N.prototype.rb,N.prototype.setTileLoadFunction=N.prototype.vb,N.prototype.setTileUrlFunction=N.prototype.cb,N.prototype.setUrl=N.prototype.jb,N.prototype.setUrls=N.prototype.eb,N.prototype.getTileGrid=N.prototype.ab,N.prototype.refresh=N.prototype.sa,N.prototype.getAttributions=N.prototype.ya,N.prototype.getLogo=N.prototype.xa,N.prototype.getProjection=N.prototype.za,N.prototype.setAttributions=N.prototype.ua,N.prototype.getKeys=N.prototype.O,N.prototype.getProperties=N.prototype.N,N.prototype.setProperties=N.prototype.H,N.prototype.unset=N.prototype.P,N.prototype.changed=N.prototype.s,N.prototype.dispatchEvent=N.prototype.b,N.prototype.getRevision=N.prototype.L,N.prototype.on=N.prototype.J,N.prototype.un=N.prototype.K,C1.prototype.setRenderReprojectionEdges=C1.prototype.Pb,C1.prototype.setTileGridForProjection=C1.prototype.Qb,C1.prototype.getTileLoadFunction=C1.prototype.pb,C1.prototype.getTileUrlFunction=C1.prototype.qb,C1.prototype.getUrls=C1.prototype.rb,C1.prototype.setTileLoadFunction=C1.prototype.vb,C1.prototype.setTileUrlFunction=C1.prototype.cb,C1.prototype.setUrl=C1.prototype.jb,C1.prototype.setUrls=C1.prototype.eb,C1.prototype.getTileGrid=C1.prototype.ab,C1.prototype.refresh=C1.prototype.sa,C1.prototype.getAttributions=C1.prototype.ya,C1.prototype.getLogo=C1.prototype.xa,C1.prototype.getProjection=C1.prototype.za,C1.prototype.setAttributions=C1.prototype.ua,C1.prototype.getKeys=C1.prototype.O,C1.prototype.getProperties=C1.prototype.N,C1.prototype.setProperties=C1.prototype.H,C1.prototype.unset=C1.prototype.P,C1.prototype.changed=C1.prototype.s,C1.prototype.dispatchEvent=C1.prototype.b,C1.prototype.getRevision=C1.prototype.L,C1.prototype.on=C1.prototype.J,C1.prototype.un=C1.prototype.K,xm.prototype.getTileCoord=xm.prototype.f,iv.prototype.changed=iv.prototype.s,iv.prototype.dispatchEvent=iv.prototype.b,iv.prototype.getRevision=iv.prototype.L,iv.prototype.on=iv.prototype.J,iv.prototype.un=iv.prototype.K,Av.prototype.changed=Av.prototype.s,Av.prototype.dispatchEvent=Av.prototype.b,Av.prototype.getRevision=Av.prototype.L,Av.prototype.on=Av.prototype.J,Av.prototype.un=Av.prototype.K,am.prototype.changed=am.prototype.s,am.prototype.dispatchEvent=am.prototype.b,am.prototype.getRevision=am.prototype.L,am.prototype.on=am.prototype.J,am.prototype.un=am.prototype.K,dm.prototype.changed=dm.prototype.s,dm.prototype.dispatchEvent=dm.prototype.b,dm.prototype.getRevision=dm.prototype.L,dm.prototype.on=dm.prototype.J,dm.prototype.un=dm.prototype.K,Tv.prototype.changed=Tv.prototype.s,Tv.prototype.dispatchEvent=Tv.prototype.b,Tv.prototype.getRevision=Tv.prototype.L,Tv.prototype.on=Tv.prototype.J,Tv.prototype.un=Tv.prototype.K,uv.prototype.changed=uv.prototype.s,uv.prototype.dispatchEvent=uv.prototype.b,uv.prototype.getRevision=uv.prototype.L,uv.prototype.on=uv.prototype.J,uv.prototype.un=uv.prototype.K,Zb.prototype.changed=Zb.prototype.s,Zb.prototype.dispatchEvent=Zb.prototype.b,Zb.prototype.getRevision=Zb.prototype.L,Zb.prototype.on=Zb.prototype.J,Zb.prototype.un=Zb.prototype.K,Kb.prototype.changed=Kb.prototype.s,Kb.prototype.dispatchEvent=Kb.prototype.b,Kb.prototype.getRevision=Kb.prototype.L,Kb.prototype.on=Kb.prototype.J,Kb.prototype.un=Kb.prototype.K,hm.prototype.changed=hm.prototype.s,hm.prototype.dispatchEvent=hm.prototype.b,hm.prototype.getRevision=hm.prototype.L,hm.prototype.on=hm.prototype.J,hm.prototype.un=hm.prototype.K,mv.prototype.changed=mv.prototype.s,mv.prototype.dispatchEvent=mv.prototype.b,mv.prototype.getRevision=mv.prototype.L,mv.prototype.on=mv.prototype.J,mv.prototype.un=mv.prototype.K,vm.prototype.changed=vm.prototype.s,vm.prototype.dispatchEvent=vm.prototype.b,vm.prototype.getRevision=vm.prototype.L,vm.prototype.on=vm.prototype.J,vm.prototype.un=vm.prototype.K,ls.prototype.getKeys=ls.prototype.O,ls.prototype.getProperties=ls.prototype.N,ls.prototype.setProperties=ls.prototype.H,ls.prototype.unset=ls.prototype.P,ls.prototype.changed=ls.prototype.s,ls.prototype.dispatchEvent=ls.prototype.b,ls.prototype.getRevision=ls.prototype.L,ls.prototype.on=ls.prototype.J,ls.prototype.un=ls.prototype.K,cs.prototype.getExtent=cs.prototype.G,cs.prototype.getMaxResolution=cs.prototype.fc,cs.prototype.getMinResolution=cs.prototype.gc,cs.prototype.getOpacity=cs.prototype.hc,cs.prototype.getVisible=cs.prototype.Mb,cs.prototype.getZIndex=cs.prototype.Ba,cs.prototype.setExtent=cs.prototype.vc,cs.prototype.setMaxResolution=cs.prototype.Ac,cs.prototype.setMinResolution=cs.prototype.Bc,cs.prototype.setOpacity=cs.prototype.wc,cs.prototype.setVisible=cs.prototype.xc,cs.prototype.setZIndex=cs.prototype.Vb,cs.prototype.getKeys=cs.prototype.O,cs.prototype.getProperties=cs.prototype.N,cs.prototype.setProperties=cs.prototype.H,cs.prototype.unset=cs.prototype.P,cs.prototype.changed=cs.prototype.s,cs.prototype.dispatchEvent=cs.prototype.b,cs.prototype.getRevision=cs.prototype.L,cs.prototype.on=cs.prototype.J,cs.prototype.un=cs.prototype.K,ys.prototype.getExtent=ys.prototype.G,ys.prototype.getMaxResolution=ys.prototype.fc,ys.prototype.getMinResolution=ys.prototype.gc,ys.prototype.getOpacity=ys.prototype.hc,ys.prototype.getVisible=ys.prototype.Mb,ys.prototype.getZIndex=ys.prototype.Ba,ys.prototype.setExtent=ys.prototype.vc,ys.prototype.setMaxResolution=ys.prototype.Ac,ys.prototype.setMinResolution=ys.prototype.Bc,ys.prototype.setOpacity=ys.prototype.wc,ys.prototype.setVisible=ys.prototype.xc,ys.prototype.setZIndex=ys.prototype.Vb,ys.prototype.getKeys=ys.prototype.O,ys.prototype.getProperties=ys.prototype.N,ys.prototype.setProperties=ys.prototype.H,ys.prototype.unset=ys.prototype.P,ys.prototype.changed=ys.prototype.s,ys.prototype.dispatchEvent=ys.prototype.b,ys.prototype.getRevision=ys.prototype.L,ys.prototype.on=ys.prototype.J,ys.prototype.un=ys.prototype.K,s.prototype.setSource=s.prototype.Wc,s.prototype.getExtent=s.prototype.G,s.prototype.getMaxResolution=s.prototype.fc,s.prototype.getMinResolution=s.prototype.gc,s.prototype.getOpacity=s.prototype.hc,s.prototype.getVisible=s.prototype.Mb,s.prototype.getZIndex=s.prototype.Ba,s.prototype.setExtent=s.prototype.vc,s.prototype.setMaxResolution=s.prototype.Ac,s.prototype.setMinResolution=s.prototype.Bc,s.prototype.setOpacity=s.prototype.wc,s.prototype.setVisible=s.prototype.xc,s.prototype.setZIndex=s.prototype.Vb,s.prototype.getKeys=s.prototype.O,s.prototype.getProperties=s.prototype.N,s.prototype.setProperties=s.prototype.H,s.prototype.unset=s.prototype.P,s.prototype.changed=s.prototype.s,s.prototype.dispatchEvent=s.prototype.b,s.prototype.getRevision=s.prototype.L,s.prototype.on=s.prototype.J,s.prototype.un=s.prototype.K,p.prototype.getSource=p.prototype.ha,p.prototype.getStyle=p.prototype.D,p.prototype.getStyleFunction=p.prototype.C,p.prototype.setStyle=p.prototype.g,p.prototype.setSource=p.prototype.Wc,p.prototype.getExtent=p.prototype.G,p.prototype.getMaxResolution=p.prototype.fc,p.prototype.getMinResolution=p.prototype.gc,p.prototype.getOpacity=p.prototype.hc,p.prototype.getVisible=p.prototype.Mb,p.prototype.getZIndex=p.prototype.Ba,p.prototype.setExtent=p.prototype.vc,p.prototype.setMaxResolution=p.prototype.Ac,p.prototype.setMinResolution=p.prototype.Bc,p.prototype.setOpacity=p.prototype.wc,p.prototype.setVisible=p.prototype.xc,p.prototype.setZIndex=p.prototype.Vb,p.prototype.getKeys=p.prototype.O,p.prototype.getProperties=p.prototype.N,p.prototype.setProperties=p.prototype.H,p.prototype.unset=p.prototype.P,p.prototype.changed=p.prototype.s,p.prototype.dispatchEvent=p.prototype.b,p.prototype.getRevision=p.prototype.L,p.prototype.on=p.prototype.J,p.prototype.un=p.prototype.K,pm.prototype.setSource=pm.prototype.Wc,pm.prototype.getExtent=pm.prototype.G,pm.prototype.getMaxResolution=pm.prototype.fc,pm.prototype.getMinResolution=pm.prototype.gc,pm.prototype.getOpacity=pm.prototype.hc,pm.prototype.getVisible=pm.prototype.Mb,pm.prototype.getZIndex=pm.prototype.Ba,pm.prototype.setExtent=pm.prototype.vc,pm.prototype.setMaxResolution=pm.prototype.Ac,pm.prototype.setMinResolution=pm.prototype.Bc,pm.prototype.setOpacity=pm.prototype.wc,pm.prototype.setVisible=pm.prototype.xc,pm.prototype.setZIndex=pm.prototype.Vb,pm.prototype.getKeys=pm.prototype.O,pm.prototype.getProperties=pm.prototype.N,pm.prototype.setProperties=pm.prototype.H,pm.prototype.unset=pm.prototype.P,pm.prototype.changed=pm.prototype.s,pm.prototype.dispatchEvent=pm.prototype.b,pm.prototype.getRevision=pm.prototype.L,pm.prototype.on=pm.prototype.J,pm.prototype.un=pm.prototype.K,A.prototype.setSource=A.prototype.Wc,A.prototype.getExtent=A.prototype.G,A.prototype.getMaxResolution=A.prototype.fc,A.prototype.getMinResolution=A.prototype.gc,A.prototype.getOpacity=A.prototype.hc,A.prototype.getVisible=A.prototype.Mb,A.prototype.getZIndex=A.prototype.Ba,A.prototype.setExtent=A.prototype.vc,A.prototype.setMaxResolution=A.prototype.Ac,A.prototype.setMinResolution=A.prototype.Bc,A.prototype.setOpacity=A.prototype.wc,A.prototype.setVisible=A.prototype.xc,A.prototype.setZIndex=A.prototype.Vb,A.prototype.getKeys=A.prototype.O,A.prototype.getProperties=A.prototype.N,A.prototype.setProperties=A.prototype.H,A.prototype.unset=A.prototype.P,A.prototype.changed=A.prototype.s,A.prototype.dispatchEvent=A.prototype.b,A.prototype.getRevision=A.prototype.L,A.prototype.on=A.prototype.J,A.prototype.un=A.prototype.K,E.prototype.getSource=E.prototype.ha,E.prototype.getStyle=E.prototype.D,E.prototype.getStyleFunction=E.prototype.C,E.prototype.setStyle=E.prototype.g,E.prototype.setSource=E.prototype.Wc,E.prototype.getExtent=E.prototype.G,E.prototype.getMaxResolution=E.prototype.fc,E.prototype.getMinResolution=E.prototype.gc,E.prototype.getOpacity=E.prototype.hc,E.prototype.getVisible=E.prototype.Mb,E.prototype.getZIndex=E.prototype.Ba,E.prototype.setExtent=E.prototype.vc,E.prototype.setMaxResolution=E.prototype.Ac,E.prototype.setMinResolution=E.prototype.Bc,E.prototype.setOpacity=E.prototype.wc,E.prototype.setVisible=E.prototype.xc,E.prototype.setZIndex=E.prototype.Vb,E.prototype.getKeys=E.prototype.O,E.prototype.getProperties=E.prototype.N,E.prototype.setProperties=E.prototype.H,E.prototype.unset=E.prototype.P,E.prototype.changed=E.prototype.s,E.prototype.dispatchEvent=E.prototype.b,E.prototype.getRevision=E.prototype.L,E.prototype.on=E.prototype.J,E.prototype.un=E.prototype.K,pn.prototype.getKeys=pn.prototype.O,pn.prototype.getProperties=pn.prototype.N,pn.prototype.setProperties=pn.prototype.H,pn.prototype.unset=pn.prototype.P,pn.prototype.changed=pn.prototype.s,pn.prototype.dispatchEvent=pn.prototype.b,pn.prototype.getRevision=pn.prototype.L,pn.prototype.on=pn.prototype.J,pn.prototype.un=pn.prototype.K,cn.prototype.getActive=cn.prototype.c,cn.prototype.getMap=cn.prototype.f,cn.prototype.setActive=cn.prototype.Ha,cn.prototype.getKeys=cn.prototype.O,cn.prototype.getProperties=cn.prototype.N,cn.prototype.setProperties=cn.prototype.H,cn.prototype.unset=cn.prototype.P,cn.prototype.changed=cn.prototype.s,cn.prototype.dispatchEvent=cn.prototype.b,cn.prototype.getRevision=cn.prototype.L,cn.prototype.on=cn.prototype.J,cn.prototype.un=cn.prototype.K,E0.prototype.getActive=E0.prototype.c,E0.prototype.getMap=E0.prototype.f,E0.prototype.setActive=E0.prototype.Ha,E0.prototype.getKeys=E0.prototype.O,E0.prototype.getProperties=E0.prototype.N,E0.prototype.setProperties=E0.prototype.H,E0.prototype.unset=E0.prototype.P,E0.prototype.changed=E0.prototype.s,E0.prototype.dispatchEvent=E0.prototype.b,E0.prototype.getRevision=E0.prototype.L,E0.prototype.on=E0.prototype.J,E0.prototype.un=E0.prototype.K,Mn.prototype.getActive=Mn.prototype.c,Mn.prototype.getMap=Mn.prototype.f,Mn.prototype.setActive=Mn.prototype.Ha,Mn.prototype.getKeys=Mn.prototype.O,Mn.prototype.getProperties=Mn.prototype.N,Mn.prototype.setProperties=Mn.prototype.H,Mn.prototype.unset=Mn.prototype.P,Mn.prototype.changed=Mn.prototype.s,Mn.prototype.dispatchEvent=Mn.prototype.b,Mn.prototype.getRevision=Mn.prototype.L,Mn.prototype.on=Mn.prototype.J,Mn.prototype.un=Mn.prototype.K,On.prototype.getActive=On.prototype.c,On.prototype.getMap=On.prototype.f,On.prototype.setActive=On.prototype.Ha,On.prototype.getKeys=On.prototype.O,On.prototype.getProperties=On.prototype.N,On.prototype.setProperties=On.prototype.H,On.prototype.unset=On.prototype.P,On.prototype.changed=On.prototype.s,On.prototype.dispatchEvent=On.prototype.b,On.prototype.getRevision=On.prototype.L,On.prototype.on=On.prototype.J,On.prototype.un=On.prototype.K,En.prototype.getActive=En.prototype.c,En.prototype.getMap=En.prototype.f,En.prototype.setActive=En.prototype.Ha,En.prototype.getKeys=En.prototype.O,En.prototype.getProperties=En.prototype.N,En.prototype.setProperties=En.prototype.H,En.prototype.unset=En.prototype.P,En.prototype.changed=En.prototype.s,En.prototype.dispatchEvent=En.prototype.b,En.prototype.getRevision=En.prototype.L,En.prototype.on=En.prototype.J,En.prototype.un=En.prototype.K,Ln.prototype.getActive=Ln.prototype.c,Ln.prototype.getMap=Ln.prototype.f,Ln.prototype.setActive=Ln.prototype.Ha,Ln.prototype.getKeys=Ln.prototype.O,Ln.prototype.getProperties=Ln.prototype.N,Ln.prototype.setProperties=Ln.prototype.H,Ln.prototype.unset=Ln.prototype.P,Ln.prototype.changed=Ln.prototype.s,Ln.prototype.dispatchEvent=Ln.prototype.b,Ln.prototype.getRevision=Ln.prototype.L,Ln.prototype.on=Ln.prototype.J,Ln.prototype.un=Ln.prototype.K,N0.prototype.getActive=N0.prototype.c,N0.prototype.getMap=N0.prototype.f,N0.prototype.setActive=N0.prototype.Ha,N0.prototype.getKeys=N0.prototype.O,N0.prototype.getProperties=N0.prototype.N,N0.prototype.setProperties=N0.prototype.H,N0.prototype.unset=N0.prototype.P,N0.prototype.changed=N0.prototype.s,N0.prototype.dispatchEvent=N0.prototype.b,N0.prototype.getRevision=N0.prototype.L,N0.prototype.on=N0.prototype.J,N0.prototype.un=N0.prototype.K,zn.prototype.getGeometry=zn.prototype.V,zn.prototype.getActive=zn.prototype.c,zn.prototype.getMap=zn.prototype.f,zn.prototype.setActive=zn.prototype.Ha,zn.prototype.getKeys=zn.prototype.O,zn.prototype.getProperties=zn.prototype.N,zn.prototype.setProperties=zn.prototype.H,zn.prototype.unset=zn.prototype.P,zn.prototype.changed=zn.prototype.s,zn.prototype.dispatchEvent=zn.prototype.b,zn.prototype.getRevision=zn.prototype.L,zn.prototype.on=zn.prototype.J,zn.prototype.un=zn.prototype.K,Uv.prototype.getActive=Uv.prototype.c,Uv.prototype.getMap=Uv.prototype.f,Uv.prototype.setActive=Uv.prototype.Ha,Uv.prototype.getKeys=Uv.prototype.O,Uv.prototype.getProperties=Uv.prototype.N,Uv.prototype.setProperties=Uv.prototype.H,Uv.prototype.unset=Uv.prototype.P,Uv.prototype.changed=Uv.prototype.s,Uv.prototype.dispatchEvent=Uv.prototype.b,Uv.prototype.getRevision=Uv.prototype.L,Uv.prototype.on=Uv.prototype.J,Uv.prototype.un=Uv.prototype.K,Qv.prototype.getActive=Qv.prototype.c,Qv.prototype.getMap=Qv.prototype.f,Qv.prototype.setActive=Qv.prototype.Ha,Qv.prototype.getKeys=Qv.prototype.O,Qv.prototype.getProperties=Qv.prototype.N,Qv.prototype.setProperties=Qv.prototype.H,Qv.prototype.unset=Qv.prototype.P,Qv.prototype.changed=Qv.prototype.s,Qv.prototype.dispatchEvent=Qv.prototype.b,Qv.prototype.getRevision=Qv.prototype.L,Qv.prototype.on=Qv.prototype.J,Qv.prototype.un=Qv.prototype.K,Yn.prototype.getActive=Yn.prototype.c,Yn.prototype.getMap=Yn.prototype.f,Yn.prototype.setActive=Yn.prototype.Ha,Yn.prototype.getKeys=Yn.prototype.O,Yn.prototype.getProperties=Yn.prototype.N,Yn.prototype.setProperties=Yn.prototype.H,Yn.prototype.unset=Yn.prototype.P,Yn.prototype.changed=Yn.prototype.s,Yn.prototype.dispatchEvent=Yn.prototype.b,Yn.prototype.getRevision=Yn.prototype.L,Yn.prototype.on=Yn.prototype.J,Yn.prototype.un=Yn.prototype.K,qn.prototype.getActive=qn.prototype.c,qn.prototype.getMap=qn.prototype.f,qn.prototype.setActive=qn.prototype.Ha,qn.prototype.getKeys=qn.prototype.O,qn.prototype.getProperties=qn.prototype.N,qn.prototype.setProperties=qn.prototype.H,qn.prototype.unset=qn.prototype.P,qn.prototype.changed=qn.prototype.s,qn.prototype.dispatchEvent=qn.prototype.b,qn.prototype.getRevision=qn.prototype.L,qn.prototype.on=qn.prototype.J,qn.prototype.un=qn.prototype.K,lb.prototype.getActive=lb.prototype.c,lb.prototype.getMap=lb.prototype.f,lb.prototype.setActive=lb.prototype.Ha,lb.prototype.getKeys=lb.prototype.O,lb.prototype.getProperties=lb.prototype.N,lb.prototype.setProperties=lb.prototype.H,lb.prototype.unset=lb.prototype.P,lb.prototype.changed=lb.prototype.s,lb.prototype.dispatchEvent=lb.prototype.b,lb.prototype.getRevision=lb.prototype.L,lb.prototype.on=lb.prototype.J,lb.prototype.un=lb.prototype.K,_n.prototype.getActive=_n.prototype.c,_n.prototype.getMap=_n.prototype.f,_n.prototype.setActive=_n.prototype.Ha,_n.prototype.getKeys=_n.prototype.O,_n.prototype.getProperties=_n.prototype.N,_n.prototype.setProperties=_n.prototype.H,_n.prototype.unset=_n.prototype.P,_n.prototype.changed=_n.prototype.s,_n.prototype.dispatchEvent=_n.prototype.b,_n.prototype.getRevision=_n.prototype.L,_n.prototype.on=_n.prototype.J,_n.prototype.un=_n.prototype.K,es.prototype.getActive=es.prototype.c,es.prototype.getMap=es.prototype.f,es.prototype.setActive=es.prototype.Ha,es.prototype.getKeys=es.prototype.O,es.prototype.getProperties=es.prototype.N,es.prototype.setProperties=es.prototype.H,es.prototype.unset=es.prototype.P,es.prototype.changed=es.prototype.s,es.prototype.dispatchEvent=es.prototype.b,es.prototype.getRevision=es.prototype.L,es.prototype.on=es.prototype.J,es.prototype.un=es.prototype.K,ns.prototype.getActive=ns.prototype.c,ns.prototype.getMap=ns.prototype.f,ns.prototype.setActive=ns.prototype.Ha,ns.prototype.getKeys=ns.prototype.O,ns.prototype.getProperties=ns.prototype.N,ns.prototype.setProperties=ns.prototype.H,ns.prototype.unset=ns.prototype.P,ns.prototype.changed=ns.prototype.s,ns.prototype.dispatchEvent=ns.prototype.b,ns.prototype.getRevision=ns.prototype.L,ns.prototype.on=ns.prototype.J,ns.prototype.un=ns.prototype.K,Pb.prototype.getActive=Pb.prototype.c,Pb.prototype.getMap=Pb.prototype.f,Pb.prototype.setActive=Pb.prototype.Ha,Pb.prototype.getKeys=Pb.prototype.O,Pb.prototype.getProperties=Pb.prototype.N,Pb.prototype.setProperties=Pb.prototype.H,Pb.prototype.unset=Pb.prototype.P,Pb.prototype.changed=Pb.prototype.s,Pb.prototype.dispatchEvent=Pb.prototype.b,Pb.prototype.getRevision=Pb.prototype.L,Pb.prototype.on=Pb.prototype.J,Pb.prototype.un=Pb.prototype.K,jb.prototype.getActive=jb.prototype.c,jb.prototype.getMap=jb.prototype.f,jb.prototype.setActive=jb.prototype.Ha,jb.prototype.getKeys=jb.prototype.O,jb.prototype.getProperties=jb.prototype.N,jb.prototype.setProperties=jb.prototype.H,jb.prototype.unset=jb.prototype.P,jb.prototype.changed=jb.prototype.s,jb.prototype.dispatchEvent=jb.prototype.b,jb.prototype.getRevision=jb.prototype.L,jb.prototype.on=jb.prototype.J,jb.prototype.un=jb.prototype.K,Ib.prototype.getActive=Ib.prototype.c,Ib.prototype.getMap=Ib.prototype.f,Ib.prototype.setActive=Ib.prototype.Ha,Ib.prototype.getKeys=Ib.prototype.O,Ib.prototype.getProperties=Ib.prototype.N,Ib.prototype.setProperties=Ib.prototype.H,Ib.prototype.unset=Ib.prototype.P,Ib.prototype.changed=Ib.prototype.s,Ib.prototype.dispatchEvent=Ib.prototype.b,Ib.prototype.getRevision=Ib.prototype.L,Ib.prototype.on=Ib.prototype.J,Ib.prototype.un=Ib.prototype.K,yr.prototype.getKeys=yr.prototype.O,yr.prototype.getProperties=yr.prototype.N,yr.prototype.setProperties=yr.prototype.H,yr.prototype.unset=yr.prototype.P,yr.prototype.changed=yr.prototype.s,yr.prototype.dispatchEvent=yr.prototype.b,yr.prototype.getRevision=yr.prototype.L,yr.prototype.on=yr.prototype.J,yr.prototype.un=yr.prototype.K,b.prototype.getClosestPoint=b.prototype.Ab,b.prototype.intersectsCoordinate=b.prototype.sb,b.prototype.getExtent=b.prototype.G,b.prototype.simplify=b.prototype.Rb,b.prototype.transform=b.prototype.tb,b.prototype.getKeys=b.prototype.O,b.prototype.getProperties=b.prototype.N,b.prototype.setProperties=b.prototype.H,b.prototype.unset=b.prototype.P,b.prototype.changed=b.prototype.s,b.prototype.dispatchEvent=b.prototype.b,b.prototype.getRevision=b.prototype.L,b.prototype.on=b.prototype.J,b.prototype.un=b.prototype.K,h0.prototype.getFirstCoordinate=h0.prototype.ac,h0.prototype.getLastCoordinate=h0.prototype.bc,h0.prototype.getLayout=h0.prototype.cc,h0.prototype.getClosestPoint=h0.prototype.Ab,h0.prototype.intersectsCoordinate=h0.prototype.sb,h0.prototype.getExtent=h0.prototype.G,h0.prototype.simplify=h0.prototype.Rb,h0.prototype.getKeys=h0.prototype.O,h0.prototype.getProperties=h0.prototype.N,h0.prototype.setProperties=h0.prototype.H,h0.prototype.unset=h0.prototype.P,h0.prototype.changed=h0.prototype.s,h0.prototype.dispatchEvent=h0.prototype.b,h0.prototype.getRevision=h0.prototype.L,h0.prototype.on=h0.prototype.J,h0.prototype.un=h0.prototype.K,uu.prototype.getClosestPoint=uu.prototype.Ab,uu.prototype.intersectsCoordinate=uu.prototype.sb,uu.prototype.getExtent=uu.prototype.G,uu.prototype.simplify=uu.prototype.Rb,uu.prototype.transform=uu.prototype.tb,uu.prototype.getKeys=uu.prototype.O,uu.prototype.getProperties=uu.prototype.N,uu.prototype.setProperties=uu.prototype.H,uu.prototype.unset=uu.prototype.P,uu.prototype.changed=uu.prototype.s,uu.prototype.dispatchEvent=uu.prototype.b,uu.prototype.getRevision=uu.prototype.L,uu.prototype.on=uu.prototype.J,uu.prototype.un=uu.prototype.K,Fr.prototype.getFirstCoordinate=Fr.prototype.ac,Fr.prototype.getLastCoordinate=Fr.prototype.bc,Fr.prototype.getLayout=Fr.prototype.cc,Fr.prototype.getClosestPoint=Fr.prototype.Ab,Fr.prototype.intersectsCoordinate=Fr.prototype.sb,Fr.prototype.getExtent=Fr.prototype.G,Fr.prototype.simplify=Fr.prototype.Rb,Fr.prototype.transform=Fr.prototype.tb,Fr.prototype.getKeys=Fr.prototype.O,Fr.prototype.getProperties=Fr.prototype.N,Fr.prototype.setProperties=Fr.prototype.H,Fr.prototype.unset=Fr.prototype.P,Fr.prototype.changed=Fr.prototype.s,Fr.prototype.dispatchEvent=Fr.prototype.b,Fr.prototype.getRevision=Fr.prototype.L,Fr.prototype.on=Fr.prototype.J,Fr.prototype.un=Fr.prototype.K,S.prototype.getFirstCoordinate=S.prototype.ac,S.prototype.getLastCoordinate=S.prototype.bc,S.prototype.getLayout=S.prototype.cc,S.prototype.getClosestPoint=S.prototype.Ab,S.prototype.intersectsCoordinate=S.prototype.sb,S.prototype.getExtent=S.prototype.G,S.prototype.simplify=S.prototype.Rb,S.prototype.transform=S.prototype.tb,S.prototype.getKeys=S.prototype.O,S.prototype.getProperties=S.prototype.N,S.prototype.setProperties=S.prototype.H,S.prototype.unset=S.prototype.P,S.prototype.changed=S.prototype.s,S.prototype.dispatchEvent=S.prototype.b,S.prototype.getRevision=S.prototype.L,S.prototype.on=S.prototype.J,S.prototype.un=S.prototype.K,M.prototype.getFirstCoordinate=M.prototype.ac,M.prototype.getLastCoordinate=M.prototype.bc,M.prototype.getLayout=M.prototype.cc,M.prototype.getClosestPoint=M.prototype.Ab,M.prototype.intersectsCoordinate=M.prototype.sb,M.prototype.getExtent=M.prototype.G,M.prototype.simplify=M.prototype.Rb,M.prototype.transform=M.prototype.tb,M.prototype.getKeys=M.prototype.O,M.prototype.getProperties=M.prototype.N,M.prototype.setProperties=M.prototype.H,M.prototype.unset=M.prototype.P,M.prototype.changed=M.prototype.s,M.prototype.dispatchEvent=M.prototype.b,M.prototype.getRevision=M.prototype.L,M.prototype.on=M.prototype.J,M.prototype.un=M.prototype.K,P.prototype.getFirstCoordinate=P.prototype.ac,P.prototype.getLastCoordinate=P.prototype.bc,P.prototype.getLayout=P.prototype.cc,P.prototype.getClosestPoint=P.prototype.Ab,P.prototype.intersectsCoordinate=P.prototype.sb,P.prototype.getExtent=P.prototype.G,P.prototype.simplify=P.prototype.Rb,P.prototype.transform=P.prototype.tb,P.prototype.getKeys=P.prototype.O,P.prototype.getProperties=P.prototype.N,P.prototype.setProperties=P.prototype.H,P.prototype.unset=P.prototype.P,P.prototype.changed=P.prototype.s,P.prototype.dispatchEvent=P.prototype.b,P.prototype.getRevision=P.prototype.L,P.prototype.on=P.prototype.J,P.prototype.un=P.prototype.K,f.prototype.getFirstCoordinate=f.prototype.ac,f.prototype.getLastCoordinate=f.prototype.bc,f.prototype.getLayout=f.prototype.cc,f.prototype.getClosestPoint=f.prototype.Ab,f.prototype.intersectsCoordinate=f.prototype.sb,f.prototype.getExtent=f.prototype.G,f.prototype.simplify=f.prototype.Rb,f.prototype.transform=f.prototype.tb,f.prototype.getKeys=f.prototype.O,f.prototype.getProperties=f.prototype.N,f.prototype.setProperties=f.prototype.H,f.prototype.unset=f.prototype.P,f.prototype.changed=f.prototype.s,f.prototype.dispatchEvent=f.prototype.b,f.prototype.getRevision=f.prototype.L,f.prototype.on=f.prototype.J,f.prototype.un=f.prototype.K,m.prototype.getFirstCoordinate=m.prototype.ac,m.prototype.getLastCoordinate=m.prototype.bc,m.prototype.getLayout=m.prototype.cc,m.prototype.getClosestPoint=m.prototype.Ab,m.prototype.intersectsCoordinate=m.prototype.sb,m.prototype.getExtent=m.prototype.G,m.prototype.simplify=m.prototype.Rb,m.prototype.transform=m.prototype.tb,m.prototype.getKeys=m.prototype.O,m.prototype.getProperties=m.prototype.N,m.prototype.setProperties=m.prototype.H,m.prototype.unset=m.prototype.P,m.prototype.changed=m.prototype.s,m.prototype.dispatchEvent=m.prototype.b,m.prototype.getRevision=m.prototype.L,m.prototype.on=m.prototype.J,m.prototype.un=m.prototype.K,w.prototype.getFirstCoordinate=w.prototype.ac,w.prototype.getLastCoordinate=w.prototype.bc,w.prototype.getLayout=w.prototype.cc,w.prototype.getClosestPoint=w.prototype.Ab,w.prototype.intersectsCoordinate=w.prototype.sb,w.prototype.getExtent=w.prototype.G,w.prototype.simplify=w.prototype.Rb,w.prototype.transform=w.prototype.tb,w.prototype.getKeys=w.prototype.O,w.prototype.getProperties=w.prototype.N,w.prototype.setProperties=w.prototype.H,w.prototype.unset=w.prototype.P,w.prototype.changed=w.prototype.s,w.prototype.dispatchEvent=w.prototype.b,w.prototype.getRevision=w.prototype.L,w.prototype.on=w.prototype.J,w.prototype.un=w.prototype.K,y.prototype.readFeatures=y.prototype.Oa,Zu.prototype.readFeatures=Zu.prototype.Oa,y.prototype.readFeatures=y.prototype.Oa,To.prototype.getKeys=To.prototype.O,To.prototype.getProperties=To.prototype.N,To.prototype.setProperties=To.prototype.H,To.prototype.unset=To.prototype.P,To.prototype.changed=To.prototype.s,To.prototype.dispatchEvent=To.prototype.b,To.prototype.getRevision=To.prototype.L,To.prototype.on=To.prototype.J,To.prototype.un=To.prototype.K,jo.prototype.getMap=jo.prototype.g,jo.prototype.setTarget=jo.prototype.f,jo.prototype.getKeys=jo.prototype.O,jo.prototype.getProperties=jo.prototype.N,jo.prototype.setProperties=jo.prototype.H,jo.prototype.unset=jo.prototype.P,jo.prototype.changed=jo.prototype.s,jo.prototype.dispatchEvent=jo.prototype.b,jo.prototype.getRevision=jo.prototype.L,jo.prototype.on=jo.prototype.J,jo.prototype.un=jo.prototype.K,Go.prototype.getMap=Go.prototype.g,Go.prototype.setTarget=Go.prototype.f,Go.prototype.getKeys=Go.prototype.O,Go.prototype.getProperties=Go.prototype.N,Go.prototype.setProperties=Go.prototype.H,Go.prototype.unset=Go.prototype.P,Go.prototype.changed=Go.prototype.s,Go.prototype.dispatchEvent=Go.prototype.b,Go.prototype.getRevision=Go.prototype.L,Go.prototype.on=Go.prototype.J,Go.prototype.un=Go.prototype.K,Ko.prototype.getMap=Ko.prototype.g,Ko.prototype.setTarget=Ko.prototype.f,Ko.prototype.getKeys=Ko.prototype.O,Ko.prototype.getProperties=Ko.prototype.N,Ko.prototype.setProperties=Ko.prototype.H,Ko.prototype.unset=Ko.prototype.P,Ko.prototype.changed=Ko.prototype.s,Ko.prototype.dispatchEvent=Ko.prototype.b,Ko.prototype.getRevision=Ko.prototype.L,Ko.prototype.on=Ko.prototype.J,Ko.prototype.un=Ko.prototype.K,Sh.prototype.getMap=Sh.prototype.g,Sh.prototype.setTarget=Sh.prototype.f,Sh.prototype.getKeys=Sh.prototype.O,Sh.prototype.getProperties=Sh.prototype.N,Sh.prototype.setProperties=Sh.prototype.H,Sh.prototype.unset=Sh.prototype.P,Sh.prototype.changed=Sh.prototype.s,Sh.prototype.dispatchEvent=Sh.prototype.b,Sh.prototype.getRevision=Sh.prototype.L,Sh.prototype.on=Sh.prototype.J,Sh.prototype.un=Sh.prototype.K,ko.prototype.getMap=ko.prototype.g,ko.prototype.setTarget=ko.prototype.f,ko.prototype.getKeys=ko.prototype.O,ko.prototype.getProperties=ko.prototype.N,ko.prototype.setProperties=ko.prototype.H,ko.prototype.unset=ko.prototype.P,ko.prototype.changed=ko.prototype.s,ko.prototype.dispatchEvent=ko.prototype.b,ko.prototype.getRevision=ko.prototype.L,ko.prototype.on=ko.prototype.J,ko.prototype.un=ko.prototype.K,Th.prototype.getMap=Th.prototype.g,Th.prototype.setTarget=Th.prototype.f,Th.prototype.getKeys=Th.prototype.O,Th.prototype.getProperties=Th.prototype.N,Th.prototype.setProperties=Th.prototype.H,Th.prototype.unset=Th.prototype.P,Th.prototype.changed=Th.prototype.s,Th.prototype.dispatchEvent=Th.prototype.b,Th.prototype.getRevision=Th.prototype.L,Th.prototype.on=Th.prototype.J,Th.prototype.un=Th.prototype.K,Oo.prototype.getMap=Oo.prototype.g,Oo.prototype.setMap,Oo.prototype.setTarget=Oo.prototype.f,Oo.prototype.get,Oo.prototype.getKeys=Oo.prototype.O,Oo.prototype.getProperties=Oo.prototype.N,Oo.prototype.set,Oo.prototype.setProperties=Oo.prototype.H,Oo.prototype.unset=Oo.prototype.P,Oo.prototype.changed=Oo.prototype.s,Oo.prototype.dispatchEvent=Oo.prototype.b,Oo.prototype.getRevision=Oo.prototype.L,Oo.prototype.on=Oo.prototype.J,Oo.prototype.once,Oo.prototype.un=Oo.prototype.K,Ih.prototype.getMap=Ih.prototype.g,Ih.prototype.setTarget=Ih.prototype.f,Ih.prototype.getKeys=Ih.prototype.O,Ih.prototype.getProperties=Ih.prototype.N,Ih.prototype.setProperties=Ih.prototype.H,Ih.prototype.unset=Ih.prototype.P,Ih.prototype.changed=Ih.prototype.s,Ih.prototype.dispatchEvent=Ih.prototype.b,Ih.prototype.getRevision=Ih.prototype.L,Ih.prototype.on=Ih.prototype.J,Ih.prototype.un=Ih.prototype.K,Oh.prototype.getMap=Oh.prototype.g,Oh.prototype.setTarget=Oh.prototype.f,Oh.prototype.getKeys=Oh.prototype.O,Oh.prototype.getProperties=Oh.prototype.N,Oh.prototype.setProperties=Oh.prototype.H,Oh.prototype.unset=Oh.prototype.P,Oh.prototype.changed=Oh.prototype.s,Oh.prototype.dispatchEvent=Oh.prototype.b,Oh.prototype.getRevision=Oh.prototype.L,Oh.prototype.on=Oh.prototype.J,Oh.prototype.un=Oh.prototype.K,F.ol})
\ No newline at end of file
public/scripts/ol3-contextmenu-min.js
+1
-1
@@ -1 +1 @@
1
-!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<this.getItemsLength()?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},e.prototype.getItemsLength=function(){var e=this,n=0;return Object.keys(this.items).forEach(function(t){e.items[t].submenu||e.items[t].separator||n++}),n},e.prototype.getPixelClicked=function(){return this.pixelClicked},e.prototype.getCoordinateClicked=function(){return this.coordinateClicked},e.prototype.positionContainer=function(t){var s=this,e=this.map.getSize(),n=e[0],o=e[1]-t[1],e=n-t[0],n=this.Base.container.offsetWidth,i=Math.round(this.lineHeight*this.getItemsLength()),a=d.find("li."+l.submenu+"> 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=['<li id="',r,'" class="',l.separator,'">',"<hr></li>"].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="<span>"+e.text+"</span>"),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("<span>Foo</span>"),n=d.createFragment("<span>Foo</span>"),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
1
+!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<this.getItemsLength()?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},e.prototype.getItemsLength=function(){var e=this,n=0;return Object.keys(this.items).forEach(function(t){e.items[t].submenu||e.items[t].separator||n++}),n},e.prototype.getPixelClicked=function(){return this.pixelClicked},e.prototype.getCoordinateClicked=function(){return this.coordinateClicked},e.prototype.positionContainer=function(t){var s=this,e=this.map.getSize(),n=e[0],o=e[1]-t[1],e=n-t[0],n=this.Base.container.offsetWidth,i=Math.round(this.lineHeight*this.getItemsLength()),a=d.find("li."+l.submenu+"> 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=['<li id="',r,'" class="',l.separator,'">',"<hr></li>"].join(""),s=d.createFragment(i),o=[].slice.call(s.childNodes,0)[0],t.firstChild.appendChild(s),a=!0):(e.classname=e.classname||"",i="<span>"+e.text+"</span>",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("<span>Foo</span>"),n=d.createFragment("<span>Foo</span>"),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
public/scripts/u2f-api-min.js
+1
-1
@@ -1 +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<o.length;u++)s[u]={version:o[u].version,challenge:t,keyHandle:o[u].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:s,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:e,challenge:t,registeredKeys:o,timeoutSeconds:r,requestId:n}},u2f.formatRegisterRequest_=function(e,t,o,r,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=0;s<o.length;s++)o[s].appId=e;for(var u=[],s=0;s<t.length;s++)u[s]={version:t[s].version,challenge:o[0],keyHandle:t[s].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:u,registerRequests:o,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:e,registerRequests:o,registeredKeys:t,timeoutSeconds:r,requestId:n}},u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(e){this.port_.postMessage(e)},u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(e,t){e=e.toLowerCase();"message"==e||"onmessage"==e?this.port_.onMessage.addListener(function(e){t({data:e})}):console.error("WrappedChromeRuntimePort only supports onMessage")},u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1,this.requestObject_=null},u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(e){e=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(e))+";end";document.location=e},u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"},u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(e,t){"message"==e.toLowerCase()?window.addEventListener("message",this.onRequestUpdate_.bind(this,t),!1):console.error("WrappedAuthenticatorPort only supports message")},u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(e,t){var t=JSON.parse(t.data),o=(t.intentURL,null);e({data:o=t.hasOwnProperty("data")?JSON.parse(t.data):o})},u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE",u2f.WrappedIosPort_=function(){},u2f.WrappedIosPort_.prototype.postMessage=function(e){e=JSON.stringify(e),e="u2f://auth?"+encodeURI(e);location.replace(e)},u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"},u2f.WrappedIosPort_.prototype.addEventListener=function(e,t){"message"!==e.toLowerCase()&&console.error("WrappedIosPort only supports message")},u2f.getIframePort_=function(t){function o(e){"ready"==e.data?(n.port1.removeEventListener("message",o),t(n.port1)):console.error('First event on iframe port was not "ready"')}var e="chrome-extension://"+u2f.EXTENSION_ID,r=document.createElement("iframe"),n=(r.src=e+"/u2f-comms.html",r.setAttribute("style","display:none"),document.body.appendChild(r),new MessageChannel);n.port1.addEventListener("message",o),n.port1.start(),r.addEventListener("load",function(){r.contentWindow.postMessage("init",e,[n.port2])})},u2f.EXTENSION_TIMEOUT_SEC=30,u2f.port_=null,u2f.waitingForPort_=[],u2f.reqCounter_=0,u2f.callbackMap_={},u2f.getPortSingleton_=function(e){u2f.port_?e(u2f.port_):(0==u2f.waitingForPort_.length&&u2f.getMessagePort(function(e){for(u2f.port_=e,u2f.port_.addEventListener("message",u2f.responseHandler_);u2f.waitingForPort_.length;)u2f.waitingForPort_.shift()(u2f.port_)}),u2f.waitingForPort_.push(e))},u2f.responseHandler_=function(e){var t,e=e.data,o=e.requestId;o&&u2f.callbackMap_[o]?(t=u2f.callbackMap_[o],delete u2f.callbackMap_[o],t(e.responseData)):console.error("Unknown or missing requestId in response.")},u2f.sign=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendSignRequest(t,o,r,n,s)}):u2f.sendSignRequest(t,o,r,n,s)},u2f.sendSignRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatSignRequest_(r,n,s,o,t);e.postMessage(o)})},u2f.register=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendRegisterRequest(t,o,r,n,s)}):u2f.sendRegisterRequest(t,o,r,n,s)},u2f.sendRegisterRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatRegisterRequest_(r,s,n,o,t);e.postMessage(o)})},u2f.getApiVersion=function(r,n){u2f.getPortSingleton_(function(e){if(e.getPortType){var t;switch(e.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":t=1.1;break;default:t=0}r({js_api_version:t})}else{var o=++u2f.reqCounter_,o=(u2f.callbackMap_[o]=r,{type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:void 0!==n?n:u2f.EXTENSION_TIMEOUT_SEC,requestId:o});e.postMessage(o)}})})
\ No newline at end of file
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.U2fRequest,u2f.U2fResponse,u2f.Error,u2f.Transport,u2f.Transports,u2f.SignRequest,u2f.SignResponse,u2f.RegisterRequest,u2f.RegisterResponse,u2f.RegisteredKey,u2f.GetJsApiVersionResponse,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<o.length;u++)s[u]={version:o[u].version,challenge:t,keyHandle:o[u].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:s,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:e,challenge:t,registeredKeys:o,timeoutSeconds:r,requestId:n}},u2f.formatRegisterRequest_=function(e,t,o,r,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=0;s<o.length;s++)o[s].appId=e;for(var u=[],s=0;s<t.length;s++)u[s]={version:t[s].version,challenge:o[0],keyHandle:t[s].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:u,registerRequests:o,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:e,registerRequests:o,registeredKeys:t,timeoutSeconds:r,requestId:n}},u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(e){this.port_.postMessage(e)},u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(e,t){e=e.toLowerCase();"message"==e||"onmessage"==e?this.port_.onMessage.addListener(function(e){t({data:e})}):console.error("WrappedChromeRuntimePort only supports onMessage")},u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1,this.requestObject_=null},u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(e){e=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(e))+";end";document.location=e},u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"},u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(e,t){"message"==e.toLowerCase()?window.addEventListener("message",this.onRequestUpdate_.bind(this,t),!1):console.error("WrappedAuthenticatorPort only supports message")},u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(e,t){var t=JSON.parse(t.data),o=(t.intentURL,t.errorCode,null);e({data:o=t.hasOwnProperty("data")?JSON.parse(t.data):o})},u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE",u2f.WrappedIosPort_=function(){},u2f.WrappedIosPort_.prototype.postMessage=function(e){e=JSON.stringify(e),e="u2f://auth?"+encodeURI(e);location.replace(e)},u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"},u2f.WrappedIosPort_.prototype.addEventListener=function(e,t){"message"!==e.toLowerCase()&&console.error("WrappedIosPort only supports message")},u2f.getIframePort_=function(t){function o(e){"ready"==e.data?(n.port1.removeEventListener("message",o),t(n.port1)):console.error('First event on iframe port was not "ready"')}var e="chrome-extension://"+u2f.EXTENSION_ID,r=document.createElement("iframe"),n=(r.src=e+"/u2f-comms.html",r.setAttribute("style","display:none"),document.body.appendChild(r),new MessageChannel);n.port1.addEventListener("message",o),n.port1.start(),r.addEventListener("load",function(){r.contentWindow.postMessage("init",e,[n.port2])})},u2f.EXTENSION_TIMEOUT_SEC=30,u2f.port_=null,u2f.waitingForPort_=[],u2f.reqCounter_=0,u2f.callbackMap_={},u2f.getPortSingleton_=function(e){u2f.port_?e(u2f.port_):(0==u2f.waitingForPort_.length&&u2f.getMessagePort(function(e){for(u2f.port_=e,u2f.port_.addEventListener("message",u2f.responseHandler_);u2f.waitingForPort_.length;)u2f.waitingForPort_.shift()(u2f.port_)}),u2f.waitingForPort_.push(e))},u2f.responseHandler_=function(e){var t,e=e.data,o=e.requestId;o&&u2f.callbackMap_[o]?(t=u2f.callbackMap_[o],delete u2f.callbackMap_[o],t(e.responseData)):console.error("Unknown or missing requestId in response.")},u2f.sign=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendSignRequest(t,o,r,n,s)}):u2f.sendSignRequest(t,o,r,n,s)},u2f.sendSignRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatSignRequest_(r,n,s,o,t);e.postMessage(o)})},u2f.register=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendRegisterRequest(t,o,r,n,s)}):u2f.sendRegisterRequest(t,o,r,n,s)},u2f.sendRegisterRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatRegisterRequest_(r,s,n,o,t);e.postMessage(o)})},u2f.getApiVersion=function(r,n){u2f.getPortSingleton_(function(e){if(e.getPortType){var t;switch(e.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":t=1.1;break;default:t=0}r({js_api_version:t})}else{var o=++u2f.reqCounter_,o=(u2f.callbackMap_[o]=r,{type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:void 0!==n?n:u2f.EXTENSION_TIMEOUT_SEC,requestId:o});e.postMessage(o)}})})
\ No newline at end of file
public/scripts/xterm-min.js
+1
-1
@@ -1 +1 @@
1
-!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;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._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;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)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<t;e++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(0<this._charsToConsume.length&&this._charsToConsume.shift()===e||(this._charsToAnnounce+=e),"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount)&&(this._liveRegion.textContent+=r.tooMuchOutput),s.isMac)&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(()=>{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<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}t.AccessibilityManager=c},3614:(e,t)=>{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;e<t;e++)this.colors.ansi[e+16]=this._parseColor(i.extendedAnsi[e],r.DEFAULT_ANSI_COLORS[e+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(e){if(void 0!==e)switch(e){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this.colors.ansi[e]=this._restoreColors.ansi[e]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(n,o,a=this.allowTransparency){if(void 0===n)return o;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=n,"string"!=typeof this._ctx.fillStyle)return console.warn(`Color: ${n} is invalid using fallback `+o.css),o;this._ctx.fillRect(0,0,1,1);let e=this._ctx.getImageData(0,0,1,1).data;if(255===e[3])return{css:this._ctx.fillStyle,rgba:h.channels.toRgba(e[0],e[1],e[2],e[3])};{if(!a)return console.warn(`Color: ${n} is using transparency, but allowTransparency is false. Using fallback ${o.css}.`),o;let[e,t,i,r]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(e=>Number(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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;let n=i(2585),o=i(8460),a=i(844),h=i(3656);i=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this._onHideLinkUnderline=this.register(new o.EventEmitter),this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(t){return this._linkProviders.push(t),{dispose:()=>{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<i.length;t++){let e=i[t];if(e.classList.contains("xterm"))break;if(e.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._onHover(e),this._lastBufferCell=e)}}}_onHover(e){this._activeLine!==e.y?(this._clearCurrentLink(),this._askForLink(e,!1)):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(r,t){var e,s;this._activeProviderReplies&&t||(null!=(e=this._activeProviderReplies)&&e.forEach(e=>{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;e<t.size;e++){var s=t.get(e);if(s)for(let t=0;t<s.length;t++){var n=s[t],o=n.link.range.start.y<i?0:n.link.range.start.x,a=n.link.range.end.y>i?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;e<r;e++)this._activeProviderReplies.has(e)&&!this._activeProviderReplies.get(e)||(i=!0);if(!i&&t){let e=t.find(e=>this._linkAtPosition(e.link,s));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let t=0;t<this._activeProviderReplies.size;t++){let e=null==(o=this._activeProviderReplies.get(t))?void 0:o.find(e=>this._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.y<t.y,s=e.range.end.y>t.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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;let d=i(511),n=i(2585);i=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(l,e){var c;let _=this._bufferService.buffer.lines.get(l-1);if(_){let i=[],s=this._optionsService.rawOptions.linkHandler,r=new d.CellData,n=_.getTrimmedLength(),o=-1,a=-1,h=!1;for(let t=0;t<n;t++)if(-1!==a||_.hasContent(t)){if(_.loadCell(t,r),r.hasExtendedAttrs()&&r.extended.urlId){if(-1===a){a=t,o=r.extended.urlId;continue}h=r.extended.urlId!==o}else-1!==a&&(h=!0);if(h||-1!==a&&t===n-1){let e=null==(c=this._oscLinkService.getLinkData(o))?void 0:c.uri;if(e){let r={start:{x:a+1,y:l},end:{x:t+(h||t!==n-1?0:1),y:l}};i.push({text:e,range:r,activate:(t,e)=>{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<e||s.coreMouseService.triggerMouseEvent({col:r.col,row:r.row,x:r.x,y:r.y,button:e,action:t,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(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<Math.abs(i);e++)t+=r;return this.coreService.triggerDataEvent(t,!0),this.cancel(e,!0)}}},{passive:!1})),this.register((0,c.addDisposableDomListener)(t,"touchstart",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<t.keyCode)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16!==e.keyCode&&17!==e.keyCode&&18!==e.keyCode&&this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null==e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1))}_inputEvent(e){return!(!e.data||"insertText"!==e.inputType||e.composed&&this._keyDownSeen||this.optionsService.rawOptions.screenReaderMode||this._keyPressHandled||(this._unprocessedDeadKey=!1,this.coreService.triggerDataEvent(e.data,!0),this.cancel(e),0))}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i;null!=(i=this._charSizeService)&&i.measure(),null!=(i=this.viewport)&&i.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(g.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;var e,t=this._customKeyEventHandler;this._setup(),super.reset(),null!=(e=this._selectionService)&&e.reset(),this._decorationService.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1),null!=(e=this.viewport)&&e.syncScrollArea()}clearTextureAtlas(){var e;null!=(e=this._renderService)&&e.clearTextureAtlas()}_reportFocus(){var e;null!=(e=this.element)&&e.classList.contains("focus")?this.coreService.triggerDataEvent(o.C0.ESC+"[I"):this.coreService.triggerDataEvent(o.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.canvasWidth.toFixed(0),t=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t};${e}t`);break;case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var i=this._renderService.dimensions.actualCellWidth.toFixed(0),r=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(o.C0.ESC+`[6;${r};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;let n=i(844),l=i(3656),o=i(4725),a=i(2585);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._element=r,this._bufferService=s,this._optionsService=n,this._charSizeService=o,this._renderService=a,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._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(0<this._charSizeService.height){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length?(this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,this._refresh(e)):this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){var t;this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?(this._ignoreNextScrollEvent=!1,this._scrollLines(0)):(t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp,this._scrollLines(t)))}_smoothScroll(){var e;this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target||(e=this._smoothScrollPercent(),this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._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||0<t&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}onWheel(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){var i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!=t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}},i=r([s(4,a.IBufferService),s(5,a.IOptionsService),s(6,o.ICharSizeService),s(7,o.IRenderService),s(8,o.ICoreBrowserService)],i);t.Viewport=i},3107: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;let n=i(3656),o=i(4725),a=i(844),h=i(2585);i=class extends a.Disposable{constructor(e,t,i,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._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<this._zonePool.length?(this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++])):(this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++)}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;let a=i(5871),n=i(3656),o=i(4725),h=i(844),l=i(2585),c={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};i=class extends h.Disposable{constructor(e,t,i,r,s,n,o){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=r,this._renderService=s,this._optionsService=n,this._coreBrowseService=o,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null!=(e=this._viewportElement.parentElement)&&e.insertBefore(this._canvas,this._viewportElement);t=this._canvas.getContext("2d");if(!t)throw new Error("Ctx cannot be null");this._ctx=t,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;let n=i(4725),o=i(2585),a=i(2584);i=class{constructor(e,t,i,r,s,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._coreService=s,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{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.length<i.length?this._coreService.triggerDataEvent(""+a.C0.DEL,!0):e.length===i.length&&e!==i&&this._coreService.triggerDataEvent(e,!0))},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,r=e*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=r+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.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;i<Math.abs(a-e);i++){let e="A"===h(r,s)?-1:1,t=n.buffer.lines.get(a+e*i);null!=t&&t.isWrapped&&o++}return o}(e,t,i),p(h(e,t),r))}function v(e,t){let i=0,r=e.buffer.lines.get(t),s=null==r?void 0:r.isWrapped;for(;s&&0<=t&&t<e.rows;)i++,r=e.buffer.lines.get(--t),s=null==r?void 0:r.isWrapped;return i}function h(e,t){return t<e?"A":"B"}function g(e,t,i,r,s,n){let o=e,a=t,h="";for(;o!==i||a!==r;)o+=s?1:-1,s&&o>n.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<t;e++)r+=i;return r}t.moveToCellSequence=function(e,t,i,r){var s,n,o,a,h,l,c=i.buffer.x,_=i.buffer.y;if(!i.buffer.hasScrollback)return u=c,(0===f(a=_,t,h=i,l=r).length?"":S(g(u,a,u,a-v(h,a),!1,h).length,p("D",l)))+f(_,t,i,r)+(u=c,a=e,o=0<f(h=_,l=t,s=i,n=r).length?l-v(s,l):h,h=function(e,t,i,r,s){s=0<f(i,r,s,n).length?r-v(s,r):t;return e<i&&s<=r||i<=e&&s<r?"C":"D"}(u,h,a,l=l,s),S(g(u,o,a,l,"C"===h,s).length,p(h,n)));let d;if(_===t)return d=e<c?"D":"C",S(Math.abs(c-e),p(d,r));d=t<_?"D":"C";var u=Math.abs(_-t);return S(i.cols-(t<_?e:c)+(u-1)*i.cols+1+((t<_?c:e)-1),p(d,r))}},8036:(e,t,i)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;let c=i(3787),n=i(8036),o=i(844),a=i(4725),h=i(2585),l=i(8460),_=i(8055),d=i(9631),u="xterm-dom-renderer-owner-",f="xterm-focus",v=1,g=class extends o.Disposable{constructor(e,t,i,r,s,n,o,a,h,l){super(),this._colors=e,this._element=t,this._screenElement=i,this._viewportElement=r,this._linkifier2=s,this._charSizeService=o,this._optionsService=a,this._bufferService=h,this._coreBrowserService=l,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=n.createInstance(c.DomRendererRowFactory,document,this._colors),this._element.classList.add(u+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(e=>this._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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.STRIKETHROUGH_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;let R=t(8036),k=t(643),a=t(511),s=t(2585),D=t(8055),n=t(4725),A=t(4269),h=t(1752),x=t(3734);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.STRIKETHROUGH_CLASS="xterm-strikethrough",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";t=class{constructor(e,t,i,r,s,n,o){this._document=e,this._colors=t,this._characterJoinerService=i,this._optionsService=r,this._coreBrowserService=s,this._coreService=n,this._decorationService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}setColors(e){this._colors=e}onSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(u,f,v,g,p,S,m,t){var C=this._document.createDocumentFragment(),b=this._characterJoinerService.getJoinedCharacters(f);let i=0;for(let e=Math.min(u.length,t)-1;0<=e;e--)if(u.loadCell(e,this._workCell).getCode()!==k.NULL_CELL_CODE||v&&e===p){i=e+1;break}for(let e=0;e<i;e++){u.loadCell(e,this._workCell);let d=this._workCell.getWidth();if(0!==d){let t=!1,i=e,r=this._workCell;if(0<b.length&&e===b[0][0]){t=!0;let e=b.shift();r=new A.JoinedCellData(this._workCell,u.translateToString(!0,e[0],e[1]),e[1]-e[0]),i=e[1]-1,d=r.getWidth()}var y=this._document.createElement("span");if(1<d&&(y.style.width=m*d+"px"),t&&(y.style.display="inline",p>=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&&e<r[0]&&t<=r[1]:e<i[0]&&i[1]<=t&&r[0]<=e&&t<=r[1]:t>i[1]&&t<r[1]||i[1]===r[1]&&t===i[1]&&i[0]<=e&&e<r[0]||i[1]<r[1]&&t===r[1]&&e<r[0]||i[1]<r[1]&&t===i[1]&&i[0]<=e)}};function B(e,t,i){for(;e.length<i;)e=t+e;return e}t=i([r(2,n.ICharacterJoinerService),r(3,s.IOptionsService),r(4,n.ICoreBrowserService),r(5,s.ICoreService),r(6,s.IDecorationService)],t),L.DomRendererRowFactory=t},456:(e,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]<e[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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;let n=i(2585),o=i(8460);i=class{constructor(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new a(e,t,this._optionsService)}get hasValidSize(){return 0<this.width&&0<this.height}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}},i=r([s(2,n.IOptionsService)],i);t.CharSizeService=i;class a{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(a,e,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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterJoinerService=e.JoinedCellData=void 0;let s=t(3734),l=t(643),n=t(511),o=t(2585);class h extends s.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=h;t=class a{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new n.CellData}register(e){e={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];var i=this._bufferService.buffer.lines.get(e);if(!i||0===i.length)return[];var r=[],s=i.translateToString(!0);let n=0,o=0,a=0,t=i.getFg(0),h=i.getBg(0);for(let e=0;e<i.getTrimmedLength();e++)if(i.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==t||this._workCell.bg!==h){if(1<e-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}n=e,a=o,t=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(1<this._bufferService.cols-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}return r}_getJoinedRanges(e,t,i,r,s){var n=e.substring(t,i);let o=[];try{o=this._characterJoiners[0].handler(n)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(n);for(let e=0;e<t.length;e++)a._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,s),o}_stringRangesToCellRanges(r,s,e){let n=0,o=!1,a=0,h=r[n];if(h){for(let i=e;i<this._bufferService.cols;i++){let e=s.getWidth(i),t=s.getString(i).length||l.WHITESPACE_CELL_CHAR.length;if(0!==e){if(!o&&h[0]<=a&&(h[0]=i,o=!0),h[1]<=a){if(h[1]=i,!(h=r[++n]))break;o=h[0]<=a&&(h[0]=i,!0)}a+=t}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let r=!1;for(let e=0;e<t.length;e++){var s=t[e];if(r){if(i[1]<=s[0])return t[e-1][1]=i[1],t;if(i[1]<=s[1])return t[e-1][1]=Math.max(i[1],s[1]),t.splice(e,1),t;t.splice(e,1),e--}else{if(i[1]<=s[0])return t.splice(e,0,i),t;if(i[1]<=s[1])return s[0]=Math.min(i[0],s[0]),t;i[0]<s[1]&&(s[0]=Math.min(i[0],s[0]),r=!0)}}return r?t[t.length-1][1]=i[1]:t.push(i),t}},t=i([r(0,o.IBufferService)],t);e.CharacterJoinerService=t},5114:(e,t)=>{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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;let n=i(4725),o=i(9806);i=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,r,s){return(0,o.getCoords)(window,e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,s)}getMouseReportCoords(e,t){e=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;let h=i(6193),l=i(8460),n=i(844),c=i(5596),_=i(3656),o=i(2585),a=i(4725);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a){if(super(),this._renderer=e,this._rowCount=t,this._charSizeService=s,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=new l.EventEmitter,this._onRenderedViewportChange=new l.EventEmitter,this._onRender=new l.EventEmitter,this._onRefreshRequest=new l.EventEmitter,this.register({dispose:()=>this._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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;let a=i(6114),l=i(456),c=i(511),_=i(8460),n=i(4725),o=i(2585),h=i(9806),d=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");i=class extends u.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=r,this._coreService=s,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this._onRedrawRequest=this.register(new _.EventEmitter),this._onSelectionChange=this.register(new _.EventEmitter),this._onRequestScrollLines=this.register(new _.EventEmitter),this._mouseMoveListener=e=>this._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]<s[0]?e:s)[0],r=(e[0]<s[0]?s:e)[0];for(let t=e[1];t<=s[1];t++){let e=n.translateBufferLineToString(t,!0,i,r);o.push(e)}}else{var t=e[1]===s[1]?s[0]:void 0;o.push(n.translateBufferLineToString(e[1],!0,e[0],t));for(let i=e[1]+1;i<=s[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);null!=e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}if(e[1]!==s[1]){let e=n.lines.get(s[1]),t=n.translateBufferLineToString(s[1],!0,0,s[0]);e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}}return o.map(e=>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]<i[1]||t[1]===i[1]&&e[1]===t[1]&&t[0]<=e[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&t[0]<=e[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._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}}_dragScroll(){var e;this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount&&(this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1}),e=this._bufferService.buffer,0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh())}_onMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){let e=(0,d.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_onBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>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<s&&i[0]!==e&&(r+=s-1)}return r}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,e,t=!0,_=!0){if(!(c[0]>=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(;0<r&&" "===f.charAt(r-1);)r--;for(;s<f.length&&" "===f.charAt(s+1);)s++}else{let t=c[0],i=c[0],e=(0===u.getWidth(t)&&(n++,t--),2===u.getWidth(i)&&(o++,i++),u.getString(i).length);for(1<e&&(h+=e-1,s+=e-1);0<t&&0<r&&!this._isCharWordSeparator(u.loadCell(t-1,this._workCell));){u.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(n++,t--):1<e&&(a+=e-1,r-=e-1),r--,t--}for(;i<u.length&&s+1<f.length&&!this._isCharWordSeparator(u.loadCell(i+1,this._workCell));){u.loadCell(i+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(o++,i++):1<e&&(h+=e-1,s+=e-1),s++,i++}}s++;let i=r+v-n+a,l=Math.min(this._bufferService.cols,s-r+n+o-a-h);if(e||""!==f.slice(r,s).trim()){if(t&&0===i&&32!==u.getCodePoint(0)){let e=d.lines.get(c[1]-1);if(e&&u.isWrapped&&32!==e.getCodePoint(this._bufferService.cols-1)){let t=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;i-=e,l+=e}}}if(_&&i+l===this._bufferService.cols&&32!==u.getCodePoint(this._bufferService.cols-1)){let e=d.lines.get(c[1]+1);if(null!=e&&e.isWrapped&&32!==e.getCodePoint(0)){let e=this._getWordAt([0,c[1]+1],!1,!1,!0);e&&(l+=e.length)}}return{start:i,length:l}}}}}_selectWordAt(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(t){var i=this._getWordAt(t,!0);if(i){let e=t[1];for(;i.start<0;)i.start+=this._bufferService.cols,e--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._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;e<Math.min(t,this.length);e++)i[e]=this._array[this._getCyclicIndex(e)];this._array=i,this._maxLength=t,this._startIndex=0}}get length(){return this._length}set length(t){if(t>this._length)for(let e=this._length;e<t;e++)this._array[e]=void 0;this._length=t}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(t,i,...r){if(i){for(let e=t;e<this._length-i;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+i)];this._length-=i,this.onDeleteEmitter.fire({index:t,amount:i})}for(let e=this._length-1;e>=t;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<r.length;e++)this._array[this._getCyclicIndex(t+e)]=r[e];if(r.length&&this.onInsertEmitter.fire({index:t,amount:r.length}),this._length+r.length>this._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(0<r){for(let e=i-1;0<=e;e--)this.set(t+e+r,this.get(t+e));var e=t+i+r-this._length;if(0<e)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<i;e++)this.set(t+e+r,this.get(t+e))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}},1439:(e,t)=>{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<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function h(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<i&&(0<o||0<a||0<h);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>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<i&&(o<255||a<255||h<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=Math.min(255,h+Math.ceil(.1*(255-h))),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>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)<n){if(e<o){let t=h(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=l(r,s,n);return i>_(o,c.relativeLuminance(e>>8))?t:e}return t}var t=l(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=h(r,s,n);return 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;e<this._listeners.length;e++)if(this._listeners[e]===t)return void this._listeners.splice(e,1)}})),this._event}fire(t,i){var r=[];for(let e=0;e<this._listeners.length;e++)r.push(this._listeners[e]);for(let e=0;e<r.length;e++)r[e].call(void 0,t,i)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e(e=>t.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(24<e)return t.setWinLines;switch(e){case 1:return t.restoreWin;case 2:return t.minimizeWin;case 3:return t.setWinPosition;case 4:return t.setWinSizePixels;case 5:return t.raiseWin;case 6:return t.lowerWin;case 7:return t.refreshWin;case 8:return t.setWinSizeChars;case 9:return t.maximizeWin;case 10:return t.fullscreenWin;case 11:return t.getWinState;case 13:return t.getWinPosition;case 14:return t.getWinSizePixels;case 15:return t.getScreenSizePixels;case 16:return t.getCellSizePixels;case 18:return t.getWinSizeChars;case 19:return t.getScreenSizeChars;case 20:return t.getIconTitle;case 21:return t.getWinTitle;case 22:return t.pushTitle;case 23:return t.popTitle;case 24:return t.setWinLines}}var C;(i=C=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}))[i.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",i[i.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS";class b extends r.Disposable{constructor(e,t,i,r,s,n,o,a,h,l=new _.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._dirtyRowService=r,this._logService=s,this._optionsService=n,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=h,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new v.EventEmitter,this._onRequestRefreshRows=new v.EventEmitter,this._onRequestReset=new v.EventEmitter,this._onRequestSendFocus=new v.EventEmitter,this._onRequestSyncScrollBar=new v.EventEmitter,this._onRequestWindowsOptionsReport=new v.EventEmitter,this._onA11yChar=new v.EventEmitter,this._onA11yTab=new v.EventEmitter,this._onCursorMove=new v.EventEmitter,this._onLineFeed=new v.EventEmitter,this._onScroll=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onColor=new v.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._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.length<r.length&&this._parseBuffer.length<h&&(this._parseBuffer=new Uint32Array(Math.min(r.length,h))),i||this._dirtyRowService.clearRange(),r.length>h)for(let i=t;i<r.length;i+=h){let e=i+h<r.length?i+h:r.length,t="string"==typeof r?this._stringDecoder.decode(r.substring(i,e),this._parseBuffer):this._utf8Decoder.decode(r.subarray(i,e),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,t))return this._preserveStack(n,o,t,i),this._logSlowResolvingAsync(s),s}else if(!i){let e=("string"==typeof r?this._stringDecoder:this._utf8Decoder).decode(r,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,e))return this._preserveStack(n,o,e,0),this._logSlowResolvingAsync(s),s}this._activeBuffer.x===n&&this._activeBuffer.y===o||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(t,i,r){let s,n;var o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,_=this._curAttrData;let d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&0<r-i&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let e=i;e<r;++e){if(s=t[e],n=this._unicodeService.wcwidth(s),s<127&&o){let e=o[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}if(a&&this._onA11yChar.fire((0,u.stringFromCodePoint)(s)),void 0!==this._currentLinkId&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),n||!this._activeBuffer.x){if(this._activeBuffer.x+n-1>=h)if(l){for(;this._activeBuffer.x<h;)d.setCellFromCodePoint(this._activeBuffer.x++,0,1,_.fg,_.bg,_.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=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<n)for(;--n;)d.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else d.getWidth(this._activeBuffer.x-1)?d.addCodepointToCell(this._activeBuffer.x-1,s):d.addCodepointToCell(this._activeBuffer.x-2,s)}0<r-i&&(d.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||65535<this._workCell.getCode()?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<h&&0<r-i&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,e=>!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),0<this._activeBuffer.x)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._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._activeBuffer.x&&this._activeBuffer.x--;return!0}tab(){var e;return this._activeBuffer.x>=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.rows;i++)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=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;0<e&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){for(var i=this._activeBuffer.ybase+this._activeBuffer.y,e=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-e+1;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var i=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom;for(r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}insertChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(f.DEFAULT_ATTR_DATA));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}scrollRight(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}insertColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}deleteColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}eraseChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(this._parser.precedingCodepoint){var t=e.params[0]||1,i=new Uint32Array(t);for(let e=0;e<t;++e)i[e]=this._parser.precedingCodepoint;this.print(i,0,i.length)}return!0}sendDeviceAttributesPrimary(e){return 0<e.params[0]||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return 0<e.params[0]||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;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;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===t.params[e]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){var i=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:s}=this._coreMouseService,n=this._coreService,{buffers:o,cols:a}=this._bufferService,{active:o,alt:h}=o,l=this._optionsService.rawOptions,c=e=>e?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],++t<e.length&&t+o+1+n<s.length;);break}}while(!(5===s[1]&&2<=o+n||2===s[1]&&5<=o+n)&&(s[1]&&(n=1),++o+r<i.length&&o+n<s.length));for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:e.fg=this._updateAttrColor(e.fg,s[1],s[3],s[4],s[5]);break;case 48:e.bg=this._updateAttrColor(e.bg,s[1],s[3],s[4],s[5]);break;case 58:e.extended=e.extended.clone(),e.extended.underlineColor=this._updateAttrColor(e.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),t.extended.underlineStyle=e=!~e||5<e?1:e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(t){if(1===t.length&&0===t.params[0])this._curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=f.DEFAULT_ATTR_DATA.bg;else{var i,r=t.length,s=this._curAttrData;for(let e=0;e<r;e++)30<=(i=t.params[e])&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):40<=i&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):90<=i&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):100<=i&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=f.DEFAULT_ATTR_DATA.fg,s.bg=f.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(t.hasSubParams(e)?t.getSubParams(e)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?e+=this._extractColor(t,e,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i)}return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(d.C0.ESC+"[0n");break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!(this._coreService.decPrivateModes.origin=!1)}setCursorStyle(e){e=e.params[0]||1;switch(e){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}return this._optionsService.options.cursorBlink=e%2==1,!0}setScrollRegion(e){var t=e.params[0]||1;let i;return(i=e.length<2||(i=e.params[1])>this._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=1<e.length?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),10<this._windowTitleStack.length&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),10<this._iconNameStack.length&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let r=[],t=e.split(";");for(;1<t.length;){let e=t.shift(),i=t.shift();if(/^\d+$/.exec(e)){let t=parseInt(e);if(0<=t&&t<256)if("?"===i)r.push({type:0,index:t});else{let e=(0,s.parseColor)(i);e&&r.push({type:1,index:t,color:e})}}}return r.length&&this._onColor.fire(r),!0}setHyperlink(e){e=e.split(";");return!(e.length<2)&&(e[1]?this._createHyperlink(e[0],e[1]):!e[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();e=e.split(":");let i;var r=e.findIndex(e=>e.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<r.length&&!(t>=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<r.length;++e)/^\d+$/.exec(r[e])&&0<=(t=parseInt(r[e]))&&t<256&&i.push({type:2,index:t});i.length&&this._onColor.fire(i)}else this._onColor.fire([{type:2}]);return!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"!==e[0]&&this._charsetService.setgCharset(o[e[0]],c.CHARSETS[e[1]]||c.DEFAULT_CHARSET),!0}index(){return this._restrictCursor(),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._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<this._bufferService.rows;++e){var i=this._activeBuffer.ybase+this._activeBuffer.y+e,i=this._activeBuffer.lines.get(i);i&&(i.fill(t),i.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){var i=this._bufferService.buffer,r=this._optionsService.rawOptions;return i='"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r",this._coreService.triggerDataEvent(d.C0.ESC+i+d.C0.ESC+"\\"),!0}}t.InputHandler=b},844:(e,t)=>{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])===t)}return!1}*getKeyIterator(e){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||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;);}forEachByKey(e,t){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||i>=this._array.length)&&this._getKey(this._array[i])===e)for(;t(this._array[i]),++i<this._array.length&&this._getKey(this._array[i])===e;);}values(){return this._array.values()}_search(e,t,i){if(i<t)return t;let r=Math.floor((t+i)/2);var s=this._getKey(this._array[r]);if(e<s)return this._search(e,t,r-1);if(s<e)return this._search(e,r+1,i);for(;0<r&&this._getKey(this._array[r-1])===e;)r--;return r}}},8273:(e,t)=>{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<s;++e)t[e]=i}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,i,r){return e.fill?e.fill(t,i,r):s(e,t,i,r)},t.fillFallback=s,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},9282:(e,t,i)=>{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&&e<this._rows}_getCorrectBufferLength(e){var t;return this._hasScrollback?(t=e+this._optionsService.rawOptions.scrollback)>i.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),0<this.lines.length){if(this._cols<i)for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);let t=0;if(this._rows<r)for(let e=this._rows;e<r;e++)this.lines.length<r+this.ybase&&(!this._optionsService.rawOptions.windowsMode&&0<this.ybase&&this.lines.length<=this.ybase+this.y+t+1?(this.ybase--,t++,0<this.ydisp&&this.ydisp--):this.lines.push(new S.BufferLine(i,s)));else for(let e=this._rows;e>r;e--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){let e=this.lines.length-n;0<e&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=n}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,r-1),t&&(this.y+=t),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(i,r),this._cols>i))for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);this._cols=i,this._rows=r}get _isReflowEnabled(){return this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._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<i.length&&(i=(0,m.reflowLargerCreateNewLayout)(this.lines,i),(0,m.reflowLargerApplyNewLayout)(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved))}_reflowLargerAdjustViewport(e,t,i){var r=this.getNullCell(S.DEFAULT_ATTR_DATA);let s=i;for(;0<s--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<t&&this.lines.push(new S.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(o,a){let h=this.getNullCell(S.DEFAULT_ATTR_DATA),l=[],c=0;for(let n=this.lines.length-1;0<=n;n--){let e=this.lines.get(n);if(!(!e||!e.isWrapped&&e.getTrimmedLength()<=o)){for(var _=[e];e.isWrapped&&0<n;)e=this.lines.get(--n),_.unshift(e);var d=this.ybase+this.y;if(!(d>=n&&d<n+_.length)){var d=_[_.length-1].getTrimmedLength(),u=(0,m.reflowSmallerGetNewLineLengths)(_,this._cols,o),f=u.length-_.length,v=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f),g=[];for(let e=0;e<f;e++){let e=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);g.push(e)}0<g.length&&(l.push({start:n+_.length+c,newLines:g}),c+=g.length),_.push(...g);let t=u.length-1,i=u[t],r=(0===i&&(t--,i=u[t]),_.length-f-1),s=d;for(;0<=r;){let e=Math.min(s,i);if(void 0===_[t])break;if(_[t].copyCellsFrom(_[r],s-e,i-e,e,!0),0===(i-=e)&&(t--,i=u[t]),0===(s-=e)){r--;let e=Math.max(r,0);s=(0,m.getWrappedLineTrimmedLength)(_,e,this._cols)}}for(let e=0;e<_.length;e++)u[e]<o&&_[e].setCell(u[e],h);let e=f-v;for(;0<e--;)0===this.ybase?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+f,this.ybase+a-1)}}}if(0<l.length){let i=[],r=[];for(let e=0;e<this.lines.length;e++)r.push(this.lines.get(e));let e=this.lines.length,s=e-1,n=0,o=l[n],a=(this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c),0);for(let t=Math.min(this.lines.maxLength-1,e+c-1);0<=t;t--)if(o&&o.start>s+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<p&&this.lines.onTrimEmitter.fire(p)}}stringIndexToBufferIndex(t,i,e=!1){for(;i;){var r=this.lines.get(t);if(!r)return[-1,-1];var s=e?r.getTrimmedLength():r.length;for(let e=0;e<s;++e)if(r.get(e)[n.CHAR_DATA_WIDTH_INDEX]&&(i-=r.get(e)[n.CHAR_DATA_CHAR_INDEX].length||1),i<0)return[t,e];t++}return[t,0]}translateBufferLineToString(e,t,i=0,r){e=this.lines.get(e);return e?e.translateToString(t,i,r):""}getWrappedRangeForLine(e){let t=e,i=e;for(;0<t&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&0<e;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new o.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim(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.line<e.index+e.amount&&t.dispose(),t.line>e.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._current<this._endIndex}next(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._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<t;++e)this.setCell(e,r);this.length=t}get(e){var t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,s.stringFromCodePoint)(i):"",t>>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<t[n.CHAR_DATA_CHAR_INDEX].length?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>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),r<this.length-i){let t=new o.CellData;for(let e=this.length-i-r-1;0<=e;--e)this.setCell(i+r+e,this.loadCell(i+e,t));for(let e=0;e<r;++e)this.setCell(i+e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-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)}deleteCells(i,r,s,e){if(i%=this.length,r<this.length-i){let t=new o.CellData;for(let e=0;e<this.length-i-r;++e)this.setCell(i+e,this.loadCell(i+r+e,t));for(let e=this.length-r;e<this.length;++e)this.setCell(e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);i&&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),0!==this.getWidth(i)||this.hasContent(i)||this.setCellFromCodePoint(i,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)}replaceCells(e,t,i,r,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)}resize(t,i){if(t!==this.length){if(t>this.length){var e=new Uint32Array(3*t);this.length&&(3*t<this._data.length?e.set(this._data.subarray(0,3*t)):e.set(this._data)),this._data=e;for(let e=this.length;e<t;++e)this.setCell(e,i)}else if(t){let e=new Uint32Array(3*t);e.set(this._data.subarray(0,3*t)),this._data=e;var r=Object.keys(this._combined);for(let e=0;e<r.length;e++){var s=parseInt(r[e],10);t<=s&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=t}}fill(t,e=!1){if(e)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){var e,t,i=new h(0);for(e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(t in this._extendedAttrs)i._extendedAttrs[t]=this._extendedAttrs[t];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;0<=e;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>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<e;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])}var o=Object.keys(i._combined);for(let t=0;t<o.length;t++){let e=parseInt(o[t],10);e>=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<t;){let e=this._data[3*i+0],t=2097151&e;r+=2097152&e?this._combined[i]:t?(0,s.stringFromCodePoint)(t):n.WHITESPACE_CELL_CHAR,i+=e>>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<r.length-1;i++){let e=i,t=r.get(++e);if(t.isWrapped){for(var d=[r.get(i)];e<r.length&&t.isWrapped;)d.push(t),t=r.get(++e);if(!(s>=i&&s<e)){let s=0,n=u(d,s,h),o=1,a=0;for(;o<d.length;){let e=u(d,o,h),t=e-a,i=l-n,r=Math.min(t,i);d[s].copyCellsFrom(d[o],a,n,r,!1),(n+=r)===l&&(s++,n=0),(a+=r)===e&&(o++,a=0),0===n&&0!==s&&2===d[s-1].getWidth(l-1)&&(d[s].copyCellsFrom(d[s-1],l-1,n++,1,!1),d[s-1].setCell(l-1,c))}d[s].replaceCells(n,l,c);let t=0;for(let e=d.length-1;0<e&&(e>s||0===d[e].getTrimmedLength());e--)t++;0<t&&(_.push(i+d.length-t),_.push(t))}i+=d.length-1}}return _},t.reflowLargerCreateNewLayout=function(i,r){let e=[],s=0,n=r[s],o=0;for(let t=0;t<i.length;t++)if(n===t){let e=r[++s];i.onDeleteEmitter.fire({index:t-o,amount:e}),t+=e-1,o+=e,n=r[++s]}else e.push(t);return{layout:e,countRemoved:o}},t.reflowLargerApplyNewLayout=function(t,i){var r=[];for(let e=0;e<i.length;e++)r.push(t.get(i[e]));for(let e=0;e<r.length;e++)t.set(e,r[e]);t.length=i.length},t.reflowSmallerGetNewLineLengths=function(i,r,e){var t=[],s=i.map((e,t)=>u(i,t,r)).reduce((e,t)=>e+t);let n=0,o=0,a=0;for(;a<s;){if(s-a<e){t.push(s-a);break}n+=e;var h=u(i,o,r),h=(n>h&&(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<e[s.CHAR_DATA_CHAR_INDEX].length?t=!0:2===e[s.CHAR_DATA_CHAR_INDEX].length?55296<=(i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0))&&i<=56319&&56320<=(r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1))&&r<=57343?this.content=1024*(i-55296)+r-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0:this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22,t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{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<e?(e-=65536,String.fromCharCode(55296+(e>>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<r;++t){let e=i[t];65535<e?(e-=65536,s+=String.fromCharCode(55296+(e>>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;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++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<n;){if(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<t||(a[l++]=t)),this.interim.fill(0)}let n=h-4,_=c;for(;_<h;){for(;!(!(_<n)||128&(e=o[_])||128&(t=o[_+1])||128&(i=o[_+2])||128&(r=o[_+3]));)a[l++]=e,a[l++]=t,a[l++]=i,a[l++]=r,_+=4;if((e=o[_++])<128)a[l++]=e;else if(192==(224&e)){if(_>=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<s||(a[l++]=s)}}}}return l}}},225:(e,t,i)=>{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;e<s.length;++e)(0,r.fill)(o,0,s[e][0],s[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,r=0,s=t.length-1;if(!(e<t[0][0]||e>t[s][1]))for(;s>=r;)if(e>t[i=r+s>>1][1])r=1+i;else{if(!(e<t[i][0]))return 1;s=i-1}}(e,n)?0:131072<=e&&e<=196605||196608<=e&&e<=262141?2:1}}},5981:(e,t,i)=>{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(5e7<this._pendingData)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(()=>this._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?(50<this._bufferOffset&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._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=1<e.length||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.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;e<t.length;e++)this.table[i<<8|t[e]]=r<<4|s}}t.TransitionTable=h;let _=160;t.VT500_TRANSITION_TABLE=function(){let e=new h(4095),i=Array.apply(null,Array(256)).map((e,t)=>t),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(1<i.prefix.length)throw new Error("only one byte as prefix supported");if((r=i.prefix.charCodeAt(0))&&r<60||63<r)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(2<i.intermediates.length)throw new Error("only two bytes as intermediates are supported");for(let t=0;t<i.intermediates.length;++t){let e=i.intermediates.charCodeAt(t);if(e<32||47<e)throw new Error("intermediate must be in range 0x20 .. 0x2f");r=r<<8|e}}if(1!==i.final.length)throw new Error("final must be a single byte");let t=i.final.charCodeAt(0);if(e[0]>t||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<t)for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 4:if(!1===i&&-1<t)for(;0<=t&&!0!==(o=e[t]());t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 6:if(a=s[this._parseStack.chunkPos],o=this._dcsParser.unhook(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=s[this._parseStack.chunkPos],o=this._oscParser.end(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let r=l;r<n;++r){switch(a=s[r],(h=this._transitions.table[this.currentState<<8|(a<160?a:_)])>>4){case 2:for(let e=r+1;;++e){if(e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let e=this._csiHandlers[this._collect<<8|a],t=e?e.length-1:-1;for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._preserveStack(3,e,t,h,r),o;t<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingCodepoint=0;break;case 8:do{switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}}while(++r<n&&47<(a=s[r])&&a<60);r--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:var c=this._escHandlers[this._collect<<8|a];let i=c?c.length-1:-1;for(;0<=i&&!0!==(o=c[i]());i--)if(o instanceof Promise)return this._preserveStack(4,c,i,h,r),o;i<0&&this._escHandlerFb(this._collect<<8|a),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let e=r+1;;++e)if(e>=n||24===(a=s[e])||26===a||27===a||127<a&&a<_){this._dcsParser.put(s,r,e),r=e-1;break}break;case 14:if(o=this._dcsParser.unhook(24!==a&&26!==a))return this._preserveStack(6,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let e=r+1;;e++)if(e>=n||(a=s[e])<32||127<a&&a<_){this._oscParser.put(s,r,e),r=e-1;break}break;case 6:if(o=this._oscParser.end(24!==a&&26!==a))return this._preserveStack(5,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&h}}}t.EscapeSequenceParser=l},6242:(e,t,i)=>{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(;i<e;){let e=t[i++];if(59===e){this._state=2,this._start();break}if(e<48||57<e)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+e-48}2===this._state&&0<e-i&&this._put(t,i,e)}}end(r,s=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),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].end(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].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._id,"END",r);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>r.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<i.length;++e){let t=i[e];if(Array.isArray(t))for(let e=0;e<t.length;++e)r.addSubParam(t[e]);else r.addParam(t)}return r}clone(){var e=new n(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){var t=[];for(let e=0;e<this.length;++e){t.push(this.params[e]);var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&t.push(Array.prototype.slice.call(this._subParams,i,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=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<e-t?this._subParams.subarray(t,e):null}getSubParamsAll(){var t={};for(let e=0;e<this.length;++e){var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&(t[e]=this._subParams.slice(i,r))}return t}addDigit(e){let t;var i,r;this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits||(r=(i=this._digitIsSub?this._subParams:this.params)[t-1],i[t-1]=~r?Math.min(10*r+e,s):e)}}t.Params=n},5741:(e,t)=>{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<this._addons.length;e++)if(this._addons[e]===i){t=e;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");i.isDisposed=!0,i.dispose.apply(i.instance),this._addons.splice(t,1)}}}},8771:(e,t,i)=>{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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;i=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new a.EventEmitter,this._onScroll=new a.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=new o.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){var i=this.buffer;let r;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var t=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(0===i.scrollTop){let e=i.lines.isFull;s===i.lines.length-1?e?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(s+1,0,r.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let e=s-t+1;i.lines.shiftElements(t+1,e-1,-1),i.lines.set(s,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){var r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;let n=i(2585),o=i(8460),a={NONE:{events:0,restrict:()=>!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<e[0]||255<e[1]||255<e[2]?"":"[M"+l(e[0])+l(e[1])+l(e[2])},SGR:e=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;let n=i(2585),o=i(8460),a=i(1439),h=i(844),l=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});i=class extends h.Disposable{constructor(e,t,i,r){super(),this._bufferService=t,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this._onUserInput=this.register(new o.EventEmitter),this._onBinary=this.register(new o.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._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<s&&(!i||(null!=(r=n.options.layer)?r:"bottom")===i)&&(yield n)}forEachDecorationAtCell(i,e,r,s){this._decorations.forEachByKey(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&&i<a.xmax&&(!r||(null!=(t=e.options.layer)?t:"bottom")===r)&&s(e)})}dispose(){for(var e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()}}t.DecorationService=h;class l extends n.Disposable{constructor(e){super(),this.options=e,this.isDisposed=!1,this.onRenderEmitter=this.register(new s.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(e){e<this._start?this._start=e:e>this._end&&(this._end=e)}markRangeDirty(e,t){var i;t<e&&(i=e,e=t,t=i),e<this._start&&(this._start=e),t>this._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<r.length?r[0].index:e.length;if(e.length!==t)throw new Error(`[createInstance] First service dependency of ${i.name} at position ${t+1} conflicts with ${e.length} static arguments`);return new i(...e,...s)}}},7866: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;let n=i(2585),o={debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};i=class{constructor(e){this._optionsService=e,this.logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange(e=>{"logLevel"===e&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)"function"==typeof t[e]&&(t[e]=t[e]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,"xterm.js: "+t,...i)}debug(e,...t){this.logLevel<=n.LogLevelEnum.DEBUG&&this._log(console.log,e,t)}info(e,...t){this.logLevel<=n.LogLevelEnum.INFO&&this._log(console.info,e,t)}warn(e,...t){this.logLevel<=n.LogLevelEnum.WARN&&this._log(console.warn,e,t)}error(e,...t){this.logLevel<=n.LogLevelEnum.ERROR&&this._log(console.error,e,t)}},i=r([s(0,n.IOptionsService)],i);t.LogService=i},7302:(e,s,t)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(i){var r=this._bufferService.buffer;if(void 0===i.id){let e=r.addMarker(r.ybase+r.y),t={data:i,id:this._nextId++,lines:[e]};return e.onDispose(()=>this._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;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++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
1
+!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;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._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;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)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<t;e++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(0<this._charsToConsume.length&&this._charsToConsume.shift()===e||(this._charsToAnnounce+=e),"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount)&&(this._liveRegion.textContent+=r.tooMuchOutput),s.isMac)&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(()=>{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<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}t.AccessibilityManager=c},3614:(e,t)=>{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;e<t;e++)this.colors.ansi[e+16]=this._parseColor(i.extendedAnsi[e],r.DEFAULT_ANSI_COLORS[e+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(e){if(void 0!==e)switch(e){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this.colors.ansi[e]=this._restoreColors.ansi[e]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(n,o,a=this.allowTransparency){if(void 0===n)return o;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=n,"string"!=typeof this._ctx.fillStyle)return console.warn(`Color: ${n} is invalid using fallback `+o.css),o;this._ctx.fillRect(0,0,1,1);let e=this._ctx.getImageData(0,0,1,1).data;if(255===e[3])return{css:this._ctx.fillStyle,rgba:h.channels.toRgba(e[0],e[1],e[2],e[3])};{if(!a)return console.warn(`Color: ${n} is using transparency, but allowTransparency is false. Using fallback ${o.css}.`),o;let[e,t,i,r]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(e=>Number(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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;let n=i(2585),o=i(8460),a=i(844),h=i(3656);i=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this._onHideLinkUnderline=this.register(new o.EventEmitter),this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(t){return this._linkProviders.push(t),{dispose:()=>{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<i.length;t++){let e=i[t];if(e.classList.contains("xterm"))break;if(e.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._onHover(e),this._lastBufferCell=e)}}}_onHover(e){this._activeLine!==e.y?(this._clearCurrentLink(),this._askForLink(e,!1)):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(r,t){var e,s;this._activeProviderReplies&&t||(null!=(e=this._activeProviderReplies)&&e.forEach(e=>{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;e<t.size;e++){var s=t.get(e);if(s)for(let t=0;t<s.length;t++){var n=s[t],o=n.link.range.start.y<i?0:n.link.range.start.x,a=n.link.range.end.y>i?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;e<r;e++)this._activeProviderReplies.has(e)&&!this._activeProviderReplies.get(e)||(i=!0);if(!i&&t){let e=t.find(e=>this._linkAtPosition(e.link,s));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let t=0;t<this._activeProviderReplies.size;t++){let e=null==(o=this._activeProviderReplies.get(t))?void 0:o.find(e=>this._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.y<t.y,s=e.range.end.y>t.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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;let d=i(511),n=i(2585);i=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(l,e){var c;let _=this._bufferService.buffer.lines.get(l-1);if(_){let i=[],s=this._optionsService.rawOptions.linkHandler,r=new d.CellData,n=_.getTrimmedLength(),o=-1,a=-1,h=!1;for(let t=0;t<n;t++)if(-1!==a||_.hasContent(t)){if(_.loadCell(t,r),r.hasExtendedAttrs()&&r.extended.urlId){if(-1===a){a=t,o=r.extended.urlId;continue}h=r.extended.urlId!==o}else-1!==a&&(h=!0);if(h||-1!==a&&t===n-1){let e=null==(c=this._oscLinkService.getLinkData(o))?void 0:c.uri;if(e){let r={start:{x:a+1,y:l},end:{x:t+(h||t!==n-1?0:1),y:l}};i.push({text:e,range:r,activate:(t,e)=>{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<e||s.coreMouseService.triggerMouseEvent({col:r.col,row:r.row,x:r.x,y:r.y,button:e,action:t,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(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<Math.abs(i);e++)t+=r;return this.coreService.triggerDataEvent(t,!0),this.cancel(e,!0)}}},{passive:!1})),this.register((0,c.addDisposableDomListener)(t,"touchstart",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<t.keyCode)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16!==e.keyCode&&17!==e.keyCode&&18!==e.keyCode&&this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1))}_inputEvent(e){if(!e.data||"insertText"!==e.inputType||e.composed&&this._keyDownSeen||this.optionsService.rawOptions.screenReaderMode)return!1;if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;var t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i;null!=(i=this._charSizeService)&&i.measure(),null!=(i=this.viewport)&&i.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(g.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;var e,t=this._customKeyEventHandler;this._setup(),super.reset(),null!=(e=this._selectionService)&&e.reset(),this._decorationService.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1),null!=(e=this.viewport)&&e.syncScrollArea()}clearTextureAtlas(){var e;null!=(e=this._renderService)&&e.clearTextureAtlas()}_reportFocus(){var e;null!=(e=this.element)&&e.classList.contains("focus")?this.coreService.triggerDataEvent(o.C0.ESC+"[I"):this.coreService.triggerDataEvent(o.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.canvasWidth.toFixed(0),t=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t};${e}t`);break;case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var i=this._renderService.dimensions.actualCellWidth.toFixed(0),r=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(o.C0.ESC+`[6;${r};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;let n=i(844),l=i(3656),o=i(4725),a=i(2585);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._element=r,this._bufferService=s,this._optionsService=n,this._charSizeService=o,this._renderService=a,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._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(0<this._charSizeService.height){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length?(this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,this._refresh(e)):this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){var t;this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?(this._ignoreNextScrollEvent=!1,this._scrollLines(0)):(t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp,this._scrollLines(t)))}_smoothScroll(){var e;this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target||(e=this._smoothScrollPercent(),this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._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||0<t&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}onWheel(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){var i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!=t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}},i=r([s(4,a.IBufferService),s(5,a.IOptionsService),s(6,o.ICharSizeService),s(7,o.IRenderService),s(8,o.ICoreBrowserService)],i);t.Viewport=i},3107: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;let n=i(3656),o=i(4725),a=i(844),h=i(2585);i=class extends a.Disposable{constructor(e,t,i,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._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<this._zonePool.length?(this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++])):(this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++)}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;let a=i(5871),n=i(3656),o=i(4725),h=i(844),l=i(2585),c={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};i=class extends h.Disposable{constructor(e,t,i,r,s,n,o){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=r,this._renderService=s,this._optionsService=n,this._coreBrowseService=o,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null!=(e=this._viewportElement.parentElement)&&e.insertBefore(this._canvas,this._viewportElement);t=this._canvas.getContext("2d");if(!t)throw new Error("Ctx cannot be null");this._ctx=t,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;let n=i(4725),o=i(2585),a=i(2584);i=class{constructor(e,t,i,r,s,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._coreService=s,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{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.length<i.length?this._coreService.triggerDataEvent(""+a.C0.DEL,!0):e.length===i.length&&e!==i&&this._coreService.triggerDataEvent(e,!0))},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,r=e*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=r+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.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;i<Math.abs(a-e);i++){let e="A"===h(r,s)?-1:1,t=n.buffer.lines.get(a+e*i);null!=t&&t.isWrapped&&o++}return o}(e,t,i),p(h(e,t),r))}function v(e,t){let i=0,r=e.buffer.lines.get(t),s=null==r?void 0:r.isWrapped;for(;s&&0<=t&&t<e.rows;)i++,r=e.buffer.lines.get(--t),s=null==r?void 0:r.isWrapped;return i}function h(e,t){return t<e?"A":"B"}function g(e,t,i,r,s,n){let o=e,a=t,h="";for(;o!==i||a!==r;)o+=s?1:-1,s&&o>n.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<t;e++)r+=i;return r}t.moveToCellSequence=function(e,t,i,r){var s,n,o,a,h,l,c=i.buffer.x,_=i.buffer.y;if(!i.buffer.hasScrollback)return u=c,(0===f(a=_,t,h=i,l=r).length?"":S(g(u,a,u,a-v(h,a),!1,h).length,p("D",l)))+f(_,t,i,r)+(u=c,a=e,o=0<f(h=_,l=t,s=i,n=r).length?l-v(s,l):h,h=function(e,t,i,r,s){s=0<f(i,r,s,n).length?r-v(s,r):t;return e<i&&s<=r||i<=e&&s<r?"C":"D"}(u,h,a,l=l,s),S(g(u,o,a,l,"C"===h,s).length,p(h,n)));let d;if(_===t)return d=e<c?"D":"C",S(Math.abs(c-e),p(d,r));d=t<_?"D":"C";var u=Math.abs(_-t);return S(i.cols-(t<_?e:c)+(u-1)*i.cols+1+((t<_?c:e)-1),p(d,r))}},8036:(e,t,i)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;let c=i(3787),n=i(8036),o=i(844),a=i(4725),h=i(2585),l=i(8460),_=i(8055),d=i(9631),u="xterm-dom-renderer-owner-",f="xterm-focus",v=1,g=class extends o.Disposable{constructor(e,t,i,r,s,n,o,a,h,l){super(),this._colors=e,this._element=t,this._screenElement=i,this._viewportElement=r,this._linkifier2=s,this._charSizeService=o,this._optionsService=a,this._bufferService=h,this._coreBrowserService=l,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=n.createInstance(c.DomRendererRowFactory,document,this._colors),this._element.classList.add(u+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(e=>this._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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.STRIKETHROUGH_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;let R=t(8036),k=t(643),a=t(511),s=t(2585),D=t(8055),n=t(4725),A=t(4269),h=t(1752),x=t(3734);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.STRIKETHROUGH_CLASS="xterm-strikethrough",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";t=class{constructor(e,t,i,r,s,n,o){this._document=e,this._colors=t,this._characterJoinerService=i,this._optionsService=r,this._coreBrowserService=s,this._coreService=n,this._decorationService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}setColors(e){this._colors=e}onSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(u,f,v,g,p,S,m,t){var C=this._document.createDocumentFragment(),b=this._characterJoinerService.getJoinedCharacters(f);let i=0;for(let e=Math.min(u.length,t)-1;0<=e;e--)if(u.loadCell(e,this._workCell).getCode()!==k.NULL_CELL_CODE||v&&e===p){i=e+1;break}for(let e=0;e<i;e++){u.loadCell(e,this._workCell);let d=this._workCell.getWidth();if(0!==d){let t=!1,i=e,r=this._workCell;if(0<b.length&&e===b[0][0]){t=!0;let e=b.shift();r=new A.JoinedCellData(this._workCell,u.translateToString(!0,e[0],e[1]),e[1]-e[0]),i=e[1]-1,d=r.getWidth()}var y=this._document.createElement("span");if(1<d&&(y.style.width=m*d+"px"),t&&(y.style.display="inline",p>=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<r[0]&&t<=r[1]:e<i[0]&&t>=i[1]&&e>=r[0]&&t<=r[1]:t>i[1]&&t<r[1]||i[1]===r[1]&&t===i[1]&&e>=i[0]&&e<r[0]||i[1]<r[1]&&t===r[1]&&e<r[0]||i[1]<r[1]&&t===i[1]&&e>=i[0])}};function B(e,t,i){for(;e.length<i;)e=t+e;return e}t=i([r(2,n.ICharacterJoinerService),r(3,s.IOptionsService),r(4,n.ICoreBrowserService),r(5,s.ICoreService),r(6,s.IDecorationService)],t),L.DomRendererRowFactory=t},456:(e,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]&&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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;let n=i(2585),o=i(8460);i=class{constructor(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new a(e,t,this._optionsService)}get hasValidSize(){return 0<this.width&&0<this.height}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}},i=r([s(2,n.IOptionsService)],i);t.CharSizeService=i;class a{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(a,e,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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterJoinerService=e.JoinedCellData=void 0;let s=t(3734),l=t(643),n=t(511),o=t(2585);class h extends s.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=h;t=class a{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new n.CellData}register(e){e={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];var i=this._bufferService.buffer.lines.get(e);if(!i||0===i.length)return[];var r=[],s=i.translateToString(!0);let n=0,o=0,a=0,t=i.getFg(0),h=i.getBg(0);for(let e=0;e<i.getTrimmedLength();e++)if(i.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==t||this._workCell.bg!==h){if(1<e-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}n=e,a=o,t=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(1<this._bufferService.cols-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}return r}_getJoinedRanges(e,t,i,r,s){var n=e.substring(t,i);let o=[];try{o=this._characterJoiners[0].handler(n)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(n);for(let e=0;e<t.length;e++)a._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,s),o}_stringRangesToCellRanges(r,s,e){let n=0,o=!1,a=0,h=r[n];if(h){for(let i=e;i<this._bufferService.cols;i++){let e=s.getWidth(i),t=s.getString(i).length||l.WHITESPACE_CELL_CHAR.length;if(0!==e){if(!o&&h[0]<=a&&(h[0]=i,o=!0),h[1]<=a){if(h[1]=i,!(h=r[++n]))break;o=h[0]<=a&&(h[0]=i,!0)}a+=t}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let r=!1;for(let e=0;e<t.length;e++){var s=t[e];if(r){if(i[1]<=s[0])return t[e-1][1]=i[1],t;if(i[1]<=s[1])return t[e-1][1]=Math.max(i[1],s[1]),t.splice(e,1),t;t.splice(e,1),e--}else{if(i[1]<=s[0])return t.splice(e,0,i),t;if(i[1]<=s[1])return s[0]=Math.min(i[0],s[0]),t;i[0]<s[1]&&(s[0]=Math.min(i[0],s[0]),r=!0)}}return r?t[t.length-1][1]=i[1]:t.push(i),t}},t=i([r(0,o.IBufferService)],t);e.CharacterJoinerService=t},5114:(e,t)=>{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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;let n=i(4725),o=i(9806);i=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,r,s){return(0,o.getCoords)(window,e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,s)}getMouseReportCoords(e,t){e=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;let h=i(6193),l=i(8460),n=i(844),c=i(5596),_=i(3656),o=i(2585),a=i(4725);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a){if(super(),this._renderer=e,this._rowCount=t,this._charSizeService=s,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=new l.EventEmitter,this._onRenderedViewportChange=new l.EventEmitter,this._onRender=new l.EventEmitter,this._onRefreshRequest=new l.EventEmitter,this.register({dispose:()=>this._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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;let a=i(6114),l=i(456),c=i(511),_=i(8460),n=i(4725),o=i(2585),h=i(9806),d=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");i=class extends u.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=r,this._coreService=s,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this._onRedrawRequest=this.register(new _.EventEmitter),this._onSelectionChange=this.register(new _.EventEmitter),this._onRequestScrollLines=this.register(new _.EventEmitter),this._mouseMoveListener=e=>this._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]<s[0]?e:s)[0],r=(e[0]<s[0]?s:e)[0];for(let t=e[1];t<=s[1];t++){let e=n.translateBufferLineToString(t,!0,i,r);o.push(e)}}else{var t=e[1]===s[1]?s[0]:void 0;o.push(n.translateBufferLineToString(e[1],!0,e[0],t));for(let i=e[1]+1;i<=s[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);null!=e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}if(e[1]!==s[1]){let e=n.lines.get(s[1]),t=n.translateBufferLineToString(s[1],!0,0,s[0]);e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}}return o.map(e=>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]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&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._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}}_dragScroll(){var e;this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount&&(this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1}),e=this._bufferService.buffer,0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh())}_onMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){let e=(0,d.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_onBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>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<s&&i[0]!==e&&(r+=s-1)}return r}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,e,t=!0,_=!0){if(!(c[0]>=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(;0<r&&" "===f.charAt(r-1);)r--;for(;s<f.length&&" "===f.charAt(s+1);)s++}else{let t=c[0],i=c[0],e=(0===u.getWidth(t)&&(n++,t--),2===u.getWidth(i)&&(o++,i++),u.getString(i).length);for(1<e&&(h+=e-1,s+=e-1);0<t&&0<r&&!this._isCharWordSeparator(u.loadCell(t-1,this._workCell));){u.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(n++,t--):1<e&&(a+=e-1,r-=e-1),r--,t--}for(;i<u.length&&s+1<f.length&&!this._isCharWordSeparator(u.loadCell(i+1,this._workCell));){u.loadCell(i+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(o++,i++):1<e&&(h+=e-1,s+=e-1),s++,i++}}s++;let i=r+v-n+a,l=Math.min(this._bufferService.cols,s-r+n+o-a-h);if(e||""!==f.slice(r,s).trim()){if(t&&0===i&&32!==u.getCodePoint(0)){let e=d.lines.get(c[1]-1);if(e&&u.isWrapped&&32!==e.getCodePoint(this._bufferService.cols-1)){let t=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;i-=e,l+=e}}}if(_&&i+l===this._bufferService.cols&&32!==u.getCodePoint(this._bufferService.cols-1)){let e=d.lines.get(c[1]+1);if(null!=e&&e.isWrapped&&32!==e.getCodePoint(0)){let e=this._getWordAt([0,c[1]+1],!1,!1,!0);e&&(l+=e.length)}}return{start:i,length:l}}}}}_selectWordAt(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(t){var i=this._getWordAt(t,!0);if(i){let e=t[1];for(;i.start<0;)i.start+=this._bufferService.cols,e--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._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;e<Math.min(t,this.length);e++)i[e]=this._array[this._getCyclicIndex(e)];this._array=i,this._maxLength=t,this._startIndex=0}}get length(){return this._length}set length(t){if(t>this._length)for(let e=this._length;e<t;e++)this._array[e]=void 0;this._length=t}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(t,i,...r){if(i){for(let e=t;e<this._length-i;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+i)];this._length-=i,this.onDeleteEmitter.fire({index:t,amount:i})}for(let e=this._length-1;e>=t;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<r.length;e++)this._array[this._getCyclicIndex(t+e)]=r[e];if(r.length&&this.onInsertEmitter.fire({index:t,amount:r.length}),this._length+r.length>this._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(0<r){for(let e=i-1;0<=e;e--)this.set(t+e+r,this.get(t+e));var e=t+i+r-this._length;if(0<e)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<i;e++)this.set(t+e+r,this.get(t+e))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}},1439:(e,t)=>{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<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function h(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<i&&(0<o||0<a||0<h);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>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<i&&(o<255||a<255||h<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=Math.min(255,h+Math.ceil(.1*(255-h))),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>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)<n){if(e<o){let t=h(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=l(r,s,n);return i>_(o,c.relativeLuminance(e>>8))?t:e}return t}var t=l(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=h(r,s,n);return 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;e<this._listeners.length;e++)if(this._listeners[e]===t)return void this._listeners.splice(e,1)}})),this._event}fire(t,i){var r=[];for(let e=0;e<this._listeners.length;e++)r.push(this._listeners[e]);for(let e=0;e<r.length;e++)r[e].call(void 0,t,i)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e(e=>t.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(24<e)return t.setWinLines;switch(e){case 1:return t.restoreWin;case 2:return t.minimizeWin;case 3:return t.setWinPosition;case 4:return t.setWinSizePixels;case 5:return t.raiseWin;case 6:return t.lowerWin;case 7:return t.refreshWin;case 8:return t.setWinSizeChars;case 9:return t.maximizeWin;case 10:return t.fullscreenWin;case 11:return t.getWinState;case 13:return t.getWinPosition;case 14:return t.getWinSizePixels;case 15:return t.getScreenSizePixels;case 16:return t.getCellSizePixels;case 18:return t.getWinSizeChars;case 19:return t.getScreenSizeChars;case 20:return t.getIconTitle;case 21:return t.getWinTitle;case 22:return t.pushTitle;case 23:return t.popTitle;case 24:return t.setWinLines}}var C;(i=C=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}))[i.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",i[i.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS";class b extends r.Disposable{constructor(e,t,i,r,s,n,o,a,h,l=new _.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._dirtyRowService=r,this._logService=s,this._optionsService=n,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=h,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new v.EventEmitter,this._onRequestRefreshRows=new v.EventEmitter,this._onRequestReset=new v.EventEmitter,this._onRequestSendFocus=new v.EventEmitter,this._onRequestSyncScrollBar=new v.EventEmitter,this._onRequestWindowsOptionsReport=new v.EventEmitter,this._onA11yChar=new v.EventEmitter,this._onA11yTab=new v.EventEmitter,this._onCursorMove=new v.EventEmitter,this._onLineFeed=new v.EventEmitter,this._onScroll=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onColor=new v.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._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.length<r.length&&this._parseBuffer.length<h&&(this._parseBuffer=new Uint32Array(Math.min(r.length,h))),i||this._dirtyRowService.clearRange(),r.length>h)for(let i=t;i<r.length;i+=h){let e=i+h<r.length?i+h:r.length,t="string"==typeof r?this._stringDecoder.decode(r.substring(i,e),this._parseBuffer):this._utf8Decoder.decode(r.subarray(i,e),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,t))return this._preserveStack(n,o,t,i),this._logSlowResolvingAsync(s),s}else if(!i){let e=("string"==typeof r?this._stringDecoder:this._utf8Decoder).decode(r,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,e))return this._preserveStack(n,o,e,0),this._logSlowResolvingAsync(s),s}this._activeBuffer.x===n&&this._activeBuffer.y===o||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(t,i,r){let s,n;var o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,_=this._curAttrData;let d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&0<r-i&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let e=i;e<r;++e){if(s=t[e],n=this._unicodeService.wcwidth(s),s<127&&o){let e=o[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}if(a&&this._onA11yChar.fire((0,u.stringFromCodePoint)(s)),void 0!==this._currentLinkId&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),n||!this._activeBuffer.x){if(this._activeBuffer.x+n-1>=h)if(l){for(;this._activeBuffer.x<h;)d.setCellFromCodePoint(this._activeBuffer.x++,0,1,_.fg,_.bg,_.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=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<n)for(;--n;)d.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else d.getWidth(this._activeBuffer.x-1)?d.addCodepointToCell(this._activeBuffer.x-1,s):d.addCodepointToCell(this._activeBuffer.x-2,s)}0<r-i&&(d.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||65535<this._workCell.getCode()?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<h&&0<r-i&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,e=>!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),0<this._activeBuffer.x)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._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._activeBuffer.x&&this._activeBuffer.x--;return!0}tab(){var e;return this._activeBuffer.x>=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.rows;i++)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=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;0<e&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){for(var i=this._activeBuffer.ybase+this._activeBuffer.y,e=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-e+1;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var i=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom;for(r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}insertChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(f.DEFAULT_ATTR_DATA));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}scrollRight(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}insertColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}deleteColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}eraseChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(this._parser.precedingCodepoint){var t=e.params[0]||1,i=new Uint32Array(t);for(let e=0;e<t;++e)i[e]=this._parser.precedingCodepoint;this.print(i,0,i.length)}return!0}sendDeviceAttributesPrimary(e){return 0<e.params[0]||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return 0<e.params[0]||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;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;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===t.params[e]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){var i=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:s}=this._coreMouseService,n=this._coreService,{buffers:o,cols:a}=this._bufferService,{active:o,alt:h}=o,l=this._optionsService.rawOptions,c=e=>e?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],++t<e.length&&t+o+1+n<s.length;);break}}while(!(5===s[1]&&2<=o+n||2===s[1]&&5<=o+n)&&(s[1]&&(n=1),++o+r<i.length&&o+n<s.length));for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:e.fg=this._updateAttrColor(e.fg,s[1],s[3],s[4],s[5]);break;case 48:e.bg=this._updateAttrColor(e.bg,s[1],s[3],s[4],s[5]);break;case 58:e.extended=e.extended.clone(),e.extended.underlineColor=this._updateAttrColor(e.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),t.extended.underlineStyle=e=!~e||5<e?1:e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(t){if(1===t.length&&0===t.params[0])this._curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=f.DEFAULT_ATTR_DATA.bg;else{var i,r=t.length,s=this._curAttrData;for(let e=0;e<r;e++)30<=(i=t.params[e])&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):40<=i&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):90<=i&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):100<=i&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=f.DEFAULT_ATTR_DATA.fg,s.bg=f.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(t.hasSubParams(e)?t.getSubParams(e)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?e+=this._extractColor(t,e,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i)}return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(d.C0.ESC+"[0n");break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!(this._coreService.decPrivateModes.origin=!1)}setCursorStyle(e){e=e.params[0]||1;switch(e){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}return this._optionsService.options.cursorBlink=e%2==1,!0}setScrollRegion(e){var t=e.params[0]||1;let i;return(i=e.length<2||(i=e.params[1])>this._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=1<e.length?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),10<this._windowTitleStack.length&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),10<this._iconNameStack.length&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let r=[],t=e.split(";");for(;1<t.length;){let e=t.shift(),i=t.shift();if(/^\d+$/.exec(e)){let t=parseInt(e);if(0<=t&&t<256)if("?"===i)r.push({type:0,index:t});else{let e=(0,s.parseColor)(i);e&&r.push({type:1,index:t,color:e})}}}return r.length&&this._onColor.fire(r),!0}setHyperlink(e){e=e.split(";");return!(e.length<2)&&(e[1]?this._createHyperlink(e[0],e[1]):!e[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();e=e.split(":");let i;var r=e.findIndex(e=>e.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<r.length&&!(t>=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<r.length;++e)/^\d+$/.exec(r[e])&&0<=(t=parseInt(r[e]))&&t<256&&i.push({type:2,index:t});i.length&&this._onColor.fire(i)}else this._onColor.fire([{type:2}]);return!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"!==e[0]&&this._charsetService.setgCharset(o[e[0]],c.CHARSETS[e[1]]||c.DEFAULT_CHARSET),!0}index(){return this._restrictCursor(),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._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<this._bufferService.rows;++e){var i=this._activeBuffer.ybase+this._activeBuffer.y+e,i=this._activeBuffer.lines.get(i);i&&(i.fill(t),i.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){var i=this._bufferService.buffer,r=this._optionsService.rawOptions;return i='"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r",this._coreService.triggerDataEvent(d.C0.ESC+i+d.C0.ESC+"\\"),!0}}t.InputHandler=b},844:(e,t)=>{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])===t)}return!1}*getKeyIterator(e){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||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;);}forEachByKey(e,t){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||i>=this._array.length)&&this._getKey(this._array[i])===e)for(;t(this._array[i]),++i<this._array.length&&this._getKey(this._array[i])===e;);}values(){return this._array.values()}_search(e,t,i){if(i<t)return t;let r=Math.floor((t+i)/2);var s=this._getKey(this._array[r]);if(e<s)return this._search(e,t,r-1);if(s<e)return this._search(e,r+1,i);for(;0<r&&this._getKey(this._array[r-1])===e;)r--;return r}}},8273:(e,t)=>{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<s;++e)t[e]=i}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,i,r){return e.fill?e.fill(t,i,r):s(e,t,i,r)},t.fillFallback=s,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},9282:(e,t,i)=>{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&&e<this._rows}_getCorrectBufferLength(e){var t;return this._hasScrollback?(t=e+this._optionsService.rawOptions.scrollback)>i.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),0<this.lines.length){if(this._cols<i)for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);let t=0;if(this._rows<r)for(let e=this._rows;e<r;e++)this.lines.length<r+this.ybase&&(!this._optionsService.rawOptions.windowsMode&&0<this.ybase&&this.lines.length<=this.ybase+this.y+t+1?(this.ybase--,t++,0<this.ydisp&&this.ydisp--):this.lines.push(new S.BufferLine(i,s)));else for(let e=this._rows;e>r;e--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){let e=this.lines.length-n;0<e&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=n}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,r-1),t&&(this.y+=t),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(i,r),this._cols>i))for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);this._cols=i,this._rows=r}get _isReflowEnabled(){return this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._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<i.length&&(i=(0,m.reflowLargerCreateNewLayout)(this.lines,i),(0,m.reflowLargerApplyNewLayout)(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved))}_reflowLargerAdjustViewport(e,t,i){var r=this.getNullCell(S.DEFAULT_ATTR_DATA);let s=i;for(;0<s--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<t&&this.lines.push(new S.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(o,a){let h=this.getNullCell(S.DEFAULT_ATTR_DATA),l=[],c=0;for(let n=this.lines.length-1;0<=n;n--){let e=this.lines.get(n);if(!(!e||!e.isWrapped&&e.getTrimmedLength()<=o)){for(var _=[e];e.isWrapped&&0<n;)e=this.lines.get(--n),_.unshift(e);var d=this.ybase+this.y;if(!(d>=n&&d<n+_.length)){var d=_[_.length-1].getTrimmedLength(),u=(0,m.reflowSmallerGetNewLineLengths)(_,this._cols,o),f=u.length-_.length,v=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f),g=[];for(let e=0;e<f;e++){let e=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);g.push(e)}0<g.length&&(l.push({start:n+_.length+c,newLines:g}),c+=g.length),_.push(...g);let t=u.length-1,i=u[t],r=(0===i&&(t--,i=u[t]),_.length-f-1),s=d;for(;0<=r;){let e=Math.min(s,i);if(void 0===_[t])break;if(_[t].copyCellsFrom(_[r],s-e,i-e,e,!0),0===(i-=e)&&(t--,i=u[t]),0===(s-=e)){r--;let e=Math.max(r,0);s=(0,m.getWrappedLineTrimmedLength)(_,e,this._cols)}}for(let e=0;e<_.length;e++)u[e]<o&&_[e].setCell(u[e],h);let e=f-v;for(;0<e--;)0===this.ybase?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+f,this.ybase+a-1)}}}if(0<l.length){let i=[],r=[];for(let e=0;e<this.lines.length;e++)r.push(this.lines.get(e));let e=this.lines.length,s=e-1,n=0,o=l[n],a=(this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c),0);for(let t=Math.min(this.lines.maxLength-1,e+c-1);0<=t;t--)if(o&&o.start>s+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<p&&this.lines.onTrimEmitter.fire(p)}}stringIndexToBufferIndex(t,i,e=!1){for(;i;){var r=this.lines.get(t);if(!r)return[-1,-1];var s=e?r.getTrimmedLength():r.length;for(let e=0;e<s;++e)if(r.get(e)[n.CHAR_DATA_WIDTH_INDEX]&&(i-=r.get(e)[n.CHAR_DATA_CHAR_INDEX].length||1),i<0)return[t,e];t++}return[t,0]}translateBufferLineToString(e,t,i=0,r){e=this.lines.get(e);return e?e.translateToString(t,i,r):""}getWrappedRangeForLine(e){let t=e,i=e;for(;0<t&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&0<e;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new o.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim(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.line<e.index+e.amount&&t.dispose(),t.line>e.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._current<this._endIndex}next(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._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<t;++e)this.setCell(e,r);this.length=t}get(e){var t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,s.stringFromCodePoint)(i):"",t>>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<t[n.CHAR_DATA_CHAR_INDEX].length?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>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),r<this.length-i){let t=new o.CellData;for(let e=this.length-i-r-1;0<=e;--e)this.setCell(i+r+e,this.loadCell(i+e,t));for(let e=0;e<r;++e)this.setCell(i+e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-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)}deleteCells(i,r,s,e){if(i%=this.length,r<this.length-i){let t=new o.CellData;for(let e=0;e<this.length-i-r;++e)this.setCell(i+e,this.loadCell(i+r+e,t));for(let e=this.length-r;e<this.length;++e)this.setCell(e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);i&&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),0!==this.getWidth(i)||this.hasContent(i)||this.setCellFromCodePoint(i,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)}replaceCells(e,t,i,r,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)}resize(t,i){if(t!==this.length){if(t>this.length){var e=new Uint32Array(3*t);this.length&&(3*t<this._data.length?e.set(this._data.subarray(0,3*t)):e.set(this._data)),this._data=e;for(let e=this.length;e<t;++e)this.setCell(e,i)}else if(t){let e=new Uint32Array(3*t);e.set(this._data.subarray(0,3*t)),this._data=e;var r=Object.keys(this._combined);for(let e=0;e<r.length;e++){var s=parseInt(r[e],10);t<=s&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=t}}fill(t,e=!1){if(e)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){var e,t,i=new h(0);for(e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(t in this._extendedAttrs)i._extendedAttrs[t]=this._extendedAttrs[t];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;0<=e;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>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<e;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])}var o=Object.keys(i._combined);for(let t=0;t<o.length;t++){let e=parseInt(o[t],10);e>=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<t;){let e=this._data[3*i+0],t=2097151&e;r+=2097152&e?this._combined[i]:t?(0,s.stringFromCodePoint)(t):n.WHITESPACE_CELL_CHAR,i+=e>>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<r.length-1;i++){let e=i,t=r.get(++e);if(t.isWrapped){for(var d=[r.get(i)];e<r.length&&t.isWrapped;)d.push(t),t=r.get(++e);if(!(s>=i&&s<e)){let s=0,n=u(d,s,h),o=1,a=0;for(;o<d.length;){let e=u(d,o,h),t=e-a,i=l-n,r=Math.min(t,i);d[s].copyCellsFrom(d[o],a,n,r,!1),(n+=r)===l&&(s++,n=0),(a+=r)===e&&(o++,a=0),0===n&&0!==s&&2===d[s-1].getWidth(l-1)&&(d[s].copyCellsFrom(d[s-1],l-1,n++,1,!1),d[s-1].setCell(l-1,c))}d[s].replaceCells(n,l,c);let t=0;for(let e=d.length-1;0<e&&(e>s||0===d[e].getTrimmedLength());e--)t++;0<t&&(_.push(i+d.length-t),_.push(t))}i+=d.length-1}}return _},t.reflowLargerCreateNewLayout=function(i,r){let e=[],s=0,n=r[s],o=0;for(let t=0;t<i.length;t++)if(n===t){let e=r[++s];i.onDeleteEmitter.fire({index:t-o,amount:e}),t+=e-1,o+=e,n=r[++s]}else e.push(t);return{layout:e,countRemoved:o}},t.reflowLargerApplyNewLayout=function(t,i){var r=[];for(let e=0;e<i.length;e++)r.push(t.get(i[e]));for(let e=0;e<r.length;e++)t.set(e,r[e]);t.length=i.length},t.reflowSmallerGetNewLineLengths=function(i,r,e){var t=[],s=i.map((e,t)=>u(i,t,r)).reduce((e,t)=>e+t);let n=0,o=0,a=0;for(;a<s;){if(s-a<e){t.push(s-a);break}n+=e;var h=u(i,o,r),h=(n>h&&(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<e[s.CHAR_DATA_CHAR_INDEX].length?t=!0:2===e[s.CHAR_DATA_CHAR_INDEX].length?55296<=(i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0))&&i<=56319&&56320<=(r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1))&&r<=57343?this.content=1024*(i-55296)+r-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0:this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22,t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{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<e?(e-=65536,String.fromCharCode(55296+(e>>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<r;++t){let e=i[t];65535<e?(e-=65536,s+=String.fromCharCode(55296+(e>>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;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++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<n;){if(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<t||(a[l++]=t)),this.interim.fill(0)}let n=h-4,_=c;for(;_<h;){for(;!(!(_<n)||128&(e=o[_])||128&(t=o[_+1])||128&(i=o[_+2])||128&(r=o[_+3]));)a[l++]=e,a[l++]=t,a[l++]=i,a[l++]=r,_+=4;if((e=o[_++])<128)a[l++]=e;else if(192==(224&e)){if(_>=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<s||(a[l++]=s)}}}}return l}}},225:(e,t,i)=>{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;e<s.length;++e)(0,r.fill)(o,0,s[e][0],s[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,r=0,s=t.length-1;if(!(e<t[0][0]||e>t[s][1]))for(;s>=r;)if(e>t[i=r+s>>1][1])r=1+i;else{if(!(e<t[i][0]))return 1;s=i-1}}(e,n)?0:131072<=e&&e<=196605||196608<=e&&e<=262141?2:1}}},5981:(e,t,i)=>{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(5e7<this._pendingData)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(()=>this._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?(50<this._bufferOffset&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._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=1<e.length||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.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;e<t.length;e++)this.table[i<<8|t[e]]=r<<4|s}}t.TransitionTable=h;let _=160;t.VT500_TRANSITION_TABLE=function(){let e=new h(4095),i=Array.apply(null,Array(256)).map((e,t)=>t),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(1<i.prefix.length)throw new Error("only one byte as prefix supported");if((r=i.prefix.charCodeAt(0))&&r<60||63<r)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(2<i.intermediates.length)throw new Error("only two bytes as intermediates are supported");for(let t=0;t<i.intermediates.length;++t){let e=i.intermediates.charCodeAt(t);if(e<32||47<e)throw new Error("intermediate must be in range 0x20 .. 0x2f");r=r<<8|e}}if(1!==i.final.length)throw new Error("final must be a single byte");let t=i.final.charCodeAt(0);if(e[0]>t||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<t)for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 4:if(!1===i&&-1<t)for(;0<=t&&!0!==(o=e[t]());t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 6:if(a=s[this._parseStack.chunkPos],o=this._dcsParser.unhook(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=s[this._parseStack.chunkPos],o=this._oscParser.end(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let r=l;r<n;++r){switch(a=s[r],(h=this._transitions.table[this.currentState<<8|(a<160?a:_)])>>4){case 2:for(let e=r+1;;++e){if(e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let e=this._csiHandlers[this._collect<<8|a],t=e?e.length-1:-1;for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._preserveStack(3,e,t,h,r),o;t<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingCodepoint=0;break;case 8:do{switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}}while(++r<n&&47<(a=s[r])&&a<60);r--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:var c=this._escHandlers[this._collect<<8|a];let i=c?c.length-1:-1;for(;0<=i&&!0!==(o=c[i]());i--)if(o instanceof Promise)return this._preserveStack(4,c,i,h,r),o;i<0&&this._escHandlerFb(this._collect<<8|a),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let e=r+1;;++e)if(e>=n||24===(a=s[e])||26===a||27===a||127<a&&a<_){this._dcsParser.put(s,r,e),r=e-1;break}break;case 14:if(o=this._dcsParser.unhook(24!==a&&26!==a))return this._preserveStack(6,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let e=r+1;;e++)if(e>=n||(a=s[e])<32||127<a&&a<_){this._oscParser.put(s,r,e),r=e-1;break}break;case 6:if(o=this._oscParser.end(24!==a&&26!==a))return this._preserveStack(5,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&h}}}t.EscapeSequenceParser=l},6242:(e,t,i)=>{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(;i<e;){let e=t[i++];if(59===e){this._state=2,this._start();break}if(e<48||57<e)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+e-48}2===this._state&&0<e-i&&this._put(t,i,e)}}end(r,s=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),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].end(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].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._id,"END",r);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>r.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<i.length;++e){let t=i[e];if(Array.isArray(t))for(let e=0;e<t.length;++e)r.addSubParam(t[e]);else r.addParam(t)}return r}clone(){var e=new n(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){var t=[];for(let e=0;e<this.length;++e){t.push(this.params[e]);var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&t.push(Array.prototype.slice.call(this._subParams,i,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=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<e-t?this._subParams.subarray(t,e):null}getSubParamsAll(){var t={};for(let e=0;e<this.length;++e){var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&(t[e]=this._subParams.slice(i,r))}return t}addDigit(e){let t;var i,r;this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits||(r=(i=this._digitIsSub?this._subParams:this.params)[t-1],i[t-1]=~r?Math.min(10*r+e,s):e)}}t.Params=n},5741:(e,t)=>{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<this._addons.length;e++)if(this._addons[e]===i){t=e;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");i.isDisposed=!0,i.dispose.apply(i.instance),this._addons.splice(t,1)}}}},8771:(e,t,i)=>{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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;i=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new a.EventEmitter,this._onScroll=new a.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=new o.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){var i=this.buffer;let r;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var t=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(0===i.scrollTop){let e=i.lines.isFull;s===i.lines.length-1?e?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(s+1,0,r.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let e=s-t+1;i.lines.shiftElements(t+1,e-1,-1),i.lines.set(s,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){var r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;let n=i(2585),o=i(8460),a={NONE:{events:0,restrict:()=>!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<e[0]||255<e[1]||255<e[2]?"":"[M"+l(e[0])+l(e[1])+l(e[2])},SGR:e=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;let n=i(2585),o=i(8460),a=i(1439),h=i(844),l=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});i=class extends h.Disposable{constructor(e,t,i,r){super(),this._bufferService=t,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this._onUserInput=this.register(new o.EventEmitter),this._onBinary=this.register(new o.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._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<s&&(!i||(null!=(r=n.options.layer)?r:"bottom")===i)&&(yield n)}forEachDecorationAtCell(i,e,r,s){this._decorations.forEachByKey(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&&i<a.xmax&&(!r||(null!=(t=e.options.layer)?t:"bottom")===r)&&s(e)})}dispose(){for(var e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()}}t.DecorationService=h;class l extends n.Disposable{constructor(e){super(),this.options=e,this.isDisposed=!1,this.onRenderEmitter=this.register(new s.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(e){e<this._start?this._start=e:e>this._end&&(this._end=e)}markRangeDirty(e,t){var i;t<e&&(i=e,e=t,t=i),e<this._start&&(this._start=e),t>this._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<r.length?r[0].index:e.length;if(e.length!==t)throw new Error(`[createInstance] First service dependency of ${i.name} at position ${t+1} conflicts with ${e.length} static arguments`);return new i(...e,...s)}}},7866: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<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;let n=i(2585),o={debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};i=class{constructor(e){this._optionsService=e,this.logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange(e=>{"logLevel"===e&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)"function"==typeof t[e]&&(t[e]=t[e]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,"xterm.js: "+t,...i)}debug(e,...t){this.logLevel<=n.LogLevelEnum.DEBUG&&this._log(console.log,e,t)}info(e,...t){this.logLevel<=n.LogLevelEnum.INFO&&this._log(console.info,e,t)}warn(e,...t){this.logLevel<=n.LogLevelEnum.WARN&&this._log(console.warn,e,t)}error(e,...t){this.logLevel<=n.LogLevelEnum.ERROR&&this._log(console.error,e,t)}},i=r([s(0,n.IOptionsService)],i);t.LogService=i},7302:(e,s,t)=>{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):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(i){var r=this._bufferService.buffer;if(void 0===i.id){let e=r.addMarker(r.ybase+r.y),t={data:i,id:this._nextId++,lines:[e]};return e.onDispose(()=>this._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;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++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
public/scripts/zlib-inflate-min.js
+1
-1
@@ -1 +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;i<E;i++)A[L[B+i]]++;for(l=Z,o=15;1<=o&&0==A[o];o--);if(o<l&&(l=o),0==o)R[x++]=f={op:64,bits:1,val:0},R[x++]=f,2==a?t.distbits=1:t.lenbits=1,t.next=x;else{for(s=1;s<o&&0==A[s];s++);for(l<s&&(l=s),z=v=1;z<=15;z++)if((v=(v<<=1)-A[z])<0)return-1;if(0<v&&(0==a||1!=o))return t.next=x,-1;for(S[1]=0,z=1;z<15;z++)S[z+1]=S[z]+A[z];for(i=0;i<E;i++)0!=L[B+i]&&(I[S[L[B+i]]++]=i);switch(a){case 0:m=k=I,g=_=0,w=19;break;case 1:m=C,k=O,g=_=-257,w=256;break;default:m=T,k=y,g=_=0,w=-1}if(z=s,u=x,b=i=n=0,h=-1,c=(p=1<<(e=l))-1,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;for(;;){for(f={op:0,bits:z-b,val:0},I[i]<w?f.val=I[i]:I[i]>w?(f.op=k[g+I[i]],f.val=m[_+I[i]]):f.op=96,d=1<<z-b,s=r=1<<e;R[u+(n>>>b)+(r-=d)]=f,0!=r;);for(d=1<<z-1;n&d;)d>>>=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<z&&(n&c)!=h){for(u+=s,v=1<<(e=z-(b=0==b?l:b));e+b<o&&!((v-=A[e+b])<=0);)e++,v<<=1;if(p+=1<<e,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;R[x+(h=n&c)]={op:e,bits:l,val:u-x}}}0!=n&&(R[u+n]={op:64,bits:z-b,val:0}),t.next=x+p,2==a?t.distbits=l:t.lenbits=l}return 0}function i(t){for(var a=new Array(t),i=0;i<t;i++)a[i]=0;return a}function l(t,a,i){return t&&a in t?t[a]:i}function o(){return 0}function s(){this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=i(320),this.work=i(288),this.codes=new Array(1444);for(var t={op:0,bits:0,val:0},a=0;a<1444;a++)this.codes[a]=t;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var a;return t&&t.state?(a=t.state,t.total_in=t.total_out=a.total=0,t.msg=null,a.wrap&&(t.adler=1&a.wrap),a.mode=0,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=0,a.distcode=0,a.next=0,a.sane=1,a.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,a){var i,s;return!t||!t.state||(s=t.state,(a=void 0===a?15:a)<0?(i=0,a=-a):(i=1+(a>>>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<a))?ZLIB.Z_STREAM_ERROR:(s.window&&s.wbits!=a&&(s.window=null),s.wrap=i,s.wbits=a,s.wsize=0,s.whave=0,s.wnext=0,ZLIB.inflateResetKeep(t))},ZLIB.inflateInit=function(t){var a=new ZLIB.z_stream;return a.state=new s,ZLIB.inflateReset(a,t),a},ZLIB.inflatePrime=function(t,a,i){if(!t||!t.state)return ZLIB.Z_STREAM_ERROR;if(t=t.state,a<0)t.hold=0,t.bits=0;else{if(16<a||32<t.bits+a)return ZLIB.Z_STREAM_ERROR;t.hold+=(i&=(1<<a)-1)<<t.bits,t.bits+=a}return ZLIB.Z_OK};var J=null,Q=null;function V(t,a){t.state.check=t.checksum_function(t.state.check,[255&a,a>>>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++))<<t.bits,t.bits+=8,1)}function at(t,a){for(;t.bits<a;)if(!tt(t))return;return 1}function it(t,a){return t.hold&(1<<a)-1}function st(t,a){t.hold>>>=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<<p,t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=512&s.hold?9:Y,$(s)}}break;case 1:if(!at(s,16))break t;if(i.flags=s.hold,(255&i.flags)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",i.mode=q;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=q;break}null!==i.head&&(i.head.text=s.hold>>>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<i.head.name_max&&(i.head.name+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.name=null);i.length=0,i.mode=7;case 7:if(4096&i.flags){if(0==s.have)break t;for(e=0,null!==i.head&&null===i.head.comment&&(i.head.comment="");p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length<i.head.comm_max&&(i.head.comment+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.comment=null);i.mode=8;case 8:if(512&i.flags){if(!at(s,16))break t;if(s.hold!=(65535&i.check)){t.msg="header crc mismatch",i.mode=q;break}$(s)}null!==i.head&&(i.head.hcrc=i.flags>>>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),286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=q;break}i.have=0,i.mode=17;case 17:for(;i.have<i.ncode;){if(!at(s,3))break t;var M=it(s,3);i.lens[et[i.have++]]=M,st(s,3)}for(;i.have<19;)i.lens[et[i.have++]]=0;if(i.next=0,i.lencode=0,i.lenbits=7,n=G(i,0)){t.msg="invalid code lengths set",i.mode=q;break}i.have=0,i.mode=18;case 18:for(;i.have<i.nlen+i.ndist;){for(;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.val<16)st(s,b.bits),i.lens[i.have++]=b.val;else{if(16==b.val){if(!at(s,b.bits+2))break t;if(st(s,b.bits),0==i.have){t.msg="invalid bit length repeat",i.mode=q;break}p=i.lens[i.have-1],e=3+it(s,2),st(s,2)}else if(17==b.val){if(!at(s,b.bits+3))break t;st(s,b.bits),p=0,e=3+it(s,3),st(s,3)}else{if(!at(s,b.bits+7))break t;st(s,b.bits),p=0,e=11+it(s,7),st(s,7)}if(i.have+e>i.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<<L.lenbits)-1,P=(1<<L.distbits)-1;a:do{for(O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[H+(C&U)];;){if(C>>>=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)-1))];continue}if(32&k){L.mode=Y;break a}w.msg="invalid literal/length code",L.mode=q;break a}for(g=_.val,(k&=15)&&(O<k&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),g+=C&(1<<k)-1,C>>>=k,O-=k),O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[j+(C&P)];;){if(C>>>=k=_.bits,O-=k,!(16&(k=_.op))){if(0==(64&k)){_=T[j+(_.val+(C&(1<<k)-1))];continue}w.msg="invalid distance code",L.mode=q;break a}if(y=_.val,O<(k&=15)&&(C+=(255&B.charCodeAt(R++))<<O,(O+=8)<k)&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),y+=C&(1<<k)-1,C>>>=k,O-=k,(k=A-K)<y){if(F<(k=y-k)&&L.sane){w.msg="invalid distance too far back",L.mode=q;break a}I=-1,(Z=0)==N?(Z+=D-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),A+=k,k=0,Z=-1,I=A-y)):(Z+=N-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),Z=-1,I=(A+=k)-y))}else Z=-1,I=A-y;if(0<=Z)w.output_data+=z.substring(Z,Z+g),A+=g,Z+=g;else{var y=g;for(A-I<y&&(y=A-I),w.output_data+=w.output_data.substring(I,I+y),I+=y,A=A+y+(g-=y);2<g;)w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),g-=3;g&&(w.output_data+=w.output_data.charAt(I++),1<g)&&(w.output_data+=w.output_data.charAt(I++))}break}}break}}while(R<E&&A<S);C&=(1<<(O-=(g=O>>>3)<<3))-1,w.next_in=R-=g,w.next_out=A,w.avail_in=R<E?E-R+5:5-(R-E),w.avail_out=A<S?S-A+257:257-(A-S),L.hold=C,L.bits=O,W(t,s),i.mode==Y&&(i.back=-1);break}for(i.back=0;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.op&&0==(240&b.op)){for(v=b;b=i.codes[i.lencode+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,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<q&&(i.mode<26||a!=ZLIB.Z_FINISH))&&(r=(d=t).state,h=d.output_data.length,null===r.window&&(r.window=""),0==r.wsize&&(r.wsize=1<<r.wbits),r.wsize<=h?r.window=d.output_data.substring(h-r.wsize):r.whave+h<r.wsize?r.window+=d.output_data:r.window=r.window.substring(r.whave-(r.wsize-h))+d.output_data,r.whave=r.window.length,r.wnext=r.whave<r.wsize?r.whave:0),l-=t.avail_out,t.total_in+=o-=t.avail_in,t.total_out+=l,i.total+=l,i.wrap&&l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,0,t.output_data.length)),t.data_type=i.bits+(i.last?64:0)+(i.mode==Y?128:0)+(19==i.mode||14==i.mode?256:0),n=(0==o&&0==l||a==ZLIB.Z_FINISH)&&n==ZLIB.Z_OK?ZLIB.Z_BUF_ERROR:n},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,a){this.input_data=t,this.next_in=l(a,"next_in",0),this.avail_in=l(a,"avail_in",t.length-this.next_in),i=l(a,"flush",ZLIB.Z_SYNC_FLUSH),s=l(a,"avail_out",-1);var i,s,o="";do{if(this.avail_out=0<=s?s:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,i),0<=s)return this.output_data}while((o+=this.output_data,!(0<this.avail_out))&&this.error==ZLIB.Z_OK);return o},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}}()
\ No newline at end of file
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;i<E;i++)A[L[B+i]]++;for(l=Z,o=15;1<=o&&0==A[o];o--);if(o<l&&(l=o),0==o)R[x++]=f={op:64,bits:1,val:0},R[x++]=f,2==a?t.distbits=1:t.lenbits=1,t.next=x;else{for(s=1;s<o&&0==A[s];s++);for(l<s&&(l=s),z=v=1;z<=15;z++)if((v=(v<<=1)-A[z])<0)return-1;if(0<v&&(0==a||1!=o))return t.next=x,-1;for(S[1]=0,z=1;z<15;z++)S[z+1]=S[z]+A[z];for(i=0;i<E;i++)0!=L[B+i]&&(I[S[L[B+i]]++]=i);switch(a){case 0:m=k=I,g=_=0,w=19;break;case 1:m=C,k=O,g=_=-257,w=256;break;default:m=T,k=y,g=_=0,w=-1}if(z=s,u=x,b=i=n=0,h=-1,c=(p=1<<(e=l))-1,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;for(;;){for(f={op:0,bits:z-b,val:0},I[i]<w?f.val=I[i]:I[i]>w?(f.op=k[g+I[i]],f.val=m[_+I[i]]):f.op=96,d=1<<z-b,s=r=1<<e;R[u+(n>>>b)+(r-=d)]=f,0!=r;);for(d=1<<z-1;n&d;)d>>>=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<z&&(n&c)!=h){for(u+=s,v=1<<(e=z-(b=0==b?l:b));e+b<o&&!((v-=A[e+b])<=0);)e++,v<<=1;if(p+=1<<e,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;R[x+(h=n&c)]={op:e,bits:l,val:u-x}}}0!=n&&(R[u+n]={op:64,bits:z-b,val:0}),t.next=x+p,2==a?t.distbits=l:t.lenbits=l}return 0}function i(t){for(var a=new Array(t),i=0;i<t;i++)a[i]=0;return a}function l(t,a,i){return t&&a in t?t[a]:i}function o(){return 0}function s(){this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=i(320),this.work=i(288),this.codes=new Array(1444);for(var t={op:0,bits:0,val:0},a=0;a<1444;a++)this.codes[a]=t;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var a;return t&&t.state?(a=t.state,t.total_in=t.total_out=a.total=0,t.msg=null,a.wrap&&(t.adler=1&a.wrap),a.mode=0,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=0,a.distcode=0,a.next=0,a.sane=1,a.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,a){var i,s;return!t||!t.state||(s=t.state,(a=void 0===a?15:a)<0?(i=0,a=-a):(i=1+(a>>>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<a))?ZLIB.Z_STREAM_ERROR:(s.window&&s.wbits!=a&&(s.window=null),s.wrap=i,s.wbits=a,s.wsize=0,s.whave=0,s.wnext=0,ZLIB.inflateResetKeep(t))},ZLIB.inflateInit=function(t){var a=new ZLIB.z_stream;return a.state=new s,ZLIB.inflateReset(a,t),a},ZLIB.inflatePrime=function(t,a,i){if(!t||!t.state)return ZLIB.Z_STREAM_ERROR;if(t=t.state,a<0)t.hold=0,t.bits=0;else{if(16<a||32<t.bits+a)return ZLIB.Z_STREAM_ERROR;t.hold+=(i&=(1<<a)-1)<<t.bits,t.bits+=a}return ZLIB.Z_OK};var J=null,Q=null;function V(t,a){t.state.check=t.checksum_function(t.state.check,[255&a,a>>>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++))<<t.bits,t.bits+=8,1)}function at(t,a){for(;t.bits<a;)if(!tt(t))return;return 1}function it(t,a){return t.hold&(1<<a)-1}function st(t,a){t.hold>>>=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<<p,t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=512&s.hold?9:Y,$(s)}}break;case 1:if(!at(s,16))break t;if(i.flags=s.hold,(255&i.flags)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",i.mode=q;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=q;break}null!==i.head&&(i.head.text=s.hold>>>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<i.head.name_max&&(i.head.name+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.name=null);i.length=0,i.mode=7;case 7:if(4096&i.flags){if(0==s.have)break t;for(e=0,null!==i.head&&null===i.head.comment&&(i.head.comment="");p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length<i.head.comm_max&&(i.head.comment+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.comment=null);i.mode=8;case 8:if(512&i.flags){if(!at(s,16))break t;if(s.hold!=(65535&i.check)){t.msg="header crc mismatch",i.mode=q;break}$(s)}null!==i.head&&(i.head.hcrc=i.flags>>>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),286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=q;break}i.have=0,i.mode=17;case 17:for(;i.have<i.ncode;){if(!at(s,3))break t;var M=it(s,3);i.lens[et[i.have++]]=M,st(s,3)}for(;i.have<19;)i.lens[et[i.have++]]=0;if(i.next=0,i.lencode=0,i.lenbits=7,n=G(i,0)){t.msg="invalid code lengths set",i.mode=q;break}i.have=0,i.mode=18;case 18:for(;i.have<i.nlen+i.ndist;){for(;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.val<16)st(s,b.bits),i.lens[i.have++]=b.val;else{if(16==b.val){if(!at(s,b.bits+2))break t;if(st(s,b.bits),0==i.have){t.msg="invalid bit length repeat",i.mode=q;break}p=i.lens[i.have-1],e=3+it(s,2),st(s,2)}else if(17==b.val){if(!at(s,b.bits+3))break t;st(s,b.bits),p=0,e=3+it(s,3),st(s,3)}else{if(!at(s,b.bits+7))break t;st(s,b.bits),p=0,e=11+it(s,7),st(s,7)}if(i.have+e>i.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<<L.lenbits)-1,P=(1<<L.distbits)-1;a:do{for(O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[H+(C&U)];;){if(C>>>=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)-1))];continue}if(32&k){L.mode=Y;break a}w.msg="invalid literal/length code",L.mode=q;break a}for(g=_.val,(k&=15)&&(O<k&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),g+=C&(1<<k)-1,C>>>=k,O-=k),O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[j+(C&P)];;){if(C>>>=k=_.bits,O-=k,!(16&(k=_.op))){if(0==(64&k)){_=T[j+(_.val+(C&(1<<k)-1))];continue}w.msg="invalid distance code",L.mode=q;break a}if(y=_.val,O<(k&=15)&&(C+=(255&B.charCodeAt(R++))<<O,(O+=8)<k)&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),y+=C&(1<<k)-1,C>>>=k,O-=k,(k=A-K)<y){if(F<(k=y-k)&&L.sane){w.msg="invalid distance too far back",L.mode=q;break a}I=-1,(Z=0)==N?(Z+=D-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),A+=k,k=0,Z=-1,I=A-y)):(Z+=N-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),Z=-1,I=(A+=k)-y))}else Z=-1,I=A-y;if(0<=Z)w.output_data+=z.substring(Z,Z+g),A+=g,Z+=g;else{var y=g;for(A-I<y&&(y=A-I),w.output_data+=w.output_data.substring(I,I+y),I+=y,A=A+y+(g-=y);2<g;)w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),g-=3;g&&(w.output_data+=w.output_data.charAt(I++),1<g)&&(w.output_data+=w.output_data.charAt(I++))}break}}break}}while(R<E&&A<S);C&=(1<<(O-=(g=O>>>3)<<3))-1,w.next_in=R-=g,w.next_out=A,w.avail_in=R<E?E-R+5:5-(R-E),w.avail_out=A<S?S-A+257:257-(A-S),L.hold=C,L.bits=O,W(t,s),i.mode==Y&&(i.back=-1);break}for(i.back=0;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.op&&0==(240&b.op)){for(v=b;b=i.codes[i.lencode+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,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<q&&(i.mode<26||a!=ZLIB.Z_FINISH))&&(r=(d=t).state,h=d.output_data.length,null===r.window&&(r.window=""),0==r.wsize&&(r.wsize=1<<r.wbits),h>=r.wsize?r.window=d.output_data.substring(h-r.wsize):r.whave+h<r.wsize?r.window+=d.output_data:r.window=r.window.substring(r.whave-(r.wsize-h))+d.output_data,r.whave=r.window.length,r.whave<r.wsize?r.wnext=r.whave:r.wnext=0),o-=t.avail_in,l-=t.avail_out,t.total_in+=o,t.total_out+=l,i.total+=l,i.wrap&&l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,0,t.output_data.length)),t.data_type=i.bits+(i.last?64:0)+(i.mode==Y?128:0)+(19==i.mode||14==i.mode?256:0),n=(0==o&&0==l||a==ZLIB.Z_FINISH)&&n==ZLIB.Z_OK?ZLIB.Z_BUF_ERROR:n},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,a){this.input_data=t,this.next_in=l(a,"next_in",0),this.avail_in=l(a,"avail_in",t.length-this.next_in),i=l(a,"flush",ZLIB.Z_SYNC_FLUSH),s=l(a,"avail_out",-1);var i,s,o="";do{if(this.avail_out=0<=s?s:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,i),0<=s)return this.output_data}while((o+=this.output_data,!(0<this.avail_out))&&this.error==ZLIB.Z_OK);return o},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}}()
\ No newline at end of file