From 299192ea05067276b473dce5ff68b22d710b265b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 18 Jan 2021 03:00:30 +0000 Subject: [PATCH] chore(release): 4.39.2 [skip ci] --- CHANGELOG.md | 8 ++++++++ dist/main-3af7aad3.js | 2 ++ dist/main-3af7aad3.js.map | 1 + dist/main-f082673e.js | 2 -- dist/main-f082673e.js.map | 1 - dist/main.js | 2 +- ...fc.js => minimap-plugin-generator-element-27adcab9.js} | 4 ++-- ...p => minimap-plugin-generator-element-27adcab9.js.map} | 2 +- package-lock.json | 2 +- package.json | 2 +- 10 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 dist/main-3af7aad3.js create mode 100644 dist/main-3af7aad3.js.map delete mode 100644 dist/main-f082673e.js delete mode 100644 dist/main-f082673e.js.map rename dist/{minimap-plugin-generator-element-d36805fc.js => minimap-plugin-generator-element-27adcab9.js} (99%) rename dist/{minimap-plugin-generator-element-d36805fc.js.map => minimap-plugin-generator-element-27adcab9.js.map} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 699e167b..e28428f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [4.39.2](https://github.com/atom-minimap/minimap/compare/v4.39.1...v4.39.2) (2021-01-18) + + +### Bug Fixes + +* add minimap.destroy to minimapForEditor just in case ([40a4676](https://github.com/atom-minimap/minimap/commit/40a467623a257732f54824e7a8a99f14ade706c9)) +* dispose the editorSubscription if minimap is deactivated before destroying the editor ([7b359b3](https://github.com/atom-minimap/minimap/commit/7b359b364343fb575e46fcee41b9812a553ecfb1)) + ## [4.39.1](https://github.com/atom-minimap/minimap/compare/v4.39.0...v4.39.1) (2021-01-17) diff --git a/dist/main-3af7aad3.js b/dist/main-3af7aad3.js new file mode 100644 index 00000000..6592dc45 --- /dev/null +++ b/dist/main-3af7aad3.js @@ -0,0 +1,2 @@ +"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function t(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((i=>{var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})})),t}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function h(e){if(null==Qe&&(Qe=Ze),!Qe.isDisposable(e))throw new TypeError("Arguments to CompositeDisposable.add must have a .dispose() method")}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,i){return t&&c(e.prototype,t),i&&c(e,i),e}function p(){var e={},t=0,i=0,n=0;return{add(s,o){o||(o=s,s=0),s>i?i=s:n>s&&(n=s),e[s]||(e[s]=[]),e[s].push(o),t++},process(){for(var t=n;i>=t;t++)for(var s=e[t],o=0;s.length>o;o++)(0,s[o])()},size:()=>t}}function m(e){return e[wt]={},g(e)}function g(e){return e[wt]}function f(e){delete e[wt]}function v(e){return Array.isArray(e)||void 0!==e.length}function b(e){if(Array.isArray(e))return e;var t=[];return Dt(e,(e=>{t.push(e)})),t}function y(e){return e&&1===e.nodeType}function S(e,t,i){var n=e[t];return null==n&&void 0!==i?i:n}function w(e){return e?e.replace(kt,"\\$&"):""}function x(e){return e?(e=`${e[0].toLowerCase()}${e.slice(1)}`).replace(Lt,((e,t)=>t?"-"+t.toLowerCase():"-")):""}function C(){const e=Error().stack.split("\n")[3].split("(")[1].replace(")",""),t=RegExp(atom.packages.getPackageDirPaths().join("|")+w($e.default.sep)),i=e.replace(t,"").split($e.default.sep)[0].replace(/minimap-|-minimap/,"");return 0>i.indexOf($e.default.sep)?i:void 0}function E(e,t,i,n){const s=[];return e.isLessThan(i)?s.push([e,i]):i.isLessThan(e)&&s.push([i,e]),t.isLessThan(n)?s.push([t,n]):n.isLessThan(t)&&s.push([n,t]),s}function M(e,t,i,n,s,o,r,a,l,h,d,c,u,p,m,g){const f=z(t,i,o,n,s),v=e.context;if(e.clearCanvas(),0===f.length)L(t,i,0,r,a,l,h,v,d,c,u,p,m,g);else{for(let i=0,n=f.length;n>i;i++){const n=f[i];e.copyPartFromOffscreen(n.offscreenRow*r,(n.start-t)*r,(n.end-n.start)*r)}let n=t;for(let e=0,i=f.length;i>e;e++){const i=f[e];L(n,i.start,n-t,r,a,l,h,v,d,c,u,p,m,g),n=i.end}n>i||L(n,i,n-t,r,a,l,h,v,d,c,u,p,m,g)}e.resetOffscreenSize(),e.copyToOffscreen()}function D(e,t,i,n,s,o,r,a,l,h){const d=z(t,i,o,n,s);if(e.clearCanvas(),0===d.length)F(t,i,0,r,a,l,h);else{for(let i=0,n=d.length;n>i;i++){const n=d[i];e.copyPartFromOffscreen(n.offscreenRow*a,(n.start-t)*a,(n.end-n.start)*a)}let n=t;for(let e=0,i=d.length;i>e;e++){const i=d[e];F(n,i.start,n-t,r,a,l,h),n=i.end}n>i||F(n,i,n-t,r,a,l,h)}e.resetOffscreenSize(),e.copyToOffscreen()}function T(e,t,i,n,s,o,r,a,l,h){const d=z(t,i,o,n,s);if(e.clearCanvas(),0===d.length)N(t,i,0,r,a,l,h);else{for(let i=0,n=d.length;n>i;i++){const n=d[i];e.copyPartFromOffscreen(n.offscreenRow*a,(n.start-t)*a,(n.end-n.start)*a)}let n=t;for(let e=0,i=d.length;i>e;e++){const i=d[e];N(n,i.start,n-t,r,a,l,h),n=i.end}n>i||N(n,i,n-t,r,a,l,h)}e.resetOffscreenSize(),e.copyToOffscreen()}function k(e,t,i,n,s,o,r,a){if(e.fillStyle=i,a){const i=t.length*o;return e.fillRect(n,s,i,r),n+i}{let i=0;for(let a=0,l=t.length;l>a;a++)" "===t[a]?(i>0&&e.fillRect(n-i*o,s,i*o,r),i=0):i++,n+=o;return i>0&&e.fillRect(n-i*o,s,i*o,r),n}}function L(e,t,i,n,s,o,r,a,l,h,d,c,u,p){if(e>t)return;let m,g,f=i*n-n;t=Math.min(t,h);for(let i=e;t>i;i++){const e=l.tokensForScreenRow(i),t=Math.min(e.length,p);for(let l=0;t>l;l++){const t=e[l],h=t.text.replace(d," "),p=t.scopes;m!==i&&(g=0,f+=n,m=i,a.clearRect(g,f,r,n)),g>r||(Ft.test(h)?g+=h.length*o:g=k(a,h,c(p),g,f,o,s,u))}}a.fill()}function A(e){const t=e.getInvisibles(),i=[];return null!=t.cr&&i.push(t.cr),null!=t.eol&&i.push(t.eol),null!=t.space&&i.push(t.space),null!=t.tab&&i.push(t.tab),0!==i.length?RegExp(i.filter((e=>"string"==typeof e)).map(w).join("|"),"g"):null}function R(e,t,i){const{context:n,lineHeight:s,canvasWidth:o,yRow:r}=t;n.fillStyle=i,n.fillRect(0,r,o,s)}function P(e,t,i){const{context:n,lineHeight:s,yRow:o}=t;n.fillStyle=i,n.fillRect(0,o,1,s)}function H(e,t,i){const{context:n,lineHeight:s,charWidth:o,canvasWidth:r,screenRow:a,yRow:l}=t,h=e.getMarker().getScreenRange(),d=h.end.row-h.start.row;if(n.fillStyle=i,0===d)n.fillRect(h.start.column*o,l,(h.end.column-h.start.column)*o,s);else if(a===h.start.row){const e=h.start.column*o;n.fillRect(e,l,r-e,s)}else n.fillRect(0,l,a===h.end.row?h.end.column*o:r,s)}function I(e,t,i){const{context:n,lineHeight:s,charWidth:o,canvasWidth:r,screenRow:a,yRow:l}=t;let h,d,c,u,p,m;const g=e.getMarker().getScreenRange(),f=g.end.row-g.start.row,v=l,b=v+s;n.fillStyle=i,0===f?(d=g.end.column-g.start.column,c=d*o,m=g.start.column*o,p=m+c,n.fillRect(m,v,c,1),n.fillRect(m,b-1,c,1),n.fillRect(m,v,1,s),n.fillRect(p,v,1,s)):1===f?(m=g.start.column*o,p=g.end.column*o,a===g.start.row?(c=r-m,u=Math.max(m,p),h=r-u,n.fillRect(m,v,c,1),n.fillRect(u,b-1,h,1),n.fillRect(m,v,1,s),n.fillRect(r-1,v,1,s)):(c=r-m,h=r-p,n.fillRect(0,v,m,1),n.fillRect(0,b-1,p,1),n.fillRect(0,v,1,s),n.fillRect(p,v,1,s))):(m=g.start.column*o,p=g.end.column*o,a===g.start.row?(c=r-m,n.fillRect(m,v,c,1),n.fillRect(m,v,1,s),n.fillRect(r-1,v,1,s)):a===g.end.row?(c=r-m,n.fillRect(0,b-1,p,1),n.fillRect(0,v,1,s),n.fillRect(p,v,1,s)):(n.fillRect(0,v,1,s),n.fillRect(r-1,v,1,s),a===g.start.row+1&&n.fillRect(0,v,m,1),a===g.end.row-1&&n.fillRect(p,b-1,r-p,1)))}function O(e,t,i,n){const s=e.getProperties().render;s&&(t.color=i,s(e,t,n))}function _(e,t,i,n,s){let o=[];i.context.clearRect(0,i.yRow,i.canvasWidth,i.lineHeight);for(const i in n)o=o.concat(null!=t[i]&&t[i][e]||[]);if(o.sort(((e,t)=>(i.orders[e.properties.plugin]||0)-(i.orders[t.properties.plugin]||0))),null!=o?o.length:void 0)for(let e=0,t=o.length;t>e;e++){const t=o[e],r=n[t.properties.type];if(Ot){const e=r.name.split("$").pop().replace("Lambda","");_t[e](t,i,q(t,s))}else r(t,i,q(t,s))}}function N(e,t,i,n,s,o,r){if(t>=e){for(let a=e;t>=a;a++)n.row=i+(a-e),n.yRow=n.row*s,n.screenRow=a,_(a,r,n,Bt,o);n.context.fill()}}function F(e,t,i,n,s,o,r){if(t>=e){for(let a=e;t>=a;a++)n.row=i+(a-e),n.yRow=n.row*s,n.screenRow=a,_(a,r,n,jt,o);n.context.fill()}}function W(e,t){return B(exports.domStylesReader.retrieveStyleFromDom([".editor"],"color",e,!0),t)}function j(e,t,i){return B(exports.domStylesReader.retrieveStyleFromDom(e,"color",t,!0),i)}function B(e,t){return`rgba(${e.slice(4,-1)}, ${t})`}function q(e,t){const i=e.getProperties();if(i.color)return i.color;if(i.scope){const e=i.scope.split(/\s+/);return exports.domStylesReader.retrieveStyleFromDom(e,"background-color",t,!0)}return W(t)}function z(e,t,i,n,s){if(null==n&&null==s)return[];let o=[{start:n,end:s,offscreenRow:0}];for(let e=0,t=i.length;t>e;e++){const t=i[e],n=[];for(let e=0,i=o.length;i>e;e++){const i=o[e];i.start>t.end&&0!==t.screenDelta?n.push({start:i.start+t.screenDelta,end:i.end+t.screenDelta,offscreenRow:i.offscreenRow}):i.start>t.end||t.start>i.end?n.push(i):(t.start>i.start&&n.push({start:i.start,end:t.start-1,offscreenRow:i.offscreenRow}),i.end>t.end&&n.push(0!==t.bufferDelta||0!==t.screenDelta?{start:t.end+t.screenDelta+1,end:i.end+t.screenDelta,offscreenRow:i.offscreenRow+t.end+1-i.start}:{start:t.end+1,end:i.end,offscreenRow:i.offscreenRow+t.end+1-i.start}))}o=n}return U(o,e,t)}function U(e,t,i){let n=0;for(;e.length>n;){const s=e[n];t>s.start&&(s.offscreenRow+=t-s.start,s.start=t),s.end>i&&(s.end=i),s.end>s.start||e.splice(n--,1),n++}return e.sort(((e,t)=>e.offscreenRow-t.offscreenRow))}function V(e,...t){t.forEach((t=>{$(e,t)}))}function $(e,t){Object.getOwnPropertyNames(t).forEach((i=>{0>["length","name","arguments","caller","prototype","includeInto"].indexOf(i)&&Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})),Object.getOwnPropertyNames(t.prototype).forEach((i=>{"constructor"!==i&&Object.defineProperty(e.prototype,i,Object.getOwnPropertyDescriptor(t.prototype,i))}))}function Q(e,t){return ct.registerOrUpdateElement(t,{class:e})}function Y(){Vt||(Vt=document.createElement("style"),Vt.setAttribute("context","atom-text-editor-minimap"),document.head.appendChild(Vt))}function G(){Vt&&(Vt.parentNode.removeChild(Vt),Vt=null)}function Z(e){Vt&&(Vt.textContent=`\n atom-text-editor[with-minimap].editor > div,\n atom-text-editor[with-minimap] > div {\n margin-left: ${e}px;\n }\n `)}function X(e){return{x:e.pageX,y:e.pageY,isLeftMouse:0===e.button,isMiddleMouse:1===e.button}}function K(e){const t=e.changedTouches[0];return{x:t.pageX,y:t.pageY,isLeftMouse:!0,isMiddleMouse:!1}}function J(e,t){if(!e)return;let i="";for(const e in t)i+=`${e}: ${t[e]}; `;e.style.cssText=i}function ee(e=0,t=0,i=!1){return i?`translate3d(${e}px, ${t}px, 0)`:`translate(${e}px, ${t}px)`}function te(e=0,t=e,i=!1){return i?`scale3d(${e}, ${t}, 1)`:`scale(${e}, ${t})`}function ie({from:e,to:t,duration:i,step:n}){const s=se();let o;const r=()=>{const a=se()-s;o=0===i?1:a/i,o>1&&(o=1);const l=ne(o);n(e+(t-e)*l,l),1>o&&requestAnimationFrame(r)};r()}function ne(e){return.5-Math.cos(e*Math.PI)/2}function se(){return new Date}function oe(e,t){ki[e]=t,Li[e]=new ze.CompositeDisposable,Wi.emit("did-add-plugin",{name:e,plugin:t}),atom.config.get("minimap.displayPluginsControls")&&pe(e,t),de(e)}function re(e){const t=ki[e];atom.config.get("minimap.displayPluginsControls")&&fe(e),delete ki[e],Wi.emit("did-remove-plugin",{name:e,plugin:t})}function ae(e,t){const i="minimap.plugins."+e;null!=t?atom.config.set(i,t):atom.config.set(i,!atom.config.get(i)),de(e)}function le(){for(const[e,t]of he())t.deactivatePlugin(),Wi.emit("did-deactivate-plugin",{name:e,plugin:t})}function*he(){for(const e in ki)yield[e,ki[e]]}function de(e){const t=ki[e],i=t.isActive(),n=atom.config.get("minimap.plugins."+e);atom.config.get("minimap.displayPluginsControls")?n&&!i?ce(e,t):i&&!n&&ue(e,t):i?i&&ue(e,t):ce(e,t)}function ce(e,t){const i={name:e,plugin:t};t.activatePlugin(),Wi.emit("did-activate-plugin",i)}function ue(e,t){const i={name:e,plugin:t};t.deactivatePlugin(),Wi.emit("did-deactivate-plugin",i)}function pe(e,t){const i="minimap.plugins."+e,n=`minimap.plugins.${e}DecorationsZIndex`,s=Ee();s.plugins.properties[e]={type:"boolean",title:e,description:`Whether the ${e} plugin is activated and displayed in the Minimap.`,default:!0},s.plugins.properties[e+"DecorationsZIndex"]={type:"integer",title:e+" decorations order",description:`The relative order of the ${e} plugin's decorations in the layer into which they are drawn. Note that this order only apply inside a layer, so highlight-over decorations will always be displayed above line decorations as they are rendered in different layers.`,default:0},void 0===atom.config.get(i)&&atom.config.set(i,!0),void 0===atom.config.get(n)&&atom.config.set(n,0),Li[e].add(atom.config.observe(i,(()=>{de(e)}))),Li[e].add(atom.config.observe(n,(i=>{me(e),Wi.emit("did-change-plugin-order",{name:e,plugin:t,order:i})}))),Li[e].add(atom.commands.add("atom-workspace",{["minimap:toggle-"+e](){ae(e)}})),me(e)}function me(e){Ai[e]=atom.config.get(`minimap.plugins.${e}DecorationsZIndex`)}function ge(){return Ai}function fe(e){Li[e].dispose(),delete Li[e],delete Ee().plugins.properties[e]}function ve(){return be("core.useTreeSitterParsers",!0,"Tree-sitter is off (Low Performance Warning).","You should turn on Atom's tree-sitter parser to experience the best performance Minimap and Atom is deisgned for.\n Keeping tree-sitter parser off results in sluggish scrolling and lags in the text editor.")}function be(e,t,i,n){return atom.config.observe(e,(s=>{if(s!==t){const s="Minimap."+e,o=new Date,r=window.localStorage.getItem(s);let a=null;if(r&&(a=new Date(Date.parse(r)).getDay()),!a||"number"==typeof a&&a-o.getDay()>=1){window.localStorage.setItem(s,o);const r=atom.notifications.addWarning(i,{description:n,dismissable:!0,buttons:[{text:`Set to ${t} and restart Atom`,onDidClick(){atom.config.set(e,!0),r.dismiss(),window.localStorage.removeItem(s),setTimeout((()=>{atom.reload()}),1500)}}]})}}}))}function ye(e,t){const i=e.match(/rgb(a?)\((\d+), (\d+), (\d+)(, (\d+(\.\d+)?))?\)/);let[,,n,s,o,,r]=i,[,a]=t.match(Ii);return[n,s,o,r,a]=[n,s,o,r,a].map(Number),[n,s,o]=Se(n,s,o,a),isNaN(r)?`rgb(${n}, ${s}, ${o})`:`rgba(${n}, ${s}, ${o}, ${r})`}function Se(e,t,i,n){function s(e){return Math.ceil(Math.max(0,Math.min(255,e)))}const o=[1,0,0,0,1,0,0,0,1],r=.2126,a=.7152,l=.0722,h=Math.cos(n*Math.PI/180),d=Math.sin(n*Math.PI/180);return o[0]=r+.7874*h-r*d,o[1]=a-a*h-a*d,o[2]=l-l*h+.9278*d,o[3]=r-r*h+.143*d,o[4]=a+(1-a)*h+.14*d,o[5]=l-l*h-.283*d,o[6]=r-r*h-.7874*d,o[7]=a-a*h+a*d,o[8]=l+.9278*h+l*d,[s(o[0]*e+o[1]*t+o[2]*i),s(o[3]*e+o[4]*t+o[5]*i),s(o[6]*e+o[7]*t+o[8]*i)]}function we(){Oi||(Fi=atom.commands.add("atom-workspace",{"minimap:toggle"(){Me()},async"minimap:generate-coffee-plugin"(){await De("coffee")},async"minimap:generate-javascript-plugin"(){await De("javascript")},async"minimap:generate-babel-plugin"(){await De("babel")}}),exports.editorsMinimaps=new Map,exports.domStylesReader=new Ri,Ni=new ze.CompositeDisposable,Oi=!0,atom.config.get("minimap.autoToggle")&&Me())}function xe(e){if(e instanceof ei){const t=new Yt;return t.setModel(e),t}}function Ce(){Oi&&(le(),exports.editorsMinimaps&&(exports.editorsMinimaps.forEach((e=>{e.destroy()})),exports.editorsMinimaps.clear()),Ni.dispose(),Ni=null,Fi.dispose(),Fi=null,exports.editorsMinimaps=void 0,exports.domStylesReader.invalidateDOMStylesCache(),_i=!1,Oi=!1)}function Ee(){return Ti||atom.packages.getLoadedPackage("minimap").metadata.configSchema}function Me(){if(Oi){if(_i){_i=!1,exports.editorsMinimaps&&(exports.editorsMinimaps.forEach((e=>{e.destroy()})),exports.editorsMinimaps.clear()),Ni.dispose();const e=atom.isMaximized(),{width:t,height:i}=atom.getSize();atom.setSize(t,i),e&&atom.maximize()}else _i=!0,Be();exports.domStylesReader.invalidateDOMStylesCache()}}async function De(e){const{default:t}=await Promise.resolve().then((()=>require("./minimap-plugin-generator-element-27adcab9.js"))),i=new t;i.template=e,i.attach()}function Te(e){return Wi.on("did-activate",e)}function ke(e){return Wi.on("did-deactivate",e)}function Le(e){return Wi.on("did-create-minimap",e)}function Ae(e){return Wi.on("did-add-plugin",e)}function Re(e){return Wi.on("did-remove-plugin",e)}function Pe(e){return Wi.on("did-activate-plugin",e)}function He(e){return Wi.on("did-deactivate-plugin",e)}function Ie(e){return Wi.on("did-change-plugin-order",e)}function Oe(){return ei}function _e(e){if(e)return Ne(e.getModel())}function Ne(e){if(!e)return;if(!exports.editorsMinimaps)return;let t=exports.editorsMinimaps.get(e);if(void 0===t||t.destroyed){t=new ei({textEditor:e}),exports.editorsMinimaps.set(e,t);const i=e.onDidDestroy((()=>{exports.editorsMinimaps&&exports.editorsMinimaps.delete(e),t&&t.destroy(),i.dispose()}));Ni.add(i)}return t}function Fe(e){if(e)return new ei({textEditor:e,standAlone:!0})}function We(){return Ne(atom.workspace.getActiveTextEditor())}function je(e){if(e)return exports.editorsMinimaps&&exports.editorsMinimaps.forEach((t=>{e(t)})),Le((t=>{e(t)}))}function Be(){Ni.add(atom.workspace.observeTextEditors((e=>{const t=Ne(e),i=t.getMinimapElement()||xe(t);Wi.emit("did-create-minimap",t),i.attach(e.getElement())})),atom.themes.onDidChangeActiveThemes((()=>{exports.domStylesReader.invalidateDOMStylesCache(),exports.editorsMinimaps.forEach((e=>{atom.views.getView(e).requestForcedUpdate()}))})),ve())}function qe(){return ji}const ze=require("atom"),Ue=require("path"),Ve=e(ze),$e=e(Ue);var Qe,Ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ge=i((function(e){e.exports=function(){function e(e,t,i){this.message=e,this.fileName=t,this.lineNumber=i,this.callCount=0,this.stackCount=0,this.stacks={},this.stackCallCounts={}}return e.getFunctionNameFromCallsite=e=>{},e.deserialize=t=>{var i,n,s,o,r;for(s=t.stacks,i=new e(t.message,t.fileName,t.lineNumber),o=0,r=s.length;r>o;o++)i.addStack(n=s[o],n.metadata);return i},e.prototype.getFunctionNameFromCallsite=e=>{var t,i,n;return null!=e.functionName?e.functionName:e.isToplevel()?null!=(t=e.getFunctionName())?t:"":e.isConstructor()?"new "+e.getFunctionName():e.getMethodName()&&!e.getFunctionName()?e.getMethodName():e.getTypeName()+"."+(null!=(i=null!=(n=e.getMethodName())?n:e.getFunctionName())?i:"")},e.prototype.getLocationFromCallsite=function(e){return null==e?"unknown":null!=e.location?e.location:e.isNative()?"native":e.isEval()?"eval at "+this.getLocationFromCallsite(e.getEvalOrigin()):e.getFileName()+":"+e.getLineNumber()+":"+e.getColumnNumber()},e.prototype.getFileNameFromCallSite=e=>{var t;return null!=(t=e.fileName)?t:e.getFileName()},e.prototype.getOriginName=function(){return this.originName},e.prototype.getMessage=function(){return this.message},e.prototype.getStacks=function(){var e,t,i,n,s;for(e in i=[],s=this.stacks)(t=this.parseStack(n=s[e])).callCount=this.stackCallCounts[e],t.metadata=n.metadata,i.push(t);return i},e.prototype.getStackCount=function(){return this.stackCount},e.prototype.getCallCount=function(){return this.callCount},e.prototype.addStack=function(e,t){var i,n,s;return null==this.originName&&(this.originName=this.getFunctionNameFromCallsite(e[0])),null==this.fileName&&(this.fileName=this.getFileNameFromCallSite(e[0])),null==this.lineNumber&&(this.lineNumber="function"==typeof(n=e[0]).getLineNumber?n.getLineNumber():void 0),this.callCount++,e.metadata=t,i=this.getLocationFromCallsite(e[1]),null==this.stacks[i]&&(this.stacks[i]=e,this.stackCount++),null==(s=this.stackCallCounts)[i]&&(s[i]=0),this.stackCallCounts[i]++},e.prototype.parseStack=function(e){return e.map((t=this,e=>({functionName:t.getFunctionNameFromCallsite(e),location:t.getLocationFromCallsite(e),fileName:t.getFileNameFromCallSite(e)})));var t},e.prototype.serialize=function(){return{message:this.getMessage(),lineNumber:this.lineNumber,fileName:this.fileName,stacks:this.getStacks()}},e}()})),Ze=function(){function e(t){n(this,e),this.disposed=!1,this.disposalAction=t}return o(e,null,[{key:"isDisposable",value:e=>"function"==typeof(null!=e?e.dispose:void 0)}]),o(e,[{key:"dispose",value(){this.disposed||(this.disposed=!0,"function"==typeof this.disposalAction&&this.disposalAction(),this.disposalAction=null)}}]),e}(),Xe=function(){function e(){r(this,e),this.disposed=!1,this.disposables=new Set;var t=!0,i=!1,n=void 0;try{for(var s,o=arguments[Symbol.iterator]();!(t=(s=o.next()).done);t=!0){var a=s.value;this.add(a)}}catch(e){i=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(i)throw n}}}return l(e,[{key:"dispose",value(){this.disposed||(this.disposed=!0,this.disposables.forEach((e=>e.dispose())),this.disposables=null)}},{key:"add",value(){if(!this.disposed){var e=!0,t=!1,i=void 0;try{for(var n,s=arguments[Symbol.iterator]();!(e=(n=s.next()).done);e=!0){var o=n.value;h(o),this.disposables.add(o)}}catch(e){t=!0,i=e}finally{try{e||null==s.return||s.return()}finally{if(t)throw i}}}}},{key:"remove",value(e){this.disposed||this.disposables.delete(e)}},{key:"delete",value(e){this.remove(e)}},{key:"clear",value(){this.disposed||this.disposables.clear()}}]),e}(),Ke=function(){function e(){d(this,e),this.disposed=!1,this.clear()}return u(e,null,[{key:"onEventHandlerException",value(e){var t=this;return 0===this.exceptionHandlers.length&&(this.dispatch=this.exceptionHandlingDispatch),this.exceptionHandlers.push(e),new Ze((()=>{if(t.exceptionHandlers.splice(t.exceptionHandlers.indexOf(e),1),0===t.exceptionHandlers.length)return t.dispatch=t.simpleDispatch}))}},{key:"simpleDispatch",value:(e,t)=>e(t)},{key:"exceptionHandlingDispatch",value(e,t){try{return e(t)}catch(e){return this.exceptionHandlers.map((t=>t(e)))}}}]),u(e,[{key:"clear",value(){null!=this.subscriptions&&this.subscriptions.dispose(),this.subscriptions=new Xe,this.handlersByEventName={}}},{key:"dispose",value(){this.subscriptions.dispose(),this.handlersByEventName=null,this.disposed=!0}},{key:"on",value(e,t,i){var n=this;if(null==i&&(i=!1),this.disposed)throw Error("Emitter has been disposed");if("function"!=typeof t)throw Error("Handler must be a function");this.handlersByEventName[e]?i?this.handlersByEventName[e].unshift(t):this.handlersByEventName[e].push(t):this.handlersByEventName[e]=[t];var s=new Ze((()=>(n.subscriptions.remove(s),n.off(e,t))));return this.subscriptions.add(s),s}},{key:"once",value(e,t,i){null==i&&(i=!1);var n=this.on(e,(e=>(n.dispose(),t(e))),i);return n}},{key:"preempt",value(e,t){return this.on(e,t,!0)}},{key:"off",value(e,t){if(!this.disposed){var i=this.handlersByEventName[e];if(i){var n=i.indexOf(t);0>n||i.splice(n,1),0===i.length&&delete this.handlersByEventName[e]}}}},{key:"emit",value(e,t){var i=this.handlersByEventName&&this.handlersByEventName[e];if(i)for(var n=i.slice(),s=0;n.length>s;s++)this.constructor.dispatch(n[s],t)}},{key:"emitAsync",value(e,t){var i=this,n=this.handlersByEventName&&this.handlersByEventName[e];if(n){var s=n.map((e=>i.constructor.dispatch(e,t)));return Promise.all(s).then((()=>{}))}return Promise.resolve()}},{key:"getEventNames",value(){return Object.keys(this.handlersByEventName)}},{key:"listenerCountForEventName",value(e){var t=this.handlersByEventName[e];return null==t?0:t.length}},{key:"getTotalListenerCount",value(){for(var e=0,t=Object.keys(this.handlersByEventName),i=0;t.length>i;i++)e+=this.handlersByEventName[t[i]].length;return e}}]),e}();Ke.dispatch=Ke.simpleDispatch,Ke.exceptionHandlers=[];var Je=Ke,et=Je,tt=Ze,it=Xe,nt={Emitter:et,Disposable:tt,CompositeDisposable:it},st=i((function(e){!function(){var t,i,n;t=Ge,null==Ye.__grim__&&(n=Ye.__grim__={deprecations:{},emitter:new(0,nt.Emitter),includeDeprecatedAPIs:!0,getDeprecations(){var e,t,i,s,o,r,a;for(s in e=[],a=n.deprecations)for(o in t=a[s])for(r in i=t[o])e.push(i[r]);return e},getDeprecationsLength(){return this.getDeprecations().length},clearDeprecations(){n.deprecations={}},logDeprecations(){var e,t,i,n;for((t=this.getDeprecations()).sort(((e,t)=>t.getCallCount()-e.getCallCount())),console.warn("\nCalls to deprecated functions\n-----------------------------"),i=0,n=t.length;n>i;i++)console.warn("("+(e=t[i]).getCallCount()+") "+e.getOriginName()+" : "+e.getMessage(),e)},deprecate(e,s){var o,r,a,l,h,d,c,u,p,m,g,f,v;d=Error.stackTraceLimit;try{Error.stackTraceLimit=7,u=(u=null!=(f="function"==typeof(a=Error()).getRawStack?a.getRawStack():void 0)?f:i(a)).slice(1)}finally{Error.stackTraceLimit=d}l=(r=u[0]).getFileName(),h=r.getLineNumber(),c=null!=(v=null!=s?s.packageName:void 0)?v:"",null==(p=n.deprecations)[l]&&(p[l]={}),null==(m=n.deprecations[l])[h]&&(m[h]={}),null==(g=n.deprecations[l][h])[c]&&(g[c]=new t(e)),(o=n.deprecations[l][h][c]).addStack(u,s),n.emitter.emit("updated",o)},addSerializedDeprecation(e){var i,s,o,r,a,l,h,d,c,u,p,m,g,f,v;for(r=(i=t.deserialize(e)).getMessage(),s=i.fileName,o=i.lineNumber,a=null!=(g=null!=(f=(h=i.getStacks())[0])&&null!=(v=f.metadata)?v.packageName:void 0)?g:"",null==(d=n.deprecations)[s]&&(d[s]={}),null==(c=n.deprecations[s])[o]&&(c[o]={}),null==(u=n.deprecations[s][o])[a]&&(u[a]=new t(r,s,o)),i=n.deprecations[s][o][a],p=0,m=h.length;m>p;p++)i.addStack(l=h[p],l.metadata);n.emitter.emit("updated",i)},on:(e,t)=>n.emitter.on(e,t)}),i=e=>{var t,n;return t=Error.prepareStackTrace,Error.prepareStackTrace=(e,t)=>t,Error.captureStackTrace(e,i),n=e.stack,Error.prepareStackTrace=t,n},e.exports=Ye.__grim__}()})),ot=i((function(e){var t,i,n,s;({deprecate:s}=st),null!=Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__?(Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__=Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__,delete Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__):null==Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__&&(Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__={}),t=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"],n=function(e,i){return t.forEach((function(t){return Object.defineProperty(e,t,{value(){var e;return null!=(e=this["__"+t])?e.apply(this,arguments):void 0},writable:!0,enumerable:!0,configurable:!0})})),Object.getOwnPropertyNames(i).forEach((n=>{var s;if("constructor"!==n)return s=Object.getOwnPropertyDescriptor(i,n),t.indexOf(n)>-1?Object.defineProperty(e,"__"+n,s):Object.defineProperty(e,n,s)}))},i=(e,t)=>Object.getOwnPropertyNames(t).forEach((i=>{if("length"!==i&&"name"!==i&&"arguments"!==i&&"caller"!==i&&"prototype"!==i)return Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})),e.exports=(e,t)=>{var o,r,a,l,h;return({class:a}=t),(l=null!=a?a.prototype:null!=(h=t.prototype)?h:t)===t&&s("Using the prototype as the second argument is deprecated, use the prototype option instead"),__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e]?(o=__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e],n(o.prototype,l),null!=a&&i(o,a),o):(r=Object.create(HTMLElement.prototype),n(r,l),o=document.registerElement(e,{prototype:Object.create(r)}),null!=a&&i(o,a),__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e]=o)}})),rt=i((function(e){!function(){var t,i,n,s;for(s in e.exports=n=function(){function e(){"function"==typeof this.extended&&this.extended()}return e.includeInto=function(e){var i,n,s;for(i in this.extend(e.prototype),this)n=this[i],-1===t.indexOf(i)&&(e.hasOwnProperty(i)||(e[i]=n));return null!=(s=this.included)?s.call(e):void 0},e.extend=function(e){var t,n,s,o,r;for(n=0,s=(o=Object.getOwnPropertyNames(this.prototype)).length;s>n;n++)-1===i.indexOf(t=o[n])&&(e.hasOwnProperty(t)||(e[t]=this.prototype[t]));return null!=(r=this.prototype.extended)?r.call(e):void 0},e}(),t=["__super__"],n)t.push(s);i=["constructor","extended"]}()})),at=i((function(e){var t;t=rt,e.exports=class e extends t{static parents(e,t="*"){var i;return i=[],this.eachParent(e,(e=>{if("function"==typeof e.matches?e.matches(t):void 0)return i.push(e)})),i}static eachParent(e,t){var i,n;for(null!=(i=e.parentNode)&&t(i),n=[];i=i.parentNode;)n.push(null!=i?t(i):void 0);return n}parents(t="*"){return e.parents(this,t)}queryParentSelectorAll(e){if(null==e)throw Error("::queryParentSelectorAll requires a valid selector as argument");return this.parents(e)}queryParentSelector(e){if(null==e)throw Error("::queryParentSelector requires a valid selector as argument");return this.queryParentSelectorAll(e)[0]}eachParent(t){return e.eachParent(this,t)}}})),lt=i((e=>{(()=>{var t,i;i=rt,({Disposable:t}=Ve.default),e.exports=class extends i{addDisposableEventListener(e,i,n,s){return e.addEventListener(i,n,s),new t((()=>e.removeEventListener(i,n)))}}})()})),ht=i((function(e){!function(){var t,i,n,s,o,r;s=rt,n=lt,({Disposable:i,CompositeDisposable:t}=Ve.default),r=(e,t)=>{var i,n;for(i in n=[],e)n.push(t(i,e[i]));return n},o="__NONE__",e.exports=function(){class e extends s{subscribeTo(e,t,n,s){var a,l;return e instanceof HTMLElement||([e,t,n,s]=[this,e,t,n]),"object"==typeof t&&([n,t,s]=[t,o,n]),null==this.eventsMap&&(this.eventsMap=new WeakMap),null==this.disposablesMap&&(this.disposablesMap=new WeakMap),null==this.eventsMap.get(e)&&this.eventsMap.set(e,{}),null==this.disposablesMap.get(e)&&this.disposablesMap.set(e,{}),l=this.eventsMap.get(e),a=this.disposablesMap.get(e),r(n,((i,n)=>(null==l[i]&&(l[i]={},a[i]=this.createEventListener(e,i,s)),l[i][t]=n))),new i((()=>this.unsubscribeFrom(e,t,n)))}unsubscribeFrom(e,t,i){var n,s,r;if(e instanceof HTMLElement||([e,t,i]=[this,e,t]),"object"==typeof t&&([i,t]=[t,o]),r=this.eventsMap.get(e)){for(s in i)delete r[s][t],0===Object.keys(r[s]).length&&((n=this.disposablesMap.get(e))[s].dispose(),delete n[s],delete r[s]);return 0===Object.keys(r).length?(this.eventsMap.delete(e),this.disposablesMap.delete(e)):void 0}}createEventListener(e,t,i){return this.addDisposableEventListener(e,t,(i=>{var n,s,o;if(n=null!=(s=this.eventsMap.get(e))?s[t]:void 0)return({target:o}=i),this.decorateEvent(i),this.eachSelectorFromTarget(i,o,n),i.isPropagationStopped||"function"==typeof n.__NONE__&&n.__NONE__(i),!0}),i)}eachSelectorFromTarget(e,t,i){return this.nodeAndItsAncestors(t,(t=>{if(!e.isPropagationStopped)return this.eachSelector(i,((i,n)=>{var s;if(s=this.targetMatch(t,i),!e.isImmediatePropagationStopped&&s)return n(e)}))}))}eachSelector(e,t){var i,n,s,r;for(-1!==(s=Object.keys(e)).indexOf(o)&&s.splice(s.indexOf(o),1),s.sort(((e,t)=>t.split(" ").length-e.split(" ").length)),i=0,r=s.length;r>i;i++)if(t(n=s[i],e[n]))return!0;return!1}targetMatch(e,t){var i;if(e.matches(t))return!0;for(i=e.parentNode;null!=i&&null!=i.matches;){if(i.matches(t))return!0;i=i.parentNode}return!1}nodeAndItsAncestors(e,t){var i,n;for(i=e.parentNode,t(e),n=[];null!=i&&null!=i.matches;)t(i),n.push(i=i.parentNode);return n}decorateEvent(e){var t,i;return t=Event.prototype.stopPropagation,e.stopPropagation=function(){return this.isPropagationStopped=!0,t.apply(this,arguments)},i=Event.prototype.stopImmediatePropagation,e.stopImmediatePropagation=function(){return this.isImmediatePropagationStopped=!0,i.apply(this,arguments)}}}return n.includeInto(e),e}()}()})),dt=i((function(e){var t,i,n,s,o,r,a;n=rt,r="a abbr address article aside audio b bdi bdo blockquote body button canvas caption cite code colgroup datalist dd del details dfn dialog div dl dt em fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header html i iframe ins kbd label legend li main map mark menu meter nav noscript object ol optgroup option output p pre progress q rp rt ruby s samp script section select small span strong style sub summary sup table tbody td textarea tfoot th thead time title tr u ul var video area base br col command embed hr img input keygen link meta param source track wbr".split(/\s+/),s={},"area base br col command embed hr img input keygen link meta param source track wbr".split(/\s+/).forEach((e=>s[e]=!0)),t=class extends n{buildContent(){if(null!=this.constructor.content)return o.buildContent(this,this.constructor.content)}},e.exports=o=function(){class e extends n{static includeInto(t){return super.includeInto(t),Object.defineProperty(t,"content",{enumerable:!1,get(){return this.prototype.__content__},set(e){return this.prototype.__content__=e}}),Object.defineProperty(t.prototype,"createdCallback",{enumerable:!0,get(){return this.__create__},set(e){return this.__createdCallback__=e}}),Object.defineProperty(t.prototype,"__create__",{enumerable:!0,value(){if(null!=this.__content__&&e.buildContent(this,this.__content__),null!=this.__createdCallback__)return this.__createdCallback__()}}),t.useShadowRoot=()=>t.prototype.__useShadowRoot__=!0}static buildContent(e,t){var i,n,s;return s=new a,t.call(s),[i]=s.buildHtml(),(n=n=e.__useShadowRoot__?e.shadowRoot=e.createShadowRoot():e).innerHTML=i,this.wireOutlets(e,n)}static wireOutlets(e,t){var i,n,s,o;for(n=0,s=(o=t.querySelectorAll("[outlet]")).length;s>n;n++)e[(i=o[n]).getAttribute("outlet")]=i,i.removeAttribute("outlet")}}return e.Babel=t,e}(),a=function(){class e{constructor(){this.currentBuilder=new i}subview(e,t){return this.currentBuilder.subview(e,t)}text(e){return this.currentBuilder.text(e)}tag(e,...t){return this.currentBuilder.tag(e,...t)}raw(e){return this.currentBuilder.raw(e)}buildHtml(){return this.currentBuilder.buildHtml()}}return r.forEach((function(t){return e.prototype[t]=function(...e){return this.currentBuilder.tag(t,...e)}})),e}(),i=class{constructor(){this.document=[],this.postProcessingSteps=[]}buildHtml(){return[this.document.join(""),this.postProcessingSteps]}tag(e,...t){var i;if(i=this.extractOptions(t),this.openTag(e,i.attributes),!s.hasOwnProperty(e))return"function"==typeof i.content&&i.content(),i.text&&this.text(i.text),this.closeTag(e);if(null!=i.text||null!=i.content)throw Error(`Self-closing tag ${e} cannot have text or content`)}openTag(e,t){var i,n,s;return 0===this.document.length&&null==t&&(t={}),s=(n=(()=>{var e;for(i in e=[],t)e.push(`${i}="${t[i]}"`);return e})()).length?" "+n.join(" "):"",this.document.push(`<${e}${s}>`)}closeTag(e){return this.document.push(``)}text(e){var t;return t=e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),this.document.push(t)}raw(e){return this.document.push(e)}subview(e,t){var i;return i="subview-"+ ++idCounter,this.tag("div",{id:i}),this.postProcessingSteps.push((n=>(n[e]=t,t.parentView=n,n.find("div#"+i).replaceWith(t))))}extractOptions(e){var t,i,n,s;for(s={},i=0,n=e.length;n>i;i++)switch(typeof(t=e[i])){case"function":s.content=t;break;case"string":case"number":s.text=""+t;break;default:s.attributes=t}return s}}})),ct=i((e=>{e.exports={requirePackages(...e){return new Promise(((t,i)=>{var n,s,o,r;return o=[],n=[],s=e.length,r=()=>{if(0==--s)return n.length>0?i(n):t(o)},e.forEach(((e,t)=>{var i,s;return i=e=>(n[t]=e,r()),null!=(s=atom.packages.activatePackage(e).then((e=>(o[t]=e.mainModule,r())))).fail?s.fail(i):null!=s.catch?s.catch(i):void 0}))}))},registerOrUpdateElement:ot,Ancestors:at,AncestorsMethods:at,DisposableEvents:lt,EventsDelegation:ht,SpacePenDSL:dt}})),ut=i((e=>{(e.exports={}).forEach=(e,t)=>{for(var i=0;e.length>i;i++){var n=t(e[i]);if(n)return n}}})),pt=e=>{var t=e.stateHandler.getState;return{isDetectable(e){var i=t(e);return i&&!!i.isDetectable},markAsDetectable(e){t(e).isDetectable=!0},isBusy:e=>!!t(e).busy,markBusy(e,i){t(e).busy=!!i}}},mt=e=>{function t(t){var n=e.get(t);return void 0===n?[]:i[n]||[]}var i={};return{get:t,add(t,n){var s=e.get(t);i[s]||(i[s]=[]),i[s].push(n)},removeListener(e,i){for(var n=t(e),s=0,o=n.length;o>s;++s)if(n[s]===i){n.splice(s,1);break}},removeAllListeners(e){var i=t(e);i&&(i.length=0)}}},gt=()=>{var e=1;return{generate:()=>e++}},ft=e=>{var t=e.idGenerator,i=e.stateHandler.getState;return{get(e){var t=i(e);return t&&void 0!==t.id?t.id:null},set(e){var n=i(e);if(!n)throw Error("setId required the element to have a resize detection state.");var s=t.generate();return n.id=s,s}}},vt=e=>{function t(){}var i={log:t,warn:t,error:t};if(!e&&window.console){var n=(e,t)=>{e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var i=0;arguments.length>i;i++)e(arguments[i])}};n(i,"log"),n(i,"warn"),n(i,"error")}return i},bt=i((e=>{var t=e.exports={};t.isIE=e=>{return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==(()=>{var e=3,t=document.createElement("div"),i=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]>4?e:void 0})());var t},t.isLegacyOpera=()=>!!window.opera})),yt=i((e=>{(e.exports={}).getOption=(e,t,i)=>{var n=e[t];return null==n&&void 0!==i?i:n}})),St=e=>{function t(){for(l=!0;a.size();){var e=a;a=p(),e.process()}l=!1}function i(){r=setTimeout(t,0)}var n=(e=e||{}).reporter,s=yt.getOption(e,"async",!0),o=yt.getOption(e,"auto",!0);o&&!s&&(n&&n.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),s=!0);var r,a=p(),l=!1;return{add(e,t){!l&&o&&s&&0===a.size()&&i(),a.add(e,t)},force(e){l||(void 0===e&&(e=s),r&&(clearTimeout(r),r=null),e?i():t())}}},wt="_erd",xt={initState:m,getState:g,cleanState:f},Ct=function(e){function t(t){var i=e.important?" !important; ":"; ";return(t.join(i)+i).trim()}function i(e){return o(e).object}var n=(e=e||{}).reporter,s=e.batchProcessor,o=e.stateHandler.getState;if(!n)throw Error("Missing required dependency: reporter.");return{makeDetectable(e,i,r){r||(r=i,i=e,e=null),e=e||{},bt.isIE(8)?r(i):function(i,r){function a(){function t(){if("static"===d.position){i.style.setProperty("position","relative",e.important?"important":"");var t=(t,i,n,s)=>{var o=n[s];"auto"!==o&&"0"!==(e=>e.replace(/[^-\d\.]/g,""))(o)&&(t.warn("An element that is positioned static has style."+s+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+s+" will be set to 0. Element: ",i),i.style.setProperty(s,"0",e.important?"important":""))};t(n,i,d,"top"),t(n,i,d,"right"),t(n,i,d,"bottom"),t(n,i,d,"left")}}""!==d.position&&(t(),h=!0);var s=document.createElement("object");s.style.cssText=l,s.tabIndex=-1,s.type="text/html",s.setAttribute("aria-hidden","true"),s.onload=function(){h||t(),function e(t,i){if(!t.contentDocument){var n=o(t);return n.checkForObjectDocumentTimeoutId&&window.clearTimeout(n.checkForObjectDocumentTimeoutId),void(n.checkForObjectDocumentTimeoutId=setTimeout((()=>{n.checkForObjectDocumentTimeoutId=0,e(t,i)}),100))}i(t.contentDocument)}(this,(e=>{r(i)}))},bt.isIE()||(s.data="about:blank"),o(i)&&(i.appendChild(s),o(i).object=s,bt.isIE()&&(s.data="about:blank"))}var l=t(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),h=!1,d=window.getComputedStyle(i),c=i.offsetWidth,u=i.offsetHeight;o(i).startSize={width:c,height:u},s?s.add(a):a()}(i,r)},addListener(e,t){function n(){t(e)}if(bt.isIE(8))o(e).object={proxy:n},e.attachEvent("onresize",n);else{var s=i(e);if(!s)throw Error("Element is not detectable by this strategy.");s.contentDocument.defaultView.addEventListener("resize",n)}},uninstall(e){if(o(e)){var t=i(e);t&&(bt.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),o(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(o(e).checkForObjectDocumentTimeoutId),delete o(e).object)}}}},Et=ut.forEach,Mt=e=>{function t(e){((e,t,n)=>{if(!e.getElementById(t)){var s=n+"_animation",o=n+"_animation_active",r="/* Created by the element-resize-detector library. */\n";r+="."+n+" > div::-webkit-scrollbar { "+i(["display: none"])+" }\n\n",r+="."+o+" { "+i(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+s,"animation-name: "+s])+" }\n",r+="@-webkit-keyframes "+s+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(i,n){n=n||(t=>{e.head.appendChild(t)});var s=e.createElement("style");s.innerHTML=i,s.id=t,n(s)}(r+="@keyframes "+s+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}})(e,"erd_scroll_detection_scrollbar_style",u)}function i(t){var i=e.important?" !important; ":"; ";return(t.join(i)+i).trim()}function n(e,t,i){if(e.addEventListener)e.addEventListener(t,i);else{if(!e.attachEvent)return a.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+t,i)}}function s(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i);else{if(!e.detachEvent)return a.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+t,i)}}function o(e){return h(e).container.childNodes[0].childNodes[0].childNodes[0]}function r(e){return h(e).container.childNodes[0].childNodes[0].childNodes[1]}var a=(e=e||{}).reporter,l=e.batchProcessor,h=e.stateHandler.getState,d=e.idHandler;if(!l)throw Error("Missing required dependency: batchProcessor");if(!a)throw Error("Missing required dependency: reporter.");var c=(()=>{var e=document.createElement("div");e.style.cssText=i(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=i(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,s=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:s}})(),u="erd_scroll_detection_container";return t(window.document),{makeDetectable(e,t,s){function p(){if(e.debug){var i=[].slice.call(arguments);if(i.unshift(d.get(t),"Scroll: "),a.log.apply)a.log.apply(null,i);else for(var n=0;i.length>n;n++)a.log(i[n])}}function m(e){var t=h(e).container.childNodes[0],i=window.getComputedStyle(t);return!i.width||-1===i.width.indexOf("px")}function g(){var e=window.getComputedStyle(t),i={};return i.position=e.position,i.width=t.offsetWidth,i.height=t.offsetHeight,i.top=e.top,i.right=e.right,i.bottom=e.bottom,i.left=e.left,i.widthCSS=e.width,i.heightCSS=e.height,i}function f(){if(p("storeStyle invoked."),h(t)){var e=g();h(t).style=e}else p("Aborting because element has been uninstalled")}function v(e,t,i){h(e).lastWidth=t,h(e).lastHeight=i}function b(){return 2*c.width+1}function y(){return 2*c.height+1}function S(e){return e+10+b()}function w(e){return e+10+y()}function x(e,t,i){var n=o(e),s=r(e),a=S(t),l=w(i),h=(e=>2*e+b())(t),d=(e=>2*e+y())(i);n.scrollLeft=a,n.scrollTop=l,s.scrollLeft=h,s.scrollTop=d}function C(){var e=h(t).container;if(!e){(e=document.createElement("div")).className=u,e.style.cssText=i(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),h(t).container=e,(e=>{e.className+=" "+u+"_animation_active"})(e),t.appendChild(e);var s=()=>{h(t).onRendered&&h(t).onRendered()};n(e,"animationstart",s),h(t).onAnimationStart=s}return e}function E(){function s(){h(t).onExpand&&h(t).onExpand()}function o(){h(t).onShrink&&h(t).onShrink()}if(p("Injecting elements"),h(t)){(()=>{var i=h(t).style;if("static"===i.position){t.style.setProperty("position","relative",e.important?"important":"");var n=(e,t,i,n)=>{var s=i[n];"auto"!==s&&"0"!==(e=>e.replace(/[^-\d\.]/g,""))(s)&&(e.warn("An element that is positioned static has style."+n+"="+s+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+n+" will be set to 0. Element: ",t),t.style[n]=0)};n(a,t,i,"top"),n(a,t,i,"right"),n(a,t,i,"bottom"),n(a,t,i,"left")}})();var r=h(t).container;r||(r=C());var l,d,m,g,f=c.width,v=c.height,b=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),y=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(l=(l=-(1+f))?l+"px":"0"),"top: "+(d=(d=-(1+v))?d+"px":"0"),"right: "+(g=(g=-f)?g+"px":"0"),"bottom: "+(m=(m=-v)?m+"px":"0")])),S=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),w=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),x=i(["position: absolute","left: 0","top: 0"]),E=i(["position: absolute","width: 200%","height: 200%"]),M=document.createElement("div"),D=document.createElement("div"),T=document.createElement("div"),k=document.createElement("div"),L=document.createElement("div"),A=document.createElement("div");M.dir="ltr",M.style.cssText=b,M.className=u,D.className=u,D.style.cssText=y,T.style.cssText=S,k.style.cssText=x,L.style.cssText=w,A.style.cssText=E,T.appendChild(k),L.appendChild(A),D.appendChild(T),D.appendChild(L),M.appendChild(D),r.appendChild(M),n(T,"scroll",s),n(L,"scroll",o),h(t).onExpandScroll=s,h(t).onShrinkScroll=o}else p("Aborting because element has been uninstalled")}function M(){function i(t,i,n){var s=(e=>o(e).childNodes[0])(t),r=S(i),a=w(n);s.style.setProperty("width",r+"px",e.important?"important":""),s.style.setProperty("height",a+"px",e.important?"important":"")}function n(n){var o=t.offsetWidth,r=t.offsetHeight,c=o!==h(t).lastWidth||r!==h(t).lastHeight;p("Storing current size",o,r),v(t,o,r),l.add(0,(()=>{c&&(h(t)?s()?(e.debug&&(t.offsetWidth===o&&t.offsetHeight===r||a.warn(d.get(t),"Scroll: Size changed before updating detector elements.")),i(t,o,r)):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled"))})),l.add(1,(()=>{h(t)?s()?x(t,o,r):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})),c&&n&&l.add(2,(()=>{h(t)?s()?n():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}))}function s(){return!!h(t).container}function c(){p("notifyListenersIfNeeded invoked");var e=h(t);return void 0===h(t).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void Et(h(t).listeners,(e=>{e(t)})))}function u(){p("Scroll detected."),m(t)?p("Scroll event fired while unrendered. Ignoring..."):n(c)}if(p("registerListenersAndPositionElements invoked."),h(t)){h(t).onRendered=()=>{if(p("startanimation triggered."),m(t))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=o(t),i=r(t);0!==e.scrollLeft&&0!==e.scrollTop&&0!==i.scrollLeft&&0!==i.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),n(c))}},h(t).onExpand=u,h(t).onShrink=u;var g=h(t).style;i(t,g.width,g.height)}else p("Aborting because element has been uninstalled")}function D(){if(p("finalizeDomMutation invoked."),h(t)){var e=h(t).style;v(t,e.width,e.height),x(t,e.width,e.height)}else p("Aborting because element has been uninstalled")}function T(){s(t)}function k(){var e;p("Installing..."),h(t).listeners=[],e=g(),h(t).startSize={width:e.width,height:e.height},p("Element start size",h(t).startSize),l.add(0,f),l.add(1,E),l.add(2,M),l.add(3,D),l.add(4,T)}s||(s=t,t=e,e=null),e=e||{},p("Making detectable..."),(e=>!(e=>e===e.ownerDocument.body||e.ownerDocument.body.contains(e))(e)||null===window.getComputedStyle(e))(t)?(p("Element is detached"),C(),p("Waiting until element is attached..."),h(t).onRendered=()=>{p("Element is now attached"),k()}):k()},addListener(e,t){if(!h(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");h(e).listeners.push(t)},uninstall(e){var t=h(e);t&&(t.onExpandScroll&&s(o(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(r(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:t}},Dt=ut.forEach,Tt=e=>{var t;if((e=e||{}).idHandler)t={get:t=>e.idHandler.get(t,!0),set:e.idHandler.set};else{var i=gt(),n=ft({idGenerator:i,stateHandler:xt});t=n}var s=e.reporter;s||(s=vt(!1===s));var o=S(e,"batchProcessor",St({reporter:s})),r={};r.callOnAdd=!!S(e,"callOnAdd",!0),r.debug=!!S(e,"debug",!1);var a,l=mt(t),h=pt({stateHandler:xt}),d=S(e,"strategy","object"),c=S(e,"important",!1),u={reporter:s,batchProcessor:o,stateHandler:xt,idHandler:t,important:c};if("scroll"===d&&(bt.isLegacyOpera()?(s.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),d="object"):bt.isIE(9)&&(s.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),d="object")),"scroll"===d)a=Mt(u);else{if("object"!==d)throw Error("Invalid strategy name: "+d);a=Ct(u)}var p={};return{listenTo(e,i,n){function o(e){var t=l.get(e);Dt(t,(t=>{t(e)}))}function d(e,t,i){l.add(t,i),e&&i(t)}if(n||(n=i,i=e,e={}),!i)throw Error("At least one element required.");if(!n)throw Error("Listener required.");if(y(i))i=[i];else{if(!v(i))return s.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=b(i)}var u=0,m=S(e,"callOnAdd",r.callOnAdd),g=S(e,"onReady",(()=>{})),f=S(e,"debug",r.debug);Dt(i,(e=>{xt.getState(e)||(xt.initState(e),t.set(e));var r=t.get(e);if(f&&s.log("Attaching listener to element",r,e),!h.isDetectable(e))return f&&s.log(r,"Not detectable."),h.isBusy(e)?(f&&s.log(r,"System busy making it detectable"),d(m,e,n),p[r]=p[r]||[],void p[r].push((()=>{++u===i.length&&g()}))):(f&&s.log(r,"Making detectable..."),h.markBusy(e,!0),a.makeDetectable({debug:f,important:c},e,(e=>{if(f&&s.log(r,"onElementDetectable"),xt.getState(e)){h.markAsDetectable(e),h.markBusy(e,!1),a.addListener(e,o),d(m,e,n);var t=xt.getState(e);t&&t.startSize&&(t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||o(e)),p[r]&&Dt(p[r],(e=>{e()}))}else f&&s.log(r,"Element uninstalled before being detectable.");delete p[r],++u===i.length&&g()})));f&&s.log(r,"Already detecable, adding listener."),d(m,e,n),u++})),u===i.length&&g()},removeListener:l.removeListener,removeAllListeners:l.removeAllListeners,uninstall(e){if(!e)return s.error("At least one element is required.");if(y(e))e=[e];else{if(!v(e))return s.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=b(e)}Dt(e,(e=>{l.removeAllListeners(e),a.uninstall(e),xt.cleanState(e)}))},initDocument(e){a.initDocument&&a.initDocument(e)}}};const kt=/[-/\\^$*+?.()|[\]{}]/g,Lt=/([A-Z])|(_)/g;let At=0;const Rt=()=>At++;class Pt{static isType(e,t){return Array.isArray(e.type)?e.type.indexOf(t)>=0:t===e.type}constructor(e,t,i){this.marker=e,this.minimap=t,this.emitter=new ze.Emitter,this.id=At++,this.properties=null,this.setProperties(i),this.properties.id=this.id,this.destroyed=!1,this.markerDestroyDisposable=this.marker.onDidDestroy((()=>{this.destroy()})),this.screenRange=e.getScreenRange()}destroy(){this.destroyed||(this.markerDestroyDisposable.dispose(),this.markerDestroyDisposable=null,this.destroyed=!0,this.emitter.emit("did-destroy"),this.emitter.dispose())}isDestroyed(){return this.destroyed}onDidChangeProperties(e){return this.emitter.on("did-change-properties",e)}onDidDestroy(e){return this.emitter.on("did-destroy",e)}getId(){return this.id}getMarker(){return this.marker}isType(e){return Pt.isType(this.properties,e)}getProperties(){return this.properties}setProperties(e){if(this.destroyed)return;const t=this.properties;this.properties=e,this.properties.id=this.id,this.emitter.emit("did-change-properties",{oldProperties:t,newProperties:e})}}class Ht{initializeDecorations(e){this.minimap=e,this.emitter=null==this.emitter?new ze.Emitter:this.minimap.emitter,this.decorationsById=new Map,this.decorationsByMarkerId=new Map,this.decorationMarkerChangedSubscriptions=new Map,this.decorationMarkerDestroyedSubscriptions=new Map,this.decorationUpdatedSubscriptions=new Map,this.decorationDestroyedSubscriptions=new Map,this.destroyed=!1}getDecorations(){return this.decorationsById.values()}onDidAddDecoration(e){return this.emitter.on("did-add-decoration",e)}onDidRemoveDecoration(e){return this.emitter.on("did-remove-decoration",e)}onDidChangeDecoration(e){return this.emitter.on("did-change-decoration",e)}onDidChangeDecorationRange(e){return this.emitter.on("did-change-decoration-range",e)}onDidUpdateDecoration(e){return this.emitter.on("did-update-decoration",e)}decorationForId(e){return this.decorationsById.get(e)}decorationsForScreenRowRange(e,t){const i={},n=this.findMarkers({intersectsScreenRowRange:[e,t]});for(let e=0,t=n.length;t>e;e++){const t=n[e],s=this.decorationsByMarkerId.get(t.id);void 0!==s&&(i[t.id]=s)}return i}decorationsByTypeThenRows(){if(null!=this.decorationsByTypeThenRowsCache)return this.decorationsByTypeThenRowsCache;const e={},t=this.decorationsById.values();for(const i of t){const t=i.marker.getScreenRange(),n=i.getProperties().type;null==e[n]&&(e[n]={});for(let s=t.start.row,o=t.end.row;o>=s;s++)null==e[n][s]&&(e[n][s]=[]),e[n][s].push(i)}return this.decorationsByTypeThenRowsCache=e,e}invalidateDecorationForScreenRowsCache(){this.decorationsByTypeThenRowsCache=null}decorateMarker(e,t){if(this.destroyed||this.minimap.destroyed||null==e)return;const{id:i}=e;"highlight"===t.type&&(t.type="highlight-over");const{type:n,plugin:s}=t;if(null==s&&(t.plugin=C()),null==t.scope&&null!=t.class){const e=t.class.split(" ").join(".");t.scope=".minimap ."+e}this.decorationMarkerDestroyedSubscriptions.has(i)||this.decorationMarkerDestroyedSubscriptions.set(i,e.onDidDestroy((()=>{this.removeAllDecorationsForMarker(e)}))),this.decorationMarkerChangedSubscriptions.has(i)||this.decorationMarkerChangedSubscriptions.set(i,e.onDidChange((t=>{const s=this.decorationsByMarkerId.get(i),o=e.getScreenRange();if(this.invalidateDecorationForScreenRowsCache(),void 0!==s)for(let i=0,n=s.length;n>i;i++){const n=s[i];this.emitter.emit("did-change-decoration",{marker:e,decoration:n,event:t}),this.emitDecorationChanges(n.type,n),n.screenRange=o}let r=t.oldTailScreenPosition,a=t.oldHeadScreenPosition,l=t.newTailScreenPosition,h=t.newHeadScreenPosition;r.row>a.row&&([r,a]=[a,r]),l.row>h.row&&([l,h]=[h,l]);const d=E(r,a,l,h);for(let e=0,t=d.length;t>e;e++){const[t,i]=d[e];this.emitRangeChanges(n,{start:t,end:i},0)}})));const o=new Pt(e,this,t);return this.decorationsByMarkerId.has(i)||this.decorationsByMarkerId.set(i,[]),this.decorationsByMarkerId.get(i).push(o),this.decorationsById.set(o.id,o),this.decorationUpdatedSubscriptions.has(o.id)||this.decorationUpdatedSubscriptions.set(o.id,o.onDidChangeProperties((e=>{this.emitDecorationChanges(n,o)}))),this.decorationDestroyedSubscriptions.set(o.id,o.onDidDestroy((()=>{this.removeDecoration(o)}))),this.emitDecorationChanges(n,o),this.emitter.emit("did-add-decoration",{marker:e,decoration:o}),o}emitDecorationChanges(e,t){if(this.destroyed||this.minimap.editorDestroyed())return;this.invalidateDecorationForScreenRowsCache();const i=t.screenRange;i.start&&i.end&&this.emitRangeChanges(e,i,0)}emitRangeChanges(e,t,i){const n=t.start.row,s=t.end.row,o=this.minimap.getLastVisibleScreenRow(),r=this.minimap.getFirstVisibleScreenRow();null==i&&(i=o-r-(s-n)),this.emitter.emit("did-change-decoration-range",{start:n,end:s,screenDelta:i,type:e})}removeDecoration(e){if(null==e)return;const t=e.marker;let i;this.decorationsById.delete(e.id),i=this.decorationUpdatedSubscriptions.get(e.id),void 0!==i&&i.dispose(),i=this.decorationDestroyedSubscriptions.get(e.id),void 0!==i&&i.dispose(),this.decorationUpdatedSubscriptions.delete(e.id),this.decorationDestroyedSubscriptions.delete(e.id);const n=this.decorationsByMarkerId.get(t.id);if(void 0===n)return;this.emitDecorationChanges(e.getProperties().type,e);const s=n.indexOf(e);s>-1&&(n.splice(s,1),this.emitter.emit("did-remove-decoration",{marker:t,decoration:e}),0===n.length&&this.removedAllMarkerDecorations(t))}removeAllDecorationsForMarker(e){if(null==e)return;const t=this.decorationsByMarkerId.get(e.id);if(void 0!==t){for(let i=0,n=t.length;n>i;i++){const n=t[i];this.destroyed||this.minimap.editorDestroyed()||this.emitDecorationChanges(n.getProperties().type,n),this.emitter.emit("did-remove-decoration",{marker:e,decoration:n})}this.removedAllMarkerDecorations(e)}}removedAllMarkerDecorations(e){null!=e&&(this.decorationMarkerChangedSubscriptions.get(e.id).dispose(),this.decorationMarkerDestroyedSubscriptions.get(e.id).dispose(),this.decorationsByMarkerId.delete(e.id),this.decorationMarkerChangedSubscriptions.delete(e.id),this.decorationMarkerDestroyedSubscriptions.delete(e.id))}removeAllDecorations(){const e=this.decorationMarkerChangedSubscriptions.values();for(const t of e)t.dispose();const t=this.decorationMarkerDestroyedSubscriptions.values();for(const e of t)e.dispose();const i=this.decorationUpdatedSubscriptions.values();for(const e of i)e.dispose();const n=this.decorationDestroyedSubscriptions.values();for(const e of n)e.dispose();const s=this.decorationsById.values();for(const e of s)e.destroy();this.decorationsById.clear(),this.decorationsByMarkerId.clear(),this.decorationMarkerChangedSubscriptions.clear(),this.decorationMarkerDestroyedSubscriptions.clear(),this.decorationUpdatedSubscriptions.clear(),this.decorationDestroyedSubscriptions.clear()}destroy(){this.removeAllDecorations(),this.minimap=void 0,this.emitter=void 0,this.destroyed=!0}}class It{constructor(){this.canvas=document.createElement("canvas");const e="linux"!==process.platform;this.context=this.canvas.getContext("2d",{desynchronized:e}),this.canvas.webkitImageSmoothingEnabled=!1,this.context.imageSmoothingEnabled=!1,this.offscreenCanvas=document.createElement("canvas"),this.offscreenContext=this.offscreenCanvas.getContext("2d",{desynchronized:e}),this.offscreenCanvas.webkitImageSmoothingEnabled=!1,this.offscreenContext.imageSmoothingEnabled=!1}attach(e){this.canvas.parentNode||e.appendChild(this.canvas)}setSize(e=0,t=0){this.canvas.width=e,this.canvas.height=t,this.context.imageSmoothingEnabled=!1,this.resetOffscreenSize()}getSize(){return{width:this.canvas.width,height:this.canvas.height}}resetOffscreenSize(){this.offscreenCanvas.width=this.canvas.width,this.offscreenCanvas.height=this.canvas.height,this.offscreenContext.imageSmoothingEnabled=!1}copyToOffscreen(){this.canvas.width>0&&this.canvas.height>0&&this.offscreenContext.drawImage(this.canvas,0,0)}copyFromOffscreen(){this.offscreenCanvas.width>0&&this.offscreenCanvas.height>0&&this.context.drawImage(this.offscreenCanvas,0,0)}copyPartFromOffscreen(e,t,i){this.offscreenCanvas.width>0&&this.offscreenCanvas.height>0&&this.context.drawImage(this.offscreenCanvas,0,e,this.offscreenCanvas.width,i,0,t,this.offscreenCanvas.width,i)}clearCanvas(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}}const Ot=!1;let _t;class Nt extends rt{initializeCanvas(){this.tokensLayer=new It,this.backLayer=new It,this.frontLayer=new It,this.pendingChanges||(this.pendingChanges=[]),this.pendingBackDecorationChanges||(this.pendingBackDecorationChanges=[]),this.pendingFrontDecorationChanges||(this.pendingFrontDecorationChanges=[]),this.maxTokensInOneLine=atom.config.get("minimap.maxTokensInOneLine")}getFrontCanvas(){return this.frontLayer.canvas}attachCanvases(e){this.backLayer.attach(e),this.tokensLayer.attach(e),this.frontLayer.attach(e)}setCanvasesSize(e,t){this.backLayer.setSize(e,t),this.tokensLayer.setSize(e,t),this.frontLayer.setSize(e,t)}updateCanvas(){const e=this.minimap.getFirstVisibleScreenRow(),t=this.minimap.getLastVisibleScreenRow(),i=this.minimap.getDevicePixelRatio(),n=this.minimap.getLineHeight()*i,s=this.minimap.getCharHeight()*i,o=this.minimap.getCharWidth()*i,{width:r,height:a}=this.tokensLayer.getSize(),l=this.minimap.getTextEditor(),h=this.minimap.getTextEditorElement(),d=this.displayCodeHighlights?e=>j(e,h,this.textOpacity):()=>W(h,this.textOpacity);M(this.tokensLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingChanges,n,s,o,r,l,l.getScreenLineCount(),A(l),d,this.ignoreWhitespacesInTokens,this.maxTokensInOneLine);const c=this.DecorationManagement.decorationsByTypeThenRows(e,t),u={context:this.backLayer.context,canvasWidth:r,canvasHeight:a,lineHeight:n,charWidth:o,charHeight:s,orders:ge()},p=(e,t,i)=>O(e,t,i,h);jt["background-custom"]=p,Bt["foreground-custom"]=p,D(this.backLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingBackDecorationChanges,u,n,h,c),u.context=this.frontLayer.context,T(this.frontLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingFrontDecorationChanges,u,n,h,c),this.pendingChanges=[],this.pendingBackDecorationChanges=[],this.pendingFrontDecorationChanges=[],this.offscreenFirstRow=e,this.offscreenLastRow=t}}const Ft=/^\s+$/,Wt=/\s+/,jt={line:R,"highlight-under":H},Bt={gutter:P,"highlight-over":H,"highlight-outline":I};class qt{static initClass(){return V(this,ct.EventsDelegation,ct.SpacePenDSL.Babel),Q(this,"minimap-quick-settings")}static content(){this.div({class:"select-list popover-list minimap-quick-settings"},(()=>{this.input({type:"text",class:"hidden-input",outlet:"hiddenInput"}),this.ol({class:"list-group mark-active",outlet:"list"},(()=>{this.li({class:"separator",outlet:"separator"}),this.li({class:"code-highlights",outlet:"codeHighlights"},"code-highlights"),this.li({class:"absolute-mode",outlet:"absoluteMode"},"absolute-mode"),this.li({class:"adjust-absolute-mode-height",outlet:"adjustAbsoluteModeHeight"},"adjust-absolute-mode-height")})),this.div({class:"btn-group"},(()=>{this.button({class:"btn btn-default",outlet:"onLeftButton"},"On Left"),this.button({class:"btn btn-default",outlet:"onRightButton"},"On Right")}))}))}createdCallback(){this.buildContent()}setModel(e){this.selectedItem=null,this.minimap=e,this.emitter=new ze.Emitter,this.subscriptions=new ze.CompositeDisposable,this.plugins={},this.itemsActions=new WeakMap,this.codeHighlights.classList.toggle("active",this.minimap.displayCodeHighlights),this.itemsActions.set(this.codeHighlights,(()=>{atom.config.set("minimap.displayCodeHighlights",!this.minimap.displayCodeHighlights)})),this.itemsActions.set(this.absoluteMode,(()=>{atom.config.set("minimap.absoluteMode",!atom.config.get("minimap.absoluteMode"))})),this.itemsActions.set(this.adjustAbsoluteModeHeight,(()=>{atom.config.set("minimap.adjustAbsoluteModeHeight",!atom.config.get("minimap.adjustAbsoluteModeHeight"))})),this.subscriptions.add(Ae((({name:e,plugin:t})=>this.addItemFor(e,t))),Re((({name:e,plugin:t})=>this.removeItemFor(e,t))),Pe((({name:e,plugin:t})=>this.activateItem(e,t))),He((({name:e,plugin:t})=>this.deactivateItem(e,t))),atom.commands.add("minimap-quick-settings",{"core:move-up":()=>{this.selectPreviousItem()},"core:move-down":()=>{this.selectNextItem()},"core:move-left"(){atom.config.set("minimap.displayMinimapOnLeft",!0)},"core:move-right"(){atom.config.set("minimap.displayMinimapOnLeft",!1)},"core:cancel":()=>{this.destroy()},"core:confirm":()=>{this.toggleSelectedItem()}}),this.subscribeTo(this.codeHighlights,{mousedown:e=>{e.preventDefault(),atom.config.set("minimap.displayCodeHighlights",!this.minimap.displayCodeHighlights)}}),this.subscribeTo(this.absoluteMode,{mousedown(e){e.preventDefault(),atom.config.set("minimap.absoluteMode",!atom.config.get("minimap.absoluteMode"))}}),this.subscribeTo(this.adjustAbsoluteModeHeight,{mousedown(e){e.preventDefault(),atom.config.set("minimap.adjustAbsoluteModeHeight",!atom.config.get("minimap.adjustAbsoluteModeHeight"))}}),this.subscribeTo(this.hiddenInput,{focusout:e=>{this.destroy()}},{passive:!0}),this.subscribeTo(this.onLeftButton,{mousedown(e){e.preventDefault(),atom.config.set("minimap.displayMinimapOnLeft",!0)}}),this.subscribeTo(this.onRightButton,{mousedown(e){e.preventDefault(),atom.config.set("minimap.displayMinimapOnLeft",!1)}}),atom.config.observe("minimap.displayCodeHighlights",(e=>{this.codeHighlights.classList.toggle("active",e)})),atom.config.observe("minimap.absoluteMode",(e=>{this.absoluteMode.classList.toggle("active",e)})),atom.config.observe("minimap.adjustAbsoluteModeHeight",(e=>{this.adjustAbsoluteModeHeight.classList.toggle("active",e)})),atom.config.observe("minimap.displayMinimapOnLeft",(e=>{this.onLeftButton.classList.toggle("selected",e),this.onRightButton.classList.toggle("selected",!e)}))),this.initList()}onDidDestroy(e){return this.emitter.on("did-destroy",e)}attach(){atom.views.getView(atom.workspace).appendChild(this),this.hiddenInput.focus()}destroy(){this.emitter.emit("did-destroy"),this.subscriptions.dispose(),this.parentNode.removeChild(this)}initList(){this.itemsDisposables=new WeakMap;for(const e in ki)this.addItemFor(e,ki[e])}toggleSelectedItem(){const e=this.itemsActions.get(this.selectedItem);"function"==typeof e&&e()}selectNextItem(){this.selectedItem.classList.remove("selected"),null!=this.selectedItem.nextSibling?(this.selectedItem=this.selectedItem.nextSibling,this.selectedItem.matches(".separator")&&(this.selectedItem=this.selectedItem.nextSibling)):this.selectedItem=this.list.firstChild,this.selectedItem.classList.add("selected")}selectPreviousItem(){this.selectedItem.classList.remove("selected"),null!=this.selectedItem.previousSibling?(this.selectedItem=this.selectedItem.previousSibling,this.selectedItem.matches(".separator")&&(this.selectedItem=this.selectedItem.previousSibling)):this.selectedItem=this.list.lastChild,this.selectedItem.classList.add("selected")}addItemFor(e,t){const i=document.createElement("li"),n=()=>{ae(e)};t.isActive()&&i.classList.add("active"),i.textContent=e,this.itemsActions.set(i,n),this.itemsDisposables.set(i,this.addDisposableEventListener(i,"mousedown",(e=>{e.preventDefault(),n()}))),this.plugins[e]=i,this.list.insertBefore(i,this.separator),null==this.selectedItem&&(this.selectedItem=i,this.selectedItem.classList.add("selected"))}removeItemFor(e,t){try{this.list.removeChild(this.plugins[e])}catch(e){}delete this.plugins[e]}activateItem(e,t){this.plugins[e].classList.add("active")}deactivateItem(e,t){this.plugins[e].classList.remove("active")}}const zt=qt.initClass(),Ut=Tt({strategy:"scroll"});let Vt;const $t=!1;class Qt{static initClass(){return V(this,Nt,ct.EventsDelegation,ct.AncestorsMethods),Q(this,"atom-text-editor-minimap")}createdCallback(){this.minimap=void 0,this.width=void 0,this.height=void 0,this.subscriptions=new ze.CompositeDisposable,this.visibleAreaSubscription=void 0,this.quickSettingsSubscription=void 0,this.dragSubscription=void 0,this.openQuickSettingSubscription=void 0,this.displayMinimapOnLeft=!1,this.minimapScrollIndicator=void 0,this.displayMinimapOnLeft=void 0,this.displayPluginsControls=void 0,this.textOpacity=void 0,this.displayCodeHighlights=void 0,this.adjustToSoftWrap=void 0,this.useHardwareAcceleration=void 0,this.absoluteMode=void 0,this.visibleArea=void 0,this.controls=void 0,this.scrollIndicator=void 0,this.openQuickSettings=void 0,this.quickSettingsElement=void 0,this.DecorationManagement=new Ht,this.attached=void 0,this.attachedToTextEditor=void 0,this.standAlone=void 0,this.wasVisible=void 0,this.offscreenFirstRow=void 0,this.offscreenLastRow=void 0,this.frameRequested=void 0,this.flexBasis=void 0,this.initializeContent(),this.subscriptions.add(atom.config.observe("minimap.displayMinimapOnLeft",(e=>{this.displayMinimapOnLeft=e,e?Y():G(),this.updateMinimapFlexPosition(),this.measureHeightAndWidth(!0,!0)})),atom.config.observe("minimap.minimapScrollIndicator",(e=>{this.minimapScrollIndicator=e,this.minimapScrollIndicator&&null==this.scrollIndicator&&!this.standAlone?this.initializeScrollIndicator():null!=this.scrollIndicator&&this.disposeScrollIndicator(),this.attached&&this.requestUpdate()})),atom.config.observe("minimap.displayPluginsControls",(e=>{this.displayPluginsControls=e,this.displayPluginsControls&&null==this.openQuickSettings&&!this.standAlone?this.initializeOpenQuickSettings():null!=this.openQuickSettings&&this.disposeOpenQuickSettings()})),atom.config.observe("minimap.textOpacity",(e=>{this.textOpacity=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("minimap.displayCodeHighlights",(e=>{this.displayCodeHighlights=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("minimap.smoothScrolling",(e=>{this.smoothScrolling=e,this.attached&&(this.smoothScrolling?this.requestUpdate():(this.backLayer.canvas.style.cssText="",this.tokensLayer.canvas.style.cssText="",this.frontLayer.canvas.style.cssText=""))})),atom.config.observe("minimap.adjustMinimapWidthToSoftWrap",(e=>{this.adjustToSoftWrap=e,this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.adjustMinimapWidthOnlyIfSmaller",(e=>{this.adjustOnlyIfSmaller=e,this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.useHardwareAcceleration",(e=>{this.useHardwareAcceleration=e,this.attached&&this.requestUpdate()})),atom.config.observe("minimap.absoluteMode",(e=>{this.absoluteMode=e,this.classList.toggle("absolute",this.absoluteMode)})),atom.config.observe("minimap.adjustAbsoluteModeHeight",(e=>{this.adjustAbsoluteModeHeight=e,this.classList.toggle("adjust-absolute-height",this.adjustAbsoluteModeHeight),this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.ignoreWhitespacesInTokens",(e=>{this.ignoreWhitespacesInTokens=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("editor.preferredLineLength",(()=>{this.attached&&this.measureHeightAndWidth()})),atom.config.observe("editor.softWrap",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.showInvisibles",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.invisibles",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.softWrapAtPreferredLineLength",(()=>{this.attached&&this.requestUpdate()})))}attachedCallback(){if("function"==typeof atom.views.pollDocument)this.subscriptions.add(atom.views.pollDocument((()=>{this.pollDOM()})));else{this.intersectionObserver=new IntersectionObserver((e=>{const{intersectionRect:t}=e[e.length-1];(t.width>0||t.height>0)&&this.measureHeightAndWidth(!0,!0)})),this.intersectionObserver.observe(this),this.isVisible()&&this.measureHeightAndWidth(!0,!0);const e=()=>{this.measureHeightAndWidth(!1,!1)};Ut.listenTo(this,e),window.addEventListener("resize",e,{passive:!0}),this.subscriptions.add(new ze.Disposable((()=>{Ut.removeListener(this,e)})),new ze.Disposable((()=>{window.removeEventListener("resize",e)})))}this.measureHeightAndWidth(),this.updateMinimapFlexPosition(),this.attached=!0,this.attachedToTextEditor=this.queryParentSelector("atom-text-editor")===this.minimap.getTextEditorElement(),this.attachedToTextEditor&&this.minimap.getTextEditorElement().setAttribute("with-minimap",""),this.subscriptions.add(this.subscribeToMediaQuery())}detachedCallback(){this.minimap.getTextEditorElement().removeAttribute("with-minimap"),this.attached=!1}isVisible(){return this.offsetWidth>0||this.offsetHeight>0}attach(e){if(this.attached)return;const t=e||this.minimap.getTextEditorElement(),i=t.querySelectorAll("atom-text-editor-minimap");i.length&&[].forEach.call(i,(e=>{e.destroy(),t.removeChild(e)})),t.appendChild(this)}detach(){this.attached&&null!=this.parentNode&&this.parentNode.removeChild(this)}updateMinimapFlexPosition(){this.classList.toggle("left",this.displayMinimapOnLeft)}destroy(){this.DecorationManagement.destroy(),this.quickSettingsElement&&this.quickSettingsElement.destroy(),this.subscriptions.dispose(),this.detach(),this.minimap&&(this.minimap.minimapElement=null,this.minimap=null)}initializeContent(){this.initializeCanvas(),this.attachCanvases(this),this.createVisibleArea(),this.createControls(),this.subscriptions.add(this.subscribeTo(this,{mousewheel:e=>{!this.standAlone&&this.minimap.onMouseWheel&&this.minimap.onMouseWheel(e)}},{passive:!0}),this.subscribeTo(this.getFrontCanvas(),{mousedown:e=>{this.canvasPressed(X(e))},touchstart:e=>{this.canvasPressed(K(e))}},{passive:!0}))}createVisibleArea(){this.visibleArea||(this.visibleArea=document.createElement("div"),this.visibleArea.classList.add("minimap-visible-area"),this.appendChild(this.visibleArea),this.visibleAreaSubscription=this.subscribeTo(this.visibleArea,{mousedown:e=>{this.startDrag(X(e))},touchstart:e=>{this.startDrag(K(e))}},{passive:!0}),this.subscriptions.add(this.visibleAreaSubscription))}removeVisibleArea(){this.visibleArea&&(this.subscriptions.remove(this.visibleAreaSubscription),this.visibleAreaSubscription.dispose(),this.removeChild(this.visibleArea),delete this.visibleArea)}createControls(){this.controls||this.standAlone||(this.controls=document.createElement("div"),this.controls.classList.add("minimap-controls"),this.appendChild(this.controls))}removeControls(){this.controls&&(this.removeChild(this.controls),delete this.controls)}initializeScrollIndicator(){this.scrollIndicator||this.standAlone||(this.scrollIndicator=document.createElement("div"),this.scrollIndicator.classList.add("minimap-scroll-indicator"),this.controls.appendChild(this.scrollIndicator))}disposeScrollIndicator(){this.scrollIndicator&&(this.controls.removeChild(this.scrollIndicator),delete this.scrollIndicator)}initializeOpenQuickSettings(){this.openQuickSettings||this.standAlone||(this.openQuickSettings=document.createElement("div"),this.openQuickSettings.classList.add("open-minimap-quick-settings"),this.controls.appendChild(this.openQuickSettings),this.openQuickSettingSubscription=this.subscribeTo(this.openQuickSettings,{mousedown:e=>{if(e.preventDefault(),e.stopPropagation(),null!=this.quickSettingsElement)this.quickSettingsElement.destroy(),this.quickSettingsSubscription.dispose();else{this.quickSettingsElement=new zt,this.quickSettingsElement.setModel(this),this.quickSettingsSubscription=this.quickSettingsElement.onDidDestroy((()=>{this.quickSettingsElement=null}));const{top:e,left:t,right:i}=this.getFrontCanvas().getBoundingClientRect();this.quickSettingsElement.style.top=e+"px",this.quickSettingsElement.attach(),this.quickSettingsElement.style.left=this.displayMinimapOnLeft?i+"px":t-this.quickSettingsElement.clientWidth+"px"}}}))}disposeOpenQuickSettings(){this.openQuickSettings&&(this.controls.removeChild(this.openQuickSettings),this.openQuickSettingSubscription.dispose(),delete this.openQuickSettings)}getDecorationManagement(){return this.DecorationManagement}getModel(){return this.minimap}setModel(e){return this.minimap=e,this.minimap.minimapElement=this,this.DecorationManagement.initializeDecorations(this.minimap),this.subscriptions.add(this.minimap.onDidChangeScrollTop((()=>{this.requestUpdate()})),this.minimap.onDidChangeScrollLeft((()=>{this.requestUpdate()})),this.minimap.onDidDestroy((()=>{this.destroy()})),this.minimap.onDidChangeConfig((()=>{if(this.attached)return this.requestForcedUpdate()})),this.minimap.onDidChangeStandAlone((()=>{this.setStandAlone(this.minimap.isStandAlone()),this.requestUpdate()})),this.minimap.onDidChange((e=>{this.pendingChanges.push(e),this.requestUpdate()})),this.DecorationManagement.onDidChangeDecorationRange((e=>{const{type:t}=e;"line"===t||"highlight-under"===t||"background-custom"===t?this.pendingBackDecorationChanges.push(e):this.pendingFrontDecorationChanges.push(e),this.requestUpdate()})),Ie((()=>{this.requestForcedUpdate()}))),this.setStandAlone(this.minimap.isStandAlone()),null!=this.width&&null!=this.height&&this.minimap.setScreenHeightAndWidth(this.height,this.width),this.minimap}setStandAlone(e){this.standAlone=e,this.standAlone?(this.setAttribute("stand-alone",!0),this.disposeScrollIndicator(),this.disposeOpenQuickSettings(),this.removeControls(),this.removeVisibleArea()):(this.removeAttribute("stand-alone"),this.createVisibleArea(),this.createControls(),this.minimapScrollIndicator&&this.initializeScrollIndicator(),this.displayPluginsControls&&this.initializeOpenQuickSettings())}requestUpdate(){this.frameRequested||(this.frameRequested=!0,requestAnimationFrame((()=>{this.update(),this.frameRequested=!1})))}requestForcedUpdate(){this.offscreenFirstRow=null,this.offscreenLastRow=null,this.requestUpdate()}update(){if(!(this.attached&&this.isVisible()&&this.minimap))return;const e=this.minimap;e.enableCache();const t=this.getFrontCanvas(),i=this.minimap.getDevicePixelRatio(),n=e.getTextEditorScaledScrollLeft(),s=e.getTextEditorScaledScrollTop()-e.getScrollTop(),o=Math.min(t.width/i,this.width),r=o+n;this.adjustToSoftWrap&&this.flexBasis?(this.style.flexBasis=this.flexBasis+"px",this.style.width=this.flexBasis+"px"):(this.style.flexBasis=null,this.style.width=null),J(this.visibleArea,{width:Math.round(r)+"px",height:Math.round(e.getTextEditorScaledHeight())+"px",transform:ee(0,s,this.useHardwareAcceleration),"border-left-width":Math.round(n)+"px"}),J(this.controls,{width:Math.round(o)+"px"});const a=e.getFirstVisibleScreenRow()*e.getLineHeight()-e.getScrollTop();if(this.smoothScrolling){let e=ee(0,a,this.useHardwareAcceleration);if(1!==i){const t=1/i;e+=" "+te(t,t,this.useHardwareAcceleration)}J(this.backLayer.canvas,{transform:e}),J(this.tokensLayer.canvas,{transform:e}),J(this.frontLayer.canvas,{transform:e})}else{const e=1/i,t=te(e,e,this.useHardwareAcceleration);J(this.backLayer.canvas,{transform:t}),J(this.tokensLayer.canvas,{transform:t}),J(this.frontLayer.canvas,{transform:t})}if(this.minimapScrollIndicator&&!this.scrollIndicator&&e.canScroll()&&this.initializeScrollIndicator(),null!=this.scrollIndicator){const t=e.getScreenHeight(),i=t*(t/e.getHeight()),n=(t-i)*e.getScrollRatio();J(this.scrollIndicator,{height:i+"px",transform:ee(0,n,this.useHardwareAcceleration)}),e.canScroll()||this.disposeScrollIndicator()}this.absoluteMode&&this.adjustAbsoluteModeHeight&&this.updateCanvasesSize(),this.updateCanvas(),e.clearCache()}setDisplayCodeHighlights(e){this.displayCodeHighlights=e,this.attached&&this.requestForcedUpdate()}pollDOM(){const e=this.checkForVisibilityChange();this.isVisible()&&(this.wasVisible||this.requestForcedUpdate(),this.measureHeightAndWidth(e,!1))}checkForVisibilityChange(){return this.isVisible()?!this.wasVisible&&(this.wasVisible=!0,this.wasVisible):this.wasVisible?(this.wasVisible=!1,!0):(this.wasVisible=!1,this.wasVisible)}measureHeightAndWidth(e,t=!0){if(!this.minimap)return;const i=this.style.flexBasis;this.style.flexBasis="";const n=this.width!==this.clientWidth||this.height!==this.clientHeight;this.height=this.clientHeight,this.width=this.clientWidth;let s=this.width;if(null!=this.minimap&&this.minimap.setScreenHeightAndWidth(this.height,this.width),(n||e||t)&&this.requestForcedUpdate(),this.isVisible())if(n||t){if(this.adjustToSoftWrap){const e=atom.config.get("editor.preferredLineLength"),t=atom.config.get("editor.softWrap"),i=atom.config.get("editor.softWrapAtPreferredLineLength"),n=e*this.minimap.getCharWidth();!(t&&i&&e)||n>this.width&&this.adjustOnlyIfSmaller?(Z(s),delete this.flexBasis):(this.flexBasis=n,s=n,Z(n))}else Z(s),delete this.flexBasis;this.updateCanvasesSize(s)}else this.style.flexBasis=i}updateCanvasesSize(e){const t=this.minimap.getDevicePixelRatio(),i=this.height+this.minimap.getLineHeight(),n=this.absoluteMode&&this.adjustAbsoluteModeHeight?Math.min(this.minimap.getHeight(),i):i,s=this.getFrontCanvas();null==e&&(e=s.width/t),e===s.width&&n===s.height||(this.setCanvasesSize(e*t,n*t),this.absoluteMode&&this.adjustAbsoluteModeHeight&&(this.offscreenFirstRow=null,this.offscreenLastRow=null))}canvasPressed({y:e,isLeftMouse:t,isMiddleMouse:i}){if(!this.minimap.isStandAlone())if(t)this.canvasLeftMousePressed(e);else if(i){this.canvasMiddleMousePressed(e);const{top:t,height:i}=this.visibleArea.getBoundingClientRect();this.startDrag({y:t+i/2,isLeftMouse:!1,isMiddleMouse:!0})}}canvasLeftMousePressed(e){const t=e-this.getBoundingClientRect().top,i=Math.floor(t/this.minimap.getLineHeight())+this.minimap.getFirstVisibleScreenRow(),n=this.minimap.getTextEditor(),s=this.minimap.getTextEditorElement(),o=i*n.getLineHeightInPixels()-this.minimap.getTextEditorHeight()/2,r=s.pixelPositionForScreenPosition([i,0]).top-this.minimap.getTextEditorHeight()/2;if(atom.config.get("minimap.moveCursorOnMinimapClick")&&n.setCursorScreenPosition([i,0]),atom.config.get("minimap.scrollAnimation")){const e=atom.config.get("minimap.scrollAnimationDuration"),t=this.minimap.scrollIndependentlyOnMouseWheel(),i=this.minimap.getTextEditorScrollTop(),n=r;let s;if(t){const t=this.minimap.getScrollTop(),r=Math.min(1,o/(this.minimap.getTextEditorMaxScrollTop()||1))*this.minimap.getMaxScrollTop();s=(e,i)=>{null!==this.minimap&&(this.minimap.setTextEditorScrollTop(e,!0),this.minimap.setScrollTop(t+(r-t)*i))},ie({from:i,to:n,duration:e,step:s})}else s=e=>{null!==this.minimap&&this.minimap.setTextEditorScrollTop(e)},ie({from:i,to:n,duration:e,step:s})}else this.minimap.setTextEditorScrollTop(r)}canvasMiddleMousePressed(e){const{top:t}=this.getBoundingClientRect(),i=(e-t-this.minimap.getTextEditorScaledHeight()/2)/(this.minimap.getVisibleHeight()-this.minimap.getTextEditorScaledHeight());this.minimap.setTextEditorScrollTop(i*this.minimap.getTextEditorMaxScrollTop())}subscribeToMediaQuery(){const e=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"),t=()=>{this.requestForcedUpdate()};return e.addEventListener("change",t),new ze.Disposable((()=>{e.removeEventListener("change",t)}))}startDrag({y:e,isLeftMouse:t,isMiddleMouse:i}){if(!this.minimap)return;if(!t&&!i)return;const n={dragOffset:e-this.visibleArea.getBoundingClientRect().top,offsetTop:this.getBoundingClientRect().top},s=e=>this.drag(X(e),n),o=()=>this.endDrag(),r=e=>this.drag(K(e),n);document.body.addEventListener("mousemove",s,{passive:!0}),document.body.addEventListener("mouseup",o,{passive:!0}),document.body.addEventListener("mouseleave",o,{passive:!0}),document.body.addEventListener("touchmove",r,{passive:!0}),document.body.addEventListener("touchend",o,{passive:!0}),document.body.addEventListener("touchcancel",o,{passive:!0}),this.dragSubscription=new ze.Disposable((()=>{document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mouseleave",o),document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",o),document.body.removeEventListener("touchcancel",o)}))}drag({y:e,isLeftMouse:t,isMiddleMouse:i},n){if(!this.minimap)return;if(!t&&!i)return;const s=(e-n.offsetTop-n.dragOffset)/(this.minimap.getVisibleHeight()-this.minimap.getTextEditorScaledHeight());this.minimap.setTextEditorScrollTop(s*this.minimap.getTextEditorMaxScrollTop())}endDrag(){this.minimap&&this.dragSubscription.dispose()}}const Yt=Qt.initClass();class Gt{constructor(e){this.textEditor=e}enableCache(){this.useCache=!0}clearCache(){this.useCache=!1,delete this.heightCache,delete this.scrollTopCache,delete this.scrollLeftCache,delete this.maxScrollTopCache}onDidChangeScrollTop(e){return this.textEditor.onDidChangeScrollTop(e)}onDidChangeScrollLeft(e){return this.textEditor.onDidChangeScrollLeft(e)}getHeight(){return this.useCache?(this.heightCache||(this.heightCache=this.textEditor.getHeight()),this.heightCache):this.textEditor.getHeight()}getScrollTop(){return this.useCache?(this.scrollTopCache||(this.scrollTopCache=this.textEditor.getScrollTop()),this.scrollTopCache):this.textEditor.getScrollTop()}setScrollTop(e){return this.textEditor.setScrollTop(e)}getScrollLeft(){return this.useCache?(this.scrollLeftCache||(this.scrollLeftCache=this.textEditor.getScrollLeft()),this.scrollLeftCache):this.textEditor.getScrollLeft()}getMaxScrollTop(){if(null!=this.maxScrollTopCache&&this.useCache)return this.maxScrollTopCache;let e=this.textEditor.displayBuffer.getMaxScrollTop();const t=this.textEditor.getLineHeightInPixels();return this.scrollPastEnd&&(e-=this.getHeight()-3*t),this.useCache&&(this.maxScrollTopCache=e),e}editorDestroyed(){return!this.textEditor||this.textEditor.isDestroyed()}}const Zt=Object.freeze({__proto__:null,default:Gt}),Xt=t(Zt);class Kt{constructor(e){this.textEditor=e,this.textEditorElement=atom.views.getView(this.textEditor)}enableCache(){this.useCache=!0}clearCache(){this.useCache=!1,delete this.heightCache,delete this.scrollTopCache,delete this.scrollLeftCache,delete this.maxScrollTopCache}onDidChangeScrollTop(e){return this.textEditorElement.onDidChangeScrollTop(e)}onDidChangeScrollLeft(e){return this.textEditorElement.onDidChangeScrollLeft(e)}getHeight(){return this.editorDestroyed()?0:this.useCache?(this.heightCache||(this.heightCache=this.textEditorElement.getHeight()),this.heightCache):this.textEditorElement.getHeight()}getScrollTop(){return this.editorDestroyed()?0:this.useCache?(this.scrollTopCache||(this.scrollTopCache=this.computeScrollTop()),this.scrollTopCache):this.computeScrollTop()}computeScrollTop(){if(this.editorDestroyed())return 0;const e=this.textEditorElement.getScrollTop(),t=this.textEditor.getLineHeightInPixels();let i=this.textEditorElement.getFirstVisibleScreenRow();if(Number.isNaN(i))return 0;let n=this.textEditorElement.pixelPositionForScreenPosition([i,0]).top;return n>e&&(i-=1,n=this.textEditorElement.pixelPositionForScreenPosition([i,0]).top),i*t+Math.min(e-n,t)}setScrollTop(e){this.editorDestroyed()||this.textEditorElement.setScrollTop(e)}getScrollLeft(){return this.editorDestroyed()?0:this.useCache?(this.scrollLeftCache||(this.scrollLeftCache=this.textEditorElement.getScrollLeft()),this.scrollLeftCache):this.textEditorElement.getScrollLeft()}getMaxScrollTop(){if(this.editorDestroyed())return 0;if(null!=this.maxScrollTopCache&&this.useCache)return this.maxScrollTopCache;let e;if(this.textEditorElement.getMaxScrollTop){if(e=this.textEditorElement.getMaxScrollTop(),parseFloat(atom.getVersion())>=1.13&&this.scrollPastEnd){const t=this.textEditor.getLineHeightInPixels();e-=this.getHeight()-3*t}}else if(e=this.textEditorElement.getScrollHeight()-this.getHeight(),this.scrollPastEnd){const t=this.textEditor.getLineHeightInPixels();e-=this.getHeight()-3*t}return this.useCache&&(this.maxScrollTopCache=e),e}editorDestroyed(){return!this.textEditor||this.textEditor.isDestroyed()||!this.textEditorElement.component||!this.textEditorElement.getModel()||!this.textEditorElement.parentNode}}let Jt=1;class ei{constructor(e={}){if(!e.textEditor)throw Error("Cannot create a minimap without an editor");this.minimapElement=void 0,this.DecorationManagement=void 0,this.textEditor=e.textEditor,this.editorElement=void 0,this.standAlone=e.standAlone,this.width=e.width,this.height=e.height,this.id=Jt++,this.emitter=new ze.Emitter,this.subscriptions=new ze.CompositeDisposable,this.adapter=null,this.charHeight=null,this.configCharHeight=null,this.charWidth=null,this.configCharWidth=null,this.interline=null,this.configInterline=null,this.devicePixelRatioRounding=null,this.configDevicePixelRatioRounding=null,this.redrawDelay=0,this.destroyed=!1,this.scrollPastEnd=!1,this.pendingChangeEvents=[],this.flushChangesTimer=null,null!=atom.views.getView(this.textEditor).getScrollTop?this.adapter=new Kt(this.textEditor):(atom.notifications.addWarning("LegacyAdapter of Minimap is deprecated and will be removed in the next major version. Please upgrade Atom to the latest version."),this.adapter=new Xt(this.textEditor)),this.scrollTop=0;let t=this.subscribeToConfig();this.subscriptions.add(t,this.textEditor.onDidChangeGrammar((()=>{this.subscriptions.remove(t),t.dispose(),t=this.subscribeToConfig(),this.subscriptions.add(t)})),this.adapter.onDidChangeScrollTop((()=>{this.standAlone||this.ignoreTextEditorScroll||this.inChangeScrollTop||(this.inChangeScrollTop=!0,this.updateScrollTop(),this.emitter.emit("did-change-scroll-top",this),this.inChangeScrollTop=!1),this.ignoreTextEditorScroll&&(this.ignoreTextEditorScroll=!1)})),this.adapter.onDidChangeScrollLeft((()=>{this.standAlone||this.emitter.emit("did-change-scroll-left",this)})),this.textEditor.onDidChange((e=>{this.scheduleChanges(e)})),this.textEditor.onDidDestroy((()=>{exports.editorsMinimaps&&exports.editorsMinimaps.delete(this.textEditor),this.destroy()})),this.textEditor.onDidTokenize((()=>{this.emitter.emit("did-change-config")})))}destroy(){this.destroyed||(clearTimeout(this.flushChangesTimer),this.flushChangesTimer=null,this.pendingChangeEvents=[],this.subscriptions.dispose(),this.subscriptions=null,this.textEditor=null,this.emitter.emit("did-destroy"),this.emitter.dispose(),this.destroyed=!0)}isDestroyed(){return this.destroyed}scheduleChanges(e){this.pendingChangeEvents=this.pendingChangeEvents.concat(e),this.redrawDelay||this.requestFlushChanges(),this.flushChangesTimer||(this.flushChangesTimer=setTimeout((()=>{this.requestFlushChanges()}),this.redrawDelay))}flushChanges(){clearTimeout(this.flushChangesTimer),this.flushChangesTimer=null,this.emitChanges(this.pendingChangeEvents),this.pendingChangeEvents=[]}requestFlushChanges(){this.requestedFlushChanges||(this.requestedFlushChanges=requestAnimationFrame((()=>{this.flushChanges(),this.requestedFlushChanges&&(cancelAnimationFrame(this.requestedFlushChanges),this.requestedFlushChanges=null)})))}onDidChange(e){return this.emitter.on("did-change",e)}onDidChangeConfig(e){return this.emitter.on("did-change-config",e)}onDidChangeScrollTop(e){return this.emitter.on("did-change-scroll-top",e)}onDidChangeScrollLeft(e){return this.emitter.on("did-change-scroll-left",e)}onDidChangeStandAlone(e){return this.emitter.on("did-change-stand-alone",e)}onDidDestroy(e){return this.emitter.on("did-destroy",e)}subscribeToConfig(){const e=new ze.CompositeDisposable,t={scope:this.textEditor.getRootScopeDescriptor()};return e.add(atom.config.observe("editor.scrollPastEnd",t,(e=>{this.scrollPastEnd=e,this.adapter.scrollPastEnd=this.scrollPastEnd,this.emitter.emit("did-change-config")})),atom.config.observe("minimap.charHeight",t,(e=>{this.configCharHeight=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.charWidth",t,(e=>{this.configCharWidth=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.interline",t,(e=>{this.configInterline=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.independentMinimapScroll",t,(e=>{this.independentMinimapScroll=e,this.updateScrollTop()})),atom.config.observe("minimap.scrollSensitivity",t,(e=>{this.scrollSensitivity=e})),atom.config.observe("minimap.redrawDelay",t,(e=>{this.redrawDelay=e})),atom.config.observe("minimap.devicePixelRatioRounding",t,(e=>{this.configDevicePixelRatioRounding=e,this.updateScrollTop(),this.emitter.emit("did-change-config")}))),e}isStandAlone(){return this.standAlone}setStandAlone(e){e!==this.standAlone&&(this.standAlone=e,this.emitter.emit("did-change-stand-alone",this))}getMinimapElement(){return this.minimapElement}getTextEditor(){return this.textEditor}getTextEditorElement(){return this.editorElement||(this.editorElement=atom.views.getView(this.getTextEditor())),this.editorElement}getTextEditorScaledHeight(){return this.adapter.getHeight()*this.getVerticalScaleFactor()}getTextEditorScaledScrollTop(){return this.adapter.getScrollTop()*this.getVerticalScaleFactor()}getTextEditorScaledScrollLeft(){return this.adapter.getScrollLeft()*this.getHorizontalScaleFactor()}getTextEditorMaxScrollTop(){return this.adapter.getMaxScrollTop()}getTextEditorScrollTop(){return this.adapter.getScrollTop()}setTextEditorScrollTop(e,t=!1){this.ignoreTextEditorScroll=t,this.adapter.setScrollTop(e)}getTextEditorScrollLeft(){return this.adapter.getScrollLeft()}getTextEditorHeight(){return this.adapter.getHeight()}getTextEditorScrollRatio(){return this.adapter.getScrollTop()/(this.getTextEditorMaxScrollTop()||1)}getCapedTextEditorScrollRatio(){return Math.min(1,this.getTextEditorScrollRatio())}getHeight(){return this.textEditor.getScreenLineCount()*this.getLineHeight()}getWidth(){return this.textEditor.getMaxScreenLineLength()*this.getCharWidth()}getVisibleHeight(){return Math.min(this.getScreenHeight(),this.getHeight())}getScreenHeight(){return this.isStandAlone()?null!=this.height?this.height:this.getHeight():this.adapter.getHeight()}getVisibleWidth(){return Math.min(this.getScreenWidth(),this.getWidth())}getScreenWidth(){return this.isStandAlone()&&null!=this.width?this.width:this.getWidth()}setScreenHeightAndWidth(e,t){this.width===t&&this.height===e||(this.height=e,this.width=t,this.updateScrollTop())}getVerticalScaleFactor(){return this.getLineHeight()/this.textEditor.getLineHeightInPixels()}getHorizontalScaleFactor(){return this.getCharWidth()/this.textEditor.getDefaultCharWidth()}getLineHeight(){return this.getCharHeight()+this.getInterline()}getCharWidth(){return null!=this.charWidth?this.charWidth:this.configCharWidth}setCharWidth(e){this.charWidth=Math.floor(e),this.emitter.emit("did-change-config")}getCharHeight(){return null!=this.charHeight?this.charHeight:this.configCharHeight}setCharHeight(e){this.charHeight=Math.floor(e),this.emitter.emit("did-change-config")}getInterline(){return null!=this.interline?this.interline:this.configInterline}setInterline(e){this.interline=Math.floor(e),this.emitter.emit("did-change-config")}getDevicePixelRatioRounding(){return null!=this.devicePixelRatioRounding?this.devicePixelRatioRounding:this.configDevicePixelRatioRounding}setDevicePixelRatioRounding(e){this.devicePixelRatioRounding=e,this.emitter.emit("did-change-config")}getDevicePixelRatio(){return this.getDevicePixelRatioRounding()?Math.floor(devicePixelRatio):devicePixelRatio}getFirstVisibleScreenRow(){return Math.floor(this.getScrollTop()/this.getLineHeight())}getLastVisibleScreenRow(){return Math.ceil((this.getScrollTop()+this.getScreenHeight())/this.getLineHeight())}scrollIndependentlyOnMouseWheel(){return this.independentMinimapScroll}getScrollTop(){return this.standAlone||this.independentMinimapScroll?this.scrollTop:this.getScrollTopFromEditor()}setScrollTop(e){this.scrollTop=Math.max(0,Math.min(this.getMaxScrollTop(),e)),(this.standAlone||this.independentMinimapScroll)&&this.emitter.emit("did-change-scroll-top",this)}getScrollRatio(){return this.getScrollTop()/this.getMaxScrollTop()}updateScrollTop(){if(this.independentMinimapScroll){try{this.setScrollTop(this.getScrollTopFromEditor())}catch(e){}this.emitter.emit("did-change-scroll-top",this)}}getScrollTopFromEditor(){return Math.abs(this.getCapedTextEditorScrollRatio()*this.getMaxScrollTop())}getMaxScrollTop(){return Math.max(0,this.getHeight()-this.getScreenHeight())}canScroll(){return this.getMaxScrollTop()>0}onMouseWheel(e){if(this.scrollIndependentlyOnMouseWheel()){if(e.stopPropagation(),!this.canScroll())return;const{wheelDeltaY:t}=e,i=this.getScrollTop()-Math.round(t*this.scrollSensitivity);e.preventDefault(),this.setScrollTop(i)}}getMarker(e){return this.textEditor.getMarker(e)}findMarkers(e){try{return this.textEditor.findMarkers(e)}catch(e){return[]}}markBufferRange(e){return this.textEditor.markBufferRange(e)}emitChanges(e){this.emitter.emit("did-change",e)}enableCache(){this.adapter.enableCache()}clearCache(){this.adapter.clearCache()}editorDestroyed(){this.adapter.editorDestroyed()}getDecorationManagement(){return void 0===this.DecorationManagement&&(this.DecorationManagement=this.minimapElement.DecorationManagement),this.DecorationManagement}getDecorations(){return this.getDecorationManagement().getDecorations()}onDidAddDecoration(...e){return this.getDecorationManagement().onDidAddDecoration(...e)}onDidRemoveDecoration(...e){return this.getDecorationManagement().onDidRemoveDecoration(...e)}onDidChangeDecorationRange(...e){return this.getDecorationManagement().onDidChangeDecorationRange(...e)}onDidUpdateDecoration(...e){return this.getDecorationManagement().onDidUpdateDecoration(...e)}decorationForId(...e){return this.getDecorationManagement().decorationForId(...e)}decorationsForScreenRowRange(...e){return this.getDecorationManagement().decorationsForScreenRowRange(...e)}decorationsByTypeThenRows(){return this.getDecorationManagement().decorationsByTypeThenRows()}decorateMarker(...e){return this.getDecorationManagement().decorateMarker(...e)}removeDecoration(...e){return this.getDecorationManagement().removeDecoration(...e)}removeAllDecorationsForMarker(...e){return this.getDecorationManagement().removeAllDecorationsForMarker(...e)}removeAllDecorations(){return this.getDecorationManagement().removeAllDecorations()}}var ti={type:"object",properties:{}},ii={title:"Show Minimap On Atom Start",type:"boolean",default:!0,order:1},ni={type:"boolean",default:!1,order:2},si={type:"boolean",default:!0,description:"Toggles the render of the buffer tokens in the minimap.",order:3},oi={type:"boolean",default:!0,description:"You need to restart Atom for this setting to be effective.",order:4},ri={type:"boolean",default:!0,description:"Toggles the display of a side line showing which part of the buffer is currently displayed by the minimap. This side line will only appear if the minimap is taller than the editor view height.",order:5},ai={type:"boolean",default:!0,description:"If this option is enabled and Soft Wrap is checked then the Minimap max width is set to the Preferred Line Length value.",order:6},li={type:"boolean",default:!0,description:"If this option and `adjustMinimapWidthToSoftWrap` are enabled the minimap width will never go past the limit sets by CSS. On the other hand, when disabled the minimap will expand to honor the preferred line width.",order:7},hi={type:"boolean",default:!1,description:"When enabled, text editor tokens are rendered as plain blocks, with no regards to the whitespaces they contains.",order:8},di={type:"number",default:1,minimum:.5,order:9},ci={type:"number",default:2,minimum:.5,order:10},ui={type:"number",default:1,minimum:0,description:"The space between lines in the minimap in pixels.",order:11},pi={type:"number",default:.6,minimum:0,maximum:1,description:"The opacity used to render the line's text in the minimap.",order:12},mi={type:"boolean",default:!1,description:"Moves the cursor to the beginning of the target line when clicking on the minimap",order:13},gi={type:"boolean",title:"Independent Minimap Scroll On Mouse Wheel Events",default:!1,description:"When enabled, using the mouse wheel over the Minimap will make it scroll independently of the text editor. The Minimap will still sync with the editor whenever the editor is scrolled, but it will no longer relay the mouse wheel events to the editor.",order:14},fi={type:"number",default:.5,description:"The scrolling speed when the `Independent Minimap Scroll On Mouse Wheel Events` setting is enabled.",order:15},vi={type:"boolean",default:!1,description:"Whether to offset the minimap canvas when scrolling to keep the scroll smooth. When `true` the minimap canvas will be offseted, resulting in a smoother scroll, but with the side-effect of a blurry minimap when the canvas is placed between pixels. When `false` the canvas will always stay at the same position, and will never look blurry, but the scroll will appear more jagged.",order:16},bi={type:"boolean",default:!1,order:17},yi={type:"boolean",default:!1,description:"When enabled the text editor content will be able to flow below the minimap.",order:18},Si={type:"boolean",default:!1,description:"When enabled and `Absolute Mode` is also enabled, the minimap height will be adjusted to only take the space required by the text editor content, leaving the space below triggering mouse events on the text editor. **Be aware this can have some impact on performances as the minimap canvases will be resized every time a change in the editor make its height change.**",order:19},wi={type:"number",default:400,minimum:0,maximum:2e3,description:"Controls how often (in ms) the minimap should redraw itself after changing the text editor's contents. Setting this to 100ms or higher could dramatically improve editor responsiveness when working with large files. A value of 0 will cause the minimap to redraw itself immediately on each change.",order:20},xi={type:"boolean",default:!0,description:"Toggles the rounding of the devicePixelRatio in the minimap.",order:21},Ci={type:"boolean",default:!0,order:22},Ei={type:"boolean",default:!1,description:"Enables animations when scrolling by clicking on the minimap.",order:23},Mi={type:"integer",default:300,description:"The duration of scrolling animations when clicking on the minimap.",order:24},Di={type:"integer",default:160,description:"The maximum number of tokens that are rendered for each line.",order:25};const Ti={plugins:ti,autoToggle:ii,displayMinimapOnLeft:ni,displayCodeHighlights:si,displayPluginsControls:oi,minimapScrollIndicator:ri,adjustMinimapWidthToSoftWrap:ai,adjustMinimapWidthOnlyIfSmaller:li,ignoreWhitespacesInTokens:hi,charWidth:di,charHeight:ci,interline:ui,textOpacity:pi,moveCursorOnMinimapClick:mi,independentMinimapScroll:gi,scrollSensitivity:fi,smoothScrolling:vi,createPluginInDevMode:bi,absoluteMode:yi,adjustAbsoluteModeHeight:Si,redrawDelay:wi,devicePixelRatioRounding:xi,useHardwareAcceleration:Ci,scrollAnimation:Ei,scrollAnimationDuration:Mi,maxTokensInOneLine:Di},ki={},Li={},Ai={};class Ri{constructor(){this.domStylesCache=new Map,this.dummyNode=void 0,this.targetNode=void 0}retrieveStyleFromDom(e,t,i,n){if(!e.length)return"";const s=e.join(" ");let o=this.domStylesCache.get(s);if(void 0!==o){if(n){const e=o[t];if(void 0!==e)return e}}else o={};this.ensureDummyNodeExistence(i);let r=this.dummyNode;for(let t=0,i=e.length;i>t;t++){const i=e[t],n=document.createElement("span");n.className=i.replace(Pi," "),r.appendChild(n),r=n}const a=window.getComputedStyle(r);let l=a.getPropertyValue(t);const h=a.getPropertyValue("-webkit-filter");return h.indexOf("hue-rotate")>-1&&(l=ye(l,h)),""!==l&&(o[t]=l,this.domStylesCache.set(s,o)),this.dummyNode.innerHTML="",l}ensureDummyNodeExistence(e){this.targetNode===e&&void 0!==this.dummyNode||(this.dummyNode=document.createElement("span"),this.dummyNode.style.visibility="hidden",e.appendChild(this.dummyNode),this.targetNode=e)}invalidateDOMStylesCache(){this.domStylesCache.clear()}}const Pi=/\.+/g,Hi=/rgb(a?)\((\d+), (\d+), (\d+)(, (\d+(\.\d+)?))?\)/,Ii=/hue-rotate\((\d+)deg\)/;let Oi=!1,_i=!1;exports.editorsMinimaps=null;let Ni=null,Fi=null;const Wi=new ze.Emitter;exports.domStylesReader=null;const ji={minimapViewProvider:xe,getConfigSchema:Ee,onDidActivate:Te,onDidDeactivate:ke,onDidCreateMinimap:Le,onDidAddPlugin:Ae,onDidRemovePlugin:Re,onDidActivatePlugin:Pe,onDidDeactivatePlugin:He,onDidChangePluginOrder:Ie,minimapClass:Oe,minimapForEditorElement:_e,minimapForEditor:Ne,standAloneMinimapForEditor:Fe,getActiveMinimap:We,observeMinimaps:je,registerPlugin:oe,unregisterPlugin:re,togglePluginActivation:ae,deactivateAllPlugins:le,activatePlugin:ce,deactivatePlugin:ue,getPluginsOrder:ge};exports.Minimap=ei,exports.activate=we,exports.activatePlugin=ce,exports.commonjsGlobal=Ye,exports.config=Ti,exports.createCommonjsModule=i,exports.dasherize=x,exports.deactivate=Ce,exports.deactivateAllPlugins=le,exports.deactivatePlugin=ue,exports.element=Q,exports.emitter=Wi,exports.getActiveMinimap=We,exports.getAugmentedNamespace=t,exports.getConfigSchema=Ee,exports.getPluginsOrder=ge,exports.minimapClass=Oe,exports.minimapForEditor=Ne,exports.minimapForEditorElement=_e,exports.minimapViewProvider=xe,exports.observeMinimaps=je,exports.onDidActivate=Te,exports.onDidActivatePlugin=Pe,exports.onDidAddPlugin=Ae,exports.onDidChangePluginOrder=Ie,exports.onDidCreateMinimap=Le,exports.onDidDeactivate=ke,exports.onDidDeactivatePlugin=He,exports.onDidRemovePlugin=Re,exports.plugins=ki,exports.provideMinimapServiceV1=qe,exports.registerPlugin=oe,exports.standAloneMinimapForEditor=Fe,exports.toggle=Me,exports.togglePluginActivation=ae,exports.unregisterPlugin=re; +//# sourceMappingURL=main-3af7aad3.js.map diff --git a/dist/main-3af7aad3.js.map b/dist/main-3af7aad3.js.map new file mode 100644 index 00000000..1d7fd7ec --- /dev/null +++ b/dist/main-3af7aad3.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main-3af7aad3.js","sources":["../node_modules/event-kit/dist/disposable.js","../node_modules/event-kit/dist/composite-disposable.js","../node_modules/event-kit/dist/emitter.js","../node_modules/batch-processor/src/batch-processor.js","../node_modules/element-resize-detector/src/state-handler.js","../node_modules/element-resize-detector/src/element-resize-detector.js","../lib/deps/underscore-plus.js","../lib/decoration-management.js","../lib/mixins/canvas-drawer.js","../lib/decorators/include.js","../lib/decorators/element.js","../lib/minimap-element.js","../lib/plugin-management.js","../lib/performance-monitor.js","../lib/dom-styles-reader.js","../lib/main.js","../node_modules/grim/lib/deprecation.js","../node_modules/event-kit/dist/event-kit.js","../node_modules/grim/lib/grim.js","../node_modules/atom-utils-plus/lib/register-or-update-element.coffee","../node_modules/mixto/lib/mixin.js","../node_modules/atom-utils-plus/lib/mixins/ancestors.coffee","../node_modules/atom-utils-plus/lib/mixins/disposable-events.coffee","../node_modules/atom-utils-plus/lib/mixins/events-delegation.coffee","../node_modules/atom-utils-plus/lib/mixins/space-pen-dsl.coffee","../node_modules/atom-utils-plus/lib/atom-utils.coffee","../node_modules/element-resize-detector/src/collection-utils.js","../node_modules/element-resize-detector/src/element-utils.js","../node_modules/element-resize-detector/src/listener-handler.js","../node_modules/element-resize-detector/src/id-generator.js","../node_modules/element-resize-detector/src/id-handler.js","../node_modules/element-resize-detector/src/reporter.js","../node_modules/element-resize-detector/src/browser-detector.js","../node_modules/batch-processor/src/utils.js","../node_modules/element-resize-detector/src/detection-strategy/object.js","../node_modules/element-resize-detector/src/detection-strategy/scroll.js","../lib/decoration.js","../lib/canvas-layer.js","../lib/minimap-quick-settings-element.js","../lib/adapters/legacy-adapter.js","../lib/adapters/stable-adapter.js","../lib/minimap.js"],"sourcesContent":["\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// Essential: A handle to a resource that can be disposed. For example,\n// {Emitter::on} returns disposables representing subscriptions.\nmodule.exports =\n/*#__PURE__*/\nfunction () {\n _createClass(Disposable, null, [{\n key: \"isDisposable\",\n // Public: Ensure that `object` correctly implements the `Disposable`\n // contract.\n //\n // * `object` An {Object} you want to perform the check against.\n //\n // Returns a {Boolean} indicating whether `object` is a valid `Disposable`.\n value: function isDisposable(object) {\n return typeof (object != null ? object.dispose : undefined) === \"function\";\n }\n /*\n Section: Construction and Destruction\n */\n // Public: Construct a Disposable\n //\n // * `disposalAction` A {Function} to call when {::dispose} is called for the\n // first time.\n\n }]);\n\n function Disposable(disposalAction) {\n _classCallCheck(this, Disposable);\n\n this.disposed = false;\n this.disposalAction = disposalAction;\n } // Public: Perform the disposal action, indicating that the resource associated\n // with this disposable is no longer needed.\n //\n // You can call this method more than once, but the disposal action will only\n // be performed the first time.\n\n\n _createClass(Disposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.disposed) {\n this.disposed = true;\n\n if (typeof this.disposalAction === \"function\") {\n this.disposalAction();\n }\n\n this.disposalAction = null;\n }\n }\n }]);\n\n return Disposable;\n}();","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar CompositeDisposable;\nvar Disposable; // Essential: An object that aggregates multiple {Disposable} instances together\n// into a single disposable, so they can all be disposed as a group.\n//\n// These are very useful when subscribing to multiple events.\n//\n// ## Examples\n//\n// ```js\n// const {CompositeDisposable} = require('atom')\n//\n// class Something {\n// constructor() {\n// this.disposables = new CompositeDisposable()\n// const editor = atom.workspace.getActiveTextEditor()\n// this.disposables.add(editor.onDidChange(() => {})\n// this.disposables.add(editor.onDidChangePath(() => {})\n// }\n//\n// destroy() {\n// this.disposables.dispose();\n// }\n// }\n// ```\n\nmodule.exports =\n/*#__PURE__*/\nfunction () {\n /*\n Section: Construction and Destruction\n */\n // Public: Construct an instance, optionally with one or more disposables\n function CompositeDisposable() {\n _classCallCheck(this, CompositeDisposable);\n\n this.disposed = false;\n this.disposables = new Set();\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var disposable = _step.value;\n this.add(disposable);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } // Public: Dispose all disposables added to this composite disposable.\n //\n // If this object has already been disposed, this method has no effect.\n\n\n _createClass(CompositeDisposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposables.forEach(function (disposable) {\n return disposable.dispose();\n });\n this.disposables = null;\n }\n }\n /*\n Section: Managing Disposables\n */\n // Public: Add disposables to be disposed when the composite is disposed.\n //\n // If this object has already been disposed, this method has no effect.\n //\n // * `...disposables` {Disposable} instances or any objects with `.dispose()`\n // methods.\n\n }, {\n key: \"add\",\n value: function add() {\n if (!this.disposed) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = arguments[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var disposable = _step2.value;\n assertDisposable(disposable);\n this.disposables.add(disposable);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n } // Public: Remove a previously added disposable.\n //\n // * `disposable` {Disposable} instance or any object with a `.dispose()`\n // method.\n\n }, {\n key: \"remove\",\n value: function remove(disposable) {\n if (!this.disposed) {\n this.disposables.delete(disposable);\n }\n } // Public: Alias to {CompositeDisposable::remove}\n\n }, {\n key: \"delete\",\n value: function _delete(disposable) {\n this.remove(disposable);\n } // Public: Clear all disposables. They will not be disposed by the next call\n // to dispose.\n\n }, {\n key: \"clear\",\n value: function clear() {\n if (!this.disposed) {\n this.disposables.clear();\n }\n }\n }]);\n\n return CompositeDisposable;\n}();\n\nfunction assertDisposable(disposable) {\n if (Disposable == null) {\n Disposable = require(\"./disposable\");\n }\n\n if (!Disposable.isDisposable(disposable)) {\n throw new TypeError(\"Arguments to CompositeDisposable.add must have a .dispose() method\");\n }\n}","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar Disposable = require(\"./disposable\");\n\nvar CompositeDisposable = require(\"./composite-disposable\"); // Essential: Utility class to be used when implementing event-based APIs that\n// allows for handlers registered via `::on` to be invoked with calls to\n// `::emit`. Instances of this class are intended to be used internally by\n// classes that expose an event-based API.\n//\n// For example:\n//\n// ```js\n// class User {\n// constructor() {\n// this.emitter = new Emitter()\n// }\n//\n// onDidChangeName(callback) {\n// this.emitter.on('did-change-name', callback)\n// }\n//\n// setName(name) {\n// if (name !== this.name) {\n// this.name = name\n// this.emitter.emit('did-change-name', name)\n// }\n//\n// return this.name\n// }\n// }\n// ```\n\n\nvar Emitter =\n/*#__PURE__*/\nfunction () {\n _createClass(Emitter, null, [{\n key: \"onEventHandlerException\",\n value: function onEventHandlerException(exceptionHandler) {\n var _this = this;\n\n if (this.exceptionHandlers.length === 0) {\n this.dispatch = this.exceptionHandlingDispatch;\n }\n\n this.exceptionHandlers.push(exceptionHandler);\n return new Disposable(function () {\n _this.exceptionHandlers.splice(_this.exceptionHandlers.indexOf(exceptionHandler), 1);\n\n if (_this.exceptionHandlers.length === 0) {\n return _this.dispatch = _this.simpleDispatch;\n }\n });\n }\n }, {\n key: \"simpleDispatch\",\n value: function simpleDispatch(handler, value) {\n return handler(value);\n }\n }, {\n key: \"exceptionHandlingDispatch\",\n value: function exceptionHandlingDispatch(handler, value) {\n try {\n return handler(value);\n } catch (exception) {\n return this.exceptionHandlers.map(function (exceptionHandler) {\n return exceptionHandler(exception);\n });\n }\n }\n /*\n Section: Construction and Destruction\n */\n // Public: Construct an emitter.\n //\n // ```js\n // this.emitter = new Emitter()\n // ```\n\n }]);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n this.disposed = false;\n this.clear();\n } // Public: Clear out any existing subscribers.\n\n\n _createClass(Emitter, [{\n key: \"clear\",\n value: function clear() {\n if (this.subscriptions != null) {\n this.subscriptions.dispose();\n }\n\n this.subscriptions = new CompositeDisposable();\n this.handlersByEventName = {};\n } // Public: Unsubscribe all handlers.\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.subscriptions.dispose();\n this.handlersByEventName = null;\n this.disposed = true;\n }\n /*\n Section: Event Subscription\n */\n // Public: Register the given handler function to be invoked whenever events by\n // the given name are emitted via {::emit}.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"on\",\n value: function on(eventName, handler, unshift) {\n var _this2 = this;\n\n if (unshift == null) {\n unshift = false;\n }\n\n if (this.disposed) {\n throw new Error(\"Emitter has been disposed\");\n }\n\n if (typeof handler !== \"function\") {\n throw new Error(\"Handler must be a function\");\n }\n\n var currentHandlers = this.handlersByEventName[eventName];\n\n if (currentHandlers) {\n if (unshift) {\n this.handlersByEventName[eventName].unshift(handler);\n } else {\n this.handlersByEventName[eventName].push(handler);\n }\n } else {\n this.handlersByEventName[eventName] = [handler];\n } // When the emitter is disposed, we want to dispose of all subscriptions.\n // However, we also need to stop tracking disposables when they're disposed\n // from outside, otherwise this class will hold references to all the\n // disposables it created (instead of just the active ones).\n\n\n var cleanup = new Disposable(function () {\n _this2.subscriptions.remove(cleanup);\n\n return _this2.off(eventName, handler);\n });\n this.subscriptions.add(cleanup);\n return cleanup;\n } // Public: Register the given handler function to be invoked the next time an\n // events with the given name is emitted via {::emit}.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"once\",\n value: function once(eventName, handler, unshift) {\n if (unshift == null) {\n unshift = false;\n }\n\n var wrapped = function wrapped(value) {\n disposable.dispose();\n return handler(value);\n };\n\n var disposable = this.on(eventName, wrapped, unshift);\n return disposable;\n } // Public: Register the given handler function to be invoked *before* all\n // other handlers existing at the time of subscription whenever events by the\n // given name are emitted via {::emit}.\n //\n // Use this method when you need to be the first to handle a given event. This\n // could be required when a data structure in a parent object needs to be\n // updated before third-party event handlers registered on a child object via a\n // public API are invoked. Your handler could itself be preempted via\n // subsequent calls to this method, but this can be controlled by keeping\n // methods based on `::preempt` private.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"preempt\",\n value: function preempt(eventName, handler) {\n return this.on(eventName, handler, true);\n } // Private: Used by the disposable.\n\n }, {\n key: \"off\",\n value: function off(eventName, handlerToRemove) {\n if (this.disposed) {\n return;\n }\n\n var handlers = this.handlersByEventName[eventName];\n\n if (handlers) {\n var handlerIndex = handlers.indexOf(handlerToRemove);\n\n if (handlerIndex >= 0) {\n handlers.splice(handlerIndex, 1);\n }\n\n if (handlers.length === 0) {\n delete this.handlersByEventName[eventName];\n }\n }\n }\n /*\n Section: Event Emission\n */\n // Public: Invoke handlers registered via {::on} for the given event name.\n //\n // * `eventName` The name of the event to emit. Handlers registered with {::on}\n // for the same name will be invoked.\n // * `value` Callbacks will be invoked with this value as an argument.\n\n }, {\n key: \"emit\",\n value: function emit(eventName, value) {\n var handlers = this.handlersByEventName && this.handlersByEventName[eventName];\n\n if (handlers) {\n // create a copy of `handlers` so that if any handler mutates `handlers`\n // (e.g. by calling `on` on this same emitter), this does not result in\n // changing the handlers being called during this same `emit`.\n var handlersCopy = handlers.slice();\n\n for (var i = 0; i < handlersCopy.length; i++) {\n this.constructor.dispatch(handlersCopy[i], value);\n }\n }\n }\n }, {\n key: \"emitAsync\",\n value: function emitAsync(eventName, value) {\n var _this3 = this;\n\n var handlers = this.handlersByEventName && this.handlersByEventName[eventName];\n\n if (handlers) {\n var promises = handlers.map(function (handler) {\n return _this3.constructor.dispatch(handler, value);\n });\n return Promise.all(promises).then(function () {});\n }\n\n return Promise.resolve();\n }\n }, {\n key: \"getEventNames\",\n value: function getEventNames() {\n return Object.keys(this.handlersByEventName);\n }\n }, {\n key: \"listenerCountForEventName\",\n value: function listenerCountForEventName(eventName) {\n var handlers = this.handlersByEventName[eventName];\n return handlers == null ? 0 : handlers.length;\n }\n }, {\n key: \"getTotalListenerCount\",\n value: function getTotalListenerCount() {\n var result = 0;\n\n var _arr = Object.keys(this.handlersByEventName);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var eventName = _arr[_i];\n result += this.handlersByEventName[eventName].length;\n }\n\n return result;\n }\n }]);\n\n return Emitter;\n}();\n\nEmitter.dispatch = Emitter.simpleDispatch;\nEmitter.exceptionHandlers = [];\nmodule.exports = Emitter;","\"use strict\";\n\nvar utils = require(\"./utils\");\n\nmodule.exports = function batchProcessorMaker(options) {\n options = options || {};\n var reporter = options.reporter;\n var asyncProcess = utils.getOption(options, \"async\", true);\n var autoProcess = utils.getOption(options, \"auto\", true);\n\n if(autoProcess && !asyncProcess) {\n reporter && reporter.warn(\"Invalid options combination. auto=true and async=false is invalid. Setting async=true.\");\n asyncProcess = true;\n }\n\n var batch = Batch();\n var asyncFrameHandler;\n var isProcessing = false;\n\n function addFunction(level, fn) {\n if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {\n // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.\n // This needs to be done before, since we're checking the size of the batch to be 0.\n processBatchAsync();\n }\n\n batch.add(level, fn);\n }\n\n function processBatch() {\n // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.\n // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).\n isProcessing = true;\n while (batch.size()) {\n var processingBatch = batch;\n batch = Batch();\n processingBatch.process();\n }\n isProcessing = false;\n }\n\n function forceProcessBatch(localAsyncProcess) {\n if (isProcessing) {\n return;\n }\n\n if(localAsyncProcess === undefined) {\n localAsyncProcess = asyncProcess;\n }\n\n if(asyncFrameHandler) {\n cancelFrame(asyncFrameHandler);\n asyncFrameHandler = null;\n }\n\n if(localAsyncProcess) {\n processBatchAsync();\n } else {\n processBatch();\n }\n }\n\n function processBatchAsync() {\n asyncFrameHandler = requestFrame(processBatch);\n }\n\n function clearBatch() {\n batch = {};\n batchSize = 0;\n topLevel = 0;\n bottomLevel = 0;\n }\n\n function cancelFrame(listener) {\n // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;\n var cancel = clearTimeout;\n return cancel(listener);\n }\n\n function requestFrame(callback) {\n // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };\n var raf = function(fn) { return setTimeout(fn, 0); };\n return raf(callback);\n }\n\n return {\n add: addFunction,\n force: forceProcessBatch\n };\n};\n\nfunction Batch() {\n var batch = {};\n var size = 0;\n var topLevel = 0;\n var bottomLevel = 0;\n\n function add(level, fn) {\n if(!fn) {\n fn = level;\n level = 0;\n }\n\n if(level > topLevel) {\n topLevel = level;\n } else if(level < bottomLevel) {\n bottomLevel = level;\n }\n\n if(!batch[level]) {\n batch[level] = [];\n }\n\n batch[level].push(fn);\n size++;\n }\n\n function process() {\n for(var level = bottomLevel; level <= topLevel; level++) {\n var fns = batch[level];\n\n for(var i = 0; i < fns.length; i++) {\n var fn = fns[i];\n fn();\n }\n }\n }\n\n function getSize() {\n return size;\n }\n\n return {\n add: add,\n process: process,\n size: getSize\n };\n}\n","\"use strict\";\n\nvar prop = \"_erd\";\n\nfunction initState(element) {\n element[prop] = {};\n return getState(element);\n}\n\nfunction getState(element) {\n return element[prop];\n}\n\nfunction cleanState(element) {\n delete element[prop];\n}\n\nmodule.exports = {\n initState: initState,\n getState: getState,\n cleanState: cleanState\n};\n","\"use strict\";\n\nvar forEach = require(\"./collection-utils\").forEach;\nvar elementUtilsMaker = require(\"./element-utils\");\nvar listenerHandlerMaker = require(\"./listener-handler\");\nvar idGeneratorMaker = require(\"./id-generator\");\nvar idHandlerMaker = require(\"./id-handler\");\nvar reporterMaker = require(\"./reporter\");\nvar browserDetector = require(\"./browser-detector\");\nvar batchProcessorMaker = require(\"batch-processor\");\nvar stateHandler = require(\"./state-handler\");\n\n//Detection strategies.\nvar objectStrategyMaker = require(\"./detection-strategy/object.js\");\nvar scrollStrategyMaker = require(\"./detection-strategy/scroll.js\");\n\nfunction isCollection(obj) {\n return Array.isArray(obj) || obj.length !== undefined;\n}\n\nfunction toArray(collection) {\n if (!Array.isArray(collection)) {\n var array = [];\n forEach(collection, function (obj) {\n array.push(obj);\n });\n return array;\n } else {\n return collection;\n }\n}\n\nfunction isElement(obj) {\n return obj && obj.nodeType === 1;\n}\n\n/**\n * @typedef idHandler\n * @type {object}\n * @property {function} get Gets the resize detector id of the element.\n * @property {function} set Generate and sets the resize detector id of the element.\n */\n\n/**\n * @typedef Options\n * @type {object}\n * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.\n Default is true. If true, the listener is guaranteed to be called when it has been added.\n If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).\n * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.\n If not provided, a default id handler will be used.\n * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.\n If not provided, a default id handler will be used.\n If set to false, then nothing will be reported.\n * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.\n */\n\n/**\n * Creates an element resize detector instance.\n * @public\n * @param {Options?} options Optional global options object that will decide how this instance will work.\n */\nmodule.exports = function(options) {\n options = options || {};\n\n //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var idHandler;\n\n if (options.idHandler) {\n // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler\n // so that readonly flag always is true when it's used here. This may be removed next major version bump.\n idHandler = {\n get: function (element) { return options.idHandler.get(element, true); },\n set: options.idHandler.set\n };\n } else {\n var idGenerator = idGeneratorMaker();\n var defaultIdHandler = idHandlerMaker({\n idGenerator: idGenerator,\n stateHandler: stateHandler\n });\n idHandler = defaultIdHandler;\n }\n\n //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var reporter = options.reporter;\n\n if(!reporter) {\n //If options.reporter is false, then the reporter should be quiet.\n var quiet = reporter === false;\n reporter = reporterMaker(quiet);\n }\n\n //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var batchProcessor = getOption(options, \"batchProcessor\", batchProcessorMaker({ reporter: reporter }));\n\n //Options to be used as default for the listenTo function.\n var globalOptions = {};\n globalOptions.callOnAdd = !!getOption(options, \"callOnAdd\", true);\n globalOptions.debug = !!getOption(options, \"debug\", false);\n\n var eventListenerHandler = listenerHandlerMaker(idHandler);\n var elementUtils = elementUtilsMaker({\n stateHandler: stateHandler\n });\n\n //The detection strategy to be used.\n var detectionStrategy;\n var desiredStrategy = getOption(options, \"strategy\", \"object\");\n var importantCssRules = getOption(options, \"important\", false);\n var strategyOptions = {\n reporter: reporter,\n batchProcessor: batchProcessor,\n stateHandler: stateHandler,\n idHandler: idHandler,\n important: importantCssRules\n };\n\n if(desiredStrategy === \"scroll\") {\n if (browserDetector.isLegacyOpera()) {\n reporter.warn(\"Scroll strategy is not supported on legacy Opera. Changing to object strategy.\");\n desiredStrategy = \"object\";\n } else if (browserDetector.isIE(9)) {\n reporter.warn(\"Scroll strategy is not supported on IE9. Changing to object strategy.\");\n desiredStrategy = \"object\";\n }\n }\n\n if(desiredStrategy === \"scroll\") {\n detectionStrategy = scrollStrategyMaker(strategyOptions);\n } else if(desiredStrategy === \"object\") {\n detectionStrategy = objectStrategyMaker(strategyOptions);\n } else {\n throw new Error(\"Invalid strategy name: \" + desiredStrategy);\n }\n\n //Calls can be made to listenTo with elements that are still being installed.\n //Also, same elements can occur in the elements list in the listenTo function.\n //With this map, the ready callbacks can be synchronized between the calls\n //so that the ready callback can always be called when an element is ready - even if\n //it wasn't installed from the function itself.\n var onReadyCallbacks = {};\n\n /**\n * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.\n * @public\n * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.\n * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.\n * @param {function} listener The callback to be executed for each resize event for each element.\n */\n function listenTo(options, elements, listener) {\n function onResizeCallback(element) {\n var listeners = eventListenerHandler.get(element);\n forEach(listeners, function callListenerProxy(listener) {\n listener(element);\n });\n }\n\n function addListener(callOnAdd, element, listener) {\n eventListenerHandler.add(element, listener);\n\n if(callOnAdd) {\n listener(element);\n }\n }\n\n //Options object may be omitted.\n if(!listener) {\n listener = elements;\n elements = options;\n options = {};\n }\n\n if(!elements) {\n throw new Error(\"At least one element required.\");\n }\n\n if(!listener) {\n throw new Error(\"Listener required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n var elementsReady = 0;\n\n var callOnAdd = getOption(options, \"callOnAdd\", globalOptions.callOnAdd);\n var onReadyCallback = getOption(options, \"onReady\", function noop() {});\n var debug = getOption(options, \"debug\", globalOptions.debug);\n\n forEach(elements, function attachListenerToElement(element) {\n if (!stateHandler.getState(element)) {\n stateHandler.initState(element);\n idHandler.set(element);\n }\n\n var id = idHandler.get(element);\n\n debug && reporter.log(\"Attaching listener to element\", id, element);\n\n if(!elementUtils.isDetectable(element)) {\n debug && reporter.log(id, \"Not detectable.\");\n if(elementUtils.isBusy(element)) {\n debug && reporter.log(id, \"System busy making it detectable\");\n\n //The element is being prepared to be detectable. Do not make it detectable.\n //Just add the listener, because the element will soon be detectable.\n addListener(callOnAdd, element, listener);\n onReadyCallbacks[id] = onReadyCallbacks[id] || [];\n onReadyCallbacks[id].push(function onReady() {\n elementsReady++;\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n return;\n }\n\n debug && reporter.log(id, \"Making detectable...\");\n //The element is not prepared to be detectable, so do prepare it and add a listener to it.\n elementUtils.markBusy(element, true);\n return detectionStrategy.makeDetectable({ debug: debug, important: importantCssRules }, element, function onElementDetectable(element) {\n debug && reporter.log(id, \"onElementDetectable\");\n\n if (stateHandler.getState(element)) {\n elementUtils.markAsDetectable(element);\n elementUtils.markBusy(element, false);\n detectionStrategy.addListener(element, onResizeCallback);\n addListener(callOnAdd, element, listener);\n\n // Since the element size might have changed since the call to \"listenTo\", we need to check for this change,\n // so that a resize event may be emitted.\n // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.\n // Also, check the state existance before since the element may have been uninstalled in the installation process.\n var state = stateHandler.getState(element);\n if (state && state.startSize) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n if (state.startSize.width !== width || state.startSize.height !== height) {\n onResizeCallback(element);\n }\n }\n\n if(onReadyCallbacks[id]) {\n forEach(onReadyCallbacks[id], function(callback) {\n callback();\n });\n }\n } else {\n // The element has been unisntalled before being detectable.\n debug && reporter.log(id, \"Element uninstalled before being detectable.\");\n }\n\n delete onReadyCallbacks[id];\n\n elementsReady++;\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n }\n\n debug && reporter.log(id, \"Already detecable, adding listener.\");\n\n //The element has been prepared to be detectable and is ready to be listened to.\n addListener(callOnAdd, element, listener);\n elementsReady++;\n });\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n }\n\n function uninstall(elements) {\n if(!elements) {\n return reporter.error(\"At least one element is required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n forEach(elements, function (element) {\n eventListenerHandler.removeAllListeners(element);\n detectionStrategy.uninstall(element);\n stateHandler.cleanState(element);\n });\n }\n\n function initDocument(targetDocument) {\n detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);\n }\n\n return {\n listenTo: listenTo,\n removeListener: eventListenerHandler.removeListener,\n removeAllListeners: eventListenerHandler.removeAllListeners,\n uninstall: uninstall,\n initDocument: initDocument\n };\n};\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","const regexEscape = /[-/\\\\^$*+?.()|[\\]{}]/g\nexport function escapeRegExp (string) {\n if (string) {\n return string.replace(regexEscape, '\\\\$&')\n } else {\n return ''\n }\n}\n\nconst regexDaherize = /([A-Z])|(_)/g\nexport function dasherize (string) {\n if (!string) { return '' }\n\n string = `${string[0].toLowerCase()}${string.slice(1)}`\n return string.replace(regexDaherize, function (m, letter) {\n if (letter) {\n return `-${letter.toLowerCase()}`\n } else {\n return '-'\n }\n })\n}\n","'use strict'\n\nimport { Emitter } from 'atom'\nimport { escapeRegExp } from './deps/underscore-plus'\nimport path from 'path'\nimport Decoration from './decoration'\n\n/**\n * The mixin that provides the decorations API to the minimap editor\n * view.\n *\n * This mixin is injected into the `Minimap` prototype, so every methods defined\n * in this file will be available on any `Minimap` instance.\n */\nexport default class DecorationManagement {\n /**\n * Initializes the decorations related properties.\n */\n initializeDecorations (minimap) {\n this.minimap = minimap\n\n if (this.emitter == null) {\n /**\n * The minimap emitter, lazily created if not created yet.\n * @type {Emitter}\n * @access private\n */\n this.emitter = new Emitter()\n } else {\n this.emitter = this.minimap.emitter\n }\n\n /**\n * A map with the decoration id as key and the decoration as value.\n * @type {Object}\n * @access private\n */\n this.decorationsById = new Map()\n /**\n * The decorations stored in an array indexed with their marker id.\n * @type {Object}\n * @access private\n */\n this.decorationsByMarkerId = new Map()\n /**\n * The subscriptions to the markers `did-change` event indexed using the\n * marker id.\n * @type {Object}\n * @access private\n */\n this.decorationMarkerChangedSubscriptions = new Map()\n /**\n * The subscriptions to the markers `did-destroy` event indexed using the\n * marker id.\n * @type {Object}\n * @access private\n */\n this.decorationMarkerDestroyedSubscriptions = new Map()\n /**\n * The subscriptions to the decorations `did-change-properties` event\n * indexed using the decoration id.\n * @type {Object}\n * @access private\n */\n this.decorationUpdatedSubscriptions = new Map()\n /**\n * The subscriptions to the decorations `did-destroy` event indexed using\n * the decoration id.\n * @type {Object}\n * @access private\n */\n this.decorationDestroyedSubscriptions = new Map()\n\n // is set to true when a minimapElement is destroyed\n this.destroyed = false\n }\n\n /**\n * Returns all the decorations registered in the current `Minimap`.\n *\n * @return {Array} all the decorations in this `Minimap`\n */\n getDecorations () {\n return this.decorationsById.values()\n }\n\n /**\n * Registers an event listener to the `did-add-decoration` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidAddDecoration (callback) {\n return this.emitter.on('did-add-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-remove-decoration` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidRemoveDecoration (callback) {\n return this.emitter.on('did-remove-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-decoration` event.\n *\n * This event is triggered when the marker targeted by the decoration\n * was changed.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeDecoration (callback) {\n return this.emitter.on('did-change-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-decoration-range` event.\n *\n * This event is triggered when the marker range targeted by the decoration\n * was changed.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeDecorationRange (callback) {\n return this.emitter.on('did-change-decoration-range', callback)\n }\n\n /**\n * Registers an event listener to the `did-update-decoration` event.\n *\n * This event is triggered when the decoration itself is modified.\n *\n * @param {function(decoration:Decoration):void} callback a function to call\n * when the event is\n * triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidUpdateDecoration (callback) {\n return this.emitter.on('did-update-decoration', callback)\n }\n\n /**\n * Returns the decoration with the passed-in id.\n *\n * @param {number} id the decoration id\n * @return {Decoration} the decoration with the given id\n */\n decorationForId (id) {\n return this.decorationsById.get(id)\n }\n\n /**\n * Returns all the decorations that intersect the passed-in row range.\n *\n * @param {number} startScreenRow the first row of the range\n * @param {number} endScreenRow the last row of the range\n * @return {Array} the decorations that intersect the passed-in\n * range\n */\n decorationsForScreenRowRange (startScreenRow, endScreenRow) {\n const decorationsByMarkerId = {}\n const markers = this.findMarkers({\n intersectsScreenRowRange: [startScreenRow, endScreenRow]\n })\n\n for (let i = 0, len = markers.length; i < len; i++) {\n const marker = markers[i]\n const decorations = this.decorationsByMarkerId.get(marker.id)\n\n if (decorations !== undefined) {\n decorationsByMarkerId[marker.id] = decorations\n }\n }\n\n return decorationsByMarkerId\n }\n\n /**\n * Returns the decorations that intersects the passed-in row range\n * in a structured way.\n *\n * At the first level, the keys are the available decoration types.\n * At the second level, the keys are the row index for which there\n * are decorations available. The value is an array containing the\n * decorations that intersects with the corresponding row.\n *\n * @return {Object} the decorations grouped by type and then rows\n * @property {Object} line all the line decorations by row\n * @property {Array} line[row] all the line decorations\n * at a given row\n * @property {Object} highlight-under all the highlight-under decorations\n * by row\n * @property {Array} highlight-under[row] all the highlight-under\n * decorations at a given row\n * @property {Object} highlight-over all the highlight-over decorations\n * by row\n * @property {Array} highlight-over[row] all the highlight-over\n * decorations at a given row\n * @property {Object} highlight-outine all the highlight-outine decorations\n * by row\n * @property {Array} highlight-outine[row] all the\n * highlight-outine decorations at a given\n * row\n */\n decorationsByTypeThenRows () {\n if (this.decorationsByTypeThenRowsCache != null) {\n return this.decorationsByTypeThenRowsCache\n }\n\n const cache = {}\n\n const decorations = this.decorationsById.values()\n for (const decoration of decorations) {\n const range = decoration.marker.getScreenRange()\n const type = decoration.getProperties().type\n\n if (cache[type] == null) { cache[type] = {} }\n\n for (let row = range.start.row, len = range.end.row; row <= len; row++) {\n if (cache[type][row] == null) { cache[type][row] = [] }\n\n cache[type][row].push(decoration)\n }\n }\n\n /**\n * The grouped decorations cache.\n * @type {Object}\n * @access private\n */\n this.decorationsByTypeThenRowsCache = cache\n return cache\n }\n\n /**\n * Invalidates the decoration by screen rows cache.\n */\n invalidateDecorationForScreenRowsCache () {\n this.decorationsByTypeThenRowsCache = null\n }\n\n /**\n * Adds a decoration that tracks a `Marker`. When the marker moves,\n * is invalidated, or is destroyed, the decoration will be updated to reflect\n * the marker's state.\n *\n * @param {Marker} marker the marker you want this decoration to follow\n * @param {Object} decorationParams the decoration properties\n * @param {string} decorationParams.type the decoration type in the following\n * list:\n * - __line__: Fills the line background with the decoration color.\n * - __highlight__: Renders a colored rectangle on the minimap. The highlight\n * is rendered above the line's text.\n * - __highlight-over__: Same as __highlight__.\n * - __highlight-under__: Renders a colored rectangle on the minimap. The\n * highlight is rendered below the line's text.\n * - __highlight-outline__: Renders a colored outline on the minimap. The\n * highlight box is rendered above the line's text.\n * - __foreground-custom__: A decoration type for which you have the control\n * over the render routine. Note that your routine should implement a render\n * on a per-line basis to avoid any side-effect with the offset bitmap cache\n * mechanism. These decorations are rendred on the foreground decorations\n * layer.\n * - __background-custom__: A decoration type for which you have the control\n * over the render routine. Note that your routine should implement a render\n * on a per-line basis to avoid any side-effect with the offset bitmap cache\n * mechanism. These decorations are rendred on the background decorations\n * layer.\n * @param {string} [decorationParams.class] the CSS class to use to retrieve\n * the background color of the\n * decoration by building a scop\n * corresponding to\n * `.minimap .editor `\n * @param {string} [decorationParams.scope] the scope to use to retrieve the\n * decoration background. Note that if\n * the `scope` property is set, the\n * `class` won't be used.\n * @param {string} [decorationParams.color] the CSS color to use to render\n * the decoration. When set, neither\n * `scope` nor `class` are used.\n * @param {string} [decorationParams.plugin] the name of the plugin that\n * created this decoration. It'll\n * be used to order the decorations\n * on the same layer and that are\n * overlapping. If the parameter is\n * omitted the Minimap will attempt\n * to infer the plugin origin from\n * the path of the caller function.\n * @param {function} [decorationParams.render] the render routine for custom\n * decorations. The function\n * receives the decoration and\n * the render data for the\n * current render pass.\n * @return {Decoration} the created decoration\n * @emits {did-add-decoration} when the decoration is created successfully\n * @emits {did-change} when the decoration is created successfully\n */\n decorateMarker (marker, decorationParams) {\n if (this.destroyed || this.minimap.destroyed || marker == null) { return }\n\n const { id } = marker\n\n if (decorationParams.type === 'highlight') {\n decorationParams.type = 'highlight-over'\n }\n\n const { type, plugin } = decorationParams\n\n if (plugin == null) {\n decorationParams.plugin = getOriginatorPackageName()\n }\n\n if (decorationParams.scope == null && decorationParams.class != null) {\n const cls = decorationParams.class.split(' ').join('.')\n decorationParams.scope = `.minimap .${cls}`\n }\n\n if (!this.decorationMarkerDestroyedSubscriptions.has(id)) {\n this.decorationMarkerDestroyedSubscriptions.set(id,\n marker.onDidDestroy(() => {\n this.removeAllDecorationsForMarker(marker)\n }))\n }\n\n if (!this.decorationMarkerChangedSubscriptions.has(id)) {\n this.decorationMarkerChangedSubscriptions.set(id,\n marker.onDidChange((event) => {\n const decorations = this.decorationsByMarkerId.get(id)\n const screenRange = marker.getScreenRange()\n\n this.invalidateDecorationForScreenRowsCache()\n\n if (decorations !== undefined) {\n for (let i = 0, len = decorations.length; i < len; i++) {\n const decoration = decorations[i]\n this.emitter.emit('did-change-decoration', {\n marker,\n decoration,\n event\n })\n this.emitDecorationChanges(decoration.type, decoration)\n\n decoration.screenRange = screenRange\n }\n }\n let oldStart = event.oldTailScreenPosition\n let oldEnd = event.oldHeadScreenPosition\n let newStart = event.newTailScreenPosition\n let newEnd = event.newHeadScreenPosition\n\n if (oldStart.row > oldEnd.row) {\n [oldStart, oldEnd] = [oldEnd, oldStart]\n }\n if (newStart.row > newEnd.row) {\n [newStart, newEnd] = [newEnd, newStart]\n }\n\n const rangesDiffs = computeRangesDiffs(\n oldStart, oldEnd,\n newStart, newEnd\n )\n\n for (let i = 0, len = rangesDiffs.length; i < len; i++) {\n const [start, end] = rangesDiffs[i]\n this.emitRangeChanges(type, {\n start,\n end\n }, 0)\n }\n }))\n }\n\n const decoration = new Decoration(marker, this, decorationParams)\n\n if (!this.decorationsByMarkerId.has(id)) {\n this.decorationsByMarkerId.set(id, [])\n }\n\n this.decorationsByMarkerId.get(id).push(decoration)\n this.decorationsById.set(decoration.id, decoration)\n\n if (!this.decorationUpdatedSubscriptions.has(decoration.id)) {\n this.decorationUpdatedSubscriptions.set(decoration.id,\n decoration.onDidChangeProperties((event) => {\n this.emitDecorationChanges(type, decoration)\n }))\n }\n\n this.decorationDestroyedSubscriptions.set(decoration.id,\n decoration.onDidDestroy(() => {\n this.removeDecoration(decoration)\n }))\n\n this.emitDecorationChanges(type, decoration)\n this.emitter.emit('did-add-decoration', {\n marker,\n decoration\n })\n\n return decoration\n }\n\n /**\n * Emits a change in the `Minimap` corresponding to the\n * passed-in decoration.\n *\n * @param {string} type the type of decoration that changed\n * @param {Decoration} decoration the decoration for which emitting an event\n * @access private\n */\n emitDecorationChanges (type, decoration) {\n if (this.destroyed || this.minimap.editorDestroyed()) { return }\n\n this.invalidateDecorationForScreenRowsCache()\n\n const range = decoration.screenRange\n if (!range.start || !range.end) { return }\n\n this.emitRangeChanges(type, range, 0)\n }\n\n /**\n * Emits a change for the specified range.\n *\n * @param {string} type the type of decoration that changed\n * @param {Object} range the range where changes occured\n * @param {number} [screenDelta] an optional screen delta for the\n * change object\n * @access private\n */\n emitRangeChanges (type, range, screenDelta) {\n const startScreenRow = range.start.row\n const endScreenRow = range.end.row\n const lastRenderedScreenRow = this.minimap.getLastVisibleScreenRow()\n const firstRenderedScreenRow = this.minimap.getFirstVisibleScreenRow()\n\n if (screenDelta == null) {\n screenDelta = (lastRenderedScreenRow - firstRenderedScreenRow) -\n (endScreenRow - startScreenRow)\n }\n\n const changeEvent = {\n start: startScreenRow,\n end: endScreenRow,\n screenDelta,\n type\n }\n\n this.emitter.emit('did-change-decoration-range', changeEvent)\n }\n\n /**\n * Removes a `Decoration` from this minimap.\n *\n * @param {Decoration} decoration the decoration to remove\n * @emits {did-change} when the decoration is removed\n * @emits {did-remove-decoration} when the decoration is removed\n */\n removeDecoration (decoration) {\n if (decoration == null) { return }\n\n const marker = decoration.marker\n let subscription\n\n this.decorationsById.delete(decoration.id)\n\n subscription = this.decorationUpdatedSubscriptions.get(decoration.id)\n if (subscription !== undefined) { subscription.dispose() }\n\n subscription = this.decorationDestroyedSubscriptions.get(decoration.id)\n if (subscription !== undefined) { subscription.dispose() }\n\n this.decorationUpdatedSubscriptions.delete(decoration.id)\n this.decorationDestroyedSubscriptions.delete(decoration.id)\n\n const decorations = this.decorationsByMarkerId.get(marker.id)\n if (decorations === undefined) { return }\n\n this.emitDecorationChanges(decoration.getProperties().type, decoration)\n\n const index = decorations.indexOf(decoration)\n if (index > -1) {\n decorations.splice(index, 1)\n\n this.emitter.emit('did-remove-decoration', {\n marker,\n decoration\n })\n\n if (decorations.length === 0) {\n this.removedAllMarkerDecorations(marker)\n }\n }\n }\n\n /**\n * Removes all the decorations registered for the passed-in marker.\n *\n * @param {Marker} marker the marker for which removing its decorations\n * @emits {did-change} when a decoration have been removed\n * @emits {did-remove-decoration} when a decoration have been removed\n */\n removeAllDecorationsForMarker (marker) {\n if (marker == null) { return }\n\n const decorations = this.decorationsByMarkerId.get(marker.id)\n if (decorations === undefined) { return }\n\n for (let i = 0, len = decorations.length; i < len; i++) {\n const decoration = decorations[i]\n\n if (!this.destroyed && !this.minimap.editorDestroyed()) {\n this.emitDecorationChanges(decoration.getProperties().type, decoration)\n }\n this.emitter.emit('did-remove-decoration', {\n marker,\n decoration\n })\n }\n\n this.removedAllMarkerDecorations(marker)\n }\n\n /**\n * Performs the removal of a decoration for a given marker.\n *\n * @param {Marker} marker the marker for which removing decorations\n * @access private\n */\n removedAllMarkerDecorations (marker) {\n if (marker == null) { return }\n\n this.decorationMarkerChangedSubscriptions.get(marker.id).dispose()\n this.decorationMarkerDestroyedSubscriptions.get(marker.id).dispose()\n\n this.decorationsByMarkerId.delete(marker.id)\n this.decorationMarkerChangedSubscriptions.delete(marker.id)\n this.decorationMarkerDestroyedSubscriptions.delete(marker.id)\n }\n\n /**\n * Removes all the decorations that was created in the current `Minimap`.\n */\n removeAllDecorations () {\n const decorationMarkerChangedSubscriptionsValues = this.decorationMarkerChangedSubscriptions.values()\n for (const decoration of decorationMarkerChangedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationMarkerDestroyedSubscriptionsValues = this.decorationMarkerDestroyedSubscriptions.values()\n for (const decoration of decorationMarkerDestroyedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationUpdatedSubscriptionsValues = this.decorationUpdatedSubscriptions.values()\n for (const decoration of decorationUpdatedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationDestroyedSubscriptionsValues = this.decorationDestroyedSubscriptions.values()\n for (const decoration of decorationDestroyedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationsByIdValues = this.decorationsById.values()\n for (const decoration of decorationsByIdValues) {\n decoration.destroy()\n }\n\n this.decorationsById.clear()\n this.decorationsByMarkerId.clear()\n this.decorationMarkerChangedSubscriptions.clear()\n this.decorationMarkerDestroyedSubscriptions.clear()\n this.decorationUpdatedSubscriptions.clear()\n this.decorationDestroyedSubscriptions.clear()\n }\n\n destroy () {\n this.removeAllDecorations()\n this.minimap = undefined\n this.emitter = undefined\n this.destroyed = true\n }\n}\n\nfunction getOriginatorPackageName () {\n const line = new Error().stack.split('\\n')[3]\n const filePath = line.split('(')[1].replace(')', '')\n const re = new RegExp(\n atom.packages.getPackageDirPaths().join('|') + escapeRegExp(path.sep)\n )\n const plugin = filePath.replace(re, '').split(path.sep)[0].replace(/minimap-|-minimap/, '')\n return plugin.indexOf(path.sep) < 0 ? plugin : undefined\n}\n\n/**\n * Given two ranges, it returns an array of ranges representing the\n * differences between them.\n *\n * @param {number} oldStart the row index of the first range start\n * @param {number} oldEnd the row index of the first range end\n * @param {number} newStart the row index of the second range start\n * @param {number} newEnd the row index of the second range end\n * @return {Array} the array of diff ranges\n * @access private\n */\nfunction computeRangesDiffs (oldStart, oldEnd, newStart, newEnd) {\n const diffs = []\n\n if (oldStart.isLessThan(newStart)) {\n diffs.push([oldStart, newStart])\n } else if (newStart.isLessThan(oldStart)) {\n diffs.push([newStart, oldStart])\n }\n\n if (oldEnd.isLessThan(newEnd)) {\n diffs.push([oldEnd, newEnd])\n } else if (newEnd.isLessThan(oldEnd)) {\n diffs.push([newEnd, oldEnd])\n }\n\n return diffs\n}\n","'use strict'\n\nimport { escapeRegExp } from '../deps/underscore-plus'\nimport Mixin from 'mixto'\n\nimport * as Main from '../main'\nimport { domStylesReader } from '../main'\nimport CanvasLayer from '../canvas-layer'\n\nconst SPEC_MODE = atom.inSpecMode()\n// an instance of MinimapElement used for testing and calling spies\nlet thisSpec\n\n/**\n * The `CanvasDrawer` mixin is responsible for the rendering of a `Minimap`\n * in a `canvas` element.\n *\n * This mixin is injected in the `MinimapElement` prototype, so all these\n * methods are available on any `MinimapElement` instance.\n */\nexport default class CanvasDrawer extends Mixin {\n /**\n * Initializes the canvas elements needed to perform the `Minimap` rendering.\n */\n initializeCanvas () {\n if (SPEC_MODE) {\n // class methods only used for spying the calls\n this.drawLines = (firstLine, lastLine) => { console.log({ firstLine, lastLine }) }\n this.drawLineDecoration = drawLineDecoration\n this.drawGutterDecoration = drawGutterDecoration\n this.drawHighlightDecoration = drawHighlightDecoration\n this.drawHighlightOutlineDecoration = drawHighlightOutlineDecoration\n this.drawCustomDecoration = drawCustomDecoration\n this.DOMStylesReader = domStylesReader\n thisSpec = this\n }\n\n /**\n * The main canvas layer where lines are rendered.\n * @type {CanvasLayer}\n */\n this.tokensLayer = new CanvasLayer()\n /**\n * The canvas layer for decorations below the text.\n * @type {CanvasLayer}\n */\n this.backLayer = new CanvasLayer()\n /**\n * The canvas layer for decorations above the text.\n * @type {CanvasLayer}\n */\n this.frontLayer = new CanvasLayer()\n\n if (!this.pendingChanges) {\n /**\n * Stores the changes from the text editor.\n * @type {Array}\n * @access private\n */\n this.pendingChanges = []\n }\n\n if (!this.pendingBackDecorationChanges) {\n /**\n * Stores the changes from the minimap back decorations.\n * @type {Array}\n * @access private\n */\n this.pendingBackDecorationChanges = []\n }\n\n if (!this.pendingFrontDecorationChanges) {\n /**\n * Stores the changes from the minimap front decorations.\n * @type {Array}\n * @access private\n */\n this.pendingFrontDecorationChanges = []\n }\n\n // the maximum number of tokens to render in one line\n this.maxTokensInOneLine = atom.config.get('minimap.maxTokensInOneLine')\n }\n\n /**\n * Returns the uppermost canvas in the MinimapElement.\n *\n * @return {HTMLCanvasElement} the html canvas element\n */\n getFrontCanvas () { return this.frontLayer.canvas }\n\n /**\n * Attaches the canvases into the specified container.\n *\n * @param {HTMLElement} parent the canvases' container\n * @access private\n */\n attachCanvases (parent) {\n this.backLayer.attach(parent)\n this.tokensLayer.attach(parent)\n this.frontLayer.attach(parent)\n }\n\n /**\n * Changes the size of all the canvas layers at once.\n *\n * @param {number} width the new width for the three canvases\n * @param {number} height the new height for the three canvases\n * @access private\n */\n setCanvasesSize (width, height) {\n this.backLayer.setSize(width, height)\n this.tokensLayer.setSize(width, height)\n this.frontLayer.setSize(width, height)\n }\n\n /**\n * Performs an update of the rendered `Minimap` based on the changes\n * registered in the instance.\n */\n updateCanvas () {\n const firstRow = this.minimap.getFirstVisibleScreenRow()\n const lastRow = this.minimap.getLastVisibleScreenRow()\n\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const lineHeight = this.minimap.getLineHeight() * devicePixelRatio\n const charHeight = this.minimap.getCharHeight() * devicePixelRatio\n const charWidth = this.minimap.getCharWidth() * devicePixelRatio\n const { width: canvasWidth, height: canvasHeight } = this.tokensLayer.getSize()\n const editor = this.minimap.getTextEditor()\n const editorElement = this.minimap.getTextEditorElement()\n\n // TODO avoid closure: https://stackoverflow.com/a/46256398/7910299\n const getTokenColorClosure = this.displayCodeHighlights ? (scopes) => getTokenColor(scopes, editorElement, this.textOpacity) : () => getDefaultColor(editorElement, this.textOpacity)\n\n updateTokensLayer(this.tokensLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingChanges, lineHeight, charHeight, charWidth, canvasWidth, editor, editor.getScreenLineCount(), getInvisibleRegExp(editor), getTokenColorClosure, this.ignoreWhitespacesInTokens, this.maxTokensInOneLine)\n\n if (SPEC_MODE) {\n // call the spy for drawLines which is used inside updateTokensLayer\n this.drawLines(firstRow, lastRow)\n }\n\n const decorations = this.DecorationManagement.decorationsByTypeThenRows(firstRow, lastRow)\n\n const renderData = {\n context: this.backLayer.context,\n canvasWidth,\n canvasHeight,\n lineHeight,\n charWidth,\n charHeight,\n orders: Main.getPluginsOrder()\n }\n\n const drawCustomDecorationLambda = (decoration, data, decorationColor) => drawCustomDecoration(decoration, data, decorationColor, editorElement)\n backgroundDecorationDispatcher['background-custom'] = drawCustomDecorationLambda\n frontDecorationDispatcher['foreground-custom'] = drawCustomDecorationLambda\n\n updateBackDecorationsLayer(this.backLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingBackDecorationChanges, renderData, lineHeight, editorElement, decorations)\n\n renderData.context = this.frontLayer.context\n\n updateFrontDecorationsLayer(this.frontLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingFrontDecorationChanges, renderData, lineHeight, editorElement, decorations)\n\n this.pendingChanges = []\n this.pendingBackDecorationChanges = []\n this.pendingFrontDecorationChanges = []\n\n /**\n * The first row in the last render of the offscreen canvas.\n * @type {number}\n * @access private\n */\n this.offscreenFirstRow = firstRow\n /**\n * The last row in the last render of the offscreen canvas.\n * @type {number}\n * @access private\n */\n this.offscreenLastRow = lastRow\n }\n\n // ######## ######## ### ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ######## ## ## ## ## ##\n // ## ## ## ## ######### ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ######## ## ## ## ## ### ###\n\n /**\n * Routine used to render changes in specific ranges for one layer.\n *\n * @param {CanvasLayer} layer the layer to redraw\n * @param {Array} intactRanges an array of the ranges to leave intact\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n * @param {Function} method the render method to use for the lines drawing\n * @access private\n * Unused (inlined the code for performance reasons)\n */\n // redrawRangesOnLayer (layer, intactRanges, firstRow, lastRow, method) {\n // const devicePixelRatio = this.minimap.getDevicePixelRatio()\n // const lineHeight = this.minimap.getLineHeight() * devicePixelRatio\n //\n // layer.clearCanvas()\n //\n // if (intactRanges.length === 0) {\n // method.call(this, firstRow, lastRow, 0)\n // } else {\n // for (let j = 0, len = intactRanges.length; j < len; j++) {\n // const intact = intactRanges[j]\n //\n // layer.copyPartFromOffscreen(\n // intact.offscreenRow * lineHeight,\n // (intact.start - firstRow) * lineHeight,\n // (intact.end - intact.start) * lineHeight\n // )\n // }\n // drawLinesForRanges(method, intactRanges, firstRow, lastRow)\n // }\n //\n // layer.resetOffscreenSize()\n // layer.copyToOffscreen()\n // }\n\n /**\n * Renders the lines between the intact ranges when an update has pending\n * changes.\n *\n * @param {Function} method the render method to use for the lines drawing\n * @param {Array} intactRanges the intact ranges in the minimap\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @access private\n * Unused (inlined the code for performance reasons)\n */\n // drawLinesForRanges (method, ranges, firstRow, lastRow) {\n // let currentRow = firstRow\n // for (let i = 0, len = ranges.length; i < len; i++) {\n // const range = ranges[i]\n //\n // method.call(this, currentRow, range.start, currentRow - firstRow)\n //\n // currentRow = range.end\n // }\n // if (currentRow <= lastRow) {\n // method.call(this, currentRow, lastRow, currentRow - firstRow)\n // }\n // }\n}\n\n// ######## ######## ### ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ######## ## ## ## ## ##\n// ## ## ## ## ######### ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ######## ## ## ## ## ### ###\n\n/**\n * Performs an update of the tokens layer using the pending changes array.\n *\n * @param {CanvasLayer} tokensLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingChanges\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {number} charHeight this.minimap.getCharHeight() * devicePixelRatio\n * @param {number} charWidth this.minimap.getCharWidth() * devicePixelRatio\n * @param {number} canvasWidth this.tokensLayer.getSize().width\n * @param {TextEditor} editor this.minimap.getTextEditor()\n * @param {(t: Token) => string} getTokenColorClosure\n * @param {boolean} ignoreWhitespacesInTokens this.ignoreWhitespacesInTokens\n * @param {number} maxTokensInOneLine this.maxTokensInOneLine\n * @access private\n */\nfunction updateTokensLayer (tokensLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingChanges, lineHeight, charHeight, charWidth, canvasWidth, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine) {\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingChanges, offscreenFirstRow, offscreenLastRow)\n\n // redrawRangesOnLayer\n const context = tokensLayer.context\n\n tokensLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawLines(firstRow, lastRow, 0, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n tokensLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawLines(currentRow, range.start, currentRow - firstRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawLines(currentRow, lastRow, currentRow - firstRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n }\n }\n\n tokensLayer.resetOffscreenSize()\n tokensLayer.copyToOffscreen()\n}\n\n/**\n * Performs an update of the back decorations layer using the pending back\n * decorations changes arrays.\n * @param {CanvasLayer} backLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n *\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingBackDecorationChanges\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction updateBackDecorationsLayer (backLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingBackDecorationChanges, renderData, lineHeight, editorElement, decorations) {\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingBackDecorationChanges, offscreenFirstRow, offscreenLastRow)\n\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n // redrawRangesOnLayer\n\n backLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawBackDecorationsForLines(firstRow, lastRow, 0, renderData, lineHeight, editorElement, decorations)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n backLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawBackDecorationsForLines(currentRow, range.start, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawBackDecorationsForLines(currentRow, lastRow, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n }\n }\n\n backLayer.resetOffscreenSize()\n backLayer.copyToOffscreen()\n}\n\n/**\n * Performs an update of the front decorations layer using the pending front\n * decorations changes arrays.\n *\n * @param {CanvasLayer} frontLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n *\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingFrontDecorationChanges\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction updateFrontDecorationsLayer (frontLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingFrontDecorationChanges, renderData, lineHeight, editorElement, decorations) {\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingFrontDecorationChanges, offscreenFirstRow, offscreenLastRow)\n\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n // redrawRangesOnLayer\n\n frontLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawFrontDecorationsForLines(firstRow, lastRow, 0, renderData, lineHeight, editorElement, decorations)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n frontLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawFrontDecorationsForLines(currentRow, range.start, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawFrontDecorationsForLines(currentRow, lastRow, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n }\n }\n\n frontLayer.resetOffscreenSize()\n frontLayer.copyToOffscreen()\n}\n\nconst whitespaceTokenRegex = /^\\s+$/\nconst oneOrMoreWhiteSpaceRegexp = /\\s+/\n\n/**\n * Draws a single token on the given context.\n *\n * @param {CanvasRenderingContext2D} context the target canvas context\n * @param {string} text the token's text content\n * @param {string} color the token's CSS color\n * @param {number} x the x position of the token in the line\n * @param {number} y the y position of the line in the minimap\n * @param {number} charWidth the width of a character in the minimap\n * @param {number} charHeight the height of a character in the minimap\n * @return {number} the x position at the end of the token\n * @return {boolean} the x position at the end of the token\n * @access private\n */\nfunction drawToken (context, text, color, x, y, charWidth, charHeight, ignoreWhitespacesInTokens) {\n context.fillStyle = color\n\n if (ignoreWhitespacesInTokens) {\n const length = text.length * charWidth\n context.fillRect(x, y, length, charHeight)\n\n return x + length\n } else {\n let chars = 0\n for (let j = 0, len = text.length; j < len; j++) {\n const char = text[j]\n if (char === ' ') {\n if (chars > 0) {\n context.fillRect(x - (chars * charWidth), y, chars * charWidth, charHeight)\n }\n chars = 0\n } else {\n chars++\n }\n x += charWidth\n }\n if (chars > 0) {\n context.fillRect(x - (chars * charWidth), y, chars * charWidth, charHeight)\n }\n return x\n }\n}\n\n/**\n * Draws lines on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {number} charHeight this.minimap.getCharHeight() * devicePixelRatio\n * @param {number} charWidth this.minimap.getCharWidth() * devicePixelRatio\n * @param {number} canvasWidth this.tokensLayer.getSize().width\n * @param {CanvasRenderingContext2D} context this.tokensLayer.context\n * @param {TextEditor} editor this.minimap.getTextEditor()\n * @param {number} editorScreenLineCount\n * @param {RegExp} invisibleRegExp\n * @param {(t: Token) => string} getTokenColorClosure\n * @param {boolean} ignoreWhitespacesInTokens this.ignoreWhitespacesInTokens\n * @param {number} maxTokensInOneLine this.maxTokensInOneLine\n * @access private\n */\nfunction drawLines (firstRow, lastRow, offsetRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine) {\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n if (firstRow > lastRow) { return }\n\n let lastLine, x\n let y = (offsetRow * lineHeight) - lineHeight\n\n // eachTokenForScreenRows\n lastRow = Math.min(lastRow, editorScreenLineCount)\n\n for (let line = firstRow; line < lastRow; line++) {\n const editorTokensForScreenRow = editor.tokensForScreenRow(line)\n const numToken = editorTokensForScreenRow.length\n const numTokenToRender = Math.min(numToken, maxTokensInOneLine)\n for (let iToken = 0; iToken < numTokenToRender; iToken++) {\n const token = editorTokensForScreenRow[iToken]\n const tokenText = token.text.replace(invisibleRegExp, ' ')\n const tokenScopes = token.scopes\n\n if (lastLine !== line) {\n x = 0\n y += lineHeight\n lastLine = line\n context.clearRect(x, y, canvasWidth, lineHeight)\n }\n if (x > canvasWidth) { continue }\n\n if (whitespaceTokenRegex.test(tokenText)) {\n x += tokenText.length * charWidth\n } else {\n x = drawToken(\n context, tokenText, getTokenColorClosure(tokenScopes), x, y, charWidth, charHeight, ignoreWhitespacesInTokens\n )\n }\n }\n }\n\n context.fill()\n}\n\n/**\n * Returns the regexp to replace invisibles substitution characters\n * in editor lines.\n * @param {TextEditor} editor\n * @return {RegExp} the regular expression to match invisible characters\n * @access private\n */\nfunction getInvisibleRegExp (editor) {\n const invisibles = editor.getInvisibles()\n const regexp = []\n if (invisibles.cr != null) { regexp.push(invisibles.cr) }\n if (invisibles.eol != null) { regexp.push(invisibles.eol) }\n if (invisibles.space != null) { regexp.push(invisibles.space) }\n if (invisibles.tab != null) { regexp.push(invisibles.tab) }\n\n if (regexp.length !== 0) {\n return RegExp(regexp.filter((s) => {\n return typeof s === 'string'\n }).map(escapeRegExp).join('|'), 'g')\n } else {\n return null\n }\n}\n\n/**\n * dispatchers for decoration drawing (custom decoration drawer added dynamically)\n * @param {Object} backgroundDecorationDispatcher an object with the type to render as key and the\n * render method as value\n*/\nconst backgroundDecorationDispatcher = {\n line: drawLineDecoration,\n 'highlight-under': drawHighlightDecoration\n}\n\n/**\n * dispatchers for decoration drawing (custom decoration drawer added dynamically)\n * @param {Object} frontDecorationDispatcher an object with the type to render as key and the\n * render method as value\n*/\nconst frontDecorationDispatcher = {\n gutter: drawGutterDecoration,\n 'highlight-over': drawHighlightDecoration,\n 'highlight-outline': drawHighlightOutlineDecoration\n}\n\n/**\n * Draws a line decoration.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawLineDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, canvasWidth, yRow } = data\n\n context.fillStyle = decorationColor\n context.fillRect(0, yRow, canvasWidth, lineHeight)\n}\n\n/**\n * Draws a gutter decoration.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawGutterDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, yRow } = data\n\n context.fillStyle = decorationColor\n context.fillRect(0, yRow, 1, lineHeight)\n}\n\n/**\n * Draws a highlight decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawHighlightDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, charWidth, canvasWidth, screenRow, yRow } = data\n\n const range = decoration.getMarker().getScreenRange()\n const rowSpan = range.end.row - range.start.row\n\n context.fillStyle = decorationColor\n\n if (rowSpan === 0) {\n const colSpan = range.end.column - range.start.column\n context.fillRect(range.start.column * charWidth, yRow, colSpan * charWidth, lineHeight)\n } else if (screenRow === range.start.row) {\n const x = range.start.column * charWidth\n context.fillRect(x, yRow, canvasWidth - x, lineHeight)\n } else if (screenRow === range.end.row) {\n context.fillRect(0, yRow, range.end.column * charWidth, lineHeight)\n } else {\n context.fillRect(0, yRow, canvasWidth, lineHeight)\n }\n}\n\n/**\n * Draws a highlight outline decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawHighlightOutlineDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, charWidth, canvasWidth, screenRow, yRow } = data\n\n let bottomWidth, colSpan, width, xBottomStart, xEnd, xStart\n const range = decoration.getMarker().getScreenRange()\n const rowSpan = range.end.row - range.start.row\n const yStart = yRow\n const yEnd = yStart + lineHeight\n\n context.fillStyle = decorationColor\n\n if (rowSpan === 0) {\n colSpan = range.end.column - range.start.column\n width = colSpan * charWidth\n xStart = range.start.column * charWidth\n xEnd = xStart + width\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xStart, yEnd - 1, width, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n } else if (rowSpan === 1) {\n xStart = range.start.column * charWidth\n xEnd = range.end.column * charWidth\n\n if (screenRow === range.start.row) {\n width = canvasWidth - xStart\n xBottomStart = Math.max(xStart, xEnd)\n bottomWidth = canvasWidth - xBottomStart\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xBottomStart, yEnd - 1, bottomWidth, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n } else {\n width = canvasWidth - xStart\n bottomWidth = canvasWidth - xEnd\n\n context.fillRect(0, yStart, xStart, 1)\n context.fillRect(0, yEnd - 1, xEnd, 1)\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n }\n } else {\n xStart = range.start.column * charWidth\n xEnd = range.end.column * charWidth\n if (screenRow === range.start.row) {\n width = canvasWidth - xStart\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n } else if (screenRow === range.end.row) {\n width = canvasWidth - xStart\n\n context.fillRect(0, yEnd - 1, xEnd, 1)\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n } else {\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n if (screenRow === range.start.row + 1) {\n context.fillRect(0, yStart, xStart, 1)\n }\n if (screenRow === range.end.row - 1) {\n context.fillRect(xEnd, yEnd - 1, canvasWidth - xEnd, 1)\n }\n }\n }\n}\n\n/**\n * Draws a custom decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @param {TextEditorElement} editorElement\n * @access private\n */\nfunction drawCustomDecoration (decoration, data, decorationColor, editorElement) {\n const renderRoutine = decoration.getProperties().render\n\n if (renderRoutine) {\n data.color = decorationColor\n renderRoutine(decoration, data, editorElement)\n }\n}\n\n/**\n * Draws the specified decorations for the current `screenRow`.\n *\n * The `decorations` object contains all the decorations grouped by type and\n * then rows.\n *\n * @param {number} screenRow the screen row index for which\n * render decorations\n * @param {Object} decorations the object containing all the decorations\n * @param {Object} renderData the object containing the render data\n * @param {Object} types an object with the type to render as key and the\n * render method as value\n * @param {TextEditorElement} editorElement\n * @access private\n */\nfunction drawDecorations (screenRow, decorations, renderData, types, editorElement) {\n let decorationsToRender = []\n\n renderData.context.clearRect(\n 0, renderData.yRow,\n renderData.canvasWidth, renderData.lineHeight\n )\n\n for (const i in types) {\n decorationsToRender = decorationsToRender.concat(\n decorations[i] != null ? decorations[i][screenRow] || [] : []\n )\n }\n\n decorationsToRender.sort((a, b) =>\n (renderData.orders[a.properties.plugin] || 0) - (renderData.orders[b.properties.plugin] || 0)\n )\n\n if (decorationsToRender != null ? decorationsToRender.length : undefined) {\n for (let i = 0, len = decorationsToRender.length; i < len; i++) {\n const decoration = decorationsToRender[i]\n const decorationDrawer = types[decoration.properties.type]\n if (!SPEC_MODE) {\n decorationDrawer(\n decoration,\n renderData,\n /* decorationColor */ getDecorationColor(decoration, editorElement)\n )\n } else {\n // get the real function name from the mangeld Parcel names\n const functionName = decorationDrawer.name.split('$').pop().replace('Lambda', '')\n // call the spy:\n thisSpec[functionName](\n decoration,\n renderData,\n /* decorationColor */ getDecorationColor(decoration, editorElement)\n )\n }\n }\n }\n}\n\n/**\n * Draws front decorations on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n *\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction drawFrontDecorationsForLines (firstRow, lastRow, offsetRow, renderData, lineHeight, editorElement, decorations) {\n if (firstRow > lastRow) { return }\n\n for (let screenRow = firstRow; screenRow <= lastRow; screenRow++) {\n renderData.row = offsetRow + (screenRow - firstRow)\n renderData.yRow = renderData.row * lineHeight\n renderData.screenRow = screenRow\n\n drawDecorations(screenRow, decorations, renderData, frontDecorationDispatcher, editorElement)\n }\n\n renderData.context.fill()\n}\n\n/**\n * Draws back decorations on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n *\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction drawBackDecorationsForLines (firstRow, lastRow, offsetRow, renderData, lineHeight, editorElement, decorations) {\n if (firstRow > lastRow) { return }\n\n for (let screenRow = firstRow; screenRow <= lastRow; screenRow++) {\n renderData.row = offsetRow + (screenRow - firstRow)\n renderData.yRow = renderData.row * lineHeight\n renderData.screenRow = screenRow\n\n drawDecorations(screenRow, decorations, renderData, backgroundDecorationDispatcher, editorElement)\n }\n\n renderData.context.fill()\n}\n\n// ###### ####### ## ####### ######## ######\n// ## ## ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ######## ######\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ## ##\n// ###### ####### ######## ####### ## ## ######\n\n/**\n * Returns the opacity value to use when rendering the `Minimap` text.\n *\n * @return {Number} the text opacity value\n * Unused (inlined)\n */\n// getTextOpacity () { return this.textOpacity }\n\n/**\n * Returns the default text color for an editor content.\n *\n * The color value is directly read from the `TextEditorView` computed styles.\n * @param {TextEditorElement} editorElement\n * @param {number} textOpacity\n * @return {string} a CSS color\n */\nfunction getDefaultColor (editorElement, textOpacity) {\n const color = domStylesReader.retrieveStyleFromDom(['.editor'], 'color', editorElement, true)\n return transparentize(color, textOpacity)\n}\n\n/**\n * Returns the text color for the passed-in scopes\n *\n * The color value is read from the DOM by creating a node structure that\n * match the token `scope` property.\n *\n * @param {Array} scopes an array of scopes for a `TextEditor` token (token.scopeDescriptor || token.scopes)\n * @param {TextEditorElement} editorElement\n * @param {number} textOpacity\n * @return {string} the CSS color for the provided token\n */\nfunction getTokenColor (scopes, editorElement, textOpacity) {\n const color = domStylesReader.retrieveStyleFromDom(scopes, 'color', editorElement, true)\n\n return transparentize(color, textOpacity)\n}\n\n/**\n * Converts a `rgb(...)` color into a `rgba(...)` color with the specified\n * opacity.\n *\n * @param {string} color the CSS RGB color to transparentize\n * @param {number} opacity the opacity amount\n * @return {string} the transparentized CSS color\n * @access private\n */\nfunction transparentize (color, opacity) {\n // assumes that color is in form of `rgb(content)` with no spaces around the given value\n return `rgba(${color.slice(4, -1)}, ${opacity})`\n}\n\n/**\n * Returns the background color for the passed-in `decoration` object.\n *\n * The color value is read from the DOM by creating a node structure that\n * match the decoration `scope` property unless the decoration provides\n * its own `color` property.\n *\n * @param {Decoration} decoration the decoration to get the color for\n * @param {TextEditorElement} editorElement\n * @return {string} the CSS color for the provided decoration\n */\nfunction getDecorationColor (decoration, editorElement) {\n const properties = decoration.getProperties()\n if (properties.color) { return properties.color }\n\n if (properties.scope) {\n const scopeString = properties.scope.split(oneOrMoreWhiteSpaceRegexp)\n return domStylesReader.retrieveStyleFromDom(scopeString, 'background-color', editorElement, true)\n } else {\n return getDefaultColor(editorElement)\n }\n}\n\n// ######## ### ## ## ###### ######## ######\n// ## ## ## ## ### ## ## ## ## ## ##\n// ## ## ## ## #### ## ## ## ##\n// ######## ## ## ## ## ## ## #### ###### ######\n// ## ## ######### ## #### ## ## ## ##\n// ## ## ## ## ## ### ## ## ## ## ##\n// ## ## ## ## ## ## ###### ######## ######\n\n/**\n * Computes the ranges that are not affected by the current pending changes.\n *\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @param {number | null} offscreenFirstRow CanvasDrawer.offscreenLastRow\n * @param {number | null} offscreenLastRow CanvasDrawer.offscreenLastRow\n * @return {Array} the intact ranges in the rendered region\n * @access private\n */\nfunction computeIntactRanges (firstRow, lastRow, changes, offscreenFirstRow, offscreenLastRow) {\n // TODO when do they get null?\n if ((offscreenFirstRow == null) && (offscreenLastRow == null)) {\n return []\n }\n\n // At first, the whole range is considered intact\n let intactRanges = [\n {\n start: offscreenFirstRow,\n end: offscreenLastRow,\n offscreenRow: 0\n }\n ]\n\n for (let i = 0, len = changes.length; i < len; i++) {\n const change = changes[i]\n const newIntactRanges = []\n\n for (let j = 0, intactLen = intactRanges.length; j < intactLen; j++) {\n const range = intactRanges[j]\n\n if (change.end < range.start && change.screenDelta !== 0) {\n // The change is above of the range and lines are either\n // added or removed\n newIntactRanges.push({\n start: range.start + change.screenDelta,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow\n })\n } else if (change.end < range.start || change.start > range.end) {\n // The change is outside the range but didn't add\n // or remove lines\n newIntactRanges.push(range)\n } else {\n // The change is within the range, there's one intact range\n // from the range start to the change start\n if (change.start > range.start) {\n newIntactRanges.push({\n start: range.start,\n end: change.start - 1,\n offscreenRow: range.offscreenRow\n })\n }\n if (change.end < range.end) {\n // The change ends within the range\n if (change.bufferDelta !== 0) {\n // Lines are added or removed, the intact range starts in the\n // next line after the change end plus the screen delta\n newIntactRanges.push({\n start: change.end + change.screenDelta + 1,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n } else if (change.screenDelta !== 0) {\n // Lines are added or removed in the display buffer, the intact\n // range starts in the next line after the change end plus the\n // screen delta\n newIntactRanges.push({\n start: change.end + change.screenDelta + 1,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n } else {\n // No lines are added, the intact range starts on the line after\n // the change end\n newIntactRanges.push({\n start: change.end + 1,\n end: range.end,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n }\n }\n }\n }\n intactRanges = newIntactRanges\n }\n\n return truncateIntactRanges(intactRanges, firstRow, lastRow)\n}\n\n/**\n * Truncates the intact ranges so that they doesn't expand past the visible\n * area of the minimap.\n *\n * @param {Array} intactRanges the initial array of ranges\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @return {Array} the array of truncated ranges\n * @access private\n */\nfunction truncateIntactRanges (intactRanges, firstRow, lastRow) {\n let i = 0\n while (i < intactRanges.length) {\n const range = intactRanges[i]\n\n if (range.start < firstRow) {\n range.offscreenRow += firstRow - range.start\n range.start = firstRow\n }\n\n if (range.end > lastRow) { range.end = lastRow }\n\n if (range.start >= range.end) { intactRanges.splice(i--, 1) }\n\n i++\n }\n\n return intactRanges.sort((a, b) => {\n return a.offscreenRow - b.offscreenRow\n })\n}\n","'use strict'\n\n/**\n * Generates a decorator function to includes many `mixto` mixins into a class.\n *\n * @param {...Mixin} mixins the mixins to include in the class\n * @return {function(cls:Function):Function} the decorator function that will\n * include the specified mixins\n * @example\n * @include(SomeMixin)\n * export default class SomeClass {\n * // ...\n * }\n */\nexport default function include (cls, ...mixins) {\n mixins.forEach((mixin) => { includeMixin(cls, mixin) })\n}\n\nfunction includeMixin (target, source) {\n Object.getOwnPropertyNames(source).forEach((k) => {\n if (['length', 'name', 'arguments', 'caller', 'prototype', 'includeInto'].indexOf(k) >= 0) { return }\n\n const descriptor = Object.getOwnPropertyDescriptor(source, k)\n Object.defineProperty(target, k, descriptor)\n })\n\n Object.getOwnPropertyNames(source.prototype).forEach((k) => {\n if (k === 'constructor') { return }\n\n const descriptor = Object.getOwnPropertyDescriptor(source.prototype, k)\n Object.defineProperty(target.prototype, k, descriptor)\n })\n}\n","'use strict'\n\nimport { registerOrUpdateElement } from 'atom-utils-plus'\n\n/**\n * Generates a decorator function to convert a class into a custom element\n * through the `registerOrUpdateElement` method from `atom-utils-plus`.\n *\n * The decorator will take care to return the generated element class so that\n * you can just export it directly as demonstrated below.\n *\n * As supported by the `registerOrUpdateElement` method, static member will\n * be available on the new class.\n *\n * **Note: As there's some limitations when modifying the prototype\n * of a custom element, if you need to inject element callbacks (like\n * `createdCallback`) through a mixin, the mixins should be included before\n * converting the class as a custom element. You'll be able to achieve that by\n * placing the `include` decorator after the `element` one as shown in the\n * second example.**\n *\n * @param {string} elementName the node name of the element to register\n * @return {Function} the element class as returned by\n * `document.registerElement`\n * @example\n * @element('dummy-element-name')\n * export default class SomeClass {\n * // ...\n * }\n *\n * @element('dummy-element-with-mixin')\n * @include(SomeMixin)\n * export default class SomeClass {\n * // ...\n * }\n */\nexport default function element (cls, elementName) {\n return registerOrUpdateElement(elementName, { class: cls })\n}\n","'use strict'\n\nimport { CompositeDisposable, Disposable } from 'atom'\nimport { EventsDelegation, AncestorsMethods } from 'atom-utils-plus'\nimport elementResizeDetectorImport from 'element-resize-detector'\nimport DecorationManagement from './decoration-management'\n\nimport * as Main from './main'\nimport CanvasDrawer from './mixins/canvas-drawer'\nimport include from './decorators/include'\nimport element from './decorators/element'\n\nimport MinimapQuickSettingsElement from './minimap-quick-settings-element'\nconst elementResizeDetector = elementResizeDetectorImport({ strategy: 'scroll' })\n\nlet overlayStyle\n\nfunction ensureOverlayStyle () {\n if (!overlayStyle) {\n overlayStyle = document.createElement('style')\n overlayStyle.setAttribute('context', 'atom-text-editor-minimap')\n document.head.appendChild(overlayStyle)\n }\n}\n\nfunction removeOverlayStyle () {\n if (overlayStyle) {\n overlayStyle.parentNode.removeChild(overlayStyle)\n overlayStyle = null\n }\n}\n\nfunction updateOverlayStyle (basis) {\n if (overlayStyle) {\n overlayStyle.textContent = `\n atom-text-editor[with-minimap].editor > div,\n atom-text-editor[with-minimap] > div {\n margin-left: ${basis}px;\n }\n `\n }\n}\n\nconst SPEC_MODE = atom.inSpecMode()\n\n/**\n * Public: The MinimapElement is the view meant to render a {@link Minimap}\n * instance in the DOM.\n *\n * You can retrieve the MinimapElement associated to a Minimap\n * using the `atom.views.getView` method.\n *\n * Note that most interactions with the Minimap package is done through the\n * Minimap model so you should never have to access MinimapElement\n * instances.\n *\n * @example\n * let minimapElement = atom.views.getView(minimap)\n */\nclass MinimapElement {\n static initClass () {\n include(this, CanvasDrawer, EventsDelegation, AncestorsMethods)\n return element(this, 'atom-text-editor-minimap')\n }\n\n // ## ## ####### ####### ## ## ######\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ######### ## ## ## ## ##### ######\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ####### ####### ## ## ######\n\n /**\n * DOM callback invoked when a new MinimapElement is created.\n *\n * @access private\n */\n createdCallback () {\n // Core properties\n\n /**\n * @access private\n */\n this.minimap = undefined\n\n /**\n * @access private\n */\n this.width = undefined\n /**\n * @access private\n */\n this.height = undefined\n\n // Subscriptions\n\n /**\n * @access private\n */\n this.subscriptions = new CompositeDisposable()\n /**\n * @access private\n */\n this.visibleAreaSubscription = undefined\n /**\n * @access private\n */\n this.quickSettingsSubscription = undefined\n /**\n * @access private\n */\n this.dragSubscription = undefined\n /**\n * @access private\n */\n this.openQuickSettingSubscription = undefined\n\n // Configs\n\n /**\n * @access private\n */\n this.displayMinimapOnLeft = false\n /**\n * @access private\n */\n this.minimapScrollIndicator = undefined\n /**\n * @access private\n */\n this.displayMinimapOnLeft = undefined\n /**\n * @access private\n */\n this.displayPluginsControls = undefined\n /**\n * @access private\n */\n this.textOpacity = undefined\n /**\n * @access private\n */\n this.displayCodeHighlights = undefined\n /**\n * @access private\n */\n this.adjustToSoftWrap = undefined\n /**\n * @access private\n */\n this.useHardwareAcceleration = undefined\n /**\n * @access private\n */\n this.absoluteMode = undefined\n\n // Elements\n\n /**\n * @access private\n */\n this.visibleArea = undefined\n /**\n * @access private\n */\n this.controls = undefined\n /**\n * @access private\n */\n this.scrollIndicator = undefined\n /**\n * @access private\n */\n this.openQuickSettings = undefined\n /**\n * @access private\n */\n this.quickSettingsElement = undefined\n\n this.DecorationManagement = new DecorationManagement()\n\n // States\n\n /**\n * @access private\n */\n this.attached = undefined\n /**\n * @access private\n */\n this.attachedToTextEditor = undefined\n /**\n * @access private\n */\n this.standAlone = undefined\n /**\n * @access private\n */\n this.wasVisible = undefined\n\n // Other\n\n /**\n * @access private\n */\n this.offscreenFirstRow = undefined\n /**\n * @access private\n */\n this.offscreenLastRow = undefined\n /**\n * @access private\n */\n this.frameRequested = undefined\n /**\n * @access private\n */\n this.flexBasis = undefined\n\n this.initializeContent()\n\n this.subscriptions.add(\n atom.config.observe('minimap.displayMinimapOnLeft', (displayMinimapOnLeft) => {\n this.displayMinimapOnLeft = displayMinimapOnLeft\n\n displayMinimapOnLeft\n ? ensureOverlayStyle()\n : removeOverlayStyle()\n this.updateMinimapFlexPosition()\n this.measureHeightAndWidth(true, true)\n }),\n\n atom.config.observe('minimap.minimapScrollIndicator', (minimapScrollIndicator) => {\n this.minimapScrollIndicator = minimapScrollIndicator\n\n if (this.minimapScrollIndicator && !(this.scrollIndicator != null) && !this.standAlone) {\n this.initializeScrollIndicator()\n } else if ((this.scrollIndicator != null)) {\n this.disposeScrollIndicator()\n }\n\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('minimap.displayPluginsControls', (displayPluginsControls) => {\n this.displayPluginsControls = displayPluginsControls\n\n if (this.displayPluginsControls && !(this.openQuickSettings != null) && !this.standAlone) {\n this.initializeOpenQuickSettings()\n } else if ((this.openQuickSettings != null)) {\n this.disposeOpenQuickSettings()\n }\n }),\n\n atom.config.observe('minimap.textOpacity', (textOpacity) => {\n this.textOpacity = textOpacity\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('minimap.displayCodeHighlights', (displayCodeHighlights) => {\n this.displayCodeHighlights = displayCodeHighlights\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('minimap.smoothScrolling', (smoothScrolling) => {\n this.smoothScrolling = smoothScrolling\n\n if (this.attached) {\n if (!this.smoothScrolling) {\n this.backLayer.canvas.style.cssText = ''\n this.tokensLayer.canvas.style.cssText = ''\n this.frontLayer.canvas.style.cssText = ''\n } else {\n this.requestUpdate()\n }\n }\n }),\n\n atom.config.observe('minimap.adjustMinimapWidthToSoftWrap', (adjustToSoftWrap) => {\n this.adjustToSoftWrap = adjustToSoftWrap\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.adjustMinimapWidthOnlyIfSmaller', (adjustOnlyIfSmaller) => {\n this.adjustOnlyIfSmaller = adjustOnlyIfSmaller\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.useHardwareAcceleration', (useHardwareAcceleration) => {\n this.useHardwareAcceleration = useHardwareAcceleration\n\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('minimap.absoluteMode', (absoluteMode) => {\n this.absoluteMode = absoluteMode\n\n this.classList.toggle('absolute', this.absoluteMode)\n }),\n\n atom.config.observe('minimap.adjustAbsoluteModeHeight', (adjustAbsoluteModeHeight) => {\n this.adjustAbsoluteModeHeight = adjustAbsoluteModeHeight\n\n this.classList.toggle('adjust-absolute-height', this.adjustAbsoluteModeHeight)\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.ignoreWhitespacesInTokens', (ignoreWhitespacesInTokens) => {\n this.ignoreWhitespacesInTokens = ignoreWhitespacesInTokens\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('editor.preferredLineLength', () => {\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('editor.softWrap', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.showInvisibles', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.invisibles', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.softWrapAtPreferredLineLength', () => {\n if (this.attached) { this.requestUpdate() }\n })\n )\n }\n\n /**\n * DOM callback invoked when a new MinimapElement is attached to the DOM.\n *\n * @access private\n */\n attachedCallback () {\n if (typeof atom.views.pollDocument === 'function') {\n this.subscriptions.add(atom.views.pollDocument(() => { this.pollDOM() }))\n } else {\n this.intersectionObserver = new IntersectionObserver((entries) => {\n const { intersectionRect } = entries[entries.length - 1]\n if (intersectionRect.width > 0 || intersectionRect.height > 0) {\n this.measureHeightAndWidth(true, true)\n }\n })\n\n this.intersectionObserver.observe(this)\n if (this.isVisible()) {\n this.measureHeightAndWidth(true, true)\n }\n\n const measureDimensions = () => { this.measureHeightAndWidth(false, false) }\n elementResizeDetector.listenTo(this, measureDimensions)\n window.addEventListener('resize', measureDimensions, { passive: true })\n\n this.subscriptions.add(\n new Disposable(() => { elementResizeDetector.removeListener(this, measureDimensions) }),\n new Disposable(() => { window.removeEventListener('resize', measureDimensions) })\n )\n }\n\n this.measureHeightAndWidth()\n this.updateMinimapFlexPosition()\n this.attached = true\n this.attachedToTextEditor = this.queryParentSelector('atom-text-editor') === this.minimap.getTextEditorElement()\n\n if (this.attachedToTextEditor) {\n this.minimap.getTextEditorElement().setAttribute('with-minimap', '')\n }\n\n this.subscriptions.add(\n this.subscribeToMediaQuery()\n )\n }\n\n /**\n * DOM callback invoked when a new MinimapElement is detached from the DOM.\n *\n * @access private\n */\n detachedCallback () {\n this.minimap.getTextEditorElement().removeAttribute('with-minimap')\n this.attached = false\n }\n\n // ### ######## ######## ### ###### ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## #########\n // ######### ## ## ######### ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ###### ## ##\n\n /**\n * Returns whether the MinimapElement is currently visible on screen or not.\n *\n * The visibility of the minimap is defined by testing the size of the offset\n * width and height of the element.\n *\n * @return {boolean} whether the MinimapElement is currently visible or not\n */\n isVisible () { return this.offsetWidth > 0 || this.offsetHeight > 0 }\n\n /**\n * Attaches the MinimapElement to the DOM.\n *\n * The position at which the element is attached is defined by the\n * `displayMinimapOnLeft` setting.\n *\n * @param {HTMLElement} [parent] the DOM node where attaching the minimap\n * element\n */\n attach (parent) {\n if (this.attached) { return }\n\n const container = parent || this.minimap.getTextEditorElement()\n const minimaps = container.querySelectorAll('atom-text-editor-minimap')\n if (minimaps.length) {\n Array.prototype.forEach.call(minimaps, (el) => {\n el.destroy()\n container.removeChild(el)\n })\n }\n container.appendChild(this)\n }\n\n /**\n * Detaches the MinimapElement from the DOM.\n */\n detach () {\n if (!this.attached || this.parentNode == null) { return }\n this.parentNode.removeChild(this)\n }\n\n /**\n * Toggles the minimap left/right position based on the value of the\n * `displayMinimapOnLeft` setting.\n *\n * @access private\n */\n updateMinimapFlexPosition () {\n this.classList.toggle('left', this.displayMinimapOnLeft)\n }\n\n /**\n * Destroys this MinimapElement\n */\n destroy () {\n this.DecorationManagement.destroy()\n if (this.quickSettingsElement) {\n this.quickSettingsElement.destroy()\n }\n this.subscriptions.dispose()\n this.detach()\n if (this.minimap) {\n this.minimap.minimapElement = null\n this.minimap = null\n }\n }\n\n // ###### ####### ## ## ######## ######## ## ## ########\n // ## ## ## ## ### ## ## ## ### ## ##\n // ## ## ## #### ## ## ## #### ## ##\n // ## ## ## ## ## ## ## ###### ## ## ## ##\n // ## ## ## ## #### ## ## ## #### ##\n // ## ## ## ## ## ### ## ## ## ### ##\n // ###### ####### ## ## ## ######## ## ## ##\n\n /**\n * Creates the content of the MinimapElement and attaches the mouse control\n * event listeners.\n *\n * @access private\n */\n initializeContent () {\n this.initializeCanvas()\n\n this.attachCanvases(this)\n\n this.createVisibleArea()\n this.createControls()\n\n this.subscriptions.add(\n\n this.subscribeTo(\n this,\n {\n mousewheel: (e) => {\n if (!this.standAlone && this.minimap.onMouseWheel) {\n this.minimap.onMouseWheel(e)\n }\n }\n },\n { passive: true }\n ),\n\n this.subscribeTo(\n this.getFrontCanvas(),\n {\n mousedown: (e) => { this.canvasPressed(extractMouseEventData(e)) },\n touchstart: (e) => { this.canvasPressed(extractTouchEventData(e)) }\n },\n { passive: true }\n )\n\n )\n }\n\n /**\n * Initializes the visible area div.\n *\n * @access private\n */\n createVisibleArea () {\n if (this.visibleArea) { return }\n\n this.visibleArea = document.createElement('div')\n this.visibleArea.classList.add('minimap-visible-area')\n this.appendChild(this.visibleArea)\n this.visibleAreaSubscription = this.subscribeTo(this.visibleArea, {\n mousedown: (e) => { this.startDrag(extractMouseEventData(e)) },\n touchstart: (e) => { this.startDrag(extractTouchEventData(e)) }\n }, { passive: true })\n\n this.subscriptions.add(this.visibleAreaSubscription)\n }\n\n /**\n * Removes the visible area div.\n *\n * @access private\n */\n removeVisibleArea () {\n if (!this.visibleArea) { return }\n\n this.subscriptions.remove(this.visibleAreaSubscription)\n this.visibleAreaSubscription.dispose()\n this.removeChild(this.visibleArea)\n delete this.visibleArea\n }\n\n /**\n * Creates the controls container div.\n *\n * @access private\n */\n createControls () {\n if (this.controls || this.standAlone) { return }\n\n this.controls = document.createElement('div')\n this.controls.classList.add('minimap-controls')\n this.appendChild(this.controls)\n }\n\n /**\n * Removes the controls container div.\n *\n * @access private\n */\n removeControls () {\n if (!this.controls) { return }\n\n this.removeChild(this.controls)\n delete this.controls\n }\n\n /**\n * Initializes the scroll indicator div when the `minimapScrollIndicator`\n * settings is enabled.\n *\n * @access private\n */\n initializeScrollIndicator () {\n if (this.scrollIndicator || this.standAlone) { return }\n\n this.scrollIndicator = document.createElement('div')\n this.scrollIndicator.classList.add('minimap-scroll-indicator')\n this.controls.appendChild(this.scrollIndicator)\n }\n\n /**\n * Disposes the scroll indicator div when the `minimapScrollIndicator`\n * settings is disabled.\n *\n * @access private\n */\n disposeScrollIndicator () {\n if (!this.scrollIndicator) { return }\n\n this.controls.removeChild(this.scrollIndicator)\n delete this.scrollIndicator\n }\n\n /**\n * Initializes the quick settings openener div when the\n * `displayPluginsControls` setting is enabled.\n *\n * @access private\n */\n initializeOpenQuickSettings () {\n if (this.openQuickSettings || this.standAlone) { return }\n\n this.openQuickSettings = document.createElement('div')\n this.openQuickSettings.classList.add('open-minimap-quick-settings')\n this.controls.appendChild(this.openQuickSettings)\n\n this.openQuickSettingSubscription = this.subscribeTo(this.openQuickSettings, {\n mousedown: (e) => {\n e.preventDefault()\n e.stopPropagation()\n\n if ((this.quickSettingsElement != null)) {\n this.quickSettingsElement.destroy()\n this.quickSettingsSubscription.dispose()\n } else {\n this.quickSettingsElement = new MinimapQuickSettingsElement()\n this.quickSettingsElement.setModel(this)\n this.quickSettingsSubscription = this.quickSettingsElement.onDidDestroy(() => {\n this.quickSettingsElement = null\n })\n\n const { top, left, right } = this.getFrontCanvas().getBoundingClientRect()\n this.quickSettingsElement.style.top = `${top}px`\n this.quickSettingsElement.attach()\n\n if (this.displayMinimapOnLeft) {\n this.quickSettingsElement.style.left = `${right}px`\n } else {\n this.quickSettingsElement.style.left = `${left - this.quickSettingsElement.clientWidth}px`\n }\n }\n }\n })\n }\n\n /**\n * Disposes the quick settings openener div when the `displayPluginsControls`\n * setting is disabled.\n *\n * @access private\n */\n disposeOpenQuickSettings () {\n if (!this.openQuickSettings) { return }\n\n this.controls.removeChild(this.openQuickSettings)\n this.openQuickSettingSubscription.dispose()\n delete this.openQuickSettings\n }\n\n /**\n * get the DecorationManagement API for minimapElement\n * @return {DecorationManagement}\n */\n getDecorationManagement () {\n return this.DecorationManagement\n }\n\n // ## ## ####### ######## ######## ##\n // ### ### ## ## ## ## ## ##\n // #### #### ## ## ## ## ## ##\n // ## ### ## ## ## ## ## ###### ##\n // ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ##\n // ## ## ####### ######## ######## ########\n\n /**\n * Returns the Minimap for which this MinimapElement was created.\n *\n * @return {Minimap} this element's Minimap\n */\n getModel () { return this.minimap }\n\n /**\n * Defines the Minimap model for this MinimapElement instance.\n *\n * @param {Minimap} minimap the Minimap model for this instance.\n * @return {Minimap} this element's Minimap\n */\n setModel (minimap) {\n this.minimap = minimap\n\n // set minimapElement for Minimap\n this.minimap.minimapElement = this\n\n this.DecorationManagement.initializeDecorations(this.minimap)\n\n this.subscriptions.add(\n\n this.minimap.onDidChangeScrollTop(() => {\n this.requestUpdate()\n }),\n\n this.minimap.onDidChangeScrollLeft(() => {\n this.requestUpdate()\n }),\n\n this.minimap.onDidDestroy(() => {\n this.destroy()\n }),\n\n this.minimap.onDidChangeConfig(() => {\n if (this.attached) { return this.requestForcedUpdate() }\n }),\n\n this.minimap.onDidChangeStandAlone(() => {\n this.setStandAlone(this.minimap.isStandAlone())\n this.requestUpdate()\n }),\n\n this.minimap.onDidChange((change) => {\n this.pendingChanges.push(change)\n this.requestUpdate()\n }),\n\n this.DecorationManagement.onDidChangeDecorationRange((change) => {\n const { type } = change\n if (type === 'line' ||\n type === 'highlight-under' ||\n type === 'background-custom') {\n this.pendingBackDecorationChanges.push(change)\n } else {\n this.pendingFrontDecorationChanges.push(change)\n }\n this.requestUpdate()\n }),\n\n Main.onDidChangePluginOrder(() => {\n this.requestForcedUpdate()\n })\n )\n\n this.setStandAlone(this.minimap.isStandAlone())\n\n if (this.width != null && this.height != null) {\n this.minimap.setScreenHeightAndWidth(this.height, this.width)\n }\n\n return this.minimap\n }\n\n /**\n * Sets the stand-alone mode for this MinimapElement.\n *\n * @param {boolean} standAlone the new mode for this MinimapElement\n */\n setStandAlone (standAlone) {\n this.standAlone = standAlone\n\n if (this.standAlone) {\n this.setAttribute('stand-alone', true)\n this.disposeScrollIndicator()\n this.disposeOpenQuickSettings()\n this.removeControls()\n this.removeVisibleArea()\n } else {\n this.removeAttribute('stand-alone')\n this.createVisibleArea()\n this.createControls()\n if (this.minimapScrollIndicator) { this.initializeScrollIndicator() }\n if (this.displayPluginsControls) { this.initializeOpenQuickSettings() }\n }\n }\n\n // ## ## ######## ######## ### ######## ########\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ######## ## ## ## ## ## ######\n // ## ## ## ## ## ######### ## ##\n // ## ## ## ## ## ## ## ## ##\n // ####### ## ######## ## ## ## ########\n\n /**\n * Requests an update to be performed on the next frame.\n */\n requestUpdate () {\n if (this.frameRequested) { return }\n\n this.frameRequested = true\n requestAnimationFrame(() => {\n this.update()\n this.frameRequested = false\n })\n }\n\n /**\n * Requests an update to be performed on the next frame that will completely\n * redraw the minimap.\n */\n requestForcedUpdate () {\n this.offscreenFirstRow = null\n this.offscreenLastRow = null\n this.requestUpdate()\n }\n\n /**\n * Performs the actual MinimapElement update.\n *\n * @access private\n */\n update () {\n if (!(this.attached && this.isVisible() && this.minimap)) { return }\n const minimap = this.minimap\n minimap.enableCache()\n const canvas = this.getFrontCanvas()\n\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const visibleAreaLeft = minimap.getTextEditorScaledScrollLeft()\n const visibleAreaTop = minimap.getTextEditorScaledScrollTop() - minimap.getScrollTop()\n const width = Math.min(canvas.width / devicePixelRatio, this.width)\n const visibleWidth = width + visibleAreaLeft\n\n if (this.adjustToSoftWrap && this.flexBasis) {\n this.style.flexBasis = `${this.flexBasis}px`\n this.style.width = `${this.flexBasis}px`\n } else {\n this.style.flexBasis = null\n this.style.width = null\n }\n\n if (SPEC_MODE) {\n applyStyles(this.visibleArea, {\n width: `${Math.round(visibleWidth)}px`,\n height: `${Math.round(minimap.getTextEditorScaledHeight())}px`,\n top: `${Math.round(visibleAreaTop)}px`,\n 'border-left-width': `${Math.round(visibleAreaLeft)}px`\n })\n } else {\n applyStyles(this.visibleArea, {\n width: `${Math.round(visibleWidth)}px`,\n height: `${Math.round(minimap.getTextEditorScaledHeight())}px`,\n transform: makeTranslate(0, visibleAreaTop, this.useHardwareAcceleration),\n 'border-left-width': `${Math.round(visibleAreaLeft)}px`\n })\n }\n\n applyStyles(this.controls, { width: `${Math.round(width)}px` })\n\n const canvasTop = minimap.getFirstVisibleScreenRow() * minimap.getLineHeight() - minimap.getScrollTop()\n\n if (this.smoothScrolling) {\n if (SPEC_MODE) {\n applyStyles(this.backLayer.canvas, { top: `${canvasTop}px` })\n applyStyles(this.tokensLayer.canvas, { top: `${canvasTop}px` })\n applyStyles(this.frontLayer.canvas, { top: `${canvasTop}px` })\n } else {\n let canvasTransform = makeTranslate(0, canvasTop, this.useHardwareAcceleration)\n if (devicePixelRatio !== 1) {\n const scale = 1 / devicePixelRatio\n canvasTransform += ` ${makeScale(scale, scale, this.useHardwareAcceleration)}`\n }\n applyStyles(this.backLayer.canvas, { transform: canvasTransform })\n applyStyles(this.tokensLayer.canvas, { transform: canvasTransform })\n applyStyles(this.frontLayer.canvas, { transform: canvasTransform })\n }\n } else {\n const scale = 1 / devicePixelRatio\n const canvasTransform = makeScale(scale, scale, this.useHardwareAcceleration)\n applyStyles(this.backLayer.canvas, { transform: canvasTransform })\n applyStyles(this.tokensLayer.canvas, { transform: canvasTransform })\n applyStyles(this.frontLayer.canvas, { transform: canvasTransform })\n }\n\n if (this.minimapScrollIndicator && !this.scrollIndicator && minimap.canScroll()) {\n this.initializeScrollIndicator()\n }\n\n if (this.scrollIndicator != null) {\n const minimapScreenHeight = minimap.getScreenHeight()\n const indicatorHeight = minimapScreenHeight * (minimapScreenHeight / minimap.getHeight())\n const indicatorScroll = (minimapScreenHeight - indicatorHeight) * minimap.getScrollRatio()\n\n if (SPEC_MODE) {\n applyStyles(this.scrollIndicator, {\n height: `${indicatorHeight}px`,\n top: `${indicatorScroll}px`\n })\n } else {\n applyStyles(this.scrollIndicator, {\n height: `${indicatorHeight}px`,\n transform: makeTranslate(0, indicatorScroll, this.useHardwareAcceleration)\n })\n }\n\n if (!minimap.canScroll()) { this.disposeScrollIndicator() }\n }\n\n if (this.absoluteMode && this.adjustAbsoluteModeHeight) { this.updateCanvasesSize() }\n\n this.updateCanvas()\n minimap.clearCache()\n }\n\n /**\n * Defines whether to render the code highlights or not.\n *\n * @param {Boolean} displayCodeHighlights whether to render the code\n * highlights or not\n */\n setDisplayCodeHighlights (displayCodeHighlights) {\n this.displayCodeHighlights = displayCodeHighlights\n if (this.attached) { this.requestForcedUpdate() }\n }\n\n /**\n * Polling callback used to detect visibility and size changes.\n *\n * @access private\n */\n pollDOM () {\n const visibilityChanged = this.checkForVisibilityChange()\n if (this.isVisible()) {\n if (!this.wasVisible) { this.requestForcedUpdate() }\n\n this.measureHeightAndWidth(visibilityChanged, false)\n }\n }\n\n /**\n * A method that checks for visibility changes in the MinimapElement.\n * The method returns `true` when the visibility changed from visible to\n * hidden or from hidden to visible.\n *\n * @return {boolean} whether the visibility changed or not since the last call\n * @access private\n */\n checkForVisibilityChange () {\n if (this.isVisible()) {\n if (this.wasVisible) {\n return false\n } else {\n this.wasVisible = true\n return this.wasVisible\n }\n } else {\n if (this.wasVisible) {\n this.wasVisible = false\n return true\n } else {\n this.wasVisible = false\n return this.wasVisible\n }\n }\n }\n\n /**\n * A method used to measure the size of the MinimapElement and update internal\n * components based on the new size.\n *\n * @param {boolean} visibilityChanged did the visibility changed since last\n * measurement\n * @param {[type]} [forceUpdate=true] forces the update even when no changes\n * were detected\n * @access private\n */\n measureHeightAndWidth (visibilityChanged, forceUpdate = true) {\n if (!this.minimap) { return }\n\n const safeFlexBasis = this.style.flexBasis\n this.style.flexBasis = ''\n\n const wasResized = this.width !== this.clientWidth || this.height !== this.clientHeight\n\n this.height = this.clientHeight\n this.width = this.clientWidth\n let canvasWidth = this.width\n\n if ((this.minimap != null)) {\n this.minimap.setScreenHeightAndWidth(this.height, this.width)\n }\n\n if (wasResized || visibilityChanged || forceUpdate) {\n this.requestForcedUpdate()\n }\n\n if (!this.isVisible()) { return }\n\n if (wasResized || forceUpdate) {\n if (this.adjustToSoftWrap) {\n const lineLength = atom.config.get('editor.preferredLineLength')\n const softWrap = atom.config.get('editor.softWrap')\n const softWrapAtPreferredLineLength = atom.config.get('editor.softWrapAtPreferredLineLength')\n const width = lineLength * this.minimap.getCharWidth()\n\n if (softWrap && softWrapAtPreferredLineLength && lineLength && (width <= this.width || !this.adjustOnlyIfSmaller)) {\n this.flexBasis = width\n canvasWidth = width\n updateOverlayStyle(width)\n } else {\n updateOverlayStyle(canvasWidth)\n delete this.flexBasis\n }\n } else {\n updateOverlayStyle(canvasWidth)\n delete this.flexBasis\n }\n\n this.updateCanvasesSize(canvasWidth)\n } else {\n this.style.flexBasis = safeFlexBasis\n }\n }\n\n updateCanvasesSize (canvasWidth) {\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const maxCanvasHeight = this.height + this.minimap.getLineHeight()\n const newHeight = this.absoluteMode && this.adjustAbsoluteModeHeight ? Math.min(this.minimap.getHeight(), maxCanvasHeight) : maxCanvasHeight\n const canvas = this.getFrontCanvas()\n\n if (canvasWidth == null) {\n canvasWidth = canvas.width / devicePixelRatio\n }\n\n if (canvasWidth !== canvas.width || newHeight !== canvas.height) {\n this.setCanvasesSize(\n canvasWidth * devicePixelRatio,\n newHeight * devicePixelRatio\n )\n if (this.absoluteMode && this.adjustAbsoluteModeHeight) {\n this.offscreenFirstRow = null\n this.offscreenLastRow = null\n }\n }\n }\n\n // ######## ## ## ######## ## ## ######## ######\n // ## ## ## ## ### ## ## ## ##\n // ## ## ## ## #### ## ## ##\n // ###### ## ## ###### ## ## ## ## ######\n // ## ## ## ## ## #### ## ##\n // ## ## ## ## ## ### ## ## ##\n // ######## ### ######## ## ## ## ######\n\n /**\n * Callback triggered when the mouse is pressed on the MinimapElement canvas.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @access private\n */\n canvasPressed ({ y, isLeftMouse, isMiddleMouse }) {\n if (this.minimap.isStandAlone()) { return }\n if (isLeftMouse) {\n this.canvasLeftMousePressed(y)\n } else if (isMiddleMouse) {\n this.canvasMiddleMousePressed(y)\n const { top, height } = this.visibleArea.getBoundingClientRect()\n this.startDrag({ y: top + height / 2, isLeftMouse: false, isMiddleMouse: true })\n }\n }\n\n /**\n * Callback triggered when the mouse left button is pressed on the\n * MinimapElement canvas.\n *\n * @param {MouseEvent} e the mouse event object\n * @param {number} e.pageY the mouse y position in page\n * @param {HTMLElement} e.target the source of the event\n * @access private\n */\n canvasLeftMousePressed (y) {\n const deltaY = y - this.getBoundingClientRect().top\n const row = Math.floor(deltaY / this.minimap.getLineHeight()) + this.minimap.getFirstVisibleScreenRow()\n\n const textEditor = this.minimap.getTextEditor()\n const textEditorElement = this.minimap.getTextEditorElement()\n\n const scrollTop = row * textEditor.getLineHeightInPixels() - this.minimap.getTextEditorHeight() / 2\n const textEditorScrollTop = textEditorElement.pixelPositionForScreenPosition([row, 0]).top - this.minimap.getTextEditorHeight() / 2\n\n if (atom.config.get('minimap.moveCursorOnMinimapClick')) {\n textEditor.setCursorScreenPosition([row, 0])\n }\n\n if (atom.config.get('minimap.scrollAnimation')) {\n const duration = atom.config.get('minimap.scrollAnimationDuration')\n const independentScroll = this.minimap.scrollIndependentlyOnMouseWheel()\n\n const from = this.minimap.getTextEditorScrollTop()\n const to = textEditorScrollTop\n let step\n\n if (independentScroll) {\n const minimapFrom = this.minimap.getScrollTop()\n const minimapTo = Math.min(1, scrollTop / (this.minimap.getTextEditorMaxScrollTop() || 1)) * this.minimap.getMaxScrollTop()\n\n step = (now, t) => {\n if (this.minimap === null) return // TODO why this happens in the tests?\n this.minimap.setTextEditorScrollTop(now, true)\n this.minimap.setScrollTop(minimapFrom + (minimapTo - minimapFrom) * t)\n }\n animate({ from, to, duration, step })\n } else {\n step = (now) => {\n if (this.minimap === null) return // TODO why this happens in the tests?\n this.minimap.setTextEditorScrollTop(now)\n }\n animate({ from, to, duration, step })\n }\n } else {\n this.minimap.setTextEditorScrollTop(textEditorScrollTop)\n }\n }\n\n /**\n * Callback triggered when the mouse middle button is pressed on the\n * MinimapElement canvas.\n *\n * @param {MouseEvent} e the mouse event object\n * @param {number} e.pageY the mouse y position in page\n * @access private\n */\n canvasMiddleMousePressed (y) {\n const { top: offsetTop } = this.getBoundingClientRect()\n const deltaY = y - offsetTop - this.minimap.getTextEditorScaledHeight() / 2\n\n const ratio = deltaY / (this.minimap.getVisibleHeight() - this.minimap.getTextEditorScaledHeight())\n\n this.minimap.setTextEditorScrollTop(ratio * this.minimap.getTextEditorMaxScrollTop())\n }\n\n /**\n * Subscribes to a media query for device pixel ratio changes and forces\n * a repaint when it occurs.\n *\n * @return {Disposable} a disposable to remove the media query listener\n * @access private\n */\n subscribeToMediaQuery () {\n const mediaQuery = window.matchMedia('screen and (-webkit-min-device-pixel-ratio: 1.5)')\n const mediaListener = () => { this.requestForcedUpdate() }\n mediaQuery.addEventListener('change', mediaListener)\n\n return new Disposable(() => {\n mediaQuery.removeEventListener('change', mediaListener)\n })\n }\n\n // ######## #### ########\n // ## ## ## ## ## ##\n // ## ## #### ## ##\n // ## ## #### ## ##\n // ## ## ## ## ## ## ##\n // ## ## ## ## ## ##\n // ######## #### ## ########\n\n /**\n * A method triggered when the mouse is pressed over the visible area that\n * starts the dragging gesture.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @access private\n */\n startDrag ({ y, isLeftMouse, isMiddleMouse }) {\n if (!this.minimap) { return }\n if (!isLeftMouse && !isMiddleMouse) { return }\n\n const initial = {\n dragOffset: y - this.visibleArea.getBoundingClientRect().top,\n offsetTop: this.getBoundingClientRect().top\n }\n\n // TODO can we avoid adding and removing the listeners every time?\n\n const mousemoveHandler = (e) => this.drag(extractMouseEventData(e), initial)\n const dragendHandler = () => this.endDrag()\n\n const touchmoveHandler = (e) => this.drag(extractTouchEventData(e), initial)\n\n document.body.addEventListener('mousemove', mousemoveHandler, { passive: true })\n document.body.addEventListener('mouseup', dragendHandler, { passive: true })\n document.body.addEventListener('mouseleave', dragendHandler, { passive: true })\n\n document.body.addEventListener('touchmove', touchmoveHandler, { passive: true })\n document.body.addEventListener('touchend', dragendHandler, { passive: true })\n document.body.addEventListener('touchcancel', dragendHandler, { passive: true })\n\n this.dragSubscription = new Disposable(function () {\n document.body.removeEventListener('mousemove', mousemoveHandler)\n document.body.removeEventListener('mouseup', dragendHandler)\n document.body.removeEventListener('mouseleave', dragendHandler)\n\n document.body.removeEventListener('touchmove', touchmoveHandler)\n document.body.removeEventListener('touchend', dragendHandler)\n document.body.removeEventListener('touchcancel', dragendHandler)\n })\n }\n\n /**\n * The method called during the drag gesture.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @param {number} initial.dragOffset the mouse offset within the visible\n * area\n * @param {number} initial.offsetTop the MinimapElement offset at the moment\n * of the drag start\n * @access private\n */\n drag ({ y, isLeftMouse, isMiddleMouse }, initial) {\n if (!this.minimap) { return }\n if (!isLeftMouse && !isMiddleMouse) { return }\n const deltaY = y - initial.offsetTop - initial.dragOffset\n\n const ratio = deltaY / (this.minimap.getVisibleHeight() - this.minimap.getTextEditorScaledHeight())\n\n this.minimap.setTextEditorScrollTop(ratio * this.minimap.getTextEditorMaxScrollTop())\n }\n\n /**\n * The method that ends the drag gesture.\n *\n * @access private\n */\n endDrag () {\n if (!this.minimap) { return }\n this.dragSubscription.dispose()\n }\n}\n\nconst minimapElement = MinimapElement.initClass()\nexport default minimapElement\n\n// ######## ## ## ######## ## ## ######## ######\n// ## ## ## ## ### ## ## ## ##\n// ## ## ## ## #### ## ## ##\n// ###### ## ## ###### ## ## ## ## ######\n// ## ## ## ## ## #### ## ##\n// ## ## ## ## ## ### ## ## ##\n// ######## ### ######## ## ## ## ######\n\n/**\n * A method that extracts data from a `MouseEvent` which can then be used to\n * process clicks and drags of the minimap.\n *\n * Used together with `extractTouchEventData` to provide a unified interface\n * for `MouseEvent`s and `TouchEvent`s.\n *\n * @param {MouseEvent} mouseEvent the mouse event object\n * @access private\n */\nfunction extractMouseEventData (mouseEvent) {\n return {\n x: mouseEvent.pageX,\n y: mouseEvent.pageY,\n isLeftMouse: mouseEvent.button === 0,\n isMiddleMouse: mouseEvent.button === 1\n }\n}\n\n/**\n * A method that extracts data from a `TouchEvent` which can then be used to\n * process clicks and drags of the minimap.\n *\n * Used together with `extractMouseEventData` to provide a unified interface\n * for `MouseEvent`s and `TouchEvent`s.\n *\n * @param {TouchEvent} touchEvent the touch event object\n * @access private\n */\nfunction extractTouchEventData (touchEvent) {\n // Use the first touch on the target area. Other touches will be ignored in\n // case of multi-touch.\n const touch = touchEvent.changedTouches[0]\n\n return {\n x: touch.pageX,\n y: touch.pageY,\n isLeftMouse: true, // Touch is treated like a left mouse button click\n isMiddleMouse: false\n }\n}\n\n// ###### ###### ######\n// ## ## ## ## ## ##\n// ## ## ##\n// ## ###### ######\n// ## ## ##\n// ## ## ## ## ## ##\n// ###### ###### ######\n\n/**\n * Applies the passed-in styles properties to the specified element\n *\n * @param {HTMLElement} element the element onto which apply the styles\n * @param {Object} styles the styles to apply\n * @access private\n */\nfunction applyStyles (element, styles) {\n if (!element) { return }\n\n let cssText = ''\n for (const property in styles) {\n cssText += `${property}: ${styles[property]}; `\n }\n\n element.style.cssText = cssText\n}\n\n/**\n * Returns a string with a CSS translation tranform value.\n *\n * @param {number} [x = 0] the x offset of the translation\n * @param {number} [y = 0] the y offset of the translation\n * @param {boolean} [useHardwareAcceleration = false] use hardware acceleration\n * @return {string} the CSS translation string\n * @access private\n */\nfunction makeTranslate (x = 0, y = 0, useHardwareAcceleration = false) {\n if (useHardwareAcceleration) {\n return `translate3d(${x}px, ${y}px, 0)`\n } else {\n return `translate(${x}px, ${y}px)`\n }\n}\n\n/**\n * Returns a string with a CSS scaling tranform value.\n *\n * @param {number} [x = 0] the x scaling factor\n * @param {number} [y = 0] the y scaling factor\n * @param {boolean} [useHardwareAcceleration = false] use hardware acceleration\n * @return {string} the CSS scaling string\n * @access private\n */\nfunction makeScale (x = 0, y = x, useHardwareAcceleration = false) {\n if (useHardwareAcceleration) {\n return `scale3d(${x}, ${y}, 1)`\n } else {\n return `scale(${x}, ${y})`\n }\n}\n\n/**\n * A method that mimic the jQuery `animate` method and used to animate the\n * scroll when clicking on the MinimapElement canvas.\n *\n * @param {Object} param the animation data object\n * @param {[type]} param.from the start value\n * @param {[type]} param.to the end value\n * @param {[type]} param.duration the animation duration\n * @param {[type]} param.step the easing function for the animation\n * @access private\n */\nfunction animate ({ from, to, duration, step }) {\n const start = getTime()\n let progress\n\n const update = () => {\n const passed = getTime() - start\n if (duration === 0) {\n progress = 1\n } else {\n progress = passed / duration\n }\n if (progress > 1) { progress = 1 }\n const delta = swing(progress)\n const value = from + (to - from) * delta\n step(value, delta)\n\n if (progress < 1) { requestAnimationFrame(update) }\n }\n\n update()\n}\n\nfunction swing (progress) {\n return 0.5 - Math.cos(progress * Math.PI) / 2\n}\n\n/**\n * A method that return the current time as a Date.\n *\n * That method exist so that we can mock it in tests.\n *\n * @return {Date} the current time as Date\n * @access private\n */\nfunction getTime () { return new Date() }\n","'use strict'\n\nimport { CompositeDisposable } from 'atom'\nimport { emitter, getConfigSchema } from './main'\n\n/**\n * Provides methods to manage minimap plugins.\n * Minimap plugins are Atom packages that will augment the minimap.\n * They have a secondary activation cycle going on constrained by the minimap\n * package activation. A minimap plugin life cycle will generally look\n * like this:\n *\n * 1. The plugin module is activated by Atom through the `activate` method\n * 2. The plugin then register itself as a minimap plugin using `registerPlugin`\n * 3. The plugin is activated/deactivated according to the minimap settings.\n * 4. On the plugin module deactivation, the plugin must unregisters itself\n * from the minimap using the `unregisterPlugin`.\n *\n * @access public\n */\n\n// Initialize the properties for plugin management.\n\n/**\n * The registered Minimap plugins stored using their name as key.\n *\n * @type {Object}\n * @access private\n */\nexport const plugins = {}\n/**\n * The plugins' subscriptions stored using the plugin names as keys.\n *\n * @type {Object}\n * @access private\n */\nconst pluginsSubscriptions = {}\n\n/**\n * A map that stores the display order for each plugin\n *\n * @type {Object}\n * @access private\n */\nconst pluginsOrderMap = {}\n\n/**\n * Registers a minimap `plugin` with the given `name`.\n *\n * @param {string} name The identifying name of the plugin.\n * It will be used as activation settings name\n * as well as the key to unregister the module.\n * @param {MinimapPlugin} plugin The plugin to register.\n * @emits {did-add-plugin} with the name and a reference to the added plugin.\n * @emits {did-activate-plugin} if the plugin was activated during\n * the registration.\n */\nexport function registerPlugin (name, plugin) {\n plugins[name] = plugin\n pluginsSubscriptions[name] = new CompositeDisposable()\n\n const event = { name, plugin }\n emitter.emit('did-add-plugin', event)\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n registerPluginControls(name, plugin)\n }\n\n updatesPluginActivationState(name)\n}\n\n/**\n * Unregisters a plugin from the minimap.\n *\n * @param {string} name The identifying name of the plugin to unregister.\n * @emits {did-remove-plugin} with the name and a reference\n * to the added plugin.\n */\nexport function unregisterPlugin (name) {\n const plugin = plugins[name]\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n unregisterPluginControls(name)\n }\n\n delete plugins[name]\n\n const event = { name, plugin }\n emitter.emit('did-remove-plugin', event)\n}\n\n/**\n * Toggles the specified plugin activation state.\n *\n * @param {string} name The name of the plugin.\n * @param {boolean} boolean An optional boolean to set the activation\n * state of the plugin. If ommitted the new plugin\n * state will be the the inverse of its current\n * state.\n * @emits {did-activate-plugin} if the plugin was activated by the call.\n * @emits {did-deactivate-plugin} if the plugin was deactivated by the call.\n */\nexport function togglePluginActivation (name, boolean) {\n const settingsKey = `minimap.plugins.${name}`\n\n if (boolean !== undefined && boolean !== null) {\n atom.config.set(settingsKey, boolean)\n } else {\n atom.config.set(settingsKey, !atom.config.get(settingsKey))\n }\n\n updatesPluginActivationState(name)\n}\n\n/**\n * Deactivates all the plugins registered in the minimap package so far.\n *\n * @emits {did-deactivate-plugin} for each plugin deactivated by the call.\n */\nexport function deactivateAllPlugins () {\n for (const [name, plugin] of eachPlugin()) {\n plugin.deactivatePlugin()\n emitter.emit('did-deactivate-plugin', { name, plugin })\n }\n}\n\n/**\n * A generator function to iterate over registered plugins.\n *\n * @return An iterable that yield the name and reference to every plugin\n * as an array in each iteration.\n */\nfunction * eachPlugin () {\n for (const name in plugins) {\n yield [name, plugins[name]]\n }\n}\n\n/**\n * Updates the plugin activation state according to the current config.\n *\n * @param {string} name The identifying name of the plugin to update.\n * @emits {did-activate-plugin} if the plugin was activated by the call.\n * @emits {did-deactivate-plugin} if the plugin was deactivated by the call.\n * @access private\n */\nfunction updatesPluginActivationState (name) {\n const plugin = plugins[name]\n const pluginActive = plugin.isActive()\n const settingActive = atom.config.get(`minimap.plugins.${name}`)\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n if (settingActive && !pluginActive) {\n activatePlugin(name, plugin)\n } else if (pluginActive && !settingActive) {\n deactivatePlugin(name, plugin)\n }\n } else {\n if (!pluginActive) {\n activatePlugin(name, plugin)\n } else if (pluginActive) {\n deactivatePlugin(name, plugin)\n }\n }\n}\n\nexport function activatePlugin (name, plugin) {\n const event = { name, plugin }\n\n plugin.activatePlugin()\n emitter.emit('did-activate-plugin', event)\n}\n\nexport function deactivatePlugin (name, plugin) {\n const event = { name, plugin }\n\n plugin.deactivatePlugin()\n emitter.emit('did-deactivate-plugin', event)\n}\n\n/**\n * When the `minimap.displayPluginsControls` setting is toggled,\n * this function will register the commands and setting to manage the plugin\n * activation from the minimap settings.\n *\n * @param {string} name The identifying name of the plugin.\n * @param {MinimapPlugin} plugin The plugin instance to register\n * controls for.\n * @listens {minimap.plugins.${name}} listen to the setting to update\n * the plugin state accordingly.\n * @listens {minimap:toggle-${name}} listen to the command on `atom-workspace`\n * to toggle the plugin state.\n * @access private\n */\nfunction registerPluginControls (name, plugin) {\n const settingsKey = `minimap.plugins.${name}`\n const orderSettingsKey = `minimap.plugins.${name}DecorationsZIndex`\n\n const config = getConfigSchema()\n\n config.plugins.properties[name] = {\n type: 'boolean',\n title: name,\n description: `Whether the ${name} plugin is activated and displayed in the Minimap.`,\n default: true\n }\n\n config.plugins.properties[`${name}DecorationsZIndex`] = {\n type: 'integer',\n title: `${name} decorations order`,\n description: `The relative order of the ${name} plugin's decorations in the layer into which they are drawn. Note that this order only apply inside a layer, so highlight-over decorations will always be displayed above line decorations as they are rendered in different layers.`,\n default: 0\n }\n\n if (atom.config.get(settingsKey) === undefined) {\n atom.config.set(settingsKey, true)\n }\n\n if (atom.config.get(orderSettingsKey) === undefined) {\n atom.config.set(orderSettingsKey, 0)\n }\n\n pluginsSubscriptions[name].add(atom.config.observe(settingsKey, () => {\n updatesPluginActivationState(name)\n }))\n\n pluginsSubscriptions[name].add(atom.config.observe(orderSettingsKey, (order) => {\n updatePluginsOrderMap(name)\n const event = { name, plugin, order }\n emitter.emit('did-change-plugin-order', event)\n }))\n\n pluginsSubscriptions[name].add(atom.commands.add('atom-workspace', {\n [`minimap:toggle-${name}`]: () => {\n togglePluginActivation(name)\n }\n }))\n\n updatePluginsOrderMap(name)\n}\n\n/**\n * Updates the display order in the map for the passed-in plugin name.\n *\n * @param {string} name the name of the plugin to update\n * @access private\n */\nfunction updatePluginsOrderMap (name) {\n const orderSettingsKey = `minimap.plugins.${name}DecorationsZIndex`\n\n pluginsOrderMap[name] = atom.config.get(orderSettingsKey)\n}\n\n/**\n * Returns the plugins display order mapped by name.\n *\n * @return {Object} The plugins order by name\n */\nexport function getPluginsOrder () { return pluginsOrderMap }\n\n/**\n * When the `minimap.displayPluginsControls` setting is toggled,\n * this function will unregister the commands and setting that\n * was created previously.\n *\n * @param {string} name The identifying name of the plugin.\n * @access private\n */\nfunction unregisterPluginControls (name) {\n pluginsSubscriptions[name].dispose()\n delete pluginsSubscriptions[name]\n delete getConfigSchema().plugins.properties[name]\n}\n","// Functions used to recommend the configurations required for the best performance of Minimap\n\nexport function treeSitterWarning () {\n return observeAndWarn(\n 'core.useTreeSitterParsers',\n true,\n 'Tree-sitter is off (Low Performance Warning).',\n `You should turn on Atom's tree-sitter parser to experience the best performance Minimap and Atom is deisgned for.\n Keeping tree-sitter parser off results in sluggish scrolling and lags in the text editor.`\n )\n}\n\n/* Utility function that observes a config and throws warnings once a day if it is not the recommended value */\nfunction observeAndWarn (configName, recommendedValue, warningTitle, warningDescription) {\n return atom.config.observe(configName, value => {\n if (value !== recommendedValue) {\n const storageName = `Minimap.${configName}`\n const today = new Date()\n const previousWarning = window.localStorage.getItem(storageName)\n let previousWarningDay = null\n if (previousWarning) {\n previousWarningDay = (new Date(Date.parse(previousWarning))).getDay()\n }\n // throw the warning once a day\n if (!previousWarningDay ||\n (typeof previousWarningDay === 'number' && (previousWarningDay - today.getDay() >= 1))\n ) {\n window.localStorage.setItem(storageName, today)\n\n const notification = atom.notifications.addWarning(\n warningTitle, {\n description: warningDescription,\n dismissable: true,\n buttons: [\n {\n text: `Set to ${recommendedValue} and restart Atom`,\n onDidClick () {\n atom.config.set(configName, true)\n notification.dismiss()\n window.localStorage.removeItem(storageName)\n setTimeout(() => {\n atom.reload()\n }, 1500)\n }\n }\n ]\n })\n }\n }\n })\n}\n","'use strict'\n\n/**\n * This class is used by the `CanvasDrawer` in `MinimapElement` to\n * read the styles informations (color and background-color) from the DOM to use when rendering\n * the `Minimap`.\n *\n * It attaches a dummyNode to the targetNode, renders them, and finds the computed style back.\n * TODO: find a better way to get the token colors\n */\nexport default class DOMStylesReader {\n constructor () {\n /**\n * The cache object\n * @access private\n */\n this.domStylesCache = new Map()\n\n /**\n * @access private\n */\n this.dummyNode = undefined\n\n // used to check if the dummyNode is on the current targetNode\n this.targetNode = undefined\n\n /**\n * Set to true once tokenized\n * @access private\n * unused\n */\n // this.hasTokenizedOnce = false\n }\n\n /**\n * Returns the computed values for the given property and scope in the DOM.\n *\n * This function insert a dummy element in the DOM to compute\n * its style, return the specified property, and clear the content of the\n * dummy element.\n *\n * @param {Array} scopes a list of classes reprensenting the scope\n * to build\n * @param {string} property the name of the style property to compute\n * @param {Node} targetNode\n * @param {boolean} getFromCache whether to cache the computed value or not\n * @return {string} the computed property's value\n * used in CanvasDrawer\n */\n retrieveStyleFromDom (scopes, property, targetNode, getFromCache) {\n if (!scopes.length) { return '' } // no scopes\n const key = scopes.join(' ')\n let cachedData = this.domStylesCache.get(key)\n\n if (cachedData !== undefined) {\n if (getFromCache) { // if should get the value from the cache\n const value = cachedData[property]\n if (value !== undefined) {\n // value exists\n return value\n } // value not in the cache - get fresh value\n } // don't use cache - get fresh value\n } else {\n // key did not exist. create it\n cachedData = {}\n }\n\n this.ensureDummyNodeExistence(targetNode)\n\n let parent = this.dummyNode\n for (let i = 0, len = scopes.length; i < len; i++) {\n const scope = scopes[i]\n const node = document.createElement('span')\n node.className = scope.replace(dotRegexp, ' ') // TODO why replace is needed?\n parent.appendChild(node)\n parent = node\n }\n\n const style = window.getComputedStyle(parent)\n let value = style.getPropertyValue(property)\n\n // rotate hue if webkit-filter available\n const filter = style.getPropertyValue('-webkit-filter')\n if (filter.indexOf('hue-rotate') > -1) {\n value = rotateHue(value, filter)\n }\n\n if (value !== '') {\n cachedData[property] = value\n this.domStylesCache.set(key, cachedData)\n }\n\n this.dummyNode.innerHTML = ''\n return value\n }\n\n /**\n * Creates a DOM node container for all the operations that need to read\n * styles properties from DOM.\n * @param {Node} targetNode\n *\n * @access private\n */\n ensureDummyNodeExistence (targetNode) {\n if (this.targetNode !== targetNode || this.dummyNode === undefined) {\n this.dummyNode = document.createElement('span')\n this.dummyNode.style.visibility = 'hidden'\n\n // attach to the target node\n targetNode.appendChild(this.dummyNode)\n this.targetNode = targetNode\n }\n }\n\n /**\n * Invalidates the cache by emptying the cache object.\n * used in MinimapElement\n */\n invalidateDOMStylesCache () {\n this.domStylesCache.clear()\n }\n\n /**\n * Invalidates the cache only for the first tokenization event.\n *\n * @access private\n * unused\n */\n /*\n invalidateIfFirstTokenization () {\n if (this.hasTokenizedOnce) { return }\n this.invalidateDOMStylesCache()\n this.hasTokenizedOnce = true\n }\n */\n}\n\n// ## ## ######## ## ######## ######## ######## ######\n// ## ## ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ##\n// ######### ###### ## ######## ###### ######## ######\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ##\n// ## ## ######## ######## ## ######## ## ## ######\n\nconst dotRegexp = /\\.+/g\nconst rgbExtractRegexp = /rgb(a?)\\((\\d+), (\\d+), (\\d+)(, (\\d+(\\.\\d+)?))?\\)/\nconst hueRegexp = /hue-rotate\\((\\d+)deg\\)/\n\n/**\n * Computes the output color of `value` with a rotated hue defined\n * in `filter`.\n *\n * @param {string} value the CSS color to apply the rotation on\n * @param {string} filter the CSS hue rotate filter declaration\n * @return {string} the rotated CSS color\n * @access private\n */\nfunction rotateHue (value, filter) {\n const match = value.match(rgbExtractRegexp)\n let [, , r, g, b, , a] = match\n\n let [, hue] = filter.match(hueRegexp)\n\n ;[r, g, b, a, hue] = [r, g, b, a, hue].map(Number)\n ;[r, g, b] = rotate(r, g, b, hue)\n\n if (isNaN(a)) {\n return `rgb(${r}, ${g}, ${b})`\n } else {\n return `rgba(${r}, ${g}, ${b}, ${a})`\n }\n}\n\n/**\n * Computes the hue rotation on the provided `r`, `g` and `b` channels\n * by the amount of `angle`.\n *\n * @param {number} r the red channel of the color to rotate\n * @param {number} g the green channel of the color to rotate\n * @param {number} b the blue channel of the color to rotate\n * @param {number} angle the angle to rotate the hue with\n * @return {Array} the rotated color channels\n * @access private\n */\nfunction rotate (r, g, b, angle) {\n const matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]\n const lumR = 0.2126\n const lumG = 0.7152\n const lumB = 0.0722\n const hueRotateR = 0.143\n const hueRotateG = 0.140\n const hueRotateB = 0.283\n const cos = Math.cos(angle * Math.PI / 180)\n const sin = Math.sin(angle * Math.PI / 180)\n\n matrix[0] = lumR + (1 - lumR) * cos - (lumR * sin)\n matrix[1] = lumG - (lumG * cos) - (lumG * sin)\n matrix[2] = lumB - (lumB * cos) + (1 - lumB) * sin\n matrix[3] = lumR - (lumR * cos) + hueRotateR * sin\n matrix[4] = lumG + (1 - lumG) * cos + hueRotateG * sin\n matrix[5] = lumB - (lumB * cos) - (hueRotateB * sin)\n matrix[6] = lumR - (lumR * cos) - ((1 - lumR) * sin)\n matrix[7] = lumG - (lumG * cos) + lumG * sin\n matrix[8] = lumB + (1 - lumB) * cos + lumB * sin\n\n return [\n clamp(matrix[0] * r + matrix[1] * g + matrix[2] * b),\n clamp(matrix[3] * r + matrix[4] * g + matrix[5] * b),\n clamp(matrix[6] * r + matrix[7] * g + matrix[8] * b)\n ]\n\n function clamp (num) {\n return Math.ceil(Math.max(0, Math.min(255, num)))\n }\n}\n","'use strict'\n\nimport { Emitter, CompositeDisposable } from 'atom'\nimport MinimapElement from './minimap-element'\nimport Minimap from './minimap'\nimport config from './config.json'\nimport * as PluginManagement from './plugin-management'\nimport { treeSitterWarning } from './performance-monitor'\nimport DOMStylesReader from './dom-styles-reader'\n\nexport { default as config } from './config.json'\nexport * from './plugin-management'\nexport { default as Minimap } from './minimap'\n\n/**\n * The `Minimap` package provides an eagle-eye view of text buffers.\n *\n * It also provides API for plugin packages that want to interact with the\n * minimap and be available to the user through the minimap settings.\n */\n\n/**\n * The activation state of the package.\n *\n * @type {boolean}\n * @access private\n */\nlet active = false\n/**\n * The toggle state of the package.\n *\n * @type {boolean}\n * @access private\n */\nlet toggled = false\n/**\n * The `Map` where Minimap instances are stored with the text editor they\n * target as key.\n *\n * @type {Map}\n * @access private\n */\nexport let editorsMinimaps = null\n/**\n * The composite disposable that stores the package's subscriptions.\n *\n * @type {CompositeDisposable}\n * @access private\n */\nlet subscriptions = null\n/**\n * The disposable that stores the package's commands subscription.\n *\n * @type {Disposable}\n * @access private\n */\nlet subscriptionsOfCommands = null\n\n/**\n * The package's events emitter.\n *\n * @type {Emitter}\n * @access private\n */\nexport const emitter = new Emitter()\n\n/**\n DOMStylesReader cache used for storing token colors\n*/\nexport let domStylesReader = null\n\n/**\n * Activates the minimap package.\n */\nexport function activate () {\n if (active) { return }\n\n subscriptionsOfCommands = atom.commands.add('atom-workspace', {\n 'minimap:toggle': () => {\n toggle()\n },\n 'minimap:generate-coffee-plugin': async () => {\n await generatePlugin('coffee')\n },\n 'minimap:generate-javascript-plugin': async () => {\n await generatePlugin('javascript')\n },\n 'minimap:generate-babel-plugin': async () => {\n await generatePlugin('babel')\n }\n })\n\n editorsMinimaps = new Map()\n domStylesReader = new DOMStylesReader()\n\n subscriptions = new CompositeDisposable()\n active = true\n\n if (atom.config.get('minimap.autoToggle')) { toggle() }\n}\n\n/**\n * Returns a {MinimapElement} for the passed-in model if it's a {Minimap}.\n *\n * @param {Minimap} model the model for which returning a view\n * @return {MinimapElement}\n */\nexport function minimapViewProvider (model) {\n if (model instanceof Minimap) {\n const element = new MinimapElement()\n element.setModel(model)\n return element\n }\n}\n\n/**\n * Deactivates the minimap package.\n */\nexport function deactivate () {\n if (!active) { return }\n\n PluginManagement.deactivateAllPlugins()\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((value) => {\n value.destroy()\n })\n editorsMinimaps.clear()\n }\n\n subscriptions.dispose()\n subscriptions = null\n subscriptionsOfCommands.dispose()\n subscriptionsOfCommands = null\n editorsMinimaps = undefined\n domStylesReader.invalidateDOMStylesCache()\n toggled = false\n active = false\n}\n\nexport function getConfigSchema () {\n return config || atom.packages.getLoadedPackage('minimap').metadata.configSchema\n}\n\n/**\n * Toggles the minimap display.\n */\nexport function toggle () {\n if (!active) { return }\n\n if (toggled) {\n toggled = false\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((minimap) => {\n minimap.destroy()\n })\n editorsMinimaps.clear()\n }\n subscriptions.dispose()\n\n // HACK: this hack forces rerendering editor size which moves the scrollbar to the right once minimap is removed\n const wasMaximized = atom.isMaximized()\n const { width, height } = atom.getSize()\n atom.setSize(width, height)\n if (wasMaximized) {\n atom.maximize()\n }\n\n } else {\n toggled = true\n initSubscriptions()\n }\n domStylesReader.invalidateDOMStylesCache()\n}\n\n/**\n * Opens the plugin generation view.\n *\n * @param {string} template the name of the template to use\n */\nasync function generatePlugin (template) {\n const { default: MinimapPluginGeneratorElement } = await import('./minimap-plugin-generator-element')\n const view = new MinimapPluginGeneratorElement()\n view.template = template\n view.attach()\n}\n\n/**\n * Registers a callback to listen to the `did-activate` event of the package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidActivate (callback) {\n return emitter.on('did-activate', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-deactivate` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidDeactivate (callback) {\n return emitter.on('did-deactivate', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-create-minimap` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidCreateMinimap (callback) {\n return emitter.on('did-create-minimap', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-add-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidAddPlugin (callback) {\n return emitter.on('did-add-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-remove-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidRemovePlugin (callback) {\n return emitter.on('did-remove-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-activate-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidActivatePlugin (callback) {\n return emitter.on('did-activate-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-deactivate-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidDeactivatePlugin (callback) {\n return emitter.on('did-deactivate-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-change-plugin-order` event of\n * the package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidChangePluginOrder (callback) {\n return emitter.on('did-change-plugin-order', callback)\n}\n\n/**\n * Returns the `Minimap` class\n *\n * @return {Function} the `Minimap` class constructor\n */\nexport function minimapClass () {\n return Minimap\n}\n\n/**\n * Returns the `Minimap` object associated to the passed-in\n * `TextEditorElement`.\n *\n * @param {TextEditorElement} editorElement a text editor element\n * @return {Minimap} the associated minimap\n */\nexport function minimapForEditorElement (editorElement) {\n if (!editorElement) { return }\n return minimapForEditor(editorElement.getModel())\n}\n\n/**\n * Returns the `Minimap` object associated to the passed-in\n * `TextEditor`.\n *\n * @param {TextEditor} textEditor a text editor\n * @return {Minimap} the associated minimap\n */\nexport function minimapForEditor (textEditor) {\n if (!textEditor) { return }\n if (!editorsMinimaps) { return }\n\n let minimap = editorsMinimaps.get(textEditor)\n\n if (minimap === undefined || minimap.destroyed) {\n minimap = new Minimap({ textEditor })\n editorsMinimaps.set(textEditor, minimap)\n\n const editorSubscription = textEditor.onDidDestroy(() => {\n if (editorsMinimaps) { editorsMinimaps.delete(textEditor) }\n if (minimap) {\n // just in case\n minimap.destroy()\n }\n editorSubscription.dispose()\n })\n // dispose the editorSubscription if minimap is deactivated before destroying the editor\n subscriptions.add(editorSubscription)\n }\n\n return minimap\n}\n\n/**\n * Returns a new stand-alone {Minimap} for the passed-in `TextEditor`.\n *\n * @param {TextEditor} textEditor a text editor instance to create\n * a minimap for\n * @return {Minimap} a new stand-alone Minimap for the passed-in editor\n */\nexport function standAloneMinimapForEditor (textEditor) {\n if (!textEditor) { return }\n\n return new Minimap({\n textEditor,\n standAlone: true\n })\n}\n\n/**\n * Returns the `Minimap` associated to the active `TextEditor`.\n *\n * @return {Minimap} the active Minimap\n */\nexport function getActiveMinimap () {\n return minimapForEditor(atom.workspace.getActiveTextEditor())\n}\n\n/**\n * Calls a function for each present and future minimaps.\n *\n * @param {function(minimap:Minimap):void} iterator a function to call with\n * the existing and future\n * minimaps\n * @return {Disposable} a disposable to unregister the observer\n */\nexport function observeMinimaps (iterator) {\n if (!iterator) { return }\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((minimap) => { iterator(minimap) })\n }\n return onDidCreateMinimap((minimap) => { iterator(minimap) })\n}\n\n/**\n * Registers to the `observeTextEditors` method.\n *\n * @access private\n */\nfunction initSubscriptions () {\n subscriptions.add(\n atom.workspace.observeTextEditors((textEditor) => {\n const minimap = minimapForEditor(textEditor)\n const minimapElement = minimap.getMinimapElement() || minimapViewProvider(minimap)\n\n emitter.emit('did-create-minimap', minimap)\n minimapElement.attach(textEditor.getElement())\n }),\n // empty color cache if the theme changes\n atom.themes.onDidChangeActiveThemes(() => {\n domStylesReader.invalidateDOMStylesCache()\n editorsMinimaps.forEach((minimap) => { atom.views.getView(minimap).requestForcedUpdate() })\n }),\n treeSitterWarning()\n )\n}\n\n// The public exports included in the service:\nconst MinimapServiceV1 = {\n minimapViewProvider,\n getConfigSchema,\n onDidActivate,\n onDidDeactivate,\n onDidCreateMinimap,\n onDidAddPlugin,\n onDidRemovePlugin,\n onDidActivatePlugin,\n onDidDeactivatePlugin,\n onDidChangePluginOrder,\n minimapClass,\n minimapForEditorElement,\n minimapForEditor,\n standAloneMinimapForEditor,\n getActiveMinimap,\n observeMinimaps,\n registerPlugin: PluginManagement.registerPlugin,\n unregisterPlugin: PluginManagement.unregisterPlugin,\n togglePluginActivation: PluginManagement.togglePluginActivation,\n deactivateAllPlugins: PluginManagement.deactivateAllPlugins,\n activatePlugin: PluginManagement.activatePlugin,\n deactivatePlugin: PluginManagement.deactivatePlugin,\n getPluginsOrder: PluginManagement.getPluginsOrder\n}\n\n/**\n * Returns the Minimap main module instance.\n *\n * @return {Main} The Minimap main module instance.\n */\nexport function provideMinimapServiceV1 () { return MinimapServiceV1 }\n","(function() {\n var Deprecation, SourceMapCache;\n\n SourceMapCache = {};\n\n module.exports = Deprecation = (function() {\n Deprecation.getFunctionNameFromCallsite = function(callsite) {};\n\n Deprecation.deserialize = function(_arg) {\n var deprecation, fileName, lineNumber, message, stack, stacks, _i, _len;\n message = _arg.message, fileName = _arg.fileName, lineNumber = _arg.lineNumber, stacks = _arg.stacks;\n deprecation = new Deprecation(message, fileName, lineNumber);\n for (_i = 0, _len = stacks.length; _i < _len; _i++) {\n stack = stacks[_i];\n deprecation.addStack(stack, stack.metadata);\n }\n return deprecation;\n };\n\n function Deprecation(message, fileName, lineNumber) {\n this.message = message;\n this.fileName = fileName;\n this.lineNumber = lineNumber;\n this.callCount = 0;\n this.stackCount = 0;\n this.stacks = {};\n this.stackCallCounts = {};\n }\n\n Deprecation.prototype.getFunctionNameFromCallsite = function(callsite) {\n var _ref, _ref1, _ref2;\n if (callsite.functionName != null) {\n return callsite.functionName;\n }\n if (callsite.isToplevel()) {\n return (_ref = callsite.getFunctionName()) != null ? _ref : '';\n } else {\n if (callsite.isConstructor()) {\n return \"new \" + (callsite.getFunctionName());\n } else if (callsite.getMethodName() && !callsite.getFunctionName()) {\n return callsite.getMethodName();\n } else {\n return \"\" + (callsite.getTypeName()) + \".\" + ((_ref1 = (_ref2 = callsite.getMethodName()) != null ? _ref2 : callsite.getFunctionName()) != null ? _ref1 : '');\n }\n }\n };\n\n Deprecation.prototype.getLocationFromCallsite = function(callsite) {\n var column, fileName, line;\n if (callsite == null) {\n return \"unknown\";\n }\n if (callsite.location != null) {\n return callsite.location;\n }\n if (callsite.isNative()) {\n return \"native\";\n } else if (callsite.isEval()) {\n return \"eval at \" + (this.getLocationFromCallsite(callsite.getEvalOrigin()));\n } else {\n fileName = callsite.getFileName();\n line = callsite.getLineNumber();\n column = callsite.getColumnNumber();\n return \"\" + fileName + \":\" + line + \":\" + column;\n }\n };\n\n Deprecation.prototype.getFileNameFromCallSite = function(callsite) {\n var _ref;\n return (_ref = callsite.fileName) != null ? _ref : callsite.getFileName();\n };\n\n Deprecation.prototype.getOriginName = function() {\n return this.originName;\n };\n\n Deprecation.prototype.getMessage = function() {\n return this.message;\n };\n\n Deprecation.prototype.getStacks = function() {\n var location, parsedStack, parsedStacks, stack, _ref;\n parsedStacks = [];\n _ref = this.stacks;\n for (location in _ref) {\n stack = _ref[location];\n parsedStack = this.parseStack(stack);\n parsedStack.callCount = this.stackCallCounts[location];\n parsedStack.metadata = stack.metadata;\n parsedStacks.push(parsedStack);\n }\n return parsedStacks;\n };\n\n Deprecation.prototype.getStackCount = function() {\n return this.stackCount;\n };\n\n Deprecation.prototype.getCallCount = function() {\n return this.callCount;\n };\n\n Deprecation.prototype.addStack = function(stack, metadata) {\n var callerLocation, _base, _base1;\n if (this.originName == null) {\n this.originName = this.getFunctionNameFromCallsite(stack[0]);\n }\n if (this.fileName == null) {\n this.fileName = this.getFileNameFromCallSite(stack[0]);\n }\n if (this.lineNumber == null) {\n this.lineNumber = typeof (_base = stack[0]).getLineNumber === \"function\" ? _base.getLineNumber() : void 0;\n }\n this.callCount++;\n stack.metadata = metadata;\n callerLocation = this.getLocationFromCallsite(stack[1]);\n if (this.stacks[callerLocation] == null) {\n this.stacks[callerLocation] = stack;\n this.stackCount++;\n }\n if ((_base1 = this.stackCallCounts)[callerLocation] == null) {\n _base1[callerLocation] = 0;\n }\n return this.stackCallCounts[callerLocation]++;\n };\n\n Deprecation.prototype.parseStack = function(stack) {\n return stack.map((function(_this) {\n return function(callsite) {\n return {\n functionName: _this.getFunctionNameFromCallsite(callsite),\n location: _this.getLocationFromCallsite(callsite),\n fileName: _this.getFileNameFromCallSite(callsite)\n };\n };\n })(this));\n };\n\n Deprecation.prototype.serialize = function() {\n return {\n message: this.getMessage(),\n lineNumber: this.lineNumber,\n fileName: this.fileName,\n stacks: this.getStacks()\n };\n };\n\n return Deprecation;\n\n })();\n\n}).call(this);\n","\"use strict\";\n\nexports.Emitter = require(\"./emitter\");\nexports.Disposable = require(\"./disposable\");\nexports.CompositeDisposable = require(\"./composite-disposable\");","(function() {\n var Deprecation, Emitter, getRawStack, grim;\n\n Deprecation = require('./deprecation');\n\n if (global.__grim__ == null) {\n Emitter = require('event-kit').Emitter;\n grim = global.__grim__ = {\n deprecations: {},\n emitter: new Emitter,\n includeDeprecatedAPIs: true,\n getDeprecations: function() {\n var deprecation, deprecations, deprecationsByLineNumber, deprecationsByPackage, fileName, lineNumber, packageName, _ref;\n deprecations = [];\n _ref = grim.deprecations;\n for (fileName in _ref) {\n deprecationsByLineNumber = _ref[fileName];\n for (lineNumber in deprecationsByLineNumber) {\n deprecationsByPackage = deprecationsByLineNumber[lineNumber];\n for (packageName in deprecationsByPackage) {\n deprecation = deprecationsByPackage[packageName];\n deprecations.push(deprecation);\n }\n }\n }\n return deprecations;\n },\n getDeprecationsLength: function() {\n return this.getDeprecations().length;\n },\n clearDeprecations: function() {\n grim.deprecations = {};\n },\n logDeprecations: function() {\n var deprecation, deprecations, _i, _len;\n deprecations = this.getDeprecations();\n deprecations.sort(function(a, b) {\n return b.getCallCount() - a.getCallCount();\n });\n console.warn(\"\\nCalls to deprecated functions\\n-----------------------------\");\n for (_i = 0, _len = deprecations.length; _i < _len; _i++) {\n deprecation = deprecations[_i];\n console.warn(\"(\" + (deprecation.getCallCount()) + \") \" + (deprecation.getOriginName()) + \" : \" + (deprecation.getMessage()), deprecation);\n }\n },\n deprecate: function(message, metadata) {\n var deprecation, deprecationSite, error, fileName, lineNumber, originalStackTraceLimit, packageName, stack, _base, _base1, _base2, _ref, _ref1;\n originalStackTraceLimit = Error.stackTraceLimit;\n try {\n Error.stackTraceLimit = 7;\n error = new Error;\n stack = (_ref = typeof error.getRawStack === \"function\" ? error.getRawStack() : void 0) != null ? _ref : getRawStack(error);\n stack = stack.slice(1);\n } finally {\n Error.stackTraceLimit = originalStackTraceLimit;\n }\n deprecationSite = stack[0];\n fileName = deprecationSite.getFileName();\n lineNumber = deprecationSite.getLineNumber();\n packageName = (_ref1 = metadata != null ? metadata.packageName : void 0) != null ? _ref1 : \"\";\n if ((_base = grim.deprecations)[fileName] == null) {\n _base[fileName] = {};\n }\n if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {\n _base1[lineNumber] = {};\n }\n if ((_base2 = grim.deprecations[fileName][lineNumber])[packageName] == null) {\n _base2[packageName] = new Deprecation(message);\n }\n deprecation = grim.deprecations[fileName][lineNumber][packageName];\n deprecation.addStack(stack, metadata);\n grim.emitter.emit(\"updated\", deprecation);\n },\n addSerializedDeprecation: function(serializedDeprecation) {\n var deprecation, fileName, lineNumber, message, packageName, stack, stacks, _base, _base1, _base2, _i, _len, _ref, _ref1, _ref2;\n deprecation = Deprecation.deserialize(serializedDeprecation);\n message = deprecation.getMessage();\n fileName = deprecation.fileName, lineNumber = deprecation.lineNumber;\n stacks = deprecation.getStacks();\n packageName = (_ref = (_ref1 = stacks[0]) != null ? (_ref2 = _ref1.metadata) != null ? _ref2.packageName : void 0 : void 0) != null ? _ref : \"\";\n if ((_base = grim.deprecations)[fileName] == null) {\n _base[fileName] = {};\n }\n if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {\n _base1[lineNumber] = {};\n }\n if ((_base2 = grim.deprecations[fileName][lineNumber])[packageName] == null) {\n _base2[packageName] = new Deprecation(message, fileName, lineNumber);\n }\n deprecation = grim.deprecations[fileName][lineNumber][packageName];\n for (_i = 0, _len = stacks.length; _i < _len; _i++) {\n stack = stacks[_i];\n deprecation.addStack(stack, stack.metadata);\n }\n grim.emitter.emit(\"updated\", deprecation);\n },\n on: function(eventName, callback) {\n return grim.emitter.on(eventName, callback);\n }\n };\n }\n\n getRawStack = function(error) {\n var originalPrepareStackTrace, result;\n originalPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = function(error, stack) {\n return stack;\n };\n Error.captureStackTrace(error, getRawStack);\n result = error.stack;\n Error.prepareStackTrace = originalPrepareStackTrace;\n return result;\n };\n\n module.exports = global.__grim__;\n\n}).call(this);\n","{deprecate} = require 'grim'\n\nif global.__CUSTOM_HTML_ELEMENTS_CLASSES__?\n global.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__ = global.__CUSTOM_HTML_ELEMENTS_CLASSES__\n delete global.__CUSTOM_HTML_ELEMENTS_CLASSES__\nelse\n global.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__ ?= {}\n\ncallbackProperties = [\n 'createdCallback'\n 'attachedCallback'\n 'detachedCallback'\n 'attributeChangedCallback'\n]\n\ndecorateElementPrototype = (target, source) ->\n callbackProperties.forEach (k) ->\n Object.defineProperty target, k, {\n value: -> @[\"__#{k}\"]?.apply(this, arguments)\n writable: true\n enumerable: true\n configurable: true\n }\n\n Object.getOwnPropertyNames(source).forEach (k) ->\n return if k in ['constructor']\n\n descriptor = Object.getOwnPropertyDescriptor(source, k)\n if callbackProperties.indexOf(k) > -1\n Object.defineProperty(target, \"__#{k}\", descriptor)\n else\n Object.defineProperty(target, k, descriptor)\n\ndecorateElementClass = (target, source) ->\n Object.getOwnPropertyNames(source).forEach (k) ->\n return if k in ['length', 'name', 'arguments', 'caller', 'prototype']\n\n descriptor = Object.getOwnPropertyDescriptor(source, k)\n Object.defineProperty(target, k, descriptor)\n\nmodule.exports = (nodeName, options) ->\n {class: klass} = options\n if klass?\n proto = klass.prototype\n else\n proto = options.prototype ? options\n\n if proto is options\n deprecate('Using the prototype as the second argument is deprecated, use the prototype option instead')\n\n\n if __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName]\n elementClass = __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName]\n\n decorateElementPrototype(elementClass.prototype, proto)\n decorateElementClass(elementClass, klass) if klass?\n\n elementClass\n else\n elementPrototype = Object.create(HTMLElement.prototype)\n decorateElementPrototype(elementPrototype, proto)\n\n elementClass = document.registerElement nodeName, prototype: Object.create(elementPrototype)\n\n decorateElementClass(elementClass, klass) if klass?\n\n __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName] = elementClass\n","(function() {\n var ExcludedClassProperties, ExcludedPrototypeProperties, Mixin, name;\n\n module.exports = Mixin = (function() {\n Mixin.includeInto = function(constructor) {\n var name, value, _ref;\n this.extend(constructor.prototype);\n for (name in this) {\n value = this[name];\n if (ExcludedClassProperties.indexOf(name) === -1) {\n if (!constructor.hasOwnProperty(name)) {\n constructor[name] = value;\n }\n }\n }\n return (_ref = this.included) != null ? _ref.call(constructor) : void 0;\n };\n\n Mixin.extend = function(object) {\n var name, _i, _len, _ref, _ref1;\n _ref = Object.getOwnPropertyNames(this.prototype);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n name = _ref[_i];\n if (ExcludedPrototypeProperties.indexOf(name) === -1) {\n if (!object.hasOwnProperty(name)) {\n object[name] = this.prototype[name];\n }\n }\n }\n return (_ref1 = this.prototype.extended) != null ? _ref1.call(object) : void 0;\n };\n\n function Mixin() {\n if (typeof this.extended === \"function\") {\n this.extended();\n }\n }\n\n return Mixin;\n\n })();\n\n ExcludedClassProperties = ['__super__'];\n\n for (name in Mixin) {\n ExcludedClassProperties.push(name);\n }\n\n ExcludedPrototypeProperties = ['constructor', 'extended'];\n\n}).call(this);\n","Mixin = require 'mixto'\n\n# Public\nmodule.exports =\nclass Ancestors extends Mixin\n\n ### Public ###\n\n @parents: (node, selector='*') ->\n parents = []\n @eachParent node, (parent) -> parents.push(parent) if parent.matches?(selector)\n parents\n\n @eachParent: (node, block) ->\n parent = node.parentNode\n\n block(parent) if parent?\n while parent = parent.parentNode\n block(parent) if parent?\n\n parents: (selector='*') -> Ancestors.parents(this, selector)\n\n queryParentSelectorAll: (selector) ->\n unless selector?\n throw new Error '::queryParentSelectorAll requires a valid selector as argument'\n @parents(selector)\n\n queryParentSelector: (selector) ->\n unless selector?\n throw new Error '::queryParentSelector requires a valid selector as argument'\n @queryParentSelectorAll(selector)[0]\n\n eachParent: (block) -> Ancestors.eachParent(this, block)\n","Mixin = require 'mixto'\n{Disposable} = require 'atom'\n\nmodule.exports =\nclass DisposableEvents extends Mixin\n addDisposableEventListener: (object, event, listener, options) ->\n object.addEventListener event, listener, options\n new Disposable -> object.removeEventListener event, listener\n","Mixin = require 'mixto'\nDisposableEvents = require './disposable-events'\n{Disposable, CompositeDisposable} = require 'atom'\neachPair = (object, callback) -> callback(k,v) for k,v of object\n\nNO_SELECTOR = '__NONE__'\n\nmodule.exports =\nclass EventsDelegation extends Mixin\n DisposableEvents.includeInto(this)\n\n subscribeTo: (object, selector, events, options) ->\n unless object instanceof HTMLElement\n [object, selector, events, options] = [this, object, selector, events]\n\n [events, selector, options] = [selector, NO_SELECTOR, events] if typeof selector is 'object'\n\n @eventsMap ?= new WeakMap\n @disposablesMap ?= new WeakMap\n @eventsMap.set(object, {}) unless @eventsMap.get(object)?\n @disposablesMap.set(object, {}) unless @disposablesMap.get(object)?\n\n eventsForObject = @eventsMap.get(object)\n disposablesForObject = @disposablesMap.get(object)\n\n eachPair events, (event, callback) =>\n unless eventsForObject[event]?\n eventsForObject[event] = {}\n disposablesForObject[event] = @createEventListener(object, event, options)\n\n eventsForObject[event][selector] = callback\n\n new Disposable => @unsubscribeFrom object, selector, events\n\n unsubscribeFrom: (object, selector, events) ->\n unless object instanceof HTMLElement\n [object, selector, events] = [this, object, selector]\n\n [events, selector] = [selector, NO_SELECTOR] if typeof selector is 'object'\n\n return unless eventsForObject = @eventsMap.get(object)\n\n for event of events\n delete eventsForObject[event][selector]\n\n if Object.keys(eventsForObject[event]).length is 0\n disposablesForObject = @disposablesMap.get(object)\n disposablesForObject[event].dispose()\n delete disposablesForObject[event]\n delete eventsForObject[event]\n\n if Object.keys(eventsForObject).length is 0\n @eventsMap.delete(object)\n @disposablesMap.delete(object)\n\n createEventListener: (object, event, options) ->\n listener = (e) =>\n return unless eventsForObject = @eventsMap.get(object)?[event]\n\n {target} = e\n @decorateEvent(e)\n\n @eachSelectorFromTarget(e, target, eventsForObject)\n eventsForObject[NO_SELECTOR]?(e) unless e.isPropagationStopped\n return true\n\n @addDisposableEventListener object, event, listener, options\n\n eachSelectorFromTarget: (event, target, eventsForObject) ->\n @nodeAndItsAncestors target, (node) =>\n return if event.isPropagationStopped\n @eachSelector eventsForObject, (selector,callback) =>\n matched = @targetMatch(node, selector)\n return if event.isImmediatePropagationStopped or not matched\n callback(event)\n\n eachSelector: (eventsForObject, callback) ->\n keys = Object.keys(eventsForObject)\n if keys.indexOf(NO_SELECTOR) isnt - 1\n keys.splice(keys.indexOf(NO_SELECTOR), 1)\n keys.sort (a,b) -> b.split(' ').length - a.split(' ').length\n\n for key in keys\n return true if callback(key, eventsForObject[key])\n return false\n\n targetMatch: (target, selector) ->\n return true if target.matches(selector)\n\n parent = target.parentNode\n while parent? and parent.matches?\n return true if parent.matches(selector)\n parent = parent.parentNode\n\n false\n\n nodeAndItsAncestors: (node, callback) ->\n parent = node.parentNode\n\n callback(node)\n while parent? and parent.matches?\n callback(parent)\n parent = parent.parentNode\n\n decorateEvent: (e) ->\n overriddenStop = Event::stopPropagation\n e.stopPropagation = ->\n @isPropagationStopped = true\n overriddenStop.apply(this, arguments)\n\n overriddenStopImmediate = Event::stopImmediatePropagation\n e.stopImmediatePropagation = ->\n @isImmediatePropagationStopped = true\n overriddenStopImmediate.apply(this, arguments)\n","Mixin = require 'mixto'\n\nTags =\n 'a abbr address article aside audio b bdi bdo blockquote body button canvas\n caption cite code colgroup datalist dd del details dfn dialog div dl dt em\n fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header html i\n iframe ins kbd label legend li main map mark menu meter nav noscript object\n ol optgroup option output p pre progress q rp rt ruby s samp script section\n select small span strong style sub summary sup table tbody td textarea tfoot\n th thead time title tr u ul var video area base br col command embed hr img\n input keygen link meta param source track wbr'.split /\\s+/\n\nSelfClosingTags = {}\n'area base br col command embed hr img input keygen link meta param\n source track wbr'.split(/\\s+/).forEach (tag) -> SelfClosingTags[tag] = true\n\nEvents =\n 'blur change click dblclick error focus input keydown\n keypress keyup load mousedown mousemove mouseout mouseover\n mouseup resize scroll select submit unload'.split /\\s+/\n\nclass BabelSpacePenDSL extends Mixin\n buildContent: ->\n SpacePenDSL.buildContent(this, @constructor.content) if @constructor.content?\n\nmodule.exports =\nclass SpacePenDSL extends Mixin\n @Babel: BabelSpacePenDSL\n\n @includeInto: (klass) ->\n super(klass)\n\n Object.defineProperty klass, 'content',\n enumerable: false\n get: -> @prototype.__content__\n set: (value) -> @prototype.__content__ = value\n\n Object.defineProperty klass::, 'createdCallback',\n enumerable: true\n get: -> @__create__\n set: (value) -> @__createdCallback__ = value\n\n Object.defineProperty klass::, '__create__',\n enumerable: true\n value: ->\n SpacePenDSL.buildContent(this, @__content__) if @__content__?\n\n do @__createdCallback__ if @__createdCallback__?\n\n klass.useShadowRoot = ->\n klass::__useShadowRoot__ = true\n\n @buildContent: (element, content) ->\n template = new Template\n\n content.call(template)\n\n [html] = template.buildHtml()\n root =\n if element.__useShadowRoot__\n root = element.shadowRoot = element.createShadowRoot()\n else\n root = element\n root.innerHTML = html\n\n @wireOutlets(element, root)\n\n @wireOutlets: (view, root) ->\n for element in root.querySelectorAll('[outlet]')\n outlet = element.getAttribute('outlet')\n view[outlet] = element\n element.removeAttribute('outlet')\n\n undefined\n\nclass Template\n constructor: -> @currentBuilder = new Builder\n\n Tags.forEach (tagName) ->\n Template::[tagName] = (args...) -> @currentBuilder.tag(tagName, args...)\n\n subview: (name, view) -> @currentBuilder.subview(name, view)\n\n text: (string) -> @currentBuilder.text(string)\n\n tag: (tagName, args...) -> @currentBuilder.tag(tagName, args...)\n\n raw: (string) -> @currentBuilder.raw(string)\n\n buildHtml: -> @currentBuilder.buildHtml()\n\nclass Builder\n constructor: ->\n @document = []\n @postProcessingSteps = []\n\n buildHtml: ->\n [@document.join(''), @postProcessingSteps]\n\n tag: (name, args...) ->\n options = @extractOptions(args)\n\n @openTag(name, options.attributes)\n\n if SelfClosingTags.hasOwnProperty(name)\n if options.text? or options.content?\n throw new Error(\"Self-closing tag #{name} cannot have text or content\")\n else\n options.content?()\n @text(options.text) if options.text\n @closeTag(name)\n\n openTag: (name, attributes) ->\n if @document.length is 0\n attributes ?= {}\n\n attributePairs =\n for attributeName, value of attributes\n \"#{attributeName}=\\\"#{value}\\\"\"\n\n attributesString =\n if attributePairs.length\n \" \" + attributePairs.join(\" \")\n else\n \"\"\n\n @document.push \"<#{name}#{attributesString}>\"\n\n closeTag: (name) ->\n @document.push \"\"\n\n text: (string) ->\n escapedString = string\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>')\n\n @document.push escapedString\n\n raw: (string) ->\n @document.push string\n\n subview: (outletName, subview) ->\n subviewId = \"subview-#{++idCounter}\"\n @tag 'div', id: subviewId\n @postProcessingSteps.push (view) ->\n view[outletName] = subview\n subview.parentView = view\n view.find(\"div##{subviewId}\").replaceWith(subview)\n\n extractOptions: (args) ->\n options = {}\n for arg in args\n switch typeof(arg)\n when 'function'\n options.content = arg\n when 'string', 'number'\n options.text = arg.toString()\n else\n options.attributes = arg\n options\n","\nmodule.exports =\n requirePackages: (packages...) ->\n new Promise (resolve, reject) ->\n required = []\n failures = []\n remains = packages.length\n\n solved = ->\n remains--\n return unless remains is 0\n return reject(failures) if failures.length > 0\n resolve(required)\n\n packages.forEach (pkg, i) ->\n failHandler = (reason) ->\n failures[i] = reason\n solved()\n\n promise = atom.packages.activatePackage(pkg)\n .then (activatedPackage) ->\n required[i] = activatedPackage.mainModule\n solved()\n\n if promise.fail?\n promise.fail(failHandler)\n else if promise.catch?\n promise.catch(failHandler)\n\n registerOrUpdateElement: require './register-or-update-element'\n Ancestors: require './mixins/ancestors'\n AncestorsMethods: require './mixins/ancestors'\n DisposableEvents: require './mixins/disposable-events'\n EventsDelegation: require './mixins/events-delegation'\n SpacePenDSL: require './mixins/space-pen-dsl'\n","\"use strict\";\n\nvar utils = module.exports = {};\n\n/**\n * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.\n * @public\n * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.\n * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.\n * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.\n */\nutils.forEach = function(collection, callback) {\n for(var i = 0; i < collection.length; i++) {\n var result = callback(collection[i]);\n if(result) {\n return result;\n }\n }\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var getState = options.stateHandler.getState;\n\n /**\n * Tells if the element has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is detectable or not.\n */\n function isDetectable(element) {\n var state = getState(element);\n return state && !!state.isDetectable;\n }\n\n /**\n * Marks the element that it has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to mark.\n */\n function markAsDetectable(element) {\n getState(element).isDetectable = true;\n }\n\n /**\n * Tells if the element is busy or not.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is busy or not.\n */\n function isBusy(element) {\n return !!getState(element).busy;\n }\n\n /**\n * Marks the object is busy and should not be made detectable.\n * @public\n * @param {element} element The element to mark.\n * @param {boolean} busy If the element is busy or not.\n */\n function markBusy(element, busy) {\n getState(element).busy = !!busy;\n }\n\n return {\n isDetectable: isDetectable,\n markAsDetectable: markAsDetectable,\n isBusy: isBusy,\n markBusy: markBusy\n };\n};\n","\"use strict\";\n\nmodule.exports = function(idHandler) {\n var eventListeners = {};\n\n /**\n * Gets all listeners for the given element.\n * @public\n * @param {element} element The element to get all listeners for.\n * @returns All listeners for the given element.\n */\n function getListeners(element) {\n var id = idHandler.get(element);\n\n if (id === undefined) {\n return [];\n }\n\n return eventListeners[id] || [];\n }\n\n /**\n * Stores the given listener for the given element. Will not actually add the listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The callback that the element has added.\n */\n function addListener(element, listener) {\n var id = idHandler.get(element);\n\n if(!eventListeners[id]) {\n eventListeners[id] = [];\n }\n\n eventListeners[id].push(listener);\n }\n\n function removeListener(element, listener) {\n var listeners = getListeners(element);\n for (var i = 0, len = listeners.length; i < len; ++i) {\n if (listeners[i] === listener) {\n listeners.splice(i, 1);\n break;\n }\n }\n }\n\n function removeAllListeners(element) {\n var listeners = getListeners(element);\n if (!listeners) { return; }\n listeners.length = 0;\n }\n\n return {\n get: getListeners,\n add: addListener,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners\n };\n};\n","\"use strict\";\n\nmodule.exports = function() {\n var idCount = 1;\n\n /**\n * Generates a new unique id in the context.\n * @public\n * @returns {number} A unique id in the context.\n */\n function generate() {\n return idCount++;\n }\n\n return {\n generate: generate\n };\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var idGenerator = options.idGenerator;\n var getState = options.stateHandler.getState;\n\n /**\n * Gets the resize detector id of the element.\n * @public\n * @param {element} element The target element to get the id of.\n * @returns {string|number|null} The id of the element. Null if it has no id.\n */\n function getId(element) {\n var state = getState(element);\n\n if (state && state.id !== undefined) {\n return state.id;\n }\n\n return null;\n }\n\n /**\n * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.\n * @public\n * @param {element} element The target element to set the id of.\n * @returns {string|number|null} The id of the element.\n */\n function setId(element) {\n var state = getState(element);\n\n if (!state) {\n throw new Error(\"setId required the element to have a resize detection state.\");\n }\n\n var id = idGenerator.generate();\n\n state.id = id;\n\n return id;\n }\n\n return {\n get: getId,\n set: setId\n };\n};\n","\"use strict\";\n\n/* global console: false */\n\n/**\n * Reporter that handles the reporting of logs, warnings and errors.\n * @public\n * @param {boolean} quiet Tells if the reporter should be quiet or not.\n */\nmodule.exports = function(quiet) {\n function noop() {\n //Does nothing.\n }\n\n var reporter = {\n log: noop,\n warn: noop,\n error: noop\n };\n\n if(!quiet && window.console) {\n var attachFunction = function(reporter, name) {\n //The proxy is needed to be able to call the method with the console context,\n //since we cannot use bind.\n reporter[name] = function reporterProxy() {\n var f = console[name];\n if (f.apply) { //IE9 does not support console.log.apply :)\n f.apply(console, arguments);\n } else {\n for (var i = 0; i < arguments.length; i++) {\n f(arguments[i]);\n }\n }\n };\n };\n\n attachFunction(reporter, \"log\");\n attachFunction(reporter, \"warn\");\n attachFunction(reporter, \"error\");\n }\n\n return reporter;\n};","\"use strict\";\n\nvar detector = module.exports = {};\n\ndetector.isIE = function(version) {\n function isAnyIeVersion() {\n var agent = navigator.userAgent.toLowerCase();\n return agent.indexOf(\"msie\") !== -1 || agent.indexOf(\"trident\") !== -1 || agent.indexOf(\" edge/\") !== -1;\n }\n\n if(!isAnyIeVersion()) {\n return false;\n }\n\n if(!version) {\n return true;\n }\n\n //Shamelessly stolen from https://gist.github.com/padolsey/527683\n var ieVersion = (function(){\n var undef,\n v = 3,\n div = document.createElement(\"div\"),\n all = div.getElementsByTagName(\"i\");\n\n do {\n div.innerHTML = \"\";\n }\n while (all[0]);\n\n return v > 4 ? v : undef;\n }());\n\n return version === ieVersion;\n};\n\ndetector.isLegacyOpera = function() {\n return !!window.opera;\n};\n","\"use strict\";\n\nvar utils = module.exports = {};\n\nutils.getOption = getOption;\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","/**\n * Resize detection strategy that injects objects to elements in order to detect resize events.\n * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/\n */\n\n\"use strict\";\n\nvar browserDetector = require(\"../browser-detector\");\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n\n if(!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n function listenerProxy() {\n listener(element);\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support object, but supports the resize event directly on elements.\n getState(element).object = {\n proxy: listenerProxy\n };\n element.attachEvent(\"onresize\", listenerProxy);\n } else {\n var object = getObject(element);\n\n if(!object) {\n throw new Error(\"Element is not detectable by this strategy.\");\n }\n\n object.contentDocument.defaultView.addEventListener(\"resize\", listenerProxy);\n }\n }\n\n function buildCssTextString(rules) {\n var seperator = options.important ? \" !important; \" : \"; \";\n\n return (rules.join(seperator) + seperator).trim();\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n var debug = options.debug;\n\n function injectObject(element, callback) {\n var OBJECT_STYLE = buildCssTextString([\"display: block\", \"position: absolute\", \"top: 0\", \"left: 0\", \"width: 100%\", \"height: 100%\", \"border: none\", \"padding: 0\", \"margin: 0\", \"opacity: 0\", \"z-index: -1000\", \"pointer-events: none\"]);\n\n //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.\n\n // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.\n var positionCheckPerformed = false;\n\n // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.\n // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.\n var style = window.getComputedStyle(element);\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n getState(element).startSize = {\n width: width,\n height: height\n };\n\n function mutateDom() {\n function alterPositionStyles() {\n if(style.position === \"static\") {\n element.style.setProperty(\"position\", \"relative\", options.important ? \"important\" : \"\");\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style.setProperty(property, \"0\", options.important ? \"important\" : \"\");\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function onObjectLoad() {\n // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.\n if (!positionCheckPerformed) {\n alterPositionStyles();\n }\n\n /*jshint validthis: true */\n\n function getDocument(element, callback) {\n //Opera 12 seem to call the object.onload before the actual document has been created.\n //So if it is not present, poll it with an timeout until it is present.\n //TODO: Could maybe be handled better with object.onreadystatechange or similar.\n if(!element.contentDocument) {\n var state = getState(element);\n if (state.checkForObjectDocumentTimeoutId) {\n window.clearTimeout(state.checkForObjectDocumentTimeoutId);\n }\n state.checkForObjectDocumentTimeoutId = setTimeout(function checkForObjectDocument() {\n state.checkForObjectDocumentTimeoutId = 0;\n getDocument(element, callback);\n }, 100);\n\n return;\n }\n\n callback(element.contentDocument);\n }\n\n //Mutating the object element here seems to fire another load event.\n //Mutating the inner document of the object element is fine though.\n var objectElement = this;\n\n //Create the style element to be added to the object.\n getDocument(objectElement, function onObjectDocumentReady(objectDocument) {\n //Notify that the element is ready to be listened to.\n callback(element);\n });\n }\n\n // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.\n // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.\n if (style.position !== \"\") {\n alterPositionStyles(style);\n positionCheckPerformed = true;\n }\n\n //Add an object element as a child to the target element that will be listened to for resize events.\n var object = document.createElement(\"object\");\n object.style.cssText = OBJECT_STYLE;\n object.tabIndex = -1;\n object.type = \"text/html\";\n object.setAttribute(\"aria-hidden\", \"true\");\n object.onload = onObjectLoad;\n\n //Safari: This must occur before adding the object to the DOM.\n //IE: Does not like that this happens before, even if it is also added after.\n if(!browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n\n if (!getState(element)) {\n // The element has been uninstalled before the actual loading happened.\n return;\n }\n\n element.appendChild(object);\n getState(element).object = object;\n\n //IE: This must occur after adding the object to the DOM.\n if(browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n }\n\n if(batchProcessor) {\n batchProcessor.add(mutateDom);\n } else {\n mutateDom();\n }\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support objects properly. Luckily they do support the resize event.\n //So do not inject the object and notify that the element is already ready to be listened to.\n //The event handler for the resize event is attached in the utils.addListener instead.\n callback(element);\n } else {\n injectObject(element, callback);\n }\n }\n\n /**\n * Returns the child object of the target element.\n * @private\n * @param {element} element The target element.\n * @returns The object element of the target.\n */\n function getObject(element) {\n return getState(element).object;\n }\n\n function uninstall(element) {\n if (!getState(element)) {\n return;\n }\n\n var object = getObject(element);\n\n if (!object) {\n return;\n }\n\n if (browserDetector.isIE(8)) {\n element.detachEvent(\"onresize\", object.proxy);\n } else {\n element.removeChild(object);\n }\n\n if (getState(element).checkForObjectDocumentTimeoutId) {\n window.clearTimeout(getState(element).checkForObjectDocumentTimeoutId);\n }\n\n delete getState(element).object;\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall\n };\n};\n","/**\n * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.\n * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js\n */\n\n\"use strict\";\n\nvar forEach = require(\"../collection-utils\").forEach;\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n var hasState = options.stateHandler.hasState;\n var idHandler = options.idHandler;\n\n if (!batchProcessor) {\n throw new Error(\"Missing required dependency: batchProcessor\");\n }\n\n if (!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n //TODO: Could this perhaps be done at installation time?\n var scrollbarSizes = getScrollbarSizes();\n\n var styleId = \"erd_scroll_detection_scrollbar_style\";\n var detectionContainerClass = \"erd_scroll_detection_container\";\n\n function initDocument(targetDocument) {\n // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.\n // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).\n injectScrollStyle(targetDocument, styleId, detectionContainerClass);\n }\n\n initDocument(window.document);\n\n function buildCssTextString(rules) {\n var seperator = options.important ? \" !important; \" : \"; \";\n\n return (rules.join(seperator) + seperator).trim();\n }\n\n function getScrollbarSizes() {\n var width = 500;\n var height = 500;\n\n var child = document.createElement(\"div\");\n child.style.cssText = buildCssTextString([\"position: absolute\", \"width: \" + width*2 + \"px\", \"height: \" + height*2 + \"px\", \"visibility: hidden\", \"margin: 0\", \"padding: 0\"]);\n\n var container = document.createElement(\"div\");\n container.style.cssText = buildCssTextString([\"position: absolute\", \"width: \" + width + \"px\", \"height: \" + height + \"px\", \"overflow: scroll\", \"visibility: none\", \"top: \" + -width*3 + \"px\", \"left: \" + -height*3 + \"px\", \"visibility: hidden\", \"margin: 0\", \"padding: 0\"]);\n\n container.appendChild(child);\n\n document.body.insertBefore(container, document.body.firstChild);\n\n var widthSize = width - container.clientWidth;\n var heightSize = height - container.clientHeight;\n\n document.body.removeChild(container);\n\n return {\n width: widthSize,\n height: heightSize\n };\n }\n\n function injectScrollStyle(targetDocument, styleId, containerClass) {\n function injectStyle(style, method) {\n method = method || function (element) {\n targetDocument.head.appendChild(element);\n };\n\n var styleElement = targetDocument.createElement(\"style\");\n styleElement.innerHTML = style;\n styleElement.id = styleId;\n method(styleElement);\n return styleElement;\n }\n\n if (!targetDocument.getElementById(styleId)) {\n var containerAnimationClass = containerClass + \"_animation\";\n var containerAnimationActiveClass = containerClass + \"_animation_active\";\n var style = \"/* Created by the element-resize-detector library. */\\n\";\n style += \".\" + containerClass + \" > div::-webkit-scrollbar { \" + buildCssTextString([\"display: none\"]) + \" }\\n\\n\";\n style += \".\" + containerAnimationActiveClass + \" { \" + buildCssTextString([\"-webkit-animation-duration: 0.1s\", \"animation-duration: 0.1s\", \"-webkit-animation-name: \" + containerAnimationClass, \"animation-name: \" + containerAnimationClass]) + \" }\\n\";\n style += \"@-webkit-keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\\n\";\n style += \"@keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\";\n injectStyle(style);\n }\n }\n\n function addAnimationClass(element) {\n element.className += \" \" + detectionContainerClass + \"_animation_active\";\n }\n\n function addEvent(el, name, cb) {\n if (el.addEventListener) {\n el.addEventListener(name, cb);\n } else if(el.attachEvent) {\n el.attachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to add event listeners.\");\n }\n }\n\n function removeEvent(el, name, cb) {\n if (el.removeEventListener) {\n el.removeEventListener(name, cb);\n } else if(el.detachEvent) {\n el.detachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to remove event listeners.\");\n }\n }\n\n function getExpandElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[0];\n }\n\n function getShrinkElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[1];\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n var listeners = getState(element).listeners;\n\n if (!listeners.push) {\n throw new Error(\"Cannot add listener to an element that is not detectable.\");\n }\n\n getState(element).listeners.push(listener);\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n\n function debug() {\n if (options.debug) {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(idHandler.get(element), \"Scroll: \");\n if (reporter.log.apply) {\n reporter.log.apply(null, args);\n } else {\n for (var i = 0; i < args.length; i++) {\n reporter.log(args[i]);\n }\n }\n }\n }\n\n function isDetached(element) {\n function isInDocument(element) {\n return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);\n }\n\n if (!isInDocument(element)) {\n return true;\n }\n\n // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520\n if (window.getComputedStyle(element) === null) {\n return true;\n }\n\n return false;\n }\n\n function isUnrendered(element) {\n // Check the absolute positioned container since the top level container is display: inline.\n var container = getState(element).container.childNodes[0];\n var style = window.getComputedStyle(container);\n return !style.width || style.width.indexOf(\"px\") === -1; //Can only compute pixel value when rendered.\n }\n\n function getStyle() {\n // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,\n // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).\n var elementStyle = window.getComputedStyle(element);\n var style = {};\n style.position = elementStyle.position;\n style.width = element.offsetWidth;\n style.height = element.offsetHeight;\n style.top = elementStyle.top;\n style.right = elementStyle.right;\n style.bottom = elementStyle.bottom;\n style.left = elementStyle.left;\n style.widthCSS = elementStyle.width;\n style.heightCSS = elementStyle.height;\n return style;\n }\n\n function storeStartSize() {\n var style = getStyle();\n getState(element).startSize = {\n width: style.width,\n height: style.height\n };\n debug(\"Element start size\", getState(element).startSize);\n }\n\n function initListeners() {\n getState(element).listeners = [];\n }\n\n function storeStyle() {\n debug(\"storeStyle invoked.\");\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getStyle();\n getState(element).style = style;\n }\n\n function storeCurrentSize(element, width, height) {\n getState(element).lastWidth = width;\n getState(element).lastHeight = height;\n }\n\n function getExpandChildElement(element) {\n return getExpandElement(element).childNodes[0];\n }\n\n function getWidthOffset() {\n return 2 * scrollbarSizes.width + 1;\n }\n\n function getHeightOffset() {\n return 2 * scrollbarSizes.height + 1;\n }\n\n function getExpandWidth(width) {\n return width + 10 + getWidthOffset();\n }\n\n function getExpandHeight(height) {\n return height + 10 + getHeightOffset();\n }\n\n function getShrinkWidth(width) {\n return width * 2 + getWidthOffset();\n }\n\n function getShrinkHeight(height) {\n return height * 2 + getHeightOffset();\n }\n\n function positionScrollbars(element, width, height) {\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n var shrinkWidth = getShrinkWidth(width);\n var shrinkHeight = getShrinkHeight(height);\n expand.scrollLeft = expandWidth;\n expand.scrollTop = expandHeight;\n shrink.scrollLeft = shrinkWidth;\n shrink.scrollTop = shrinkHeight;\n }\n\n function injectContainerElement() {\n var container = getState(element).container;\n\n if (!container) {\n container = document.createElement(\"div\");\n container.className = detectionContainerClass;\n container.style.cssText = buildCssTextString([\"visibility: hidden\", \"display: inline\", \"width: 0px\", \"height: 0px\", \"z-index: -1\", \"overflow: hidden\", \"margin: 0\", \"padding: 0\"]);\n getState(element).container = container;\n addAnimationClass(container);\n element.appendChild(container);\n\n var onAnimationStart = function () {\n getState(element).onRendered && getState(element).onRendered();\n };\n\n addEvent(container, \"animationstart\", onAnimationStart);\n\n // Store the event handler here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onAnimationStart = onAnimationStart;\n }\n\n return container;\n }\n\n function injectScrollElements() {\n function alterPositionStyles() {\n var style = getState(element).style;\n\n if(style.position === \"static\") {\n element.style.setProperty(\"position\", \"relative\",options.important ? \"important\" : \"\");\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style[property] = 0;\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function getLeftTopBottomRightCssText(left, top, bottom, right) {\n left = (!left ? \"0\" : (left + \"px\"));\n top = (!top ? \"0\" : (top + \"px\"));\n bottom = (!bottom ? \"0\" : (bottom + \"px\"));\n right = (!right ? \"0\" : (right + \"px\"));\n\n return [\"left: \" + left, \"top: \" + top, \"right: \" + right, \"bottom: \" + bottom];\n }\n\n debug(\"Injecting elements\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n alterPositionStyles();\n\n var rootContainer = getState(element).container;\n\n if (!rootContainer) {\n rootContainer = injectContainerElement();\n }\n\n // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),\n // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than\n // the targeted element.\n // When the bug is resolved, \"containerContainer\" may be removed.\n\n // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).\n // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.\n\n var scrollbarWidth = scrollbarSizes.width;\n var scrollbarHeight = scrollbarSizes.height;\n var containerContainerStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: hidden\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\", \"left: 0px\", \"top: 0px\"]);\n var containerStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: hidden\", \"z-index: -1\", \"visibility: hidden\"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));\n var expandStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: scroll\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\"]);\n var shrinkStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: scroll\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\"]);\n var expandChildStyle = buildCssTextString([\"position: absolute\", \"left: 0\", \"top: 0\"]);\n var shrinkChildStyle = buildCssTextString([\"position: absolute\", \"width: 200%\", \"height: 200%\"]);\n\n var containerContainer = document.createElement(\"div\");\n var container = document.createElement(\"div\");\n var expand = document.createElement(\"div\");\n var expandChild = document.createElement(\"div\");\n var shrink = document.createElement(\"div\");\n var shrinkChild = document.createElement(\"div\");\n\n // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56\n // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.\n containerContainer.dir = \"ltr\";\n\n containerContainer.style.cssText = containerContainerStyle;\n containerContainer.className = detectionContainerClass;\n container.className = detectionContainerClass;\n container.style.cssText = containerStyle;\n expand.style.cssText = expandStyle;\n expandChild.style.cssText = expandChildStyle;\n shrink.style.cssText = shrinkStyle;\n shrinkChild.style.cssText = shrinkChildStyle;\n\n expand.appendChild(expandChild);\n shrink.appendChild(shrinkChild);\n container.appendChild(expand);\n container.appendChild(shrink);\n containerContainer.appendChild(container);\n rootContainer.appendChild(containerContainer);\n\n function onExpandScroll() {\n getState(element).onExpand && getState(element).onExpand();\n }\n\n function onShrinkScroll() {\n getState(element).onShrink && getState(element).onShrink();\n }\n\n addEvent(expand, \"scroll\", onExpandScroll);\n addEvent(shrink, \"scroll\", onShrinkScroll);\n\n // Store the event handlers here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onExpandScroll = onExpandScroll;\n getState(element).onShrinkScroll = onShrinkScroll;\n }\n\n function registerListenersAndPositionElements() {\n function updateChildSizes(element, width, height) {\n var expandChild = getExpandChildElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n expandChild.style.setProperty(\"width\", expandWidth + \"px\", options.important ? \"important\" : \"\");\n expandChild.style.setProperty(\"height\", expandHeight + \"px\", options.important ? \"important\" : \"\");\n }\n\n function updateDetectorElements(done) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n // Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.\n var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;\n\n debug(\"Storing current size\", width, height);\n\n // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.\n // Otherwise the if-check in handleScroll is useless.\n storeCurrentSize(element, width, height);\n\n // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.\n // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.\n\n batchProcessor.add(0, function performUpdateChildSizes() {\n if (!sizeChanged) {\n return;\n }\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n if (options.debug) {\n var w = element.offsetWidth;\n var h = element.offsetHeight;\n\n if (w !== width || h !== height) {\n reporter.warn(idHandler.get(element), \"Scroll: Size changed before updating detector elements.\");\n }\n }\n\n updateChildSizes(element, width, height);\n });\n\n batchProcessor.add(1, function updateScrollbars() {\n // This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then\n // been restored to the original size, which will have changed the scrollbar positions.\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n positionScrollbars(element, width, height);\n });\n\n if (sizeChanged && done) {\n batchProcessor.add(2, function () {\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n done();\n });\n }\n }\n\n function areElementsInjected() {\n return !!getState(element).container;\n }\n\n function notifyListenersIfNeeded() {\n function isFirstNotify() {\n return getState(element).lastNotifiedWidth === undefined;\n }\n\n debug(\"notifyListenersIfNeeded invoked\");\n\n var state = getState(element);\n\n // Don't notify if the current size is the start size, and this is the first notification.\n if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {\n return debug(\"Not notifying: Size is the same as the start size, and there has been no notification yet.\");\n }\n\n // Don't notify if the size already has been notified.\n if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {\n return debug(\"Not notifying: Size already notified\");\n }\n\n\n debug(\"Current size not notified, notifying...\");\n state.lastNotifiedWidth = state.lastWidth;\n state.lastNotifiedHeight = state.lastHeight;\n forEach(getState(element).listeners, function (listener) {\n listener(element);\n });\n }\n\n function handleRender() {\n debug(\"startanimation triggered.\");\n\n if (isUnrendered(element)) {\n debug(\"Ignoring since element is still unrendered...\");\n return;\n }\n\n debug(\"Element rendered.\");\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {\n debug(\"Scrollbars out of sync. Updating detector elements...\");\n updateDetectorElements(notifyListenersIfNeeded);\n }\n }\n\n function handleScroll() {\n debug(\"Scroll detected.\");\n\n if (isUnrendered(element)) {\n // Element is still unrendered. Skip this scroll event.\n debug(\"Scroll event fired while unrendered. Ignoring...\");\n return;\n }\n\n updateDetectorElements(notifyListenersIfNeeded);\n }\n\n debug(\"registerListenersAndPositionElements invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n getState(element).onRendered = handleRender;\n getState(element).onExpand = handleScroll;\n getState(element).onShrink = handleScroll;\n\n var style = getState(element).style;\n updateChildSizes(element, style.width, style.height);\n }\n\n function finalizeDomMutation() {\n debug(\"finalizeDomMutation invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getState(element).style;\n storeCurrentSize(element, style.width, style.height);\n positionScrollbars(element, style.width, style.height);\n }\n\n function ready() {\n callback(element);\n }\n\n function install() {\n debug(\"Installing...\");\n initListeners();\n storeStartSize();\n\n batchProcessor.add(0, storeStyle);\n batchProcessor.add(1, injectScrollElements);\n batchProcessor.add(2, registerListenersAndPositionElements);\n batchProcessor.add(3, finalizeDomMutation);\n batchProcessor.add(4, ready);\n }\n\n debug(\"Making detectable...\");\n\n if (isDetached(element)) {\n debug(\"Element is detached\");\n\n injectContainerElement();\n\n debug(\"Waiting until element is attached...\");\n\n getState(element).onRendered = function () {\n debug(\"Element is now attached\");\n install();\n };\n } else {\n install();\n }\n }\n\n function uninstall(element) {\n var state = getState(element);\n\n if (!state) {\n // Uninstall has been called on a non-erd element.\n return;\n }\n\n // Uninstall may have been called in the following scenarios:\n // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).\n // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).\n // (3) After the installation process (here, state.busy = false and all the stuff has been injected).\n // So to be on the safe side, let's check for each thing before removing.\n\n // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.\n state.onExpandScroll && removeEvent(getExpandElement(element), \"scroll\", state.onExpandScroll);\n state.onShrinkScroll && removeEvent(getShrinkElement(element), \"scroll\", state.onShrinkScroll);\n state.onAnimationStart && removeEvent(state.container, \"animationstart\", state.onAnimationStart);\n\n state.container && element.removeChild(state.container);\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall,\n initDocument: initDocument\n };\n};\n","'use strict'\n\nimport { Emitter } from 'atom'\n\nlet idCounter = 0\nconst nextId = function () { return idCounter++ }\n\n/**\n * The `Decoration` class represents a decoration in the Minimap.\n *\n * It has the same API than the `Decoration` class of a text editor.\n */\nexport default class Decoration {\n /**\n * Returns `true` if the passed-in decoration properties matches the\n * specified type.\n *\n * @param {Object} decorationProperties the decoration properties to match\n * @param {string} type the decoration type to match\n * @return {boolean} whether the decoration properties match the type\n */\n static isType (decorationProperties, type) {\n if (Array.isArray(decorationProperties.type)) {\n if (decorationProperties.type.indexOf(type) >= 0) { return true }\n return false\n } else {\n return type === decorationProperties.type\n }\n }\n\n /**\n * Creates a new decoration.\n *\n * @param {Marker} marker the target marker for the decoration\n * @param {Minimap} minimap the Minimap where the decoration will\n * be displayed\n * @param {Object} properties the decoration's properties\n */\n constructor (marker, minimap, properties) {\n /**\n * @access private\n */\n this.marker = marker\n /**\n * @access private\n */\n this.minimap = minimap\n /**\n * @access private\n */\n this.emitter = new Emitter()\n /**\n * @access private\n */\n this.id = nextId()\n /**\n * @access private\n */\n this.properties = null\n this.setProperties(properties)\n this.properties.id = this.id\n /**\n * @access private\n */\n this.destroyed = false\n /**\n * @access private\n */\n this.markerDestroyDisposable = this.marker.onDidDestroy(() => {\n this.destroy()\n })\n\n this.screenRange = marker.getScreenRange()\n }\n\n /**\n * Destroy this marker.\n *\n * If you own the marker, you should use `Marker#destroy` which will destroy\n * this decoration.\n */\n destroy () {\n if (this.destroyed) { return }\n\n this.markerDestroyDisposable.dispose()\n this.markerDestroyDisposable = null\n this.destroyed = true\n this.emitter.emit('did-destroy')\n this.emitter.dispose()\n }\n\n /**\n * Returns whether this decoration is destroyed or not.\n *\n * @return {boolean} whether this decoration is destroyed or not\n */\n isDestroyed () { return this.destroyed }\n\n /**\n * Registers an event listener to the `did-change-properties` event.\n *\n * This event is triggered when the decoration update method is called.\n *\n * @param {function(change:Object):void} callback a function to call\n * when the event is triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeProperties (callback) {\n return this.emitter.on('did-change-properties', callback)\n }\n\n /**\n * Registers an event listener to the `did-destroy` event.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n /**\n * An id unique across all Decoration objects.\n *\n * @return {number} the decoration id\n */\n getId () { return this.id }\n\n /**\n * Returns the marker associated with this Decoration.\n *\n * @return {Marker} the decoration's marker\n */\n getMarker () { return this.marker }\n\n /**\n * Check if this decoration is of type `type`.\n *\n * @param {string|Array} type a type like `'line-number'`, `'line'`, etc.\n * `type` can also be an Array of Strings, where\n * it will return true if the decoration's type\n * matches any in the array.\n * @return {boolean} whether this decoration match the passed-in type\n */\n isType (type) {\n return Decoration.isType(this.properties, type)\n }\n\n /**\n * Returns the Decoration's properties.\n *\n * @return {Object} the decoration's properties\n */\n getProperties () {\n return this.properties\n }\n\n /**\n * Update the marker with new properties. Allows you to change the\n * decoration's class.\n *\n * @param {Object} newProperties the new properties for the decoration\n */\n setProperties (newProperties) {\n if (this.destroyed) { return }\n\n const oldProperties = this.properties\n this.properties = newProperties\n this.properties.id = this.id\n\n this.emitter.emit('did-change-properties', { oldProperties, newProperties })\n }\n}\n","'use babel'\n'use strict'\n\n/**\n * @access private\n */\nexport default class CanvasLayer {\n constructor () {\n /**\n * The onscreen canvas.\n * @type {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas')\n\n const desynchronized = process.platform !== 'linux'\n\n /**\n * The onscreen canvas context.\n * @type {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d', { desynchronized })\n this.canvas.webkitImageSmoothingEnabled = false\n this.context.imageSmoothingEnabled = false\n\n /**\n * The offscreen canvas.\n * @type {HTMLCanvasElement}\n * @access private\n */\n this.offscreenCanvas = document.createElement('canvas')\n /**\n * The offscreen canvas context.\n * @type {CanvasRenderingContext2D}\n * @access private\n */\n this.offscreenContext = this.offscreenCanvas.getContext('2d', { desynchronized })\n this.offscreenCanvas.webkitImageSmoothingEnabled = false\n this.offscreenContext.imageSmoothingEnabled = false\n }\n\n attach (parent) {\n if (this.canvas.parentNode) { return }\n\n parent.appendChild(this.canvas)\n }\n\n setSize (width = 0, height = 0) {\n this.canvas.width = width\n this.canvas.height = height\n this.context.imageSmoothingEnabled = false\n this.resetOffscreenSize()\n }\n\n getSize () {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n }\n }\n\n resetOffscreenSize () {\n this.offscreenCanvas.width = this.canvas.width\n this.offscreenCanvas.height = this.canvas.height\n this.offscreenContext.imageSmoothingEnabled = false\n }\n\n copyToOffscreen () {\n if (this.canvas.width > 0 && this.canvas.height > 0) {\n this.offscreenContext.drawImage(this.canvas, 0, 0)\n }\n }\n\n copyFromOffscreen () {\n if (this.offscreenCanvas.width > 0 && this.offscreenCanvas.height > 0) {\n this.context.drawImage(this.offscreenCanvas, 0, 0)\n }\n }\n\n copyPartFromOffscreen (srcY, destY, height) {\n if (this.offscreenCanvas.width > 0 && this.offscreenCanvas.height > 0) {\n this.context.drawImage(\n this.offscreenCanvas,\n 0, srcY, this.offscreenCanvas.width, height,\n 0, destY, this.offscreenCanvas.width, height\n )\n }\n }\n\n clearCanvas () {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)\n }\n}\n","'use strict'\n\nimport { CompositeDisposable, Emitter } from 'atom'\nimport { EventsDelegation, SpacePenDSL } from 'atom-utils-plus'\n\nimport * as Main from './main'\nimport element from './decorators/element'\nimport include from './decorators/include'\n\n/**\n * @access private\n */\nclass MinimapQuickSettingsElement {\n static initClass () {\n include(this, EventsDelegation, SpacePenDSL.Babel)\n return element(this, 'minimap-quick-settings')\n }\n\n static content () {\n this.div({ class: 'select-list popover-list minimap-quick-settings' }, () => {\n this.input({ type: 'text', class: 'hidden-input', outlet: 'hiddenInput' })\n this.ol({ class: 'list-group mark-active', outlet: 'list' }, () => {\n this.li({ class: 'separator', outlet: 'separator' })\n this.li({ class: 'code-highlights', outlet: 'codeHighlights' }, 'code-highlights')\n this.li({ class: 'absolute-mode', outlet: 'absoluteMode' }, 'absolute-mode')\n this.li({ class: 'adjust-absolute-mode-height', outlet: 'adjustAbsoluteModeHeight' }, 'adjust-absolute-mode-height')\n })\n this.div({ class: 'btn-group' }, () => {\n this.button({ class: 'btn btn-default', outlet: 'onLeftButton' }, 'On Left')\n this.button({ class: 'btn btn-default', outlet: 'onRightButton' }, 'On Right')\n })\n })\n }\n\n createdCallback () {\n this.buildContent()\n }\n\n setModel (minimap) {\n this.selectedItem = null\n this.minimap = minimap\n this.emitter = new Emitter()\n this.subscriptions = new CompositeDisposable()\n this.plugins = {}\n this.itemsActions = new WeakMap()\n\n this.codeHighlights.classList.toggle('active', this.minimap.displayCodeHighlights)\n\n this.itemsActions.set(this.codeHighlights, () => {\n atom.config.set('minimap.displayCodeHighlights', !this.minimap.displayCodeHighlights)\n })\n\n this.itemsActions.set(this.absoluteMode, () => {\n atom.config.set('minimap.absoluteMode', !atom.config.get('minimap.absoluteMode'))\n })\n\n this.itemsActions.set(this.adjustAbsoluteModeHeight, () => {\n atom.config.set('minimap.adjustAbsoluteModeHeight', !atom.config.get('minimap.adjustAbsoluteModeHeight'))\n })\n\n this.subscriptions.add(\n\n Main.onDidAddPlugin(({ name, plugin }) => {\n return this.addItemFor(name, plugin)\n }),\n Main.onDidRemovePlugin(({ name, plugin }) => {\n return this.removeItemFor(name, plugin)\n }),\n Main.onDidActivatePlugin(({ name, plugin }) => {\n return this.activateItem(name, plugin)\n }),\n Main.onDidDeactivatePlugin(({ name, plugin }) => {\n return this.deactivateItem(name, plugin)\n }),\n\n atom.commands.add('minimap-quick-settings', {\n 'core:move-up': () => {\n this.selectPreviousItem()\n },\n 'core:move-down': () => {\n this.selectNextItem()\n },\n 'core:move-left': () => {\n atom.config.set('minimap.displayMinimapOnLeft', true)\n },\n 'core:move-right': () => {\n atom.config.set('minimap.displayMinimapOnLeft', false)\n },\n 'core:cancel': () => {\n this.destroy()\n },\n 'core:confirm': () => {\n this.toggleSelectedItem()\n }\n }),\n\n this.subscribeTo(this.codeHighlights, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayCodeHighlights', !this.minimap.displayCodeHighlights)\n }\n }),\n\n this.subscribeTo(this.absoluteMode, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.absoluteMode', !atom.config.get('minimap.absoluteMode'))\n }\n }),\n\n this.subscribeTo(this.adjustAbsoluteModeHeight, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.adjustAbsoluteModeHeight', !atom.config.get('minimap.adjustAbsoluteModeHeight'))\n }\n }),\n\n this.subscribeTo(this.hiddenInput, {\n focusout: (e) => { this.destroy() }\n },\n { passive: true }\n ),\n\n this.subscribeTo(this.onLeftButton, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayMinimapOnLeft', true)\n }\n }),\n\n this.subscribeTo(this.onRightButton, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayMinimapOnLeft', false)\n }\n }),\n\n atom.config.observe('minimap.displayCodeHighlights', (bool) => {\n this.codeHighlights.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.absoluteMode', (bool) => {\n this.absoluteMode.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.adjustAbsoluteModeHeight', (bool) => {\n this.adjustAbsoluteModeHeight.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.displayMinimapOnLeft', (bool) => {\n this.onLeftButton.classList.toggle('selected', bool)\n this.onRightButton.classList.toggle('selected', !bool)\n })\n )\n\n this.initList()\n }\n\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n attach () {\n const workspaceElement = atom.views.getView(atom.workspace)\n workspaceElement.appendChild(this)\n this.hiddenInput.focus()\n }\n\n destroy () {\n this.emitter.emit('did-destroy')\n this.subscriptions.dispose()\n this.parentNode.removeChild(this)\n }\n\n initList () {\n this.itemsDisposables = new WeakMap()\n for (const name in Main.plugins) {\n this.addItemFor(name, Main.plugins[name])\n }\n }\n\n toggleSelectedItem () {\n const fn = this.itemsActions.get(this.selectedItem)\n if (typeof fn === 'function') { fn() }\n }\n\n selectNextItem () {\n this.selectedItem.classList.remove('selected')\n if ((this.selectedItem.nextSibling != null)) {\n this.selectedItem = this.selectedItem.nextSibling\n if (this.selectedItem.matches('.separator')) {\n this.selectedItem = this.selectedItem.nextSibling\n }\n } else {\n this.selectedItem = this.list.firstChild\n }\n this.selectedItem.classList.add('selected')\n }\n\n selectPreviousItem () {\n this.selectedItem.classList.remove('selected')\n if ((this.selectedItem.previousSibling != null)) {\n this.selectedItem = this.selectedItem.previousSibling\n if (this.selectedItem.matches('.separator')) {\n this.selectedItem = this.selectedItem.previousSibling\n }\n } else {\n this.selectedItem = this.list.lastChild\n }\n this.selectedItem.classList.add('selected')\n }\n\n addItemFor (name, plugin) {\n const item = document.createElement('li')\n const action = () => { Main.togglePluginActivation(name) }\n\n if (plugin.isActive()) { item.classList.add('active') }\n\n item.textContent = name\n\n this.itemsActions.set(item, action)\n this.itemsDisposables.set(item, this.addDisposableEventListener(item, 'mousedown', (e) => {\n e.preventDefault()\n action()\n }))\n\n this.plugins[name] = item\n this.list.insertBefore(item, this.separator)\n\n if (!(this.selectedItem != null)) {\n this.selectedItem = item\n this.selectedItem.classList.add('selected')\n }\n }\n\n removeItemFor (name, plugin) {\n try {\n this.list.removeChild(this.plugins[name])\n } catch (error) {}\n\n delete this.plugins[name]\n }\n\n activateItem (name, plugin) {\n this.plugins[name].classList.add('active')\n }\n\n deactivateItem (name, plugin) {\n this.plugins[name].classList.remove('active')\n }\n}\n\nconst minimapQuickSettingsElement = MinimapQuickSettingsElement.initClass()\nexport default minimapQuickSettingsElement\n","'use strict'\n\n/**\n * @access private\n */\nexport default class LegacyAdapter {\n constructor (textEditor) { this.textEditor = textEditor }\n\n enableCache () { this.useCache = true }\n\n clearCache () {\n this.useCache = false\n delete this.heightCache\n delete this.scrollTopCache\n delete this.scrollLeftCache\n delete this.maxScrollTopCache\n }\n\n onDidChangeScrollTop (callback) {\n return this.textEditor.onDidChangeScrollTop(callback)\n }\n\n onDidChangeScrollLeft (callback) {\n return this.textEditor.onDidChangeScrollLeft(callback)\n }\n\n getHeight () {\n if (this.useCache) {\n if (!this.heightCache) {\n this.heightCache = this.textEditor.getHeight()\n }\n return this.heightCache\n }\n return this.textEditor.getHeight()\n }\n\n getScrollTop () {\n if (this.useCache) {\n if (!this.scrollTopCache) {\n this.scrollTopCache = this.textEditor.getScrollTop()\n }\n return this.scrollTopCache\n }\n return this.textEditor.getScrollTop()\n }\n\n setScrollTop (scrollTop) {\n return this.textEditor.setScrollTop(scrollTop)\n }\n\n getScrollLeft () {\n if (this.useCache) {\n if (!this.scrollLeftCache) {\n this.scrollLeftCache = this.textEditor.getScrollLeft()\n }\n return this.scrollLeftCache\n }\n\n return this.textEditor.getScrollLeft()\n }\n\n getMaxScrollTop () {\n if (this.maxScrollTopCache != null && this.useCache) {\n return this.maxScrollTopCache\n }\n let maxScrollTop = this.textEditor.displayBuffer.getMaxScrollTop()\n const lineHeight = this.textEditor.getLineHeightInPixels()\n\n if (this.scrollPastEnd) {\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n if (this.useCache) { this.maxScrollTopCache = maxScrollTop }\n return maxScrollTop\n }\n\n editorDestroyed () {\n return !this.textEditor || this.textEditor.isDestroyed()\n }\n}\n","'use strict'\n\n/**\n * @access private\n */\nexport default class StableAdapter {\n constructor (textEditor) {\n this.textEditor = textEditor\n this.textEditorElement = atom.views.getView(this.textEditor)\n }\n\n enableCache () { this.useCache = true }\n\n clearCache () {\n this.useCache = false\n delete this.heightCache\n delete this.scrollTopCache\n delete this.scrollLeftCache\n delete this.maxScrollTopCache\n }\n\n onDidChangeScrollTop (callback) {\n return this.textEditorElement.onDidChangeScrollTop(callback)\n }\n\n onDidChangeScrollLeft (callback) {\n return this.textEditorElement.onDidChangeScrollLeft(callback)\n }\n\n getHeight () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.heightCache) {\n this.heightCache = this.textEditorElement.getHeight()\n }\n return this.heightCache\n }\n return this.textEditorElement.getHeight()\n }\n\n getScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.scrollTopCache) {\n this.scrollTopCache = this.computeScrollTop()\n }\n return this.scrollTopCache\n }\n return this.computeScrollTop()\n }\n\n computeScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n const scrollTop = this.textEditorElement.getScrollTop()\n const lineHeight = this.textEditor.getLineHeightInPixels()\n let firstRow = this.textEditorElement.getFirstVisibleScreenRow()\n\n if (Number.isNaN(firstRow)) {\n // Guard against their being no visible screen row\n return 0\n }\n\n let lineTop = this.textEditorElement.pixelPositionForScreenPosition([firstRow, 0]).top\n\n if (lineTop > scrollTop) {\n firstRow -= 1\n lineTop = this.textEditorElement.pixelPositionForScreenPosition([firstRow, 0]).top\n }\n\n const lineY = firstRow * lineHeight\n const offset = Math.min(scrollTop - lineTop, lineHeight)\n return lineY + offset\n }\n\n setScrollTop (scrollTop) {\n if (this.editorDestroyed()) { return }\n\n this.textEditorElement.setScrollTop(scrollTop)\n }\n\n getScrollLeft () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.scrollLeftCache) {\n this.scrollLeftCache = this.textEditorElement.getScrollLeft()\n }\n return this.scrollLeftCache\n }\n return this.textEditorElement.getScrollLeft()\n }\n\n getMaxScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.maxScrollTopCache != null && this.useCache) {\n return this.maxScrollTopCache\n }\n\n let maxScrollTop\n if (this.textEditorElement.getMaxScrollTop) {\n maxScrollTop = this.textEditorElement.getMaxScrollTop()\n\n if (parseFloat(atom.getVersion()) >= 1.13) {\n if (this.scrollPastEnd) {\n const lineHeight = this.textEditor.getLineHeightInPixels()\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n }\n } else {\n maxScrollTop = this.textEditorElement.getScrollHeight() - this.getHeight()\n\n if (this.scrollPastEnd) {\n const lineHeight = this.textEditor.getLineHeightInPixels()\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n }\n\n if (this.useCache) {\n this.maxScrollTopCache = maxScrollTop\n }\n\n return maxScrollTop\n }\n\n editorDestroyed () {\n return !this.textEditor ||\n this.textEditor.isDestroyed() ||\n !this.textEditorElement.component ||\n !this.textEditorElement.getModel() ||\n !this.textEditorElement.parentNode\n }\n}\n","'use strict'\n\nimport { Emitter, CompositeDisposable } from 'atom'\nimport StableAdapter from './adapters/stable-adapter'\nimport { editorsMinimaps } from './main'\n\nlet nextModelId = 1\n\n/**\n * The Minimap class is the underlying model of a .\n * Most manipulations of the minimap is done through the model.\n *\n * Any Minimap instance is tied to a `TextEditor`.\n * Their lifecycle follow the one of their target `TextEditor`, so they are\n * destroyed whenever their `TextEditor` is destroyed.\n */\nexport default class Minimap {\n /**\n * Creates a new Minimap instance for the given `TextEditor`.\n *\n * @param {Object} options an object with the new Minimap properties\n * @param {TextEditor} options.textEditor the target text editor for\n * the minimap\n * @param {boolean} [options.standAlone] whether this minimap is in\n * stand-alone mode or not\n * @param {number} [options.width] the minimap width in pixels\n * @param {number} [options.height] the minimap height in pixels\n * @throws {Error} Cannot create a minimap without an editor\n */\n constructor (options = {}) {\n if (!options.textEditor) {\n throw new Error('Cannot create a minimap without an editor')\n }\n\n /**\n * The Minimap's minimapElement.\n *\n * @type {MinimapElement}\n * @access private\n */\n this.minimapElement = undefined\n\n // local cache of this.minimapElement.DecorationManagement\n this.DecorationManagement = undefined\n\n /**\n * The Minimap's text editor.\n *\n * @type {TextEditor}\n * @access private\n */\n this.textEditor = options.textEditor\n\n /**\n * The Minimap's text editor element.\n * @access private\n */\n this.editorElement = undefined\n\n /**\n * The stand-alone state of the current Minimap.\n *\n * @type {boolean}\n * @access private\n */\n this.standAlone = options.standAlone\n /**\n * The width of the current Minimap.\n *\n * @type {number}\n * @access private\n */\n this.width = options.width\n /**\n * The height of the current Minimap.\n *\n * @type {number}\n * @access private\n */\n this.height = options.height\n /**\n * The id of the current Minimap.\n *\n * @type {Number}\n * @access private\n */\n this.id = nextModelId++\n /**\n * The events emitter of the current Minimap.\n *\n * @type {Emitter}\n * @access private\n */\n this.emitter = new Emitter()\n /**\n * The Minimap's subscriptions.\n *\n * @type {CompositeDisposable}\n * @access private\n */\n this.subscriptions = new CompositeDisposable()\n /**\n * The adapter object leverage the access to several properties from\n * the `TextEditor`/`TextEditorElement` to support the different APIs\n * between different version of Atom.\n *\n * @type {Object}\n * @access private\n */\n this.adapter = null\n /**\n * The char height of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.charHeight = null\n /**\n * The char height from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configCharHeight = null\n /**\n * The char width of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.charWidth = null\n /**\n * The char width from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configCharWidth = null\n /**\n * The interline of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.interline = null\n /**\n * The interline from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configInterline = null\n /**\n * The devicePixelRatioRounding of the current Minimap, will be\n * `undefined` unless `setDevicePixelRatioRounding` is called.\n *\n * @type {boolean}\n * @access private\n */\n this.devicePixelRatioRounding = null\n /**\n * The devicePixelRatioRounding from the package's configuration.\n * Will be overriden by the instance value.\n *\n * @type {boolean}\n * @access private\n */\n this.configDevicePixelRatioRounding = null\n /**\n * A number of milliseconds which determines how often the minimap should redraw itself after\n * detecting changes in the text editor. A value of 0 will cause the minimap to redraw\n * immediately.\n *\n * @type {number}\n * @access private\n */\n this.redrawDelay = 0\n /**\n * A boolean value to store whether this Minimap have been destroyed or not.\n *\n * @type {boolean}\n * @access private\n */\n this.destroyed = false\n /**\n * A boolean value to store whether the `scrollPastEnd` setting is enabled\n * or not.\n *\n * @type {boolean}\n * @access private\n */\n this.scrollPastEnd = false\n\n /**\n * An array of changes registered with textEditor.onDidChange() which have not yet been handled\n *\n * @type {Array}\n * @access private\n */\n this.pendingChangeEvents = []\n\n /**\n * Timer reference which, once fired, will flush all the pending changes stored in\n * this.pendingChangeEvents array.\n *\n * @type {Timer?}\n * @access private\n */\n this.flushChangesTimer = null\n\n if (atom.views.getView(this.textEditor).getScrollTop != null) {\n this.adapter = new StableAdapter(this.textEditor)\n } else {\n // TODO remove LegacyAdapter in the next major version\n atom.notifications.addWarning('LegacyAdapter of Minimap is deprecated and will be removed in the next major version. Please upgrade Atom to the latest version.')\n const LegacyAdapter = require('./adapters/legacy-adapter')\n this.adapter = new LegacyAdapter(this.textEditor)\n }\n\n /**\n * When in stand-alone or independent scrolling mode, this value can be used\n * instead of the computed scroll.\n *\n * @type {number}\n * @access private\n */\n this.scrollTop = 0\n\n let configSubscription = this.subscribeToConfig()\n\n this.subscriptions.add(\n configSubscription,\n\n this.textEditor.onDidChangeGrammar(() => {\n this.subscriptions.remove(configSubscription)\n configSubscription.dispose()\n\n configSubscription = this.subscribeToConfig()\n this.subscriptions.add(configSubscription)\n }),\n\n this.adapter.onDidChangeScrollTop(() => {\n if (!this.standAlone && !this.ignoreTextEditorScroll && !this.inChangeScrollTop) {\n this.inChangeScrollTop = true\n this.updateScrollTop()\n this.emitter.emit('did-change-scroll-top', this)\n this.inChangeScrollTop = false\n }\n\n if (this.ignoreTextEditorScroll) {\n this.ignoreTextEditorScroll = false\n }\n }),\n\n this.adapter.onDidChangeScrollLeft(() => {\n if (!this.standAlone) {\n this.emitter.emit('did-change-scroll-left', this)\n }\n }),\n\n this.textEditor.onDidChange((changes) => {\n this.scheduleChanges(changes)\n }),\n\n this.textEditor.onDidDestroy(() => {\n if (editorsMinimaps) {\n editorsMinimaps.delete(this.textEditor)\n }\n this.destroy()\n }),\n\n /*\n FIXME Some changes occuring during the tokenization produces\n ranges that deceive the canvas rendering by making some\n lines at the end of the buffer intact while they are in fact not,\n resulting in extra lines appearing at the end of the minimap.\n Forcing a whole repaint to fix that bug is suboptimal but works.\n */\n this.textEditor.onDidTokenize(() => {\n this.emitter.emit('did-change-config')\n })\n\n )\n }\n\n /**\n * Destroys the model.\n */\n destroy () {\n if (this.destroyed) { return }\n\n clearTimeout(this.flushChangesTimer)\n this.flushChangesTimer = null\n this.pendingChangeEvents = []\n this.subscriptions.dispose()\n this.subscriptions = null\n this.textEditor = null\n this.emitter.emit('did-destroy')\n this.emitter.dispose()\n this.destroyed = true\n }\n\n /**\n * Returns `true` when this `Minimap` has benn destroyed.\n *\n * @return {boolean} whether this Minimap has been destroyed or not\n */\n isDestroyed () { return this.destroyed }\n\n /**\n * Schedule changes from textEditor.onDidChange() to be handled at a later time\n *\n * @param {Array} changes The changes to be scheduled\n * @return void\n * @access private\n */\n scheduleChanges (changes) {\n this.pendingChangeEvents = this.pendingChangeEvents.concat(changes)\n\n // Optimisation: If the redraw delay is set to 0, do not even schedule a timer\n if (!this.redrawDelay) {\n this.requestFlushChanges()\n }\n\n if (!this.flushChangesTimer) {\n // If any changes happened within the timeout's delay, a timeout will already have been\n // scheduled -> no need to schedule again\n this.flushChangesTimer = setTimeout(() => { this.requestFlushChanges() }, this.redrawDelay)\n }\n }\n\n /**\n * Flush all changes which have been scheduled for later processing by this.scheduleChanges()\n *\n * @return void\n * @access private\n */\n flushChanges () {\n clearTimeout(this.flushChangesTimer)\n this.flushChangesTimer = null\n this.emitChanges(this.pendingChangeEvents)\n this.pendingChangeEvents = []\n }\n\n /**\n * Requests flush changes if not already requested\n *\n * @return void\n * @access private\n */\n requestFlushChanges () {\n if (!this.requestedFlushChanges) {\n this.requestedFlushChanges = requestAnimationFrame(() => {\n this.flushChanges()\n if (this.requestedFlushChanges) {\n cancelAnimationFrame(this.requestedFlushChanges)\n this.requestedFlushChanges = null\n }\n })\n }\n }\n\n /**\n * Registers an event listener to the `did-change` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - start: The change's start row number\n * - end: The change's end row number\n * - screenDelta: the delta in buffer rows between the versions before and\n * after the change\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChange (callback) {\n return this.emitter.on('did-change', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-config` event.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeConfig (callback) {\n return this.emitter.on('did-change-config', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-scroll-top` event.\n *\n * The event is dispatched when the text editor `scrollTop` value have been\n * changed or when the minimap scroll top have been changed in stand-alone\n * mode.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeScrollTop (callback) {\n return this.emitter.on('did-change-scroll-top', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-scroll-left` event.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeScrollLeft (callback) {\n return this.emitter.on('did-change-scroll-left', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-stand-alone` event.\n *\n * This event is dispatched when the stand-alone of the current Minimap\n * is either enabled or disabled.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeStandAlone (callback) {\n return this.emitter.on('did-change-stand-alone', callback)\n }\n\n /**\n * Registers an event listener to the `did-destroy` event.\n *\n * This event is dispatched when this Minimap have been destroyed. It can\n * occurs either because the {@link destroy} method have been called on the\n * Minimap or because the target text editor have been destroyed.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n /**\n * Registers to the config changes for the current editor scope.\n *\n * @return {Disposable} the disposable to dispose all the registered events\n * @access private\n */\n subscribeToConfig () {\n const subs = new CompositeDisposable()\n const opts = { scope: this.textEditor.getRootScopeDescriptor() }\n\n subs.add(\n atom.config.observe('editor.scrollPastEnd', opts, (scrollPastEnd) => {\n this.scrollPastEnd = scrollPastEnd\n this.adapter.scrollPastEnd = this.scrollPastEnd\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.charHeight', opts, (configCharHeight) => {\n this.configCharHeight = configCharHeight\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.charWidth', opts, (configCharWidth) => {\n this.configCharWidth = configCharWidth\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.interline', opts, (configInterline) => {\n this.configInterline = configInterline\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.independentMinimapScroll', opts, (independentMinimapScroll) => {\n this.independentMinimapScroll = independentMinimapScroll\n this.updateScrollTop()\n }),\n\n atom.config.observe('minimap.scrollSensitivity', opts, (scrollSensitivity) => {\n this.scrollSensitivity = scrollSensitivity\n }),\n\n atom.config.observe('minimap.redrawDelay', opts, (redrawDelay) => {\n this.redrawDelay = redrawDelay\n }),\n // cdprr is shorthand for configDevicePixelRatioRounding\n\n atom.config.observe(\n 'minimap.devicePixelRatioRounding',\n opts,\n (cdprr) => {\n this.configDevicePixelRatioRounding = cdprr\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }\n )\n )\n\n return subs\n }\n\n /**\n * Returns `true` when the current Minimap is a stand-alone minimap.\n *\n * @return {boolean} whether this Minimap is in stand-alone mode or not.\n */\n isStandAlone () { return this.standAlone }\n\n /**\n * Sets the stand-alone mode for this minimap.\n *\n * @param {boolean} standAlone the new state of the stand-alone mode for this\n * Minimap\n * @emits {did-change-stand-alone} if the stand-alone mode have been toggled\n * on or off by the call\n */\n setStandAlone (standAlone) {\n if (standAlone !== this.standAlone) {\n this.standAlone = standAlone\n this.emitter.emit('did-change-stand-alone', this)\n }\n }\n\n /**\n * @return {MinimapElement} returns the current minimapElement\n */\n getMinimapElement () {\n return this.minimapElement\n }\n\n /**\n * Returns the `TextEditor` that this minimap represents.\n *\n * @return {TextEditor} this Minimap's text editor\n */\n getTextEditor () { return this.textEditor }\n\n /**\n * Returns the `TextEditorElement` for the Minimap's `TextEditor`.\n *\n * @return {TextEditorElement} the minimap's text editor element\n */\n getTextEditorElement () {\n if (this.editorElement) { return this.editorElement }\n\n this.editorElement = atom.views.getView(this.getTextEditor())\n return this.editorElement\n }\n\n /**\n * Returns the height of the `TextEditor` at the Minimap scale.\n *\n * @return {number} the scaled height of the text editor\n */\n getTextEditorScaledHeight () {\n return this.adapter.getHeight() * this.getVerticalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` scroll top value at the Minimap scale.\n *\n * @return {number} the scaled scroll top of the text editor\n */\n getTextEditorScaledScrollTop () {\n return this.adapter.getScrollTop() * this.getVerticalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` scroll left value at the Minimap scale.\n *\n * @return {number} the scaled scroll left of the text editor\n */\n getTextEditorScaledScrollLeft () {\n return this.adapter.getScrollLeft() * this.getHorizontalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` maximum scroll top value.\n *\n * When the `scrollPastEnd` setting is enabled, the method compensate the\n * extra scroll by removing the same height as added by the editor from the\n * final value.\n *\n * @return {number} the maximum scroll top of the text editor\n */\n getTextEditorMaxScrollTop () { return this.adapter.getMaxScrollTop() }\n\n /**\n * Returns the `TextEditor` scroll top value.\n *\n * @return {number} the scroll top of the text editor\n */\n getTextEditorScrollTop () { return this.adapter.getScrollTop() }\n\n /**\n * Sets the scroll top of the `TextEditor`.\n *\n * @param {number} scrollTop the new scroll top value\n */\n setTextEditorScrollTop (scrollTop, ignoreTextEditorScroll = false) {\n this.ignoreTextEditorScroll = ignoreTextEditorScroll\n this.adapter.setScrollTop(scrollTop)\n }\n\n /**\n * Returns the `TextEditor` scroll left value.\n *\n * @return {number} the scroll left of the text editor\n */\n getTextEditorScrollLeft () { return this.adapter.getScrollLeft() }\n\n /**\n * Returns the height of the `TextEditor`.\n *\n * @return {number} the height of the text editor\n */\n getTextEditorHeight () { return this.adapter.getHeight() }\n\n /**\n * Returns the `TextEditor` scroll as a value normalized between `0` and `1`.\n *\n * When the `scrollPastEnd` setting is enabled the value may exceed `1` as the\n * maximum scroll value used to compute this ratio compensate for the extra\n * height in the editor. **Use {@link getCapedTextEditorScrollRatio} when\n * you need a value that is strictly between `0` and `1`.**\n *\n * @return {number} the scroll ratio of the text editor\n */\n getTextEditorScrollRatio () {\n return this.adapter.getScrollTop() / (this.getTextEditorMaxScrollTop() || 1)\n }\n\n /**\n * Returns the `TextEditor` scroll as a value normalized between `0` and `1`.\n *\n * The returned value will always be strictly between `0` and `1`.\n *\n * @return {number} the scroll ratio of the text editor strictly between\n * 0 and 1\n */\n getCapedTextEditorScrollRatio () {\n return Math.min(1, this.getTextEditorScrollRatio())\n }\n\n /**\n * Returns the height of the whole minimap in pixels based on the `minimap`\n * settings.\n *\n * @return {number} the height of the minimap\n */\n getHeight () {\n return this.textEditor.getScreenLineCount() * this.getLineHeight()\n }\n\n /**\n * Returns the width of the whole minimap in pixels based on the `minimap`\n * settings.\n *\n * @return {number} the width of the minimap\n */\n getWidth () {\n return this.textEditor.getMaxScreenLineLength() * this.getCharWidth()\n }\n\n /**\n * Returns the height the Minimap content will take on screen.\n *\n * When the Minimap height is greater than the `TextEditor` height, the\n * `TextEditor` height is returned instead.\n *\n * @return {number} the visible height of the Minimap\n */\n getVisibleHeight () {\n return Math.min(this.getScreenHeight(), this.getHeight())\n }\n\n /**\n * Returns the height the minimap should take once displayed, it's either\n * the height of the `TextEditor` or the provided `height` when in stand-alone\n * mode.\n *\n * @return {number} the total height of the Minimap\n */\n getScreenHeight () {\n if (this.isStandAlone()) {\n if (this.height != null) {\n return this.height\n } else {\n return this.getHeight()\n }\n } else {\n return this.adapter.getHeight()\n }\n }\n\n /**\n * Returns the width the whole Minimap will take on screen.\n *\n * @return {number} the width of the Minimap when displayed\n */\n getVisibleWidth () {\n return Math.min(this.getScreenWidth(), this.getWidth())\n }\n\n /**\n * Returns the width the Minimap should take once displayed, it's either the\n * width of the Minimap content or the provided `width` when in standAlone\n * mode.\n *\n * @return {number} the Minimap screen width\n */\n getScreenWidth () {\n if (this.isStandAlone() && this.width != null) {\n return this.width\n } else {\n return this.getWidth()\n }\n }\n\n /**\n * Sets the preferred height and width when in stand-alone mode.\n *\n * This method is called by the for this Minimap so that\n * the model is kept in sync with the view.\n *\n * @param {number} height the new height of the Minimap\n * @param {number} width the new width of the Minimap\n */\n setScreenHeightAndWidth (height, width) {\n if (this.width !== width || this.height !== height) {\n this.height = height\n this.width = width\n this.updateScrollTop()\n }\n }\n\n /**\n * Returns the vertical scaling factor when converting coordinates from the\n * `TextEditor` to the Minimap.\n *\n * @return {number} the Minimap vertical scaling factor\n */\n getVerticalScaleFactor () {\n return this.getLineHeight() / this.textEditor.getLineHeightInPixels()\n }\n\n /**\n * Returns the horizontal scaling factor when converting coordinates from the\n * `TextEditor` to the Minimap.\n *\n * @return {number} the Minimap horizontal scaling factor\n */\n getHorizontalScaleFactor () {\n return this.getCharWidth() / this.textEditor.getDefaultCharWidth()\n }\n\n /**\n * Returns the height of a line in the Minimap in pixels.\n *\n * @return {number} a line's height in the Minimap\n */\n getLineHeight () { return this.getCharHeight() + this.getInterline() }\n\n /**\n * Returns the width of a character in the Minimap in pixels.\n *\n * @return {number} a character's width in the Minimap\n */\n getCharWidth () {\n if (this.charWidth != null) {\n return this.charWidth\n } else {\n return this.configCharWidth\n }\n }\n\n /**\n * Sets the char width for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} charWidth the new width of a char in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setCharWidth (charWidth) {\n this.charWidth = Math.floor(charWidth)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the height of a character in the Minimap in pixels.\n *\n * @return {number} a character's height in the Minimap\n */\n getCharHeight () {\n if (this.charHeight != null) {\n return this.charHeight\n } else {\n return this.configCharHeight\n }\n }\n\n /**\n * Sets the char height for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} charHeight the new height of a char in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setCharHeight (charHeight) {\n this.charHeight = Math.floor(charHeight)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the height of an interline in the Minimap in pixels.\n *\n * @return {number} the interline's height in the Minimap\n */\n getInterline () {\n if (this.interline != null) {\n return this.interline\n } else {\n return this.configInterline\n }\n }\n\n /**\n * Sets the interline height for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} interline the new height of an interline in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setInterline (interline) {\n this.interline = Math.floor(interline)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the status of devicePixelRatioRounding in the Minimap.\n *\n * @return {boolean} the devicePixelRatioRounding status in the Minimap\n */\n getDevicePixelRatioRounding () {\n if (this.devicePixelRatioRounding != null) {\n return this.devicePixelRatioRounding\n } else {\n return this.configDevicePixelRatioRounding\n }\n }\n\n /**\n * Sets the devicePixelRatioRounding status for this Minimap.\n * This value will override the value from the config for this instance only.\n * A `did-change-config` event is dispatched.\n *\n * @param {boolean} devicePixelRatioRounding the new status of\n * devicePixelRatioRounding\n * in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setDevicePixelRatioRounding (devicePixelRatioRounding) {\n this.devicePixelRatioRounding = devicePixelRatioRounding\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the devicePixelRatio in the Minimap in pixels.\n *\n * @return {number} the devicePixelRatio in the Minimap\n */\n getDevicePixelRatio () {\n return this.getDevicePixelRatioRounding()\n ? Math.floor(devicePixelRatio)\n : devicePixelRatio\n }\n\n /**\n * Returns the index of the first visible row in the Minimap.\n *\n * @return {number} the index of the first visible row\n */\n getFirstVisibleScreenRow () {\n return Math.floor(this.getScrollTop() / this.getLineHeight())\n }\n\n /**\n * Returns the index of the last visible row in the Minimap.\n *\n * @return {number} the index of the last visible row\n */\n getLastVisibleScreenRow () {\n return Math.ceil(\n (this.getScrollTop() + this.getScreenHeight()) / this.getLineHeight()\n )\n }\n\n /**\n * Returns true when the `independentMinimapScroll` setting have been enabled.\n *\n * @return {boolean} whether the minimap can scroll independently\n */\n scrollIndependentlyOnMouseWheel () { return this.independentMinimapScroll }\n\n /**\n * Returns the current scroll of the Minimap.\n *\n * The Minimap can scroll only when its height is greater that the height\n * of its `TextEditor`.\n *\n * @return {number} the scroll top of the Minimap\n */\n getScrollTop () {\n return this.standAlone || this.independentMinimapScroll\n ? this.scrollTop\n : this.getScrollTopFromEditor()\n }\n\n /**\n * Sets the minimap scroll top value when in stand-alone mode.\n *\n * @param {number} scrollTop the new scroll top for the Minimap\n * @emits {did-change-scroll-top} if the Minimap's stand-alone mode is enabled\n */\n setScrollTop (scrollTop) {\n this.scrollTop = Math.max(0, Math.min(this.getMaxScrollTop(), scrollTop))\n\n if (this.standAlone || this.independentMinimapScroll) {\n this.emitter.emit('did-change-scroll-top', this)\n }\n }\n\n /**\n * Returns the minimap scroll as a ration between 0 and 1.\n *\n * @return {number} the minimap scroll ratio\n */\n getScrollRatio () {\n return this.getScrollTop() / this.getMaxScrollTop()\n }\n\n /**\n * Updates the scroll top value with the one computed from the text editor\n * when the minimap is in the independent scrolling mode.\n *\n * @access private\n */\n updateScrollTop () {\n if (this.independentMinimapScroll) {\n try {\n this.setScrollTop(this.getScrollTopFromEditor())\n } catch (err) {\n\n }\n this.emitter.emit('did-change-scroll-top', this)\n }\n }\n\n /**\n * Returns the scroll top as computed from the text editor scroll top.\n *\n * @return {number} the computed scroll top value\n */\n getScrollTopFromEditor () {\n return Math.abs(\n this.getCapedTextEditorScrollRatio() * this.getMaxScrollTop()\n )\n }\n\n /**\n * Returns the maximum scroll value of the Minimap.\n *\n * @return {number} the maximum scroll top for the Minimap\n */\n getMaxScrollTop () {\n return Math.max(0, this.getHeight() - this.getScreenHeight())\n }\n\n /**\n * Returns `true` when the Minimap can scroll.\n *\n * @return {boolean} whether this Minimap can scroll or not\n */\n canScroll () { return this.getMaxScrollTop() > 0 }\n\n /**\n * Updates the minimap scroll top value using a mouse event when the\n * independent scrolling mode is enabled\n *\n * @param {MouseEvent} event the mouse wheel event\n * @access private\n */\n onMouseWheel (event) {\n if (this.scrollIndependentlyOnMouseWheel()) {\n event.stopPropagation()\n\n if (!this.canScroll()) { return }\n\n const { wheelDeltaY } = event\n const previousScrollTop = this.getScrollTop()\n const updatedScrollTop = previousScrollTop - Math.round(wheelDeltaY * this.scrollSensitivity)\n\n event.preventDefault()\n this.setScrollTop(updatedScrollTop)\n }\n }\n\n /**\n * Delegates to `TextEditor#getMarker`.\n *\n * @access private\n */\n getMarker (id) { return this.textEditor.getMarker(id) }\n\n /**\n * Delegates to `TextEditor#findMarkers`.\n *\n * @access private\n */\n findMarkers (o) {\n try {\n return this.textEditor.findMarkers(o)\n } catch (error) {\n return []\n }\n }\n\n /**\n * Delegates to `TextEditor#markBufferRange`.\n *\n * @access private\n */\n markBufferRange (range) { return this.textEditor.markBufferRange(range) }\n\n /**\n * Emits a change events with the passed-in changes as data.\n *\n * @param {Object} changes a change to dispatch\n * @access private\n */\n emitChanges (changes) { this.emitter.emit('did-change', changes) }\n\n /**\n * Enables the cache at the adapter level to avoid consecutive access to the\n * text editor API during a render phase.\n *\n * @access private\n */\n enableCache () { this.adapter.enableCache() }\n\n /**\n * Disable the adapter cache.\n *\n * @access private\n */\n clearCache () { this.adapter.clearCache() }\n\n editorDestroyed () { this.adapter.editorDestroyed() }\n\n /**\n * get the DecorationManagement API for the current minimapElement\n * @return {DecorationManagement}\n */\n getDecorationManagement () {\n if (this.DecorationManagement === undefined) {\n this.DecorationManagement = this.minimapElement.DecorationManagement\n }\n return this.DecorationManagement\n }\n\n // Decoration API duplicated for backward compatibility in the service\n getDecorations () { return this.getDecorationManagement().getDecorations() }\n onDidAddDecoration (...args) { return this.getDecorationManagement().onDidAddDecoration(...args) }\n onDidRemoveDecoration (...args) { return this.getDecorationManagement().onDidRemoveDecoration(...args) }\n onDidChangeDecorationRange (...args) { return this.getDecorationManagement().onDidChangeDecorationRange(...args) }\n onDidUpdateDecoration (...args) { return this.getDecorationManagement().onDidUpdateDecoration(...args) }\n decorationForId (...args) { return this.getDecorationManagement().decorationForId(...args) }\n decorationsForScreenRowRange (...args) { return this.getDecorationManagement().decorationsForScreenRowRange(...args) }\n decorationsByTypeThenRows () { return this.getDecorationManagement().decorationsByTypeThenRows() }\n decorateMarker (...args) { return this.getDecorationManagement().decorateMarker(...args) }\n removeDecoration (...args) { return this.getDecorationManagement().removeDecoration(...args) }\n removeAllDecorationsForMarker (...args) { return this.getDecorationManagement().removeAllDecorationsForMarker(...args) }\n removeAllDecorations () { return this.getDecorationManagement().removeAllDecorations() }\n}\n"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","assertDisposable","disposable","Disposable","require$$0","isDisposable","Batch","batch","size","topLevel","bottomLevel","[object Object]","level","fn","push","fns","initState","element","prop","getState","cleanState","isCollection","obj","Array","isArray","undefined","toArray","collection","array","forEach","isElement","nodeType","getOption","options","name","defaultValue","value","escapeRegExp","string","replace","regexEscape","dasherize","toLowerCase","slice","regexDaherize","m","letter","getOriginatorPackageName","filePath","Error","stack","split","re","RegExp","atom","packages","getPackageDirPaths","join","path","sep","plugin","indexOf","computeRangesDiffs","oldStart","oldEnd","newStart","newEnd","diffs","isLessThan","updateTokensLayer","tokensLayer","firstRow","lastRow","offscreenFirstRow","offscreenLastRow","pendingChanges","lineHeight","charHeight","charWidth","canvasWidth","editor","editorScreenLineCount","invisibleRegExp","getTokenColorClosure","ignoreWhitespacesInTokens","maxTokensInOneLine","intactRanges","computeIntactRanges","context","clearCanvas","drawLines","j","len","intact","copyPartFromOffscreen","offscreenRow","start","end","currentRow","range","resetOffscreenSize","copyToOffscreen","updateBackDecorationsLayer","backLayer","pendingBackDecorationChanges","renderData","editorElement","decorations","drawBackDecorationsForLines","updateFrontDecorationsLayer","frontLayer","pendingFrontDecorationChanges","drawFrontDecorationsForLines","drawToken","text","color","x","y","fillStyle","fillRect","chars","offsetRow","lastLine","Math","min","line","editorTokensForScreenRow","tokensForScreenRow","numTokenToRender","iToken","token","tokenText","tokenScopes","scopes","clearRect","whitespaceTokenRegex","test","fill","getInvisibleRegExp","invisibles","getInvisibles","regexp","cr","eol","space","tab","filter","s","map","drawLineDecoration","decoration","data","decorationColor","yRow","drawGutterDecoration","drawHighlightDecoration","screenRow","getMarker","getScreenRange","rowSpan","row","column","drawHighlightOutlineDecoration","bottomWidth","colSpan","width","xBottomStart","xEnd","xStart","yStart","yEnd","max","drawCustomDecoration","renderRoutine","getProperties","render","drawDecorations","types","decorationsToRender","concat","sort","a","b","orders","properties","decorationDrawer","type","SPEC_MODE","functionName","pop","thisSpec","getDecorationColor","frontDecorationDispatcher","backgroundDecorationDispatcher","getDefaultColor","textOpacity","transparentize","domStylesReader","retrieveStyleFromDom","getTokenColor","opacity","scope","scopeString","changes","change","newIntactRanges","intactLen","screenDelta","bufferDelta","truncateIntactRanges","splice","include","cls","mixins","mixin","includeMixin","source","getOwnPropertyNames","k","getOwnPropertyDescriptor","elementName","registerOrUpdateElement","class","ensureOverlayStyle","overlayStyle","document","createElement","setAttribute","head","appendChild","removeOverlayStyle","parentNode","removeChild","updateOverlayStyle","basis","textContent","extractMouseEventData","mouseEvent","pageX","pageY","isLeftMouse","button","isMiddleMouse","extractTouchEventData","touchEvent","touch","changedTouches","applyStyles","styles","cssText","property","style","makeTranslate","useHardwareAcceleration","makeScale","animate","from","to","duration","step","getTime","progress","update","passed","delta","swing","requestAnimationFrame","cos","PI","Date","registerPlugin","plugins","pluginsSubscriptions","CompositeDisposable","emitter","emit","config","get","registerPluginControls","updatesPluginActivationState","unregisterPlugin","unregisterPluginControls","togglePluginActivation","boolean","settingsKey","set","deactivateAllPlugins","eachPlugin","deactivatePlugin","pluginActive","isActive","settingActive","activatePlugin","event","orderSettingsKey","getConfigSchema","title","description","default","add","observe","order","updatePluginsOrderMap","commands","pluginsOrderMap","getPluginsOrder","dispose","treeSitterWarning","observeAndWarn","configName","recommendedValue","warningTitle","warningDescription","storageName","today","previousWarning","window","localStorage","getItem","previousWarningDay","parse","getDay","setItem","notification","notifications","addWarning","dismissable","buttons","dismiss","removeItem","setTimeout","reload","rotateHue","match","r","g","hue","hueRegexp","Number","rotate","isNaN","angle","clamp","num","ceil","matrix","lumR","lumG","lumB","sin","activate","active","subscriptionsOfCommands","toggle","generatePlugin","editorsMinimaps","Map","DOMStylesReader","subscriptions","minimapViewProvider","model","Minimap","MinimapElement","setModel","deactivate","PluginManagement.deactivateAllPlugins","destroy","clear","invalidateDOMStylesCache","toggled","getLoadedPackage","metadata","configSchema","minimap","wasMaximized","isMaximized","height","getSize","setSize","maximize","initSubscriptions","async","template","MinimapPluginGeneratorElement","Promise","view","attach","onDidActivate","callback","on","onDidDeactivate","onDidCreateMinimap","onDidAddPlugin","onDidRemovePlugin","onDidActivatePlugin","onDidDeactivatePlugin","onDidChangePluginOrder","minimapClass","minimapForEditorElement","minimapForEditor","getModel","textEditor","destroyed","editorSubscription","onDidDestroy","delete","standAloneMinimapForEditor","standAlone","getActiveMinimap","workspace","getActiveTextEditor","observeMinimaps","iterator","observeTextEditors","minimapElement","getMinimapElement","getElement","themes","onDidChangeActiveThemes","views","getView","requestForcedUpdate","provideMinimapServiceV1","MinimapServiceV1","module","Deprecation","message","fileName","lineNumber","this","callCount","stackCount","stacks","stackCallCounts","getFunctionNameFromCallsite","callsite","deserialize","_arg","deprecation","_i","_len","addStack","_ref","_ref1","_ref2","isToplevel","getFunctionName","isConstructor","getMethodName","getTypeName","getLocationFromCallsite","location","isNative","isEval","getEvalOrigin","getFileName","getLineNumber","getColumnNumber","getFileNameFromCallSite","getOriginName","originName","getMessage","getStacks","parsedStack","parsedStacks","parseStack","getStackCount","getCallCount","callerLocation","_base","_base1","_this","serialize","disposalAction","disposed","object","disposables","Set","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","arguments","Symbol","next","done","err","return","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","remove","Emitter","exceptionHandler","exceptionHandlers","dispatch","exceptionHandlingDispatch","simpleDispatch","handler","exception","handlersByEventName","eventName","unshift","_this2","cleanup","off","handlerToRemove","handlers","handlerIndex","handlersCopy","constructor","_this3","promises","all","then","resolve","keys","result","_arr","require$$1","require$$2","getRawStack","grim","global","__grim__","deprecations","includeDeprecatedAPIs","deprecationsByLineNumber","deprecationsByPackage","packageName","getDeprecations","console","warn","deprecationSite","error","originalStackTraceLimit","_base2","stackTraceLimit","serializedDeprecation","originalPrepareStackTrace","prepareStackTrace","captureStackTrace","callbackProperties","decorateElementClass","decorateElementPrototype","deprecate","__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__","__CUSTOM_HTML_ELEMENTS_CLASSES__","ref","apply","nodeName","elementClass","elementPrototype","klass","proto","create","HTMLElement","registerElement","ExcludedClassProperties","ExcludedPrototypeProperties","Mixin","extended","includeInto","extend","hasOwnProperty","included","call","Ancestors","node","selector","parents","eachParent","parent","matches","block","results","queryParentSelectorAll","listener","addEventListener","removeEventListener","DisposableEvents","NO_SELECTOR","eachPair","EventsDelegation","events","disposablesForObject","eventsForObject","eventsMap","WeakMap","disposablesMap","createEventListener","unsubscribeFrom","addDisposableEventListener","e","decorateEvent","eachSelectorFromTarget","isPropagationStopped","nodeAndItsAncestors","eachSelector","matched","targetMatch","isImmediatePropagationStopped","overriddenStop","overriddenStopImmediate","Event","stopPropagation","stopImmediatePropagation","BabelSpacePenDSL","Builder","SelfClosingTags","SpacePenDSL","Tags","Template","tag","buildContent","content","__content__","__create__","__createdCallback__","useShadowRoot","__useShadowRoot__","html","root","buildHtml","shadowRoot","createShadowRoot","innerHTML","wireOutlets","getAttribute","removeAttribute","Babel","currentBuilder","subview","tagName","args","raw","postProcessingSteps","extractOptions","openTag","attributes","closeTag","attributeName","attributePairs","attributesString","escapedString","outletName","subviewId","idCounter","id","parentView","find","replaceWith","arg","reject","failures","remains","required","solved","pkg","failHandler","promise","reason","activatePackage","activatedPackage","mainModule","fail","catch","AncestorsMethods","require$$3","require$$4","stateHandler","state","isDetectable","isBusy","busy","idHandler","getListeners","eventListeners","listeners","idCount","generate","idGenerator","quiet","noop","reporter","log","attachFunction","f","detector","isIE","version","agent","navigator","userAgent","v","div","getElementsByTagName","undef","isLegacyOpera","opera","processBatch","isProcessing","processingBatch","process","processBatchAsync","asyncFrameHandler","asyncProcess","utils","autoProcess","localAsyncProcess","clearTimeout","buildCssTextString","rules","seperator","important","trim","getObject","batchProcessor","browserDetector","mutateDom","alterPositionStyles","position","setProperty","removeRelativeStyles","getNumericalValue","positionCheckPerformed","OBJECT_STYLE","tabIndex","onload","getDocument","contentDocument","checkForObjectDocumentTimeoutId","objectDocument","getComputedStyle","offsetWidth","offsetHeight","startSize","injectObject","listenerProxy","proxy","attachEvent","defaultView","detachEvent","initDocument","targetDocument","styleId","containerClass","getElementById","containerAnimationClass","containerAnimationActiveClass","method","styleElement","injectStyle","injectScrollStyle","detectionContainerClass","addEvent","el","cb","removeEvent","getExpandElement","container","childNodes","getShrinkElement","scrollbarSizes","child","body","insertBefore","firstChild","widthSize","clientWidth","heightSize","clientHeight","getScrollbarSizes","debug","isUnrendered","getStyle","elementStyle","top","right","bottom","left","widthCSS","heightCSS","storeStyle","storeCurrentSize","lastWidth","lastHeight","getWidthOffset","getHeightOffset","getExpandWidth","getExpandHeight","positionScrollbars","expand","shrink","expandWidth","expandHeight","shrinkWidth","getShrinkWidth","shrinkHeight","getShrinkHeight","scrollLeft","scrollTop","injectContainerElement","className","addAnimationClass","onAnimationStart","onRendered","injectScrollElements","onExpandScroll","onExpand","onShrinkScroll","onShrink","rootContainer","scrollbarWidth","scrollbarHeight","containerContainerStyle","containerStyle","expandStyle","shrinkStyle","expandChildStyle","shrinkChildStyle","containerContainer","expandChild","shrinkChild","dir","registerListenersAndPositionElements","updateChildSizes","getExpandChildElement","updateDetectorElements","sizeChanged","areElementsInjected","notifyListenersIfNeeded","lastNotifiedWidth","lastNotifiedHeight","handleScroll","finalizeDomMutation","ready","install","ownerDocument","contains","isInDocument","isDetached","idGeneratorMaker","defaultIdHandler","idHandlerMaker","reporterMaker","batchProcessorMaker","globalOptions","callOnAdd","detectionStrategy","eventListenerHandler","listenerHandlerMaker","elementUtils","elementUtilsMaker","desiredStrategy","importantCssRules","strategyOptions","scrollStrategyMaker","objectStrategyMaker","onReadyCallbacks","elements","onResizeCallback","addListener","elementsReady","onReadyCallback","markBusy","makeDetectable","markAsDetectable","removeListener","removeAllListeners","uninstall","nextId","Decoration","decorationProperties","marker","setProperties","markerDestroyDisposable","screenRange","isType","newProperties","oldProperties","DecorationManagement","decorationsById","decorationsByMarkerId","decorationMarkerChangedSubscriptions","decorationMarkerDestroyedSubscriptions","decorationUpdatedSubscriptions","decorationDestroyedSubscriptions","values","startScreenRow","endScreenRow","markers","findMarkers","intersectsScreenRowRange","decorationsByTypeThenRowsCache","cache","decorationParams","has","removeAllDecorationsForMarker","onDidChange","invalidateDecorationForScreenRowsCache","emitDecorationChanges","oldTailScreenPosition","oldHeadScreenPosition","newTailScreenPosition","newHeadScreenPosition","rangesDiffs","emitRangeChanges","onDidChangeProperties","removeDecoration","editorDestroyed","lastRenderedScreenRow","getLastVisibleScreenRow","firstRenderedScreenRow","getFirstVisibleScreenRow","subscription","index","removedAllMarkerDecorations","decorationMarkerChangedSubscriptionsValues","decorationMarkerDestroyedSubscriptionsValues","decorationUpdatedSubscriptionsValues","decorationDestroyedSubscriptionsValues","decorationsByIdValues","removeAllDecorations","CanvasLayer","canvas","desynchronized","platform","getContext","webkitImageSmoothingEnabled","imageSmoothingEnabled","offscreenCanvas","offscreenContext","drawImage","srcY","destY","CanvasDrawer","devicePixelRatio","getDevicePixelRatio","getLineHeight","getCharHeight","getCharWidth","canvasHeight","getTextEditor","getTextEditorElement","displayCodeHighlights","getScreenLineCount","decorationsByTypeThenRows","Main.getPluginsOrder","drawCustomDecorationLambda","oneOrMoreWhiteSpaceRegexp","highlight-under","gutter","highlight-over","highlight-outline","MinimapQuickSettingsElement","input","outlet","ol","li","selectedItem","itemsActions","codeHighlights","classList","absoluteMode","adjustAbsoluteModeHeight","Main.onDidAddPlugin","addItemFor","Main.onDidRemovePlugin","removeItemFor","Main.onDidActivatePlugin","activateItem","Main.onDidDeactivatePlugin","deactivateItem","core:move-up","selectPreviousItem","core:move-down","selectNextItem","core:cancel","core:confirm","toggleSelectedItem","subscribeTo","mousedown","preventDefault","hiddenInput","focusout","passive","onLeftButton","onRightButton","bool","initList","focus","itemsDisposables","Main.plugins","nextSibling","list","previousSibling","lastChild","item","action","Main.togglePluginActivation","separator","minimapQuickSettingsElement","initClass","elementResizeDetector","elementResizeDetectorImport","strategy","visibleAreaSubscription","quickSettingsSubscription","dragSubscription","openQuickSettingSubscription","displayMinimapOnLeft","minimapScrollIndicator","displayPluginsControls","adjustToSoftWrap","visibleArea","controls","scrollIndicator","openQuickSettings","quickSettingsElement","attached","attachedToTextEditor","wasVisible","frameRequested","flexBasis","initializeContent","updateMinimapFlexPosition","measureHeightAndWidth","initializeScrollIndicator","disposeScrollIndicator","requestUpdate","initializeOpenQuickSettings","disposeOpenQuickSettings","smoothScrolling","adjustOnlyIfSmaller","pollDocument","pollDOM","intersectionObserver","IntersectionObserver","entries","intersectionRect","isVisible","measureDimensions","listenTo","queryParentSelector","subscribeToMediaQuery","minimaps","querySelectorAll","detach","initializeCanvas","attachCanvases","createVisibleArea","createControls","mousewheel","onMouseWheel","getFrontCanvas","canvasPressed","touchstart","startDrag","getBoundingClientRect","initializeDecorations","onDidChangeScrollTop","onDidChangeScrollLeft","onDidChangeConfig","onDidChangeStandAlone","setStandAlone","isStandAlone","onDidChangeDecorationRange","Main.onDidChangePluginOrder","setScreenHeightAndWidth","removeControls","removeVisibleArea","enableCache","visibleAreaLeft","getTextEditorScaledScrollLeft","visibleAreaTop","getTextEditorScaledScrollTop","getScrollTop","visibleWidth","round","getTextEditorScaledHeight","transform","border-left-width","canvasTop","canvasTransform","scale","canScroll","minimapScreenHeight","getScreenHeight","indicatorHeight","getHeight","indicatorScroll","getScrollRatio","updateCanvasesSize","updateCanvas","clearCache","visibilityChanged","checkForVisibilityChange","forceUpdate","safeFlexBasis","wasResized","lineLength","softWrap","softWrapAtPreferredLineLength","maxCanvasHeight","newHeight","setCanvasesSize","canvasLeftMousePressed","canvasMiddleMousePressed","deltaY","floor","textEditorElement","getLineHeightInPixels","getTextEditorHeight","textEditorScrollTop","pixelPositionForScreenPosition","setCursorScreenPosition","independentScroll","scrollIndependentlyOnMouseWheel","getTextEditorScrollTop","minimapFrom","minimapTo","getTextEditorMaxScrollTop","getMaxScrollTop","now","t","setTextEditorScrollTop","setScrollTop","offsetTop","ratio","getVisibleHeight","mediaQuery","matchMedia","mediaListener","initial","dragOffset","mousemoveHandler","drag","dragendHandler","endDrag","touchmoveHandler","LegacyAdapter","useCache","heightCache","scrollTopCache","scrollLeftCache","maxScrollTopCache","getScrollLeft","maxScrollTop","displayBuffer","scrollPastEnd","isDestroyed","StableAdapter","computeScrollTop","lineTop","parseFloat","getVersion","getScrollHeight","component","nextModelId","adapter","configCharHeight","configCharWidth","interline","configInterline","devicePixelRatioRounding","configDevicePixelRatioRounding","redrawDelay","pendingChangeEvents","flushChangesTimer","configSubscription","subscribeToConfig","onDidChangeGrammar","ignoreTextEditorScroll","inChangeScrollTop","updateScrollTop","scheduleChanges","onDidTokenize","requestFlushChanges","emitChanges","requestedFlushChanges","flushChanges","cancelAnimationFrame","subs","opts","getRootScopeDescriptor","independentMinimapScroll","scrollSensitivity","cdprr","getVerticalScaleFactor","getHorizontalScaleFactor","getTextEditorScrollRatio","getMaxScreenLineLength","getScreenWidth","getWidth","getDefaultCharWidth","getInterline","getDevicePixelRatioRounding","getScrollTopFromEditor","abs","getCapedTextEditorScrollRatio","wheelDeltaY","updatedScrollTop","o","markBufferRange","getDecorationManagement","getDecorations","onDidAddDecoration","onDidRemoveDecoration","onDidUpdateDecoration","decorationForId","decorationsForScreenRowRange","decorateMarker","domStylesCache","dummyNode","targetNode","getFromCache","cachedData","ensureDummyNodeExistence","dotRegexp","getPropertyValue","visibility","rgbExtractRegexp","PluginManagement.registerPlugin","PluginManagement.unregisterPlugin","PluginManagement.togglePluginActivation","PluginManagement.activatePlugin","PluginManagement.deactivatePlugin","PluginManagement.getPluginsOrder"],"mappings":"wYAEA,SAASA,EAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAEhH,SAASC,EAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAOD,EAAME,OAAVD,EAAkBA,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAE7S,SAASO,EAAad,EAAae,EAAYC,GAAmJ,OAAhID,GAAYb,EAAkBF,EAAYiB,UAAWF,GAAiBC,GAAad,EAAkBF,EAAagB,GAAqBhB,ECJzM,SAASF,EAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAEhH,SAASC,EAAkBC,EAAQC,GAA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AC5BpxB,KAAKqxB,WAAaA,GAQtBvrC,2BACEka,KAAKmxB,eAAej1B,SA0BxB,MAAMu1B,GAAY,OACZG,GAAmB,mDACnBx3B,GAAY,yBCxHlB,IAAIc,IAAS,EAOTkB,IAAU,EAQHd,wBAAkB,KAO7B,IAAIG,GAAgB,KAOhBN,GAA0B,KAQlB,MAAC9E,GAAU,IAAI6N,WAKhB1S,wBAAkB,KAqU7B,MAAMkO,GAAmB,CACvBhE,oBAAAA,GACAhE,gBAAAA,GACA4F,cAAAA,GACAG,gBAAAA,GACAC,mBAAAA,GACAC,eAAAA,GACAC,kBAAAA,GACAC,oBAAAA,GACAC,sBAAAA,GACAC,uBAAAA,GACAC,aAAAA,GACAC,wBAAAA,GACAC,iBAAAA,GACAO,2BAAAA,GACAE,iBAAAA,GACAG,gBAAAA,GACA7I,eAAgB47B,GAChBl7B,iBAAkBm7B,GAClBj7B,uBAAwBk7B,GACxB96B,qBAAsB+E,GACtBzE,eAAgBy6B,GAChB76B,iBAAkB86B,GAClB75B,gBAAiB85B"} \ No newline at end of file diff --git a/dist/main-f082673e.js b/dist/main-f082673e.js deleted file mode 100644 index aac3e805..00000000 --- a/dist/main-f082673e.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function t(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((i=>{var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:()=>e[i]})})),t}function i(e){var t={exports:{}};return e(t,t.exports),t.exports}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function h(e){if(null==Qe&&(Qe=Ze),!Qe.isDisposable(e))throw new TypeError("Arguments to CompositeDisposable.add must have a .dispose() method")}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var i=0;t.length>i;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function u(e,t,i){return t&&c(e.prototype,t),i&&c(e,i),e}function p(){var e={},t=0,i=0,n=0;return{add(s,o){o||(o=s,s=0),s>i?i=s:n>s&&(n=s),e[s]||(e[s]=[]),e[s].push(o),t++},process(){for(var t=n;i>=t;t++)for(var s=e[t],o=0;s.length>o;o++)(0,s[o])()},size:()=>t}}function m(e){return e[wt]={},g(e)}function g(e){return e[wt]}function f(e){delete e[wt]}function v(e){return Array.isArray(e)||void 0!==e.length}function b(e){if(Array.isArray(e))return e;var t=[];return Dt(e,(e=>{t.push(e)})),t}function y(e){return e&&1===e.nodeType}function S(e,t,i){var n=e[t];return null==n&&void 0!==i?i:n}function w(e){return e?e.replace(kt,"\\$&"):""}function x(e){return e?(e=`${e[0].toLowerCase()}${e.slice(1)}`).replace(Lt,((e,t)=>t?"-"+t.toLowerCase():"-")):""}function C(){const e=Error().stack.split("\n")[3].split("(")[1].replace(")",""),t=RegExp(atom.packages.getPackageDirPaths().join("|")+w($e.default.sep)),i=e.replace(t,"").split($e.default.sep)[0].replace(/minimap-|-minimap/,"");return 0>i.indexOf($e.default.sep)?i:void 0}function E(e,t,i,n){const s=[];return e.isLessThan(i)?s.push([e,i]):i.isLessThan(e)&&s.push([i,e]),t.isLessThan(n)?s.push([t,n]):n.isLessThan(t)&&s.push([n,t]),s}function M(e,t,i,n,s,o,r,a,l,h,d,c,u,p,m,g){const f=z(t,i,o,n,s),v=e.context;if(e.clearCanvas(),0===f.length)L(t,i,0,r,a,l,h,v,d,c,u,p,m,g);else{for(let i=0,n=f.length;n>i;i++){const n=f[i];e.copyPartFromOffscreen(n.offscreenRow*r,(n.start-t)*r,(n.end-n.start)*r)}let n=t;for(let e=0,i=f.length;i>e;e++){const i=f[e];L(n,i.start,n-t,r,a,l,h,v,d,c,u,p,m,g),n=i.end}n>i||L(n,i,n-t,r,a,l,h,v,d,c,u,p,m,g)}e.resetOffscreenSize(),e.copyToOffscreen()}function D(e,t,i,n,s,o,r,a,l,h){const d=z(t,i,o,n,s);if(e.clearCanvas(),0===d.length)F(t,i,0,r,a,l,h);else{for(let i=0,n=d.length;n>i;i++){const n=d[i];e.copyPartFromOffscreen(n.offscreenRow*a,(n.start-t)*a,(n.end-n.start)*a)}let n=t;for(let e=0,i=d.length;i>e;e++){const i=d[e];F(n,i.start,n-t,r,a,l,h),n=i.end}n>i||F(n,i,n-t,r,a,l,h)}e.resetOffscreenSize(),e.copyToOffscreen()}function T(e,t,i,n,s,o,r,a,l,h){const d=z(t,i,o,n,s);if(e.clearCanvas(),0===d.length)N(t,i,0,r,a,l,h);else{for(let i=0,n=d.length;n>i;i++){const n=d[i];e.copyPartFromOffscreen(n.offscreenRow*a,(n.start-t)*a,(n.end-n.start)*a)}let n=t;for(let e=0,i=d.length;i>e;e++){const i=d[e];N(n,i.start,n-t,r,a,l,h),n=i.end}n>i||N(n,i,n-t,r,a,l,h)}e.resetOffscreenSize(),e.copyToOffscreen()}function k(e,t,i,n,s,o,r,a){if(e.fillStyle=i,a){const i=t.length*o;return e.fillRect(n,s,i,r),n+i}{let i=0;for(let a=0,l=t.length;l>a;a++)" "===t[a]?(i>0&&e.fillRect(n-i*o,s,i*o,r),i=0):i++,n+=o;return i>0&&e.fillRect(n-i*o,s,i*o,r),n}}function L(e,t,i,n,s,o,r,a,l,h,d,c,u,p){if(e>t)return;let m,g,f=i*n-n;t=Math.min(t,h);for(let i=e;t>i;i++){const e=l.tokensForScreenRow(i),t=Math.min(e.length,p);for(let l=0;t>l;l++){const t=e[l],h=t.text.replace(d," "),p=t.scopes;m!==i&&(g=0,f+=n,m=i,a.clearRect(g,f,r,n)),g>r||(Ft.test(h)?g+=h.length*o:g=k(a,h,c(p),g,f,o,s,u))}}a.fill()}function A(e){const t=e.getInvisibles(),i=[];return null!=t.cr&&i.push(t.cr),null!=t.eol&&i.push(t.eol),null!=t.space&&i.push(t.space),null!=t.tab&&i.push(t.tab),0!==i.length?RegExp(i.filter((e=>"string"==typeof e)).map(w).join("|"),"g"):null}function R(e,t,i){const{context:n,lineHeight:s,canvasWidth:o,yRow:r}=t;n.fillStyle=i,n.fillRect(0,r,o,s)}function P(e,t,i){const{context:n,lineHeight:s,yRow:o}=t;n.fillStyle=i,n.fillRect(0,o,1,s)}function H(e,t,i){const{context:n,lineHeight:s,charWidth:o,canvasWidth:r,screenRow:a,yRow:l}=t,h=e.getMarker().getScreenRange(),d=h.end.row-h.start.row;if(n.fillStyle=i,0===d)n.fillRect(h.start.column*o,l,(h.end.column-h.start.column)*o,s);else if(a===h.start.row){const e=h.start.column*o;n.fillRect(e,l,r-e,s)}else n.fillRect(0,l,a===h.end.row?h.end.column*o:r,s)}function I(e,t,i){const{context:n,lineHeight:s,charWidth:o,canvasWidth:r,screenRow:a,yRow:l}=t;let h,d,c,u,p,m;const g=e.getMarker().getScreenRange(),f=g.end.row-g.start.row,v=l,b=v+s;n.fillStyle=i,0===f?(d=g.end.column-g.start.column,c=d*o,m=g.start.column*o,p=m+c,n.fillRect(m,v,c,1),n.fillRect(m,b-1,c,1),n.fillRect(m,v,1,s),n.fillRect(p,v,1,s)):1===f?(m=g.start.column*o,p=g.end.column*o,a===g.start.row?(c=r-m,u=Math.max(m,p),h=r-u,n.fillRect(m,v,c,1),n.fillRect(u,b-1,h,1),n.fillRect(m,v,1,s),n.fillRect(r-1,v,1,s)):(c=r-m,h=r-p,n.fillRect(0,v,m,1),n.fillRect(0,b-1,p,1),n.fillRect(0,v,1,s),n.fillRect(p,v,1,s))):(m=g.start.column*o,p=g.end.column*o,a===g.start.row?(c=r-m,n.fillRect(m,v,c,1),n.fillRect(m,v,1,s),n.fillRect(r-1,v,1,s)):a===g.end.row?(c=r-m,n.fillRect(0,b-1,p,1),n.fillRect(0,v,1,s),n.fillRect(p,v,1,s)):(n.fillRect(0,v,1,s),n.fillRect(r-1,v,1,s),a===g.start.row+1&&n.fillRect(0,v,m,1),a===g.end.row-1&&n.fillRect(p,b-1,r-p,1)))}function O(e,t,i,n){const s=e.getProperties().render;s&&(t.color=i,s(e,t,n))}function _(e,t,i,n,s){let o=[];i.context.clearRect(0,i.yRow,i.canvasWidth,i.lineHeight);for(const i in n)o=o.concat(null!=t[i]&&t[i][e]||[]);if(o.sort(((e,t)=>(i.orders[e.properties.plugin]||0)-(i.orders[t.properties.plugin]||0))),null!=o?o.length:void 0)for(let e=0,t=o.length;t>e;e++){const t=o[e],r=n[t.properties.type];if(Ot){const e=r.name.split("$").pop().replace("Lambda","");_t[e](t,i,q(t,s))}else r(t,i,q(t,s))}}function N(e,t,i,n,s,o,r){if(t>=e){for(let a=e;t>=a;a++)n.row=i+(a-e),n.yRow=n.row*s,n.screenRow=a,_(a,r,n,Bt,o);n.context.fill()}}function F(e,t,i,n,s,o,r){if(t>=e){for(let a=e;t>=a;a++)n.row=i+(a-e),n.yRow=n.row*s,n.screenRow=a,_(a,r,n,jt,o);n.context.fill()}}function W(e,t){return B(exports.domStylesReader.retrieveStyleFromDom([".editor"],"color",e,!0),t)}function j(e,t,i){return B(exports.domStylesReader.retrieveStyleFromDom(e,"color",t,!0),i)}function B(e,t){return`rgba(${e.slice(4,-1)}, ${t})`}function q(e,t){const i=e.getProperties();if(i.color)return i.color;if(i.scope){const e=i.scope.split(/\s+/);return exports.domStylesReader.retrieveStyleFromDom(e,"background-color",t,!0)}return W(t)}function z(e,t,i,n,s){if(null==n&&null==s)return[];let o=[{start:n,end:s,offscreenRow:0}];for(let e=0,t=i.length;t>e;e++){const t=i[e],n=[];for(let e=0,i=o.length;i>e;e++){const i=o[e];i.start>t.end&&0!==t.screenDelta?n.push({start:i.start+t.screenDelta,end:i.end+t.screenDelta,offscreenRow:i.offscreenRow}):i.start>t.end||t.start>i.end?n.push(i):(t.start>i.start&&n.push({start:i.start,end:t.start-1,offscreenRow:i.offscreenRow}),i.end>t.end&&n.push(0!==t.bufferDelta||0!==t.screenDelta?{start:t.end+t.screenDelta+1,end:i.end+t.screenDelta,offscreenRow:i.offscreenRow+t.end+1-i.start}:{start:t.end+1,end:i.end,offscreenRow:i.offscreenRow+t.end+1-i.start}))}o=n}return U(o,e,t)}function U(e,t,i){let n=0;for(;e.length>n;){const s=e[n];t>s.start&&(s.offscreenRow+=t-s.start,s.start=t),s.end>i&&(s.end=i),s.end>s.start||e.splice(n--,1),n++}return e.sort(((e,t)=>e.offscreenRow-t.offscreenRow))}function V(e,...t){t.forEach((t=>{$(e,t)}))}function $(e,t){Object.getOwnPropertyNames(t).forEach((i=>{0>["length","name","arguments","caller","prototype","includeInto"].indexOf(i)&&Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})),Object.getOwnPropertyNames(t.prototype).forEach((i=>{"constructor"!==i&&Object.defineProperty(e.prototype,i,Object.getOwnPropertyDescriptor(t.prototype,i))}))}function Q(e,t){return ct.registerOrUpdateElement(t,{class:e})}function Y(){Vt||(Vt=document.createElement("style"),Vt.setAttribute("context","atom-text-editor-minimap"),document.head.appendChild(Vt))}function G(){Vt&&(Vt.parentNode.removeChild(Vt),Vt=null)}function Z(e){Vt&&(Vt.textContent=`\n atom-text-editor[with-minimap].editor > div,\n atom-text-editor[with-minimap] > div {\n margin-left: ${e}px;\n }\n `)}function X(e){return{x:e.pageX,y:e.pageY,isLeftMouse:0===e.button,isMiddleMouse:1===e.button}}function K(e){const t=e.changedTouches[0];return{x:t.pageX,y:t.pageY,isLeftMouse:!0,isMiddleMouse:!1}}function J(e,t){if(!e)return;let i="";for(const e in t)i+=`${e}: ${t[e]}; `;e.style.cssText=i}function ee(e=0,t=0,i=!1){return i?`translate3d(${e}px, ${t}px, 0)`:`translate(${e}px, ${t}px)`}function te(e=0,t=e,i=!1){return i?`scale3d(${e}, ${t}, 1)`:`scale(${e}, ${t})`}function ie({from:e,to:t,duration:i,step:n}){const s=se();let o;const r=()=>{const a=se()-s;o=0===i?1:a/i,o>1&&(o=1);const l=ne(o);n(e+(t-e)*l,l),1>o&&requestAnimationFrame(r)};r()}function ne(e){return.5-Math.cos(e*Math.PI)/2}function se(){return new Date}function oe(e,t){ki[e]=t,Li[e]=new ze.CompositeDisposable,Wi.emit("did-add-plugin",{name:e,plugin:t}),atom.config.get("minimap.displayPluginsControls")&&pe(e,t),de(e)}function re(e){const t=ki[e];atom.config.get("minimap.displayPluginsControls")&&fe(e),delete ki[e],Wi.emit("did-remove-plugin",{name:e,plugin:t})}function ae(e,t){const i="minimap.plugins."+e;null!=t?atom.config.set(i,t):atom.config.set(i,!atom.config.get(i)),de(e)}function le(){for(const[e,t]of he())t.deactivatePlugin(),Wi.emit("did-deactivate-plugin",{name:e,plugin:t})}function*he(){for(const e in ki)yield[e,ki[e]]}function de(e){const t=ki[e],i=t.isActive(),n=atom.config.get("minimap.plugins."+e);atom.config.get("minimap.displayPluginsControls")?n&&!i?ce(e,t):i&&!n&&ue(e,t):i?i&&ue(e,t):ce(e,t)}function ce(e,t){const i={name:e,plugin:t};t.activatePlugin(),Wi.emit("did-activate-plugin",i)}function ue(e,t){const i={name:e,plugin:t};t.deactivatePlugin(),Wi.emit("did-deactivate-plugin",i)}function pe(e,t){const i="minimap.plugins."+e,n=`minimap.plugins.${e}DecorationsZIndex`,s=Ee();s.plugins.properties[e]={type:"boolean",title:e,description:`Whether the ${e} plugin is activated and displayed in the Minimap.`,default:!0},s.plugins.properties[e+"DecorationsZIndex"]={type:"integer",title:e+" decorations order",description:`The relative order of the ${e} plugin's decorations in the layer into which they are drawn. Note that this order only apply inside a layer, so highlight-over decorations will always be displayed above line decorations as they are rendered in different layers.`,default:0},void 0===atom.config.get(i)&&atom.config.set(i,!0),void 0===atom.config.get(n)&&atom.config.set(n,0),Li[e].add(atom.config.observe(i,(()=>{de(e)}))),Li[e].add(atom.config.observe(n,(i=>{me(e),Wi.emit("did-change-plugin-order",{name:e,plugin:t,order:i})}))),Li[e].add(atom.commands.add("atom-workspace",{["minimap:toggle-"+e](){ae(e)}})),me(e)}function me(e){Ai[e]=atom.config.get(`minimap.plugins.${e}DecorationsZIndex`)}function ge(){return Ai}function fe(e){Li[e].dispose(),delete Li[e],delete Ee().plugins.properties[e]}function ve(){return be("core.useTreeSitterParsers",!0,"Tree-sitter is off (Low Performance Warning).","You should turn on Atom's tree-sitter parser to experience the best performance Minimap and Atom is deisgned for.\n Keeping tree-sitter parser off results in sluggish scrolling and lags in the text editor.")}function be(e,t,i,n){return atom.config.observe(e,(s=>{if(s!==t){const s="Minimap."+e,o=new Date,r=window.localStorage.getItem(s);let a=null;if(r&&(a=new Date(Date.parse(r)).getDay()),!a||"number"==typeof a&&a-o.getDay()>=1){window.localStorage.setItem(s,o);const r=atom.notifications.addWarning(i,{description:n,dismissable:!0,buttons:[{text:`Set to ${t} and restart Atom`,onDidClick(){atom.config.set(e,!0),r.dismiss(),window.localStorage.removeItem(s),setTimeout((()=>{atom.reload()}),1500)}}]})}}}))}function ye(e,t){const i=e.match(/rgb(a?)\((\d+), (\d+), (\d+)(, (\d+(\.\d+)?))?\)/);let[,,n,s,o,,r]=i,[,a]=t.match(Ii);return[n,s,o,r,a]=[n,s,o,r,a].map(Number),[n,s,o]=Se(n,s,o,a),isNaN(r)?`rgb(${n}, ${s}, ${o})`:`rgba(${n}, ${s}, ${o}, ${r})`}function Se(e,t,i,n){function s(e){return Math.ceil(Math.max(0,Math.min(255,e)))}const o=[1,0,0,0,1,0,0,0,1],r=.2126,a=.7152,l=.0722,h=Math.cos(n*Math.PI/180),d=Math.sin(n*Math.PI/180);return o[0]=r+.7874*h-r*d,o[1]=a-a*h-a*d,o[2]=l-l*h+.9278*d,o[3]=r-r*h+.143*d,o[4]=a+(1-a)*h+.14*d,o[5]=l-l*h-.283*d,o[6]=r-r*h-.7874*d,o[7]=a-a*h+a*d,o[8]=l+.9278*h+l*d,[s(o[0]*e+o[1]*t+o[2]*i),s(o[3]*e+o[4]*t+o[5]*i),s(o[6]*e+o[7]*t+o[8]*i)]}function we(){Oi||(Fi=atom.commands.add("atom-workspace",{"minimap:toggle"(){Me()},async"minimap:generate-coffee-plugin"(){await De("coffee")},async"minimap:generate-javascript-plugin"(){await De("javascript")},async"minimap:generate-babel-plugin"(){await De("babel")}}),exports.editorsMinimaps=new Map,exports.domStylesReader=new Ri,Ni=new ze.CompositeDisposable,Oi=!0,atom.config.get("minimap.autoToggle")&&Me())}function xe(e){if(e instanceof ei){const t=new Yt;return t.setModel(e),t}}function Ce(){Oi&&(le(),exports.editorsMinimaps&&(exports.editorsMinimaps.forEach((e=>{e.destroy()})),exports.editorsMinimaps.clear()),Ni.dispose(),Ni=null,Fi.dispose(),Fi=null,exports.editorsMinimaps=void 0,exports.domStylesReader.invalidateDOMStylesCache(),_i=!1,Oi=!1)}function Ee(){return Ti||atom.packages.getLoadedPackage("minimap").metadata.configSchema}function Me(){if(Oi){if(_i){_i=!1,exports.editorsMinimaps&&(exports.editorsMinimaps.forEach((e=>{e.destroy()})),exports.editorsMinimaps.clear()),Ni.dispose();const e=atom.isMaximized(),{width:t,height:i}=atom.getSize();atom.setSize(t,i),e&&atom.maximize()}else _i=!0,Be();exports.domStylesReader.invalidateDOMStylesCache()}}async function De(e){const{default:t}=await Promise.resolve().then((()=>require("./minimap-plugin-generator-element-d36805fc.js"))),i=new t;i.template=e,i.attach()}function Te(e){return Wi.on("did-activate",e)}function ke(e){return Wi.on("did-deactivate",e)}function Le(e){return Wi.on("did-create-minimap",e)}function Ae(e){return Wi.on("did-add-plugin",e)}function Re(e){return Wi.on("did-remove-plugin",e)}function Pe(e){return Wi.on("did-activate-plugin",e)}function He(e){return Wi.on("did-deactivate-plugin",e)}function Ie(e){return Wi.on("did-change-plugin-order",e)}function Oe(){return ei}function _e(e){if(e)return Ne(e.getModel())}function Ne(e){if(!e)return;if(!exports.editorsMinimaps)return;let t=exports.editorsMinimaps.get(e);if(void 0===t||t.destroyed){t=new ei({textEditor:e}),exports.editorsMinimaps.set(e,t);const i=e.onDidDestroy((()=>{exports.editorsMinimaps&&exports.editorsMinimaps.delete(e),i.dispose()}))}return t}function Fe(e){if(e)return new ei({textEditor:e,standAlone:!0})}function We(){return Ne(atom.workspace.getActiveTextEditor())}function je(e){if(e)return exports.editorsMinimaps&&exports.editorsMinimaps.forEach((t=>{e(t)})),Le((t=>{e(t)}))}function Be(){Ni.add(atom.workspace.observeTextEditors((e=>{const t=Ne(e),i=t.getMinimapElement()||xe(t);Wi.emit("did-create-minimap",t),i.attach(e.getElement())})),atom.themes.onDidChangeActiveThemes((()=>{exports.domStylesReader.invalidateDOMStylesCache(),exports.editorsMinimaps.forEach((e=>{atom.views.getView(e).requestForcedUpdate()}))})),ve())}function qe(){return ji}const ze=require("atom"),Ue=require("path"),Ve=e(ze),$e=e(Ue);var Qe,Ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ge=i((function(e){e.exports=function(){function e(e,t,i){this.message=e,this.fileName=t,this.lineNumber=i,this.callCount=0,this.stackCount=0,this.stacks={},this.stackCallCounts={}}return e.getFunctionNameFromCallsite=e=>{},e.deserialize=t=>{var i,n,s,o,r;for(s=t.stacks,i=new e(t.message,t.fileName,t.lineNumber),o=0,r=s.length;r>o;o++)i.addStack(n=s[o],n.metadata);return i},e.prototype.getFunctionNameFromCallsite=e=>{var t,i,n;return null!=e.functionName?e.functionName:e.isToplevel()?null!=(t=e.getFunctionName())?t:"":e.isConstructor()?"new "+e.getFunctionName():e.getMethodName()&&!e.getFunctionName()?e.getMethodName():e.getTypeName()+"."+(null!=(i=null!=(n=e.getMethodName())?n:e.getFunctionName())?i:"")},e.prototype.getLocationFromCallsite=function(e){return null==e?"unknown":null!=e.location?e.location:e.isNative()?"native":e.isEval()?"eval at "+this.getLocationFromCallsite(e.getEvalOrigin()):e.getFileName()+":"+e.getLineNumber()+":"+e.getColumnNumber()},e.prototype.getFileNameFromCallSite=e=>{var t;return null!=(t=e.fileName)?t:e.getFileName()},e.prototype.getOriginName=function(){return this.originName},e.prototype.getMessage=function(){return this.message},e.prototype.getStacks=function(){var e,t,i,n,s;for(e in i=[],s=this.stacks)(t=this.parseStack(n=s[e])).callCount=this.stackCallCounts[e],t.metadata=n.metadata,i.push(t);return i},e.prototype.getStackCount=function(){return this.stackCount},e.prototype.getCallCount=function(){return this.callCount},e.prototype.addStack=function(e,t){var i,n,s;return null==this.originName&&(this.originName=this.getFunctionNameFromCallsite(e[0])),null==this.fileName&&(this.fileName=this.getFileNameFromCallSite(e[0])),null==this.lineNumber&&(this.lineNumber="function"==typeof(n=e[0]).getLineNumber?n.getLineNumber():void 0),this.callCount++,e.metadata=t,i=this.getLocationFromCallsite(e[1]),null==this.stacks[i]&&(this.stacks[i]=e,this.stackCount++),null==(s=this.stackCallCounts)[i]&&(s[i]=0),this.stackCallCounts[i]++},e.prototype.parseStack=function(e){return e.map((t=this,e=>({functionName:t.getFunctionNameFromCallsite(e),location:t.getLocationFromCallsite(e),fileName:t.getFileNameFromCallSite(e)})));var t},e.prototype.serialize=function(){return{message:this.getMessage(),lineNumber:this.lineNumber,fileName:this.fileName,stacks:this.getStacks()}},e}()})),Ze=function(){function e(t){n(this,e),this.disposed=!1,this.disposalAction=t}return o(e,null,[{key:"isDisposable",value:e=>"function"==typeof(null!=e?e.dispose:void 0)}]),o(e,[{key:"dispose",value(){this.disposed||(this.disposed=!0,"function"==typeof this.disposalAction&&this.disposalAction(),this.disposalAction=null)}}]),e}(),Xe=function(){function e(){r(this,e),this.disposed=!1,this.disposables=new Set;var t=!0,i=!1,n=void 0;try{for(var s,o=arguments[Symbol.iterator]();!(t=(s=o.next()).done);t=!0){var a=s.value;this.add(a)}}catch(e){i=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(i)throw n}}}return l(e,[{key:"dispose",value(){this.disposed||(this.disposed=!0,this.disposables.forEach((e=>e.dispose())),this.disposables=null)}},{key:"add",value(){if(!this.disposed){var e=!0,t=!1,i=void 0;try{for(var n,s=arguments[Symbol.iterator]();!(e=(n=s.next()).done);e=!0){var o=n.value;h(o),this.disposables.add(o)}}catch(e){t=!0,i=e}finally{try{e||null==s.return||s.return()}finally{if(t)throw i}}}}},{key:"remove",value(e){this.disposed||this.disposables.delete(e)}},{key:"delete",value(e){this.remove(e)}},{key:"clear",value(){this.disposed||this.disposables.clear()}}]),e}(),Ke=function(){function e(){d(this,e),this.disposed=!1,this.clear()}return u(e,null,[{key:"onEventHandlerException",value(e){var t=this;return 0===this.exceptionHandlers.length&&(this.dispatch=this.exceptionHandlingDispatch),this.exceptionHandlers.push(e),new Ze((()=>{if(t.exceptionHandlers.splice(t.exceptionHandlers.indexOf(e),1),0===t.exceptionHandlers.length)return t.dispatch=t.simpleDispatch}))}},{key:"simpleDispatch",value:(e,t)=>e(t)},{key:"exceptionHandlingDispatch",value(e,t){try{return e(t)}catch(e){return this.exceptionHandlers.map((t=>t(e)))}}}]),u(e,[{key:"clear",value(){null!=this.subscriptions&&this.subscriptions.dispose(),this.subscriptions=new Xe,this.handlersByEventName={}}},{key:"dispose",value(){this.subscriptions.dispose(),this.handlersByEventName=null,this.disposed=!0}},{key:"on",value(e,t,i){var n=this;if(null==i&&(i=!1),this.disposed)throw Error("Emitter has been disposed");if("function"!=typeof t)throw Error("Handler must be a function");this.handlersByEventName[e]?i?this.handlersByEventName[e].unshift(t):this.handlersByEventName[e].push(t):this.handlersByEventName[e]=[t];var s=new Ze((()=>(n.subscriptions.remove(s),n.off(e,t))));return this.subscriptions.add(s),s}},{key:"once",value(e,t,i){null==i&&(i=!1);var n=this.on(e,(e=>(n.dispose(),t(e))),i);return n}},{key:"preempt",value(e,t){return this.on(e,t,!0)}},{key:"off",value(e,t){if(!this.disposed){var i=this.handlersByEventName[e];if(i){var n=i.indexOf(t);0>n||i.splice(n,1),0===i.length&&delete this.handlersByEventName[e]}}}},{key:"emit",value(e,t){var i=this.handlersByEventName&&this.handlersByEventName[e];if(i)for(var n=i.slice(),s=0;n.length>s;s++)this.constructor.dispatch(n[s],t)}},{key:"emitAsync",value(e,t){var i=this,n=this.handlersByEventName&&this.handlersByEventName[e];if(n){var s=n.map((e=>i.constructor.dispatch(e,t)));return Promise.all(s).then((()=>{}))}return Promise.resolve()}},{key:"getEventNames",value(){return Object.keys(this.handlersByEventName)}},{key:"listenerCountForEventName",value(e){var t=this.handlersByEventName[e];return null==t?0:t.length}},{key:"getTotalListenerCount",value(){for(var e=0,t=Object.keys(this.handlersByEventName),i=0;t.length>i;i++)e+=this.handlersByEventName[t[i]].length;return e}}]),e}();Ke.dispatch=Ke.simpleDispatch,Ke.exceptionHandlers=[];var Je=Ke,et=Je,tt=Ze,it=Xe,nt={Emitter:et,Disposable:tt,CompositeDisposable:it},st=i((function(e){!function(){var t,i,n;t=Ge,null==Ye.__grim__&&(n=Ye.__grim__={deprecations:{},emitter:new(0,nt.Emitter),includeDeprecatedAPIs:!0,getDeprecations(){var e,t,i,s,o,r,a;for(s in e=[],a=n.deprecations)for(o in t=a[s])for(r in i=t[o])e.push(i[r]);return e},getDeprecationsLength(){return this.getDeprecations().length},clearDeprecations(){n.deprecations={}},logDeprecations(){var e,t,i,n;for((t=this.getDeprecations()).sort(((e,t)=>t.getCallCount()-e.getCallCount())),console.warn("\nCalls to deprecated functions\n-----------------------------"),i=0,n=t.length;n>i;i++)console.warn("("+(e=t[i]).getCallCount()+") "+e.getOriginName()+" : "+e.getMessage(),e)},deprecate(e,s){var o,r,a,l,h,d,c,u,p,m,g,f,v;d=Error.stackTraceLimit;try{Error.stackTraceLimit=7,u=(u=null!=(f="function"==typeof(a=Error()).getRawStack?a.getRawStack():void 0)?f:i(a)).slice(1)}finally{Error.stackTraceLimit=d}l=(r=u[0]).getFileName(),h=r.getLineNumber(),c=null!=(v=null!=s?s.packageName:void 0)?v:"",null==(p=n.deprecations)[l]&&(p[l]={}),null==(m=n.deprecations[l])[h]&&(m[h]={}),null==(g=n.deprecations[l][h])[c]&&(g[c]=new t(e)),(o=n.deprecations[l][h][c]).addStack(u,s),n.emitter.emit("updated",o)},addSerializedDeprecation(e){var i,s,o,r,a,l,h,d,c,u,p,m,g,f,v;for(r=(i=t.deserialize(e)).getMessage(),s=i.fileName,o=i.lineNumber,a=null!=(g=null!=(f=(h=i.getStacks())[0])&&null!=(v=f.metadata)?v.packageName:void 0)?g:"",null==(d=n.deprecations)[s]&&(d[s]={}),null==(c=n.deprecations[s])[o]&&(c[o]={}),null==(u=n.deprecations[s][o])[a]&&(u[a]=new t(r,s,o)),i=n.deprecations[s][o][a],p=0,m=h.length;m>p;p++)i.addStack(l=h[p],l.metadata);n.emitter.emit("updated",i)},on:(e,t)=>n.emitter.on(e,t)}),i=e=>{var t,n;return t=Error.prepareStackTrace,Error.prepareStackTrace=(e,t)=>t,Error.captureStackTrace(e,i),n=e.stack,Error.prepareStackTrace=t,n},e.exports=Ye.__grim__}()})),ot=i((function(e){var t,i,n,s;({deprecate:s}=st),null!=Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__?(Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__=Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__,delete Ye.__CUSTOM_HTML_ELEMENTS_CLASSES__):null==Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__&&(Ye.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__={}),t=["createdCallback","attachedCallback","detachedCallback","attributeChangedCallback"],n=function(e,i){return t.forEach((function(t){return Object.defineProperty(e,t,{value(){var e;return null!=(e=this["__"+t])?e.apply(this,arguments):void 0},writable:!0,enumerable:!0,configurable:!0})})),Object.getOwnPropertyNames(i).forEach((n=>{var s;if("constructor"!==n)return s=Object.getOwnPropertyDescriptor(i,n),t.indexOf(n)>-1?Object.defineProperty(e,"__"+n,s):Object.defineProperty(e,n,s)}))},i=(e,t)=>Object.getOwnPropertyNames(t).forEach((i=>{if("length"!==i&&"name"!==i&&"arguments"!==i&&"caller"!==i&&"prototype"!==i)return Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})),e.exports=(e,t)=>{var o,r,a,l,h;return({class:a}=t),(l=null!=a?a.prototype:null!=(h=t.prototype)?h:t)===t&&s("Using the prototype as the second argument is deprecated, use the prototype option instead"),__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e]?(o=__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e],n(o.prototype,l),null!=a&&i(o,a),o):(r=Object.create(HTMLElement.prototype),n(r,l),o=document.registerElement(e,{prototype:Object.create(r)}),null!=a&&i(o,a),__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[e]=o)}})),rt=i((function(e){!function(){var t,i,n,s;for(s in e.exports=n=function(){function e(){"function"==typeof this.extended&&this.extended()}return e.includeInto=function(e){var i,n,s;for(i in this.extend(e.prototype),this)n=this[i],-1===t.indexOf(i)&&(e.hasOwnProperty(i)||(e[i]=n));return null!=(s=this.included)?s.call(e):void 0},e.extend=function(e){var t,n,s,o,r;for(n=0,s=(o=Object.getOwnPropertyNames(this.prototype)).length;s>n;n++)-1===i.indexOf(t=o[n])&&(e.hasOwnProperty(t)||(e[t]=this.prototype[t]));return null!=(r=this.prototype.extended)?r.call(e):void 0},e}(),t=["__super__"],n)t.push(s);i=["constructor","extended"]}()})),at=i((function(e){var t;t=rt,e.exports=class e extends t{static parents(e,t="*"){var i;return i=[],this.eachParent(e,(e=>{if("function"==typeof e.matches?e.matches(t):void 0)return i.push(e)})),i}static eachParent(e,t){var i,n;for(null!=(i=e.parentNode)&&t(i),n=[];i=i.parentNode;)n.push(null!=i?t(i):void 0);return n}parents(t="*"){return e.parents(this,t)}queryParentSelectorAll(e){if(null==e)throw Error("::queryParentSelectorAll requires a valid selector as argument");return this.parents(e)}queryParentSelector(e){if(null==e)throw Error("::queryParentSelector requires a valid selector as argument");return this.queryParentSelectorAll(e)[0]}eachParent(t){return e.eachParent(this,t)}}})),lt=i((e=>{(()=>{var t,i;i=rt,({Disposable:t}=Ve.default),e.exports=class extends i{addDisposableEventListener(e,i,n,s){return e.addEventListener(i,n,s),new t((()=>e.removeEventListener(i,n)))}}})()})),ht=i((function(e){!function(){var t,i,n,s,o,r;s=rt,n=lt,({Disposable:i,CompositeDisposable:t}=Ve.default),r=(e,t)=>{var i,n;for(i in n=[],e)n.push(t(i,e[i]));return n},o="__NONE__",e.exports=function(){class e extends s{subscribeTo(e,t,n,s){var a,l;return e instanceof HTMLElement||([e,t,n,s]=[this,e,t,n]),"object"==typeof t&&([n,t,s]=[t,o,n]),null==this.eventsMap&&(this.eventsMap=new WeakMap),null==this.disposablesMap&&(this.disposablesMap=new WeakMap),null==this.eventsMap.get(e)&&this.eventsMap.set(e,{}),null==this.disposablesMap.get(e)&&this.disposablesMap.set(e,{}),l=this.eventsMap.get(e),a=this.disposablesMap.get(e),r(n,((i,n)=>(null==l[i]&&(l[i]={},a[i]=this.createEventListener(e,i,s)),l[i][t]=n))),new i((()=>this.unsubscribeFrom(e,t,n)))}unsubscribeFrom(e,t,i){var n,s,r;if(e instanceof HTMLElement||([e,t,i]=[this,e,t]),"object"==typeof t&&([i,t]=[t,o]),r=this.eventsMap.get(e)){for(s in i)delete r[s][t],0===Object.keys(r[s]).length&&((n=this.disposablesMap.get(e))[s].dispose(),delete n[s],delete r[s]);return 0===Object.keys(r).length?(this.eventsMap.delete(e),this.disposablesMap.delete(e)):void 0}}createEventListener(e,t,i){return this.addDisposableEventListener(e,t,(i=>{var n,s,o;if(n=null!=(s=this.eventsMap.get(e))?s[t]:void 0)return({target:o}=i),this.decorateEvent(i),this.eachSelectorFromTarget(i,o,n),i.isPropagationStopped||"function"==typeof n.__NONE__&&n.__NONE__(i),!0}),i)}eachSelectorFromTarget(e,t,i){return this.nodeAndItsAncestors(t,(t=>{if(!e.isPropagationStopped)return this.eachSelector(i,((i,n)=>{var s;if(s=this.targetMatch(t,i),!e.isImmediatePropagationStopped&&s)return n(e)}))}))}eachSelector(e,t){var i,n,s,r;for(-1!==(s=Object.keys(e)).indexOf(o)&&s.splice(s.indexOf(o),1),s.sort(((e,t)=>t.split(" ").length-e.split(" ").length)),i=0,r=s.length;r>i;i++)if(t(n=s[i],e[n]))return!0;return!1}targetMatch(e,t){var i;if(e.matches(t))return!0;for(i=e.parentNode;null!=i&&null!=i.matches;){if(i.matches(t))return!0;i=i.parentNode}return!1}nodeAndItsAncestors(e,t){var i,n;for(i=e.parentNode,t(e),n=[];null!=i&&null!=i.matches;)t(i),n.push(i=i.parentNode);return n}decorateEvent(e){var t,i;return t=Event.prototype.stopPropagation,e.stopPropagation=function(){return this.isPropagationStopped=!0,t.apply(this,arguments)},i=Event.prototype.stopImmediatePropagation,e.stopImmediatePropagation=function(){return this.isImmediatePropagationStopped=!0,i.apply(this,arguments)}}}return n.includeInto(e),e}()}()})),dt=i((function(e){var t,i,n,s,o,r,a;n=rt,r="a abbr address article aside audio b bdi bdo blockquote body button canvas caption cite code colgroup datalist dd del details dfn dialog div dl dt em fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header html i iframe ins kbd label legend li main map mark menu meter nav noscript object ol optgroup option output p pre progress q rp rt ruby s samp script section select small span strong style sub summary sup table tbody td textarea tfoot th thead time title tr u ul var video area base br col command embed hr img input keygen link meta param source track wbr".split(/\s+/),s={},"area base br col command embed hr img input keygen link meta param source track wbr".split(/\s+/).forEach((e=>s[e]=!0)),t=class extends n{buildContent(){if(null!=this.constructor.content)return o.buildContent(this,this.constructor.content)}},e.exports=o=function(){class e extends n{static includeInto(t){return super.includeInto(t),Object.defineProperty(t,"content",{enumerable:!1,get(){return this.prototype.__content__},set(e){return this.prototype.__content__=e}}),Object.defineProperty(t.prototype,"createdCallback",{enumerable:!0,get(){return this.__create__},set(e){return this.__createdCallback__=e}}),Object.defineProperty(t.prototype,"__create__",{enumerable:!0,value(){if(null!=this.__content__&&e.buildContent(this,this.__content__),null!=this.__createdCallback__)return this.__createdCallback__()}}),t.useShadowRoot=()=>t.prototype.__useShadowRoot__=!0}static buildContent(e,t){var i,n,s;return s=new a,t.call(s),[i]=s.buildHtml(),(n=n=e.__useShadowRoot__?e.shadowRoot=e.createShadowRoot():e).innerHTML=i,this.wireOutlets(e,n)}static wireOutlets(e,t){var i,n,s,o;for(n=0,s=(o=t.querySelectorAll("[outlet]")).length;s>n;n++)e[(i=o[n]).getAttribute("outlet")]=i,i.removeAttribute("outlet")}}return e.Babel=t,e}(),a=function(){class e{constructor(){this.currentBuilder=new i}subview(e,t){return this.currentBuilder.subview(e,t)}text(e){return this.currentBuilder.text(e)}tag(e,...t){return this.currentBuilder.tag(e,...t)}raw(e){return this.currentBuilder.raw(e)}buildHtml(){return this.currentBuilder.buildHtml()}}return r.forEach((function(t){return e.prototype[t]=function(...e){return this.currentBuilder.tag(t,...e)}})),e}(),i=class{constructor(){this.document=[],this.postProcessingSteps=[]}buildHtml(){return[this.document.join(""),this.postProcessingSteps]}tag(e,...t){var i;if(i=this.extractOptions(t),this.openTag(e,i.attributes),!s.hasOwnProperty(e))return"function"==typeof i.content&&i.content(),i.text&&this.text(i.text),this.closeTag(e);if(null!=i.text||null!=i.content)throw Error(`Self-closing tag ${e} cannot have text or content`)}openTag(e,t){var i,n,s;return 0===this.document.length&&null==t&&(t={}),s=(n=(()=>{var e;for(i in e=[],t)e.push(`${i}="${t[i]}"`);return e})()).length?" "+n.join(" "):"",this.document.push(`<${e}${s}>`)}closeTag(e){return this.document.push(``)}text(e){var t;return t=e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"),this.document.push(t)}raw(e){return this.document.push(e)}subview(e,t){var i;return i="subview-"+ ++idCounter,this.tag("div",{id:i}),this.postProcessingSteps.push((n=>(n[e]=t,t.parentView=n,n.find("div#"+i).replaceWith(t))))}extractOptions(e){var t,i,n,s;for(s={},i=0,n=e.length;n>i;i++)switch(typeof(t=e[i])){case"function":s.content=t;break;case"string":case"number":s.text=""+t;break;default:s.attributes=t}return s}}})),ct=i((e=>{e.exports={requirePackages(...e){return new Promise(((t,i)=>{var n,s,o,r;return o=[],n=[],s=e.length,r=()=>{if(0==--s)return n.length>0?i(n):t(o)},e.forEach(((e,t)=>{var i,s;return i=e=>(n[t]=e,r()),null!=(s=atom.packages.activatePackage(e).then((e=>(o[t]=e.mainModule,r())))).fail?s.fail(i):null!=s.catch?s.catch(i):void 0}))}))},registerOrUpdateElement:ot,Ancestors:at,AncestorsMethods:at,DisposableEvents:lt,EventsDelegation:ht,SpacePenDSL:dt}})),ut=i((e=>{(e.exports={}).forEach=(e,t)=>{for(var i=0;e.length>i;i++){var n=t(e[i]);if(n)return n}}})),pt=e=>{var t=e.stateHandler.getState;return{isDetectable(e){var i=t(e);return i&&!!i.isDetectable},markAsDetectable(e){t(e).isDetectable=!0},isBusy:e=>!!t(e).busy,markBusy(e,i){t(e).busy=!!i}}},mt=e=>{function t(t){var n=e.get(t);return void 0===n?[]:i[n]||[]}var i={};return{get:t,add(t,n){var s=e.get(t);i[s]||(i[s]=[]),i[s].push(n)},removeListener(e,i){for(var n=t(e),s=0,o=n.length;o>s;++s)if(n[s]===i){n.splice(s,1);break}},removeAllListeners(e){var i=t(e);i&&(i.length=0)}}},gt=()=>{var e=1;return{generate:()=>e++}},ft=e=>{var t=e.idGenerator,i=e.stateHandler.getState;return{get(e){var t=i(e);return t&&void 0!==t.id?t.id:null},set(e){var n=i(e);if(!n)throw Error("setId required the element to have a resize detection state.");var s=t.generate();return n.id=s,s}}},vt=e=>{function t(){}var i={log:t,warn:t,error:t};if(!e&&window.console){var n=(e,t)=>{e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var i=0;arguments.length>i;i++)e(arguments[i])}};n(i,"log"),n(i,"warn"),n(i,"error")}return i},bt=i((e=>{var t=e.exports={};t.isIE=e=>{return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==(()=>{var e=3,t=document.createElement("div"),i=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]>4?e:void 0})());var t},t.isLegacyOpera=()=>!!window.opera})),yt=i((e=>{(e.exports={}).getOption=(e,t,i)=>{var n=e[t];return null==n&&void 0!==i?i:n}})),St=e=>{function t(){for(l=!0;a.size();){var e=a;a=p(),e.process()}l=!1}function i(){r=setTimeout(t,0)}var n=(e=e||{}).reporter,s=yt.getOption(e,"async",!0),o=yt.getOption(e,"auto",!0);o&&!s&&(n&&n.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),s=!0);var r,a=p(),l=!1;return{add(e,t){!l&&o&&s&&0===a.size()&&i(),a.add(e,t)},force(e){l||(void 0===e&&(e=s),r&&(clearTimeout(r),r=null),e?i():t())}}},wt="_erd",xt={initState:m,getState:g,cleanState:f},Ct=function(e){function t(t){var i=e.important?" !important; ":"; ";return(t.join(i)+i).trim()}function i(e){return o(e).object}var n=(e=e||{}).reporter,s=e.batchProcessor,o=e.stateHandler.getState;if(!n)throw Error("Missing required dependency: reporter.");return{makeDetectable(e,i,r){r||(r=i,i=e,e=null),e=e||{},bt.isIE(8)?r(i):function(i,r){function a(){function t(){if("static"===d.position){i.style.setProperty("position","relative",e.important?"important":"");var t=(t,i,n,s)=>{var o=n[s];"auto"!==o&&"0"!==(e=>e.replace(/[^-\d\.]/g,""))(o)&&(t.warn("An element that is positioned static has style."+s+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+s+" will be set to 0. Element: ",i),i.style.setProperty(s,"0",e.important?"important":""))};t(n,i,d,"top"),t(n,i,d,"right"),t(n,i,d,"bottom"),t(n,i,d,"left")}}""!==d.position&&(t(),h=!0);var s=document.createElement("object");s.style.cssText=l,s.tabIndex=-1,s.type="text/html",s.setAttribute("aria-hidden","true"),s.onload=function(){h||t(),function e(t,i){if(!t.contentDocument){var n=o(t);return n.checkForObjectDocumentTimeoutId&&window.clearTimeout(n.checkForObjectDocumentTimeoutId),void(n.checkForObjectDocumentTimeoutId=setTimeout((()=>{n.checkForObjectDocumentTimeoutId=0,e(t,i)}),100))}i(t.contentDocument)}(this,(e=>{r(i)}))},bt.isIE()||(s.data="about:blank"),o(i)&&(i.appendChild(s),o(i).object=s,bt.isIE()&&(s.data="about:blank"))}var l=t(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),h=!1,d=window.getComputedStyle(i),c=i.offsetWidth,u=i.offsetHeight;o(i).startSize={width:c,height:u},s?s.add(a):a()}(i,r)},addListener(e,t){function n(){t(e)}if(bt.isIE(8))o(e).object={proxy:n},e.attachEvent("onresize",n);else{var s=i(e);if(!s)throw Error("Element is not detectable by this strategy.");s.contentDocument.defaultView.addEventListener("resize",n)}},uninstall(e){if(o(e)){var t=i(e);t&&(bt.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),o(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(o(e).checkForObjectDocumentTimeoutId),delete o(e).object)}}}},Et=ut.forEach,Mt=e=>{function t(e){((e,t,n)=>{if(!e.getElementById(t)){var s=n+"_animation",o=n+"_animation_active",r="/* Created by the element-resize-detector library. */\n";r+="."+n+" > div::-webkit-scrollbar { "+i(["display: none"])+" }\n\n",r+="."+o+" { "+i(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+s,"animation-name: "+s])+" }\n",r+="@-webkit-keyframes "+s+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(i,n){n=n||(t=>{e.head.appendChild(t)});var s=e.createElement("style");s.innerHTML=i,s.id=t,n(s)}(r+="@keyframes "+s+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}})(e,"erd_scroll_detection_scrollbar_style",u)}function i(t){var i=e.important?" !important; ":"; ";return(t.join(i)+i).trim()}function n(e,t,i){if(e.addEventListener)e.addEventListener(t,i);else{if(!e.attachEvent)return a.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+t,i)}}function s(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i);else{if(!e.detachEvent)return a.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+t,i)}}function o(e){return h(e).container.childNodes[0].childNodes[0].childNodes[0]}function r(e){return h(e).container.childNodes[0].childNodes[0].childNodes[1]}var a=(e=e||{}).reporter,l=e.batchProcessor,h=e.stateHandler.getState,d=e.idHandler;if(!l)throw Error("Missing required dependency: batchProcessor");if(!a)throw Error("Missing required dependency: reporter.");var c=(()=>{var e=document.createElement("div");e.style.cssText=i(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=i(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var n=500-t.clientWidth,s=500-t.clientHeight;return document.body.removeChild(t),{width:n,height:s}})(),u="erd_scroll_detection_container";return t(window.document),{makeDetectable(e,t,s){function p(){if(e.debug){var i=[].slice.call(arguments);if(i.unshift(d.get(t),"Scroll: "),a.log.apply)a.log.apply(null,i);else for(var n=0;i.length>n;n++)a.log(i[n])}}function m(e){var t=h(e).container.childNodes[0],i=window.getComputedStyle(t);return!i.width||-1===i.width.indexOf("px")}function g(){var e=window.getComputedStyle(t),i={};return i.position=e.position,i.width=t.offsetWidth,i.height=t.offsetHeight,i.top=e.top,i.right=e.right,i.bottom=e.bottom,i.left=e.left,i.widthCSS=e.width,i.heightCSS=e.height,i}function f(){if(p("storeStyle invoked."),h(t)){var e=g();h(t).style=e}else p("Aborting because element has been uninstalled")}function v(e,t,i){h(e).lastWidth=t,h(e).lastHeight=i}function b(){return 2*c.width+1}function y(){return 2*c.height+1}function S(e){return e+10+b()}function w(e){return e+10+y()}function x(e,t,i){var n=o(e),s=r(e),a=S(t),l=w(i),h=(e=>2*e+b())(t),d=(e=>2*e+y())(i);n.scrollLeft=a,n.scrollTop=l,s.scrollLeft=h,s.scrollTop=d}function C(){var e=h(t).container;if(!e){(e=document.createElement("div")).className=u,e.style.cssText=i(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),h(t).container=e,(e=>{e.className+=" "+u+"_animation_active"})(e),t.appendChild(e);var s=()=>{h(t).onRendered&&h(t).onRendered()};n(e,"animationstart",s),h(t).onAnimationStart=s}return e}function E(){function s(){h(t).onExpand&&h(t).onExpand()}function o(){h(t).onShrink&&h(t).onShrink()}if(p("Injecting elements"),h(t)){(()=>{var i=h(t).style;if("static"===i.position){t.style.setProperty("position","relative",e.important?"important":"");var n=(e,t,i,n)=>{var s=i[n];"auto"!==s&&"0"!==(e=>e.replace(/[^-\d\.]/g,""))(s)&&(e.warn("An element that is positioned static has style."+n+"="+s+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+n+" will be set to 0. Element: ",t),t.style[n]=0)};n(a,t,i,"top"),n(a,t,i,"right"),n(a,t,i,"bottom"),n(a,t,i,"left")}})();var r=h(t).container;r||(r=C());var l,d,m,g,f=c.width,v=c.height,b=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),y=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(l=(l=-(1+f))?l+"px":"0"),"top: "+(d=(d=-(1+v))?d+"px":"0"),"right: "+(g=(g=-f)?g+"px":"0"),"bottom: "+(m=(m=-v)?m+"px":"0")])),S=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),w=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),x=i(["position: absolute","left: 0","top: 0"]),E=i(["position: absolute","width: 200%","height: 200%"]),M=document.createElement("div"),D=document.createElement("div"),T=document.createElement("div"),k=document.createElement("div"),L=document.createElement("div"),A=document.createElement("div");M.dir="ltr",M.style.cssText=b,M.className=u,D.className=u,D.style.cssText=y,T.style.cssText=S,k.style.cssText=x,L.style.cssText=w,A.style.cssText=E,T.appendChild(k),L.appendChild(A),D.appendChild(T),D.appendChild(L),M.appendChild(D),r.appendChild(M),n(T,"scroll",s),n(L,"scroll",o),h(t).onExpandScroll=s,h(t).onShrinkScroll=o}else p("Aborting because element has been uninstalled")}function M(){function i(t,i,n){var s=(e=>o(e).childNodes[0])(t),r=S(i),a=w(n);s.style.setProperty("width",r+"px",e.important?"important":""),s.style.setProperty("height",a+"px",e.important?"important":"")}function n(n){var o=t.offsetWidth,r=t.offsetHeight,c=o!==h(t).lastWidth||r!==h(t).lastHeight;p("Storing current size",o,r),v(t,o,r),l.add(0,(()=>{c&&(h(t)?s()?(e.debug&&(t.offsetWidth===o&&t.offsetHeight===r||a.warn(d.get(t),"Scroll: Size changed before updating detector elements.")),i(t,o,r)):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled"))})),l.add(1,(()=>{h(t)?s()?x(t,o,r):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})),c&&n&&l.add(2,(()=>{h(t)?s()?n():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}))}function s(){return!!h(t).container}function c(){p("notifyListenersIfNeeded invoked");var e=h(t);return void 0===h(t).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void Et(h(t).listeners,(e=>{e(t)})))}function u(){p("Scroll detected."),m(t)?p("Scroll event fired while unrendered. Ignoring..."):n(c)}if(p("registerListenersAndPositionElements invoked."),h(t)){h(t).onRendered=()=>{if(p("startanimation triggered."),m(t))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=o(t),i=r(t);0!==e.scrollLeft&&0!==e.scrollTop&&0!==i.scrollLeft&&0!==i.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),n(c))}},h(t).onExpand=u,h(t).onShrink=u;var g=h(t).style;i(t,g.width,g.height)}else p("Aborting because element has been uninstalled")}function D(){if(p("finalizeDomMutation invoked."),h(t)){var e=h(t).style;v(t,e.width,e.height),x(t,e.width,e.height)}else p("Aborting because element has been uninstalled")}function T(){s(t)}function k(){var e;p("Installing..."),h(t).listeners=[],e=g(),h(t).startSize={width:e.width,height:e.height},p("Element start size",h(t).startSize),l.add(0,f),l.add(1,E),l.add(2,M),l.add(3,D),l.add(4,T)}s||(s=t,t=e,e=null),e=e||{},p("Making detectable..."),(e=>!(e=>e===e.ownerDocument.body||e.ownerDocument.body.contains(e))(e)||null===window.getComputedStyle(e))(t)?(p("Element is detached"),C(),p("Waiting until element is attached..."),h(t).onRendered=()=>{p("Element is now attached"),k()}):k()},addListener(e,t){if(!h(e).listeners.push)throw Error("Cannot add listener to an element that is not detectable.");h(e).listeners.push(t)},uninstall(e){var t=h(e);t&&(t.onExpandScroll&&s(o(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&s(r(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&s(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:t}},Dt=ut.forEach,Tt=e=>{var t;if((e=e||{}).idHandler)t={get:t=>e.idHandler.get(t,!0),set:e.idHandler.set};else{var i=gt(),n=ft({idGenerator:i,stateHandler:xt});t=n}var s=e.reporter;s||(s=vt(!1===s));var o=S(e,"batchProcessor",St({reporter:s})),r={};r.callOnAdd=!!S(e,"callOnAdd",!0),r.debug=!!S(e,"debug",!1);var a,l=mt(t),h=pt({stateHandler:xt}),d=S(e,"strategy","object"),c=S(e,"important",!1),u={reporter:s,batchProcessor:o,stateHandler:xt,idHandler:t,important:c};if("scroll"===d&&(bt.isLegacyOpera()?(s.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),d="object"):bt.isIE(9)&&(s.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),d="object")),"scroll"===d)a=Mt(u);else{if("object"!==d)throw Error("Invalid strategy name: "+d);a=Ct(u)}var p={};return{listenTo(e,i,n){function o(e){var t=l.get(e);Dt(t,(t=>{t(e)}))}function d(e,t,i){l.add(t,i),e&&i(t)}if(n||(n=i,i=e,e={}),!i)throw Error("At least one element required.");if(!n)throw Error("Listener required.");if(y(i))i=[i];else{if(!v(i))return s.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");i=b(i)}var u=0,m=S(e,"callOnAdd",r.callOnAdd),g=S(e,"onReady",(()=>{})),f=S(e,"debug",r.debug);Dt(i,(e=>{xt.getState(e)||(xt.initState(e),t.set(e));var r=t.get(e);if(f&&s.log("Attaching listener to element",r,e),!h.isDetectable(e))return f&&s.log(r,"Not detectable."),h.isBusy(e)?(f&&s.log(r,"System busy making it detectable"),d(m,e,n),p[r]=p[r]||[],void p[r].push((()=>{++u===i.length&&g()}))):(f&&s.log(r,"Making detectable..."),h.markBusy(e,!0),a.makeDetectable({debug:f,important:c},e,(e=>{if(f&&s.log(r,"onElementDetectable"),xt.getState(e)){h.markAsDetectable(e),h.markBusy(e,!1),a.addListener(e,o),d(m,e,n);var t=xt.getState(e);t&&t.startSize&&(t.startSize.width===e.offsetWidth&&t.startSize.height===e.offsetHeight||o(e)),p[r]&&Dt(p[r],(e=>{e()}))}else f&&s.log(r,"Element uninstalled before being detectable.");delete p[r],++u===i.length&&g()})));f&&s.log(r,"Already detecable, adding listener."),d(m,e,n),u++})),u===i.length&&g()},removeListener:l.removeListener,removeAllListeners:l.removeAllListeners,uninstall(e){if(!e)return s.error("At least one element is required.");if(y(e))e=[e];else{if(!v(e))return s.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=b(e)}Dt(e,(e=>{l.removeAllListeners(e),a.uninstall(e),xt.cleanState(e)}))},initDocument(e){a.initDocument&&a.initDocument(e)}}};const kt=/[-/\\^$*+?.()|[\]{}]/g,Lt=/([A-Z])|(_)/g;let At=0;const Rt=()=>At++;class Pt{static isType(e,t){return Array.isArray(e.type)?e.type.indexOf(t)>=0:t===e.type}constructor(e,t,i){this.marker=e,this.minimap=t,this.emitter=new ze.Emitter,this.id=At++,this.properties=null,this.setProperties(i),this.properties.id=this.id,this.destroyed=!1,this.markerDestroyDisposable=this.marker.onDidDestroy((()=>{this.destroy()})),this.screenRange=e.getScreenRange()}destroy(){this.destroyed||(this.markerDestroyDisposable.dispose(),this.markerDestroyDisposable=null,this.destroyed=!0,this.emitter.emit("did-destroy"),this.emitter.dispose())}isDestroyed(){return this.destroyed}onDidChangeProperties(e){return this.emitter.on("did-change-properties",e)}onDidDestroy(e){return this.emitter.on("did-destroy",e)}getId(){return this.id}getMarker(){return this.marker}isType(e){return Pt.isType(this.properties,e)}getProperties(){return this.properties}setProperties(e){if(this.destroyed)return;const t=this.properties;this.properties=e,this.properties.id=this.id,this.emitter.emit("did-change-properties",{oldProperties:t,newProperties:e})}}class Ht{initializeDecorations(e){this.minimap=e,this.emitter=null==this.emitter?new ze.Emitter:this.minimap.emitter,this.decorationsById=new Map,this.decorationsByMarkerId=new Map,this.decorationMarkerChangedSubscriptions=new Map,this.decorationMarkerDestroyedSubscriptions=new Map,this.decorationUpdatedSubscriptions=new Map,this.decorationDestroyedSubscriptions=new Map,this.destroyed=!1}getDecorations(){return this.decorationsById.values()}onDidAddDecoration(e){return this.emitter.on("did-add-decoration",e)}onDidRemoveDecoration(e){return this.emitter.on("did-remove-decoration",e)}onDidChangeDecoration(e){return this.emitter.on("did-change-decoration",e)}onDidChangeDecorationRange(e){return this.emitter.on("did-change-decoration-range",e)}onDidUpdateDecoration(e){return this.emitter.on("did-update-decoration",e)}decorationForId(e){return this.decorationsById.get(e)}decorationsForScreenRowRange(e,t){const i={},n=this.findMarkers({intersectsScreenRowRange:[e,t]});for(let e=0,t=n.length;t>e;e++){const t=n[e],s=this.decorationsByMarkerId.get(t.id);void 0!==s&&(i[t.id]=s)}return i}decorationsByTypeThenRows(){if(null!=this.decorationsByTypeThenRowsCache)return this.decorationsByTypeThenRowsCache;const e={},t=this.decorationsById.values();for(const i of t){const t=i.marker.getScreenRange(),n=i.getProperties().type;null==e[n]&&(e[n]={});for(let s=t.start.row,o=t.end.row;o>=s;s++)null==e[n][s]&&(e[n][s]=[]),e[n][s].push(i)}return this.decorationsByTypeThenRowsCache=e,e}invalidateDecorationForScreenRowsCache(){this.decorationsByTypeThenRowsCache=null}decorateMarker(e,t){if(this.destroyed||this.minimap.destroyed||null==e)return;const{id:i}=e;"highlight"===t.type&&(t.type="highlight-over");const{type:n,plugin:s}=t;if(null==s&&(t.plugin=C()),null==t.scope&&null!=t.class){const e=t.class.split(" ").join(".");t.scope=".minimap ."+e}this.decorationMarkerDestroyedSubscriptions.has(i)||this.decorationMarkerDestroyedSubscriptions.set(i,e.onDidDestroy((()=>{this.removeAllDecorationsForMarker(e)}))),this.decorationMarkerChangedSubscriptions.has(i)||this.decorationMarkerChangedSubscriptions.set(i,e.onDidChange((t=>{const s=this.decorationsByMarkerId.get(i),o=e.getScreenRange();if(this.invalidateDecorationForScreenRowsCache(),void 0!==s)for(let i=0,n=s.length;n>i;i++){const n=s[i];this.emitter.emit("did-change-decoration",{marker:e,decoration:n,event:t}),this.emitDecorationChanges(n.type,n),n.screenRange=o}let r=t.oldTailScreenPosition,a=t.oldHeadScreenPosition,l=t.newTailScreenPosition,h=t.newHeadScreenPosition;r.row>a.row&&([r,a]=[a,r]),l.row>h.row&&([l,h]=[h,l]);const d=E(r,a,l,h);for(let e=0,t=d.length;t>e;e++){const[t,i]=d[e];this.emitRangeChanges(n,{start:t,end:i},0)}})));const o=new Pt(e,this,t);return this.decorationsByMarkerId.has(i)||this.decorationsByMarkerId.set(i,[]),this.decorationsByMarkerId.get(i).push(o),this.decorationsById.set(o.id,o),this.decorationUpdatedSubscriptions.has(o.id)||this.decorationUpdatedSubscriptions.set(o.id,o.onDidChangeProperties((e=>{this.emitDecorationChanges(n,o)}))),this.decorationDestroyedSubscriptions.set(o.id,o.onDidDestroy((()=>{this.removeDecoration(o)}))),this.emitDecorationChanges(n,o),this.emitter.emit("did-add-decoration",{marker:e,decoration:o}),o}emitDecorationChanges(e,t){if(this.destroyed||this.minimap.editorDestroyed())return;this.invalidateDecorationForScreenRowsCache();const i=t.screenRange;i.start&&i.end&&this.emitRangeChanges(e,i,0)}emitRangeChanges(e,t,i){const n=t.start.row,s=t.end.row,o=this.minimap.getLastVisibleScreenRow(),r=this.minimap.getFirstVisibleScreenRow();null==i&&(i=o-r-(s-n)),this.emitter.emit("did-change-decoration-range",{start:n,end:s,screenDelta:i,type:e})}removeDecoration(e){if(null==e)return;const t=e.marker;let i;this.decorationsById.delete(e.id),i=this.decorationUpdatedSubscriptions.get(e.id),void 0!==i&&i.dispose(),i=this.decorationDestroyedSubscriptions.get(e.id),void 0!==i&&i.dispose(),this.decorationUpdatedSubscriptions.delete(e.id),this.decorationDestroyedSubscriptions.delete(e.id);const n=this.decorationsByMarkerId.get(t.id);if(void 0===n)return;this.emitDecorationChanges(e.getProperties().type,e);const s=n.indexOf(e);s>-1&&(n.splice(s,1),this.emitter.emit("did-remove-decoration",{marker:t,decoration:e}),0===n.length&&this.removedAllMarkerDecorations(t))}removeAllDecorationsForMarker(e){if(null==e)return;const t=this.decorationsByMarkerId.get(e.id);if(void 0!==t){for(let i=0,n=t.length;n>i;i++){const n=t[i];this.destroyed||this.minimap.editorDestroyed()||this.emitDecorationChanges(n.getProperties().type,n),this.emitter.emit("did-remove-decoration",{marker:e,decoration:n})}this.removedAllMarkerDecorations(e)}}removedAllMarkerDecorations(e){null!=e&&(this.decorationMarkerChangedSubscriptions.get(e.id).dispose(),this.decorationMarkerDestroyedSubscriptions.get(e.id).dispose(),this.decorationsByMarkerId.delete(e.id),this.decorationMarkerChangedSubscriptions.delete(e.id),this.decorationMarkerDestroyedSubscriptions.delete(e.id))}removeAllDecorations(){const e=this.decorationMarkerChangedSubscriptions.values();for(const t of e)t.dispose();const t=this.decorationMarkerDestroyedSubscriptions.values();for(const e of t)e.dispose();const i=this.decorationUpdatedSubscriptions.values();for(const e of i)e.dispose();const n=this.decorationDestroyedSubscriptions.values();for(const e of n)e.dispose();const s=this.decorationsById.values();for(const e of s)e.destroy();this.decorationsById.clear(),this.decorationsByMarkerId.clear(),this.decorationMarkerChangedSubscriptions.clear(),this.decorationMarkerDestroyedSubscriptions.clear(),this.decorationUpdatedSubscriptions.clear(),this.decorationDestroyedSubscriptions.clear()}destroy(){this.removeAllDecorations(),this.minimap=void 0,this.emitter=void 0,this.destroyed=!0}}class It{constructor(){this.canvas=document.createElement("canvas");const e="linux"!==process.platform;this.context=this.canvas.getContext("2d",{desynchronized:e}),this.canvas.webkitImageSmoothingEnabled=!1,this.context.imageSmoothingEnabled=!1,this.offscreenCanvas=document.createElement("canvas"),this.offscreenContext=this.offscreenCanvas.getContext("2d",{desynchronized:e}),this.offscreenCanvas.webkitImageSmoothingEnabled=!1,this.offscreenContext.imageSmoothingEnabled=!1}attach(e){this.canvas.parentNode||e.appendChild(this.canvas)}setSize(e=0,t=0){this.canvas.width=e,this.canvas.height=t,this.context.imageSmoothingEnabled=!1,this.resetOffscreenSize()}getSize(){return{width:this.canvas.width,height:this.canvas.height}}resetOffscreenSize(){this.offscreenCanvas.width=this.canvas.width,this.offscreenCanvas.height=this.canvas.height,this.offscreenContext.imageSmoothingEnabled=!1}copyToOffscreen(){this.canvas.width>0&&this.canvas.height>0&&this.offscreenContext.drawImage(this.canvas,0,0)}copyFromOffscreen(){this.offscreenCanvas.width>0&&this.offscreenCanvas.height>0&&this.context.drawImage(this.offscreenCanvas,0,0)}copyPartFromOffscreen(e,t,i){this.offscreenCanvas.width>0&&this.offscreenCanvas.height>0&&this.context.drawImage(this.offscreenCanvas,0,e,this.offscreenCanvas.width,i,0,t,this.offscreenCanvas.width,i)}clearCanvas(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}}const Ot=!1;let _t;class Nt extends rt{initializeCanvas(){this.tokensLayer=new It,this.backLayer=new It,this.frontLayer=new It,this.pendingChanges||(this.pendingChanges=[]),this.pendingBackDecorationChanges||(this.pendingBackDecorationChanges=[]),this.pendingFrontDecorationChanges||(this.pendingFrontDecorationChanges=[]),this.maxTokensInOneLine=atom.config.get("minimap.maxTokensInOneLine")}getFrontCanvas(){return this.frontLayer.canvas}attachCanvases(e){this.backLayer.attach(e),this.tokensLayer.attach(e),this.frontLayer.attach(e)}setCanvasesSize(e,t){this.backLayer.setSize(e,t),this.tokensLayer.setSize(e,t),this.frontLayer.setSize(e,t)}updateCanvas(){const e=this.minimap.getFirstVisibleScreenRow(),t=this.minimap.getLastVisibleScreenRow(),i=this.minimap.getDevicePixelRatio(),n=this.minimap.getLineHeight()*i,s=this.minimap.getCharHeight()*i,o=this.minimap.getCharWidth()*i,{width:r,height:a}=this.tokensLayer.getSize(),l=this.minimap.getTextEditor(),h=this.minimap.getTextEditorElement(),d=this.displayCodeHighlights?e=>j(e,h,this.textOpacity):()=>W(h,this.textOpacity);M(this.tokensLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingChanges,n,s,o,r,l,l.getScreenLineCount(),A(l),d,this.ignoreWhitespacesInTokens,this.maxTokensInOneLine);const c=this.DecorationManagement.decorationsByTypeThenRows(e,t),u={context:this.backLayer.context,canvasWidth:r,canvasHeight:a,lineHeight:n,charWidth:o,charHeight:s,orders:ge()},p=(e,t,i)=>O(e,t,i,h);jt["background-custom"]=p,Bt["foreground-custom"]=p,D(this.backLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingBackDecorationChanges,u,n,h,c),u.context=this.frontLayer.context,T(this.frontLayer,e,t,this.offscreenFirstRow,this.offscreenLastRow,this.pendingFrontDecorationChanges,u,n,h,c),this.pendingChanges=[],this.pendingBackDecorationChanges=[],this.pendingFrontDecorationChanges=[],this.offscreenFirstRow=e,this.offscreenLastRow=t}}const Ft=/^\s+$/,Wt=/\s+/,jt={line:R,"highlight-under":H},Bt={gutter:P,"highlight-over":H,"highlight-outline":I};class qt{static initClass(){return V(this,ct.EventsDelegation,ct.SpacePenDSL.Babel),Q(this,"minimap-quick-settings")}static content(){this.div({class:"select-list popover-list minimap-quick-settings"},(()=>{this.input({type:"text",class:"hidden-input",outlet:"hiddenInput"}),this.ol({class:"list-group mark-active",outlet:"list"},(()=>{this.li({class:"separator",outlet:"separator"}),this.li({class:"code-highlights",outlet:"codeHighlights"},"code-highlights"),this.li({class:"absolute-mode",outlet:"absoluteMode"},"absolute-mode"),this.li({class:"adjust-absolute-mode-height",outlet:"adjustAbsoluteModeHeight"},"adjust-absolute-mode-height")})),this.div({class:"btn-group"},(()=>{this.button({class:"btn btn-default",outlet:"onLeftButton"},"On Left"),this.button({class:"btn btn-default",outlet:"onRightButton"},"On Right")}))}))}createdCallback(){this.buildContent()}setModel(e){this.selectedItem=null,this.minimap=e,this.emitter=new ze.Emitter,this.subscriptions=new ze.CompositeDisposable,this.plugins={},this.itemsActions=new WeakMap,this.codeHighlights.classList.toggle("active",this.minimap.displayCodeHighlights),this.itemsActions.set(this.codeHighlights,(()=>{atom.config.set("minimap.displayCodeHighlights",!this.minimap.displayCodeHighlights)})),this.itemsActions.set(this.absoluteMode,(()=>{atom.config.set("minimap.absoluteMode",!atom.config.get("minimap.absoluteMode"))})),this.itemsActions.set(this.adjustAbsoluteModeHeight,(()=>{atom.config.set("minimap.adjustAbsoluteModeHeight",!atom.config.get("minimap.adjustAbsoluteModeHeight"))})),this.subscriptions.add(Ae((({name:e,plugin:t})=>this.addItemFor(e,t))),Re((({name:e,plugin:t})=>this.removeItemFor(e,t))),Pe((({name:e,plugin:t})=>this.activateItem(e,t))),He((({name:e,plugin:t})=>this.deactivateItem(e,t))),atom.commands.add("minimap-quick-settings",{"core:move-up":()=>{this.selectPreviousItem()},"core:move-down":()=>{this.selectNextItem()},"core:move-left"(){atom.config.set("minimap.displayMinimapOnLeft",!0)},"core:move-right"(){atom.config.set("minimap.displayMinimapOnLeft",!1)},"core:cancel":()=>{this.destroy()},"core:confirm":()=>{this.toggleSelectedItem()}}),this.subscribeTo(this.codeHighlights,{mousedown:e=>{e.preventDefault(),atom.config.set("minimap.displayCodeHighlights",!this.minimap.displayCodeHighlights)}}),this.subscribeTo(this.absoluteMode,{mousedown(e){e.preventDefault(),atom.config.set("minimap.absoluteMode",!atom.config.get("minimap.absoluteMode"))}}),this.subscribeTo(this.adjustAbsoluteModeHeight,{mousedown(e){e.preventDefault(),atom.config.set("minimap.adjustAbsoluteModeHeight",!atom.config.get("minimap.adjustAbsoluteModeHeight"))}}),this.subscribeTo(this.hiddenInput,{focusout:e=>{this.destroy()}},{passive:!0}),this.subscribeTo(this.onLeftButton,{mousedown(e){e.preventDefault(),atom.config.set("minimap.displayMinimapOnLeft",!0)}}),this.subscribeTo(this.onRightButton,{mousedown(e){e.preventDefault(),atom.config.set("minimap.displayMinimapOnLeft",!1)}}),atom.config.observe("minimap.displayCodeHighlights",(e=>{this.codeHighlights.classList.toggle("active",e)})),atom.config.observe("minimap.absoluteMode",(e=>{this.absoluteMode.classList.toggle("active",e)})),atom.config.observe("minimap.adjustAbsoluteModeHeight",(e=>{this.adjustAbsoluteModeHeight.classList.toggle("active",e)})),atom.config.observe("minimap.displayMinimapOnLeft",(e=>{this.onLeftButton.classList.toggle("selected",e),this.onRightButton.classList.toggle("selected",!e)}))),this.initList()}onDidDestroy(e){return this.emitter.on("did-destroy",e)}attach(){atom.views.getView(atom.workspace).appendChild(this),this.hiddenInput.focus()}destroy(){this.emitter.emit("did-destroy"),this.subscriptions.dispose(),this.parentNode.removeChild(this)}initList(){this.itemsDisposables=new WeakMap;for(const e in ki)this.addItemFor(e,ki[e])}toggleSelectedItem(){const e=this.itemsActions.get(this.selectedItem);"function"==typeof e&&e()}selectNextItem(){this.selectedItem.classList.remove("selected"),null!=this.selectedItem.nextSibling?(this.selectedItem=this.selectedItem.nextSibling,this.selectedItem.matches(".separator")&&(this.selectedItem=this.selectedItem.nextSibling)):this.selectedItem=this.list.firstChild,this.selectedItem.classList.add("selected")}selectPreviousItem(){this.selectedItem.classList.remove("selected"),null!=this.selectedItem.previousSibling?(this.selectedItem=this.selectedItem.previousSibling,this.selectedItem.matches(".separator")&&(this.selectedItem=this.selectedItem.previousSibling)):this.selectedItem=this.list.lastChild,this.selectedItem.classList.add("selected")}addItemFor(e,t){const i=document.createElement("li"),n=()=>{ae(e)};t.isActive()&&i.classList.add("active"),i.textContent=e,this.itemsActions.set(i,n),this.itemsDisposables.set(i,this.addDisposableEventListener(i,"mousedown",(e=>{e.preventDefault(),n()}))),this.plugins[e]=i,this.list.insertBefore(i,this.separator),null==this.selectedItem&&(this.selectedItem=i,this.selectedItem.classList.add("selected"))}removeItemFor(e,t){try{this.list.removeChild(this.plugins[e])}catch(e){}delete this.plugins[e]}activateItem(e,t){this.plugins[e].classList.add("active")}deactivateItem(e,t){this.plugins[e].classList.remove("active")}}const zt=qt.initClass(),Ut=Tt({strategy:"scroll"});let Vt;const $t=!1;class Qt{static initClass(){return V(this,Nt,ct.EventsDelegation,ct.AncestorsMethods),Q(this,"atom-text-editor-minimap")}createdCallback(){this.minimap=void 0,this.width=void 0,this.height=void 0,this.subscriptions=new ze.CompositeDisposable,this.visibleAreaSubscription=void 0,this.quickSettingsSubscription=void 0,this.dragSubscription=void 0,this.openQuickSettingSubscription=void 0,this.displayMinimapOnLeft=!1,this.minimapScrollIndicator=void 0,this.displayMinimapOnLeft=void 0,this.displayPluginsControls=void 0,this.textOpacity=void 0,this.displayCodeHighlights=void 0,this.adjustToSoftWrap=void 0,this.useHardwareAcceleration=void 0,this.absoluteMode=void 0,this.visibleArea=void 0,this.controls=void 0,this.scrollIndicator=void 0,this.openQuickSettings=void 0,this.quickSettingsElement=void 0,this.DecorationManagement=new Ht,this.attached=void 0,this.attachedToTextEditor=void 0,this.standAlone=void 0,this.wasVisible=void 0,this.offscreenFirstRow=void 0,this.offscreenLastRow=void 0,this.frameRequested=void 0,this.flexBasis=void 0,this.initializeContent(),this.subscriptions.add(atom.config.observe("minimap.displayMinimapOnLeft",(e=>{this.displayMinimapOnLeft=e,e?Y():G(),this.updateMinimapFlexPosition(),this.measureHeightAndWidth(!0,!0)})),atom.config.observe("minimap.minimapScrollIndicator",(e=>{this.minimapScrollIndicator=e,this.minimapScrollIndicator&&null==this.scrollIndicator&&!this.standAlone?this.initializeScrollIndicator():null!=this.scrollIndicator&&this.disposeScrollIndicator(),this.attached&&this.requestUpdate()})),atom.config.observe("minimap.displayPluginsControls",(e=>{this.displayPluginsControls=e,this.displayPluginsControls&&null==this.openQuickSettings&&!this.standAlone?this.initializeOpenQuickSettings():null!=this.openQuickSettings&&this.disposeOpenQuickSettings()})),atom.config.observe("minimap.textOpacity",(e=>{this.textOpacity=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("minimap.displayCodeHighlights",(e=>{this.displayCodeHighlights=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("minimap.smoothScrolling",(e=>{this.smoothScrolling=e,this.attached&&(this.smoothScrolling?this.requestUpdate():(this.backLayer.canvas.style.cssText="",this.tokensLayer.canvas.style.cssText="",this.frontLayer.canvas.style.cssText=""))})),atom.config.observe("minimap.adjustMinimapWidthToSoftWrap",(e=>{this.adjustToSoftWrap=e,this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.adjustMinimapWidthOnlyIfSmaller",(e=>{this.adjustOnlyIfSmaller=e,this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.useHardwareAcceleration",(e=>{this.useHardwareAcceleration=e,this.attached&&this.requestUpdate()})),atom.config.observe("minimap.absoluteMode",(e=>{this.absoluteMode=e,this.classList.toggle("absolute",this.absoluteMode)})),atom.config.observe("minimap.adjustAbsoluteModeHeight",(e=>{this.adjustAbsoluteModeHeight=e,this.classList.toggle("adjust-absolute-height",this.adjustAbsoluteModeHeight),this.attached&&this.measureHeightAndWidth()})),atom.config.observe("minimap.ignoreWhitespacesInTokens",(e=>{this.ignoreWhitespacesInTokens=e,this.attached&&this.requestForcedUpdate()})),atom.config.observe("editor.preferredLineLength",(()=>{this.attached&&this.measureHeightAndWidth()})),atom.config.observe("editor.softWrap",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.showInvisibles",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.invisibles",(()=>{this.attached&&this.requestUpdate()})),atom.config.observe("editor.softWrapAtPreferredLineLength",(()=>{this.attached&&this.requestUpdate()})))}attachedCallback(){if("function"==typeof atom.views.pollDocument)this.subscriptions.add(atom.views.pollDocument((()=>{this.pollDOM()})));else{this.intersectionObserver=new IntersectionObserver((e=>{const{intersectionRect:t}=e[e.length-1];(t.width>0||t.height>0)&&this.measureHeightAndWidth(!0,!0)})),this.intersectionObserver.observe(this),this.isVisible()&&this.measureHeightAndWidth(!0,!0);const e=()=>{this.measureHeightAndWidth(!1,!1)};Ut.listenTo(this,e),window.addEventListener("resize",e,{passive:!0}),this.subscriptions.add(new ze.Disposable((()=>{Ut.removeListener(this,e)})),new ze.Disposable((()=>{window.removeEventListener("resize",e)})))}this.measureHeightAndWidth(),this.updateMinimapFlexPosition(),this.attached=!0,this.attachedToTextEditor=this.queryParentSelector("atom-text-editor")===this.minimap.getTextEditorElement(),this.attachedToTextEditor&&this.minimap.getTextEditorElement().setAttribute("with-minimap",""),this.subscriptions.add(this.subscribeToMediaQuery())}detachedCallback(){this.minimap.getTextEditorElement().removeAttribute("with-minimap"),this.attached=!1}isVisible(){return this.offsetWidth>0||this.offsetHeight>0}attach(e){if(this.attached)return;const t=e||this.minimap.getTextEditorElement(),i=t.querySelectorAll("atom-text-editor-minimap");i.length&&[].forEach.call(i,(e=>{e.destroy(),t.removeChild(e)})),t.appendChild(this)}detach(){this.attached&&null!=this.parentNode&&this.parentNode.removeChild(this)}updateMinimapFlexPosition(){this.classList.toggle("left",this.displayMinimapOnLeft)}destroy(){this.DecorationManagement.destroy(),this.quickSettingsElement&&this.quickSettingsElement.destroy(),this.subscriptions.dispose(),this.detach(),this.minimap&&(this.minimap.minimapElement=null,this.minimap=null)}initializeContent(){this.initializeCanvas(),this.attachCanvases(this),this.createVisibleArea(),this.createControls(),this.subscriptions.add(this.subscribeTo(this,{mousewheel:e=>{!this.standAlone&&this.minimap.onMouseWheel&&this.minimap.onMouseWheel(e)}},{passive:!0}),this.subscribeTo(this.getFrontCanvas(),{mousedown:e=>{this.canvasPressed(X(e))},touchstart:e=>{this.canvasPressed(K(e))}},{passive:!0}))}createVisibleArea(){this.visibleArea||(this.visibleArea=document.createElement("div"),this.visibleArea.classList.add("minimap-visible-area"),this.appendChild(this.visibleArea),this.visibleAreaSubscription=this.subscribeTo(this.visibleArea,{mousedown:e=>{this.startDrag(X(e))},touchstart:e=>{this.startDrag(K(e))}},{passive:!0}),this.subscriptions.add(this.visibleAreaSubscription))}removeVisibleArea(){this.visibleArea&&(this.subscriptions.remove(this.visibleAreaSubscription),this.visibleAreaSubscription.dispose(),this.removeChild(this.visibleArea),delete this.visibleArea)}createControls(){this.controls||this.standAlone||(this.controls=document.createElement("div"),this.controls.classList.add("minimap-controls"),this.appendChild(this.controls))}removeControls(){this.controls&&(this.removeChild(this.controls),delete this.controls)}initializeScrollIndicator(){this.scrollIndicator||this.standAlone||(this.scrollIndicator=document.createElement("div"),this.scrollIndicator.classList.add("minimap-scroll-indicator"),this.controls.appendChild(this.scrollIndicator))}disposeScrollIndicator(){this.scrollIndicator&&(this.controls.removeChild(this.scrollIndicator),delete this.scrollIndicator)}initializeOpenQuickSettings(){this.openQuickSettings||this.standAlone||(this.openQuickSettings=document.createElement("div"),this.openQuickSettings.classList.add("open-minimap-quick-settings"),this.controls.appendChild(this.openQuickSettings),this.openQuickSettingSubscription=this.subscribeTo(this.openQuickSettings,{mousedown:e=>{if(e.preventDefault(),e.stopPropagation(),null!=this.quickSettingsElement)this.quickSettingsElement.destroy(),this.quickSettingsSubscription.dispose();else{this.quickSettingsElement=new zt,this.quickSettingsElement.setModel(this),this.quickSettingsSubscription=this.quickSettingsElement.onDidDestroy((()=>{this.quickSettingsElement=null}));const{top:e,left:t,right:i}=this.getFrontCanvas().getBoundingClientRect();this.quickSettingsElement.style.top=e+"px",this.quickSettingsElement.attach(),this.quickSettingsElement.style.left=this.displayMinimapOnLeft?i+"px":t-this.quickSettingsElement.clientWidth+"px"}}}))}disposeOpenQuickSettings(){this.openQuickSettings&&(this.controls.removeChild(this.openQuickSettings),this.openQuickSettingSubscription.dispose(),delete this.openQuickSettings)}getDecorationManagement(){return this.DecorationManagement}getModel(){return this.minimap}setModel(e){return this.minimap=e,this.minimap.minimapElement=this,this.DecorationManagement.initializeDecorations(this.minimap),this.subscriptions.add(this.minimap.onDidChangeScrollTop((()=>{this.requestUpdate()})),this.minimap.onDidChangeScrollLeft((()=>{this.requestUpdate()})),this.minimap.onDidDestroy((()=>{this.destroy()})),this.minimap.onDidChangeConfig((()=>{if(this.attached)return this.requestForcedUpdate()})),this.minimap.onDidChangeStandAlone((()=>{this.setStandAlone(this.minimap.isStandAlone()),this.requestUpdate()})),this.minimap.onDidChange((e=>{this.pendingChanges.push(e),this.requestUpdate()})),this.DecorationManagement.onDidChangeDecorationRange((e=>{const{type:t}=e;"line"===t||"highlight-under"===t||"background-custom"===t?this.pendingBackDecorationChanges.push(e):this.pendingFrontDecorationChanges.push(e),this.requestUpdate()})),Ie((()=>{this.requestForcedUpdate()}))),this.setStandAlone(this.minimap.isStandAlone()),null!=this.width&&null!=this.height&&this.minimap.setScreenHeightAndWidth(this.height,this.width),this.minimap}setStandAlone(e){this.standAlone=e,this.standAlone?(this.setAttribute("stand-alone",!0),this.disposeScrollIndicator(),this.disposeOpenQuickSettings(),this.removeControls(),this.removeVisibleArea()):(this.removeAttribute("stand-alone"),this.createVisibleArea(),this.createControls(),this.minimapScrollIndicator&&this.initializeScrollIndicator(),this.displayPluginsControls&&this.initializeOpenQuickSettings())}requestUpdate(){this.frameRequested||(this.frameRequested=!0,requestAnimationFrame((()=>{this.update(),this.frameRequested=!1})))}requestForcedUpdate(){this.offscreenFirstRow=null,this.offscreenLastRow=null,this.requestUpdate()}update(){if(!(this.attached&&this.isVisible()&&this.minimap))return;const e=this.minimap;e.enableCache();const t=this.getFrontCanvas(),i=this.minimap.getDevicePixelRatio(),n=e.getTextEditorScaledScrollLeft(),s=e.getTextEditorScaledScrollTop()-e.getScrollTop(),o=Math.min(t.width/i,this.width),r=o+n;this.adjustToSoftWrap&&this.flexBasis?(this.style.flexBasis=this.flexBasis+"px",this.style.width=this.flexBasis+"px"):(this.style.flexBasis=null,this.style.width=null),J(this.visibleArea,{width:Math.round(r)+"px",height:Math.round(e.getTextEditorScaledHeight())+"px",transform:ee(0,s,this.useHardwareAcceleration),"border-left-width":Math.round(n)+"px"}),J(this.controls,{width:Math.round(o)+"px"});const a=e.getFirstVisibleScreenRow()*e.getLineHeight()-e.getScrollTop();if(this.smoothScrolling){let e=ee(0,a,this.useHardwareAcceleration);if(1!==i){const t=1/i;e+=" "+te(t,t,this.useHardwareAcceleration)}J(this.backLayer.canvas,{transform:e}),J(this.tokensLayer.canvas,{transform:e}),J(this.frontLayer.canvas,{transform:e})}else{const e=1/i,t=te(e,e,this.useHardwareAcceleration);J(this.backLayer.canvas,{transform:t}),J(this.tokensLayer.canvas,{transform:t}),J(this.frontLayer.canvas,{transform:t})}if(this.minimapScrollIndicator&&!this.scrollIndicator&&e.canScroll()&&this.initializeScrollIndicator(),null!=this.scrollIndicator){const t=e.getScreenHeight(),i=t*(t/e.getHeight()),n=(t-i)*e.getScrollRatio();J(this.scrollIndicator,{height:i+"px",transform:ee(0,n,this.useHardwareAcceleration)}),e.canScroll()||this.disposeScrollIndicator()}this.absoluteMode&&this.adjustAbsoluteModeHeight&&this.updateCanvasesSize(),this.updateCanvas(),e.clearCache()}setDisplayCodeHighlights(e){this.displayCodeHighlights=e,this.attached&&this.requestForcedUpdate()}pollDOM(){const e=this.checkForVisibilityChange();this.isVisible()&&(this.wasVisible||this.requestForcedUpdate(),this.measureHeightAndWidth(e,!1))}checkForVisibilityChange(){return this.isVisible()?!this.wasVisible&&(this.wasVisible=!0,this.wasVisible):this.wasVisible?(this.wasVisible=!1,!0):(this.wasVisible=!1,this.wasVisible)}measureHeightAndWidth(e,t=!0){if(!this.minimap)return;const i=this.style.flexBasis;this.style.flexBasis="";const n=this.width!==this.clientWidth||this.height!==this.clientHeight;this.height=this.clientHeight,this.width=this.clientWidth;let s=this.width;if(null!=this.minimap&&this.minimap.setScreenHeightAndWidth(this.height,this.width),(n||e||t)&&this.requestForcedUpdate(),this.isVisible())if(n||t){if(this.adjustToSoftWrap){const e=atom.config.get("editor.preferredLineLength"),t=atom.config.get("editor.softWrap"),i=atom.config.get("editor.softWrapAtPreferredLineLength"),n=e*this.minimap.getCharWidth();!(t&&i&&e)||n>this.width&&this.adjustOnlyIfSmaller?(Z(s),delete this.flexBasis):(this.flexBasis=n,s=n,Z(n))}else Z(s),delete this.flexBasis;this.updateCanvasesSize(s)}else this.style.flexBasis=i}updateCanvasesSize(e){const t=this.minimap.getDevicePixelRatio(),i=this.height+this.minimap.getLineHeight(),n=this.absoluteMode&&this.adjustAbsoluteModeHeight?Math.min(this.minimap.getHeight(),i):i,s=this.getFrontCanvas();null==e&&(e=s.width/t),e===s.width&&n===s.height||(this.setCanvasesSize(e*t,n*t),this.absoluteMode&&this.adjustAbsoluteModeHeight&&(this.offscreenFirstRow=null,this.offscreenLastRow=null))}canvasPressed({y:e,isLeftMouse:t,isMiddleMouse:i}){if(!this.minimap.isStandAlone())if(t)this.canvasLeftMousePressed(e);else if(i){this.canvasMiddleMousePressed(e);const{top:t,height:i}=this.visibleArea.getBoundingClientRect();this.startDrag({y:t+i/2,isLeftMouse:!1,isMiddleMouse:!0})}}canvasLeftMousePressed(e){const t=e-this.getBoundingClientRect().top,i=Math.floor(t/this.minimap.getLineHeight())+this.minimap.getFirstVisibleScreenRow(),n=this.minimap.getTextEditor(),s=this.minimap.getTextEditorElement(),o=i*n.getLineHeightInPixels()-this.minimap.getTextEditorHeight()/2,r=s.pixelPositionForScreenPosition([i,0]).top-this.minimap.getTextEditorHeight()/2;if(atom.config.get("minimap.moveCursorOnMinimapClick")&&n.setCursorScreenPosition([i,0]),atom.config.get("minimap.scrollAnimation")){const e=atom.config.get("minimap.scrollAnimationDuration"),t=this.minimap.scrollIndependentlyOnMouseWheel(),i=this.minimap.getTextEditorScrollTop(),n=r;let s;if(t){const t=this.minimap.getScrollTop(),r=Math.min(1,o/(this.minimap.getTextEditorMaxScrollTop()||1))*this.minimap.getMaxScrollTop();s=(e,i)=>{null!==this.minimap&&(this.minimap.setTextEditorScrollTop(e,!0),this.minimap.setScrollTop(t+(r-t)*i))},ie({from:i,to:n,duration:e,step:s})}else s=e=>{null!==this.minimap&&this.minimap.setTextEditorScrollTop(e)},ie({from:i,to:n,duration:e,step:s})}else this.minimap.setTextEditorScrollTop(r)}canvasMiddleMousePressed(e){const{top:t}=this.getBoundingClientRect(),i=(e-t-this.minimap.getTextEditorScaledHeight()/2)/(this.minimap.getVisibleHeight()-this.minimap.getTextEditorScaledHeight());this.minimap.setTextEditorScrollTop(i*this.minimap.getTextEditorMaxScrollTop())}subscribeToMediaQuery(){const e=window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)"),t=()=>{this.requestForcedUpdate()};return e.addEventListener("change",t),new ze.Disposable((()=>{e.removeEventListener("change",t)}))}startDrag({y:e,isLeftMouse:t,isMiddleMouse:i}){if(!this.minimap)return;if(!t&&!i)return;const n={dragOffset:e-this.visibleArea.getBoundingClientRect().top,offsetTop:this.getBoundingClientRect().top},s=e=>this.drag(X(e),n),o=()=>this.endDrag(),r=e=>this.drag(K(e),n);document.body.addEventListener("mousemove",s,{passive:!0}),document.body.addEventListener("mouseup",o,{passive:!0}),document.body.addEventListener("mouseleave",o,{passive:!0}),document.body.addEventListener("touchmove",r,{passive:!0}),document.body.addEventListener("touchend",o,{passive:!0}),document.body.addEventListener("touchcancel",o,{passive:!0}),this.dragSubscription=new ze.Disposable((()=>{document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mouseleave",o),document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",o),document.body.removeEventListener("touchcancel",o)}))}drag({y:e,isLeftMouse:t,isMiddleMouse:i},n){if(!this.minimap)return;if(!t&&!i)return;const s=(e-n.offsetTop-n.dragOffset)/(this.minimap.getVisibleHeight()-this.minimap.getTextEditorScaledHeight());this.minimap.setTextEditorScrollTop(s*this.minimap.getTextEditorMaxScrollTop())}endDrag(){this.minimap&&this.dragSubscription.dispose()}}const Yt=Qt.initClass();class Gt{constructor(e){this.textEditor=e}enableCache(){this.useCache=!0}clearCache(){this.useCache=!1,delete this.heightCache,delete this.scrollTopCache,delete this.scrollLeftCache,delete this.maxScrollTopCache}onDidChangeScrollTop(e){return this.textEditor.onDidChangeScrollTop(e)}onDidChangeScrollLeft(e){return this.textEditor.onDidChangeScrollLeft(e)}getHeight(){return this.useCache?(this.heightCache||(this.heightCache=this.textEditor.getHeight()),this.heightCache):this.textEditor.getHeight()}getScrollTop(){return this.useCache?(this.scrollTopCache||(this.scrollTopCache=this.textEditor.getScrollTop()),this.scrollTopCache):this.textEditor.getScrollTop()}setScrollTop(e){return this.textEditor.setScrollTop(e)}getScrollLeft(){return this.useCache?(this.scrollLeftCache||(this.scrollLeftCache=this.textEditor.getScrollLeft()),this.scrollLeftCache):this.textEditor.getScrollLeft()}getMaxScrollTop(){if(null!=this.maxScrollTopCache&&this.useCache)return this.maxScrollTopCache;let e=this.textEditor.displayBuffer.getMaxScrollTop();const t=this.textEditor.getLineHeightInPixels();return this.scrollPastEnd&&(e-=this.getHeight()-3*t),this.useCache&&(this.maxScrollTopCache=e),e}editorDestroyed(){return!this.textEditor||this.textEditor.isDestroyed()}}const Zt=Object.freeze({__proto__:null,default:Gt}),Xt=t(Zt);class Kt{constructor(e){this.textEditor=e,this.textEditorElement=atom.views.getView(this.textEditor)}enableCache(){this.useCache=!0}clearCache(){this.useCache=!1,delete this.heightCache,delete this.scrollTopCache,delete this.scrollLeftCache,delete this.maxScrollTopCache}onDidChangeScrollTop(e){return this.textEditorElement.onDidChangeScrollTop(e)}onDidChangeScrollLeft(e){return this.textEditorElement.onDidChangeScrollLeft(e)}getHeight(){return this.editorDestroyed()?0:this.useCache?(this.heightCache||(this.heightCache=this.textEditorElement.getHeight()),this.heightCache):this.textEditorElement.getHeight()}getScrollTop(){return this.editorDestroyed()?0:this.useCache?(this.scrollTopCache||(this.scrollTopCache=this.computeScrollTop()),this.scrollTopCache):this.computeScrollTop()}computeScrollTop(){if(this.editorDestroyed())return 0;const e=this.textEditorElement.getScrollTop(),t=this.textEditor.getLineHeightInPixels();let i=this.textEditorElement.getFirstVisibleScreenRow();if(Number.isNaN(i))return 0;let n=this.textEditorElement.pixelPositionForScreenPosition([i,0]).top;return n>e&&(i-=1,n=this.textEditorElement.pixelPositionForScreenPosition([i,0]).top),i*t+Math.min(e-n,t)}setScrollTop(e){this.editorDestroyed()||this.textEditorElement.setScrollTop(e)}getScrollLeft(){return this.editorDestroyed()?0:this.useCache?(this.scrollLeftCache||(this.scrollLeftCache=this.textEditorElement.getScrollLeft()),this.scrollLeftCache):this.textEditorElement.getScrollLeft()}getMaxScrollTop(){if(this.editorDestroyed())return 0;if(null!=this.maxScrollTopCache&&this.useCache)return this.maxScrollTopCache;let e;if(this.textEditorElement.getMaxScrollTop){if(e=this.textEditorElement.getMaxScrollTop(),parseFloat(atom.getVersion())>=1.13&&this.scrollPastEnd){const t=this.textEditor.getLineHeightInPixels();e-=this.getHeight()-3*t}}else if(e=this.textEditorElement.getScrollHeight()-this.getHeight(),this.scrollPastEnd){const t=this.textEditor.getLineHeightInPixels();e-=this.getHeight()-3*t}return this.useCache&&(this.maxScrollTopCache=e),e}editorDestroyed(){return!this.textEditor||this.textEditor.isDestroyed()||!this.textEditorElement.component||!this.textEditorElement.getModel()||!this.textEditorElement.parentNode}}let Jt=1;class ei{constructor(e={}){if(!e.textEditor)throw Error("Cannot create a minimap without an editor");this.minimapElement=void 0,this.DecorationManagement=void 0,this.textEditor=e.textEditor,this.editorElement=void 0,this.standAlone=e.standAlone,this.width=e.width,this.height=e.height,this.id=Jt++,this.emitter=new ze.Emitter,this.subscriptions=new ze.CompositeDisposable,this.adapter=null,this.charHeight=null,this.configCharHeight=null,this.charWidth=null,this.configCharWidth=null,this.interline=null,this.configInterline=null,this.devicePixelRatioRounding=null,this.configDevicePixelRatioRounding=null,this.redrawDelay=0,this.destroyed=!1,this.scrollPastEnd=!1,this.pendingChangeEvents=[],this.flushChangesTimer=null,null!=atom.views.getView(this.textEditor).getScrollTop?this.adapter=new Kt(this.textEditor):(atom.notifications.addWarning("LegacyAdapter of Minimap is deprecated and will be removed in the next major version. Please upgrade Atom to the latest version."),this.adapter=new Xt(this.textEditor)),this.scrollTop=0;let t=this.subscribeToConfig();this.subscriptions.add(t,this.textEditor.onDidChangeGrammar((()=>{this.subscriptions.remove(t),t.dispose(),t=this.subscribeToConfig(),this.subscriptions.add(t)})),this.adapter.onDidChangeScrollTop((()=>{this.standAlone||this.ignoreTextEditorScroll||this.inChangeScrollTop||(this.inChangeScrollTop=!0,this.updateScrollTop(),this.emitter.emit("did-change-scroll-top",this),this.inChangeScrollTop=!1),this.ignoreTextEditorScroll&&(this.ignoreTextEditorScroll=!1)})),this.adapter.onDidChangeScrollLeft((()=>{this.standAlone||this.emitter.emit("did-change-scroll-left",this)})),this.textEditor.onDidChange((e=>{this.scheduleChanges(e)})),this.textEditor.onDidDestroy((()=>{exports.editorsMinimaps&&exports.editorsMinimaps.delete(this.textEditor),this.destroy()})),this.textEditor.onDidTokenize((()=>{this.emitter.emit("did-change-config")})))}destroy(){this.destroyed||(clearTimeout(this.flushChangesTimer),this.flushChangesTimer=null,this.pendingChangeEvents=[],this.subscriptions.dispose(),this.subscriptions=null,this.textEditor=null,this.emitter.emit("did-destroy"),this.emitter.dispose(),this.destroyed=!0)}isDestroyed(){return this.destroyed}scheduleChanges(e){this.pendingChangeEvents=this.pendingChangeEvents.concat(e),this.redrawDelay||this.requestFlushChanges(),this.flushChangesTimer||(this.flushChangesTimer=setTimeout((()=>{this.requestFlushChanges()}),this.redrawDelay))}flushChanges(){clearTimeout(this.flushChangesTimer),this.flushChangesTimer=null,this.emitChanges(this.pendingChangeEvents),this.pendingChangeEvents=[]}requestFlushChanges(){this.requestedFlushChanges||(this.requestedFlushChanges=requestAnimationFrame((()=>{this.flushChanges(),this.requestedFlushChanges&&(cancelAnimationFrame(this.requestedFlushChanges),this.requestedFlushChanges=null)})))}onDidChange(e){return this.emitter.on("did-change",e)}onDidChangeConfig(e){return this.emitter.on("did-change-config",e)}onDidChangeScrollTop(e){return this.emitter.on("did-change-scroll-top",e)}onDidChangeScrollLeft(e){return this.emitter.on("did-change-scroll-left",e)}onDidChangeStandAlone(e){return this.emitter.on("did-change-stand-alone",e)}onDidDestroy(e){return this.emitter.on("did-destroy",e)}subscribeToConfig(){const e=new ze.CompositeDisposable,t={scope:this.textEditor.getRootScopeDescriptor()};return e.add(atom.config.observe("editor.scrollPastEnd",t,(e=>{this.scrollPastEnd=e,this.adapter.scrollPastEnd=this.scrollPastEnd,this.emitter.emit("did-change-config")})),atom.config.observe("minimap.charHeight",t,(e=>{this.configCharHeight=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.charWidth",t,(e=>{this.configCharWidth=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.interline",t,(e=>{this.configInterline=e,this.updateScrollTop(),this.emitter.emit("did-change-config")})),atom.config.observe("minimap.independentMinimapScroll",t,(e=>{this.independentMinimapScroll=e,this.updateScrollTop()})),atom.config.observe("minimap.scrollSensitivity",t,(e=>{this.scrollSensitivity=e})),atom.config.observe("minimap.redrawDelay",t,(e=>{this.redrawDelay=e})),atom.config.observe("minimap.devicePixelRatioRounding",t,(e=>{this.configDevicePixelRatioRounding=e,this.updateScrollTop(),this.emitter.emit("did-change-config")}))),e}isStandAlone(){return this.standAlone}setStandAlone(e){e!==this.standAlone&&(this.standAlone=e,this.emitter.emit("did-change-stand-alone",this))}getMinimapElement(){return this.minimapElement}getTextEditor(){return this.textEditor}getTextEditorElement(){return this.editorElement||(this.editorElement=atom.views.getView(this.getTextEditor())),this.editorElement}getTextEditorScaledHeight(){return this.adapter.getHeight()*this.getVerticalScaleFactor()}getTextEditorScaledScrollTop(){return this.adapter.getScrollTop()*this.getVerticalScaleFactor()}getTextEditorScaledScrollLeft(){return this.adapter.getScrollLeft()*this.getHorizontalScaleFactor()}getTextEditorMaxScrollTop(){return this.adapter.getMaxScrollTop()}getTextEditorScrollTop(){return this.adapter.getScrollTop()}setTextEditorScrollTop(e,t=!1){this.ignoreTextEditorScroll=t,this.adapter.setScrollTop(e)}getTextEditorScrollLeft(){return this.adapter.getScrollLeft()}getTextEditorHeight(){return this.adapter.getHeight()}getTextEditorScrollRatio(){return this.adapter.getScrollTop()/(this.getTextEditorMaxScrollTop()||1)}getCapedTextEditorScrollRatio(){return Math.min(1,this.getTextEditorScrollRatio())}getHeight(){return this.textEditor.getScreenLineCount()*this.getLineHeight()}getWidth(){return this.textEditor.getMaxScreenLineLength()*this.getCharWidth()}getVisibleHeight(){return Math.min(this.getScreenHeight(),this.getHeight())}getScreenHeight(){return this.isStandAlone()?null!=this.height?this.height:this.getHeight():this.adapter.getHeight()}getVisibleWidth(){return Math.min(this.getScreenWidth(),this.getWidth())}getScreenWidth(){return this.isStandAlone()&&null!=this.width?this.width:this.getWidth()}setScreenHeightAndWidth(e,t){this.width===t&&this.height===e||(this.height=e,this.width=t,this.updateScrollTop())}getVerticalScaleFactor(){return this.getLineHeight()/this.textEditor.getLineHeightInPixels()}getHorizontalScaleFactor(){return this.getCharWidth()/this.textEditor.getDefaultCharWidth()}getLineHeight(){return this.getCharHeight()+this.getInterline()}getCharWidth(){return null!=this.charWidth?this.charWidth:this.configCharWidth}setCharWidth(e){this.charWidth=Math.floor(e),this.emitter.emit("did-change-config")}getCharHeight(){return null!=this.charHeight?this.charHeight:this.configCharHeight}setCharHeight(e){this.charHeight=Math.floor(e),this.emitter.emit("did-change-config")}getInterline(){return null!=this.interline?this.interline:this.configInterline}setInterline(e){this.interline=Math.floor(e),this.emitter.emit("did-change-config")}getDevicePixelRatioRounding(){return null!=this.devicePixelRatioRounding?this.devicePixelRatioRounding:this.configDevicePixelRatioRounding}setDevicePixelRatioRounding(e){this.devicePixelRatioRounding=e,this.emitter.emit("did-change-config")}getDevicePixelRatio(){return this.getDevicePixelRatioRounding()?Math.floor(devicePixelRatio):devicePixelRatio}getFirstVisibleScreenRow(){return Math.floor(this.getScrollTop()/this.getLineHeight())}getLastVisibleScreenRow(){return Math.ceil((this.getScrollTop()+this.getScreenHeight())/this.getLineHeight())}scrollIndependentlyOnMouseWheel(){return this.independentMinimapScroll}getScrollTop(){return this.standAlone||this.independentMinimapScroll?this.scrollTop:this.getScrollTopFromEditor()}setScrollTop(e){this.scrollTop=Math.max(0,Math.min(this.getMaxScrollTop(),e)),(this.standAlone||this.independentMinimapScroll)&&this.emitter.emit("did-change-scroll-top",this)}getScrollRatio(){return this.getScrollTop()/this.getMaxScrollTop()}updateScrollTop(){if(this.independentMinimapScroll){try{this.setScrollTop(this.getScrollTopFromEditor())}catch(e){}this.emitter.emit("did-change-scroll-top",this)}}getScrollTopFromEditor(){return Math.abs(this.getCapedTextEditorScrollRatio()*this.getMaxScrollTop())}getMaxScrollTop(){return Math.max(0,this.getHeight()-this.getScreenHeight())}canScroll(){return this.getMaxScrollTop()>0}onMouseWheel(e){if(this.scrollIndependentlyOnMouseWheel()){if(e.stopPropagation(),!this.canScroll())return;const{wheelDeltaY:t}=e,i=this.getScrollTop()-Math.round(t*this.scrollSensitivity);e.preventDefault(),this.setScrollTop(i)}}getMarker(e){return this.textEditor.getMarker(e)}findMarkers(e){try{return this.textEditor.findMarkers(e)}catch(e){return[]}}markBufferRange(e){return this.textEditor.markBufferRange(e)}emitChanges(e){this.emitter.emit("did-change",e)}enableCache(){this.adapter.enableCache()}clearCache(){this.adapter.clearCache()}editorDestroyed(){this.adapter.editorDestroyed()}getDecorationManagement(){return void 0===this.DecorationManagement&&(this.DecorationManagement=this.minimapElement.DecorationManagement),this.DecorationManagement}getDecorations(){return this.getDecorationManagement().getDecorations()}onDidAddDecoration(...e){return this.getDecorationManagement().onDidAddDecoration(...e)}onDidRemoveDecoration(...e){return this.getDecorationManagement().onDidRemoveDecoration(...e)}onDidChangeDecorationRange(...e){return this.getDecorationManagement().onDidChangeDecorationRange(...e)}onDidUpdateDecoration(...e){return this.getDecorationManagement().onDidUpdateDecoration(...e)}decorationForId(...e){return this.getDecorationManagement().decorationForId(...e)}decorationsForScreenRowRange(...e){return this.getDecorationManagement().decorationsForScreenRowRange(...e)}decorationsByTypeThenRows(){return this.getDecorationManagement().decorationsByTypeThenRows()}decorateMarker(...e){return this.getDecorationManagement().decorateMarker(...e)}removeDecoration(...e){return this.getDecorationManagement().removeDecoration(...e)}removeAllDecorationsForMarker(...e){return this.getDecorationManagement().removeAllDecorationsForMarker(...e)}removeAllDecorations(){return this.getDecorationManagement().removeAllDecorations()}}var ti={type:"object",properties:{}},ii={title:"Show Minimap On Atom Start",type:"boolean",default:!0,order:1},ni={type:"boolean",default:!1,order:2},si={type:"boolean",default:!0,description:"Toggles the render of the buffer tokens in the minimap.",order:3},oi={type:"boolean",default:!0,description:"You need to restart Atom for this setting to be effective.",order:4},ri={type:"boolean",default:!0,description:"Toggles the display of a side line showing which part of the buffer is currently displayed by the minimap. This side line will only appear if the minimap is taller than the editor view height.",order:5},ai={type:"boolean",default:!0,description:"If this option is enabled and Soft Wrap is checked then the Minimap max width is set to the Preferred Line Length value.",order:6},li={type:"boolean",default:!0,description:"If this option and `adjustMinimapWidthToSoftWrap` are enabled the minimap width will never go past the limit sets by CSS. On the other hand, when disabled the minimap will expand to honor the preferred line width.",order:7},hi={type:"boolean",default:!1,description:"When enabled, text editor tokens are rendered as plain blocks, with no regards to the whitespaces they contains.",order:8},di={type:"number",default:1,minimum:.5,order:9},ci={type:"number",default:2,minimum:.5,order:10},ui={type:"number",default:1,minimum:0,description:"The space between lines in the minimap in pixels.",order:11},pi={type:"number",default:.6,minimum:0,maximum:1,description:"The opacity used to render the line's text in the minimap.",order:12},mi={type:"boolean",default:!1,description:"Moves the cursor to the beginning of the target line when clicking on the minimap",order:13},gi={type:"boolean",title:"Independent Minimap Scroll On Mouse Wheel Events",default:!1,description:"When enabled, using the mouse wheel over the Minimap will make it scroll independently of the text editor. The Minimap will still sync with the editor whenever the editor is scrolled, but it will no longer relay the mouse wheel events to the editor.",order:14},fi={type:"number",default:.5,description:"The scrolling speed when the `Independent Minimap Scroll On Mouse Wheel Events` setting is enabled.",order:15},vi={type:"boolean",default:!1,description:"Whether to offset the minimap canvas when scrolling to keep the scroll smooth. When `true` the minimap canvas will be offseted, resulting in a smoother scroll, but with the side-effect of a blurry minimap when the canvas is placed between pixels. When `false` the canvas will always stay at the same position, and will never look blurry, but the scroll will appear more jagged.",order:16},bi={type:"boolean",default:!1,order:17},yi={type:"boolean",default:!1,description:"When enabled the text editor content will be able to flow below the minimap.",order:18},Si={type:"boolean",default:!1,description:"When enabled and `Absolute Mode` is also enabled, the minimap height will be adjusted to only take the space required by the text editor content, leaving the space below triggering mouse events on the text editor. **Be aware this can have some impact on performances as the minimap canvases will be resized every time a change in the editor make its height change.**",order:19},wi={type:"number",default:400,minimum:0,maximum:2e3,description:"Controls how often (in ms) the minimap should redraw itself after changing the text editor's contents. Setting this to 100ms or higher could dramatically improve editor responsiveness when working with large files. A value of 0 will cause the minimap to redraw itself immediately on each change.",order:20},xi={type:"boolean",default:!0,description:"Toggles the rounding of the devicePixelRatio in the minimap.",order:21},Ci={type:"boolean",default:!0,order:22},Ei={type:"boolean",default:!1,description:"Enables animations when scrolling by clicking on the minimap.",order:23},Mi={type:"integer",default:300,description:"The duration of scrolling animations when clicking on the minimap.",order:24},Di={type:"integer",default:160,description:"The maximum number of tokens that are rendered for each line.",order:25};const Ti={plugins:ti,autoToggle:ii,displayMinimapOnLeft:ni,displayCodeHighlights:si,displayPluginsControls:oi,minimapScrollIndicator:ri,adjustMinimapWidthToSoftWrap:ai,adjustMinimapWidthOnlyIfSmaller:li,ignoreWhitespacesInTokens:hi,charWidth:di,charHeight:ci,interline:ui,textOpacity:pi,moveCursorOnMinimapClick:mi,independentMinimapScroll:gi,scrollSensitivity:fi,smoothScrolling:vi,createPluginInDevMode:bi,absoluteMode:yi,adjustAbsoluteModeHeight:Si,redrawDelay:wi,devicePixelRatioRounding:xi,useHardwareAcceleration:Ci,scrollAnimation:Ei,scrollAnimationDuration:Mi,maxTokensInOneLine:Di},ki={},Li={},Ai={};class Ri{constructor(){this.domStylesCache=new Map,this.dummyNode=void 0,this.targetNode=void 0}retrieveStyleFromDom(e,t,i,n){if(!e.length)return"";const s=e.join(" ");let o=this.domStylesCache.get(s);if(void 0!==o){if(n){const e=o[t];if(void 0!==e)return e}}else o={};this.ensureDummyNodeExistence(i);let r=this.dummyNode;for(let t=0,i=e.length;i>t;t++){const i=e[t],n=document.createElement("span");n.className=i.replace(Pi," "),r.appendChild(n),r=n}const a=window.getComputedStyle(r);let l=a.getPropertyValue(t);const h=a.getPropertyValue("-webkit-filter");return h.indexOf("hue-rotate")>-1&&(l=ye(l,h)),""!==l&&(o[t]=l,this.domStylesCache.set(s,o)),this.dummyNode.innerHTML="",l}ensureDummyNodeExistence(e){this.targetNode===e&&void 0!==this.dummyNode||(this.dummyNode=document.createElement("span"),this.dummyNode.style.visibility="hidden",e.appendChild(this.dummyNode),this.targetNode=e)}invalidateDOMStylesCache(){this.domStylesCache.clear()}}const Pi=/\.+/g,Hi=/rgb(a?)\((\d+), (\d+), (\d+)(, (\d+(\.\d+)?))?\)/,Ii=/hue-rotate\((\d+)deg\)/;let Oi=!1,_i=!1;exports.editorsMinimaps=null;let Ni=null,Fi=null;const Wi=new ze.Emitter;exports.domStylesReader=null;const ji={minimapViewProvider:xe,getConfigSchema:Ee,onDidActivate:Te,onDidDeactivate:ke,onDidCreateMinimap:Le,onDidAddPlugin:Ae,onDidRemovePlugin:Re,onDidActivatePlugin:Pe,onDidDeactivatePlugin:He,onDidChangePluginOrder:Ie,minimapClass:Oe,minimapForEditorElement:_e,minimapForEditor:Ne,standAloneMinimapForEditor:Fe,getActiveMinimap:We,observeMinimaps:je,registerPlugin:oe,unregisterPlugin:re,togglePluginActivation:ae,deactivateAllPlugins:le,activatePlugin:ce,deactivatePlugin:ue,getPluginsOrder:ge};exports.Minimap=ei,exports.activate=we,exports.activatePlugin=ce,exports.commonjsGlobal=Ye,exports.config=Ti,exports.createCommonjsModule=i,exports.dasherize=x,exports.deactivate=Ce,exports.deactivateAllPlugins=le,exports.deactivatePlugin=ue,exports.element=Q,exports.emitter=Wi,exports.getActiveMinimap=We,exports.getAugmentedNamespace=t,exports.getConfigSchema=Ee,exports.getPluginsOrder=ge,exports.minimapClass=Oe,exports.minimapForEditor=Ne,exports.minimapForEditorElement=_e,exports.minimapViewProvider=xe,exports.observeMinimaps=je,exports.onDidActivate=Te,exports.onDidActivatePlugin=Pe,exports.onDidAddPlugin=Ae,exports.onDidChangePluginOrder=Ie,exports.onDidCreateMinimap=Le,exports.onDidDeactivate=ke,exports.onDidDeactivatePlugin=He,exports.onDidRemovePlugin=Re,exports.plugins=ki,exports.provideMinimapServiceV1=qe,exports.registerPlugin=oe,exports.standAloneMinimapForEditor=Fe,exports.toggle=Me,exports.togglePluginActivation=ae,exports.unregisterPlugin=re; -//# sourceMappingURL=main-f082673e.js.map diff --git a/dist/main-f082673e.js.map b/dist/main-f082673e.js.map deleted file mode 100644 index d6b80f1d..00000000 --- a/dist/main-f082673e.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"main-f082673e.js","sources":["../node_modules/event-kit/dist/disposable.js","../node_modules/event-kit/dist/composite-disposable.js","../node_modules/event-kit/dist/emitter.js","../node_modules/batch-processor/src/batch-processor.js","../node_modules/element-resize-detector/src/state-handler.js","../node_modules/element-resize-detector/src/element-resize-detector.js","../lib/deps/underscore-plus.js","../lib/decoration-management.js","../lib/mixins/canvas-drawer.js","../lib/decorators/include.js","../lib/decorators/element.js","../lib/minimap-element.js","../lib/plugin-management.js","../lib/performance-monitor.js","../lib/dom-styles-reader.js","../lib/main.js","../node_modules/grim/lib/deprecation.js","../node_modules/event-kit/dist/event-kit.js","../node_modules/grim/lib/grim.js","../node_modules/atom-utils-plus/lib/register-or-update-element.coffee","../node_modules/mixto/lib/mixin.js","../node_modules/atom-utils-plus/lib/mixins/ancestors.coffee","../node_modules/atom-utils-plus/lib/mixins/disposable-events.coffee","../node_modules/atom-utils-plus/lib/mixins/events-delegation.coffee","../node_modules/atom-utils-plus/lib/mixins/space-pen-dsl.coffee","../node_modules/atom-utils-plus/lib/atom-utils.coffee","../node_modules/element-resize-detector/src/collection-utils.js","../node_modules/element-resize-detector/src/element-utils.js","../node_modules/element-resize-detector/src/listener-handler.js","../node_modules/element-resize-detector/src/id-generator.js","../node_modules/element-resize-detector/src/id-handler.js","../node_modules/element-resize-detector/src/reporter.js","../node_modules/element-resize-detector/src/browser-detector.js","../node_modules/batch-processor/src/utils.js","../node_modules/element-resize-detector/src/detection-strategy/object.js","../node_modules/element-resize-detector/src/detection-strategy/scroll.js","../lib/decoration.js","../lib/canvas-layer.js","../lib/minimap-quick-settings-element.js","../lib/adapters/legacy-adapter.js","../lib/adapters/stable-adapter.js","../lib/minimap.js"],"sourcesContent":["\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// Essential: A handle to a resource that can be disposed. For example,\n// {Emitter::on} returns disposables representing subscriptions.\nmodule.exports =\n/*#__PURE__*/\nfunction () {\n _createClass(Disposable, null, [{\n key: \"isDisposable\",\n // Public: Ensure that `object` correctly implements the `Disposable`\n // contract.\n //\n // * `object` An {Object} you want to perform the check against.\n //\n // Returns a {Boolean} indicating whether `object` is a valid `Disposable`.\n value: function isDisposable(object) {\n return typeof (object != null ? object.dispose : undefined) === \"function\";\n }\n /*\n Section: Construction and Destruction\n */\n // Public: Construct a Disposable\n //\n // * `disposalAction` A {Function} to call when {::dispose} is called for the\n // first time.\n\n }]);\n\n function Disposable(disposalAction) {\n _classCallCheck(this, Disposable);\n\n this.disposed = false;\n this.disposalAction = disposalAction;\n } // Public: Perform the disposal action, indicating that the resource associated\n // with this disposable is no longer needed.\n //\n // You can call this method more than once, but the disposal action will only\n // be performed the first time.\n\n\n _createClass(Disposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.disposed) {\n this.disposed = true;\n\n if (typeof this.disposalAction === \"function\") {\n this.disposalAction();\n }\n\n this.disposalAction = null;\n }\n }\n }]);\n\n return Disposable;\n}();","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar CompositeDisposable;\nvar Disposable; // Essential: An object that aggregates multiple {Disposable} instances together\n// into a single disposable, so they can all be disposed as a group.\n//\n// These are very useful when subscribing to multiple events.\n//\n// ## Examples\n//\n// ```js\n// const {CompositeDisposable} = require('atom')\n//\n// class Something {\n// constructor() {\n// this.disposables = new CompositeDisposable()\n// const editor = atom.workspace.getActiveTextEditor()\n// this.disposables.add(editor.onDidChange(() => {})\n// this.disposables.add(editor.onDidChangePath(() => {})\n// }\n//\n// destroy() {\n// this.disposables.dispose();\n// }\n// }\n// ```\n\nmodule.exports =\n/*#__PURE__*/\nfunction () {\n /*\n Section: Construction and Destruction\n */\n // Public: Construct an instance, optionally with one or more disposables\n function CompositeDisposable() {\n _classCallCheck(this, CompositeDisposable);\n\n this.disposed = false;\n this.disposables = new Set();\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var disposable = _step.value;\n this.add(disposable);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } // Public: Dispose all disposables added to this composite disposable.\n //\n // If this object has already been disposed, this method has no effect.\n\n\n _createClass(CompositeDisposable, [{\n key: \"dispose\",\n value: function dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposables.forEach(function (disposable) {\n return disposable.dispose();\n });\n this.disposables = null;\n }\n }\n /*\n Section: Managing Disposables\n */\n // Public: Add disposables to be disposed when the composite is disposed.\n //\n // If this object has already been disposed, this method has no effect.\n //\n // * `...disposables` {Disposable} instances or any objects with `.dispose()`\n // methods.\n\n }, {\n key: \"add\",\n value: function add() {\n if (!this.disposed) {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = arguments[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var disposable = _step2.value;\n assertDisposable(disposable);\n this.disposables.add(disposable);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n } // Public: Remove a previously added disposable.\n //\n // * `disposable` {Disposable} instance or any object with a `.dispose()`\n // method.\n\n }, {\n key: \"remove\",\n value: function remove(disposable) {\n if (!this.disposed) {\n this.disposables.delete(disposable);\n }\n } // Public: Alias to {CompositeDisposable::remove}\n\n }, {\n key: \"delete\",\n value: function _delete(disposable) {\n this.remove(disposable);\n } // Public: Clear all disposables. They will not be disposed by the next call\n // to dispose.\n\n }, {\n key: \"clear\",\n value: function clear() {\n if (!this.disposed) {\n this.disposables.clear();\n }\n }\n }]);\n\n return CompositeDisposable;\n}();\n\nfunction assertDisposable(disposable) {\n if (Disposable == null) {\n Disposable = require(\"./disposable\");\n }\n\n if (!Disposable.isDisposable(disposable)) {\n throw new TypeError(\"Arguments to CompositeDisposable.add must have a .dispose() method\");\n }\n}","\"use strict\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar Disposable = require(\"./disposable\");\n\nvar CompositeDisposable = require(\"./composite-disposable\"); // Essential: Utility class to be used when implementing event-based APIs that\n// allows for handlers registered via `::on` to be invoked with calls to\n// `::emit`. Instances of this class are intended to be used internally by\n// classes that expose an event-based API.\n//\n// For example:\n//\n// ```js\n// class User {\n// constructor() {\n// this.emitter = new Emitter()\n// }\n//\n// onDidChangeName(callback) {\n// this.emitter.on('did-change-name', callback)\n// }\n//\n// setName(name) {\n// if (name !== this.name) {\n// this.name = name\n// this.emitter.emit('did-change-name', name)\n// }\n//\n// return this.name\n// }\n// }\n// ```\n\n\nvar Emitter =\n/*#__PURE__*/\nfunction () {\n _createClass(Emitter, null, [{\n key: \"onEventHandlerException\",\n value: function onEventHandlerException(exceptionHandler) {\n var _this = this;\n\n if (this.exceptionHandlers.length === 0) {\n this.dispatch = this.exceptionHandlingDispatch;\n }\n\n this.exceptionHandlers.push(exceptionHandler);\n return new Disposable(function () {\n _this.exceptionHandlers.splice(_this.exceptionHandlers.indexOf(exceptionHandler), 1);\n\n if (_this.exceptionHandlers.length === 0) {\n return _this.dispatch = _this.simpleDispatch;\n }\n });\n }\n }, {\n key: \"simpleDispatch\",\n value: function simpleDispatch(handler, value) {\n return handler(value);\n }\n }, {\n key: \"exceptionHandlingDispatch\",\n value: function exceptionHandlingDispatch(handler, value) {\n try {\n return handler(value);\n } catch (exception) {\n return this.exceptionHandlers.map(function (exceptionHandler) {\n return exceptionHandler(exception);\n });\n }\n }\n /*\n Section: Construction and Destruction\n */\n // Public: Construct an emitter.\n //\n // ```js\n // this.emitter = new Emitter()\n // ```\n\n }]);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n this.disposed = false;\n this.clear();\n } // Public: Clear out any existing subscribers.\n\n\n _createClass(Emitter, [{\n key: \"clear\",\n value: function clear() {\n if (this.subscriptions != null) {\n this.subscriptions.dispose();\n }\n\n this.subscriptions = new CompositeDisposable();\n this.handlersByEventName = {};\n } // Public: Unsubscribe all handlers.\n\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.subscriptions.dispose();\n this.handlersByEventName = null;\n this.disposed = true;\n }\n /*\n Section: Event Subscription\n */\n // Public: Register the given handler function to be invoked whenever events by\n // the given name are emitted via {::emit}.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"on\",\n value: function on(eventName, handler, unshift) {\n var _this2 = this;\n\n if (unshift == null) {\n unshift = false;\n }\n\n if (this.disposed) {\n throw new Error(\"Emitter has been disposed\");\n }\n\n if (typeof handler !== \"function\") {\n throw new Error(\"Handler must be a function\");\n }\n\n var currentHandlers = this.handlersByEventName[eventName];\n\n if (currentHandlers) {\n if (unshift) {\n this.handlersByEventName[eventName].unshift(handler);\n } else {\n this.handlersByEventName[eventName].push(handler);\n }\n } else {\n this.handlersByEventName[eventName] = [handler];\n } // When the emitter is disposed, we want to dispose of all subscriptions.\n // However, we also need to stop tracking disposables when they're disposed\n // from outside, otherwise this class will hold references to all the\n // disposables it created (instead of just the active ones).\n\n\n var cleanup = new Disposable(function () {\n _this2.subscriptions.remove(cleanup);\n\n return _this2.off(eventName, handler);\n });\n this.subscriptions.add(cleanup);\n return cleanup;\n } // Public: Register the given handler function to be invoked the next time an\n // events with the given name is emitted via {::emit}.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"once\",\n value: function once(eventName, handler, unshift) {\n if (unshift == null) {\n unshift = false;\n }\n\n var wrapped = function wrapped(value) {\n disposable.dispose();\n return handler(value);\n };\n\n var disposable = this.on(eventName, wrapped, unshift);\n return disposable;\n } // Public: Register the given handler function to be invoked *before* all\n // other handlers existing at the time of subscription whenever events by the\n // given name are emitted via {::emit}.\n //\n // Use this method when you need to be the first to handle a given event. This\n // could be required when a data structure in a parent object needs to be\n // updated before third-party event handlers registered on a child object via a\n // public API are invoked. Your handler could itself be preempted via\n // subsequent calls to this method, but this can be controlled by keeping\n // methods based on `::preempt` private.\n //\n // * `eventName` {String} naming the event that you want to invoke the handler\n // when emitted.\n // * `handler` {Function} to invoke when {::emit} is called with the given\n // event name.\n //\n // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.\n\n }, {\n key: \"preempt\",\n value: function preempt(eventName, handler) {\n return this.on(eventName, handler, true);\n } // Private: Used by the disposable.\n\n }, {\n key: \"off\",\n value: function off(eventName, handlerToRemove) {\n if (this.disposed) {\n return;\n }\n\n var handlers = this.handlersByEventName[eventName];\n\n if (handlers) {\n var handlerIndex = handlers.indexOf(handlerToRemove);\n\n if (handlerIndex >= 0) {\n handlers.splice(handlerIndex, 1);\n }\n\n if (handlers.length === 0) {\n delete this.handlersByEventName[eventName];\n }\n }\n }\n /*\n Section: Event Emission\n */\n // Public: Invoke handlers registered via {::on} for the given event name.\n //\n // * `eventName` The name of the event to emit. Handlers registered with {::on}\n // for the same name will be invoked.\n // * `value` Callbacks will be invoked with this value as an argument.\n\n }, {\n key: \"emit\",\n value: function emit(eventName, value) {\n var handlers = this.handlersByEventName && this.handlersByEventName[eventName];\n\n if (handlers) {\n // create a copy of `handlers` so that if any handler mutates `handlers`\n // (e.g. by calling `on` on this same emitter), this does not result in\n // changing the handlers being called during this same `emit`.\n var handlersCopy = handlers.slice();\n\n for (var i = 0; i < handlersCopy.length; i++) {\n this.constructor.dispatch(handlersCopy[i], value);\n }\n }\n }\n }, {\n key: \"emitAsync\",\n value: function emitAsync(eventName, value) {\n var _this3 = this;\n\n var handlers = this.handlersByEventName && this.handlersByEventName[eventName];\n\n if (handlers) {\n var promises = handlers.map(function (handler) {\n return _this3.constructor.dispatch(handler, value);\n });\n return Promise.all(promises).then(function () {});\n }\n\n return Promise.resolve();\n }\n }, {\n key: \"getEventNames\",\n value: function getEventNames() {\n return Object.keys(this.handlersByEventName);\n }\n }, {\n key: \"listenerCountForEventName\",\n value: function listenerCountForEventName(eventName) {\n var handlers = this.handlersByEventName[eventName];\n return handlers == null ? 0 : handlers.length;\n }\n }, {\n key: \"getTotalListenerCount\",\n value: function getTotalListenerCount() {\n var result = 0;\n\n var _arr = Object.keys(this.handlersByEventName);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var eventName = _arr[_i];\n result += this.handlersByEventName[eventName].length;\n }\n\n return result;\n }\n }]);\n\n return Emitter;\n}();\n\nEmitter.dispatch = Emitter.simpleDispatch;\nEmitter.exceptionHandlers = [];\nmodule.exports = Emitter;","\"use strict\";\n\nvar utils = require(\"./utils\");\n\nmodule.exports = function batchProcessorMaker(options) {\n options = options || {};\n var reporter = options.reporter;\n var asyncProcess = utils.getOption(options, \"async\", true);\n var autoProcess = utils.getOption(options, \"auto\", true);\n\n if(autoProcess && !asyncProcess) {\n reporter && reporter.warn(\"Invalid options combination. auto=true and async=false is invalid. Setting async=true.\");\n asyncProcess = true;\n }\n\n var batch = Batch();\n var asyncFrameHandler;\n var isProcessing = false;\n\n function addFunction(level, fn) {\n if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {\n // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.\n // This needs to be done before, since we're checking the size of the batch to be 0.\n processBatchAsync();\n }\n\n batch.add(level, fn);\n }\n\n function processBatch() {\n // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.\n // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).\n isProcessing = true;\n while (batch.size()) {\n var processingBatch = batch;\n batch = Batch();\n processingBatch.process();\n }\n isProcessing = false;\n }\n\n function forceProcessBatch(localAsyncProcess) {\n if (isProcessing) {\n return;\n }\n\n if(localAsyncProcess === undefined) {\n localAsyncProcess = asyncProcess;\n }\n\n if(asyncFrameHandler) {\n cancelFrame(asyncFrameHandler);\n asyncFrameHandler = null;\n }\n\n if(localAsyncProcess) {\n processBatchAsync();\n } else {\n processBatch();\n }\n }\n\n function processBatchAsync() {\n asyncFrameHandler = requestFrame(processBatch);\n }\n\n function clearBatch() {\n batch = {};\n batchSize = 0;\n topLevel = 0;\n bottomLevel = 0;\n }\n\n function cancelFrame(listener) {\n // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;\n var cancel = clearTimeout;\n return cancel(listener);\n }\n\n function requestFrame(callback) {\n // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };\n var raf = function(fn) { return setTimeout(fn, 0); };\n return raf(callback);\n }\n\n return {\n add: addFunction,\n force: forceProcessBatch\n };\n};\n\nfunction Batch() {\n var batch = {};\n var size = 0;\n var topLevel = 0;\n var bottomLevel = 0;\n\n function add(level, fn) {\n if(!fn) {\n fn = level;\n level = 0;\n }\n\n if(level > topLevel) {\n topLevel = level;\n } else if(level < bottomLevel) {\n bottomLevel = level;\n }\n\n if(!batch[level]) {\n batch[level] = [];\n }\n\n batch[level].push(fn);\n size++;\n }\n\n function process() {\n for(var level = bottomLevel; level <= topLevel; level++) {\n var fns = batch[level];\n\n for(var i = 0; i < fns.length; i++) {\n var fn = fns[i];\n fn();\n }\n }\n }\n\n function getSize() {\n return size;\n }\n\n return {\n add: add,\n process: process,\n size: getSize\n };\n}\n","\"use strict\";\n\nvar prop = \"_erd\";\n\nfunction initState(element) {\n element[prop] = {};\n return getState(element);\n}\n\nfunction getState(element) {\n return element[prop];\n}\n\nfunction cleanState(element) {\n delete element[prop];\n}\n\nmodule.exports = {\n initState: initState,\n getState: getState,\n cleanState: cleanState\n};\n","\"use strict\";\n\nvar forEach = require(\"./collection-utils\").forEach;\nvar elementUtilsMaker = require(\"./element-utils\");\nvar listenerHandlerMaker = require(\"./listener-handler\");\nvar idGeneratorMaker = require(\"./id-generator\");\nvar idHandlerMaker = require(\"./id-handler\");\nvar reporterMaker = require(\"./reporter\");\nvar browserDetector = require(\"./browser-detector\");\nvar batchProcessorMaker = require(\"batch-processor\");\nvar stateHandler = require(\"./state-handler\");\n\n//Detection strategies.\nvar objectStrategyMaker = require(\"./detection-strategy/object.js\");\nvar scrollStrategyMaker = require(\"./detection-strategy/scroll.js\");\n\nfunction isCollection(obj) {\n return Array.isArray(obj) || obj.length !== undefined;\n}\n\nfunction toArray(collection) {\n if (!Array.isArray(collection)) {\n var array = [];\n forEach(collection, function (obj) {\n array.push(obj);\n });\n return array;\n } else {\n return collection;\n }\n}\n\nfunction isElement(obj) {\n return obj && obj.nodeType === 1;\n}\n\n/**\n * @typedef idHandler\n * @type {object}\n * @property {function} get Gets the resize detector id of the element.\n * @property {function} set Generate and sets the resize detector id of the element.\n */\n\n/**\n * @typedef Options\n * @type {object}\n * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.\n Default is true. If true, the listener is guaranteed to be called when it has been added.\n If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).\n * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.\n If not provided, a default id handler will be used.\n * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.\n If not provided, a default id handler will be used.\n If set to false, then nothing will be reported.\n * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.\n */\n\n/**\n * Creates an element resize detector instance.\n * @public\n * @param {Options?} options Optional global options object that will decide how this instance will work.\n */\nmodule.exports = function(options) {\n options = options || {};\n\n //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var idHandler;\n\n if (options.idHandler) {\n // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler\n // so that readonly flag always is true when it's used here. This may be removed next major version bump.\n idHandler = {\n get: function (element) { return options.idHandler.get(element, true); },\n set: options.idHandler.set\n };\n } else {\n var idGenerator = idGeneratorMaker();\n var defaultIdHandler = idHandlerMaker({\n idGenerator: idGenerator,\n stateHandler: stateHandler\n });\n idHandler = defaultIdHandler;\n }\n\n //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var reporter = options.reporter;\n\n if(!reporter) {\n //If options.reporter is false, then the reporter should be quiet.\n var quiet = reporter === false;\n reporter = reporterMaker(quiet);\n }\n\n //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var batchProcessor = getOption(options, \"batchProcessor\", batchProcessorMaker({ reporter: reporter }));\n\n //Options to be used as default for the listenTo function.\n var globalOptions = {};\n globalOptions.callOnAdd = !!getOption(options, \"callOnAdd\", true);\n globalOptions.debug = !!getOption(options, \"debug\", false);\n\n var eventListenerHandler = listenerHandlerMaker(idHandler);\n var elementUtils = elementUtilsMaker({\n stateHandler: stateHandler\n });\n\n //The detection strategy to be used.\n var detectionStrategy;\n var desiredStrategy = getOption(options, \"strategy\", \"object\");\n var importantCssRules = getOption(options, \"important\", false);\n var strategyOptions = {\n reporter: reporter,\n batchProcessor: batchProcessor,\n stateHandler: stateHandler,\n idHandler: idHandler,\n important: importantCssRules\n };\n\n if(desiredStrategy === \"scroll\") {\n if (browserDetector.isLegacyOpera()) {\n reporter.warn(\"Scroll strategy is not supported on legacy Opera. Changing to object strategy.\");\n desiredStrategy = \"object\";\n } else if (browserDetector.isIE(9)) {\n reporter.warn(\"Scroll strategy is not supported on IE9. Changing to object strategy.\");\n desiredStrategy = \"object\";\n }\n }\n\n if(desiredStrategy === \"scroll\") {\n detectionStrategy = scrollStrategyMaker(strategyOptions);\n } else if(desiredStrategy === \"object\") {\n detectionStrategy = objectStrategyMaker(strategyOptions);\n } else {\n throw new Error(\"Invalid strategy name: \" + desiredStrategy);\n }\n\n //Calls can be made to listenTo with elements that are still being installed.\n //Also, same elements can occur in the elements list in the listenTo function.\n //With this map, the ready callbacks can be synchronized between the calls\n //so that the ready callback can always be called when an element is ready - even if\n //it wasn't installed from the function itself.\n var onReadyCallbacks = {};\n\n /**\n * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.\n * @public\n * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.\n * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.\n * @param {function} listener The callback to be executed for each resize event for each element.\n */\n function listenTo(options, elements, listener) {\n function onResizeCallback(element) {\n var listeners = eventListenerHandler.get(element);\n forEach(listeners, function callListenerProxy(listener) {\n listener(element);\n });\n }\n\n function addListener(callOnAdd, element, listener) {\n eventListenerHandler.add(element, listener);\n\n if(callOnAdd) {\n listener(element);\n }\n }\n\n //Options object may be omitted.\n if(!listener) {\n listener = elements;\n elements = options;\n options = {};\n }\n\n if(!elements) {\n throw new Error(\"At least one element required.\");\n }\n\n if(!listener) {\n throw new Error(\"Listener required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n var elementsReady = 0;\n\n var callOnAdd = getOption(options, \"callOnAdd\", globalOptions.callOnAdd);\n var onReadyCallback = getOption(options, \"onReady\", function noop() {});\n var debug = getOption(options, \"debug\", globalOptions.debug);\n\n forEach(elements, function attachListenerToElement(element) {\n if (!stateHandler.getState(element)) {\n stateHandler.initState(element);\n idHandler.set(element);\n }\n\n var id = idHandler.get(element);\n\n debug && reporter.log(\"Attaching listener to element\", id, element);\n\n if(!elementUtils.isDetectable(element)) {\n debug && reporter.log(id, \"Not detectable.\");\n if(elementUtils.isBusy(element)) {\n debug && reporter.log(id, \"System busy making it detectable\");\n\n //The element is being prepared to be detectable. Do not make it detectable.\n //Just add the listener, because the element will soon be detectable.\n addListener(callOnAdd, element, listener);\n onReadyCallbacks[id] = onReadyCallbacks[id] || [];\n onReadyCallbacks[id].push(function onReady() {\n elementsReady++;\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n return;\n }\n\n debug && reporter.log(id, \"Making detectable...\");\n //The element is not prepared to be detectable, so do prepare it and add a listener to it.\n elementUtils.markBusy(element, true);\n return detectionStrategy.makeDetectable({ debug: debug, important: importantCssRules }, element, function onElementDetectable(element) {\n debug && reporter.log(id, \"onElementDetectable\");\n\n if (stateHandler.getState(element)) {\n elementUtils.markAsDetectable(element);\n elementUtils.markBusy(element, false);\n detectionStrategy.addListener(element, onResizeCallback);\n addListener(callOnAdd, element, listener);\n\n // Since the element size might have changed since the call to \"listenTo\", we need to check for this change,\n // so that a resize event may be emitted.\n // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.\n // Also, check the state existance before since the element may have been uninstalled in the installation process.\n var state = stateHandler.getState(element);\n if (state && state.startSize) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n if (state.startSize.width !== width || state.startSize.height !== height) {\n onResizeCallback(element);\n }\n }\n\n if(onReadyCallbacks[id]) {\n forEach(onReadyCallbacks[id], function(callback) {\n callback();\n });\n }\n } else {\n // The element has been unisntalled before being detectable.\n debug && reporter.log(id, \"Element uninstalled before being detectable.\");\n }\n\n delete onReadyCallbacks[id];\n\n elementsReady++;\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n }\n\n debug && reporter.log(id, \"Already detecable, adding listener.\");\n\n //The element has been prepared to be detectable and is ready to be listened to.\n addListener(callOnAdd, element, listener);\n elementsReady++;\n });\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n }\n\n function uninstall(elements) {\n if(!elements) {\n return reporter.error(\"At least one element is required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n forEach(elements, function (element) {\n eventListenerHandler.removeAllListeners(element);\n detectionStrategy.uninstall(element);\n stateHandler.cleanState(element);\n });\n }\n\n function initDocument(targetDocument) {\n detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);\n }\n\n return {\n listenTo: listenTo,\n removeListener: eventListenerHandler.removeListener,\n removeAllListeners: eventListenerHandler.removeAllListeners,\n uninstall: uninstall,\n initDocument: initDocument\n };\n};\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","const regexEscape = /[-/\\\\^$*+?.()|[\\]{}]/g\nexport function escapeRegExp (string) {\n if (string) {\n return string.replace(regexEscape, '\\\\$&')\n } else {\n return ''\n }\n}\n\nconst regexDaherize = /([A-Z])|(_)/g\nexport function dasherize (string) {\n if (!string) { return '' }\n\n string = `${string[0].toLowerCase()}${string.slice(1)}`\n return string.replace(regexDaherize, function (m, letter) {\n if (letter) {\n return `-${letter.toLowerCase()}`\n } else {\n return '-'\n }\n })\n}\n","'use strict'\n\nimport { Emitter } from 'atom'\nimport { escapeRegExp } from './deps/underscore-plus'\nimport path from 'path'\nimport Decoration from './decoration'\n\n/**\n * The mixin that provides the decorations API to the minimap editor\n * view.\n *\n * This mixin is injected into the `Minimap` prototype, so every methods defined\n * in this file will be available on any `Minimap` instance.\n */\nexport default class DecorationManagement {\n /**\n * Initializes the decorations related properties.\n */\n initializeDecorations (minimap) {\n this.minimap = minimap\n\n if (this.emitter == null) {\n /**\n * The minimap emitter, lazily created if not created yet.\n * @type {Emitter}\n * @access private\n */\n this.emitter = new Emitter()\n } else {\n this.emitter = this.minimap.emitter\n }\n\n /**\n * A map with the decoration id as key and the decoration as value.\n * @type {Object}\n * @access private\n */\n this.decorationsById = new Map()\n /**\n * The decorations stored in an array indexed with their marker id.\n * @type {Object}\n * @access private\n */\n this.decorationsByMarkerId = new Map()\n /**\n * The subscriptions to the markers `did-change` event indexed using the\n * marker id.\n * @type {Object}\n * @access private\n */\n this.decorationMarkerChangedSubscriptions = new Map()\n /**\n * The subscriptions to the markers `did-destroy` event indexed using the\n * marker id.\n * @type {Object}\n * @access private\n */\n this.decorationMarkerDestroyedSubscriptions = new Map()\n /**\n * The subscriptions to the decorations `did-change-properties` event\n * indexed using the decoration id.\n * @type {Object}\n * @access private\n */\n this.decorationUpdatedSubscriptions = new Map()\n /**\n * The subscriptions to the decorations `did-destroy` event indexed using\n * the decoration id.\n * @type {Object}\n * @access private\n */\n this.decorationDestroyedSubscriptions = new Map()\n\n // is set to true when a minimapElement is destroyed\n this.destroyed = false\n }\n\n /**\n * Returns all the decorations registered in the current `Minimap`.\n *\n * @return {Array} all the decorations in this `Minimap`\n */\n getDecorations () {\n return this.decorationsById.values()\n }\n\n /**\n * Registers an event listener to the `did-add-decoration` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidAddDecoration (callback) {\n return this.emitter.on('did-add-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-remove-decoration` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidRemoveDecoration (callback) {\n return this.emitter.on('did-remove-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-decoration` event.\n *\n * This event is triggered when the marker targeted by the decoration\n * was changed.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeDecoration (callback) {\n return this.emitter.on('did-change-decoration', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-decoration-range` event.\n *\n * This event is triggered when the marker range targeted by the decoration\n * was changed.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - marker: the marker object that was decorated\n * - decoration: the decoration object that was created\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeDecorationRange (callback) {\n return this.emitter.on('did-change-decoration-range', callback)\n }\n\n /**\n * Registers an event listener to the `did-update-decoration` event.\n *\n * This event is triggered when the decoration itself is modified.\n *\n * @param {function(decoration:Decoration):void} callback a function to call\n * when the event is\n * triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidUpdateDecoration (callback) {\n return this.emitter.on('did-update-decoration', callback)\n }\n\n /**\n * Returns the decoration with the passed-in id.\n *\n * @param {number} id the decoration id\n * @return {Decoration} the decoration with the given id\n */\n decorationForId (id) {\n return this.decorationsById.get(id)\n }\n\n /**\n * Returns all the decorations that intersect the passed-in row range.\n *\n * @param {number} startScreenRow the first row of the range\n * @param {number} endScreenRow the last row of the range\n * @return {Array} the decorations that intersect the passed-in\n * range\n */\n decorationsForScreenRowRange (startScreenRow, endScreenRow) {\n const decorationsByMarkerId = {}\n const markers = this.findMarkers({\n intersectsScreenRowRange: [startScreenRow, endScreenRow]\n })\n\n for (let i = 0, len = markers.length; i < len; i++) {\n const marker = markers[i]\n const decorations = this.decorationsByMarkerId.get(marker.id)\n\n if (decorations !== undefined) {\n decorationsByMarkerId[marker.id] = decorations\n }\n }\n\n return decorationsByMarkerId\n }\n\n /**\n * Returns the decorations that intersects the passed-in row range\n * in a structured way.\n *\n * At the first level, the keys are the available decoration types.\n * At the second level, the keys are the row index for which there\n * are decorations available. The value is an array containing the\n * decorations that intersects with the corresponding row.\n *\n * @return {Object} the decorations grouped by type and then rows\n * @property {Object} line all the line decorations by row\n * @property {Array} line[row] all the line decorations\n * at a given row\n * @property {Object} highlight-under all the highlight-under decorations\n * by row\n * @property {Array} highlight-under[row] all the highlight-under\n * decorations at a given row\n * @property {Object} highlight-over all the highlight-over decorations\n * by row\n * @property {Array} highlight-over[row] all the highlight-over\n * decorations at a given row\n * @property {Object} highlight-outine all the highlight-outine decorations\n * by row\n * @property {Array} highlight-outine[row] all the\n * highlight-outine decorations at a given\n * row\n */\n decorationsByTypeThenRows () {\n if (this.decorationsByTypeThenRowsCache != null) {\n return this.decorationsByTypeThenRowsCache\n }\n\n const cache = {}\n\n const decorations = this.decorationsById.values()\n for (const decoration of decorations) {\n const range = decoration.marker.getScreenRange()\n const type = decoration.getProperties().type\n\n if (cache[type] == null) { cache[type] = {} }\n\n for (let row = range.start.row, len = range.end.row; row <= len; row++) {\n if (cache[type][row] == null) { cache[type][row] = [] }\n\n cache[type][row].push(decoration)\n }\n }\n\n /**\n * The grouped decorations cache.\n * @type {Object}\n * @access private\n */\n this.decorationsByTypeThenRowsCache = cache\n return cache\n }\n\n /**\n * Invalidates the decoration by screen rows cache.\n */\n invalidateDecorationForScreenRowsCache () {\n this.decorationsByTypeThenRowsCache = null\n }\n\n /**\n * Adds a decoration that tracks a `Marker`. When the marker moves,\n * is invalidated, or is destroyed, the decoration will be updated to reflect\n * the marker's state.\n *\n * @param {Marker} marker the marker you want this decoration to follow\n * @param {Object} decorationParams the decoration properties\n * @param {string} decorationParams.type the decoration type in the following\n * list:\n * - __line__: Fills the line background with the decoration color.\n * - __highlight__: Renders a colored rectangle on the minimap. The highlight\n * is rendered above the line's text.\n * - __highlight-over__: Same as __highlight__.\n * - __highlight-under__: Renders a colored rectangle on the minimap. The\n * highlight is rendered below the line's text.\n * - __highlight-outline__: Renders a colored outline on the minimap. The\n * highlight box is rendered above the line's text.\n * - __foreground-custom__: A decoration type for which you have the control\n * over the render routine. Note that your routine should implement a render\n * on a per-line basis to avoid any side-effect with the offset bitmap cache\n * mechanism. These decorations are rendred on the foreground decorations\n * layer.\n * - __background-custom__: A decoration type for which you have the control\n * over the render routine. Note that your routine should implement a render\n * on a per-line basis to avoid any side-effect with the offset bitmap cache\n * mechanism. These decorations are rendred on the background decorations\n * layer.\n * @param {string} [decorationParams.class] the CSS class to use to retrieve\n * the background color of the\n * decoration by building a scop\n * corresponding to\n * `.minimap .editor `\n * @param {string} [decorationParams.scope] the scope to use to retrieve the\n * decoration background. Note that if\n * the `scope` property is set, the\n * `class` won't be used.\n * @param {string} [decorationParams.color] the CSS color to use to render\n * the decoration. When set, neither\n * `scope` nor `class` are used.\n * @param {string} [decorationParams.plugin] the name of the plugin that\n * created this decoration. It'll\n * be used to order the decorations\n * on the same layer and that are\n * overlapping. If the parameter is\n * omitted the Minimap will attempt\n * to infer the plugin origin from\n * the path of the caller function.\n * @param {function} [decorationParams.render] the render routine for custom\n * decorations. The function\n * receives the decoration and\n * the render data for the\n * current render pass.\n * @return {Decoration} the created decoration\n * @emits {did-add-decoration} when the decoration is created successfully\n * @emits {did-change} when the decoration is created successfully\n */\n decorateMarker (marker, decorationParams) {\n if (this.destroyed || this.minimap.destroyed || marker == null) { return }\n\n const { id } = marker\n\n if (decorationParams.type === 'highlight') {\n decorationParams.type = 'highlight-over'\n }\n\n const { type, plugin } = decorationParams\n\n if (plugin == null) {\n decorationParams.plugin = getOriginatorPackageName()\n }\n\n if (decorationParams.scope == null && decorationParams.class != null) {\n const cls = decorationParams.class.split(' ').join('.')\n decorationParams.scope = `.minimap .${cls}`\n }\n\n if (!this.decorationMarkerDestroyedSubscriptions.has(id)) {\n this.decorationMarkerDestroyedSubscriptions.set(id,\n marker.onDidDestroy(() => {\n this.removeAllDecorationsForMarker(marker)\n }))\n }\n\n if (!this.decorationMarkerChangedSubscriptions.has(id)) {\n this.decorationMarkerChangedSubscriptions.set(id,\n marker.onDidChange((event) => {\n const decorations = this.decorationsByMarkerId.get(id)\n const screenRange = marker.getScreenRange()\n\n this.invalidateDecorationForScreenRowsCache()\n\n if (decorations !== undefined) {\n for (let i = 0, len = decorations.length; i < len; i++) {\n const decoration = decorations[i]\n this.emitter.emit('did-change-decoration', {\n marker,\n decoration,\n event\n })\n this.emitDecorationChanges(decoration.type, decoration)\n\n decoration.screenRange = screenRange\n }\n }\n let oldStart = event.oldTailScreenPosition\n let oldEnd = event.oldHeadScreenPosition\n let newStart = event.newTailScreenPosition\n let newEnd = event.newHeadScreenPosition\n\n if (oldStart.row > oldEnd.row) {\n [oldStart, oldEnd] = [oldEnd, oldStart]\n }\n if (newStart.row > newEnd.row) {\n [newStart, newEnd] = [newEnd, newStart]\n }\n\n const rangesDiffs = computeRangesDiffs(\n oldStart, oldEnd,\n newStart, newEnd\n )\n\n for (let i = 0, len = rangesDiffs.length; i < len; i++) {\n const [start, end] = rangesDiffs[i]\n this.emitRangeChanges(type, {\n start,\n end\n }, 0)\n }\n }))\n }\n\n const decoration = new Decoration(marker, this, decorationParams)\n\n if (!this.decorationsByMarkerId.has(id)) {\n this.decorationsByMarkerId.set(id, [])\n }\n\n this.decorationsByMarkerId.get(id).push(decoration)\n this.decorationsById.set(decoration.id, decoration)\n\n if (!this.decorationUpdatedSubscriptions.has(decoration.id)) {\n this.decorationUpdatedSubscriptions.set(decoration.id,\n decoration.onDidChangeProperties((event) => {\n this.emitDecorationChanges(type, decoration)\n }))\n }\n\n this.decorationDestroyedSubscriptions.set(decoration.id,\n decoration.onDidDestroy(() => {\n this.removeDecoration(decoration)\n }))\n\n this.emitDecorationChanges(type, decoration)\n this.emitter.emit('did-add-decoration', {\n marker,\n decoration\n })\n\n return decoration\n }\n\n /**\n * Emits a change in the `Minimap` corresponding to the\n * passed-in decoration.\n *\n * @param {string} type the type of decoration that changed\n * @param {Decoration} decoration the decoration for which emitting an event\n * @access private\n */\n emitDecorationChanges (type, decoration) {\n if (this.destroyed || this.minimap.editorDestroyed()) { return }\n\n this.invalidateDecorationForScreenRowsCache()\n\n const range = decoration.screenRange\n if (!range.start || !range.end) { return }\n\n this.emitRangeChanges(type, range, 0)\n }\n\n /**\n * Emits a change for the specified range.\n *\n * @param {string} type the type of decoration that changed\n * @param {Object} range the range where changes occured\n * @param {number} [screenDelta] an optional screen delta for the\n * change object\n * @access private\n */\n emitRangeChanges (type, range, screenDelta) {\n const startScreenRow = range.start.row\n const endScreenRow = range.end.row\n const lastRenderedScreenRow = this.minimap.getLastVisibleScreenRow()\n const firstRenderedScreenRow = this.minimap.getFirstVisibleScreenRow()\n\n if (screenDelta == null) {\n screenDelta = (lastRenderedScreenRow - firstRenderedScreenRow) -\n (endScreenRow - startScreenRow)\n }\n\n const changeEvent = {\n start: startScreenRow,\n end: endScreenRow,\n screenDelta,\n type\n }\n\n this.emitter.emit('did-change-decoration-range', changeEvent)\n }\n\n /**\n * Removes a `Decoration` from this minimap.\n *\n * @param {Decoration} decoration the decoration to remove\n * @emits {did-change} when the decoration is removed\n * @emits {did-remove-decoration} when the decoration is removed\n */\n removeDecoration (decoration) {\n if (decoration == null) { return }\n\n const marker = decoration.marker\n let subscription\n\n this.decorationsById.delete(decoration.id)\n\n subscription = this.decorationUpdatedSubscriptions.get(decoration.id)\n if (subscription !== undefined) { subscription.dispose() }\n\n subscription = this.decorationDestroyedSubscriptions.get(decoration.id)\n if (subscription !== undefined) { subscription.dispose() }\n\n this.decorationUpdatedSubscriptions.delete(decoration.id)\n this.decorationDestroyedSubscriptions.delete(decoration.id)\n\n const decorations = this.decorationsByMarkerId.get(marker.id)\n if (decorations === undefined) { return }\n\n this.emitDecorationChanges(decoration.getProperties().type, decoration)\n\n const index = decorations.indexOf(decoration)\n if (index > -1) {\n decorations.splice(index, 1)\n\n this.emitter.emit('did-remove-decoration', {\n marker,\n decoration\n })\n\n if (decorations.length === 0) {\n this.removedAllMarkerDecorations(marker)\n }\n }\n }\n\n /**\n * Removes all the decorations registered for the passed-in marker.\n *\n * @param {Marker} marker the marker for which removing its decorations\n * @emits {did-change} when a decoration have been removed\n * @emits {did-remove-decoration} when a decoration have been removed\n */\n removeAllDecorationsForMarker (marker) {\n if (marker == null) { return }\n\n const decorations = this.decorationsByMarkerId.get(marker.id)\n if (decorations === undefined) { return }\n\n for (let i = 0, len = decorations.length; i < len; i++) {\n const decoration = decorations[i]\n\n if (!this.destroyed && !this.minimap.editorDestroyed()) {\n this.emitDecorationChanges(decoration.getProperties().type, decoration)\n }\n this.emitter.emit('did-remove-decoration', {\n marker,\n decoration\n })\n }\n\n this.removedAllMarkerDecorations(marker)\n }\n\n /**\n * Performs the removal of a decoration for a given marker.\n *\n * @param {Marker} marker the marker for which removing decorations\n * @access private\n */\n removedAllMarkerDecorations (marker) {\n if (marker == null) { return }\n\n this.decorationMarkerChangedSubscriptions.get(marker.id).dispose()\n this.decorationMarkerDestroyedSubscriptions.get(marker.id).dispose()\n\n this.decorationsByMarkerId.delete(marker.id)\n this.decorationMarkerChangedSubscriptions.delete(marker.id)\n this.decorationMarkerDestroyedSubscriptions.delete(marker.id)\n }\n\n /**\n * Removes all the decorations that was created in the current `Minimap`.\n */\n removeAllDecorations () {\n const decorationMarkerChangedSubscriptionsValues = this.decorationMarkerChangedSubscriptions.values()\n for (const decoration of decorationMarkerChangedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationMarkerDestroyedSubscriptionsValues = this.decorationMarkerDestroyedSubscriptions.values()\n for (const decoration of decorationMarkerDestroyedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationUpdatedSubscriptionsValues = this.decorationUpdatedSubscriptions.values()\n for (const decoration of decorationUpdatedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationDestroyedSubscriptionsValues = this.decorationDestroyedSubscriptions.values()\n for (const decoration of decorationDestroyedSubscriptionsValues) {\n decoration.dispose()\n }\n\n const decorationsByIdValues = this.decorationsById.values()\n for (const decoration of decorationsByIdValues) {\n decoration.destroy()\n }\n\n this.decorationsById.clear()\n this.decorationsByMarkerId.clear()\n this.decorationMarkerChangedSubscriptions.clear()\n this.decorationMarkerDestroyedSubscriptions.clear()\n this.decorationUpdatedSubscriptions.clear()\n this.decorationDestroyedSubscriptions.clear()\n }\n\n destroy () {\n this.removeAllDecorations()\n this.minimap = undefined\n this.emitter = undefined\n this.destroyed = true\n }\n}\n\nfunction getOriginatorPackageName () {\n const line = new Error().stack.split('\\n')[3]\n const filePath = line.split('(')[1].replace(')', '')\n const re = new RegExp(\n atom.packages.getPackageDirPaths().join('|') + escapeRegExp(path.sep)\n )\n const plugin = filePath.replace(re, '').split(path.sep)[0].replace(/minimap-|-minimap/, '')\n return plugin.indexOf(path.sep) < 0 ? plugin : undefined\n}\n\n/**\n * Given two ranges, it returns an array of ranges representing the\n * differences between them.\n *\n * @param {number} oldStart the row index of the first range start\n * @param {number} oldEnd the row index of the first range end\n * @param {number} newStart the row index of the second range start\n * @param {number} newEnd the row index of the second range end\n * @return {Array} the array of diff ranges\n * @access private\n */\nfunction computeRangesDiffs (oldStart, oldEnd, newStart, newEnd) {\n const diffs = []\n\n if (oldStart.isLessThan(newStart)) {\n diffs.push([oldStart, newStart])\n } else if (newStart.isLessThan(oldStart)) {\n diffs.push([newStart, oldStart])\n }\n\n if (oldEnd.isLessThan(newEnd)) {\n diffs.push([oldEnd, newEnd])\n } else if (newEnd.isLessThan(oldEnd)) {\n diffs.push([newEnd, oldEnd])\n }\n\n return diffs\n}\n","'use strict'\n\nimport { escapeRegExp } from '../deps/underscore-plus'\nimport Mixin from 'mixto'\n\nimport * as Main from '../main'\nimport { domStylesReader } from '../main'\nimport CanvasLayer from '../canvas-layer'\n\nconst SPEC_MODE = atom.inSpecMode()\n// an instance of MinimapElement used for testing and calling spies\nlet thisSpec\n\n/**\n * The `CanvasDrawer` mixin is responsible for the rendering of a `Minimap`\n * in a `canvas` element.\n *\n * This mixin is injected in the `MinimapElement` prototype, so all these\n * methods are available on any `MinimapElement` instance.\n */\nexport default class CanvasDrawer extends Mixin {\n /**\n * Initializes the canvas elements needed to perform the `Minimap` rendering.\n */\n initializeCanvas () {\n if (SPEC_MODE) {\n // class methods only used for spying the calls\n this.drawLines = (firstLine, lastLine) => { console.log({ firstLine, lastLine }) }\n this.drawLineDecoration = drawLineDecoration\n this.drawGutterDecoration = drawGutterDecoration\n this.drawHighlightDecoration = drawHighlightDecoration\n this.drawHighlightOutlineDecoration = drawHighlightOutlineDecoration\n this.drawCustomDecoration = drawCustomDecoration\n this.DOMStylesReader = domStylesReader\n thisSpec = this\n }\n\n /**\n * The main canvas layer where lines are rendered.\n * @type {CanvasLayer}\n */\n this.tokensLayer = new CanvasLayer()\n /**\n * The canvas layer for decorations below the text.\n * @type {CanvasLayer}\n */\n this.backLayer = new CanvasLayer()\n /**\n * The canvas layer for decorations above the text.\n * @type {CanvasLayer}\n */\n this.frontLayer = new CanvasLayer()\n\n if (!this.pendingChanges) {\n /**\n * Stores the changes from the text editor.\n * @type {Array}\n * @access private\n */\n this.pendingChanges = []\n }\n\n if (!this.pendingBackDecorationChanges) {\n /**\n * Stores the changes from the minimap back decorations.\n * @type {Array}\n * @access private\n */\n this.pendingBackDecorationChanges = []\n }\n\n if (!this.pendingFrontDecorationChanges) {\n /**\n * Stores the changes from the minimap front decorations.\n * @type {Array}\n * @access private\n */\n this.pendingFrontDecorationChanges = []\n }\n\n // the maximum number of tokens to render in one line\n this.maxTokensInOneLine = atom.config.get('minimap.maxTokensInOneLine')\n }\n\n /**\n * Returns the uppermost canvas in the MinimapElement.\n *\n * @return {HTMLCanvasElement} the html canvas element\n */\n getFrontCanvas () { return this.frontLayer.canvas }\n\n /**\n * Attaches the canvases into the specified container.\n *\n * @param {HTMLElement} parent the canvases' container\n * @access private\n */\n attachCanvases (parent) {\n this.backLayer.attach(parent)\n this.tokensLayer.attach(parent)\n this.frontLayer.attach(parent)\n }\n\n /**\n * Changes the size of all the canvas layers at once.\n *\n * @param {number} width the new width for the three canvases\n * @param {number} height the new height for the three canvases\n * @access private\n */\n setCanvasesSize (width, height) {\n this.backLayer.setSize(width, height)\n this.tokensLayer.setSize(width, height)\n this.frontLayer.setSize(width, height)\n }\n\n /**\n * Performs an update of the rendered `Minimap` based on the changes\n * registered in the instance.\n */\n updateCanvas () {\n const firstRow = this.minimap.getFirstVisibleScreenRow()\n const lastRow = this.minimap.getLastVisibleScreenRow()\n\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const lineHeight = this.minimap.getLineHeight() * devicePixelRatio\n const charHeight = this.minimap.getCharHeight() * devicePixelRatio\n const charWidth = this.minimap.getCharWidth() * devicePixelRatio\n const { width: canvasWidth, height: canvasHeight } = this.tokensLayer.getSize()\n const editor = this.minimap.getTextEditor()\n const editorElement = this.minimap.getTextEditorElement()\n\n // TODO avoid closure: https://stackoverflow.com/a/46256398/7910299\n const getTokenColorClosure = this.displayCodeHighlights ? (scopes) => getTokenColor(scopes, editorElement, this.textOpacity) : () => getDefaultColor(editorElement, this.textOpacity)\n\n updateTokensLayer(this.tokensLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingChanges, lineHeight, charHeight, charWidth, canvasWidth, editor, editor.getScreenLineCount(), getInvisibleRegExp(editor), getTokenColorClosure, this.ignoreWhitespacesInTokens, this.maxTokensInOneLine)\n\n if (SPEC_MODE) {\n // call the spy for drawLines which is used inside updateTokensLayer\n this.drawLines(firstRow, lastRow)\n }\n\n const decorations = this.DecorationManagement.decorationsByTypeThenRows(firstRow, lastRow)\n\n const renderData = {\n context: this.backLayer.context,\n canvasWidth,\n canvasHeight,\n lineHeight,\n charWidth,\n charHeight,\n orders: Main.getPluginsOrder()\n }\n\n const drawCustomDecorationLambda = (decoration, data, decorationColor) => drawCustomDecoration(decoration, data, decorationColor, editorElement)\n backgroundDecorationDispatcher['background-custom'] = drawCustomDecorationLambda\n frontDecorationDispatcher['foreground-custom'] = drawCustomDecorationLambda\n\n updateBackDecorationsLayer(this.backLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingBackDecorationChanges, renderData, lineHeight, editorElement, decorations)\n\n renderData.context = this.frontLayer.context\n\n updateFrontDecorationsLayer(this.frontLayer, firstRow, lastRow, this.offscreenFirstRow, this.offscreenLastRow, this.pendingFrontDecorationChanges, renderData, lineHeight, editorElement, decorations)\n\n this.pendingChanges = []\n this.pendingBackDecorationChanges = []\n this.pendingFrontDecorationChanges = []\n\n /**\n * The first row in the last render of the offscreen canvas.\n * @type {number}\n * @access private\n */\n this.offscreenFirstRow = firstRow\n /**\n * The last row in the last render of the offscreen canvas.\n * @type {number}\n * @access private\n */\n this.offscreenLastRow = lastRow\n }\n\n // ######## ######## ### ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ######## ## ## ## ## ##\n // ## ## ## ## ######### ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ######## ## ## ## ## ### ###\n\n /**\n * Routine used to render changes in specific ranges for one layer.\n *\n * @param {CanvasLayer} layer the layer to redraw\n * @param {Array} intactRanges an array of the ranges to leave intact\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n * @param {Function} method the render method to use for the lines drawing\n * @access private\n * Unused (inlined the code for performance reasons)\n */\n // redrawRangesOnLayer (layer, intactRanges, firstRow, lastRow, method) {\n // const devicePixelRatio = this.minimap.getDevicePixelRatio()\n // const lineHeight = this.minimap.getLineHeight() * devicePixelRatio\n //\n // layer.clearCanvas()\n //\n // if (intactRanges.length === 0) {\n // method.call(this, firstRow, lastRow, 0)\n // } else {\n // for (let j = 0, len = intactRanges.length; j < len; j++) {\n // const intact = intactRanges[j]\n //\n // layer.copyPartFromOffscreen(\n // intact.offscreenRow * lineHeight,\n // (intact.start - firstRow) * lineHeight,\n // (intact.end - intact.start) * lineHeight\n // )\n // }\n // drawLinesForRanges(method, intactRanges, firstRow, lastRow)\n // }\n //\n // layer.resetOffscreenSize()\n // layer.copyToOffscreen()\n // }\n\n /**\n * Renders the lines between the intact ranges when an update has pending\n * changes.\n *\n * @param {Function} method the render method to use for the lines drawing\n * @param {Array} intactRanges the intact ranges in the minimap\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @access private\n * Unused (inlined the code for performance reasons)\n */\n // drawLinesForRanges (method, ranges, firstRow, lastRow) {\n // let currentRow = firstRow\n // for (let i = 0, len = ranges.length; i < len; i++) {\n // const range = ranges[i]\n //\n // method.call(this, currentRow, range.start, currentRow - firstRow)\n //\n // currentRow = range.end\n // }\n // if (currentRow <= lastRow) {\n // method.call(this, currentRow, lastRow, currentRow - firstRow)\n // }\n // }\n}\n\n// ######## ######## ### ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ######## ## ## ## ## ##\n// ## ## ## ## ######### ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ######## ## ## ## ## ### ###\n\n/**\n * Performs an update of the tokens layer using the pending changes array.\n *\n * @param {CanvasLayer} tokensLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingChanges\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {number} charHeight this.minimap.getCharHeight() * devicePixelRatio\n * @param {number} charWidth this.minimap.getCharWidth() * devicePixelRatio\n * @param {number} canvasWidth this.tokensLayer.getSize().width\n * @param {TextEditor} editor this.minimap.getTextEditor()\n * @param {(t: Token) => string} getTokenColorClosure\n * @param {boolean} ignoreWhitespacesInTokens this.ignoreWhitespacesInTokens\n * @param {number} maxTokensInOneLine this.maxTokensInOneLine\n * @access private\n */\nfunction updateTokensLayer (tokensLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingChanges, lineHeight, charHeight, charWidth, canvasWidth, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine) {\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingChanges, offscreenFirstRow, offscreenLastRow)\n\n // redrawRangesOnLayer\n const context = tokensLayer.context\n\n tokensLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawLines(firstRow, lastRow, 0, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n tokensLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawLines(currentRow, range.start, currentRow - firstRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawLines(currentRow, lastRow, currentRow - firstRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine)\n }\n }\n\n tokensLayer.resetOffscreenSize()\n tokensLayer.copyToOffscreen()\n}\n\n/**\n * Performs an update of the back decorations layer using the pending back\n * decorations changes arrays.\n * @param {CanvasLayer} backLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n *\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingBackDecorationChanges\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction updateBackDecorationsLayer (backLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingBackDecorationChanges, renderData, lineHeight, editorElement, decorations) {\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingBackDecorationChanges, offscreenFirstRow, offscreenLastRow)\n\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n // redrawRangesOnLayer\n\n backLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawBackDecorationsForLines(firstRow, lastRow, 0, renderData, lineHeight, editorElement, decorations)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n backLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawBackDecorationsForLines(currentRow, range.start, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawBackDecorationsForLines(currentRow, lastRow, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n }\n }\n\n backLayer.resetOffscreenSize()\n backLayer.copyToOffscreen()\n}\n\n/**\n * Performs an update of the front decorations layer using the pending front\n * decorations changes arrays.\n *\n * @param {CanvasLayer} frontLayer\n * @param {number} firstRow firstRow the first row of the range to update\n * @param {number} lastRow lastRow the last row of the range to update\n *\n * @param {number} offscreenFirstRow\n * @param {number} offscreenLastRow\n * @param {Array<>} pendingFrontDecorationChanges\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction updateFrontDecorationsLayer (frontLayer, firstRow, lastRow, offscreenFirstRow, offscreenLastRow, pendingFrontDecorationChanges, renderData, lineHeight, editorElement, decorations) {\n const intactRanges = computeIntactRanges(firstRow, lastRow, pendingFrontDecorationChanges, offscreenFirstRow, offscreenLastRow)\n\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n // redrawRangesOnLayer\n\n frontLayer.clearCanvas()\n\n if (intactRanges.length === 0) {\n drawFrontDecorationsForLines(firstRow, lastRow, 0, renderData, lineHeight, editorElement, decorations)\n } else {\n for (let j = 0, len = intactRanges.length; j < len; j++) {\n const intact = intactRanges[j]\n\n frontLayer.copyPartFromOffscreen(\n intact.offscreenRow * lineHeight,\n (intact.start - firstRow) * lineHeight,\n (intact.end - intact.start) * lineHeight\n )\n }\n // drawLinesForRanges\n let currentRow = firstRow\n for (let i = 0, len = intactRanges.length; i < len; i++) {\n const range = intactRanges[i]\n\n drawFrontDecorationsForLines(currentRow, range.start, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n\n currentRow = range.end\n }\n if (currentRow <= lastRow) {\n drawFrontDecorationsForLines(currentRow, lastRow, currentRow - firstRow, renderData, lineHeight, editorElement, decorations)\n }\n }\n\n frontLayer.resetOffscreenSize()\n frontLayer.copyToOffscreen()\n}\n\nconst whitespaceTokenRegex = /^\\s+$/\nconst oneOrMoreWhiteSpaceRegexp = /\\s+/\n\n/**\n * Draws a single token on the given context.\n *\n * @param {CanvasRenderingContext2D} context the target canvas context\n * @param {string} text the token's text content\n * @param {string} color the token's CSS color\n * @param {number} x the x position of the token in the line\n * @param {number} y the y position of the line in the minimap\n * @param {number} charWidth the width of a character in the minimap\n * @param {number} charHeight the height of a character in the minimap\n * @return {number} the x position at the end of the token\n * @return {boolean} the x position at the end of the token\n * @access private\n */\nfunction drawToken (context, text, color, x, y, charWidth, charHeight, ignoreWhitespacesInTokens) {\n context.fillStyle = color\n\n if (ignoreWhitespacesInTokens) {\n const length = text.length * charWidth\n context.fillRect(x, y, length, charHeight)\n\n return x + length\n } else {\n let chars = 0\n for (let j = 0, len = text.length; j < len; j++) {\n const char = text[j]\n if (char === ' ') {\n if (chars > 0) {\n context.fillRect(x - (chars * charWidth), y, chars * charWidth, charHeight)\n }\n chars = 0\n } else {\n chars++\n }\n x += charWidth\n }\n if (chars > 0) {\n context.fillRect(x - (chars * charWidth), y, chars * charWidth, charHeight)\n }\n return x\n }\n}\n\n/**\n * Draws lines on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {number} charHeight this.minimap.getCharHeight() * devicePixelRatio\n * @param {number} charWidth this.minimap.getCharWidth() * devicePixelRatio\n * @param {number} canvasWidth this.tokensLayer.getSize().width\n * @param {CanvasRenderingContext2D} context this.tokensLayer.context\n * @param {TextEditor} editor this.minimap.getTextEditor()\n * @param {number} editorScreenLineCount\n * @param {RegExp} invisibleRegExp\n * @param {(t: Token) => string} getTokenColorClosure\n * @param {boolean} ignoreWhitespacesInTokens this.ignoreWhitespacesInTokens\n * @param {number} maxTokensInOneLine this.maxTokensInOneLine\n * @access private\n */\nfunction drawLines (firstRow, lastRow, offsetRow, lineHeight, charHeight, charWidth, canvasWidth, context, editor, editorScreenLineCount, invisibleRegExp, getTokenColorClosure, ignoreWhitespacesInTokens, maxTokensInOneLine) {\n // NOTE: this method is the hot function of Minimap. Do not refactor. The code is inlined delibarately.\n\n if (firstRow > lastRow) { return }\n\n let lastLine, x\n let y = (offsetRow * lineHeight) - lineHeight\n\n // eachTokenForScreenRows\n lastRow = Math.min(lastRow, editorScreenLineCount)\n\n for (let line = firstRow; line < lastRow; line++) {\n const editorTokensForScreenRow = editor.tokensForScreenRow(line)\n const numToken = editorTokensForScreenRow.length\n const numTokenToRender = Math.min(numToken, maxTokensInOneLine)\n for (let iToken = 0; iToken < numTokenToRender; iToken++) {\n const token = editorTokensForScreenRow[iToken]\n const tokenText = token.text.replace(invisibleRegExp, ' ')\n const tokenScopes = token.scopes\n\n if (lastLine !== line) {\n x = 0\n y += lineHeight\n lastLine = line\n context.clearRect(x, y, canvasWidth, lineHeight)\n }\n if (x > canvasWidth) { continue }\n\n if (whitespaceTokenRegex.test(tokenText)) {\n x += tokenText.length * charWidth\n } else {\n x = drawToken(\n context, tokenText, getTokenColorClosure(tokenScopes), x, y, charWidth, charHeight, ignoreWhitespacesInTokens\n )\n }\n }\n }\n\n context.fill()\n}\n\n/**\n * Returns the regexp to replace invisibles substitution characters\n * in editor lines.\n * @param {TextEditor} editor\n * @return {RegExp} the regular expression to match invisible characters\n * @access private\n */\nfunction getInvisibleRegExp (editor) {\n const invisibles = editor.getInvisibles()\n const regexp = []\n if (invisibles.cr != null) { regexp.push(invisibles.cr) }\n if (invisibles.eol != null) { regexp.push(invisibles.eol) }\n if (invisibles.space != null) { regexp.push(invisibles.space) }\n if (invisibles.tab != null) { regexp.push(invisibles.tab) }\n\n if (regexp.length !== 0) {\n return RegExp(regexp.filter((s) => {\n return typeof s === 'string'\n }).map(escapeRegExp).join('|'), 'g')\n } else {\n return null\n }\n}\n\n/**\n * dispatchers for decoration drawing (custom decoration drawer added dynamically)\n * @param {Object} backgroundDecorationDispatcher an object with the type to render as key and the\n * render method as value\n*/\nconst backgroundDecorationDispatcher = {\n line: drawLineDecoration,\n 'highlight-under': drawHighlightDecoration\n}\n\n/**\n * dispatchers for decoration drawing (custom decoration drawer added dynamically)\n * @param {Object} frontDecorationDispatcher an object with the type to render as key and the\n * render method as value\n*/\nconst frontDecorationDispatcher = {\n gutter: drawGutterDecoration,\n 'highlight-over': drawHighlightDecoration,\n 'highlight-outline': drawHighlightOutlineDecoration\n}\n\n/**\n * Draws a line decoration.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawLineDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, canvasWidth, yRow } = data\n\n context.fillStyle = decorationColor\n context.fillRect(0, yRow, canvasWidth, lineHeight)\n}\n\n/**\n * Draws a gutter decoration.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawGutterDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, yRow } = data\n\n context.fillStyle = decorationColor\n context.fillRect(0, yRow, 1, lineHeight)\n}\n\n/**\n * Draws a highlight decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawHighlightDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, charWidth, canvasWidth, screenRow, yRow } = data\n\n const range = decoration.getMarker().getScreenRange()\n const rowSpan = range.end.row - range.start.row\n\n context.fillStyle = decorationColor\n\n if (rowSpan === 0) {\n const colSpan = range.end.column - range.start.column\n context.fillRect(range.start.column * charWidth, yRow, colSpan * charWidth, lineHeight)\n } else if (screenRow === range.start.row) {\n const x = range.start.column * charWidth\n context.fillRect(x, yRow, canvasWidth - x, lineHeight)\n } else if (screenRow === range.end.row) {\n context.fillRect(0, yRow, range.end.column * charWidth, lineHeight)\n } else {\n context.fillRect(0, yRow, canvasWidth, lineHeight)\n }\n}\n\n/**\n * Draws a highlight outline decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @access private\n */\nfunction drawHighlightOutlineDecoration (decoration, data, decorationColor) {\n const { context, lineHeight, charWidth, canvasWidth, screenRow, yRow } = data\n\n let bottomWidth, colSpan, width, xBottomStart, xEnd, xStart\n const range = decoration.getMarker().getScreenRange()\n const rowSpan = range.end.row - range.start.row\n const yStart = yRow\n const yEnd = yStart + lineHeight\n\n context.fillStyle = decorationColor\n\n if (rowSpan === 0) {\n colSpan = range.end.column - range.start.column\n width = colSpan * charWidth\n xStart = range.start.column * charWidth\n xEnd = xStart + width\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xStart, yEnd - 1, width, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n } else if (rowSpan === 1) {\n xStart = range.start.column * charWidth\n xEnd = range.end.column * charWidth\n\n if (screenRow === range.start.row) {\n width = canvasWidth - xStart\n xBottomStart = Math.max(xStart, xEnd)\n bottomWidth = canvasWidth - xBottomStart\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xBottomStart, yEnd - 1, bottomWidth, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n } else {\n width = canvasWidth - xStart\n bottomWidth = canvasWidth - xEnd\n\n context.fillRect(0, yStart, xStart, 1)\n context.fillRect(0, yEnd - 1, xEnd, 1)\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n }\n } else {\n xStart = range.start.column * charWidth\n xEnd = range.end.column * charWidth\n if (screenRow === range.start.row) {\n width = canvasWidth - xStart\n\n context.fillRect(xStart, yStart, width, 1)\n context.fillRect(xStart, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n } else if (screenRow === range.end.row) {\n width = canvasWidth - xStart\n\n context.fillRect(0, yEnd - 1, xEnd, 1)\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(xEnd, yStart, 1, lineHeight)\n } else {\n context.fillRect(0, yStart, 1, lineHeight)\n context.fillRect(canvasWidth - 1, yStart, 1, lineHeight)\n if (screenRow === range.start.row + 1) {\n context.fillRect(0, yStart, xStart, 1)\n }\n if (screenRow === range.end.row - 1) {\n context.fillRect(xEnd, yEnd - 1, canvasWidth - xEnd, 1)\n }\n }\n }\n}\n\n/**\n * Draws a custom decoration.\n *\n * It renders only the part of the highlight corresponding to the specified\n * row.\n *\n * @param {Decoration} decoration the decoration to render\n * @param {Object} data the data need to perform the render\n * @param {string} decorationColor decoration color\n * @param {TextEditorElement} editorElement\n * @access private\n */\nfunction drawCustomDecoration (decoration, data, decorationColor, editorElement) {\n const renderRoutine = decoration.getProperties().render\n\n if (renderRoutine) {\n data.color = decorationColor\n renderRoutine(decoration, data, editorElement)\n }\n}\n\n/**\n * Draws the specified decorations for the current `screenRow`.\n *\n * The `decorations` object contains all the decorations grouped by type and\n * then rows.\n *\n * @param {number} screenRow the screen row index for which\n * render decorations\n * @param {Object} decorations the object containing all the decorations\n * @param {Object} renderData the object containing the render data\n * @param {Object} types an object with the type to render as key and the\n * render method as value\n * @param {TextEditorElement} editorElement\n * @access private\n */\nfunction drawDecorations (screenRow, decorations, renderData, types, editorElement) {\n let decorationsToRender = []\n\n renderData.context.clearRect(\n 0, renderData.yRow,\n renderData.canvasWidth, renderData.lineHeight\n )\n\n for (const i in types) {\n decorationsToRender = decorationsToRender.concat(\n decorations[i] != null ? decorations[i][screenRow] || [] : []\n )\n }\n\n decorationsToRender.sort((a, b) =>\n (renderData.orders[a.properties.plugin] || 0) - (renderData.orders[b.properties.plugin] || 0)\n )\n\n if (decorationsToRender != null ? decorationsToRender.length : undefined) {\n for (let i = 0, len = decorationsToRender.length; i < len; i++) {\n const decoration = decorationsToRender[i]\n const decorationDrawer = types[decoration.properties.type]\n if (!SPEC_MODE) {\n decorationDrawer(\n decoration,\n renderData,\n /* decorationColor */ getDecorationColor(decoration, editorElement)\n )\n } else {\n // get the real function name from the mangeld Parcel names\n const functionName = decorationDrawer.name.split('$').pop().replace('Lambda', '')\n // call the spy:\n thisSpec[functionName](\n decoration,\n renderData,\n /* decorationColor */ getDecorationColor(decoration, editorElement)\n )\n }\n }\n }\n}\n\n/**\n * Draws front decorations on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n *\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction drawFrontDecorationsForLines (firstRow, lastRow, offsetRow, renderData, lineHeight, editorElement, decorations) {\n if (firstRow > lastRow) { return }\n\n for (let screenRow = firstRow; screenRow <= lastRow; screenRow++) {\n renderData.row = offsetRow + (screenRow - firstRow)\n renderData.yRow = renderData.row * lineHeight\n renderData.screenRow = screenRow\n\n drawDecorations(screenRow, decorations, renderData, frontDecorationDispatcher, editorElement)\n }\n\n renderData.context.fill()\n}\n\n/**\n * Draws back decorations on the corresponding layer.\n *\n * The lines range to draw is specified by the `firstRow` and `lastRow`\n * parameters.\n *\n * @param {number} firstRow the first row to render\n * @param {number} lastRow the last row to render\n * @param {number} offsetRow the relative offset to apply to rows when\n * rendering them\n *\n * @param {Object} renderData\n * @param {number} lineHeight this.minimap.getLineHeight() * devicePixelRatio\n * @param {TextEditorElement} editorElement this.minimap.getTextEditorElement()\n * @param {Array} decorations\n * @access private\n */\nfunction drawBackDecorationsForLines (firstRow, lastRow, offsetRow, renderData, lineHeight, editorElement, decorations) {\n if (firstRow > lastRow) { return }\n\n for (let screenRow = firstRow; screenRow <= lastRow; screenRow++) {\n renderData.row = offsetRow + (screenRow - firstRow)\n renderData.yRow = renderData.row * lineHeight\n renderData.screenRow = screenRow\n\n drawDecorations(screenRow, decorations, renderData, backgroundDecorationDispatcher, editorElement)\n }\n\n renderData.context.fill()\n}\n\n// ###### ####### ## ####### ######## ######\n// ## ## ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ######## ######\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ## ##\n// ###### ####### ######## ####### ## ## ######\n\n/**\n * Returns the opacity value to use when rendering the `Minimap` text.\n *\n * @return {Number} the text opacity value\n * Unused (inlined)\n */\n// getTextOpacity () { return this.textOpacity }\n\n/**\n * Returns the default text color for an editor content.\n *\n * The color value is directly read from the `TextEditorView` computed styles.\n * @param {TextEditorElement} editorElement\n * @param {number} textOpacity\n * @return {string} a CSS color\n */\nfunction getDefaultColor (editorElement, textOpacity) {\n const color = domStylesReader.retrieveStyleFromDom(['.editor'], 'color', editorElement, true)\n return transparentize(color, textOpacity)\n}\n\n/**\n * Returns the text color for the passed-in scopes\n *\n * The color value is read from the DOM by creating a node structure that\n * match the token `scope` property.\n *\n * @param {Array} scopes an array of scopes for a `TextEditor` token (token.scopeDescriptor || token.scopes)\n * @param {TextEditorElement} editorElement\n * @param {number} textOpacity\n * @return {string} the CSS color for the provided token\n */\nfunction getTokenColor (scopes, editorElement, textOpacity) {\n const color = domStylesReader.retrieveStyleFromDom(scopes, 'color', editorElement, true)\n\n return transparentize(color, textOpacity)\n}\n\n/**\n * Converts a `rgb(...)` color into a `rgba(...)` color with the specified\n * opacity.\n *\n * @param {string} color the CSS RGB color to transparentize\n * @param {number} opacity the opacity amount\n * @return {string} the transparentized CSS color\n * @access private\n */\nfunction transparentize (color, opacity) {\n // assumes that color is in form of `rgb(content)` with no spaces around the given value\n return `rgba(${color.slice(4, -1)}, ${opacity})`\n}\n\n/**\n * Returns the background color for the passed-in `decoration` object.\n *\n * The color value is read from the DOM by creating a node structure that\n * match the decoration `scope` property unless the decoration provides\n * its own `color` property.\n *\n * @param {Decoration} decoration the decoration to get the color for\n * @param {TextEditorElement} editorElement\n * @return {string} the CSS color for the provided decoration\n */\nfunction getDecorationColor (decoration, editorElement) {\n const properties = decoration.getProperties()\n if (properties.color) { return properties.color }\n\n if (properties.scope) {\n const scopeString = properties.scope.split(oneOrMoreWhiteSpaceRegexp)\n return domStylesReader.retrieveStyleFromDom(scopeString, 'background-color', editorElement, true)\n } else {\n return getDefaultColor(editorElement)\n }\n}\n\n// ######## ### ## ## ###### ######## ######\n// ## ## ## ## ### ## ## ## ## ## ##\n// ## ## ## ## #### ## ## ## ##\n// ######## ## ## ## ## ## ## #### ###### ######\n// ## ## ######### ## #### ## ## ## ##\n// ## ## ## ## ## ### ## ## ## ## ##\n// ## ## ## ## ## ## ###### ######## ######\n\n/**\n * Computes the ranges that are not affected by the current pending changes.\n *\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @param {number | null} offscreenFirstRow CanvasDrawer.offscreenLastRow\n * @param {number | null} offscreenLastRow CanvasDrawer.offscreenLastRow\n * @return {Array} the intact ranges in the rendered region\n * @access private\n */\nfunction computeIntactRanges (firstRow, lastRow, changes, offscreenFirstRow, offscreenLastRow) {\n // TODO when do they get null?\n if ((offscreenFirstRow == null) && (offscreenLastRow == null)) {\n return []\n }\n\n // At first, the whole range is considered intact\n let intactRanges = [\n {\n start: offscreenFirstRow,\n end: offscreenLastRow,\n offscreenRow: 0\n }\n ]\n\n for (let i = 0, len = changes.length; i < len; i++) {\n const change = changes[i]\n const newIntactRanges = []\n\n for (let j = 0, intactLen = intactRanges.length; j < intactLen; j++) {\n const range = intactRanges[j]\n\n if (change.end < range.start && change.screenDelta !== 0) {\n // The change is above of the range and lines are either\n // added or removed\n newIntactRanges.push({\n start: range.start + change.screenDelta,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow\n })\n } else if (change.end < range.start || change.start > range.end) {\n // The change is outside the range but didn't add\n // or remove lines\n newIntactRanges.push(range)\n } else {\n // The change is within the range, there's one intact range\n // from the range start to the change start\n if (change.start > range.start) {\n newIntactRanges.push({\n start: range.start,\n end: change.start - 1,\n offscreenRow: range.offscreenRow\n })\n }\n if (change.end < range.end) {\n // The change ends within the range\n if (change.bufferDelta !== 0) {\n // Lines are added or removed, the intact range starts in the\n // next line after the change end plus the screen delta\n newIntactRanges.push({\n start: change.end + change.screenDelta + 1,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n } else if (change.screenDelta !== 0) {\n // Lines are added or removed in the display buffer, the intact\n // range starts in the next line after the change end plus the\n // screen delta\n newIntactRanges.push({\n start: change.end + change.screenDelta + 1,\n end: range.end + change.screenDelta,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n } else {\n // No lines are added, the intact range starts on the line after\n // the change end\n newIntactRanges.push({\n start: change.end + 1,\n end: range.end,\n offscreenRow: range.offscreenRow + change.end + 1 - range.start\n })\n }\n }\n }\n }\n intactRanges = newIntactRanges\n }\n\n return truncateIntactRanges(intactRanges, firstRow, lastRow)\n}\n\n/**\n * Truncates the intact ranges so that they doesn't expand past the visible\n * area of the minimap.\n *\n * @param {Array} intactRanges the initial array of ranges\n * @param {number} firstRow the first row of the rendered region\n * @param {number} lastRow the last row of the rendered region\n * @return {Array} the array of truncated ranges\n * @access private\n */\nfunction truncateIntactRanges (intactRanges, firstRow, lastRow) {\n let i = 0\n while (i < intactRanges.length) {\n const range = intactRanges[i]\n\n if (range.start < firstRow) {\n range.offscreenRow += firstRow - range.start\n range.start = firstRow\n }\n\n if (range.end > lastRow) { range.end = lastRow }\n\n if (range.start >= range.end) { intactRanges.splice(i--, 1) }\n\n i++\n }\n\n return intactRanges.sort((a, b) => {\n return a.offscreenRow - b.offscreenRow\n })\n}\n","'use strict'\n\n/**\n * Generates a decorator function to includes many `mixto` mixins into a class.\n *\n * @param {...Mixin} mixins the mixins to include in the class\n * @return {function(cls:Function):Function} the decorator function that will\n * include the specified mixins\n * @example\n * @include(SomeMixin)\n * export default class SomeClass {\n * // ...\n * }\n */\nexport default function include (cls, ...mixins) {\n mixins.forEach((mixin) => { includeMixin(cls, mixin) })\n}\n\nfunction includeMixin (target, source) {\n Object.getOwnPropertyNames(source).forEach((k) => {\n if (['length', 'name', 'arguments', 'caller', 'prototype', 'includeInto'].indexOf(k) >= 0) { return }\n\n const descriptor = Object.getOwnPropertyDescriptor(source, k)\n Object.defineProperty(target, k, descriptor)\n })\n\n Object.getOwnPropertyNames(source.prototype).forEach((k) => {\n if (k === 'constructor') { return }\n\n const descriptor = Object.getOwnPropertyDescriptor(source.prototype, k)\n Object.defineProperty(target.prototype, k, descriptor)\n })\n}\n","'use strict'\n\nimport { registerOrUpdateElement } from 'atom-utils-plus'\n\n/**\n * Generates a decorator function to convert a class into a custom element\n * through the `registerOrUpdateElement` method from `atom-utils-plus`.\n *\n * The decorator will take care to return the generated element class so that\n * you can just export it directly as demonstrated below.\n *\n * As supported by the `registerOrUpdateElement` method, static member will\n * be available on the new class.\n *\n * **Note: As there's some limitations when modifying the prototype\n * of a custom element, if you need to inject element callbacks (like\n * `createdCallback`) through a mixin, the mixins should be included before\n * converting the class as a custom element. You'll be able to achieve that by\n * placing the `include` decorator after the `element` one as shown in the\n * second example.**\n *\n * @param {string} elementName the node name of the element to register\n * @return {Function} the element class as returned by\n * `document.registerElement`\n * @example\n * @element('dummy-element-name')\n * export default class SomeClass {\n * // ...\n * }\n *\n * @element('dummy-element-with-mixin')\n * @include(SomeMixin)\n * export default class SomeClass {\n * // ...\n * }\n */\nexport default function element (cls, elementName) {\n return registerOrUpdateElement(elementName, { class: cls })\n}\n","'use strict'\n\nimport { CompositeDisposable, Disposable } from 'atom'\nimport { EventsDelegation, AncestorsMethods } from 'atom-utils-plus'\nimport elementResizeDetectorImport from 'element-resize-detector'\nimport DecorationManagement from './decoration-management'\n\nimport * as Main from './main'\nimport CanvasDrawer from './mixins/canvas-drawer'\nimport include from './decorators/include'\nimport element from './decorators/element'\n\nimport MinimapQuickSettingsElement from './minimap-quick-settings-element'\nconst elementResizeDetector = elementResizeDetectorImport({ strategy: 'scroll' })\n\nlet overlayStyle\n\nfunction ensureOverlayStyle () {\n if (!overlayStyle) {\n overlayStyle = document.createElement('style')\n overlayStyle.setAttribute('context', 'atom-text-editor-minimap')\n document.head.appendChild(overlayStyle)\n }\n}\n\nfunction removeOverlayStyle () {\n if (overlayStyle) {\n overlayStyle.parentNode.removeChild(overlayStyle)\n overlayStyle = null\n }\n}\n\nfunction updateOverlayStyle (basis) {\n if (overlayStyle) {\n overlayStyle.textContent = `\n atom-text-editor[with-minimap].editor > div,\n atom-text-editor[with-minimap] > div {\n margin-left: ${basis}px;\n }\n `\n }\n}\n\nconst SPEC_MODE = atom.inSpecMode()\n\n/**\n * Public: The MinimapElement is the view meant to render a {@link Minimap}\n * instance in the DOM.\n *\n * You can retrieve the MinimapElement associated to a Minimap\n * using the `atom.views.getView` method.\n *\n * Note that most interactions with the Minimap package is done through the\n * Minimap model so you should never have to access MinimapElement\n * instances.\n *\n * @example\n * let minimapElement = atom.views.getView(minimap)\n */\nclass MinimapElement {\n static initClass () {\n include(this, CanvasDrawer, EventsDelegation, AncestorsMethods)\n return element(this, 'atom-text-editor-minimap')\n }\n\n // ## ## ####### ####### ## ## ######\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ######### ## ## ## ## ##### ######\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ####### ####### ## ## ######\n\n /**\n * DOM callback invoked when a new MinimapElement is created.\n *\n * @access private\n */\n createdCallback () {\n // Core properties\n\n /**\n * @access private\n */\n this.minimap = undefined\n\n /**\n * @access private\n */\n this.width = undefined\n /**\n * @access private\n */\n this.height = undefined\n\n // Subscriptions\n\n /**\n * @access private\n */\n this.subscriptions = new CompositeDisposable()\n /**\n * @access private\n */\n this.visibleAreaSubscription = undefined\n /**\n * @access private\n */\n this.quickSettingsSubscription = undefined\n /**\n * @access private\n */\n this.dragSubscription = undefined\n /**\n * @access private\n */\n this.openQuickSettingSubscription = undefined\n\n // Configs\n\n /**\n * @access private\n */\n this.displayMinimapOnLeft = false\n /**\n * @access private\n */\n this.minimapScrollIndicator = undefined\n /**\n * @access private\n */\n this.displayMinimapOnLeft = undefined\n /**\n * @access private\n */\n this.displayPluginsControls = undefined\n /**\n * @access private\n */\n this.textOpacity = undefined\n /**\n * @access private\n */\n this.displayCodeHighlights = undefined\n /**\n * @access private\n */\n this.adjustToSoftWrap = undefined\n /**\n * @access private\n */\n this.useHardwareAcceleration = undefined\n /**\n * @access private\n */\n this.absoluteMode = undefined\n\n // Elements\n\n /**\n * @access private\n */\n this.visibleArea = undefined\n /**\n * @access private\n */\n this.controls = undefined\n /**\n * @access private\n */\n this.scrollIndicator = undefined\n /**\n * @access private\n */\n this.openQuickSettings = undefined\n /**\n * @access private\n */\n this.quickSettingsElement = undefined\n\n this.DecorationManagement = new DecorationManagement()\n\n // States\n\n /**\n * @access private\n */\n this.attached = undefined\n /**\n * @access private\n */\n this.attachedToTextEditor = undefined\n /**\n * @access private\n */\n this.standAlone = undefined\n /**\n * @access private\n */\n this.wasVisible = undefined\n\n // Other\n\n /**\n * @access private\n */\n this.offscreenFirstRow = undefined\n /**\n * @access private\n */\n this.offscreenLastRow = undefined\n /**\n * @access private\n */\n this.frameRequested = undefined\n /**\n * @access private\n */\n this.flexBasis = undefined\n\n this.initializeContent()\n\n this.subscriptions.add(\n atom.config.observe('minimap.displayMinimapOnLeft', (displayMinimapOnLeft) => {\n this.displayMinimapOnLeft = displayMinimapOnLeft\n\n displayMinimapOnLeft\n ? ensureOverlayStyle()\n : removeOverlayStyle()\n this.updateMinimapFlexPosition()\n this.measureHeightAndWidth(true, true)\n }),\n\n atom.config.observe('minimap.minimapScrollIndicator', (minimapScrollIndicator) => {\n this.minimapScrollIndicator = minimapScrollIndicator\n\n if (this.minimapScrollIndicator && !(this.scrollIndicator != null) && !this.standAlone) {\n this.initializeScrollIndicator()\n } else if ((this.scrollIndicator != null)) {\n this.disposeScrollIndicator()\n }\n\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('minimap.displayPluginsControls', (displayPluginsControls) => {\n this.displayPluginsControls = displayPluginsControls\n\n if (this.displayPluginsControls && !(this.openQuickSettings != null) && !this.standAlone) {\n this.initializeOpenQuickSettings()\n } else if ((this.openQuickSettings != null)) {\n this.disposeOpenQuickSettings()\n }\n }),\n\n atom.config.observe('minimap.textOpacity', (textOpacity) => {\n this.textOpacity = textOpacity\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('minimap.displayCodeHighlights', (displayCodeHighlights) => {\n this.displayCodeHighlights = displayCodeHighlights\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('minimap.smoothScrolling', (smoothScrolling) => {\n this.smoothScrolling = smoothScrolling\n\n if (this.attached) {\n if (!this.smoothScrolling) {\n this.backLayer.canvas.style.cssText = ''\n this.tokensLayer.canvas.style.cssText = ''\n this.frontLayer.canvas.style.cssText = ''\n } else {\n this.requestUpdate()\n }\n }\n }),\n\n atom.config.observe('minimap.adjustMinimapWidthToSoftWrap', (adjustToSoftWrap) => {\n this.adjustToSoftWrap = adjustToSoftWrap\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.adjustMinimapWidthOnlyIfSmaller', (adjustOnlyIfSmaller) => {\n this.adjustOnlyIfSmaller = adjustOnlyIfSmaller\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.useHardwareAcceleration', (useHardwareAcceleration) => {\n this.useHardwareAcceleration = useHardwareAcceleration\n\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('minimap.absoluteMode', (absoluteMode) => {\n this.absoluteMode = absoluteMode\n\n this.classList.toggle('absolute', this.absoluteMode)\n }),\n\n atom.config.observe('minimap.adjustAbsoluteModeHeight', (adjustAbsoluteModeHeight) => {\n this.adjustAbsoluteModeHeight = adjustAbsoluteModeHeight\n\n this.classList.toggle('adjust-absolute-height', this.adjustAbsoluteModeHeight)\n\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('minimap.ignoreWhitespacesInTokens', (ignoreWhitespacesInTokens) => {\n this.ignoreWhitespacesInTokens = ignoreWhitespacesInTokens\n\n if (this.attached) { this.requestForcedUpdate() }\n }),\n\n atom.config.observe('editor.preferredLineLength', () => {\n if (this.attached) { this.measureHeightAndWidth() }\n }),\n\n atom.config.observe('editor.softWrap', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.showInvisibles', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.invisibles', () => {\n if (this.attached) { this.requestUpdate() }\n }),\n\n atom.config.observe('editor.softWrapAtPreferredLineLength', () => {\n if (this.attached) { this.requestUpdate() }\n })\n )\n }\n\n /**\n * DOM callback invoked when a new MinimapElement is attached to the DOM.\n *\n * @access private\n */\n attachedCallback () {\n if (typeof atom.views.pollDocument === 'function') {\n this.subscriptions.add(atom.views.pollDocument(() => { this.pollDOM() }))\n } else {\n this.intersectionObserver = new IntersectionObserver((entries) => {\n const { intersectionRect } = entries[entries.length - 1]\n if (intersectionRect.width > 0 || intersectionRect.height > 0) {\n this.measureHeightAndWidth(true, true)\n }\n })\n\n this.intersectionObserver.observe(this)\n if (this.isVisible()) {\n this.measureHeightAndWidth(true, true)\n }\n\n const measureDimensions = () => { this.measureHeightAndWidth(false, false) }\n elementResizeDetector.listenTo(this, measureDimensions)\n window.addEventListener('resize', measureDimensions, { passive: true })\n\n this.subscriptions.add(\n new Disposable(() => { elementResizeDetector.removeListener(this, measureDimensions) }),\n new Disposable(() => { window.removeEventListener('resize', measureDimensions) })\n )\n }\n\n this.measureHeightAndWidth()\n this.updateMinimapFlexPosition()\n this.attached = true\n this.attachedToTextEditor = this.queryParentSelector('atom-text-editor') === this.minimap.getTextEditorElement()\n\n if (this.attachedToTextEditor) {\n this.minimap.getTextEditorElement().setAttribute('with-minimap', '')\n }\n\n this.subscriptions.add(\n this.subscribeToMediaQuery()\n )\n }\n\n /**\n * DOM callback invoked when a new MinimapElement is detached from the DOM.\n *\n * @access private\n */\n detachedCallback () {\n this.minimap.getTextEditorElement().removeAttribute('with-minimap')\n this.attached = false\n }\n\n // ### ######## ######## ### ###### ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## #########\n // ######### ## ## ######### ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ###### ## ##\n\n /**\n * Returns whether the MinimapElement is currently visible on screen or not.\n *\n * The visibility of the minimap is defined by testing the size of the offset\n * width and height of the element.\n *\n * @return {boolean} whether the MinimapElement is currently visible or not\n */\n isVisible () { return this.offsetWidth > 0 || this.offsetHeight > 0 }\n\n /**\n * Attaches the MinimapElement to the DOM.\n *\n * The position at which the element is attached is defined by the\n * `displayMinimapOnLeft` setting.\n *\n * @param {HTMLElement} [parent] the DOM node where attaching the minimap\n * element\n */\n attach (parent) {\n if (this.attached) { return }\n\n const container = parent || this.minimap.getTextEditorElement()\n const minimaps = container.querySelectorAll('atom-text-editor-minimap')\n if (minimaps.length) {\n Array.prototype.forEach.call(minimaps, (el) => {\n el.destroy()\n container.removeChild(el)\n })\n }\n container.appendChild(this)\n }\n\n /**\n * Detaches the MinimapElement from the DOM.\n */\n detach () {\n if (!this.attached || this.parentNode == null) { return }\n this.parentNode.removeChild(this)\n }\n\n /**\n * Toggles the minimap left/right position based on the value of the\n * `displayMinimapOnLeft` setting.\n *\n * @access private\n */\n updateMinimapFlexPosition () {\n this.classList.toggle('left', this.displayMinimapOnLeft)\n }\n\n /**\n * Destroys this MinimapElement\n */\n destroy () {\n this.DecorationManagement.destroy()\n if (this.quickSettingsElement) {\n this.quickSettingsElement.destroy()\n }\n this.subscriptions.dispose()\n this.detach()\n if (this.minimap) {\n this.minimap.minimapElement = null\n this.minimap = null\n }\n }\n\n // ###### ####### ## ## ######## ######## ## ## ########\n // ## ## ## ## ### ## ## ## ### ## ##\n // ## ## ## #### ## ## ## #### ## ##\n // ## ## ## ## ## ## ## ###### ## ## ## ##\n // ## ## ## ## #### ## ## ## #### ##\n // ## ## ## ## ## ### ## ## ## ### ##\n // ###### ####### ## ## ## ######## ## ## ##\n\n /**\n * Creates the content of the MinimapElement and attaches the mouse control\n * event listeners.\n *\n * @access private\n */\n initializeContent () {\n this.initializeCanvas()\n\n this.attachCanvases(this)\n\n this.createVisibleArea()\n this.createControls()\n\n this.subscriptions.add(\n\n this.subscribeTo(\n this,\n {\n mousewheel: (e) => {\n if (!this.standAlone && this.minimap.onMouseWheel) {\n this.minimap.onMouseWheel(e)\n }\n }\n },\n { passive: true }\n ),\n\n this.subscribeTo(\n this.getFrontCanvas(),\n {\n mousedown: (e) => { this.canvasPressed(extractMouseEventData(e)) },\n touchstart: (e) => { this.canvasPressed(extractTouchEventData(e)) }\n },\n { passive: true }\n )\n\n )\n }\n\n /**\n * Initializes the visible area div.\n *\n * @access private\n */\n createVisibleArea () {\n if (this.visibleArea) { return }\n\n this.visibleArea = document.createElement('div')\n this.visibleArea.classList.add('minimap-visible-area')\n this.appendChild(this.visibleArea)\n this.visibleAreaSubscription = this.subscribeTo(this.visibleArea, {\n mousedown: (e) => { this.startDrag(extractMouseEventData(e)) },\n touchstart: (e) => { this.startDrag(extractTouchEventData(e)) }\n }, { passive: true })\n\n this.subscriptions.add(this.visibleAreaSubscription)\n }\n\n /**\n * Removes the visible area div.\n *\n * @access private\n */\n removeVisibleArea () {\n if (!this.visibleArea) { return }\n\n this.subscriptions.remove(this.visibleAreaSubscription)\n this.visibleAreaSubscription.dispose()\n this.removeChild(this.visibleArea)\n delete this.visibleArea\n }\n\n /**\n * Creates the controls container div.\n *\n * @access private\n */\n createControls () {\n if (this.controls || this.standAlone) { return }\n\n this.controls = document.createElement('div')\n this.controls.classList.add('minimap-controls')\n this.appendChild(this.controls)\n }\n\n /**\n * Removes the controls container div.\n *\n * @access private\n */\n removeControls () {\n if (!this.controls) { return }\n\n this.removeChild(this.controls)\n delete this.controls\n }\n\n /**\n * Initializes the scroll indicator div when the `minimapScrollIndicator`\n * settings is enabled.\n *\n * @access private\n */\n initializeScrollIndicator () {\n if (this.scrollIndicator || this.standAlone) { return }\n\n this.scrollIndicator = document.createElement('div')\n this.scrollIndicator.classList.add('minimap-scroll-indicator')\n this.controls.appendChild(this.scrollIndicator)\n }\n\n /**\n * Disposes the scroll indicator div when the `minimapScrollIndicator`\n * settings is disabled.\n *\n * @access private\n */\n disposeScrollIndicator () {\n if (!this.scrollIndicator) { return }\n\n this.controls.removeChild(this.scrollIndicator)\n delete this.scrollIndicator\n }\n\n /**\n * Initializes the quick settings openener div when the\n * `displayPluginsControls` setting is enabled.\n *\n * @access private\n */\n initializeOpenQuickSettings () {\n if (this.openQuickSettings || this.standAlone) { return }\n\n this.openQuickSettings = document.createElement('div')\n this.openQuickSettings.classList.add('open-minimap-quick-settings')\n this.controls.appendChild(this.openQuickSettings)\n\n this.openQuickSettingSubscription = this.subscribeTo(this.openQuickSettings, {\n mousedown: (e) => {\n e.preventDefault()\n e.stopPropagation()\n\n if ((this.quickSettingsElement != null)) {\n this.quickSettingsElement.destroy()\n this.quickSettingsSubscription.dispose()\n } else {\n this.quickSettingsElement = new MinimapQuickSettingsElement()\n this.quickSettingsElement.setModel(this)\n this.quickSettingsSubscription = this.quickSettingsElement.onDidDestroy(() => {\n this.quickSettingsElement = null\n })\n\n const { top, left, right } = this.getFrontCanvas().getBoundingClientRect()\n this.quickSettingsElement.style.top = `${top}px`\n this.quickSettingsElement.attach()\n\n if (this.displayMinimapOnLeft) {\n this.quickSettingsElement.style.left = `${right}px`\n } else {\n this.quickSettingsElement.style.left = `${left - this.quickSettingsElement.clientWidth}px`\n }\n }\n }\n })\n }\n\n /**\n * Disposes the quick settings openener div when the `displayPluginsControls`\n * setting is disabled.\n *\n * @access private\n */\n disposeOpenQuickSettings () {\n if (!this.openQuickSettings) { return }\n\n this.controls.removeChild(this.openQuickSettings)\n this.openQuickSettingSubscription.dispose()\n delete this.openQuickSettings\n }\n\n /**\n * get the DecorationManagement API for minimapElement\n * @return {DecorationManagement}\n */\n getDecorationManagement () {\n return this.DecorationManagement\n }\n\n // ## ## ####### ######## ######## ##\n // ### ### ## ## ## ## ## ##\n // #### #### ## ## ## ## ## ##\n // ## ### ## ## ## ## ## ###### ##\n // ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ##\n // ## ## ####### ######## ######## ########\n\n /**\n * Returns the Minimap for which this MinimapElement was created.\n *\n * @return {Minimap} this element's Minimap\n */\n getModel () { return this.minimap }\n\n /**\n * Defines the Minimap model for this MinimapElement instance.\n *\n * @param {Minimap} minimap the Minimap model for this instance.\n * @return {Minimap} this element's Minimap\n */\n setModel (minimap) {\n this.minimap = minimap\n\n // set minimapElement for Minimap\n this.minimap.minimapElement = this\n\n this.DecorationManagement.initializeDecorations(this.minimap)\n\n this.subscriptions.add(\n\n this.minimap.onDidChangeScrollTop(() => {\n this.requestUpdate()\n }),\n\n this.minimap.onDidChangeScrollLeft(() => {\n this.requestUpdate()\n }),\n\n this.minimap.onDidDestroy(() => {\n this.destroy()\n }),\n\n this.minimap.onDidChangeConfig(() => {\n if (this.attached) { return this.requestForcedUpdate() }\n }),\n\n this.minimap.onDidChangeStandAlone(() => {\n this.setStandAlone(this.minimap.isStandAlone())\n this.requestUpdate()\n }),\n\n this.minimap.onDidChange((change) => {\n this.pendingChanges.push(change)\n this.requestUpdate()\n }),\n\n this.DecorationManagement.onDidChangeDecorationRange((change) => {\n const { type } = change\n if (type === 'line' ||\n type === 'highlight-under' ||\n type === 'background-custom') {\n this.pendingBackDecorationChanges.push(change)\n } else {\n this.pendingFrontDecorationChanges.push(change)\n }\n this.requestUpdate()\n }),\n\n Main.onDidChangePluginOrder(() => {\n this.requestForcedUpdate()\n })\n )\n\n this.setStandAlone(this.minimap.isStandAlone())\n\n if (this.width != null && this.height != null) {\n this.minimap.setScreenHeightAndWidth(this.height, this.width)\n }\n\n return this.minimap\n }\n\n /**\n * Sets the stand-alone mode for this MinimapElement.\n *\n * @param {boolean} standAlone the new mode for this MinimapElement\n */\n setStandAlone (standAlone) {\n this.standAlone = standAlone\n\n if (this.standAlone) {\n this.setAttribute('stand-alone', true)\n this.disposeScrollIndicator()\n this.disposeOpenQuickSettings()\n this.removeControls()\n this.removeVisibleArea()\n } else {\n this.removeAttribute('stand-alone')\n this.createVisibleArea()\n this.createControls()\n if (this.minimapScrollIndicator) { this.initializeScrollIndicator() }\n if (this.displayPluginsControls) { this.initializeOpenQuickSettings() }\n }\n }\n\n // ## ## ######## ######## ### ######## ########\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ## ## ## ## ## ## ## ##\n // ## ## ######## ## ## ## ## ## ######\n // ## ## ## ## ## ######### ## ##\n // ## ## ## ## ## ## ## ## ##\n // ####### ## ######## ## ## ## ########\n\n /**\n * Requests an update to be performed on the next frame.\n */\n requestUpdate () {\n if (this.frameRequested) { return }\n\n this.frameRequested = true\n requestAnimationFrame(() => {\n this.update()\n this.frameRequested = false\n })\n }\n\n /**\n * Requests an update to be performed on the next frame that will completely\n * redraw the minimap.\n */\n requestForcedUpdate () {\n this.offscreenFirstRow = null\n this.offscreenLastRow = null\n this.requestUpdate()\n }\n\n /**\n * Performs the actual MinimapElement update.\n *\n * @access private\n */\n update () {\n if (!(this.attached && this.isVisible() && this.minimap)) { return }\n const minimap = this.minimap\n minimap.enableCache()\n const canvas = this.getFrontCanvas()\n\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const visibleAreaLeft = minimap.getTextEditorScaledScrollLeft()\n const visibleAreaTop = minimap.getTextEditorScaledScrollTop() - minimap.getScrollTop()\n const width = Math.min(canvas.width / devicePixelRatio, this.width)\n const visibleWidth = width + visibleAreaLeft\n\n if (this.adjustToSoftWrap && this.flexBasis) {\n this.style.flexBasis = `${this.flexBasis}px`\n this.style.width = `${this.flexBasis}px`\n } else {\n this.style.flexBasis = null\n this.style.width = null\n }\n\n if (SPEC_MODE) {\n applyStyles(this.visibleArea, {\n width: `${Math.round(visibleWidth)}px`,\n height: `${Math.round(minimap.getTextEditorScaledHeight())}px`,\n top: `${Math.round(visibleAreaTop)}px`,\n 'border-left-width': `${Math.round(visibleAreaLeft)}px`\n })\n } else {\n applyStyles(this.visibleArea, {\n width: `${Math.round(visibleWidth)}px`,\n height: `${Math.round(minimap.getTextEditorScaledHeight())}px`,\n transform: makeTranslate(0, visibleAreaTop, this.useHardwareAcceleration),\n 'border-left-width': `${Math.round(visibleAreaLeft)}px`\n })\n }\n\n applyStyles(this.controls, { width: `${Math.round(width)}px` })\n\n const canvasTop = minimap.getFirstVisibleScreenRow() * minimap.getLineHeight() - minimap.getScrollTop()\n\n if (this.smoothScrolling) {\n if (SPEC_MODE) {\n applyStyles(this.backLayer.canvas, { top: `${canvasTop}px` })\n applyStyles(this.tokensLayer.canvas, { top: `${canvasTop}px` })\n applyStyles(this.frontLayer.canvas, { top: `${canvasTop}px` })\n } else {\n let canvasTransform = makeTranslate(0, canvasTop, this.useHardwareAcceleration)\n if (devicePixelRatio !== 1) {\n const scale = 1 / devicePixelRatio\n canvasTransform += ` ${makeScale(scale, scale, this.useHardwareAcceleration)}`\n }\n applyStyles(this.backLayer.canvas, { transform: canvasTransform })\n applyStyles(this.tokensLayer.canvas, { transform: canvasTransform })\n applyStyles(this.frontLayer.canvas, { transform: canvasTransform })\n }\n } else {\n const scale = 1 / devicePixelRatio\n const canvasTransform = makeScale(scale, scale, this.useHardwareAcceleration)\n applyStyles(this.backLayer.canvas, { transform: canvasTransform })\n applyStyles(this.tokensLayer.canvas, { transform: canvasTransform })\n applyStyles(this.frontLayer.canvas, { transform: canvasTransform })\n }\n\n if (this.minimapScrollIndicator && !this.scrollIndicator && minimap.canScroll()) {\n this.initializeScrollIndicator()\n }\n\n if (this.scrollIndicator != null) {\n const minimapScreenHeight = minimap.getScreenHeight()\n const indicatorHeight = minimapScreenHeight * (minimapScreenHeight / minimap.getHeight())\n const indicatorScroll = (minimapScreenHeight - indicatorHeight) * minimap.getScrollRatio()\n\n if (SPEC_MODE) {\n applyStyles(this.scrollIndicator, {\n height: `${indicatorHeight}px`,\n top: `${indicatorScroll}px`\n })\n } else {\n applyStyles(this.scrollIndicator, {\n height: `${indicatorHeight}px`,\n transform: makeTranslate(0, indicatorScroll, this.useHardwareAcceleration)\n })\n }\n\n if (!minimap.canScroll()) { this.disposeScrollIndicator() }\n }\n\n if (this.absoluteMode && this.adjustAbsoluteModeHeight) { this.updateCanvasesSize() }\n\n this.updateCanvas()\n minimap.clearCache()\n }\n\n /**\n * Defines whether to render the code highlights or not.\n *\n * @param {Boolean} displayCodeHighlights whether to render the code\n * highlights or not\n */\n setDisplayCodeHighlights (displayCodeHighlights) {\n this.displayCodeHighlights = displayCodeHighlights\n if (this.attached) { this.requestForcedUpdate() }\n }\n\n /**\n * Polling callback used to detect visibility and size changes.\n *\n * @access private\n */\n pollDOM () {\n const visibilityChanged = this.checkForVisibilityChange()\n if (this.isVisible()) {\n if (!this.wasVisible) { this.requestForcedUpdate() }\n\n this.measureHeightAndWidth(visibilityChanged, false)\n }\n }\n\n /**\n * A method that checks for visibility changes in the MinimapElement.\n * The method returns `true` when the visibility changed from visible to\n * hidden or from hidden to visible.\n *\n * @return {boolean} whether the visibility changed or not since the last call\n * @access private\n */\n checkForVisibilityChange () {\n if (this.isVisible()) {\n if (this.wasVisible) {\n return false\n } else {\n this.wasVisible = true\n return this.wasVisible\n }\n } else {\n if (this.wasVisible) {\n this.wasVisible = false\n return true\n } else {\n this.wasVisible = false\n return this.wasVisible\n }\n }\n }\n\n /**\n * A method used to measure the size of the MinimapElement and update internal\n * components based on the new size.\n *\n * @param {boolean} visibilityChanged did the visibility changed since last\n * measurement\n * @param {[type]} [forceUpdate=true] forces the update even when no changes\n * were detected\n * @access private\n */\n measureHeightAndWidth (visibilityChanged, forceUpdate = true) {\n if (!this.minimap) { return }\n\n const safeFlexBasis = this.style.flexBasis\n this.style.flexBasis = ''\n\n const wasResized = this.width !== this.clientWidth || this.height !== this.clientHeight\n\n this.height = this.clientHeight\n this.width = this.clientWidth\n let canvasWidth = this.width\n\n if ((this.minimap != null)) {\n this.minimap.setScreenHeightAndWidth(this.height, this.width)\n }\n\n if (wasResized || visibilityChanged || forceUpdate) {\n this.requestForcedUpdate()\n }\n\n if (!this.isVisible()) { return }\n\n if (wasResized || forceUpdate) {\n if (this.adjustToSoftWrap) {\n const lineLength = atom.config.get('editor.preferredLineLength')\n const softWrap = atom.config.get('editor.softWrap')\n const softWrapAtPreferredLineLength = atom.config.get('editor.softWrapAtPreferredLineLength')\n const width = lineLength * this.minimap.getCharWidth()\n\n if (softWrap && softWrapAtPreferredLineLength && lineLength && (width <= this.width || !this.adjustOnlyIfSmaller)) {\n this.flexBasis = width\n canvasWidth = width\n updateOverlayStyle(width)\n } else {\n updateOverlayStyle(canvasWidth)\n delete this.flexBasis\n }\n } else {\n updateOverlayStyle(canvasWidth)\n delete this.flexBasis\n }\n\n this.updateCanvasesSize(canvasWidth)\n } else {\n this.style.flexBasis = safeFlexBasis\n }\n }\n\n updateCanvasesSize (canvasWidth) {\n const devicePixelRatio = this.minimap.getDevicePixelRatio()\n const maxCanvasHeight = this.height + this.minimap.getLineHeight()\n const newHeight = this.absoluteMode && this.adjustAbsoluteModeHeight ? Math.min(this.minimap.getHeight(), maxCanvasHeight) : maxCanvasHeight\n const canvas = this.getFrontCanvas()\n\n if (canvasWidth == null) {\n canvasWidth = canvas.width / devicePixelRatio\n }\n\n if (canvasWidth !== canvas.width || newHeight !== canvas.height) {\n this.setCanvasesSize(\n canvasWidth * devicePixelRatio,\n newHeight * devicePixelRatio\n )\n if (this.absoluteMode && this.adjustAbsoluteModeHeight) {\n this.offscreenFirstRow = null\n this.offscreenLastRow = null\n }\n }\n }\n\n // ######## ## ## ######## ## ## ######## ######\n // ## ## ## ## ### ## ## ## ##\n // ## ## ## ## #### ## ## ##\n // ###### ## ## ###### ## ## ## ## ######\n // ## ## ## ## ## #### ## ##\n // ## ## ## ## ## ### ## ## ##\n // ######## ### ######## ## ## ## ######\n\n /**\n * Callback triggered when the mouse is pressed on the MinimapElement canvas.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @access private\n */\n canvasPressed ({ y, isLeftMouse, isMiddleMouse }) {\n if (this.minimap.isStandAlone()) { return }\n if (isLeftMouse) {\n this.canvasLeftMousePressed(y)\n } else if (isMiddleMouse) {\n this.canvasMiddleMousePressed(y)\n const { top, height } = this.visibleArea.getBoundingClientRect()\n this.startDrag({ y: top + height / 2, isLeftMouse: false, isMiddleMouse: true })\n }\n }\n\n /**\n * Callback triggered when the mouse left button is pressed on the\n * MinimapElement canvas.\n *\n * @param {MouseEvent} e the mouse event object\n * @param {number} e.pageY the mouse y position in page\n * @param {HTMLElement} e.target the source of the event\n * @access private\n */\n canvasLeftMousePressed (y) {\n const deltaY = y - this.getBoundingClientRect().top\n const row = Math.floor(deltaY / this.minimap.getLineHeight()) + this.minimap.getFirstVisibleScreenRow()\n\n const textEditor = this.minimap.getTextEditor()\n const textEditorElement = this.minimap.getTextEditorElement()\n\n const scrollTop = row * textEditor.getLineHeightInPixels() - this.minimap.getTextEditorHeight() / 2\n const textEditorScrollTop = textEditorElement.pixelPositionForScreenPosition([row, 0]).top - this.minimap.getTextEditorHeight() / 2\n\n if (atom.config.get('minimap.moveCursorOnMinimapClick')) {\n textEditor.setCursorScreenPosition([row, 0])\n }\n\n if (atom.config.get('minimap.scrollAnimation')) {\n const duration = atom.config.get('minimap.scrollAnimationDuration')\n const independentScroll = this.minimap.scrollIndependentlyOnMouseWheel()\n\n const from = this.minimap.getTextEditorScrollTop()\n const to = textEditorScrollTop\n let step\n\n if (independentScroll) {\n const minimapFrom = this.minimap.getScrollTop()\n const minimapTo = Math.min(1, scrollTop / (this.minimap.getTextEditorMaxScrollTop() || 1)) * this.minimap.getMaxScrollTop()\n\n step = (now, t) => {\n if (this.minimap === null) return // TODO why this happens in the tests?\n this.minimap.setTextEditorScrollTop(now, true)\n this.minimap.setScrollTop(minimapFrom + (minimapTo - minimapFrom) * t)\n }\n animate({ from, to, duration, step })\n } else {\n step = (now) => {\n if (this.minimap === null) return // TODO why this happens in the tests?\n this.minimap.setTextEditorScrollTop(now)\n }\n animate({ from, to, duration, step })\n }\n } else {\n this.minimap.setTextEditorScrollTop(textEditorScrollTop)\n }\n }\n\n /**\n * Callback triggered when the mouse middle button is pressed on the\n * MinimapElement canvas.\n *\n * @param {MouseEvent} e the mouse event object\n * @param {number} e.pageY the mouse y position in page\n * @access private\n */\n canvasMiddleMousePressed (y) {\n const { top: offsetTop } = this.getBoundingClientRect()\n const deltaY = y - offsetTop - this.minimap.getTextEditorScaledHeight() / 2\n\n const ratio = deltaY / (this.minimap.getVisibleHeight() - this.minimap.getTextEditorScaledHeight())\n\n this.minimap.setTextEditorScrollTop(ratio * this.minimap.getTextEditorMaxScrollTop())\n }\n\n /**\n * Subscribes to a media query for device pixel ratio changes and forces\n * a repaint when it occurs.\n *\n * @return {Disposable} a disposable to remove the media query listener\n * @access private\n */\n subscribeToMediaQuery () {\n const mediaQuery = window.matchMedia('screen and (-webkit-min-device-pixel-ratio: 1.5)')\n const mediaListener = () => { this.requestForcedUpdate() }\n mediaQuery.addEventListener('change', mediaListener)\n\n return new Disposable(() => {\n mediaQuery.removeEventListener('change', mediaListener)\n })\n }\n\n // ######## #### ########\n // ## ## ## ## ## ##\n // ## ## #### ## ##\n // ## ## #### ## ##\n // ## ## ## ## ## ## ##\n // ## ## ## ## ## ##\n // ######## #### ## ########\n\n /**\n * A method triggered when the mouse is pressed over the visible area that\n * starts the dragging gesture.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @access private\n */\n startDrag ({ y, isLeftMouse, isMiddleMouse }) {\n if (!this.minimap) { return }\n if (!isLeftMouse && !isMiddleMouse) { return }\n\n const initial = {\n dragOffset: y - this.visibleArea.getBoundingClientRect().top,\n offsetTop: this.getBoundingClientRect().top\n }\n\n // TODO can we avoid adding and removing the listeners every time?\n\n const mousemoveHandler = (e) => this.drag(extractMouseEventData(e), initial)\n const dragendHandler = () => this.endDrag()\n\n const touchmoveHandler = (e) => this.drag(extractTouchEventData(e), initial)\n\n document.body.addEventListener('mousemove', mousemoveHandler, { passive: true })\n document.body.addEventListener('mouseup', dragendHandler, { passive: true })\n document.body.addEventListener('mouseleave', dragendHandler, { passive: true })\n\n document.body.addEventListener('touchmove', touchmoveHandler, { passive: true })\n document.body.addEventListener('touchend', dragendHandler, { passive: true })\n document.body.addEventListener('touchcancel', dragendHandler, { passive: true })\n\n this.dragSubscription = new Disposable(function () {\n document.body.removeEventListener('mousemove', mousemoveHandler)\n document.body.removeEventListener('mouseup', dragendHandler)\n document.body.removeEventListener('mouseleave', dragendHandler)\n\n document.body.removeEventListener('touchmove', touchmoveHandler)\n document.body.removeEventListener('touchend', dragendHandler)\n document.body.removeEventListener('touchcancel', dragendHandler)\n })\n }\n\n /**\n * The method called during the drag gesture.\n *\n * @param {number} y the vertical coordinate of the event\n * @param {boolean} isLeftMouse was the left mouse button pressed?\n * @param {boolean} isMiddleMouse was the middle mouse button pressed?\n * @param {number} initial.dragOffset the mouse offset within the visible\n * area\n * @param {number} initial.offsetTop the MinimapElement offset at the moment\n * of the drag start\n * @access private\n */\n drag ({ y, isLeftMouse, isMiddleMouse }, initial) {\n if (!this.minimap) { return }\n if (!isLeftMouse && !isMiddleMouse) { return }\n const deltaY = y - initial.offsetTop - initial.dragOffset\n\n const ratio = deltaY / (this.minimap.getVisibleHeight() - this.minimap.getTextEditorScaledHeight())\n\n this.minimap.setTextEditorScrollTop(ratio * this.minimap.getTextEditorMaxScrollTop())\n }\n\n /**\n * The method that ends the drag gesture.\n *\n * @access private\n */\n endDrag () {\n if (!this.minimap) { return }\n this.dragSubscription.dispose()\n }\n}\n\nconst minimapElement = MinimapElement.initClass()\nexport default minimapElement\n\n// ######## ## ## ######## ## ## ######## ######\n// ## ## ## ## ### ## ## ## ##\n// ## ## ## ## #### ## ## ##\n// ###### ## ## ###### ## ## ## ## ######\n// ## ## ## ## ## #### ## ##\n// ## ## ## ## ## ### ## ## ##\n// ######## ### ######## ## ## ## ######\n\n/**\n * A method that extracts data from a `MouseEvent` which can then be used to\n * process clicks and drags of the minimap.\n *\n * Used together with `extractTouchEventData` to provide a unified interface\n * for `MouseEvent`s and `TouchEvent`s.\n *\n * @param {MouseEvent} mouseEvent the mouse event object\n * @access private\n */\nfunction extractMouseEventData (mouseEvent) {\n return {\n x: mouseEvent.pageX,\n y: mouseEvent.pageY,\n isLeftMouse: mouseEvent.button === 0,\n isMiddleMouse: mouseEvent.button === 1\n }\n}\n\n/**\n * A method that extracts data from a `TouchEvent` which can then be used to\n * process clicks and drags of the minimap.\n *\n * Used together with `extractMouseEventData` to provide a unified interface\n * for `MouseEvent`s and `TouchEvent`s.\n *\n * @param {TouchEvent} touchEvent the touch event object\n * @access private\n */\nfunction extractTouchEventData (touchEvent) {\n // Use the first touch on the target area. Other touches will be ignored in\n // case of multi-touch.\n const touch = touchEvent.changedTouches[0]\n\n return {\n x: touch.pageX,\n y: touch.pageY,\n isLeftMouse: true, // Touch is treated like a left mouse button click\n isMiddleMouse: false\n }\n}\n\n// ###### ###### ######\n// ## ## ## ## ## ##\n// ## ## ##\n// ## ###### ######\n// ## ## ##\n// ## ## ## ## ## ##\n// ###### ###### ######\n\n/**\n * Applies the passed-in styles properties to the specified element\n *\n * @param {HTMLElement} element the element onto which apply the styles\n * @param {Object} styles the styles to apply\n * @access private\n */\nfunction applyStyles (element, styles) {\n if (!element) { return }\n\n let cssText = ''\n for (const property in styles) {\n cssText += `${property}: ${styles[property]}; `\n }\n\n element.style.cssText = cssText\n}\n\n/**\n * Returns a string with a CSS translation tranform value.\n *\n * @param {number} [x = 0] the x offset of the translation\n * @param {number} [y = 0] the y offset of the translation\n * @param {boolean} [useHardwareAcceleration = false] use hardware acceleration\n * @return {string} the CSS translation string\n * @access private\n */\nfunction makeTranslate (x = 0, y = 0, useHardwareAcceleration = false) {\n if (useHardwareAcceleration) {\n return `translate3d(${x}px, ${y}px, 0)`\n } else {\n return `translate(${x}px, ${y}px)`\n }\n}\n\n/**\n * Returns a string with a CSS scaling tranform value.\n *\n * @param {number} [x = 0] the x scaling factor\n * @param {number} [y = 0] the y scaling factor\n * @param {boolean} [useHardwareAcceleration = false] use hardware acceleration\n * @return {string} the CSS scaling string\n * @access private\n */\nfunction makeScale (x = 0, y = x, useHardwareAcceleration = false) {\n if (useHardwareAcceleration) {\n return `scale3d(${x}, ${y}, 1)`\n } else {\n return `scale(${x}, ${y})`\n }\n}\n\n/**\n * A method that mimic the jQuery `animate` method and used to animate the\n * scroll when clicking on the MinimapElement canvas.\n *\n * @param {Object} param the animation data object\n * @param {[type]} param.from the start value\n * @param {[type]} param.to the end value\n * @param {[type]} param.duration the animation duration\n * @param {[type]} param.step the easing function for the animation\n * @access private\n */\nfunction animate ({ from, to, duration, step }) {\n const start = getTime()\n let progress\n\n const update = () => {\n const passed = getTime() - start\n if (duration === 0) {\n progress = 1\n } else {\n progress = passed / duration\n }\n if (progress > 1) { progress = 1 }\n const delta = swing(progress)\n const value = from + (to - from) * delta\n step(value, delta)\n\n if (progress < 1) { requestAnimationFrame(update) }\n }\n\n update()\n}\n\nfunction swing (progress) {\n return 0.5 - Math.cos(progress * Math.PI) / 2\n}\n\n/**\n * A method that return the current time as a Date.\n *\n * That method exist so that we can mock it in tests.\n *\n * @return {Date} the current time as Date\n * @access private\n */\nfunction getTime () { return new Date() }\n","'use strict'\n\nimport { CompositeDisposable } from 'atom'\nimport { emitter, getConfigSchema } from './main'\n\n/**\n * Provides methods to manage minimap plugins.\n * Minimap plugins are Atom packages that will augment the minimap.\n * They have a secondary activation cycle going on constrained by the minimap\n * package activation. A minimap plugin life cycle will generally look\n * like this:\n *\n * 1. The plugin module is activated by Atom through the `activate` method\n * 2. The plugin then register itself as a minimap plugin using `registerPlugin`\n * 3. The plugin is activated/deactivated according to the minimap settings.\n * 4. On the plugin module deactivation, the plugin must unregisters itself\n * from the minimap using the `unregisterPlugin`.\n *\n * @access public\n */\n\n// Initialize the properties for plugin management.\n\n/**\n * The registered Minimap plugins stored using their name as key.\n *\n * @type {Object}\n * @access private\n */\nexport const plugins = {}\n/**\n * The plugins' subscriptions stored using the plugin names as keys.\n *\n * @type {Object}\n * @access private\n */\nconst pluginsSubscriptions = {}\n\n/**\n * A map that stores the display order for each plugin\n *\n * @type {Object}\n * @access private\n */\nconst pluginsOrderMap = {}\n\n/**\n * Registers a minimap `plugin` with the given `name`.\n *\n * @param {string} name The identifying name of the plugin.\n * It will be used as activation settings name\n * as well as the key to unregister the module.\n * @param {MinimapPlugin} plugin The plugin to register.\n * @emits {did-add-plugin} with the name and a reference to the added plugin.\n * @emits {did-activate-plugin} if the plugin was activated during\n * the registration.\n */\nexport function registerPlugin (name, plugin) {\n plugins[name] = plugin\n pluginsSubscriptions[name] = new CompositeDisposable()\n\n const event = { name, plugin }\n emitter.emit('did-add-plugin', event)\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n registerPluginControls(name, plugin)\n }\n\n updatesPluginActivationState(name)\n}\n\n/**\n * Unregisters a plugin from the minimap.\n *\n * @param {string} name The identifying name of the plugin to unregister.\n * @emits {did-remove-plugin} with the name and a reference\n * to the added plugin.\n */\nexport function unregisterPlugin (name) {\n const plugin = plugins[name]\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n unregisterPluginControls(name)\n }\n\n delete plugins[name]\n\n const event = { name, plugin }\n emitter.emit('did-remove-plugin', event)\n}\n\n/**\n * Toggles the specified plugin activation state.\n *\n * @param {string} name The name of the plugin.\n * @param {boolean} boolean An optional boolean to set the activation\n * state of the plugin. If ommitted the new plugin\n * state will be the the inverse of its current\n * state.\n * @emits {did-activate-plugin} if the plugin was activated by the call.\n * @emits {did-deactivate-plugin} if the plugin was deactivated by the call.\n */\nexport function togglePluginActivation (name, boolean) {\n const settingsKey = `minimap.plugins.${name}`\n\n if (boolean !== undefined && boolean !== null) {\n atom.config.set(settingsKey, boolean)\n } else {\n atom.config.set(settingsKey, !atom.config.get(settingsKey))\n }\n\n updatesPluginActivationState(name)\n}\n\n/**\n * Deactivates all the plugins registered in the minimap package so far.\n *\n * @emits {did-deactivate-plugin} for each plugin deactivated by the call.\n */\nexport function deactivateAllPlugins () {\n for (const [name, plugin] of eachPlugin()) {\n plugin.deactivatePlugin()\n emitter.emit('did-deactivate-plugin', { name, plugin })\n }\n}\n\n/**\n * A generator function to iterate over registered plugins.\n *\n * @return An iterable that yield the name and reference to every plugin\n * as an array in each iteration.\n */\nfunction * eachPlugin () {\n for (const name in plugins) {\n yield [name, plugins[name]]\n }\n}\n\n/**\n * Updates the plugin activation state according to the current config.\n *\n * @param {string} name The identifying name of the plugin to update.\n * @emits {did-activate-plugin} if the plugin was activated by the call.\n * @emits {did-deactivate-plugin} if the plugin was deactivated by the call.\n * @access private\n */\nfunction updatesPluginActivationState (name) {\n const plugin = plugins[name]\n const pluginActive = plugin.isActive()\n const settingActive = atom.config.get(`minimap.plugins.${name}`)\n\n if (atom.config.get('minimap.displayPluginsControls')) {\n if (settingActive && !pluginActive) {\n activatePlugin(name, plugin)\n } else if (pluginActive && !settingActive) {\n deactivatePlugin(name, plugin)\n }\n } else {\n if (!pluginActive) {\n activatePlugin(name, plugin)\n } else if (pluginActive) {\n deactivatePlugin(name, plugin)\n }\n }\n}\n\nexport function activatePlugin (name, plugin) {\n const event = { name, plugin }\n\n plugin.activatePlugin()\n emitter.emit('did-activate-plugin', event)\n}\n\nexport function deactivatePlugin (name, plugin) {\n const event = { name, plugin }\n\n plugin.deactivatePlugin()\n emitter.emit('did-deactivate-plugin', event)\n}\n\n/**\n * When the `minimap.displayPluginsControls` setting is toggled,\n * this function will register the commands and setting to manage the plugin\n * activation from the minimap settings.\n *\n * @param {string} name The identifying name of the plugin.\n * @param {MinimapPlugin} plugin The plugin instance to register\n * controls for.\n * @listens {minimap.plugins.${name}} listen to the setting to update\n * the plugin state accordingly.\n * @listens {minimap:toggle-${name}} listen to the command on `atom-workspace`\n * to toggle the plugin state.\n * @access private\n */\nfunction registerPluginControls (name, plugin) {\n const settingsKey = `minimap.plugins.${name}`\n const orderSettingsKey = `minimap.plugins.${name}DecorationsZIndex`\n\n const config = getConfigSchema()\n\n config.plugins.properties[name] = {\n type: 'boolean',\n title: name,\n description: `Whether the ${name} plugin is activated and displayed in the Minimap.`,\n default: true\n }\n\n config.plugins.properties[`${name}DecorationsZIndex`] = {\n type: 'integer',\n title: `${name} decorations order`,\n description: `The relative order of the ${name} plugin's decorations in the layer into which they are drawn. Note that this order only apply inside a layer, so highlight-over decorations will always be displayed above line decorations as they are rendered in different layers.`,\n default: 0\n }\n\n if (atom.config.get(settingsKey) === undefined) {\n atom.config.set(settingsKey, true)\n }\n\n if (atom.config.get(orderSettingsKey) === undefined) {\n atom.config.set(orderSettingsKey, 0)\n }\n\n pluginsSubscriptions[name].add(atom.config.observe(settingsKey, () => {\n updatesPluginActivationState(name)\n }))\n\n pluginsSubscriptions[name].add(atom.config.observe(orderSettingsKey, (order) => {\n updatePluginsOrderMap(name)\n const event = { name, plugin, order }\n emitter.emit('did-change-plugin-order', event)\n }))\n\n pluginsSubscriptions[name].add(atom.commands.add('atom-workspace', {\n [`minimap:toggle-${name}`]: () => {\n togglePluginActivation(name)\n }\n }))\n\n updatePluginsOrderMap(name)\n}\n\n/**\n * Updates the display order in the map for the passed-in plugin name.\n *\n * @param {string} name the name of the plugin to update\n * @access private\n */\nfunction updatePluginsOrderMap (name) {\n const orderSettingsKey = `minimap.plugins.${name}DecorationsZIndex`\n\n pluginsOrderMap[name] = atom.config.get(orderSettingsKey)\n}\n\n/**\n * Returns the plugins display order mapped by name.\n *\n * @return {Object} The plugins order by name\n */\nexport function getPluginsOrder () { return pluginsOrderMap }\n\n/**\n * When the `minimap.displayPluginsControls` setting is toggled,\n * this function will unregister the commands and setting that\n * was created previously.\n *\n * @param {string} name The identifying name of the plugin.\n * @access private\n */\nfunction unregisterPluginControls (name) {\n pluginsSubscriptions[name].dispose()\n delete pluginsSubscriptions[name]\n delete getConfigSchema().plugins.properties[name]\n}\n","// Functions used to recommend the configurations required for the best performance of Minimap\n\nexport function treeSitterWarning () {\n return observeAndWarn(\n 'core.useTreeSitterParsers',\n true,\n 'Tree-sitter is off (Low Performance Warning).',\n `You should turn on Atom's tree-sitter parser to experience the best performance Minimap and Atom is deisgned for.\n Keeping tree-sitter parser off results in sluggish scrolling and lags in the text editor.`\n )\n}\n\n/* Utility function that observes a config and throws warnings once a day if it is not the recommended value */\nfunction observeAndWarn (configName, recommendedValue, warningTitle, warningDescription) {\n return atom.config.observe(configName, value => {\n if (value !== recommendedValue) {\n const storageName = `Minimap.${configName}`\n const today = new Date()\n const previousWarning = window.localStorage.getItem(storageName)\n let previousWarningDay = null\n if (previousWarning) {\n previousWarningDay = (new Date(Date.parse(previousWarning))).getDay()\n }\n // throw the warning once a day\n if (!previousWarningDay ||\n (typeof previousWarningDay === 'number' && (previousWarningDay - today.getDay() >= 1))\n ) {\n window.localStorage.setItem(storageName, today)\n\n const notification = atom.notifications.addWarning(\n warningTitle, {\n description: warningDescription,\n dismissable: true,\n buttons: [\n {\n text: `Set to ${recommendedValue} and restart Atom`,\n onDidClick () {\n atom.config.set(configName, true)\n notification.dismiss()\n window.localStorage.removeItem(storageName)\n setTimeout(() => {\n atom.reload()\n }, 1500)\n }\n }\n ]\n })\n }\n }\n })\n}\n","'use strict'\n\n/**\n * This class is used by the `CanvasDrawer` in `MinimapElement` to\n * read the styles informations (color and background-color) from the DOM to use when rendering\n * the `Minimap`.\n *\n * It attaches a dummyNode to the targetNode, renders them, and finds the computed style back.\n * TODO: find a better way to get the token colors\n */\nexport default class DOMStylesReader {\n constructor () {\n /**\n * The cache object\n * @access private\n */\n this.domStylesCache = new Map()\n\n /**\n * @access private\n */\n this.dummyNode = undefined\n\n // used to check if the dummyNode is on the current targetNode\n this.targetNode = undefined\n\n /**\n * Set to true once tokenized\n * @access private\n * unused\n */\n // this.hasTokenizedOnce = false\n }\n\n /**\n * Returns the computed values for the given property and scope in the DOM.\n *\n * This function insert a dummy element in the DOM to compute\n * its style, return the specified property, and clear the content of the\n * dummy element.\n *\n * @param {Array} scopes a list of classes reprensenting the scope\n * to build\n * @param {string} property the name of the style property to compute\n * @param {Node} targetNode\n * @param {boolean} getFromCache whether to cache the computed value or not\n * @return {string} the computed property's value\n * used in CanvasDrawer\n */\n retrieveStyleFromDom (scopes, property, targetNode, getFromCache) {\n if (!scopes.length) { return '' } // no scopes\n const key = scopes.join(' ')\n let cachedData = this.domStylesCache.get(key)\n\n if (cachedData !== undefined) {\n if (getFromCache) { // if should get the value from the cache\n const value = cachedData[property]\n if (value !== undefined) {\n // value exists\n return value\n } // value not in the cache - get fresh value\n } // don't use cache - get fresh value\n } else {\n // key did not exist. create it\n cachedData = {}\n }\n\n this.ensureDummyNodeExistence(targetNode)\n\n let parent = this.dummyNode\n for (let i = 0, len = scopes.length; i < len; i++) {\n const scope = scopes[i]\n const node = document.createElement('span')\n node.className = scope.replace(dotRegexp, ' ') // TODO why replace is needed?\n parent.appendChild(node)\n parent = node\n }\n\n const style = window.getComputedStyle(parent)\n let value = style.getPropertyValue(property)\n\n // rotate hue if webkit-filter available\n const filter = style.getPropertyValue('-webkit-filter')\n if (filter.indexOf('hue-rotate') > -1) {\n value = rotateHue(value, filter)\n }\n\n if (value !== '') {\n cachedData[property] = value\n this.domStylesCache.set(key, cachedData)\n }\n\n this.dummyNode.innerHTML = ''\n return value\n }\n\n /**\n * Creates a DOM node container for all the operations that need to read\n * styles properties from DOM.\n * @param {Node} targetNode\n *\n * @access private\n */\n ensureDummyNodeExistence (targetNode) {\n if (this.targetNode !== targetNode || this.dummyNode === undefined) {\n this.dummyNode = document.createElement('span')\n this.dummyNode.style.visibility = 'hidden'\n\n // attach to the target node\n targetNode.appendChild(this.dummyNode)\n this.targetNode = targetNode\n }\n }\n\n /**\n * Invalidates the cache by emptying the cache object.\n * used in MinimapElement\n */\n invalidateDOMStylesCache () {\n this.domStylesCache.clear()\n }\n\n /**\n * Invalidates the cache only for the first tokenization event.\n *\n * @access private\n * unused\n */\n /*\n invalidateIfFirstTokenization () {\n if (this.hasTokenizedOnce) { return }\n this.invalidateDOMStylesCache()\n this.hasTokenizedOnce = true\n }\n */\n}\n\n// ## ## ######## ## ######## ######## ######## ######\n// ## ## ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ##\n// ######### ###### ## ######## ###### ######## ######\n// ## ## ## ## ## ## ## ## ##\n// ## ## ## ## ## ## ## ## ## ##\n// ## ## ######## ######## ## ######## ## ## ######\n\nconst dotRegexp = /\\.+/g\nconst rgbExtractRegexp = /rgb(a?)\\((\\d+), (\\d+), (\\d+)(, (\\d+(\\.\\d+)?))?\\)/\nconst hueRegexp = /hue-rotate\\((\\d+)deg\\)/\n\n/**\n * Computes the output color of `value` with a rotated hue defined\n * in `filter`.\n *\n * @param {string} value the CSS color to apply the rotation on\n * @param {string} filter the CSS hue rotate filter declaration\n * @return {string} the rotated CSS color\n * @access private\n */\nfunction rotateHue (value, filter) {\n const match = value.match(rgbExtractRegexp)\n let [, , r, g, b, , a] = match\n\n let [, hue] = filter.match(hueRegexp)\n\n ;[r, g, b, a, hue] = [r, g, b, a, hue].map(Number)\n ;[r, g, b] = rotate(r, g, b, hue)\n\n if (isNaN(a)) {\n return `rgb(${r}, ${g}, ${b})`\n } else {\n return `rgba(${r}, ${g}, ${b}, ${a})`\n }\n}\n\n/**\n * Computes the hue rotation on the provided `r`, `g` and `b` channels\n * by the amount of `angle`.\n *\n * @param {number} r the red channel of the color to rotate\n * @param {number} g the green channel of the color to rotate\n * @param {number} b the blue channel of the color to rotate\n * @param {number} angle the angle to rotate the hue with\n * @return {Array} the rotated color channels\n * @access private\n */\nfunction rotate (r, g, b, angle) {\n const matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]\n const lumR = 0.2126\n const lumG = 0.7152\n const lumB = 0.0722\n const hueRotateR = 0.143\n const hueRotateG = 0.140\n const hueRotateB = 0.283\n const cos = Math.cos(angle * Math.PI / 180)\n const sin = Math.sin(angle * Math.PI / 180)\n\n matrix[0] = lumR + (1 - lumR) * cos - (lumR * sin)\n matrix[1] = lumG - (lumG * cos) - (lumG * sin)\n matrix[2] = lumB - (lumB * cos) + (1 - lumB) * sin\n matrix[3] = lumR - (lumR * cos) + hueRotateR * sin\n matrix[4] = lumG + (1 - lumG) * cos + hueRotateG * sin\n matrix[5] = lumB - (lumB * cos) - (hueRotateB * sin)\n matrix[6] = lumR - (lumR * cos) - ((1 - lumR) * sin)\n matrix[7] = lumG - (lumG * cos) + lumG * sin\n matrix[8] = lumB + (1 - lumB) * cos + lumB * sin\n\n return [\n clamp(matrix[0] * r + matrix[1] * g + matrix[2] * b),\n clamp(matrix[3] * r + matrix[4] * g + matrix[5] * b),\n clamp(matrix[6] * r + matrix[7] * g + matrix[8] * b)\n ]\n\n function clamp (num) {\n return Math.ceil(Math.max(0, Math.min(255, num)))\n }\n}\n","'use strict'\n\nimport { Emitter, CompositeDisposable } from 'atom'\nimport MinimapElement from './minimap-element'\nimport Minimap from './minimap'\nimport config from './config.json'\nimport * as PluginManagement from './plugin-management'\nimport { treeSitterWarning } from './performance-monitor'\nimport DOMStylesReader from './dom-styles-reader'\n\nexport { default as config } from './config.json'\nexport * from './plugin-management'\nexport { default as Minimap } from './minimap'\n\n/**\n * The `Minimap` package provides an eagle-eye view of text buffers.\n *\n * It also provides API for plugin packages that want to interact with the\n * minimap and be available to the user through the minimap settings.\n */\n\n/**\n * The activation state of the package.\n *\n * @type {boolean}\n * @access private\n */\nlet active = false\n/**\n * The toggle state of the package.\n *\n * @type {boolean}\n * @access private\n */\nlet toggled = false\n/**\n * The `Map` where Minimap instances are stored with the text editor they\n * target as key.\n *\n * @type {Map}\n * @access private\n */\nexport let editorsMinimaps = null\n/**\n * The composite disposable that stores the package's subscriptions.\n *\n * @type {CompositeDisposable}\n * @access private\n */\nlet subscriptions = null\n/**\n * The disposable that stores the package's commands subscription.\n *\n * @type {Disposable}\n * @access private\n */\nlet subscriptionsOfCommands = null\n\n/**\n * The package's events emitter.\n *\n * @type {Emitter}\n * @access private\n */\nexport const emitter = new Emitter()\n\n/**\n DOMStylesReader cache used for storing token colors\n*/\nexport let domStylesReader = null\n\n/**\n * Activates the minimap package.\n */\nexport function activate () {\n if (active) { return }\n\n subscriptionsOfCommands = atom.commands.add('atom-workspace', {\n 'minimap:toggle': () => {\n toggle()\n },\n 'minimap:generate-coffee-plugin': async () => {\n await generatePlugin('coffee')\n },\n 'minimap:generate-javascript-plugin': async () => {\n await generatePlugin('javascript')\n },\n 'minimap:generate-babel-plugin': async () => {\n await generatePlugin('babel')\n }\n })\n\n editorsMinimaps = new Map()\n domStylesReader = new DOMStylesReader()\n\n subscriptions = new CompositeDisposable()\n active = true\n\n if (atom.config.get('minimap.autoToggle')) { toggle() }\n}\n\n/**\n * Returns a {MinimapElement} for the passed-in model if it's a {Minimap}.\n *\n * @param {Minimap} model the model for which returning a view\n * @return {MinimapElement}\n */\nexport function minimapViewProvider (model) {\n if (model instanceof Minimap) {\n const element = new MinimapElement()\n element.setModel(model)\n return element\n }\n}\n\n/**\n * Deactivates the minimap package.\n */\nexport function deactivate () {\n if (!active) { return }\n\n PluginManagement.deactivateAllPlugins()\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((value) => {\n value.destroy()\n })\n editorsMinimaps.clear()\n }\n\n subscriptions.dispose()\n subscriptions = null\n subscriptionsOfCommands.dispose()\n subscriptionsOfCommands = null\n editorsMinimaps = undefined\n domStylesReader.invalidateDOMStylesCache()\n toggled = false\n active = false\n}\n\nexport function getConfigSchema () {\n return config || atom.packages.getLoadedPackage('minimap').metadata.configSchema\n}\n\n/**\n * Toggles the minimap display.\n */\nexport function toggle () {\n if (!active) { return }\n\n if (toggled) {\n toggled = false\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((minimap) => {\n minimap.destroy()\n })\n editorsMinimaps.clear()\n }\n subscriptions.dispose()\n\n // HACK: this hack forces rerendering editor size which moves the scrollbar to the right once minimap is removed\n const wasMaximized = atom.isMaximized()\n const { width, height } = atom.getSize()\n atom.setSize(width, height)\n if (wasMaximized) {\n atom.maximize()\n }\n\n } else {\n toggled = true\n initSubscriptions()\n }\n domStylesReader.invalidateDOMStylesCache()\n}\n\n/**\n * Opens the plugin generation view.\n *\n * @param {string} template the name of the template to use\n */\nasync function generatePlugin (template) {\n const { default: MinimapPluginGeneratorElement } = await import('./minimap-plugin-generator-element')\n const view = new MinimapPluginGeneratorElement()\n view.template = template\n view.attach()\n}\n\n/**\n * Registers a callback to listen to the `did-activate` event of the package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidActivate (callback) {\n return emitter.on('did-activate', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-deactivate` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidDeactivate (callback) {\n return emitter.on('did-deactivate', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-create-minimap` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidCreateMinimap (callback) {\n return emitter.on('did-create-minimap', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-add-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidAddPlugin (callback) {\n return emitter.on('did-add-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-remove-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidRemovePlugin (callback) {\n return emitter.on('did-remove-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-activate-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidActivatePlugin (callback) {\n return emitter.on('did-activate-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-deactivate-plugin` event of the\n * package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidDeactivatePlugin (callback) {\n return emitter.on('did-deactivate-plugin', callback)\n}\n\n/**\n * Registers a callback to listen to the `did-change-plugin-order` event of\n * the package.\n *\n * @param {function(event:Object):void} callback the callback function\n * @return {Disposable} a disposable to stop listening to the event\n */\nexport function onDidChangePluginOrder (callback) {\n return emitter.on('did-change-plugin-order', callback)\n}\n\n/**\n * Returns the `Minimap` class\n *\n * @return {Function} the `Minimap` class constructor\n */\nexport function minimapClass () {\n return Minimap\n}\n\n/**\n * Returns the `Minimap` object associated to the passed-in\n * `TextEditorElement`.\n *\n * @param {TextEditorElement} editorElement a text editor element\n * @return {Minimap} the associated minimap\n */\nexport function minimapForEditorElement (editorElement) {\n if (!editorElement) { return }\n return minimapForEditor(editorElement.getModel())\n}\n\n/**\n * Returns the `Minimap` object associated to the passed-in\n * `TextEditor`.\n *\n * @param {TextEditor} textEditor a text editor\n * @return {Minimap} the associated minimap\n */\nexport function minimapForEditor (textEditor) {\n if (!textEditor) { return }\n if (!editorsMinimaps) { return }\n\n let minimap = editorsMinimaps.get(textEditor)\n\n if (minimap === undefined || minimap.destroyed) {\n minimap = new Minimap({ textEditor })\n editorsMinimaps.set(textEditor, minimap)\n\n const editorSubscription = textEditor.onDidDestroy(() => {\n if (editorsMinimaps) { editorsMinimaps.delete(textEditor) }\n editorSubscription.dispose()\n })\n }\n\n return minimap\n}\n\n/**\n * Returns a new stand-alone {Minimap} for the passed-in `TextEditor`.\n *\n * @param {TextEditor} textEditor a text editor instance to create\n * a minimap for\n * @return {Minimap} a new stand-alone Minimap for the passed-in editor\n */\nexport function standAloneMinimapForEditor (textEditor) {\n if (!textEditor) { return }\n\n return new Minimap({\n textEditor,\n standAlone: true\n })\n}\n\n/**\n * Returns the `Minimap` associated to the active `TextEditor`.\n *\n * @return {Minimap} the active Minimap\n */\nexport function getActiveMinimap () {\n return minimapForEditor(atom.workspace.getActiveTextEditor())\n}\n\n/**\n * Calls a function for each present and future minimaps.\n *\n * @param {function(minimap:Minimap):void} iterator a function to call with\n * the existing and future\n * minimaps\n * @return {Disposable} a disposable to unregister the observer\n */\nexport function observeMinimaps (iterator) {\n if (!iterator) { return }\n\n if (editorsMinimaps) {\n editorsMinimaps.forEach((minimap) => { iterator(minimap) })\n }\n return onDidCreateMinimap((minimap) => { iterator(minimap) })\n}\n\n/**\n * Registers to the `observeTextEditors` method.\n *\n * @access private\n */\nfunction initSubscriptions () {\n subscriptions.add(\n atom.workspace.observeTextEditors((textEditor) => {\n const minimap = minimapForEditor(textEditor)\n const minimapElement = minimap.getMinimapElement() || minimapViewProvider(minimap)\n\n emitter.emit('did-create-minimap', minimap)\n minimapElement.attach(textEditor.getElement())\n }),\n // empty color cache if the theme changes\n atom.themes.onDidChangeActiveThemes(() => {\n domStylesReader.invalidateDOMStylesCache()\n editorsMinimaps.forEach((minimap) => { atom.views.getView(minimap).requestForcedUpdate() })\n }),\n treeSitterWarning()\n )\n}\n\n// The public exports included in the service:\nconst MinimapServiceV1 = {\n minimapViewProvider,\n getConfigSchema,\n onDidActivate,\n onDidDeactivate,\n onDidCreateMinimap,\n onDidAddPlugin,\n onDidRemovePlugin,\n onDidActivatePlugin,\n onDidDeactivatePlugin,\n onDidChangePluginOrder,\n minimapClass,\n minimapForEditorElement,\n minimapForEditor,\n standAloneMinimapForEditor,\n getActiveMinimap,\n observeMinimaps,\n registerPlugin: PluginManagement.registerPlugin,\n unregisterPlugin: PluginManagement.unregisterPlugin,\n togglePluginActivation: PluginManagement.togglePluginActivation,\n deactivateAllPlugins: PluginManagement.deactivateAllPlugins,\n activatePlugin: PluginManagement.activatePlugin,\n deactivatePlugin: PluginManagement.deactivatePlugin,\n getPluginsOrder: PluginManagement.getPluginsOrder\n}\n\n/**\n * Returns the Minimap main module instance.\n *\n * @return {Main} The Minimap main module instance.\n */\nexport function provideMinimapServiceV1 () { return MinimapServiceV1 }\n","(function() {\n var Deprecation, SourceMapCache;\n\n SourceMapCache = {};\n\n module.exports = Deprecation = (function() {\n Deprecation.getFunctionNameFromCallsite = function(callsite) {};\n\n Deprecation.deserialize = function(_arg) {\n var deprecation, fileName, lineNumber, message, stack, stacks, _i, _len;\n message = _arg.message, fileName = _arg.fileName, lineNumber = _arg.lineNumber, stacks = _arg.stacks;\n deprecation = new Deprecation(message, fileName, lineNumber);\n for (_i = 0, _len = stacks.length; _i < _len; _i++) {\n stack = stacks[_i];\n deprecation.addStack(stack, stack.metadata);\n }\n return deprecation;\n };\n\n function Deprecation(message, fileName, lineNumber) {\n this.message = message;\n this.fileName = fileName;\n this.lineNumber = lineNumber;\n this.callCount = 0;\n this.stackCount = 0;\n this.stacks = {};\n this.stackCallCounts = {};\n }\n\n Deprecation.prototype.getFunctionNameFromCallsite = function(callsite) {\n var _ref, _ref1, _ref2;\n if (callsite.functionName != null) {\n return callsite.functionName;\n }\n if (callsite.isToplevel()) {\n return (_ref = callsite.getFunctionName()) != null ? _ref : '';\n } else {\n if (callsite.isConstructor()) {\n return \"new \" + (callsite.getFunctionName());\n } else if (callsite.getMethodName() && !callsite.getFunctionName()) {\n return callsite.getMethodName();\n } else {\n return \"\" + (callsite.getTypeName()) + \".\" + ((_ref1 = (_ref2 = callsite.getMethodName()) != null ? _ref2 : callsite.getFunctionName()) != null ? _ref1 : '');\n }\n }\n };\n\n Deprecation.prototype.getLocationFromCallsite = function(callsite) {\n var column, fileName, line;\n if (callsite == null) {\n return \"unknown\";\n }\n if (callsite.location != null) {\n return callsite.location;\n }\n if (callsite.isNative()) {\n return \"native\";\n } else if (callsite.isEval()) {\n return \"eval at \" + (this.getLocationFromCallsite(callsite.getEvalOrigin()));\n } else {\n fileName = callsite.getFileName();\n line = callsite.getLineNumber();\n column = callsite.getColumnNumber();\n return \"\" + fileName + \":\" + line + \":\" + column;\n }\n };\n\n Deprecation.prototype.getFileNameFromCallSite = function(callsite) {\n var _ref;\n return (_ref = callsite.fileName) != null ? _ref : callsite.getFileName();\n };\n\n Deprecation.prototype.getOriginName = function() {\n return this.originName;\n };\n\n Deprecation.prototype.getMessage = function() {\n return this.message;\n };\n\n Deprecation.prototype.getStacks = function() {\n var location, parsedStack, parsedStacks, stack, _ref;\n parsedStacks = [];\n _ref = this.stacks;\n for (location in _ref) {\n stack = _ref[location];\n parsedStack = this.parseStack(stack);\n parsedStack.callCount = this.stackCallCounts[location];\n parsedStack.metadata = stack.metadata;\n parsedStacks.push(parsedStack);\n }\n return parsedStacks;\n };\n\n Deprecation.prototype.getStackCount = function() {\n return this.stackCount;\n };\n\n Deprecation.prototype.getCallCount = function() {\n return this.callCount;\n };\n\n Deprecation.prototype.addStack = function(stack, metadata) {\n var callerLocation, _base, _base1;\n if (this.originName == null) {\n this.originName = this.getFunctionNameFromCallsite(stack[0]);\n }\n if (this.fileName == null) {\n this.fileName = this.getFileNameFromCallSite(stack[0]);\n }\n if (this.lineNumber == null) {\n this.lineNumber = typeof (_base = stack[0]).getLineNumber === \"function\" ? _base.getLineNumber() : void 0;\n }\n this.callCount++;\n stack.metadata = metadata;\n callerLocation = this.getLocationFromCallsite(stack[1]);\n if (this.stacks[callerLocation] == null) {\n this.stacks[callerLocation] = stack;\n this.stackCount++;\n }\n if ((_base1 = this.stackCallCounts)[callerLocation] == null) {\n _base1[callerLocation] = 0;\n }\n return this.stackCallCounts[callerLocation]++;\n };\n\n Deprecation.prototype.parseStack = function(stack) {\n return stack.map((function(_this) {\n return function(callsite) {\n return {\n functionName: _this.getFunctionNameFromCallsite(callsite),\n location: _this.getLocationFromCallsite(callsite),\n fileName: _this.getFileNameFromCallSite(callsite)\n };\n };\n })(this));\n };\n\n Deprecation.prototype.serialize = function() {\n return {\n message: this.getMessage(),\n lineNumber: this.lineNumber,\n fileName: this.fileName,\n stacks: this.getStacks()\n };\n };\n\n return Deprecation;\n\n })();\n\n}).call(this);\n","\"use strict\";\n\nexports.Emitter = require(\"./emitter\");\nexports.Disposable = require(\"./disposable\");\nexports.CompositeDisposable = require(\"./composite-disposable\");","(function() {\n var Deprecation, Emitter, getRawStack, grim;\n\n Deprecation = require('./deprecation');\n\n if (global.__grim__ == null) {\n Emitter = require('event-kit').Emitter;\n grim = global.__grim__ = {\n deprecations: {},\n emitter: new Emitter,\n includeDeprecatedAPIs: true,\n getDeprecations: function() {\n var deprecation, deprecations, deprecationsByLineNumber, deprecationsByPackage, fileName, lineNumber, packageName, _ref;\n deprecations = [];\n _ref = grim.deprecations;\n for (fileName in _ref) {\n deprecationsByLineNumber = _ref[fileName];\n for (lineNumber in deprecationsByLineNumber) {\n deprecationsByPackage = deprecationsByLineNumber[lineNumber];\n for (packageName in deprecationsByPackage) {\n deprecation = deprecationsByPackage[packageName];\n deprecations.push(deprecation);\n }\n }\n }\n return deprecations;\n },\n getDeprecationsLength: function() {\n return this.getDeprecations().length;\n },\n clearDeprecations: function() {\n grim.deprecations = {};\n },\n logDeprecations: function() {\n var deprecation, deprecations, _i, _len;\n deprecations = this.getDeprecations();\n deprecations.sort(function(a, b) {\n return b.getCallCount() - a.getCallCount();\n });\n console.warn(\"\\nCalls to deprecated functions\\n-----------------------------\");\n for (_i = 0, _len = deprecations.length; _i < _len; _i++) {\n deprecation = deprecations[_i];\n console.warn(\"(\" + (deprecation.getCallCount()) + \") \" + (deprecation.getOriginName()) + \" : \" + (deprecation.getMessage()), deprecation);\n }\n },\n deprecate: function(message, metadata) {\n var deprecation, deprecationSite, error, fileName, lineNumber, originalStackTraceLimit, packageName, stack, _base, _base1, _base2, _ref, _ref1;\n originalStackTraceLimit = Error.stackTraceLimit;\n try {\n Error.stackTraceLimit = 7;\n error = new Error;\n stack = (_ref = typeof error.getRawStack === \"function\" ? error.getRawStack() : void 0) != null ? _ref : getRawStack(error);\n stack = stack.slice(1);\n } finally {\n Error.stackTraceLimit = originalStackTraceLimit;\n }\n deprecationSite = stack[0];\n fileName = deprecationSite.getFileName();\n lineNumber = deprecationSite.getLineNumber();\n packageName = (_ref1 = metadata != null ? metadata.packageName : void 0) != null ? _ref1 : \"\";\n if ((_base = grim.deprecations)[fileName] == null) {\n _base[fileName] = {};\n }\n if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {\n _base1[lineNumber] = {};\n }\n if ((_base2 = grim.deprecations[fileName][lineNumber])[packageName] == null) {\n _base2[packageName] = new Deprecation(message);\n }\n deprecation = grim.deprecations[fileName][lineNumber][packageName];\n deprecation.addStack(stack, metadata);\n grim.emitter.emit(\"updated\", deprecation);\n },\n addSerializedDeprecation: function(serializedDeprecation) {\n var deprecation, fileName, lineNumber, message, packageName, stack, stacks, _base, _base1, _base2, _i, _len, _ref, _ref1, _ref2;\n deprecation = Deprecation.deserialize(serializedDeprecation);\n message = deprecation.getMessage();\n fileName = deprecation.fileName, lineNumber = deprecation.lineNumber;\n stacks = deprecation.getStacks();\n packageName = (_ref = (_ref1 = stacks[0]) != null ? (_ref2 = _ref1.metadata) != null ? _ref2.packageName : void 0 : void 0) != null ? _ref : \"\";\n if ((_base = grim.deprecations)[fileName] == null) {\n _base[fileName] = {};\n }\n if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {\n _base1[lineNumber] = {};\n }\n if ((_base2 = grim.deprecations[fileName][lineNumber])[packageName] == null) {\n _base2[packageName] = new Deprecation(message, fileName, lineNumber);\n }\n deprecation = grim.deprecations[fileName][lineNumber][packageName];\n for (_i = 0, _len = stacks.length; _i < _len; _i++) {\n stack = stacks[_i];\n deprecation.addStack(stack, stack.metadata);\n }\n grim.emitter.emit(\"updated\", deprecation);\n },\n on: function(eventName, callback) {\n return grim.emitter.on(eventName, callback);\n }\n };\n }\n\n getRawStack = function(error) {\n var originalPrepareStackTrace, result;\n originalPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = function(error, stack) {\n return stack;\n };\n Error.captureStackTrace(error, getRawStack);\n result = error.stack;\n Error.prepareStackTrace = originalPrepareStackTrace;\n return result;\n };\n\n module.exports = global.__grim__;\n\n}).call(this);\n","{deprecate} = require 'grim'\n\nif global.__CUSTOM_HTML_ELEMENTS_CLASSES__?\n global.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__ = global.__CUSTOM_HTML_ELEMENTS_CLASSES__\n delete global.__CUSTOM_HTML_ELEMENTS_CLASSES__\nelse\n global.__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__ ?= {}\n\ncallbackProperties = [\n 'createdCallback'\n 'attachedCallback'\n 'detachedCallback'\n 'attributeChangedCallback'\n]\n\ndecorateElementPrototype = (target, source) ->\n callbackProperties.forEach (k) ->\n Object.defineProperty target, k, {\n value: -> @[\"__#{k}\"]?.apply(this, arguments)\n writable: true\n enumerable: true\n configurable: true\n }\n\n Object.getOwnPropertyNames(source).forEach (k) ->\n return if k in ['constructor']\n\n descriptor = Object.getOwnPropertyDescriptor(source, k)\n if callbackProperties.indexOf(k) > -1\n Object.defineProperty(target, \"__#{k}\", descriptor)\n else\n Object.defineProperty(target, k, descriptor)\n\ndecorateElementClass = (target, source) ->\n Object.getOwnPropertyNames(source).forEach (k) ->\n return if k in ['length', 'name', 'arguments', 'caller', 'prototype']\n\n descriptor = Object.getOwnPropertyDescriptor(source, k)\n Object.defineProperty(target, k, descriptor)\n\nmodule.exports = (nodeName, options) ->\n {class: klass} = options\n if klass?\n proto = klass.prototype\n else\n proto = options.prototype ? options\n\n if proto is options\n deprecate('Using the prototype as the second argument is deprecated, use the prototype option instead')\n\n\n if __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName]\n elementClass = __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName]\n\n decorateElementPrototype(elementClass.prototype, proto)\n decorateElementClass(elementClass, klass) if klass?\n\n elementClass\n else\n elementPrototype = Object.create(HTMLElement.prototype)\n decorateElementPrototype(elementPrototype, proto)\n\n elementClass = document.registerElement nodeName, prototype: Object.create(elementPrototype)\n\n decorateElementClass(elementClass, klass) if klass?\n\n __ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__[nodeName] = elementClass\n","(function() {\n var ExcludedClassProperties, ExcludedPrototypeProperties, Mixin, name;\n\n module.exports = Mixin = (function() {\n Mixin.includeInto = function(constructor) {\n var name, value, _ref;\n this.extend(constructor.prototype);\n for (name in this) {\n value = this[name];\n if (ExcludedClassProperties.indexOf(name) === -1) {\n if (!constructor.hasOwnProperty(name)) {\n constructor[name] = value;\n }\n }\n }\n return (_ref = this.included) != null ? _ref.call(constructor) : void 0;\n };\n\n Mixin.extend = function(object) {\n var name, _i, _len, _ref, _ref1;\n _ref = Object.getOwnPropertyNames(this.prototype);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n name = _ref[_i];\n if (ExcludedPrototypeProperties.indexOf(name) === -1) {\n if (!object.hasOwnProperty(name)) {\n object[name] = this.prototype[name];\n }\n }\n }\n return (_ref1 = this.prototype.extended) != null ? _ref1.call(object) : void 0;\n };\n\n function Mixin() {\n if (typeof this.extended === \"function\") {\n this.extended();\n }\n }\n\n return Mixin;\n\n })();\n\n ExcludedClassProperties = ['__super__'];\n\n for (name in Mixin) {\n ExcludedClassProperties.push(name);\n }\n\n ExcludedPrototypeProperties = ['constructor', 'extended'];\n\n}).call(this);\n","Mixin = require 'mixto'\n\n# Public\nmodule.exports =\nclass Ancestors extends Mixin\n\n ### Public ###\n\n @parents: (node, selector='*') ->\n parents = []\n @eachParent node, (parent) -> parents.push(parent) if parent.matches?(selector)\n parents\n\n @eachParent: (node, block) ->\n parent = node.parentNode\n\n block(parent) if parent?\n while parent = parent.parentNode\n block(parent) if parent?\n\n parents: (selector='*') -> Ancestors.parents(this, selector)\n\n queryParentSelectorAll: (selector) ->\n unless selector?\n throw new Error '::queryParentSelectorAll requires a valid selector as argument'\n @parents(selector)\n\n queryParentSelector: (selector) ->\n unless selector?\n throw new Error '::queryParentSelector requires a valid selector as argument'\n @queryParentSelectorAll(selector)[0]\n\n eachParent: (block) -> Ancestors.eachParent(this, block)\n","Mixin = require 'mixto'\n{Disposable} = require 'atom'\n\nmodule.exports =\nclass DisposableEvents extends Mixin\n addDisposableEventListener: (object, event, listener, options) ->\n object.addEventListener event, listener, options\n new Disposable -> object.removeEventListener event, listener\n","Mixin = require 'mixto'\nDisposableEvents = require './disposable-events'\n{Disposable, CompositeDisposable} = require 'atom'\neachPair = (object, callback) -> callback(k,v) for k,v of object\n\nNO_SELECTOR = '__NONE__'\n\nmodule.exports =\nclass EventsDelegation extends Mixin\n DisposableEvents.includeInto(this)\n\n subscribeTo: (object, selector, events, options) ->\n unless object instanceof HTMLElement\n [object, selector, events, options] = [this, object, selector, events]\n\n [events, selector, options] = [selector, NO_SELECTOR, events] if typeof selector is 'object'\n\n @eventsMap ?= new WeakMap\n @disposablesMap ?= new WeakMap\n @eventsMap.set(object, {}) unless @eventsMap.get(object)?\n @disposablesMap.set(object, {}) unless @disposablesMap.get(object)?\n\n eventsForObject = @eventsMap.get(object)\n disposablesForObject = @disposablesMap.get(object)\n\n eachPair events, (event, callback) =>\n unless eventsForObject[event]?\n eventsForObject[event] = {}\n disposablesForObject[event] = @createEventListener(object, event, options)\n\n eventsForObject[event][selector] = callback\n\n new Disposable => @unsubscribeFrom object, selector, events\n\n unsubscribeFrom: (object, selector, events) ->\n unless object instanceof HTMLElement\n [object, selector, events] = [this, object, selector]\n\n [events, selector] = [selector, NO_SELECTOR] if typeof selector is 'object'\n\n return unless eventsForObject = @eventsMap.get(object)\n\n for event of events\n delete eventsForObject[event][selector]\n\n if Object.keys(eventsForObject[event]).length is 0\n disposablesForObject = @disposablesMap.get(object)\n disposablesForObject[event].dispose()\n delete disposablesForObject[event]\n delete eventsForObject[event]\n\n if Object.keys(eventsForObject).length is 0\n @eventsMap.delete(object)\n @disposablesMap.delete(object)\n\n createEventListener: (object, event, options) ->\n listener = (e) =>\n return unless eventsForObject = @eventsMap.get(object)?[event]\n\n {target} = e\n @decorateEvent(e)\n\n @eachSelectorFromTarget(e, target, eventsForObject)\n eventsForObject[NO_SELECTOR]?(e) unless e.isPropagationStopped\n return true\n\n @addDisposableEventListener object, event, listener, options\n\n eachSelectorFromTarget: (event, target, eventsForObject) ->\n @nodeAndItsAncestors target, (node) =>\n return if event.isPropagationStopped\n @eachSelector eventsForObject, (selector,callback) =>\n matched = @targetMatch(node, selector)\n return if event.isImmediatePropagationStopped or not matched\n callback(event)\n\n eachSelector: (eventsForObject, callback) ->\n keys = Object.keys(eventsForObject)\n if keys.indexOf(NO_SELECTOR) isnt - 1\n keys.splice(keys.indexOf(NO_SELECTOR), 1)\n keys.sort (a,b) -> b.split(' ').length - a.split(' ').length\n\n for key in keys\n return true if callback(key, eventsForObject[key])\n return false\n\n targetMatch: (target, selector) ->\n return true if target.matches(selector)\n\n parent = target.parentNode\n while parent? and parent.matches?\n return true if parent.matches(selector)\n parent = parent.parentNode\n\n false\n\n nodeAndItsAncestors: (node, callback) ->\n parent = node.parentNode\n\n callback(node)\n while parent? and parent.matches?\n callback(parent)\n parent = parent.parentNode\n\n decorateEvent: (e) ->\n overriddenStop = Event::stopPropagation\n e.stopPropagation = ->\n @isPropagationStopped = true\n overriddenStop.apply(this, arguments)\n\n overriddenStopImmediate = Event::stopImmediatePropagation\n e.stopImmediatePropagation = ->\n @isImmediatePropagationStopped = true\n overriddenStopImmediate.apply(this, arguments)\n","Mixin = require 'mixto'\n\nTags =\n 'a abbr address article aside audio b bdi bdo blockquote body button canvas\n caption cite code colgroup datalist dd del details dfn dialog div dl dt em\n fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header html i\n iframe ins kbd label legend li main map mark menu meter nav noscript object\n ol optgroup option output p pre progress q rp rt ruby s samp script section\n select small span strong style sub summary sup table tbody td textarea tfoot\n th thead time title tr u ul var video area base br col command embed hr img\n input keygen link meta param source track wbr'.split /\\s+/\n\nSelfClosingTags = {}\n'area base br col command embed hr img input keygen link meta param\n source track wbr'.split(/\\s+/).forEach (tag) -> SelfClosingTags[tag] = true\n\nEvents =\n 'blur change click dblclick error focus input keydown\n keypress keyup load mousedown mousemove mouseout mouseover\n mouseup resize scroll select submit unload'.split /\\s+/\n\nclass BabelSpacePenDSL extends Mixin\n buildContent: ->\n SpacePenDSL.buildContent(this, @constructor.content) if @constructor.content?\n\nmodule.exports =\nclass SpacePenDSL extends Mixin\n @Babel: BabelSpacePenDSL\n\n @includeInto: (klass) ->\n super(klass)\n\n Object.defineProperty klass, 'content',\n enumerable: false\n get: -> @prototype.__content__\n set: (value) -> @prototype.__content__ = value\n\n Object.defineProperty klass::, 'createdCallback',\n enumerable: true\n get: -> @__create__\n set: (value) -> @__createdCallback__ = value\n\n Object.defineProperty klass::, '__create__',\n enumerable: true\n value: ->\n SpacePenDSL.buildContent(this, @__content__) if @__content__?\n\n do @__createdCallback__ if @__createdCallback__?\n\n klass.useShadowRoot = ->\n klass::__useShadowRoot__ = true\n\n @buildContent: (element, content) ->\n template = new Template\n\n content.call(template)\n\n [html] = template.buildHtml()\n root =\n if element.__useShadowRoot__\n root = element.shadowRoot = element.createShadowRoot()\n else\n root = element\n root.innerHTML = html\n\n @wireOutlets(element, root)\n\n @wireOutlets: (view, root) ->\n for element in root.querySelectorAll('[outlet]')\n outlet = element.getAttribute('outlet')\n view[outlet] = element\n element.removeAttribute('outlet')\n\n undefined\n\nclass Template\n constructor: -> @currentBuilder = new Builder\n\n Tags.forEach (tagName) ->\n Template::[tagName] = (args...) -> @currentBuilder.tag(tagName, args...)\n\n subview: (name, view) -> @currentBuilder.subview(name, view)\n\n text: (string) -> @currentBuilder.text(string)\n\n tag: (tagName, args...) -> @currentBuilder.tag(tagName, args...)\n\n raw: (string) -> @currentBuilder.raw(string)\n\n buildHtml: -> @currentBuilder.buildHtml()\n\nclass Builder\n constructor: ->\n @document = []\n @postProcessingSteps = []\n\n buildHtml: ->\n [@document.join(''), @postProcessingSteps]\n\n tag: (name, args...) ->\n options = @extractOptions(args)\n\n @openTag(name, options.attributes)\n\n if SelfClosingTags.hasOwnProperty(name)\n if options.text? or options.content?\n throw new Error(\"Self-closing tag #{name} cannot have text or content\")\n else\n options.content?()\n @text(options.text) if options.text\n @closeTag(name)\n\n openTag: (name, attributes) ->\n if @document.length is 0\n attributes ?= {}\n\n attributePairs =\n for attributeName, value of attributes\n \"#{attributeName}=\\\"#{value}\\\"\"\n\n attributesString =\n if attributePairs.length\n \" \" + attributePairs.join(\" \")\n else\n \"\"\n\n @document.push \"<#{name}#{attributesString}>\"\n\n closeTag: (name) ->\n @document.push \"\"\n\n text: (string) ->\n escapedString = string\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>')\n\n @document.push escapedString\n\n raw: (string) ->\n @document.push string\n\n subview: (outletName, subview) ->\n subviewId = \"subview-#{++idCounter}\"\n @tag 'div', id: subviewId\n @postProcessingSteps.push (view) ->\n view[outletName] = subview\n subview.parentView = view\n view.find(\"div##{subviewId}\").replaceWith(subview)\n\n extractOptions: (args) ->\n options = {}\n for arg in args\n switch typeof(arg)\n when 'function'\n options.content = arg\n when 'string', 'number'\n options.text = arg.toString()\n else\n options.attributes = arg\n options\n","\nmodule.exports =\n requirePackages: (packages...) ->\n new Promise (resolve, reject) ->\n required = []\n failures = []\n remains = packages.length\n\n solved = ->\n remains--\n return unless remains is 0\n return reject(failures) if failures.length > 0\n resolve(required)\n\n packages.forEach (pkg, i) ->\n failHandler = (reason) ->\n failures[i] = reason\n solved()\n\n promise = atom.packages.activatePackage(pkg)\n .then (activatedPackage) ->\n required[i] = activatedPackage.mainModule\n solved()\n\n if promise.fail?\n promise.fail(failHandler)\n else if promise.catch?\n promise.catch(failHandler)\n\n registerOrUpdateElement: require './register-or-update-element'\n Ancestors: require './mixins/ancestors'\n AncestorsMethods: require './mixins/ancestors'\n DisposableEvents: require './mixins/disposable-events'\n EventsDelegation: require './mixins/events-delegation'\n SpacePenDSL: require './mixins/space-pen-dsl'\n","\"use strict\";\n\nvar utils = module.exports = {};\n\n/**\n * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.\n * @public\n * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.\n * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.\n * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.\n */\nutils.forEach = function(collection, callback) {\n for(var i = 0; i < collection.length; i++) {\n var result = callback(collection[i]);\n if(result) {\n return result;\n }\n }\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var getState = options.stateHandler.getState;\n\n /**\n * Tells if the element has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is detectable or not.\n */\n function isDetectable(element) {\n var state = getState(element);\n return state && !!state.isDetectable;\n }\n\n /**\n * Marks the element that it has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to mark.\n */\n function markAsDetectable(element) {\n getState(element).isDetectable = true;\n }\n\n /**\n * Tells if the element is busy or not.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is busy or not.\n */\n function isBusy(element) {\n return !!getState(element).busy;\n }\n\n /**\n * Marks the object is busy and should not be made detectable.\n * @public\n * @param {element} element The element to mark.\n * @param {boolean} busy If the element is busy or not.\n */\n function markBusy(element, busy) {\n getState(element).busy = !!busy;\n }\n\n return {\n isDetectable: isDetectable,\n markAsDetectable: markAsDetectable,\n isBusy: isBusy,\n markBusy: markBusy\n };\n};\n","\"use strict\";\n\nmodule.exports = function(idHandler) {\n var eventListeners = {};\n\n /**\n * Gets all listeners for the given element.\n * @public\n * @param {element} element The element to get all listeners for.\n * @returns All listeners for the given element.\n */\n function getListeners(element) {\n var id = idHandler.get(element);\n\n if (id === undefined) {\n return [];\n }\n\n return eventListeners[id] || [];\n }\n\n /**\n * Stores the given listener for the given element. Will not actually add the listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The callback that the element has added.\n */\n function addListener(element, listener) {\n var id = idHandler.get(element);\n\n if(!eventListeners[id]) {\n eventListeners[id] = [];\n }\n\n eventListeners[id].push(listener);\n }\n\n function removeListener(element, listener) {\n var listeners = getListeners(element);\n for (var i = 0, len = listeners.length; i < len; ++i) {\n if (listeners[i] === listener) {\n listeners.splice(i, 1);\n break;\n }\n }\n }\n\n function removeAllListeners(element) {\n var listeners = getListeners(element);\n if (!listeners) { return; }\n listeners.length = 0;\n }\n\n return {\n get: getListeners,\n add: addListener,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners\n };\n};\n","\"use strict\";\n\nmodule.exports = function() {\n var idCount = 1;\n\n /**\n * Generates a new unique id in the context.\n * @public\n * @returns {number} A unique id in the context.\n */\n function generate() {\n return idCount++;\n }\n\n return {\n generate: generate\n };\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var idGenerator = options.idGenerator;\n var getState = options.stateHandler.getState;\n\n /**\n * Gets the resize detector id of the element.\n * @public\n * @param {element} element The target element to get the id of.\n * @returns {string|number|null} The id of the element. Null if it has no id.\n */\n function getId(element) {\n var state = getState(element);\n\n if (state && state.id !== undefined) {\n return state.id;\n }\n\n return null;\n }\n\n /**\n * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.\n * @public\n * @param {element} element The target element to set the id of.\n * @returns {string|number|null} The id of the element.\n */\n function setId(element) {\n var state = getState(element);\n\n if (!state) {\n throw new Error(\"setId required the element to have a resize detection state.\");\n }\n\n var id = idGenerator.generate();\n\n state.id = id;\n\n return id;\n }\n\n return {\n get: getId,\n set: setId\n };\n};\n","\"use strict\";\n\n/* global console: false */\n\n/**\n * Reporter that handles the reporting of logs, warnings and errors.\n * @public\n * @param {boolean} quiet Tells if the reporter should be quiet or not.\n */\nmodule.exports = function(quiet) {\n function noop() {\n //Does nothing.\n }\n\n var reporter = {\n log: noop,\n warn: noop,\n error: noop\n };\n\n if(!quiet && window.console) {\n var attachFunction = function(reporter, name) {\n //The proxy is needed to be able to call the method with the console context,\n //since we cannot use bind.\n reporter[name] = function reporterProxy() {\n var f = console[name];\n if (f.apply) { //IE9 does not support console.log.apply :)\n f.apply(console, arguments);\n } else {\n for (var i = 0; i < arguments.length; i++) {\n f(arguments[i]);\n }\n }\n };\n };\n\n attachFunction(reporter, \"log\");\n attachFunction(reporter, \"warn\");\n attachFunction(reporter, \"error\");\n }\n\n return reporter;\n};","\"use strict\";\n\nvar detector = module.exports = {};\n\ndetector.isIE = function(version) {\n function isAnyIeVersion() {\n var agent = navigator.userAgent.toLowerCase();\n return agent.indexOf(\"msie\") !== -1 || agent.indexOf(\"trident\") !== -1 || agent.indexOf(\" edge/\") !== -1;\n }\n\n if(!isAnyIeVersion()) {\n return false;\n }\n\n if(!version) {\n return true;\n }\n\n //Shamelessly stolen from https://gist.github.com/padolsey/527683\n var ieVersion = (function(){\n var undef,\n v = 3,\n div = document.createElement(\"div\"),\n all = div.getElementsByTagName(\"i\");\n\n do {\n div.innerHTML = \"\";\n }\n while (all[0]);\n\n return v > 4 ? v : undef;\n }());\n\n return version === ieVersion;\n};\n\ndetector.isLegacyOpera = function() {\n return !!window.opera;\n};\n","\"use strict\";\n\nvar utils = module.exports = {};\n\nutils.getOption = getOption;\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","/**\n * Resize detection strategy that injects objects to elements in order to detect resize events.\n * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/\n */\n\n\"use strict\";\n\nvar browserDetector = require(\"../browser-detector\");\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n\n if(!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n function listenerProxy() {\n listener(element);\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support object, but supports the resize event directly on elements.\n getState(element).object = {\n proxy: listenerProxy\n };\n element.attachEvent(\"onresize\", listenerProxy);\n } else {\n var object = getObject(element);\n\n if(!object) {\n throw new Error(\"Element is not detectable by this strategy.\");\n }\n\n object.contentDocument.defaultView.addEventListener(\"resize\", listenerProxy);\n }\n }\n\n function buildCssTextString(rules) {\n var seperator = options.important ? \" !important; \" : \"; \";\n\n return (rules.join(seperator) + seperator).trim();\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n var debug = options.debug;\n\n function injectObject(element, callback) {\n var OBJECT_STYLE = buildCssTextString([\"display: block\", \"position: absolute\", \"top: 0\", \"left: 0\", \"width: 100%\", \"height: 100%\", \"border: none\", \"padding: 0\", \"margin: 0\", \"opacity: 0\", \"z-index: -1000\", \"pointer-events: none\"]);\n\n //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.\n\n // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.\n var positionCheckPerformed = false;\n\n // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.\n // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.\n var style = window.getComputedStyle(element);\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n getState(element).startSize = {\n width: width,\n height: height\n };\n\n function mutateDom() {\n function alterPositionStyles() {\n if(style.position === \"static\") {\n element.style.setProperty(\"position\", \"relative\", options.important ? \"important\" : \"\");\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style.setProperty(property, \"0\", options.important ? \"important\" : \"\");\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function onObjectLoad() {\n // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.\n if (!positionCheckPerformed) {\n alterPositionStyles();\n }\n\n /*jshint validthis: true */\n\n function getDocument(element, callback) {\n //Opera 12 seem to call the object.onload before the actual document has been created.\n //So if it is not present, poll it with an timeout until it is present.\n //TODO: Could maybe be handled better with object.onreadystatechange or similar.\n if(!element.contentDocument) {\n var state = getState(element);\n if (state.checkForObjectDocumentTimeoutId) {\n window.clearTimeout(state.checkForObjectDocumentTimeoutId);\n }\n state.checkForObjectDocumentTimeoutId = setTimeout(function checkForObjectDocument() {\n state.checkForObjectDocumentTimeoutId = 0;\n getDocument(element, callback);\n }, 100);\n\n return;\n }\n\n callback(element.contentDocument);\n }\n\n //Mutating the object element here seems to fire another load event.\n //Mutating the inner document of the object element is fine though.\n var objectElement = this;\n\n //Create the style element to be added to the object.\n getDocument(objectElement, function onObjectDocumentReady(objectDocument) {\n //Notify that the element is ready to be listened to.\n callback(element);\n });\n }\n\n // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.\n // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.\n if (style.position !== \"\") {\n alterPositionStyles(style);\n positionCheckPerformed = true;\n }\n\n //Add an object element as a child to the target element that will be listened to for resize events.\n var object = document.createElement(\"object\");\n object.style.cssText = OBJECT_STYLE;\n object.tabIndex = -1;\n object.type = \"text/html\";\n object.setAttribute(\"aria-hidden\", \"true\");\n object.onload = onObjectLoad;\n\n //Safari: This must occur before adding the object to the DOM.\n //IE: Does not like that this happens before, even if it is also added after.\n if(!browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n\n if (!getState(element)) {\n // The element has been uninstalled before the actual loading happened.\n return;\n }\n\n element.appendChild(object);\n getState(element).object = object;\n\n //IE: This must occur after adding the object to the DOM.\n if(browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n }\n\n if(batchProcessor) {\n batchProcessor.add(mutateDom);\n } else {\n mutateDom();\n }\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support objects properly. Luckily they do support the resize event.\n //So do not inject the object and notify that the element is already ready to be listened to.\n //The event handler for the resize event is attached in the utils.addListener instead.\n callback(element);\n } else {\n injectObject(element, callback);\n }\n }\n\n /**\n * Returns the child object of the target element.\n * @private\n * @param {element} element The target element.\n * @returns The object element of the target.\n */\n function getObject(element) {\n return getState(element).object;\n }\n\n function uninstall(element) {\n if (!getState(element)) {\n return;\n }\n\n var object = getObject(element);\n\n if (!object) {\n return;\n }\n\n if (browserDetector.isIE(8)) {\n element.detachEvent(\"onresize\", object.proxy);\n } else {\n element.removeChild(object);\n }\n\n if (getState(element).checkForObjectDocumentTimeoutId) {\n window.clearTimeout(getState(element).checkForObjectDocumentTimeoutId);\n }\n\n delete getState(element).object;\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall\n };\n};\n","/**\n * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.\n * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js\n */\n\n\"use strict\";\n\nvar forEach = require(\"../collection-utils\").forEach;\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n var hasState = options.stateHandler.hasState;\n var idHandler = options.idHandler;\n\n if (!batchProcessor) {\n throw new Error(\"Missing required dependency: batchProcessor\");\n }\n\n if (!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n //TODO: Could this perhaps be done at installation time?\n var scrollbarSizes = getScrollbarSizes();\n\n var styleId = \"erd_scroll_detection_scrollbar_style\";\n var detectionContainerClass = \"erd_scroll_detection_container\";\n\n function initDocument(targetDocument) {\n // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.\n // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).\n injectScrollStyle(targetDocument, styleId, detectionContainerClass);\n }\n\n initDocument(window.document);\n\n function buildCssTextString(rules) {\n var seperator = options.important ? \" !important; \" : \"; \";\n\n return (rules.join(seperator) + seperator).trim();\n }\n\n function getScrollbarSizes() {\n var width = 500;\n var height = 500;\n\n var child = document.createElement(\"div\");\n child.style.cssText = buildCssTextString([\"position: absolute\", \"width: \" + width*2 + \"px\", \"height: \" + height*2 + \"px\", \"visibility: hidden\", \"margin: 0\", \"padding: 0\"]);\n\n var container = document.createElement(\"div\");\n container.style.cssText = buildCssTextString([\"position: absolute\", \"width: \" + width + \"px\", \"height: \" + height + \"px\", \"overflow: scroll\", \"visibility: none\", \"top: \" + -width*3 + \"px\", \"left: \" + -height*3 + \"px\", \"visibility: hidden\", \"margin: 0\", \"padding: 0\"]);\n\n container.appendChild(child);\n\n document.body.insertBefore(container, document.body.firstChild);\n\n var widthSize = width - container.clientWidth;\n var heightSize = height - container.clientHeight;\n\n document.body.removeChild(container);\n\n return {\n width: widthSize,\n height: heightSize\n };\n }\n\n function injectScrollStyle(targetDocument, styleId, containerClass) {\n function injectStyle(style, method) {\n method = method || function (element) {\n targetDocument.head.appendChild(element);\n };\n\n var styleElement = targetDocument.createElement(\"style\");\n styleElement.innerHTML = style;\n styleElement.id = styleId;\n method(styleElement);\n return styleElement;\n }\n\n if (!targetDocument.getElementById(styleId)) {\n var containerAnimationClass = containerClass + \"_animation\";\n var containerAnimationActiveClass = containerClass + \"_animation_active\";\n var style = \"/* Created by the element-resize-detector library. */\\n\";\n style += \".\" + containerClass + \" > div::-webkit-scrollbar { \" + buildCssTextString([\"display: none\"]) + \" }\\n\\n\";\n style += \".\" + containerAnimationActiveClass + \" { \" + buildCssTextString([\"-webkit-animation-duration: 0.1s\", \"animation-duration: 0.1s\", \"-webkit-animation-name: \" + containerAnimationClass, \"animation-name: \" + containerAnimationClass]) + \" }\\n\";\n style += \"@-webkit-keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\\n\";\n style += \"@keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\";\n injectStyle(style);\n }\n }\n\n function addAnimationClass(element) {\n element.className += \" \" + detectionContainerClass + \"_animation_active\";\n }\n\n function addEvent(el, name, cb) {\n if (el.addEventListener) {\n el.addEventListener(name, cb);\n } else if(el.attachEvent) {\n el.attachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to add event listeners.\");\n }\n }\n\n function removeEvent(el, name, cb) {\n if (el.removeEventListener) {\n el.removeEventListener(name, cb);\n } else if(el.detachEvent) {\n el.detachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to remove event listeners.\");\n }\n }\n\n function getExpandElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[0];\n }\n\n function getShrinkElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[1];\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n var listeners = getState(element).listeners;\n\n if (!listeners.push) {\n throw new Error(\"Cannot add listener to an element that is not detectable.\");\n }\n\n getState(element).listeners.push(listener);\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n\n function debug() {\n if (options.debug) {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(idHandler.get(element), \"Scroll: \");\n if (reporter.log.apply) {\n reporter.log.apply(null, args);\n } else {\n for (var i = 0; i < args.length; i++) {\n reporter.log(args[i]);\n }\n }\n }\n }\n\n function isDetached(element) {\n function isInDocument(element) {\n return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);\n }\n\n if (!isInDocument(element)) {\n return true;\n }\n\n // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520\n if (window.getComputedStyle(element) === null) {\n return true;\n }\n\n return false;\n }\n\n function isUnrendered(element) {\n // Check the absolute positioned container since the top level container is display: inline.\n var container = getState(element).container.childNodes[0];\n var style = window.getComputedStyle(container);\n return !style.width || style.width.indexOf(\"px\") === -1; //Can only compute pixel value when rendered.\n }\n\n function getStyle() {\n // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,\n // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).\n var elementStyle = window.getComputedStyle(element);\n var style = {};\n style.position = elementStyle.position;\n style.width = element.offsetWidth;\n style.height = element.offsetHeight;\n style.top = elementStyle.top;\n style.right = elementStyle.right;\n style.bottom = elementStyle.bottom;\n style.left = elementStyle.left;\n style.widthCSS = elementStyle.width;\n style.heightCSS = elementStyle.height;\n return style;\n }\n\n function storeStartSize() {\n var style = getStyle();\n getState(element).startSize = {\n width: style.width,\n height: style.height\n };\n debug(\"Element start size\", getState(element).startSize);\n }\n\n function initListeners() {\n getState(element).listeners = [];\n }\n\n function storeStyle() {\n debug(\"storeStyle invoked.\");\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getStyle();\n getState(element).style = style;\n }\n\n function storeCurrentSize(element, width, height) {\n getState(element).lastWidth = width;\n getState(element).lastHeight = height;\n }\n\n function getExpandChildElement(element) {\n return getExpandElement(element).childNodes[0];\n }\n\n function getWidthOffset() {\n return 2 * scrollbarSizes.width + 1;\n }\n\n function getHeightOffset() {\n return 2 * scrollbarSizes.height + 1;\n }\n\n function getExpandWidth(width) {\n return width + 10 + getWidthOffset();\n }\n\n function getExpandHeight(height) {\n return height + 10 + getHeightOffset();\n }\n\n function getShrinkWidth(width) {\n return width * 2 + getWidthOffset();\n }\n\n function getShrinkHeight(height) {\n return height * 2 + getHeightOffset();\n }\n\n function positionScrollbars(element, width, height) {\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n var shrinkWidth = getShrinkWidth(width);\n var shrinkHeight = getShrinkHeight(height);\n expand.scrollLeft = expandWidth;\n expand.scrollTop = expandHeight;\n shrink.scrollLeft = shrinkWidth;\n shrink.scrollTop = shrinkHeight;\n }\n\n function injectContainerElement() {\n var container = getState(element).container;\n\n if (!container) {\n container = document.createElement(\"div\");\n container.className = detectionContainerClass;\n container.style.cssText = buildCssTextString([\"visibility: hidden\", \"display: inline\", \"width: 0px\", \"height: 0px\", \"z-index: -1\", \"overflow: hidden\", \"margin: 0\", \"padding: 0\"]);\n getState(element).container = container;\n addAnimationClass(container);\n element.appendChild(container);\n\n var onAnimationStart = function () {\n getState(element).onRendered && getState(element).onRendered();\n };\n\n addEvent(container, \"animationstart\", onAnimationStart);\n\n // Store the event handler here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onAnimationStart = onAnimationStart;\n }\n\n return container;\n }\n\n function injectScrollElements() {\n function alterPositionStyles() {\n var style = getState(element).style;\n\n if(style.position === \"static\") {\n element.style.setProperty(\"position\", \"relative\",options.important ? \"important\" : \"\");\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style[property] = 0;\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function getLeftTopBottomRightCssText(left, top, bottom, right) {\n left = (!left ? \"0\" : (left + \"px\"));\n top = (!top ? \"0\" : (top + \"px\"));\n bottom = (!bottom ? \"0\" : (bottom + \"px\"));\n right = (!right ? \"0\" : (right + \"px\"));\n\n return [\"left: \" + left, \"top: \" + top, \"right: \" + right, \"bottom: \" + bottom];\n }\n\n debug(\"Injecting elements\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n alterPositionStyles();\n\n var rootContainer = getState(element).container;\n\n if (!rootContainer) {\n rootContainer = injectContainerElement();\n }\n\n // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),\n // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than\n // the targeted element.\n // When the bug is resolved, \"containerContainer\" may be removed.\n\n // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).\n // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.\n\n var scrollbarWidth = scrollbarSizes.width;\n var scrollbarHeight = scrollbarSizes.height;\n var containerContainerStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: hidden\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\", \"left: 0px\", \"top: 0px\"]);\n var containerStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: hidden\", \"z-index: -1\", \"visibility: hidden\"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));\n var expandStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: scroll\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\"]);\n var shrinkStyle = buildCssTextString([\"position: absolute\", \"flex: none\", \"overflow: scroll\", \"z-index: -1\", \"visibility: hidden\", \"width: 100%\", \"height: 100%\"]);\n var expandChildStyle = buildCssTextString([\"position: absolute\", \"left: 0\", \"top: 0\"]);\n var shrinkChildStyle = buildCssTextString([\"position: absolute\", \"width: 200%\", \"height: 200%\"]);\n\n var containerContainer = document.createElement(\"div\");\n var container = document.createElement(\"div\");\n var expand = document.createElement(\"div\");\n var expandChild = document.createElement(\"div\");\n var shrink = document.createElement(\"div\");\n var shrinkChild = document.createElement(\"div\");\n\n // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56\n // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.\n containerContainer.dir = \"ltr\";\n\n containerContainer.style.cssText = containerContainerStyle;\n containerContainer.className = detectionContainerClass;\n container.className = detectionContainerClass;\n container.style.cssText = containerStyle;\n expand.style.cssText = expandStyle;\n expandChild.style.cssText = expandChildStyle;\n shrink.style.cssText = shrinkStyle;\n shrinkChild.style.cssText = shrinkChildStyle;\n\n expand.appendChild(expandChild);\n shrink.appendChild(shrinkChild);\n container.appendChild(expand);\n container.appendChild(shrink);\n containerContainer.appendChild(container);\n rootContainer.appendChild(containerContainer);\n\n function onExpandScroll() {\n getState(element).onExpand && getState(element).onExpand();\n }\n\n function onShrinkScroll() {\n getState(element).onShrink && getState(element).onShrink();\n }\n\n addEvent(expand, \"scroll\", onExpandScroll);\n addEvent(shrink, \"scroll\", onShrinkScroll);\n\n // Store the event handlers here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onExpandScroll = onExpandScroll;\n getState(element).onShrinkScroll = onShrinkScroll;\n }\n\n function registerListenersAndPositionElements() {\n function updateChildSizes(element, width, height) {\n var expandChild = getExpandChildElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n expandChild.style.setProperty(\"width\", expandWidth + \"px\", options.important ? \"important\" : \"\");\n expandChild.style.setProperty(\"height\", expandHeight + \"px\", options.important ? \"important\" : \"\");\n }\n\n function updateDetectorElements(done) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n // Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.\n var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;\n\n debug(\"Storing current size\", width, height);\n\n // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.\n // Otherwise the if-check in handleScroll is useless.\n storeCurrentSize(element, width, height);\n\n // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.\n // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.\n\n batchProcessor.add(0, function performUpdateChildSizes() {\n if (!sizeChanged) {\n return;\n }\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n if (options.debug) {\n var w = element.offsetWidth;\n var h = element.offsetHeight;\n\n if (w !== width || h !== height) {\n reporter.warn(idHandler.get(element), \"Scroll: Size changed before updating detector elements.\");\n }\n }\n\n updateChildSizes(element, width, height);\n });\n\n batchProcessor.add(1, function updateScrollbars() {\n // This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then\n // been restored to the original size, which will have changed the scrollbar positions.\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n positionScrollbars(element, width, height);\n });\n\n if (sizeChanged && done) {\n batchProcessor.add(2, function () {\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n done();\n });\n }\n }\n\n function areElementsInjected() {\n return !!getState(element).container;\n }\n\n function notifyListenersIfNeeded() {\n function isFirstNotify() {\n return getState(element).lastNotifiedWidth === undefined;\n }\n\n debug(\"notifyListenersIfNeeded invoked\");\n\n var state = getState(element);\n\n // Don't notify if the current size is the start size, and this is the first notification.\n if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {\n return debug(\"Not notifying: Size is the same as the start size, and there has been no notification yet.\");\n }\n\n // Don't notify if the size already has been notified.\n if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {\n return debug(\"Not notifying: Size already notified\");\n }\n\n\n debug(\"Current size not notified, notifying...\");\n state.lastNotifiedWidth = state.lastWidth;\n state.lastNotifiedHeight = state.lastHeight;\n forEach(getState(element).listeners, function (listener) {\n listener(element);\n });\n }\n\n function handleRender() {\n debug(\"startanimation triggered.\");\n\n if (isUnrendered(element)) {\n debug(\"Ignoring since element is still unrendered...\");\n return;\n }\n\n debug(\"Element rendered.\");\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {\n debug(\"Scrollbars out of sync. Updating detector elements...\");\n updateDetectorElements(notifyListenersIfNeeded);\n }\n }\n\n function handleScroll() {\n debug(\"Scroll detected.\");\n\n if (isUnrendered(element)) {\n // Element is still unrendered. Skip this scroll event.\n debug(\"Scroll event fired while unrendered. Ignoring...\");\n return;\n }\n\n updateDetectorElements(notifyListenersIfNeeded);\n }\n\n debug(\"registerListenersAndPositionElements invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n getState(element).onRendered = handleRender;\n getState(element).onExpand = handleScroll;\n getState(element).onShrink = handleScroll;\n\n var style = getState(element).style;\n updateChildSizes(element, style.width, style.height);\n }\n\n function finalizeDomMutation() {\n debug(\"finalizeDomMutation invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getState(element).style;\n storeCurrentSize(element, style.width, style.height);\n positionScrollbars(element, style.width, style.height);\n }\n\n function ready() {\n callback(element);\n }\n\n function install() {\n debug(\"Installing...\");\n initListeners();\n storeStartSize();\n\n batchProcessor.add(0, storeStyle);\n batchProcessor.add(1, injectScrollElements);\n batchProcessor.add(2, registerListenersAndPositionElements);\n batchProcessor.add(3, finalizeDomMutation);\n batchProcessor.add(4, ready);\n }\n\n debug(\"Making detectable...\");\n\n if (isDetached(element)) {\n debug(\"Element is detached\");\n\n injectContainerElement();\n\n debug(\"Waiting until element is attached...\");\n\n getState(element).onRendered = function () {\n debug(\"Element is now attached\");\n install();\n };\n } else {\n install();\n }\n }\n\n function uninstall(element) {\n var state = getState(element);\n\n if (!state) {\n // Uninstall has been called on a non-erd element.\n return;\n }\n\n // Uninstall may have been called in the following scenarios:\n // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).\n // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).\n // (3) After the installation process (here, state.busy = false and all the stuff has been injected).\n // So to be on the safe side, let's check for each thing before removing.\n\n // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.\n state.onExpandScroll && removeEvent(getExpandElement(element), \"scroll\", state.onExpandScroll);\n state.onShrinkScroll && removeEvent(getShrinkElement(element), \"scroll\", state.onShrinkScroll);\n state.onAnimationStart && removeEvent(state.container, \"animationstart\", state.onAnimationStart);\n\n state.container && element.removeChild(state.container);\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall,\n initDocument: initDocument\n };\n};\n","'use strict'\n\nimport { Emitter } from 'atom'\n\nlet idCounter = 0\nconst nextId = function () { return idCounter++ }\n\n/**\n * The `Decoration` class represents a decoration in the Minimap.\n *\n * It has the same API than the `Decoration` class of a text editor.\n */\nexport default class Decoration {\n /**\n * Returns `true` if the passed-in decoration properties matches the\n * specified type.\n *\n * @param {Object} decorationProperties the decoration properties to match\n * @param {string} type the decoration type to match\n * @return {boolean} whether the decoration properties match the type\n */\n static isType (decorationProperties, type) {\n if (Array.isArray(decorationProperties.type)) {\n if (decorationProperties.type.indexOf(type) >= 0) { return true }\n return false\n } else {\n return type === decorationProperties.type\n }\n }\n\n /**\n * Creates a new decoration.\n *\n * @param {Marker} marker the target marker for the decoration\n * @param {Minimap} minimap the Minimap where the decoration will\n * be displayed\n * @param {Object} properties the decoration's properties\n */\n constructor (marker, minimap, properties) {\n /**\n * @access private\n */\n this.marker = marker\n /**\n * @access private\n */\n this.minimap = minimap\n /**\n * @access private\n */\n this.emitter = new Emitter()\n /**\n * @access private\n */\n this.id = nextId()\n /**\n * @access private\n */\n this.properties = null\n this.setProperties(properties)\n this.properties.id = this.id\n /**\n * @access private\n */\n this.destroyed = false\n /**\n * @access private\n */\n this.markerDestroyDisposable = this.marker.onDidDestroy(() => {\n this.destroy()\n })\n\n this.screenRange = marker.getScreenRange()\n }\n\n /**\n * Destroy this marker.\n *\n * If you own the marker, you should use `Marker#destroy` which will destroy\n * this decoration.\n */\n destroy () {\n if (this.destroyed) { return }\n\n this.markerDestroyDisposable.dispose()\n this.markerDestroyDisposable = null\n this.destroyed = true\n this.emitter.emit('did-destroy')\n this.emitter.dispose()\n }\n\n /**\n * Returns whether this decoration is destroyed or not.\n *\n * @return {boolean} whether this decoration is destroyed or not\n */\n isDestroyed () { return this.destroyed }\n\n /**\n * Registers an event listener to the `did-change-properties` event.\n *\n * This event is triggered when the decoration update method is called.\n *\n * @param {function(change:Object):void} callback a function to call\n * when the event is triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeProperties (callback) {\n return this.emitter.on('did-change-properties', callback)\n }\n\n /**\n * Registers an event listener to the `did-destroy` event.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n /**\n * An id unique across all Decoration objects.\n *\n * @return {number} the decoration id\n */\n getId () { return this.id }\n\n /**\n * Returns the marker associated with this Decoration.\n *\n * @return {Marker} the decoration's marker\n */\n getMarker () { return this.marker }\n\n /**\n * Check if this decoration is of type `type`.\n *\n * @param {string|Array} type a type like `'line-number'`, `'line'`, etc.\n * `type` can also be an Array of Strings, where\n * it will return true if the decoration's type\n * matches any in the array.\n * @return {boolean} whether this decoration match the passed-in type\n */\n isType (type) {\n return Decoration.isType(this.properties, type)\n }\n\n /**\n * Returns the Decoration's properties.\n *\n * @return {Object} the decoration's properties\n */\n getProperties () {\n return this.properties\n }\n\n /**\n * Update the marker with new properties. Allows you to change the\n * decoration's class.\n *\n * @param {Object} newProperties the new properties for the decoration\n */\n setProperties (newProperties) {\n if (this.destroyed) { return }\n\n const oldProperties = this.properties\n this.properties = newProperties\n this.properties.id = this.id\n\n this.emitter.emit('did-change-properties', { oldProperties, newProperties })\n }\n}\n","'use babel'\n'use strict'\n\n/**\n * @access private\n */\nexport default class CanvasLayer {\n constructor () {\n /**\n * The onscreen canvas.\n * @type {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas')\n\n const desynchronized = process.platform !== 'linux'\n\n /**\n * The onscreen canvas context.\n * @type {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d', { desynchronized })\n this.canvas.webkitImageSmoothingEnabled = false\n this.context.imageSmoothingEnabled = false\n\n /**\n * The offscreen canvas.\n * @type {HTMLCanvasElement}\n * @access private\n */\n this.offscreenCanvas = document.createElement('canvas')\n /**\n * The offscreen canvas context.\n * @type {CanvasRenderingContext2D}\n * @access private\n */\n this.offscreenContext = this.offscreenCanvas.getContext('2d', { desynchronized })\n this.offscreenCanvas.webkitImageSmoothingEnabled = false\n this.offscreenContext.imageSmoothingEnabled = false\n }\n\n attach (parent) {\n if (this.canvas.parentNode) { return }\n\n parent.appendChild(this.canvas)\n }\n\n setSize (width = 0, height = 0) {\n this.canvas.width = width\n this.canvas.height = height\n this.context.imageSmoothingEnabled = false\n this.resetOffscreenSize()\n }\n\n getSize () {\n return {\n width: this.canvas.width,\n height: this.canvas.height\n }\n }\n\n resetOffscreenSize () {\n this.offscreenCanvas.width = this.canvas.width\n this.offscreenCanvas.height = this.canvas.height\n this.offscreenContext.imageSmoothingEnabled = false\n }\n\n copyToOffscreen () {\n if (this.canvas.width > 0 && this.canvas.height > 0) {\n this.offscreenContext.drawImage(this.canvas, 0, 0)\n }\n }\n\n copyFromOffscreen () {\n if (this.offscreenCanvas.width > 0 && this.offscreenCanvas.height > 0) {\n this.context.drawImage(this.offscreenCanvas, 0, 0)\n }\n }\n\n copyPartFromOffscreen (srcY, destY, height) {\n if (this.offscreenCanvas.width > 0 && this.offscreenCanvas.height > 0) {\n this.context.drawImage(\n this.offscreenCanvas,\n 0, srcY, this.offscreenCanvas.width, height,\n 0, destY, this.offscreenCanvas.width, height\n )\n }\n }\n\n clearCanvas () {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height)\n }\n}\n","'use strict'\n\nimport { CompositeDisposable, Emitter } from 'atom'\nimport { EventsDelegation, SpacePenDSL } from 'atom-utils-plus'\n\nimport * as Main from './main'\nimport element from './decorators/element'\nimport include from './decorators/include'\n\n/**\n * @access private\n */\nclass MinimapQuickSettingsElement {\n static initClass () {\n include(this, EventsDelegation, SpacePenDSL.Babel)\n return element(this, 'minimap-quick-settings')\n }\n\n static content () {\n this.div({ class: 'select-list popover-list minimap-quick-settings' }, () => {\n this.input({ type: 'text', class: 'hidden-input', outlet: 'hiddenInput' })\n this.ol({ class: 'list-group mark-active', outlet: 'list' }, () => {\n this.li({ class: 'separator', outlet: 'separator' })\n this.li({ class: 'code-highlights', outlet: 'codeHighlights' }, 'code-highlights')\n this.li({ class: 'absolute-mode', outlet: 'absoluteMode' }, 'absolute-mode')\n this.li({ class: 'adjust-absolute-mode-height', outlet: 'adjustAbsoluteModeHeight' }, 'adjust-absolute-mode-height')\n })\n this.div({ class: 'btn-group' }, () => {\n this.button({ class: 'btn btn-default', outlet: 'onLeftButton' }, 'On Left')\n this.button({ class: 'btn btn-default', outlet: 'onRightButton' }, 'On Right')\n })\n })\n }\n\n createdCallback () {\n this.buildContent()\n }\n\n setModel (minimap) {\n this.selectedItem = null\n this.minimap = minimap\n this.emitter = new Emitter()\n this.subscriptions = new CompositeDisposable()\n this.plugins = {}\n this.itemsActions = new WeakMap()\n\n this.codeHighlights.classList.toggle('active', this.minimap.displayCodeHighlights)\n\n this.itemsActions.set(this.codeHighlights, () => {\n atom.config.set('minimap.displayCodeHighlights', !this.minimap.displayCodeHighlights)\n })\n\n this.itemsActions.set(this.absoluteMode, () => {\n atom.config.set('minimap.absoluteMode', !atom.config.get('minimap.absoluteMode'))\n })\n\n this.itemsActions.set(this.adjustAbsoluteModeHeight, () => {\n atom.config.set('minimap.adjustAbsoluteModeHeight', !atom.config.get('minimap.adjustAbsoluteModeHeight'))\n })\n\n this.subscriptions.add(\n\n Main.onDidAddPlugin(({ name, plugin }) => {\n return this.addItemFor(name, plugin)\n }),\n Main.onDidRemovePlugin(({ name, plugin }) => {\n return this.removeItemFor(name, plugin)\n }),\n Main.onDidActivatePlugin(({ name, plugin }) => {\n return this.activateItem(name, plugin)\n }),\n Main.onDidDeactivatePlugin(({ name, plugin }) => {\n return this.deactivateItem(name, plugin)\n }),\n\n atom.commands.add('minimap-quick-settings', {\n 'core:move-up': () => {\n this.selectPreviousItem()\n },\n 'core:move-down': () => {\n this.selectNextItem()\n },\n 'core:move-left': () => {\n atom.config.set('minimap.displayMinimapOnLeft', true)\n },\n 'core:move-right': () => {\n atom.config.set('minimap.displayMinimapOnLeft', false)\n },\n 'core:cancel': () => {\n this.destroy()\n },\n 'core:confirm': () => {\n this.toggleSelectedItem()\n }\n }),\n\n this.subscribeTo(this.codeHighlights, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayCodeHighlights', !this.minimap.displayCodeHighlights)\n }\n }),\n\n this.subscribeTo(this.absoluteMode, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.absoluteMode', !atom.config.get('minimap.absoluteMode'))\n }\n }),\n\n this.subscribeTo(this.adjustAbsoluteModeHeight, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.adjustAbsoluteModeHeight', !atom.config.get('minimap.adjustAbsoluteModeHeight'))\n }\n }),\n\n this.subscribeTo(this.hiddenInput, {\n focusout: (e) => { this.destroy() }\n },\n { passive: true }\n ),\n\n this.subscribeTo(this.onLeftButton, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayMinimapOnLeft', true)\n }\n }),\n\n this.subscribeTo(this.onRightButton, {\n mousedown: (e) => {\n e.preventDefault()\n atom.config.set('minimap.displayMinimapOnLeft', false)\n }\n }),\n\n atom.config.observe('minimap.displayCodeHighlights', (bool) => {\n this.codeHighlights.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.absoluteMode', (bool) => {\n this.absoluteMode.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.adjustAbsoluteModeHeight', (bool) => {\n this.adjustAbsoluteModeHeight.classList.toggle('active', bool)\n }),\n\n atom.config.observe('minimap.displayMinimapOnLeft', (bool) => {\n this.onLeftButton.classList.toggle('selected', bool)\n this.onRightButton.classList.toggle('selected', !bool)\n })\n )\n\n this.initList()\n }\n\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n attach () {\n const workspaceElement = atom.views.getView(atom.workspace)\n workspaceElement.appendChild(this)\n this.hiddenInput.focus()\n }\n\n destroy () {\n this.emitter.emit('did-destroy')\n this.subscriptions.dispose()\n this.parentNode.removeChild(this)\n }\n\n initList () {\n this.itemsDisposables = new WeakMap()\n for (const name in Main.plugins) {\n this.addItemFor(name, Main.plugins[name])\n }\n }\n\n toggleSelectedItem () {\n const fn = this.itemsActions.get(this.selectedItem)\n if (typeof fn === 'function') { fn() }\n }\n\n selectNextItem () {\n this.selectedItem.classList.remove('selected')\n if ((this.selectedItem.nextSibling != null)) {\n this.selectedItem = this.selectedItem.nextSibling\n if (this.selectedItem.matches('.separator')) {\n this.selectedItem = this.selectedItem.nextSibling\n }\n } else {\n this.selectedItem = this.list.firstChild\n }\n this.selectedItem.classList.add('selected')\n }\n\n selectPreviousItem () {\n this.selectedItem.classList.remove('selected')\n if ((this.selectedItem.previousSibling != null)) {\n this.selectedItem = this.selectedItem.previousSibling\n if (this.selectedItem.matches('.separator')) {\n this.selectedItem = this.selectedItem.previousSibling\n }\n } else {\n this.selectedItem = this.list.lastChild\n }\n this.selectedItem.classList.add('selected')\n }\n\n addItemFor (name, plugin) {\n const item = document.createElement('li')\n const action = () => { Main.togglePluginActivation(name) }\n\n if (plugin.isActive()) { item.classList.add('active') }\n\n item.textContent = name\n\n this.itemsActions.set(item, action)\n this.itemsDisposables.set(item, this.addDisposableEventListener(item, 'mousedown', (e) => {\n e.preventDefault()\n action()\n }))\n\n this.plugins[name] = item\n this.list.insertBefore(item, this.separator)\n\n if (!(this.selectedItem != null)) {\n this.selectedItem = item\n this.selectedItem.classList.add('selected')\n }\n }\n\n removeItemFor (name, plugin) {\n try {\n this.list.removeChild(this.plugins[name])\n } catch (error) {}\n\n delete this.plugins[name]\n }\n\n activateItem (name, plugin) {\n this.plugins[name].classList.add('active')\n }\n\n deactivateItem (name, plugin) {\n this.plugins[name].classList.remove('active')\n }\n}\n\nconst minimapQuickSettingsElement = MinimapQuickSettingsElement.initClass()\nexport default minimapQuickSettingsElement\n","'use strict'\n\n/**\n * @access private\n */\nexport default class LegacyAdapter {\n constructor (textEditor) { this.textEditor = textEditor }\n\n enableCache () { this.useCache = true }\n\n clearCache () {\n this.useCache = false\n delete this.heightCache\n delete this.scrollTopCache\n delete this.scrollLeftCache\n delete this.maxScrollTopCache\n }\n\n onDidChangeScrollTop (callback) {\n return this.textEditor.onDidChangeScrollTop(callback)\n }\n\n onDidChangeScrollLeft (callback) {\n return this.textEditor.onDidChangeScrollLeft(callback)\n }\n\n getHeight () {\n if (this.useCache) {\n if (!this.heightCache) {\n this.heightCache = this.textEditor.getHeight()\n }\n return this.heightCache\n }\n return this.textEditor.getHeight()\n }\n\n getScrollTop () {\n if (this.useCache) {\n if (!this.scrollTopCache) {\n this.scrollTopCache = this.textEditor.getScrollTop()\n }\n return this.scrollTopCache\n }\n return this.textEditor.getScrollTop()\n }\n\n setScrollTop (scrollTop) {\n return this.textEditor.setScrollTop(scrollTop)\n }\n\n getScrollLeft () {\n if (this.useCache) {\n if (!this.scrollLeftCache) {\n this.scrollLeftCache = this.textEditor.getScrollLeft()\n }\n return this.scrollLeftCache\n }\n\n return this.textEditor.getScrollLeft()\n }\n\n getMaxScrollTop () {\n if (this.maxScrollTopCache != null && this.useCache) {\n return this.maxScrollTopCache\n }\n let maxScrollTop = this.textEditor.displayBuffer.getMaxScrollTop()\n const lineHeight = this.textEditor.getLineHeightInPixels()\n\n if (this.scrollPastEnd) {\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n if (this.useCache) { this.maxScrollTopCache = maxScrollTop }\n return maxScrollTop\n }\n\n editorDestroyed () {\n return !this.textEditor || this.textEditor.isDestroyed()\n }\n}\n","'use strict'\n\n/**\n * @access private\n */\nexport default class StableAdapter {\n constructor (textEditor) {\n this.textEditor = textEditor\n this.textEditorElement = atom.views.getView(this.textEditor)\n }\n\n enableCache () { this.useCache = true }\n\n clearCache () {\n this.useCache = false\n delete this.heightCache\n delete this.scrollTopCache\n delete this.scrollLeftCache\n delete this.maxScrollTopCache\n }\n\n onDidChangeScrollTop (callback) {\n return this.textEditorElement.onDidChangeScrollTop(callback)\n }\n\n onDidChangeScrollLeft (callback) {\n return this.textEditorElement.onDidChangeScrollLeft(callback)\n }\n\n getHeight () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.heightCache) {\n this.heightCache = this.textEditorElement.getHeight()\n }\n return this.heightCache\n }\n return this.textEditorElement.getHeight()\n }\n\n getScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.scrollTopCache) {\n this.scrollTopCache = this.computeScrollTop()\n }\n return this.scrollTopCache\n }\n return this.computeScrollTop()\n }\n\n computeScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n const scrollTop = this.textEditorElement.getScrollTop()\n const lineHeight = this.textEditor.getLineHeightInPixels()\n let firstRow = this.textEditorElement.getFirstVisibleScreenRow()\n\n if (Number.isNaN(firstRow)) {\n // Guard against their being no visible screen row\n return 0\n }\n\n let lineTop = this.textEditorElement.pixelPositionForScreenPosition([firstRow, 0]).top\n\n if (lineTop > scrollTop) {\n firstRow -= 1\n lineTop = this.textEditorElement.pixelPositionForScreenPosition([firstRow, 0]).top\n }\n\n const lineY = firstRow * lineHeight\n const offset = Math.min(scrollTop - lineTop, lineHeight)\n return lineY + offset\n }\n\n setScrollTop (scrollTop) {\n if (this.editorDestroyed()) { return }\n\n this.textEditorElement.setScrollTop(scrollTop)\n }\n\n getScrollLeft () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.useCache) {\n if (!this.scrollLeftCache) {\n this.scrollLeftCache = this.textEditorElement.getScrollLeft()\n }\n return this.scrollLeftCache\n }\n return this.textEditorElement.getScrollLeft()\n }\n\n getMaxScrollTop () {\n if (this.editorDestroyed()) { return 0 }\n\n if (this.maxScrollTopCache != null && this.useCache) {\n return this.maxScrollTopCache\n }\n\n let maxScrollTop\n if (this.textEditorElement.getMaxScrollTop) {\n maxScrollTop = this.textEditorElement.getMaxScrollTop()\n\n if (parseFloat(atom.getVersion()) >= 1.13) {\n if (this.scrollPastEnd) {\n const lineHeight = this.textEditor.getLineHeightInPixels()\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n }\n } else {\n maxScrollTop = this.textEditorElement.getScrollHeight() - this.getHeight()\n\n if (this.scrollPastEnd) {\n const lineHeight = this.textEditor.getLineHeightInPixels()\n maxScrollTop -= this.getHeight() - 3 * lineHeight\n }\n }\n\n if (this.useCache) {\n this.maxScrollTopCache = maxScrollTop\n }\n\n return maxScrollTop\n }\n\n editorDestroyed () {\n return !this.textEditor ||\n this.textEditor.isDestroyed() ||\n !this.textEditorElement.component ||\n !this.textEditorElement.getModel() ||\n !this.textEditorElement.parentNode\n }\n}\n","'use strict'\n\nimport { Emitter, CompositeDisposable } from 'atom'\nimport StableAdapter from './adapters/stable-adapter'\nimport { editorsMinimaps } from './main'\n\nlet nextModelId = 1\n\n/**\n * The Minimap class is the underlying model of a .\n * Most manipulations of the minimap is done through the model.\n *\n * Any Minimap instance is tied to a `TextEditor`.\n * Their lifecycle follow the one of their target `TextEditor`, so they are\n * destroyed whenever their `TextEditor` is destroyed.\n */\nexport default class Minimap {\n /**\n * Creates a new Minimap instance for the given `TextEditor`.\n *\n * @param {Object} options an object with the new Minimap properties\n * @param {TextEditor} options.textEditor the target text editor for\n * the minimap\n * @param {boolean} [options.standAlone] whether this minimap is in\n * stand-alone mode or not\n * @param {number} [options.width] the minimap width in pixels\n * @param {number} [options.height] the minimap height in pixels\n * @throws {Error} Cannot create a minimap without an editor\n */\n constructor (options = {}) {\n if (!options.textEditor) {\n throw new Error('Cannot create a minimap without an editor')\n }\n\n /**\n * The Minimap's minimapElement.\n *\n * @type {MinimapElement}\n * @access private\n */\n this.minimapElement = undefined\n\n // local cache of this.minimapElement.DecorationManagement\n this.DecorationManagement = undefined\n\n /**\n * The Minimap's text editor.\n *\n * @type {TextEditor}\n * @access private\n */\n this.textEditor = options.textEditor\n\n /**\n * The Minimap's text editor element.\n * @access private\n */\n this.editorElement = undefined\n\n /**\n * The stand-alone state of the current Minimap.\n *\n * @type {boolean}\n * @access private\n */\n this.standAlone = options.standAlone\n /**\n * The width of the current Minimap.\n *\n * @type {number}\n * @access private\n */\n this.width = options.width\n /**\n * The height of the current Minimap.\n *\n * @type {number}\n * @access private\n */\n this.height = options.height\n /**\n * The id of the current Minimap.\n *\n * @type {Number}\n * @access private\n */\n this.id = nextModelId++\n /**\n * The events emitter of the current Minimap.\n *\n * @type {Emitter}\n * @access private\n */\n this.emitter = new Emitter()\n /**\n * The Minimap's subscriptions.\n *\n * @type {CompositeDisposable}\n * @access private\n */\n this.subscriptions = new CompositeDisposable()\n /**\n * The adapter object leverage the access to several properties from\n * the `TextEditor`/`TextEditorElement` to support the different APIs\n * between different version of Atom.\n *\n * @type {Object}\n * @access private\n */\n this.adapter = null\n /**\n * The char height of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.charHeight = null\n /**\n * The char height from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configCharHeight = null\n /**\n * The char width of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.charWidth = null\n /**\n * The char width from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configCharWidth = null\n /**\n * The interline of the current Minimap, will be `undefined` unless\n * `setCharWidth` is called.\n *\n * @type {number}\n * @access private\n */\n this.interline = null\n /**\n * The interline from the package's configuration. Will be overriden\n * by the instance value.\n *\n * @type {number}\n * @access private\n */\n this.configInterline = null\n /**\n * The devicePixelRatioRounding of the current Minimap, will be\n * `undefined` unless `setDevicePixelRatioRounding` is called.\n *\n * @type {boolean}\n * @access private\n */\n this.devicePixelRatioRounding = null\n /**\n * The devicePixelRatioRounding from the package's configuration.\n * Will be overriden by the instance value.\n *\n * @type {boolean}\n * @access private\n */\n this.configDevicePixelRatioRounding = null\n /**\n * A number of milliseconds which determines how often the minimap should redraw itself after\n * detecting changes in the text editor. A value of 0 will cause the minimap to redraw\n * immediately.\n *\n * @type {number}\n * @access private\n */\n this.redrawDelay = 0\n /**\n * A boolean value to store whether this Minimap have been destroyed or not.\n *\n * @type {boolean}\n * @access private\n */\n this.destroyed = false\n /**\n * A boolean value to store whether the `scrollPastEnd` setting is enabled\n * or not.\n *\n * @type {boolean}\n * @access private\n */\n this.scrollPastEnd = false\n\n /**\n * An array of changes registered with textEditor.onDidChange() which have not yet been handled\n *\n * @type {Array}\n * @access private\n */\n this.pendingChangeEvents = []\n\n /**\n * Timer reference which, once fired, will flush all the pending changes stored in\n * this.pendingChangeEvents array.\n *\n * @type {Timer?}\n * @access private\n */\n this.flushChangesTimer = null\n\n if (atom.views.getView(this.textEditor).getScrollTop != null) {\n this.adapter = new StableAdapter(this.textEditor)\n } else {\n // TODO remove LegacyAdapter in the next major version\n atom.notifications.addWarning('LegacyAdapter of Minimap is deprecated and will be removed in the next major version. Please upgrade Atom to the latest version.')\n const LegacyAdapter = require('./adapters/legacy-adapter')\n this.adapter = new LegacyAdapter(this.textEditor)\n }\n\n /**\n * When in stand-alone or independent scrolling mode, this value can be used\n * instead of the computed scroll.\n *\n * @type {number}\n * @access private\n */\n this.scrollTop = 0\n\n let configSubscription = this.subscribeToConfig()\n\n this.subscriptions.add(\n configSubscription,\n\n this.textEditor.onDidChangeGrammar(() => {\n this.subscriptions.remove(configSubscription)\n configSubscription.dispose()\n\n configSubscription = this.subscribeToConfig()\n this.subscriptions.add(configSubscription)\n }),\n\n this.adapter.onDidChangeScrollTop(() => {\n if (!this.standAlone && !this.ignoreTextEditorScroll && !this.inChangeScrollTop) {\n this.inChangeScrollTop = true\n this.updateScrollTop()\n this.emitter.emit('did-change-scroll-top', this)\n this.inChangeScrollTop = false\n }\n\n if (this.ignoreTextEditorScroll) {\n this.ignoreTextEditorScroll = false\n }\n }),\n\n this.adapter.onDidChangeScrollLeft(() => {\n if (!this.standAlone) {\n this.emitter.emit('did-change-scroll-left', this)\n }\n }),\n\n this.textEditor.onDidChange((changes) => {\n this.scheduleChanges(changes)\n }),\n\n this.textEditor.onDidDestroy(() => {\n if (editorsMinimaps) {\n editorsMinimaps.delete(this.textEditor)\n }\n this.destroy()\n }),\n\n /*\n FIXME Some changes occuring during the tokenization produces\n ranges that deceive the canvas rendering by making some\n lines at the end of the buffer intact while they are in fact not,\n resulting in extra lines appearing at the end of the minimap.\n Forcing a whole repaint to fix that bug is suboptimal but works.\n */\n this.textEditor.onDidTokenize(() => {\n this.emitter.emit('did-change-config')\n })\n\n )\n }\n\n /**\n * Destroys the model.\n */\n destroy () {\n if (this.destroyed) { return }\n\n clearTimeout(this.flushChangesTimer)\n this.flushChangesTimer = null\n this.pendingChangeEvents = []\n this.subscriptions.dispose()\n this.subscriptions = null\n this.textEditor = null\n this.emitter.emit('did-destroy')\n this.emitter.dispose()\n this.destroyed = true\n }\n\n /**\n * Returns `true` when this `Minimap` has benn destroyed.\n *\n * @return {boolean} whether this Minimap has been destroyed or not\n */\n isDestroyed () { return this.destroyed }\n\n /**\n * Schedule changes from textEditor.onDidChange() to be handled at a later time\n *\n * @param {Array} changes The changes to be scheduled\n * @return void\n * @access private\n */\n scheduleChanges (changes) {\n this.pendingChangeEvents = this.pendingChangeEvents.concat(changes)\n\n // Optimisation: If the redraw delay is set to 0, do not even schedule a timer\n if (!this.redrawDelay) {\n this.requestFlushChanges()\n }\n\n if (!this.flushChangesTimer) {\n // If any changes happened within the timeout's delay, a timeout will already have been\n // scheduled -> no need to schedule again\n this.flushChangesTimer = setTimeout(() => { this.requestFlushChanges() }, this.redrawDelay)\n }\n }\n\n /**\n * Flush all changes which have been scheduled for later processing by this.scheduleChanges()\n *\n * @return void\n * @access private\n */\n flushChanges () {\n clearTimeout(this.flushChangesTimer)\n this.flushChangesTimer = null\n this.emitChanges(this.pendingChangeEvents)\n this.pendingChangeEvents = []\n }\n\n /**\n * Requests flush changes if not already requested\n *\n * @return void\n * @access private\n */\n requestFlushChanges () {\n if (!this.requestedFlushChanges) {\n this.requestedFlushChanges = requestAnimationFrame(() => {\n this.flushChanges()\n if (this.requestedFlushChanges) {\n cancelAnimationFrame(this.requestedFlushChanges)\n this.requestedFlushChanges = null\n }\n })\n }\n }\n\n /**\n * Registers an event listener to the `did-change` event.\n *\n * @param {function(event:Object):void} callback a function to call when the\n * event is triggered.\n * the callback will be called\n * with an event object with\n * the following properties:\n * - start: The change's start row number\n * - end: The change's end row number\n * - screenDelta: the delta in buffer rows between the versions before and\n * after the change\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChange (callback) {\n return this.emitter.on('did-change', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-config` event.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeConfig (callback) {\n return this.emitter.on('did-change-config', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-scroll-top` event.\n *\n * The event is dispatched when the text editor `scrollTop` value have been\n * changed or when the minimap scroll top have been changed in stand-alone\n * mode.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeScrollTop (callback) {\n return this.emitter.on('did-change-scroll-top', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-scroll-left` event.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeScrollLeft (callback) {\n return this.emitter.on('did-change-scroll-left', callback)\n }\n\n /**\n * Registers an event listener to the `did-change-stand-alone` event.\n *\n * This event is dispatched when the stand-alone of the current Minimap\n * is either enabled or disabled.\n *\n * @param {function(minimap:Minimap):void} callback a function to call when\n * the event is triggered.\n * The current Minimap is\n * passed as argument to\n * the callback.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidChangeStandAlone (callback) {\n return this.emitter.on('did-change-stand-alone', callback)\n }\n\n /**\n * Registers an event listener to the `did-destroy` event.\n *\n * This event is dispatched when this Minimap have been destroyed. It can\n * occurs either because the {@link destroy} method have been called on the\n * Minimap or because the target text editor have been destroyed.\n *\n * @param {function():void} callback a function to call when the event\n * is triggered.\n * @return {Disposable} a disposable to stop listening to the event\n */\n onDidDestroy (callback) {\n return this.emitter.on('did-destroy', callback)\n }\n\n /**\n * Registers to the config changes for the current editor scope.\n *\n * @return {Disposable} the disposable to dispose all the registered events\n * @access private\n */\n subscribeToConfig () {\n const subs = new CompositeDisposable()\n const opts = { scope: this.textEditor.getRootScopeDescriptor() }\n\n subs.add(\n atom.config.observe('editor.scrollPastEnd', opts, (scrollPastEnd) => {\n this.scrollPastEnd = scrollPastEnd\n this.adapter.scrollPastEnd = this.scrollPastEnd\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.charHeight', opts, (configCharHeight) => {\n this.configCharHeight = configCharHeight\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.charWidth', opts, (configCharWidth) => {\n this.configCharWidth = configCharWidth\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.interline', opts, (configInterline) => {\n this.configInterline = configInterline\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }),\n\n atom.config.observe('minimap.independentMinimapScroll', opts, (independentMinimapScroll) => {\n this.independentMinimapScroll = independentMinimapScroll\n this.updateScrollTop()\n }),\n\n atom.config.observe('minimap.scrollSensitivity', opts, (scrollSensitivity) => {\n this.scrollSensitivity = scrollSensitivity\n }),\n\n atom.config.observe('minimap.redrawDelay', opts, (redrawDelay) => {\n this.redrawDelay = redrawDelay\n }),\n // cdprr is shorthand for configDevicePixelRatioRounding\n\n atom.config.observe(\n 'minimap.devicePixelRatioRounding',\n opts,\n (cdprr) => {\n this.configDevicePixelRatioRounding = cdprr\n this.updateScrollTop()\n this.emitter.emit('did-change-config')\n }\n )\n )\n\n return subs\n }\n\n /**\n * Returns `true` when the current Minimap is a stand-alone minimap.\n *\n * @return {boolean} whether this Minimap is in stand-alone mode or not.\n */\n isStandAlone () { return this.standAlone }\n\n /**\n * Sets the stand-alone mode for this minimap.\n *\n * @param {boolean} standAlone the new state of the stand-alone mode for this\n * Minimap\n * @emits {did-change-stand-alone} if the stand-alone mode have been toggled\n * on or off by the call\n */\n setStandAlone (standAlone) {\n if (standAlone !== this.standAlone) {\n this.standAlone = standAlone\n this.emitter.emit('did-change-stand-alone', this)\n }\n }\n\n /**\n * @return {MinimapElement} returns the current minimapElement\n */\n getMinimapElement () {\n return this.minimapElement\n }\n\n /**\n * Returns the `TextEditor` that this minimap represents.\n *\n * @return {TextEditor} this Minimap's text editor\n */\n getTextEditor () { return this.textEditor }\n\n /**\n * Returns the `TextEditorElement` for the Minimap's `TextEditor`.\n *\n * @return {TextEditorElement} the minimap's text editor element\n */\n getTextEditorElement () {\n if (this.editorElement) { return this.editorElement }\n\n this.editorElement = atom.views.getView(this.getTextEditor())\n return this.editorElement\n }\n\n /**\n * Returns the height of the `TextEditor` at the Minimap scale.\n *\n * @return {number} the scaled height of the text editor\n */\n getTextEditorScaledHeight () {\n return this.adapter.getHeight() * this.getVerticalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` scroll top value at the Minimap scale.\n *\n * @return {number} the scaled scroll top of the text editor\n */\n getTextEditorScaledScrollTop () {\n return this.adapter.getScrollTop() * this.getVerticalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` scroll left value at the Minimap scale.\n *\n * @return {number} the scaled scroll left of the text editor\n */\n getTextEditorScaledScrollLeft () {\n return this.adapter.getScrollLeft() * this.getHorizontalScaleFactor()\n }\n\n /**\n * Returns the `TextEditor` maximum scroll top value.\n *\n * When the `scrollPastEnd` setting is enabled, the method compensate the\n * extra scroll by removing the same height as added by the editor from the\n * final value.\n *\n * @return {number} the maximum scroll top of the text editor\n */\n getTextEditorMaxScrollTop () { return this.adapter.getMaxScrollTop() }\n\n /**\n * Returns the `TextEditor` scroll top value.\n *\n * @return {number} the scroll top of the text editor\n */\n getTextEditorScrollTop () { return this.adapter.getScrollTop() }\n\n /**\n * Sets the scroll top of the `TextEditor`.\n *\n * @param {number} scrollTop the new scroll top value\n */\n setTextEditorScrollTop (scrollTop, ignoreTextEditorScroll = false) {\n this.ignoreTextEditorScroll = ignoreTextEditorScroll\n this.adapter.setScrollTop(scrollTop)\n }\n\n /**\n * Returns the `TextEditor` scroll left value.\n *\n * @return {number} the scroll left of the text editor\n */\n getTextEditorScrollLeft () { return this.adapter.getScrollLeft() }\n\n /**\n * Returns the height of the `TextEditor`.\n *\n * @return {number} the height of the text editor\n */\n getTextEditorHeight () { return this.adapter.getHeight() }\n\n /**\n * Returns the `TextEditor` scroll as a value normalized between `0` and `1`.\n *\n * When the `scrollPastEnd` setting is enabled the value may exceed `1` as the\n * maximum scroll value used to compute this ratio compensate for the extra\n * height in the editor. **Use {@link getCapedTextEditorScrollRatio} when\n * you need a value that is strictly between `0` and `1`.**\n *\n * @return {number} the scroll ratio of the text editor\n */\n getTextEditorScrollRatio () {\n return this.adapter.getScrollTop() / (this.getTextEditorMaxScrollTop() || 1)\n }\n\n /**\n * Returns the `TextEditor` scroll as a value normalized between `0` and `1`.\n *\n * The returned value will always be strictly between `0` and `1`.\n *\n * @return {number} the scroll ratio of the text editor strictly between\n * 0 and 1\n */\n getCapedTextEditorScrollRatio () {\n return Math.min(1, this.getTextEditorScrollRatio())\n }\n\n /**\n * Returns the height of the whole minimap in pixels based on the `minimap`\n * settings.\n *\n * @return {number} the height of the minimap\n */\n getHeight () {\n return this.textEditor.getScreenLineCount() * this.getLineHeight()\n }\n\n /**\n * Returns the width of the whole minimap in pixels based on the `minimap`\n * settings.\n *\n * @return {number} the width of the minimap\n */\n getWidth () {\n return this.textEditor.getMaxScreenLineLength() * this.getCharWidth()\n }\n\n /**\n * Returns the height the Minimap content will take on screen.\n *\n * When the Minimap height is greater than the `TextEditor` height, the\n * `TextEditor` height is returned instead.\n *\n * @return {number} the visible height of the Minimap\n */\n getVisibleHeight () {\n return Math.min(this.getScreenHeight(), this.getHeight())\n }\n\n /**\n * Returns the height the minimap should take once displayed, it's either\n * the height of the `TextEditor` or the provided `height` when in stand-alone\n * mode.\n *\n * @return {number} the total height of the Minimap\n */\n getScreenHeight () {\n if (this.isStandAlone()) {\n if (this.height != null) {\n return this.height\n } else {\n return this.getHeight()\n }\n } else {\n return this.adapter.getHeight()\n }\n }\n\n /**\n * Returns the width the whole Minimap will take on screen.\n *\n * @return {number} the width of the Minimap when displayed\n */\n getVisibleWidth () {\n return Math.min(this.getScreenWidth(), this.getWidth())\n }\n\n /**\n * Returns the width the Minimap should take once displayed, it's either the\n * width of the Minimap content or the provided `width` when in standAlone\n * mode.\n *\n * @return {number} the Minimap screen width\n */\n getScreenWidth () {\n if (this.isStandAlone() && this.width != null) {\n return this.width\n } else {\n return this.getWidth()\n }\n }\n\n /**\n * Sets the preferred height and width when in stand-alone mode.\n *\n * This method is called by the for this Minimap so that\n * the model is kept in sync with the view.\n *\n * @param {number} height the new height of the Minimap\n * @param {number} width the new width of the Minimap\n */\n setScreenHeightAndWidth (height, width) {\n if (this.width !== width || this.height !== height) {\n this.height = height\n this.width = width\n this.updateScrollTop()\n }\n }\n\n /**\n * Returns the vertical scaling factor when converting coordinates from the\n * `TextEditor` to the Minimap.\n *\n * @return {number} the Minimap vertical scaling factor\n */\n getVerticalScaleFactor () {\n return this.getLineHeight() / this.textEditor.getLineHeightInPixels()\n }\n\n /**\n * Returns the horizontal scaling factor when converting coordinates from the\n * `TextEditor` to the Minimap.\n *\n * @return {number} the Minimap horizontal scaling factor\n */\n getHorizontalScaleFactor () {\n return this.getCharWidth() / this.textEditor.getDefaultCharWidth()\n }\n\n /**\n * Returns the height of a line in the Minimap in pixels.\n *\n * @return {number} a line's height in the Minimap\n */\n getLineHeight () { return this.getCharHeight() + this.getInterline() }\n\n /**\n * Returns the width of a character in the Minimap in pixels.\n *\n * @return {number} a character's width in the Minimap\n */\n getCharWidth () {\n if (this.charWidth != null) {\n return this.charWidth\n } else {\n return this.configCharWidth\n }\n }\n\n /**\n * Sets the char width for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} charWidth the new width of a char in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setCharWidth (charWidth) {\n this.charWidth = Math.floor(charWidth)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the height of a character in the Minimap in pixels.\n *\n * @return {number} a character's height in the Minimap\n */\n getCharHeight () {\n if (this.charHeight != null) {\n return this.charHeight\n } else {\n return this.configCharHeight\n }\n }\n\n /**\n * Sets the char height for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} charHeight the new height of a char in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setCharHeight (charHeight) {\n this.charHeight = Math.floor(charHeight)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the height of an interline in the Minimap in pixels.\n *\n * @return {number} the interline's height in the Minimap\n */\n getInterline () {\n if (this.interline != null) {\n return this.interline\n } else {\n return this.configInterline\n }\n }\n\n /**\n * Sets the interline height for this Minimap. This value will override the\n * value from the config for this instance only. A `did-change-config`\n * event is dispatched.\n *\n * @param {number} interline the new height of an interline in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setInterline (interline) {\n this.interline = Math.floor(interline)\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the status of devicePixelRatioRounding in the Minimap.\n *\n * @return {boolean} the devicePixelRatioRounding status in the Minimap\n */\n getDevicePixelRatioRounding () {\n if (this.devicePixelRatioRounding != null) {\n return this.devicePixelRatioRounding\n } else {\n return this.configDevicePixelRatioRounding\n }\n }\n\n /**\n * Sets the devicePixelRatioRounding status for this Minimap.\n * This value will override the value from the config for this instance only.\n * A `did-change-config` event is dispatched.\n *\n * @param {boolean} devicePixelRatioRounding the new status of\n * devicePixelRatioRounding\n * in the Minimap\n * @emits {did-change-config} when the value is changed\n */\n setDevicePixelRatioRounding (devicePixelRatioRounding) {\n this.devicePixelRatioRounding = devicePixelRatioRounding\n this.emitter.emit('did-change-config')\n }\n\n /**\n * Returns the devicePixelRatio in the Minimap in pixels.\n *\n * @return {number} the devicePixelRatio in the Minimap\n */\n getDevicePixelRatio () {\n return this.getDevicePixelRatioRounding()\n ? Math.floor(devicePixelRatio)\n : devicePixelRatio\n }\n\n /**\n * Returns the index of the first visible row in the Minimap.\n *\n * @return {number} the index of the first visible row\n */\n getFirstVisibleScreenRow () {\n return Math.floor(this.getScrollTop() / this.getLineHeight())\n }\n\n /**\n * Returns the index of the last visible row in the Minimap.\n *\n * @return {number} the index of the last visible row\n */\n getLastVisibleScreenRow () {\n return Math.ceil(\n (this.getScrollTop() + this.getScreenHeight()) / this.getLineHeight()\n )\n }\n\n /**\n * Returns true when the `independentMinimapScroll` setting have been enabled.\n *\n * @return {boolean} whether the minimap can scroll independently\n */\n scrollIndependentlyOnMouseWheel () { return this.independentMinimapScroll }\n\n /**\n * Returns the current scroll of the Minimap.\n *\n * The Minimap can scroll only when its height is greater that the height\n * of its `TextEditor`.\n *\n * @return {number} the scroll top of the Minimap\n */\n getScrollTop () {\n return this.standAlone || this.independentMinimapScroll\n ? this.scrollTop\n : this.getScrollTopFromEditor()\n }\n\n /**\n * Sets the minimap scroll top value when in stand-alone mode.\n *\n * @param {number} scrollTop the new scroll top for the Minimap\n * @emits {did-change-scroll-top} if the Minimap's stand-alone mode is enabled\n */\n setScrollTop (scrollTop) {\n this.scrollTop = Math.max(0, Math.min(this.getMaxScrollTop(), scrollTop))\n\n if (this.standAlone || this.independentMinimapScroll) {\n this.emitter.emit('did-change-scroll-top', this)\n }\n }\n\n /**\n * Returns the minimap scroll as a ration between 0 and 1.\n *\n * @return {number} the minimap scroll ratio\n */\n getScrollRatio () {\n return this.getScrollTop() / this.getMaxScrollTop()\n }\n\n /**\n * Updates the scroll top value with the one computed from the text editor\n * when the minimap is in the independent scrolling mode.\n *\n * @access private\n */\n updateScrollTop () {\n if (this.independentMinimapScroll) {\n try {\n this.setScrollTop(this.getScrollTopFromEditor())\n } catch (err) {\n\n }\n this.emitter.emit('did-change-scroll-top', this)\n }\n }\n\n /**\n * Returns the scroll top as computed from the text editor scroll top.\n *\n * @return {number} the computed scroll top value\n */\n getScrollTopFromEditor () {\n return Math.abs(\n this.getCapedTextEditorScrollRatio() * this.getMaxScrollTop()\n )\n }\n\n /**\n * Returns the maximum scroll value of the Minimap.\n *\n * @return {number} the maximum scroll top for the Minimap\n */\n getMaxScrollTop () {\n return Math.max(0, this.getHeight() - this.getScreenHeight())\n }\n\n /**\n * Returns `true` when the Minimap can scroll.\n *\n * @return {boolean} whether this Minimap can scroll or not\n */\n canScroll () { return this.getMaxScrollTop() > 0 }\n\n /**\n * Updates the minimap scroll top value using a mouse event when the\n * independent scrolling mode is enabled\n *\n * @param {MouseEvent} event the mouse wheel event\n * @access private\n */\n onMouseWheel (event) {\n if (this.scrollIndependentlyOnMouseWheel()) {\n event.stopPropagation()\n\n if (!this.canScroll()) { return }\n\n const { wheelDeltaY } = event\n const previousScrollTop = this.getScrollTop()\n const updatedScrollTop = previousScrollTop - Math.round(wheelDeltaY * this.scrollSensitivity)\n\n event.preventDefault()\n this.setScrollTop(updatedScrollTop)\n }\n }\n\n /**\n * Delegates to `TextEditor#getMarker`.\n *\n * @access private\n */\n getMarker (id) { return this.textEditor.getMarker(id) }\n\n /**\n * Delegates to `TextEditor#findMarkers`.\n *\n * @access private\n */\n findMarkers (o) {\n try {\n return this.textEditor.findMarkers(o)\n } catch (error) {\n return []\n }\n }\n\n /**\n * Delegates to `TextEditor#markBufferRange`.\n *\n * @access private\n */\n markBufferRange (range) { return this.textEditor.markBufferRange(range) }\n\n /**\n * Emits a change events with the passed-in changes as data.\n *\n * @param {Object} changes a change to dispatch\n * @access private\n */\n emitChanges (changes) { this.emitter.emit('did-change', changes) }\n\n /**\n * Enables the cache at the adapter level to avoid consecutive access to the\n * text editor API during a render phase.\n *\n * @access private\n */\n enableCache () { this.adapter.enableCache() }\n\n /**\n * Disable the adapter cache.\n *\n * @access private\n */\n clearCache () { this.adapter.clearCache() }\n\n editorDestroyed () { this.adapter.editorDestroyed() }\n\n /**\n * get the DecorationManagement API for the current minimapElement\n * @return {DecorationManagement}\n */\n getDecorationManagement () {\n if (this.DecorationManagement === undefined) {\n this.DecorationManagement = this.minimapElement.DecorationManagement\n }\n return this.DecorationManagement\n }\n\n // Decoration API duplicated for backward compatibility in the service\n getDecorations () { return this.getDecorationManagement().getDecorations() }\n onDidAddDecoration (...args) { return this.getDecorationManagement().onDidAddDecoration(...args) }\n onDidRemoveDecoration (...args) { return this.getDecorationManagement().onDidRemoveDecoration(...args) }\n onDidChangeDecorationRange (...args) { return this.getDecorationManagement().onDidChangeDecorationRange(...args) }\n onDidUpdateDecoration (...args) { return this.getDecorationManagement().onDidUpdateDecoration(...args) }\n decorationForId (...args) { return this.getDecorationManagement().decorationForId(...args) }\n decorationsForScreenRowRange (...args) { return this.getDecorationManagement().decorationsForScreenRowRange(...args) }\n decorationsByTypeThenRows () { return this.getDecorationManagement().decorationsByTypeThenRows() }\n decorateMarker (...args) { return this.getDecorationManagement().decorateMarker(...args) }\n removeDecoration (...args) { return this.getDecorationManagement().removeDecoration(...args) }\n removeAllDecorationsForMarker (...args) { return this.getDecorationManagement().removeAllDecorationsForMarker(...args) }\n removeAllDecorations () { return this.getDecorationManagement().removeAllDecorations() }\n}\n"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","assertDisposable","disposable","Disposable","require$$0","isDisposable","Batch","batch","size","topLevel","bottomLevel","[object Object]","level","fn","push","fns","initState","element","prop","getState","cleanState","isCollection","obj","Array","isArray","undefined","toArray","collection","array","forEach","isElement","nodeType","getOption","options","name","defaultValue","value","escapeRegExp","string","replace","regexEscape","dasherize","toLowerCase","slice","regexDaherize","m","letter","getOriginatorPackageName","filePath","Error","stack","split","re","RegExp","atom","packages","getPackageDirPaths","join","path","sep","plugin","indexOf","computeRangesDiffs","oldStart","oldEnd","newStart","newEnd","diffs","isLessThan","updateTokensLayer","tokensLayer","firstRow","lastRow","offscreenFirstRow","offscreenLastRow","pendingChanges","lineHeight","charHeight","charWidth","canvasWidth","editor","editorScreenLineCount","invisibleRegExp","getTokenColorClosure","ignoreWhitespacesInTokens","maxTokensInOneLine","intactRanges","computeIntactRanges","context","clearCanvas","drawLines","j","len","intact","copyPartFromOffscreen","offscreenRow","start","end","currentRow","range","resetOffscreenSize","copyToOffscreen","updateBackDecorationsLayer","backLayer","pendingBackDecorationChanges","renderData","editorElement","decorations","drawBackDecorationsForLines","updateFrontDecorationsLayer","frontLayer","pendingFrontDecorationChanges","drawFrontDecorationsForLines","drawToken","text","color","x","y","fillStyle","fillRect","chars","offsetRow","lastLine","Math","min","line","editorTokensForScreenRow","tokensForScreenRow","numTokenToRender","iToken","token","tokenText","tokenScopes","scopes","clearRect","whitespaceTokenRegex","test","fill","getInvisibleRegExp","invisibles","getInvisibles","regexp","cr","eol","space","tab","filter","s","map","drawLineDecoration","decoration","data","decorationColor","yRow","drawGutterDecoration","drawHighlightDecoration","screenRow","getMarker","getScreenRange","rowSpan","row","column","drawHighlightOutlineDecoration","bottomWidth","colSpan","width","xBottomStart","xEnd","xStart","yStart","yEnd","max","drawCustomDecoration","renderRoutine","getProperties","render","drawDecorations","types","decorationsToRender","concat","sort","a","b","orders","properties","decorationDrawer","type","SPEC_MODE","functionName","pop","thisSpec","getDecorationColor","frontDecorationDispatcher","backgroundDecorationDispatcher","getDefaultColor","textOpacity","transparentize","domStylesReader","retrieveStyleFromDom","getTokenColor","opacity","scope","scopeString","changes","change","newIntactRanges","intactLen","screenDelta","bufferDelta","truncateIntactRanges","splice","include","cls","mixins","mixin","includeMixin","source","getOwnPropertyNames","k","getOwnPropertyDescriptor","elementName","registerOrUpdateElement","class","ensureOverlayStyle","overlayStyle","document","createElement","setAttribute","head","appendChild","removeOverlayStyle","parentNode","removeChild","updateOverlayStyle","basis","textContent","extractMouseEventData","mouseEvent","pageX","pageY","isLeftMouse","button","isMiddleMouse","extractTouchEventData","touchEvent","touch","changedTouches","applyStyles","styles","cssText","property","style","makeTranslate","useHardwareAcceleration","makeScale","animate","from","to","duration","step","getTime","progress","update","passed","delta","swing","requestAnimationFrame","cos","PI","Date","registerPlugin","plugins","pluginsSubscriptions","CompositeDisposable","emitter","emit","config","get","registerPluginControls","updatesPluginActivationState","unregisterPlugin","unregisterPluginControls","togglePluginActivation","boolean","settingsKey","set","deactivateAllPlugins","eachPlugin","deactivatePlugin","pluginActive","isActive","settingActive","activatePlugin","event","orderSettingsKey","getConfigSchema","title","description","default","add","observe","order","updatePluginsOrderMap","commands","pluginsOrderMap","getPluginsOrder","dispose","treeSitterWarning","observeAndWarn","configName","recommendedValue","warningTitle","warningDescription","storageName","today","previousWarning","window","localStorage","getItem","previousWarningDay","parse","getDay","setItem","notification","notifications","addWarning","dismissable","buttons","dismiss","removeItem","setTimeout","reload","rotateHue","match","r","g","hue","hueRegexp","Number","rotate","isNaN","angle","clamp","num","ceil","matrix","lumR","lumG","lumB","sin","activate","active","subscriptionsOfCommands","toggle","generatePlugin","editorsMinimaps","Map","DOMStylesReader","subscriptions","minimapViewProvider","model","Minimap","MinimapElement","setModel","deactivate","PluginManagement.deactivateAllPlugins","destroy","clear","invalidateDOMStylesCache","toggled","getLoadedPackage","metadata","configSchema","minimap","wasMaximized","isMaximized","height","getSize","setSize","maximize","initSubscriptions","async","template","MinimapPluginGeneratorElement","Promise","view","attach","onDidActivate","callback","on","onDidDeactivate","onDidCreateMinimap","onDidAddPlugin","onDidRemovePlugin","onDidActivatePlugin","onDidDeactivatePlugin","onDidChangePluginOrder","minimapClass","minimapForEditorElement","minimapForEditor","getModel","textEditor","destroyed","editorSubscription","onDidDestroy","delete","standAloneMinimapForEditor","standAlone","getActiveMinimap","workspace","getActiveTextEditor","observeMinimaps","iterator","observeTextEditors","minimapElement","getMinimapElement","getElement","themes","onDidChangeActiveThemes","views","getView","requestForcedUpdate","provideMinimapServiceV1","MinimapServiceV1","module","Deprecation","message","fileName","lineNumber","this","callCount","stackCount","stacks","stackCallCounts","getFunctionNameFromCallsite","callsite","deserialize","_arg","deprecation","_i","_len","addStack","_ref","_ref1","_ref2","isToplevel","getFunctionName","isConstructor","getMethodName","getTypeName","getLocationFromCallsite","location","isNative","isEval","getEvalOrigin","getFileName","getLineNumber","getColumnNumber","getFileNameFromCallSite","getOriginName","originName","getMessage","getStacks","parsedStack","parsedStacks","parseStack","getStackCount","getCallCount","callerLocation","_base","_base1","_this","serialize","disposalAction","disposed","object","disposables","Set","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","arguments","Symbol","next","done","err","return","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","remove","Emitter","exceptionHandler","exceptionHandlers","dispatch","exceptionHandlingDispatch","simpleDispatch","handler","exception","handlersByEventName","eventName","unshift","_this2","cleanup","off","handlerToRemove","handlers","handlerIndex","handlersCopy","constructor","_this3","promises","all","then","resolve","keys","result","_arr","require$$1","require$$2","getRawStack","grim","global","__grim__","deprecations","includeDeprecatedAPIs","deprecationsByLineNumber","deprecationsByPackage","packageName","getDeprecations","console","warn","deprecationSite","error","originalStackTraceLimit","_base2","stackTraceLimit","serializedDeprecation","originalPrepareStackTrace","prepareStackTrace","captureStackTrace","callbackProperties","decorateElementClass","decorateElementPrototype","deprecate","__ATOM_UTILS_CUSTOM_ELEMENT_CLASSES__","__CUSTOM_HTML_ELEMENTS_CLASSES__","ref","apply","nodeName","elementClass","elementPrototype","klass","proto","create","HTMLElement","registerElement","ExcludedClassProperties","ExcludedPrototypeProperties","Mixin","extended","includeInto","extend","hasOwnProperty","included","call","Ancestors","node","selector","parents","eachParent","parent","matches","block","results","queryParentSelectorAll","listener","addEventListener","removeEventListener","DisposableEvents","NO_SELECTOR","eachPair","EventsDelegation","events","disposablesForObject","eventsForObject","eventsMap","WeakMap","disposablesMap","createEventListener","unsubscribeFrom","addDisposableEventListener","e","decorateEvent","eachSelectorFromTarget","isPropagationStopped","nodeAndItsAncestors","eachSelector","matched","targetMatch","isImmediatePropagationStopped","overriddenStop","overriddenStopImmediate","Event","stopPropagation","stopImmediatePropagation","BabelSpacePenDSL","Builder","SelfClosingTags","SpacePenDSL","Tags","Template","tag","buildContent","content","__content__","__create__","__createdCallback__","useShadowRoot","__useShadowRoot__","html","root","buildHtml","shadowRoot","createShadowRoot","innerHTML","wireOutlets","getAttribute","removeAttribute","Babel","currentBuilder","subview","tagName","args","raw","postProcessingSteps","extractOptions","openTag","attributes","closeTag","attributeName","attributePairs","attributesString","escapedString","outletName","subviewId","idCounter","id","parentView","find","replaceWith","arg","reject","failures","remains","required","solved","pkg","failHandler","promise","reason","activatePackage","activatedPackage","mainModule","fail","catch","AncestorsMethods","require$$3","require$$4","stateHandler","state","isDetectable","isBusy","busy","idHandler","getListeners","eventListeners","listeners","idCount","generate","idGenerator","quiet","noop","reporter","log","attachFunction","f","detector","isIE","version","agent","navigator","userAgent","v","div","getElementsByTagName","undef","isLegacyOpera","opera","processBatch","isProcessing","processingBatch","process","processBatchAsync","asyncFrameHandler","asyncProcess","utils","autoProcess","localAsyncProcess","clearTimeout","buildCssTextString","rules","seperator","important","trim","getObject","batchProcessor","browserDetector","mutateDom","alterPositionStyles","position","setProperty","removeRelativeStyles","getNumericalValue","positionCheckPerformed","OBJECT_STYLE","tabIndex","onload","getDocument","contentDocument","checkForObjectDocumentTimeoutId","objectDocument","getComputedStyle","offsetWidth","offsetHeight","startSize","injectObject","listenerProxy","proxy","attachEvent","defaultView","detachEvent","initDocument","targetDocument","styleId","containerClass","getElementById","containerAnimationClass","containerAnimationActiveClass","method","styleElement","injectStyle","injectScrollStyle","detectionContainerClass","addEvent","el","cb","removeEvent","getExpandElement","container","childNodes","getShrinkElement","scrollbarSizes","child","body","insertBefore","firstChild","widthSize","clientWidth","heightSize","clientHeight","getScrollbarSizes","debug","isUnrendered","getStyle","elementStyle","top","right","bottom","left","widthCSS","heightCSS","storeStyle","storeCurrentSize","lastWidth","lastHeight","getWidthOffset","getHeightOffset","getExpandWidth","getExpandHeight","positionScrollbars","expand","shrink","expandWidth","expandHeight","shrinkWidth","getShrinkWidth","shrinkHeight","getShrinkHeight","scrollLeft","scrollTop","injectContainerElement","className","addAnimationClass","onAnimationStart","onRendered","injectScrollElements","onExpandScroll","onExpand","onShrinkScroll","onShrink","rootContainer","scrollbarWidth","scrollbarHeight","containerContainerStyle","containerStyle","expandStyle","shrinkStyle","expandChildStyle","shrinkChildStyle","containerContainer","expandChild","shrinkChild","dir","registerListenersAndPositionElements","updateChildSizes","getExpandChildElement","updateDetectorElements","sizeChanged","areElementsInjected","notifyListenersIfNeeded","lastNotifiedWidth","lastNotifiedHeight","handleScroll","finalizeDomMutation","ready","install","ownerDocument","contains","isInDocument","isDetached","idGeneratorMaker","defaultIdHandler","idHandlerMaker","reporterMaker","batchProcessorMaker","globalOptions","callOnAdd","detectionStrategy","eventListenerHandler","listenerHandlerMaker","elementUtils","elementUtilsMaker","desiredStrategy","importantCssRules","strategyOptions","scrollStrategyMaker","objectStrategyMaker","onReadyCallbacks","elements","onResizeCallback","addListener","elementsReady","onReadyCallback","markBusy","makeDetectable","markAsDetectable","removeListener","removeAllListeners","uninstall","nextId","Decoration","decorationProperties","marker","setProperties","markerDestroyDisposable","screenRange","isType","newProperties","oldProperties","DecorationManagement","decorationsById","decorationsByMarkerId","decorationMarkerChangedSubscriptions","decorationMarkerDestroyedSubscriptions","decorationUpdatedSubscriptions","decorationDestroyedSubscriptions","values","startScreenRow","endScreenRow","markers","findMarkers","intersectsScreenRowRange","decorationsByTypeThenRowsCache","cache","decorationParams","has","removeAllDecorationsForMarker","onDidChange","invalidateDecorationForScreenRowsCache","emitDecorationChanges","oldTailScreenPosition","oldHeadScreenPosition","newTailScreenPosition","newHeadScreenPosition","rangesDiffs","emitRangeChanges","onDidChangeProperties","removeDecoration","editorDestroyed","lastRenderedScreenRow","getLastVisibleScreenRow","firstRenderedScreenRow","getFirstVisibleScreenRow","subscription","index","removedAllMarkerDecorations","decorationMarkerChangedSubscriptionsValues","decorationMarkerDestroyedSubscriptionsValues","decorationUpdatedSubscriptionsValues","decorationDestroyedSubscriptionsValues","decorationsByIdValues","removeAllDecorations","CanvasLayer","canvas","desynchronized","platform","getContext","webkitImageSmoothingEnabled","imageSmoothingEnabled","offscreenCanvas","offscreenContext","drawImage","srcY","destY","CanvasDrawer","devicePixelRatio","getDevicePixelRatio","getLineHeight","getCharHeight","getCharWidth","canvasHeight","getTextEditor","getTextEditorElement","displayCodeHighlights","getScreenLineCount","decorationsByTypeThenRows","Main.getPluginsOrder","drawCustomDecorationLambda","oneOrMoreWhiteSpaceRegexp","highlight-under","gutter","highlight-over","highlight-outline","MinimapQuickSettingsElement","input","outlet","ol","li","selectedItem","itemsActions","codeHighlights","classList","absoluteMode","adjustAbsoluteModeHeight","Main.onDidAddPlugin","addItemFor","Main.onDidRemovePlugin","removeItemFor","Main.onDidActivatePlugin","activateItem","Main.onDidDeactivatePlugin","deactivateItem","core:move-up","selectPreviousItem","core:move-down","selectNextItem","core:cancel","core:confirm","toggleSelectedItem","subscribeTo","mousedown","preventDefault","hiddenInput","focusout","passive","onLeftButton","onRightButton","bool","initList","focus","itemsDisposables","Main.plugins","nextSibling","list","previousSibling","lastChild","item","action","Main.togglePluginActivation","separator","minimapQuickSettingsElement","initClass","elementResizeDetector","elementResizeDetectorImport","strategy","visibleAreaSubscription","quickSettingsSubscription","dragSubscription","openQuickSettingSubscription","displayMinimapOnLeft","minimapScrollIndicator","displayPluginsControls","adjustToSoftWrap","visibleArea","controls","scrollIndicator","openQuickSettings","quickSettingsElement","attached","attachedToTextEditor","wasVisible","frameRequested","flexBasis","initializeContent","updateMinimapFlexPosition","measureHeightAndWidth","initializeScrollIndicator","disposeScrollIndicator","requestUpdate","initializeOpenQuickSettings","disposeOpenQuickSettings","smoothScrolling","adjustOnlyIfSmaller","pollDocument","pollDOM","intersectionObserver","IntersectionObserver","entries","intersectionRect","isVisible","measureDimensions","listenTo","queryParentSelector","subscribeToMediaQuery","minimaps","querySelectorAll","detach","initializeCanvas","attachCanvases","createVisibleArea","createControls","mousewheel","onMouseWheel","getFrontCanvas","canvasPressed","touchstart","startDrag","getBoundingClientRect","initializeDecorations","onDidChangeScrollTop","onDidChangeScrollLeft","onDidChangeConfig","onDidChangeStandAlone","setStandAlone","isStandAlone","onDidChangeDecorationRange","Main.onDidChangePluginOrder","setScreenHeightAndWidth","removeControls","removeVisibleArea","enableCache","visibleAreaLeft","getTextEditorScaledScrollLeft","visibleAreaTop","getTextEditorScaledScrollTop","getScrollTop","visibleWidth","round","getTextEditorScaledHeight","transform","border-left-width","canvasTop","canvasTransform","scale","canScroll","minimapScreenHeight","getScreenHeight","indicatorHeight","getHeight","indicatorScroll","getScrollRatio","updateCanvasesSize","updateCanvas","clearCache","visibilityChanged","checkForVisibilityChange","forceUpdate","safeFlexBasis","wasResized","lineLength","softWrap","softWrapAtPreferredLineLength","maxCanvasHeight","newHeight","setCanvasesSize","canvasLeftMousePressed","canvasMiddleMousePressed","deltaY","floor","textEditorElement","getLineHeightInPixels","getTextEditorHeight","textEditorScrollTop","pixelPositionForScreenPosition","setCursorScreenPosition","independentScroll","scrollIndependentlyOnMouseWheel","getTextEditorScrollTop","minimapFrom","minimapTo","getTextEditorMaxScrollTop","getMaxScrollTop","now","t","setTextEditorScrollTop","setScrollTop","offsetTop","ratio","getVisibleHeight","mediaQuery","matchMedia","mediaListener","initial","dragOffset","mousemoveHandler","drag","dragendHandler","endDrag","touchmoveHandler","LegacyAdapter","useCache","heightCache","scrollTopCache","scrollLeftCache","maxScrollTopCache","getScrollLeft","maxScrollTop","displayBuffer","scrollPastEnd","isDestroyed","StableAdapter","computeScrollTop","lineTop","parseFloat","getVersion","getScrollHeight","component","nextModelId","adapter","configCharHeight","configCharWidth","interline","configInterline","devicePixelRatioRounding","configDevicePixelRatioRounding","redrawDelay","pendingChangeEvents","flushChangesTimer","configSubscription","subscribeToConfig","onDidChangeGrammar","ignoreTextEditorScroll","inChangeScrollTop","updateScrollTop","scheduleChanges","onDidTokenize","requestFlushChanges","emitChanges","requestedFlushChanges","flushChanges","cancelAnimationFrame","subs","opts","getRootScopeDescriptor","independentMinimapScroll","scrollSensitivity","cdprr","getVerticalScaleFactor","getHorizontalScaleFactor","getTextEditorScrollRatio","getMaxScreenLineLength","getScreenWidth","getWidth","getDefaultCharWidth","getInterline","getDevicePixelRatioRounding","getScrollTopFromEditor","abs","getCapedTextEditorScrollRatio","wheelDeltaY","updatedScrollTop","o","markBufferRange","getDecorationManagement","getDecorations","onDidAddDecoration","onDidRemoveDecoration","onDidUpdateDecoration","decorationForId","decorationsForScreenRowRange","decorateMarker","domStylesCache","dummyNode","targetNode","getFromCache","cachedData","ensureDummyNodeExistence","dotRegexp","getPropertyValue","visibility","rgbExtractRegexp","PluginManagement.registerPlugin","PluginManagement.unregisterPlugin","PluginManagement.togglePluginActivation","PluginManagement.activatePlugin","PluginManagement.deactivatePlugin","PluginManagement.getPluginsOrder"],"mappings":"wYAEA,SAASA,EAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAEhH,SAASC,EAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAOD,EAAME,OAAVD,EAAkBA,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAE7S,SAASO,EAAad,EAAae,EAAYC,GAAmJ,OAAhID,GAAYb,EAAkBF,EAAYiB,UAAWF,GAAiBC,GAAad,EAAkBF,EAAagB,GAAqBhB,ECJzM,SAASF,EAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,qCAEhH,SAASC,EAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAOD,EAAME,OAAVD,EAAkBA,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAE7S,SAASO,EAAad,EAAae,EAAYC,GAAmJ,OAAhID,GAAYb,EAAkBF,EAAYiB,UAAWF,GAAiBC,GAAad,EAAkBF,EAAagB,GAAqBhB,EAqJzM,SAASkB,EAAiBC,GAKxB,GAJkB,MAAdC,KACFA,GAAaC,KAGVD,GAAWE,aAAaH,GAC3B,MAAM,IAAIlB,UAAU,sEC/JxB,SAASH,EAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAA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B,GACxB96B,qBAAsB+E,GACtBzE,eAAgBy6B,GAChB76B,iBAAkB86B,GAClB75B,gBAAiB85B"} \ No newline at end of file diff --git a/dist/main.js b/dist/main.js index 01e3709f..d3f6d1ef 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1,2 +1,2 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("atom");const e=require("./main-f082673e.js");require("path"),exports.Minimap=e.Minimap,exports.activate=e.activate,exports.activatePlugin=e.activatePlugin,exports.config=e.config,exports.deactivate=e.deactivate,exports.deactivateAllPlugins=e.deactivateAllPlugins,exports.deactivatePlugin=e.deactivatePlugin,Object.defineProperty(exports,"domStylesReader",{enumerable:!0,get:()=>e.domStylesReader}),Object.defineProperty(exports,"editorsMinimaps",{enumerable:!0,get:()=>e.editorsMinimaps}),exports.emitter=e.emitter,exports.getActiveMinimap=e.getActiveMinimap,exports.getConfigSchema=e.getConfigSchema,exports.getPluginsOrder=e.getPluginsOrder,exports.minimapClass=e.minimapClass,exports.minimapForEditor=e.minimapForEditor,exports.minimapForEditorElement=e.minimapForEditorElement,exports.minimapViewProvider=e.minimapViewProvider,exports.observeMinimaps=e.observeMinimaps,exports.onDidActivate=e.onDidActivate,exports.onDidActivatePlugin=e.onDidActivatePlugin,exports.onDidAddPlugin=e.onDidAddPlugin,exports.onDidChangePluginOrder=e.onDidChangePluginOrder,exports.onDidCreateMinimap=e.onDidCreateMinimap,exports.onDidDeactivate=e.onDidDeactivate,exports.onDidDeactivatePlugin=e.onDidDeactivatePlugin,exports.onDidRemovePlugin=e.onDidRemovePlugin,exports.plugins=e.plugins,exports.provideMinimapServiceV1=e.provideMinimapServiceV1,exports.registerPlugin=e.registerPlugin,exports.standAloneMinimapForEditor=e.standAloneMinimapForEditor,exports.toggle=e.toggle,exports.togglePluginActivation=e.togglePluginActivation,exports.unregisterPlugin=e.unregisterPlugin; +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("atom");const e=require("./main-3af7aad3.js");require("path"),exports.Minimap=e.Minimap,exports.activate=e.activate,exports.activatePlugin=e.activatePlugin,exports.config=e.config,exports.deactivate=e.deactivate,exports.deactivateAllPlugins=e.deactivateAllPlugins,exports.deactivatePlugin=e.deactivatePlugin,Object.defineProperty(exports,"domStylesReader",{enumerable:!0,get:()=>e.domStylesReader}),Object.defineProperty(exports,"editorsMinimaps",{enumerable:!0,get:()=>e.editorsMinimaps}),exports.emitter=e.emitter,exports.getActiveMinimap=e.getActiveMinimap,exports.getConfigSchema=e.getConfigSchema,exports.getPluginsOrder=e.getPluginsOrder,exports.minimapClass=e.minimapClass,exports.minimapForEditor=e.minimapForEditor,exports.minimapForEditorElement=e.minimapForEditorElement,exports.minimapViewProvider=e.minimapViewProvider,exports.observeMinimaps=e.observeMinimaps,exports.onDidActivate=e.onDidActivate,exports.onDidActivatePlugin=e.onDidActivatePlugin,exports.onDidAddPlugin=e.onDidAddPlugin,exports.onDidChangePluginOrder=e.onDidChangePluginOrder,exports.onDidCreateMinimap=e.onDidCreateMinimap,exports.onDidDeactivate=e.onDidDeactivate,exports.onDidDeactivatePlugin=e.onDidDeactivatePlugin,exports.onDidRemovePlugin=e.onDidRemovePlugin,exports.plugins=e.plugins,exports.provideMinimapServiceV1=e.provideMinimapServiceV1,exports.registerPlugin=e.registerPlugin,exports.standAloneMinimapForEditor=e.standAloneMinimapForEditor,exports.toggle=e.toggle,exports.togglePluginActivation=e.togglePluginActivation,exports.unregisterPlugin=e.unregisterPlugin; //# sourceMappingURL=main.js.map diff --git a/dist/minimap-plugin-generator-element-d36805fc.js b/dist/minimap-plugin-generator-element-27adcab9.js similarity index 99% rename from dist/minimap-plugin-generator-element-d36805fc.js rename to dist/minimap-plugin-generator-element-27adcab9.js index 229cfeed..6677fb03 100644 --- a/dist/minimap-plugin-generator-element-d36805fc.js +++ b/dist/minimap-plugin-generator-element-27adcab9.js @@ -1,4 +1,4 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function e(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var a=Array(e+1);for(i=0;e>i;i++)a[i]=arguments[i];return a[e]=n,t.apply(this,a)}}function r(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function n(t){return null===t}function i(t){return void 0===t}function a(t){return!0===t||!1===t||"[object Boolean]"===zr.call(t)}function o(t){return!(!t||1!==t.nodeType)}function s(t){return e=>zr.call(e)==="[object "+t+"]"}function c(t,e){return null!=t&&qr.call(t,e)}function l(t){return!rn(t)&&Vr(t)&&!isNaN(parseFloat(t))}function u(t){return Yr(t)&&Wr(t)}function f(t){return()=>t}function h(t){return e=>{var r=t(e);return"number"==typeof r&&r>=0&&Zr>=r}}function p(t){return e=>null==e?void 0:e[t]}function d(t){return Hr?Hr(t)&&!ln(t):vn(t)&&gn.test(zr.call(t))}function m(t){for(var e={},r=t.length,n=0;r>n;++n)e[t[n]]=!0;return{contains:t=>e[t],push:r=>(e[r]=!0,t.push(r))}}function y(t,e){e=m(e);var r=Qr.length,n=t.constructor,i=pn(n)&&n.prototype||Mr,a="constructor";for(c(t,a)&&!e.contains(a)&&e.push(a);r--;)(a=Qr[r])in t&&t[a]!==i[a]&&!e.contains(a)&&e.push(a)}function v(t){if(!r(t))return[];if($r)return $r(t);var e=[];for(var n in t)c(t,n)&&e.push(n);return Kr&&y(t,e),e}function g(t){return null==t||(wn(t)&&(un(t)||Xr(t)||mn(t))?0===t.length:0===v(t).length)}function b(t,e){var r=v(e),n=r.length;if(null==t)return!n;for(var i=Object(t),a=0;n>a;a++){var o=r[a];if(e[o]!==i[o]||!(o in i))return!1}return!0}function E(t){return t instanceof E?t:this instanceof E?void(this._wrapped=t):new E(t)}function w(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&S(t,e,r,n)}function S(t,e,r,n){t instanceof E&&(t=t._wrapped),e instanceof E&&(e=e._wrapped);var i=zr.call(t);if(i!==zr.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return Dr.valueOf.call(t)===Dr.valueOf.call(e);case"[object ArrayBuffer]":return S(new DataView(t),new DataView(e),r,n);case"[object DataView]":var a=yn(t);if(a!==yn(e))return!1;for(;a--;)if(t.getUint8(a)!==e.getUint8(a))return!1;return!0}if(bn(t))return S(new DataView(t.buffer),new DataView(e.buffer),r,n);var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,l=e.constructor;if(s!==l&&!(pn(s)&&s instanceof s&&pn(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}n=n||[];for(var u=(r=r||[]).length;u--;)if(r[u]===t)return n[u]===e;if(r.push(t),n.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!w(t[u],e[u],r,n))return!1}else{var f,h=v(t);if(u=h.length,v(e).length!==u)return!1;for(;u--;)if(!c(e,f=h[u])||!w(t[f],e[f],r,n))return!1}return r.pop(),n.pop(),!0}function k(t,e){return w(t,e)}function O(t){if(!r(t))return[];var e=[];for(var n in t)e.push(n);return Kr&&y(t,e),e}function _(t){for(var e=v(t),r=e.length,n=Array(r),i=0;r>i;i++)n[i]=t[e[i]];return n}function j(t){for(var e=v(t),r=e.length,n=Array(r),i=0;r>i;i++)n[i]=[e[i],t[e[i]]];return n}function x(t){for(var e={},r=v(t),n=0,i=r.length;i>n;n++)e[t[r[n]]]=r[n];return e}function A(t){var e=[];for(var r in t)pn(t[r])&&e.push(r);return e.sort()}function I(t,e){return function(r){var n=arguments.length;if(e&&(r=Object(r)),2>n||null==r)return r;for(var i=1;n>i;i++)for(var a=arguments[i],o=t(a),s=o.length,c=0;s>c;c++){var l=o[c];e&&void 0!==r[l]||(r[l]=a[l])}return r}}function T(){return()=>{}}function L(t){if(!r(t))return{};if(Ur)return Ur(t);var e=T();e.prototype=t;var n=new e;return e.prototype=null,n}function C(t,e){var r=L(t);return e&&kn(r,e),r}function N(t){return r(t)?un(t)?t.slice():Sn({},t):t}function P(t,e){return e(t),t}function M(t,e){if(!un(e))return c(t,e);for(var r=e.length,n=0;r>n;n++){var i=e[n];if(null==t||!qr.call(t,i))return!1;t=t[i]}return!!r}function D(t){return t}function R(t){return t=kn({},t),e=>b(e,t)}function F(t,e){for(var r=e.length,n=0;r>n;n++){if(null==t)return;t=t[e[n]]}return r?t:void 0}function z(t){return un(t)?e=>F(e,t):p(t)}function q(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return r=>t.call(e,r);case 3:return(r,n,i)=>t.call(e,r,n,i);case 4:return(r,n,i,a)=>t.call(e,r,n,i,a)}return function(){return t.apply(e,arguments)}}function B(t,e,n){return null==t?D:pn(t)?q(t,e,n):r(t)&&!un(t)?R(t):z(t)}function G(t,e){return B(t,e,1/0)}function $(t,e,r){return E.iteratee!==G?E.iteratee(t,e):B(t,e,r)}function U(t,e,r){e=$(e,r);for(var n=v(t),i=n.length,a={},o=0;i>o;o++){var s=n[o];a[s]=e(t[s],s,t)}return a}function H(){}function W(t){return null==t?()=>{}:e=>un(e)?F(t,e):t[e]}function V(t,e,r){var n=Array(Math.max(0,t));e=q(e,r,1);for(var i=0;t>i;i++)n[i]=e(i);return n}function K(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}function Q(t){var e=e=>t[e],r="(?:"+v(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return t=>n.test(t=null==t?"":""+t)?t.replace(i,e):t}function Z(t){return"\\"+Cn[t]}function X(t,e,r){!e&&r&&(e=r),e=On({},e,E.templateSettings);var n,i=RegExp([(e.escape||Ln).source,(e.interpolate||Ln).source,(e.evaluate||Ln).source].join("|")+"|$","g"),a=0,o="__p+='";t.replace(i,((e,r,n,i,s)=>(o+=t.slice(a,s).replace(Nn,Z),a=s+e.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(o+="';\n"+i+"\n__p+='"),e))),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return n.call(this,t,E)};return s.source="function("+(e.variable||"obj")+"){\n"+o+"}",s}function Y(t,e,r){un(e)||(e=[e]);var n=e.length;if(!n)return pn(r)?r.call(t):r;for(var i=0;n>i;i++){var a=null==t?void 0:t[e[i]];void 0===a&&(a=r,i=n),t=pn(a)?a.call(t):a}return t}function J(t){var e=++Pn+"";return t?t+e:e}function tt(t){var e=E(t);return e._chain=!0,e}function et(t,e,n,i,a){if(!(i instanceof e))return t.apply(n,a);var o=L(t.prototype),s=t.apply(o,a);return r(s)?s:o}function rt(t,e,r,n){if(n=n||[],e||0===e){if(0>=e)return n.concat(t)}else e=1/0;for(var i=n.length,a=0,o=En(t);o>a;a++){var s=t[a];if(wn(s)&&(un(s)||mn(s)))if(e>1)rt(s,e-1,r,n),i=n.length;else for(var c=0,l=s.length;l>c;)n[i++]=s[c++];else r||(n[i++]=s)}return n}function nt(t,e){var r=function(n){var i=r.cache,a=""+(e?e.apply(this,arguments):n);return c(i,a)||(i[a]=t.apply(this,arguments)),i[a]};return r.cache={},r}function it(t,e,r){var n,i,a,o,s=0;r||(r={});var c=()=>{s=!1===r.leading?0:_n(),n=null,o=t.apply(i,a),n||(i=a=null)},l=function(){var l=_n();s||!1!==r.leading||(s=l);var u=e-(l-s);return i=this,a=arguments,0>=u||u>e?(n&&(clearTimeout(n),n=null),s=l,o=t.apply(i,a),n||(i=a=null)):n||!1===r.trailing||(n=setTimeout(c,u)),o};return l.cancel=()=>{clearTimeout(n),s=0,n=i=a=null},l}function at(t,r,n){var i,a,o=(e,r)=>{i=null,r&&(a=t.apply(e,r))},s=e((function(e){if(i&&clearTimeout(i),n){var s=!i;i=setTimeout(o,r),s&&(a=t.apply(this,e))}else i=Fn(o,r,this,e);return a}));return s.cancel=()=>{clearTimeout(i),i=null},s}function ot(t,e){return Mn(e,t)}function st(t){return function(){return!t.apply(this,arguments)}}function ct(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function lt(t,e){return function(){if(1>--t)return e.apply(this,arguments)}}function ut(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t>1||(e=null),r}}function ft(t,e,r){e=$(e,r);for(var n,i=v(t),a=0,o=i.length;o>a;a++)if(e(t[n=i[a]],n,t))return n}function ht(t){return(e,r,n)=>{r=$(r,n);for(var i=En(e),a=t>0?0:i-1;a>=0&&i>a;a+=t)if(r(e[a],a,e))return a;return-1}}function pt(t,e,r,n){for(var i=(r=$(r,n,1))(e),a=0,o=En(t);o>a;){var s=Math.floor((a+o)/2);r(t[s]){var o=0,s=En(n);if("number"==typeof a)t>0?o=0>a?Math.max(a+s,o):a:s=0>a?a+s+1:Math.min(a+1,s);else if(r&&a&&s)return n[a=r(n,i)]===i?a:-1;if(i!=i)return 0>(a=e(Fr.call(n,o,s),u))?-1:a+o;for(a=t>0?o:s-1;a>=0&&s>a;a+=t)if(n[a]===i)return a;return-1}}function mt(t,e,r){var n=(wn(t)?Bn:ft)(t,e,r);if(void 0!==n&&-1!==n)return t[n]}function yt(t,e){return mt(t,R(e))}function vt(t,e,r){var n,i;if(e=q(e,r),wn(t))for(n=0,i=t.length;i>n;n++)e(t[n],n,t);else{var a=v(t);for(n=0,i=a.length;i>n;n++)e(t[a[n]],a[n],t)}return t}function gt(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=Array(i),o=0;i>o;o++){var s=n?n[o]:o;a[o]=e(t[s],s,t)}return a}function bt(t){var e=(e,r,n,i)=>{var a=!wn(e)&&v(e),o=(a||e).length,s=t>0?0:o-1;for(i||(n=e[a?a[s]:s],s+=t);s>=0&&o>s;s+=t){var c=a?a[s]:s;n=r(n,e[c],c,e)}return n};return function(t,r,n,i){var a=arguments.length>=3;return e(t,q(r,i,4),n,a)}}function Et(t,e,r){var n=[];return e=$(e,r),vt(t,((t,r,i)=>{e(t,r,i)&&n.push(t)})),n}function wt(t,e,r){return Et(t,st($(e)),r)}function St(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=0;i>a;a++){var o=n?n[a]:a;if(!e(t[o],o,t))return!1}return!0}function kt(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=0;i>a;a++){var o=n?n[a]:a;if(e(t[o],o,t))return!0}return!1}function Ot(t,e,r,n){return wn(t)||(t=_(t)),("number"!=typeof r||n)&&(r=0),$n(t,e,r)>=0}function _t(t,e){return gt(t,z(e))}function jt(t,e){return Et(t,R(e))}function xt(t,e,r){var n,i,a=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=wn(t)?t:_(t)).length;c>s;s++)null!=(n=t[s])&&n>a&&(a=n);else e=$(e,r),vt(t,((t,r,n)=>{((i=e(t,r,n))>o||i===-1/0&&a===-1/0)&&(a=t,o=i)}));return a}function At(t,e,r){var n,i,a=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=wn(t)?t:_(t)).length;c>s;s++)null!=(n=t[s])&&a>n&&(a=n);else e=$(e,r),vt(t,((t,r,n)=>{i=e(t,r,n),(o>i||i===1/0&&a===1/0)&&(a=t,o=i)}));return a}function It(t,e,r){if(null==e||r)return wn(t)||(t=_(t)),t[K(t.length-1)];var n=wn(t)?N(t):_(t),i=En(n);e=Math.max(Math.min(e,i),0);for(var a=i-1,o=0;e>o;o++){var s=K(o,a),c=n[o];n[o]=n[s],n[s]=c}return n.slice(0,e)}function Tt(t){return It(t,1/0)}function Lt(t,e,r){var n=0;return e=$(e,r),_t(gt(t,((t,r,i)=>({value:t,index:n++,criteria:e(t,r,i)}))).sort(((t,e)=>{var r=t.criteria,n=e.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(n>r||void 0===n)return-1}return t.index-e.index})),"value")}function Ct(t,e){return(r,n,i)=>{var a=e?[[],[]]:{};return n=$(n,i),vt(r,((e,i)=>{var o=n(e,i,r);t(a,e,o)})),a}}function Nt(t){return t?un(t)?Fr.call(t):Xr(t)?t.match(Yn):wn(t)?gt(t,D):_(t):[]}function Pt(t){return null==t?0:wn(t)?t.length:v(t).length}function Mt(t,e,r){return e in r}function Dt(t,e,r){return Fr.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))}function Rt(t,e,r){return null==t||1>t.length?null==e||r?void 0:[]:null==e||r?t[0]:Dt(t,t.length-e)}function Ft(t,e,r){return Fr.call(t,null==e||r?1:e)}function zt(t,e,r){return null==t||1>t.length?null==e||r?void 0:[]:null==e||r?t[t.length-1]:Ft(t,Math.max(0,t.length-e))}function qt(t){return Et(t,Boolean)}function Bt(t,e){return rt(t,e,!1)}function Gt(t,e,r,n){a(e)||(n=r,r=e,e=!1),null!=r&&(r=$(r,n));for(var i=[],o=[],s=0,c=En(t);c>s;s++){var l=t[s],u=r?r(l,s,t):l;e&&!r?(s&&o===u||i.push(l),o=u):r?Ot(o,u)||(o.push(u),i.push(l)):Ot(i,l)||i.push(l)}return i}function $t(t){for(var e=[],r=arguments.length,n=0,i=En(t);i>n;n++){var a=t[n];if(!Ot(e,a)){var o;for(o=1;r>o&&Ot(arguments[o],a);o++);o===r&&e.push(a)}}return e}function Ut(t){for(var e=t&&xt(t,En).length||0,r=Array(e),n=0;e>n;n++)r[n]=_t(t,n);return r}function Ht(t,e){for(var r={},n=0,i=En(t);i>n;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r}function Wt(t,e,r){null==e&&(e=t||0,t=0),r||(r=t>e?-1:1);for(var n=Math.max(Math.ceil((e-t)/r),0),i=Array(n),a=0;n>a;a++,t+=r)i[a]=t;return i}function Vt(t,e){if(null==e||1>e)return[];for(var r=[],n=0,i=t.length;i>n;)r.push(Fr.call(t,n,n+=e));return r}function Kt(t,e){return t._chain?E(e).chain():e}function Qt(t){return vt(A(t),(function(e){var r=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return Rr.apply(t,arguments),Kt(this,r.apply(E,t))}})),E}function Zt(t,e,r,n){"function"==typeof e?(r=e,e={}):e&&"object"==typeof e||(e={mode:e});var i=e.mode,a=e.fs||jr.default;void 0===i&&(i=fi),n||(n=null);var o=r||(()=>{});t=_r.default.resolve(t),a.mkdir(t,i,(r=>{if(!r)return o(null,n=n||t);switch(r.code){case"ENOENT":if(_r.default.dirname(t)===t)return o(r);Zt(_r.default.dirname(t),e,((r,n)=>{r?o(r,n):Zt(t,e,o,n)}));break;default:a.stat(t,((t,e)=>{t||!e.isDirectory()?o(r,n):o(null,n)}))}}))}function Xt(){function t(t){if(t){if(process.throwDeprecation)throw t;if(!process.noDeprecation){var e="fs: missing callback "+(t.stack||t.message);process.traceDeprecation?console.trace(e):console.error(e)}}}var e;if(di){var r=Error();e=e=>{e&&(r.message=e.message,t(e=r))}}else e=t;return e}function Yt(t){return"function"==typeof t?t:Xt()}function Jt(t){return t&&"realpath"===t.syscall&&("ELOOP"===t.code||"ENOMEM"===t.code||"ENAMETOOLONG"===t.code)}function te(t,e,r){if(_i)return Si(t,e,r);"function"==typeof e&&(r=e,e=null),Si(t,e,((n,i)=>{Jt(n)?Ei.realpath(t,e,r):r(n,i)}))}function ee(t,e){if(_i)return ki(t,e);try{return ki(t,e)}catch(r){if(Jt(r))return Ei.realpathSync(t,e);throw r}}function re(){jr.default.realpath=te,jr.default.realpathSync=ee}function ne(){jr.default.realpath=Si,jr.default.realpathSync=ki}function ie(t,e,r){t instanceof RegExp&&(t=ae(t,r)),e instanceof RegExp&&(e=ae(e,r));var n=oe(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function ae(t,e){var r=e.match(t);return r?r[0]:null}function oe(t,e,r){var n,i,a,o,s,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){for(n=[],a=r.length;u>=0&&!s;)u==c?(n.push(u),c=r.indexOf(t,u+1)):1==n.length?s=[n.pop(),l]:(a>(i=n.pop())&&(a=i,o=l),l=r.indexOf(e,u+1)),u=l>c&&c>=0?c:l;n.length&&(s=[a,o])}return s}function se(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function ce(t){return t.split("\\\\").join(Ti).split("\\{").join(Li).split("\\}").join(Ci).split("\\,").join(Ni).split("\\.").join(Pi)}function le(t){return t.split(Ti).join("\\").split(Li).join("{").split(Ci).join("}").split(Ni).join(",").split(Pi).join(".")}function ue(t){if(!t)return[""];var e=[],r=Ai("{","}",t);if(!r)return t.split(",");var n=r.body,i=r.post,a=r.pre.split(",");a[a.length-1]+="{"+n+"}";var o=ue(i);return i.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function fe(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),ye(ce(t),!0).map(le)):[]}function he(t){return"{"+t+"}"}function pe(t){return/^-?0\d/.test(t)}function de(t,e){return e>=t}function me(t,e){return t>=e}function ye(t,e){var r=[],n=Ai("{","}",t);if(!n||/\$$/.test(n.pre))return[t];var i,a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),s=a||o,c=n.body.indexOf(",")>=0;if(!s&&!c)return n.post.match(/,.*\}/)?ye(t=n.pre+"{"+n.body+Ci+n.post):[t];if(s)i=n.body.split(/\.\./);else if(1===(i=ue(n.body)).length&&1===(i=ye(i[0],!1).map(he)).length)return(f=n.post.length?ye(n.post,!1):[""]).map((t=>n.pre+i[0]+t));var l,u=n.pre,f=n.post.length?ye(n.post,!1):[""];if(s){var h=se(i[0]),p=se(i[1]),d=Math.max(i[0].length,i[1].length),m=3==i.length?Math.abs(se(i[2])):1,y=de;h>p&&(m*=-1,y=me);var v=i.some(pe);l=[];for(var g=h;y(g,p);g+=m){var b;if(o)"\\"===(b=String.fromCharCode(g))&&(b="");else if(b=g+"",v){var E=d-b.length;if(E>0){var w=Array(E+1).join("0");b=0>g?"-"+w+b.slice(1):w+b}}l.push(b)}}else l=ji(i,(t=>ye(t,!1)));for(var S=0;l.length>S;S++)for(var k=0;f.length>k;k++){var O=u+l[S]+f[k];(!e||s||O)&&r.push(O)}return r}function ve(t){return t.split("").reduce(((t,e)=>(t[e]=!0,t)),{})}function ge(t,e){return e=e||{},(r,n,i)=>Ee(r,t,e)}function be(t,e){t=t||{};var r={};return Object.keys(e=e||{}).forEach((t=>{r[t]=e[t]})),Object.keys(t).forEach((e=>{r[e]=t[e]})),r}function Ee(t,e,r){if("string"!=typeof e)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new we(e,r).match(t))}function we(t,e){if(!(this instanceof we))return new we(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),"/"!==Di.sep&&(t=t.split(Di.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function Se(){if(!this._made){var t=this.pattern,e=this.options;if(e.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map((t=>t.split(Ui))),this.debug(this.pattern,r),r=r.map((function(t,e,r){return t.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((t=>-1===t.indexOf(!1))),this.debug(this.pattern,r),this.set=r}else this.empty=!0;else this.comment=!0}}function ke(){var t=this.pattern,e=!1,r=0;if(!this.options.nonegate){for(var n=0,i=t.length;i>n&&"!"===t.charAt(n);n++)e=!e,r++;r&&(this.pattern=t.substr(r)),this.negate=e}}function Oe(t,e){if(e||(e=this instanceof we?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:Ii(t)}function _e(t,e){function r(){if(i){switch(i){case"*":o+=qi,s=!0;break;case"?":o+=zi,s=!0;break;default:o+="\\"+i}m.debug("clearStateChar %j %j",i,o),i=!1}}if(t.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===t)return Ri;if(""===t)return"";for(var i,a,o="",s=!!n.nocase,c=!1,l=[],u=[],f=!1,h=-1,p=-1,d="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this,y=0,v=t.length;v>y&&(a=t.charAt(y));y++)if(this.debug("%s\t%s %s %j",t,y,o,a),c&&$i[a])o+="\\"+a,c=!1;else switch(a){case"/":return!1;case"\\":r(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,y,o,a),f){this.debug(" in class"),"!"===a&&y===p+1&&(a="^"),o+=a;continue}m.debug("call clearStateChar %j",i),r(),i=a,n.noext&&r();continue;case"(":if(f){o+="(";continue}if(!i){o+="\\(";continue}l.push({type:i,start:y-1,reStart:o.length,open:Fi[i].open,close:Fi[i].close}),this.debug("plType %j %j",i,o+="!"===i?"(?:(?!(?:":"(?:"),i=!1;continue;case")":if(f||!l.length){o+="\\)";continue}r(),s=!0;var g=l.pop();o+=g.close,"!"===g.type&&u.push(g),g.reEnd=o.length;continue;case"|":if(f||!l.length||c){o+="\\|",c=!1;continue}r(),o+="|";continue;case"[":if(r(),f){o+="\\"+a;continue}f=!0,p=y,h=o.length,o+=a;continue;case"]":if(y===p+1||!f){o+="\\"+a,c=!1;continue}if(f){var b=t.substring(p+1,y);try{RegExp("["+b+"]")}catch(t){var E=this.parse(b,Hi);o=o.substr(0,h)+"\\["+E[0]+"\\]",s=s||E[1],f=!1;continue}}s=!0,f=!1,o+=a;continue;default:r(),c?c=!1:!$i[a]||"^"===a&&f||(o+="\\"),o+=a}for(f&&(b=t.substr(p+1),E=this.parse(b,Hi),o=o.substr(0,h)+"\\["+E[0],s=s||E[1]),g=l.pop();g;g=l.pop()){var w=o.slice(g.reStart+g.open.length);this.debug("setting tail",o,g),w=w.replace(/((?:\\{2}){0,64})(\\?)\|/g,((t,e,r)=>(r||(r="\\"),e+e+r+"|"))),this.debug("tail=%j\n %s",w,w,g,o);var S="*"===g.type?qi:"?"===g.type?zi:"\\"+g.type;s=!0,o=o.slice(0,g.reStart)+S+"\\("+w}r(),c&&(o+="\\\\");var k=!1;switch(o.charAt(0)){case".":case"[":case"(":k=!0}for(var O=u.length-1;O>-1;O--){var _=u[O],j=o.slice(0,_.reStart),x=o.slice(_.reStart,_.reEnd-8),A=o.slice(_.reEnd-8,_.reEnd),I=o.slice(_.reEnd);A+=I;var T=j.split("(").length-1,L=I;for(y=0;T>y;y++)L=L.replace(/\)[+*?]?/,"");var C="";""===(I=L)&&e!==Hi&&(C="$"),o=j+x+I+C+A}if(""!==o&&s&&(o="(?=.)"+o),k&&(o=d+o),e===Hi)return[o,s];if(!s)return Ae(t);var N=n.nocase?"i":"";try{var P=RegExp("^"+o+"$",N)}catch(t){return/$./}return P._glob=t,P._src=o,P}function je(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?qi:e.dot?Bi:Gi,n=e.nocase?"i":"",i=t.map((t=>t.map((t=>t===Ri?r:"string"==typeof t?Ie(t):t._src)).join("\\/"))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=RegExp(i,n)}catch(t){this.regexp=!1}return this.regexp}function xe(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"/"!==Di.sep&&(t=t.split(Di.sep).join("/")),t=t.split(Ui),this.debug(this.pattern,"split",t);var n,i,a=this.set;for(this.debug(this.pattern,"set",a),i=t.length-1;i>=0&&!(n=t[i]);i--);for(i=0;a.length>i;i++){var o=a[i],s=t;if(r.matchBase&&1===o.length&&(s=[n]),this.matchOne(s,o,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}function Ae(t){return t.replace(/\\(.)/g,"$1")}function Ie(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function Te(t){return"/"===t.charAt(0)}function Le(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(t),r=e[1]||"",n=!(!r||":"===r.charAt(1));return!(!e[2]&&!n)}function Ce(t,e){return{}.hasOwnProperty.call(t,e)}function Ne(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function Pe(t,e){return t.localeCompare(e)}function Me(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]),t.ignore.length&&(t.ignore=t.ignore.map(De))}function De(t){var e=null;if("/**"===t.slice(-3)){var r=t.replace(/(\/\*\*)+$/,"");e=new oa(r,{dot:!0})}return{matcher:new oa(t,{dot:!0}),gmatcher:e}}function Re(t,e,r){if(r||(r={}),r.matchBase&&-1===e.indexOf("/")){if(r.noglobstar)throw Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=!1!==r.strict,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0),t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.absolute=!!r.absolute,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),Me(t,r),t.changedCwd=!1;var n=process.cwd();Ce(r,"cwd")?(t.cwd=_r.default.resolve(r.cwd),t.changedCwd=t.cwd!==n):t.cwd=n,t.root=r.root||_r.default.resolve(t.cwd,"/"),t.root=_r.default.resolve(t.root),"win32"===process.platform&&(t.root=t.root.replace(/\\/g,"/")),t.cwdAbs=Ki(t.cwd)?t.cwd:qe(t,t.cwd),"win32"===process.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/")),t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new oa(e,r),t.options=t.minimatch.options}function Fe(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;i>n;n++){var a=t.matches[n];if(a&&0!==Object.keys(a).length){var o=Object.keys(a);e?r.push.apply(r,o):o.forEach((t=>{r[t]=!0}))}else if(t.nonull){var s=t.minimatch.globSet[n];e?r.push(s):r[s]=!0}}if(e||(r=Object.keys(r)),t.nosort||(r=r.sort(t.nocase?Ne:Pe)),t.mark){for(n=0;r.length>n;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter((e=>{var r=!/\/$/.test(e),n=t.cache[e]||t.cache[qe(t,e)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r})))}t.ignore.length&&(r=r.filter((e=>!Be(t,e)))),t.found=r}function ze(t,e){var r=qe(t,e),n=t.cache[r],i=e;if(n){var a="DIR"===n||Array.isArray(n),o="/"===e.slice(-1);if(a&&!o?i+="/":!a&&o&&(i=i.slice(0,-1)),i!==e){var s=qe(t,i);t.statCache[s]=t.statCache[r],t.cache[s]=t.cache[r]}}return i}function qe(t,e){var r=e;return r="/"===e.charAt(0)?_r.default.join(t.root,e):Ki(e)||""===e?e:t.changedCwd?_r.default.resolve(t.cwd,e):_r.default.resolve(e),"win32"===process.platform&&(r=r.replace(/\\/g,"/")),r}function Be(t,e){return!!t.ignore.length&&t.ignore.some((t=>t.matcher.match(e)||!(!t.gmatcher||!t.gmatcher.match(e))))}function Ge(t,e){return!!t.ignore.length&&t.ignore.some((t=>!(!t.gmatcher||!t.gmatcher.match(e))))}function $e(t,e){if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new Ue(t,e).found}function Ue(t,e){if(!t)throw Error("must provide pattern");if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof Ue))return new Ue(t,e);if(la(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=Array(r);for(var n=0;r>n;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}function He(t,e){function r(){for(var e=Array(arguments.length),r=0;e.length>r;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((t=>{n[t]=i[t]})),n}if(t&&e)return He(t)(e);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((e=>{r[e]=t[e]})),r}function We(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Ve(t){var e=function(){if(e.called)throw Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)};return e.onceError=(t.name||"Function wrapped with `once`")+" shouldn't be called more than once",e.called=!1,e}function Ke(t,e){return ya[t]?(ya[t].push(e),null):(ya[t]=[e],Qe(t))}function Qe(t){return da((function e(){var r=ya[t],n=r.length,i=Ze(arguments);try{for(var a=0;n>a;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick((()=>{e.apply(null,i)}))):delete ya[t]}}))}function Ze(t){for(var e=t.length,r=[],n=0;e>n;n++)r[n]=t[n];return r}function Xe(t,e,r){if("function"==typeof e&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return ca(t,e)}return new Je(t,e,r)}function Ye(t,e){if(null===e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function Je(t,e,r){function n(){--a._processing,a._processing>0||a._finish()}if("function"==typeof e&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new Oa(t,e)}if(!(this instanceof Je))return new Je(t,e,r);Ea(this,t,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=Array(i),"function"==typeof r&&(r=da(r),this.on("error",r),this.on("end",(t=>{r(null,t)})));var a=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===i)return n();for(var o=0;i>o;o++)this._process(this.minimatch.set[o],o,!1,n)}function tr(t,e,r){return(n,i)=>{n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}function er(t){if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{t[e]=t[e]||jr.default[e],t[e+="Sync"]=t[e]||jr.default[e]})),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,!1===t.glob&&(t.disableGlob=!0),!0!==t.disableGlob&&void 0===ja)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");t.disableGlob=t.disableGlob||!1,t.glob=t.glob||Aa}function rr(t,e,r){function n(t,n){return t?r(t):0===(o=n.length)?r():void n.forEach((t=>{nr(t,e,(function n(s){if(s){if(("EBUSY"===s.code||"ENOTEMPTY"===s.code||"EPERM"===s.code)&&e.maxBusyTries>i)return i++,setTimeout((()=>{nr(t,e,n)}),100*i);if("EMFILE"===s.code&&e.emfileWait>Ia)return setTimeout((()=>{nr(t,e,n)}),Ia++);"ENOENT"===s.code&&(s=null)}Ia=0,(t=>{a=a||t,0==--o&&r(a)})(s)}))}))}"function"==typeof e&&(r=e,e={}),Ar.default(t,"rimraf: missing path"),Ar.default.equal(typeof t,"string","rimraf: path should be a string"),Ar.default.equal(typeof r,"function","rimraf: callback function required"),Ar.default(e,"rimraf: invalid options argument provided"),Ar.default.equal(typeof e,"object","rimraf: options should be object"),er(e);var i=0,a=null,o=0;if(e.disableGlob||!ja.hasMagic(t))return n(null,[t]);e.lstat(t,((r,i)=>{if(!r)return n(null,[t]);ja(t,e.glob,n)}))}function nr(t,e,r){Ar.default(t),Ar.default(e),Ar.default("function"==typeof r),e.lstat(t,((n,i)=>n&&"ENOENT"===n.code?r(null):(n&&"EPERM"===n.code&&Ta&&ir(t,e,n,r),i&&i.isDirectory()?or(t,e,n,r):void e.unlink(t,(n=>{if(n){if("ENOENT"===n.code)return r(null);if("EPERM"===n.code)return Ta?ir(t,e,n,r):or(t,e,n,r);if("EISDIR"===n.code)return or(t,e,n,r)}return r(n)})))))}function ir(t,e,r,n){Ar.default(t),Ar.default(e),Ar.default("function"==typeof n),r&&Ar.default(r instanceof Error),e.chmod(t,xa,(i=>{i?n("ENOENT"===i.code?null:r):e.stat(t,((i,a)=>{i?n("ENOENT"===i.code?null:r):a.isDirectory()?or(t,e,r,n):e.unlink(t,n)}))}))}function ar(t,e,r){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error);try{e.chmodSync(t,xa)}catch(t){if("ENOENT"===t.code)return;throw r}try{var n=e.statSync(t)}catch(t){if("ENOENT"===t.code)return;throw r}n.isDirectory()?lr(t,e,r):e.unlinkSync(t)}function or(t,e,r,n){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error),Ar.default("function"==typeof n),e.rmdir(t,(i=>{!i||"ENOTEMPTY"!==i.code&&"EEXIST"!==i.code&&"EPERM"!==i.code?n(i&&"ENOTDIR"===i.code?r:i):sr(t,e,n)}))}function sr(t,e,r){Ar.default(t),Ar.default(e),Ar.default("function"==typeof r),e.readdir(t,((n,i)=>{if(n)return r(n);var a,o=i.length;if(0===o)return e.rmdir(t,r);i.forEach((n=>{rr(_r.default.join(t,n),e,(n=>{if(!a)return n?r(a=n):void(0==--o&&e.rmdir(t,r))}))}))}))}function cr(t,e){var r;if(er(e=e||{}),Ar.default(t,"rimraf: missing path"),Ar.default.equal(typeof t,"string","rimraf: path should be a string"),Ar.default(e,"rimraf: missing options"),Ar.default.equal(typeof e,"object","rimraf: options should be object"),e.disableGlob||!ja.hasMagic(t))r=[t];else try{e.lstatSync(t),r=[t]}catch(n){r=ja.sync(t,e.glob)}if(r.length)for(var n=0;r.length>n;n++){t=r[n];try{var i=e.lstatSync(t)}catch(r){if("ENOENT"===r.code)return;"EPERM"===r.code&&Ta&&ar(t,e,r)}try{i&&i.isDirectory()?lr(t,e,null):e.unlinkSync(t)}catch(r){if("ENOENT"===r.code)return;if("EPERM"===r.code)return Ta?ar(t,e,r):lr(t,e,r);if("EISDIR"!==r.code)throw r;lr(t,e,r)}}}function lr(t,e,r){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error);try{e.rmdirSync(t)}catch(n){if("ENOENT"===n.code)return;if("ENOTDIR"===n.code)throw r;"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code||ur(t,e)}}function ur(t,e){Ar.default(t),Ar.default(e),e.readdirSync(t).forEach((r=>{cr(_r.default.join(t,r),e)}));for(var r=Ta?100:1,n=0;;){var i=!0;try{var a=e.rmdirSync(t,e);return i=!1,a}finally{if(++n"function"==typeof t||!1);const pn=fn;var dn=s("Arguments");!function(){dn(arguments)||(dn=t=>c(t,"callee"))}();const mn=dn,yn=p("byteLength"),vn=h(yn);var gn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const bn=Br?d:f(!1),En=p("length"),wn=h(En);E.VERSION=Cr,E.prototype.value=function(){return this._wrapped},E.prototype.valueOf=E.prototype.toJSON=E.prototype.value,E.prototype.toString=function(){return this._wrapped+""};const Sn=I(O),kn=I(v),On=I(O,!0);E.iteratee=G;const _n=Date.now||(()=>(new Date).getTime()),jn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},xn=Q(jn),An=x(jn),In=Q(An),Tn=E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Ln=/(.)^/,Cn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Nn=/\\|'|\r|\n|\u2028|\u2029/g,Pn=0,Mn=e((function(t,e){var r=Mn.placeholder,n=function(){for(var i=0,a=e.length,o=Array(a),s=0;a>s;s++)o[s]=e[s]===r?arguments[i++]:e[s];for(;arguments.length>i;)o.push(arguments[i++]);return et(t,n,this,this,o)};return n}));Mn.placeholder=E;const Dn=e((function(t,r,n){if(!pn(t))throw new TypeError("Bind must be called on a function");var i=e((function(e){return et(t,i,r,this,n.concat(e))}));return i})),Rn=e(((t,e)=>{var r=(e=rt(e,!1,!1)).length;if(1>r)throw Error("bindAll must be passed function names");for(;r--;){var n=e[r];t[n]=Dn(t[n],t)}return t})),Fn=e(((t,e,r)=>setTimeout((()=>t.apply(null,r)),e))),zn=Mn(Fn,E,1),qn=Mn(ut,2),Bn=ht(1),Gn=ht(-1),$n=dt(1,Bn,pt),Un=dt(-1,Gn),Hn=bt(1),Wn=bt(-1),Vn=e(((t,e,r)=>{var n,i;return pn(e)?i=e:un(e)&&(n=e.slice(0,-1),e=e[e.length-1]),gt(t,(t=>{var a=i;if(!a){if(n&&n.length&&(t=F(t,n)),null==t)return;a=t[e]}return null==a?a:a.apply(t,r)}))})),Kn=Ct(((t,e,r)=>{c(t,r)?t[r].push(e):t[r]=[e]})),Qn=Ct(((t,e,r)=>{t[r]=e})),Zn=Ct(((t,e,r)=>{c(t,r)?t[r]++:t[r]=1})),Xn=Ct(((t,e,r)=>{t[r?0:1].push(e)}),!0);var Yn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;const Jn=e(((t,e)=>{var r={},n=e[0];if(null==t)return r;pn(n)?(e.length>1&&(n=q(n,e[1])),e=O(t)):(n=Mt,e=rt(e,!1,!1),t=Object(t));for(var i=0,a=e.length;a>i;i++){var o=e[i],s=t[o];n(s,o,t)&&(r[o]=s)}return r})),ti=e(((t,e)=>{var r,n=e[0];return pn(n)?(n=st(n),e.length>1&&(r=e[1])):(e=gt(rt(e,!1,!1),String),n=(t,r)=>!Ot(e,r)),Jn(t,n,r)})),ei=e(((t,e)=>(e=rt(e,!0,!0),Et(t,(t=>!Ot(e,t)))))),ri=e(((t,e)=>ei(t,e))),ni=e((t=>Gt(rt(t,!0,!0)))),ii=e(Ut);vt(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=Pr[t];E.prototype[t]=function(){var r=this._wrapped;return null!=r&&(e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0]),Kt(this,r)}})),vt(["concat","join","slice"],(function(t){var e=Pr[t];E.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Kt(this,t)}}));const ai=Object.freeze({__proto__:null,VERSION:Cr,restArguments:e,isObject:r,isNull:n,isUndefined:i,isBoolean:a,isElement:o,isString:Xr,isNumber:Yr,isDate:Jr,isRegExp:tn,isError:en,isSymbol:rn,isMap:nn,isWeakMap:an,isSet:on,isWeakSet:sn,isArrayBuffer:cn,isDataView:ln,isArray:un,isFunction:pn,isArguments:mn,isFinite:l,isNaN:u,isTypedArray:bn,isEmpty:g,isMatch:b,isEqual:k,keys:v,allKeys:O,values:_,pairs:j,invert:x,functions:A,methods:A,extend:Sn,extendOwn:kn,assign:kn,defaults:On,create:C,clone:N,tap:P,has:M,mapObject:U,identity:D,constant:f,noop:H,property:z,propertyOf:W,matcher:R,matches:R,times:V,random:K,now:_n,escape:xn,unescape:In,templateSettings:Tn,template:X,result:Y,uniqueId:J,chain:tt,iteratee:G,partial:Mn,bind:Dn,bindAll:Rn,memoize:nt,delay:Fn,defer:zn,throttle:it,debounce:at,wrap:ot,negate:st,compose:ct,after:lt,before:ut,once:qn,findKey:ft,findIndex:Bn,findLastIndex:Gn,sortedIndex:pt,indexOf:$n,lastIndexOf:Un,find:mt,detect:mt,findWhere:yt,each:vt,forEach:vt,map:gt,collect:gt,reduce:Hn,foldl:Hn,inject:Hn,reduceRight:Wn,foldr:Wn,filter:Et,select:Et,reject:wt,every:St,all:St,some:kt,any:kt,contains:Ot,includes:Ot,include:Ot,invoke:Vn,pluck:_t,where:jt,max:xt,min:At,shuffle:Tt,sample:It,sortBy:Lt,groupBy:Kn,indexBy:Qn,countBy:Zn,partition:Xn,toArray:Nt,size:Pt,pick:Jn,omit:ti,first:Rt,head:Rt,take:Rt,initial:Dt,last:zt,rest:Ft,tail:Ft,drop:Ft,compact:qt,flatten:Bt,without:ri,uniq:Gt,unique:Gt,union:ni,intersection:$t,difference:ei,unzip:Ut,transpose:Ut,zip:ii,object:Ht,range:Wt,chunk:Vt,mixin:Qt,default:E});var oi=Qt(ai);oi._=oi;const si=Object.freeze({__proto__:null,default:oi,VERSION:Cr,restArguments:e,isObject:r,isNull:n,isUndefined:i,isBoolean:a,isElement:o,isString:Xr,isNumber:Yr,isDate:Jr,isRegExp:tn,isError:en,isSymbol:rn,isMap:nn,isWeakMap:an,isSet:on,isWeakSet:sn,isArrayBuffer:cn,isDataView:ln,isArray:un,isFunction:pn,isArguments:mn,isFinite:l,isNaN:u,isTypedArray:bn,isEmpty:g,isMatch:b,isEqual:k,keys:v,allKeys:O,values:_,pairs:j,invert:x,functions:A,methods:A,extend:Sn,extendOwn:kn,assign:kn,defaults:On,create:C,clone:N,tap:P,has:M,mapObject:U,identity:D,constant:f,noop:H,property:z,propertyOf:W,matcher:R,matches:R,times:V,random:K,now:_n,escape:xn,unescape:In,templateSettings:Tn,template:X,result:Y,uniqueId:J,chain:tt,iteratee:G,partial:Mn,bind:Dn,bindAll:Rn,memoize:nt,delay:Fn,defer:zn,throttle:it,debounce:at,wrap:ot,negate:st,compose:ct,after:lt,before:ut,once:qn,findKey:ft,findIndex:Bn,findLastIndex:Gn,sortedIndex:pt,indexOf:$n,lastIndexOf:Un,find:mt,detect:mt,findWhere:yt,each:vt,forEach:vt,map:gt,collect:gt,reduce:Hn,foldl:Hn,inject:Hn,reduceRight:Wn,foldr:Wn,filter:Et,select:Et,reject:wt,every:St,all:St,some:kt,any:kt,contains:Ot,includes:Ot,include:Ot,invoke:Vn,pluck:_t,where:jt,max:xt,min:At,shuffle:Tt,sample:It,sortBy:Lt,groupBy:Kn,indexBy:Qn,countBy:Zn,partition:Xn,toArray:Nt,size:Pt,pick:Jn,omit:ti,first:Rt,head:Rt,take:Rt,initial:Dt,last:zt,rest:Ft,tail:Ft,drop:Ft,compact:qt,flatten:Bt,without:ri,uniq:Gt,unique:Gt,union:ni,intersection:$t,difference:ei,unzip:Ut,transpose:Ut,zip:ii,object:Ht,range:Wt,chunk:Vt,mixin:Qt}),ci=vr.getAugmentedNamespace(si);var li=vr.createCommonjsModule((function(t){!function(){var e,r,n,i,a,o,s,c,l=[].slice;n={cmd:"⌘",ctrl:"⌃",alt:"⌥",option:"⌥",shift:"⇧",enter:"⏎",left:"←",right:"→",up:"↑",down:"↓"},i={cmd:"Cmd",ctrl:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",enter:"Enter",left:"Left",right:"Right",up:"Up",down:"Down"},o={"~":"`",_:"-","+":"=","|":"\\","{":"[","}":"]",":":";",'"':"'","<":",",">":".","?":"/"},s=t=>{var e,r,n,i,a;if(n=0,r=[],null==t)return r;for(e=i=0,a=t.length;a>i;e=++i)"."!==t[e]||0!==e&&"\\"===t[e-1]||(r.push(t.substring(n,e)),n=e+1);return r.push(t.substr(n,t.length)),r},r=t=>c.isObject(t)&&!c.isArray(t),a={adviseBefore(t,e,r){var n;return n=t[e],t[e]=function(){var t;if(t=1>arguments.length?[]:l.call(arguments,0),!1!==r.apply(this,t))return n.apply(this,t)}},camelize:t=>t?t.replace(/[_-]+(\w)/g,(t=>t[1].toUpperCase())):"",capitalize:t=>t?"github"===t.toLowerCase()?"GitHub":t[0].toUpperCase()+t.slice(1):"",compactObject(t){var e,r,n;for(e in r={},t)null!=(n=t[e])&&(r[e]=n);return r},dasherize:t=>t?(t=t[0].toLowerCase()+t.slice(1)).replace(/([A-Z])|(_)/g,((t,e)=>e?"-"+e.toLowerCase():"-")):"",deepClone:t=>c.isArray(t)?t.map((t=>a.deepClone(t))):c.isObject(t)&&!c.isFunction(t)?a.mapObject(t,((t,e)=>[t,a.deepClone(e)])):t,deepExtend(t){var e,n,i,o,s,c,l;for(o=t,e=0;++es;s++)o[n=l[s]]=a.deepExtend(o[n],i[n]);else o=a.deepClone(i);return o},deepContains(t,e){var r,n;if(null==t)return!1;for(r=0,n=t.length;n>r;r++)if(c.isEqual(t[r],e))return!0;return!1},endsWith:(t,e)=>(null==e&&(e=""),!!t&&-1!==t.indexOf(e,t.length-e.length)),escapeAttribute:t=>t?t.replace(/"/g,""").replace(/\n/g,"").replace(/\\/g,"-"):"",escapeRegExp:t=>t?t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"):"",humanizeEventName(t,e){var r,n,i,o;return n=(o=t.split(":"))[0],null==(r=o[1])?a.undasherize(n):(i=a.undasherize(n),null==e&&(e=a.undasherize(r)),i+": "+e)},humanizeKey(t,e){var r;return null==e&&(e=process.platform),t?(r="darwin"===e?n:i)[t]?r[t]:1===t.length&&null!=o[t]?[r.shift,o[t]]:1===t.length&&t===t.toUpperCase()&&t.toUpperCase()!==t.toLowerCase()?[r.shift,t.toUpperCase()]:1===t.length||/f[0-9]{1,2}/.test(t)?t.toUpperCase():"darwin"===e?t:a.capitalize(t):t},humanizeKeystroke(t,e){var r,n,i,o,s,l,u,f,h,p;if(null==e&&(e=process.platform),!t)return t;for(r=[],u=0,h=(s=t.split(" ")).length;h>u;u++){for(o=[],n=f=0,p=(l=(t=s[u]).split("-")).length;p>f;n=++f)""===(i=l[n])&&""===l[n-1]&&(i="-"),i&&o.push(a.humanizeKey(i,e));o=(o=c.uniq(c.flatten(o))).join("darwin"===e?"":"+"),r.push(o)}return r.join(" ")},isSubset:(t,e)=>c.every(t,(t=>c.include(e,t))),losslessInvert(t){var e,r,n;for(r in e={},t)null==e[n=t[r]]&&(e[n]=[]),e[n].push(r);return e},mapObject(t,e){var r,n,i,a,o,s;for(n={},i=0,a=(o=Object.keys(t)).length;a>i;i++)n[r=(s=e(r=o[i],t[r]))[0]]=s[1];return n},multiplyString(t,e){var r,n;for(r="",n=0;e>n;)r+=t,n++;return r},pluralize:(t,e,r)=>(null==t&&(t=0),null==r&&(r=e+"s"),1===t?t+" "+e:t+" "+r),remove(t,e){var r;return 0>(r=t.indexOf(e))||t.splice(r,1),t},setValueForKeyPath(t,e,r){var n,i;for(i=s(e);i.length>1;)null==t[n=i.shift()]&&(t[n]={}),t=t[n];return null!=r?t[i.shift()]=r:delete t[i.shift()]},hasKeyPath(t,e){var r,n,i,a;for(i=0,a=(n=s(e)).length;a>i;i++){if(!t.hasOwnProperty(r=n[i]))return!1;t=t[r]}return!0},spliceWithArray(t,e,r,n,i){var a,o,s,c;if(null==i&&(i=1e5),i>n.length)return t.splice.apply(t,[e,r].concat(l.call(n)));for(t.splice(e,r),c=[],a=o=0,s=n.length;i>0?s>=o:o>=s;a=o+=i)c.push(t.splice.apply(t,[e+a,0].concat(l.call(n.slice(a,a+i)))));return c},sum(t){var e,r,n;for(e=0,r=0,n=t.length;n>r;r++)e+=t[r];return e},uncamelcase(t){var e;return t?(e=t.replace(/([A-Z])|_+/g,((t,e)=>(null==e&&(e="")," "+e))),a.capitalize(e.trim())):""},undasherize:t=>t?t.split("-").map(a.capitalize).join(" "):"",underscore:t=>t?(t=t[0].toLowerCase()+t.slice(1)).replace(/([A-Z])|-+/g,((t,e)=>(null==e&&(e=""),"_"+e.toLowerCase()))):"",valueForKeyPath(t,e){var r,n,i;for(n=0,i=(r=s(e)).length;i>n;n++)if(null==(t=t[r[n]]))return;return t},isEqual:(t,r,n,i)=>c.isArray(n)&&c.isArray(i)?e(t,r,n,i):e(t,r),isEqualForProperties(){var t,e,r,n,i,a;for(t=arguments[0],e=arguments[1],i=0,a=(r=3>arguments.length?[]:l.call(arguments,2)).length;a>i;i++)if(!c.isEqual(t[n=r[i]],e[n]))return!1;return!0}},e=(t,r,n,i)=>{var a,o,s,l,u,f,h,p,d,m,y,v,g;if(null==n&&(n=[]),null==i&&(i=[]),t===r)return c.isEqual(t,r);if(c.isFunction(t)||c.isFunction(r))return c.isEqual(t,r);for(y=n.length;y--;)if(n[y]===t)return i[y]===r;if(n.push(t),i.push(r),p=!1,c.isFunction(null!=t?t.isEqual:void 0))p=t.isEqual(r,n,i);else if(c.isFunction(null!=r?r.isEqual:void 0))p=r.isEqual(t,i,n);else if(c.isArray(t)&&c.isArray(r)&&t.length===r.length){for(p=!0,d=v=0,g=t.length;g>v;d=++v)if(!e(t[d],r[d],n,i)){p=!1;break}}else if(c.isRegExp(t)&&c.isRegExp(r))p=c.isEqual(t,r);else if(c.isElement(t)&&c.isElement(r))p=t===r;else if(c.isObject(t)&&c.isObject(r))if(u=r.constructor,o=c.isFunction(a=t.constructor)&&a instanceof a,f=c.isFunction(u)&&u instanceof u,a===u||o&&f){for(m in s=0,p=!0,t)if(l=t[m],c.has(t,m)&&(s++,!c.has(r,m)||!e(l,r[m],n,i))){p=!1;break}if(p){for(m in h=0,r)c.has(r,m)&&h++;p=s===h}}else p=!1;else p=c.isEqual(t,r);return n.pop(),i.pop(),p},t.exports=(c=ci).extend({},c,a)}()})),ui=vr.createCommonjsModule((function(t){!function(){function e(){}function r(t){return t}function n(t){return!!t}function i(t){return!t}function a(t){return function(){if(null===t)throw Error("Callback was already called.");t.apply(this,arguments),t=null}}function o(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}function s(t){return R(t)||"number"==typeof t.length&&t.length>=0&&t.length%1==0}function c(t,e){for(var r=-1,n=t.length;++re))}function f(t,e,r){return c(t,((t,n,i)=>{r=e(r,t,n,i)})),r}function h(t,e){c(F(t),(r=>{e(t[r],r)}))}function p(t,e){for(var r=0;t.length>r;r++)if(t[r]===e)return r;return-1}function d(t){var e,r,n=-1;return s(t)?(e=t.length,()=>(n++,e>n?n:null)):(r=F(t),e=r.length,()=>(n++,e>n?r[n]:null))}function m(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n)}}}function y(t){return(e,r,n)=>t(e,n)}function v(t){return(r,n,i)=>{i=o(i||e);var s=d(r=r||[]);if(0>=t)return i(null);var c=!1,l=0,u=!1;!function e(){if(c&&0>=l)return i(null);for(;t>l&&!u;){var o=s();if(null===o)return c=!0,void(l>0||i(null));l+=1,n(r[o],o,a((t=>{l-=1,t?(i(t),u=!0):e()})))}}()}}function g(t){return(e,r,n)=>t(P.eachOf,e,r,n)}function b(t){return(e,r,n,i)=>t(v(r),e,n,i)}function E(t){return(e,r,n)=>t(P.eachOfSeries,e,r,n)}function w(t,r,n,i){i=o(i||e);var a=s(r=r||[])?[]:{};t(r,((t,e,r)=>{n(t,((t,n)=>{a[e]=n,r(t)}))}),(t=>{i(t,a)}))}function S(t,e,r,n){var i=[];t(e,((t,e,n)=>{r(t,(r=>{r&&i.push({index:e,value:t}),n()}))}),(()=>{n(l(i.sort(((t,e)=>t.index-e.index)),(t=>t.value)))}))}function k(t,e,r,n){S(t,e,((t,e)=>{r(t,(t=>{e(!t)}))}),n)}function O(t,e,r){return function(n,i,a,o){function s(){o&&o(r(!1,void 0))}function c(t,n,i){if(!o)return i();a(t,(n=>{o&&e(n)&&(o(r(!0,t)),o=a=!1),i()}))}arguments.length>3?t(n,i,c,s):(o=a,a=i,t(n,c,s))}}function _(t,e){return e}function j(t,r,n){n=n||e;var i=s(r)?[]:{};t(r,((t,e,r)=>{t(m(((t,n)=>{n.length>1||(n=n[0]),i[e]=n,r(t)})))}),(t=>{n(t,i)}))}function x(t,e,r,n){var i=[];t(e,((t,e,n)=>{r(t,((t,e)=>{i=i.concat(e||[]),n(t)}))}),(t=>{n(t,i)}))}function A(t,r,n){function i(t,r,n,i){if(null!=i&&"function"!=typeof i)throw Error("task callback must be a function");if(t.started=!0,R(r)||(r=[r]),0===r.length&&t.idle())return P.setImmediate((()=>{t.drain()}));c(r,(r=>{var a={data:r,callback:i||e};n?t.tasks.unshift(a):t.tasks.push(a),t.tasks.length===t.concurrency&&t.saturated()})),P.setImmediate(t.process)}function o(t,e){return function(){s-=1;var r=!1,n=arguments;c(e,(t=>{c(u,((e,n)=>{e!==t||r||(u.splice(n,1),r=!0)})),t.callback.apply(t,n)})),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==r)r=1;else if(0===r)throw Error("Concurrency must not be zero");var s=0,u=[],f={tasks:[],concurrency:r,payload:n,saturated:e,empty:e,drain:e,started:!1,paused:!1,push(t,e){i(f,t,!1,e)},kill(){f.drain=e,f.tasks=[]},unshift(t,e){i(f,t,!0,e)},process(){for(;!f.paused&&f.concurrency>s&&f.tasks.length;){var e=f.tasks.splice(0,f.payload?f.payload:f.tasks.length),r=l(e,(t=>t.data));0===f.tasks.length&&f.empty(),s+=1,u.push(e[0]);var n=a(o(f,e));t(r,n)}},length:()=>f.tasks.length,running:()=>s,workersList:()=>u,idle:()=>f.tasks.length+s===0,pause(){f.paused=!0},resume(){if(!1!==f.paused){f.paused=!1;for(var t=Math.min(f.concurrency,f.tasks.length),e=1;t>=e;e++)P.setImmediate(f.process)}}};return f}function I(t){return m(((e,r)=>{e.apply(null,r.concat([m(((e,r)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,(e=>{console[t](e)})))}))]))}))}function T(t){return(e,r,n)=>{t(u(e),r,n)}}function L(t){return m((function(e,r){var n=m((function(r){var n=this,i=r.pop();return t(e,((t,e,i)=>{t.apply(n,r.concat([i]))}),i)}));return r.length?n.apply(this,r):n}))}function C(t){return m((function(e){var r=e.pop();e.push((function(){var t=arguments;n?P.setImmediate((()=>{r.apply(null,t)})):r.apply(null,t)}));var n=!0;t.apply(this,e),n=!1}))}var N,P={},M="object"==typeof self&&self.self===self&&self||"object"==typeof vr.commonjsGlobal&&vr.commonjsGlobal.global===vr.commonjsGlobal&&vr.commonjsGlobal||this;null!=M&&(N=M.async),P.noConflict=()=>(M.async=N,P);var D={}.toString,R=Array.isArray||(t=>"[object Array]"===D.call(t)),F=Object.keys||(t=>{var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}),z="function"==typeof setImmediate&&setImmediate,q=z?t=>{z(t)}:t=>{setTimeout(t,0)};P.nextTick="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:q,P.setImmediate=z?q:P.nextTick,P.forEach=P.each=(t,e,r)=>P.eachOf(t,y(e),r),P.forEachSeries=P.eachSeries=(t,e,r)=>P.eachOfSeries(t,y(e),r),P.forEachLimit=P.eachLimit=(t,e,r,n)=>v(e)(t,y(r),n),P.forEachOf=P.eachOf=(t,r,n)=>{function i(t){l--,t?n(t):null!==s||l>0||n(null)}n=o(n||e);for(var s,c=d(t=t||[]),l=0;null!=(s=c());)l+=1,r(t[s],s,a(i));0===l&&n(null)},P.forEachOfSeries=P.eachOfSeries=(t,r,n)=>{n=o(n||e);var i=d(t=t||[]),s=i();!function e(){var o=!0;if(null===s)return n(null);r(t[s],s,a((t=>{if(t)n(t);else{if(null===(s=i()))return n(null);o?P.setImmediate(e):e()}}))),o=!1}()},P.forEachOfLimit=P.eachOfLimit=(t,e,r,n)=>{v(e)(t,r,n)},P.map=g(w),P.mapSeries=E(w),P.mapLimit=b(w),P.inject=P.foldl=P.reduce=(t,e,r,n)=>{P.eachOfSeries(t,((t,n,i)=>{r(e,t,((t,r)=>{e=r,i(t)}))}),(t=>{n(t,e)}))},P.foldr=P.reduceRight=(t,e,n,i)=>{var a=l(t,r).reverse();P.reduce(a,e,n,i)},P.transform=function(t,e,r,n){3===arguments.length&&(n=r,r=e,e=R(t)?[]:{}),P.eachOf(t,((t,n,i)=>{r(e,t,n,i)}),(t=>{n(t,e)}))},P.select=P.filter=g(S),P.selectLimit=P.filterLimit=b(S),P.selectSeries=P.filterSeries=E(S),P.reject=g(k),P.rejectLimit=b(k),P.rejectSeries=E(k),P.any=P.some=O(P.eachOf,n,r),P.someLimit=O(P.eachOfLimit,n,r),P.all=P.every=O(P.eachOf,i,i),P.everyLimit=O(P.eachOfLimit,i,i),P.detect=O(P.eachOf,r,_),P.detectSeries=O(P.eachOfSeries,r,_),P.detectLimit=O(P.eachOfLimit,r,_),P.sortBy=(t,e,r)=>{function n(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0}P.map(t,((t,r)=>{e(t,((e,n)=>{e?r(e):r(null,{value:t,criteria:n})}))}),((t,e)=>{if(t)return r(t);r(null,l(e.sort(n),(t=>t.value)))}))},P.auto=function(t,r,n){function i(t){g.unshift(t)}function a(t){var e=p(g,t);0>e||g.splice(e,1)}function s(){u--,c(g.slice(0),(t=>{t()}))}"function"==typeof arguments[1]&&(n=r,r=null),n=o(n||e);var l=F(t),u=l.length;if(!u)return n(null);r||(r=u);var d={},y=0,v=!1,g=[];i((()=>{u||n(null,d)})),c(l,(e=>{function o(){return r>y&&f(g,((t,e)=>t&&d.hasOwnProperty(e)),!0)&&!d.hasOwnProperty(e)}if(!v){for(var c,l=R(t[e])?t[e]:[t[e]],u=m(((t,r)=>{if(y--,r.length>1||(r=r[0]),t){var i={};h(d,((t,e)=>{i[e]=t})),i[e]=r,v=!0,n(t,i)}else d[e]=r,P.setImmediate(s)})),g=l.slice(0,l.length-1),b=g.length;b--;){if(!(c=t[g[b]]))throw Error("Has nonexistent dependency in "+g.join(", "));if(R(c)&&p(c,e)>=0)throw Error("Has cyclic dependencies")}o()?(y++,l[l.length-1](u,d)):i((function t(){o()&&(y++,a(t),l[l.length-1](u,d))}))}}))},P.retry=function(t,e,r){function n(t,e){if("number"==typeof e)t.times=parseInt(e,10)||a;else{if("object"!=typeof e)throw Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||a,t.interval=parseInt(e.interval,10)||o}}function i(t,e){function r(t,r){return n=>{t(((t,e)=>{n(!t||r,{err:t,result:e})}),e)}}function n(t){return e=>{setTimeout((()=>{e(null)}),t)}}for(;c.times;){var i=!(c.times-=1);s.push(r(c.task,i)),!i&&c.interval>0&&s.push(n(c.interval))}P.series(s,((e,r)=>{(t||c.callback)((r=r[r.length-1]).err,r.result)}))}var a=5,o=0,s=[],c={times:a,interval:o},l=arguments.length;if(1>l||l>3)throw Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return l>2||"function"!=typeof t||(r=e,e=t),"function"!=typeof t&&n(c,t),c.callback=r,c.task=e,c.callback?i():i},P.waterfall=(t,r)=>(r=o(r||e),R(t)?t.length?void function t(e){return m(((n,i)=>{if(n)r.apply(null,[n].concat(i));else{var a=e.next();i.push(a?t(a):r),C(e).apply(null,i)}}))}(P.iterator(t))():r():r(Error("First argument to waterfall must be an array of functions"))),P.parallel=(t,e)=>{j(P.eachOf,t,e)},P.parallelLimit=(t,e,r)=>{j(v(e),t,r)},P.series=(t,e)=>{j(P.eachOfSeries,t,e)},P.iterator=t=>function e(r){function n(){return t.length&&t[r].apply(null,arguments),n.next()}return n.next=()=>t.length-1>r?e(r+1):null,n}(0),P.apply=m(((t,e)=>m((r=>t.apply(null,e.concat(r)))))),P.concat=g(x),P.concatSeries=E(x),P.whilst=function(t,r,n){if(n=n||e,t()){var i=m((function(e,a){e?n(e):t.apply(this,a)?r(i):n.apply(null,[null].concat(a))}));r(i)}else n(null)},P.doWhilst=function(t,e,r){var n=0;return P.whilst((function(){return 1>=++n||e.apply(this,arguments)}),t,r)},P.until=function(t,e,r){return P.whilst((function(){return!t.apply(this,arguments)}),e,r)},P.doUntil=function(t,e,r){return P.doWhilst(t,(function(){return!e.apply(this,arguments)}),r)},P.during=function(t,r,n){n=n||e;var i=m((function(e,r){e?n(e):(r.push(a),t.apply(this,r))})),a=(t,e)=>{t?n(t):e?r(i):n(null)};t(a)},P.doDuring=function(t,e,r){var n=0;P.during((function(t){1>n++?t(null,!0):e.apply(this,arguments)}),t,r)},P.queue=(t,e)=>A(((e,r)=>{t(e[0],r)}),e,1),P.priorityQueue=(t,r)=>{function n(t,e){return t.priority-e.priority}var i=P.queue(t,r);return i.push=(t,r,a)=>{((t,r,i,a)=>{if(null!=a&&"function"!=typeof a)throw Error("task callback must be a function");if(t.started=!0,R(r)||(r=[r]),0===r.length)return P.setImmediate((()=>{t.drain()}));c(r,(r=>{var o={data:r,priority:i,callback:"function"==typeof a?a:e};t.tasks.splice(((t,e,r)=>{for(var n=-1,i=t.length-1;i>n;){var a=n+(i-n+1>>>1);0>r(e,t[a])?i=a-1:n=a}return n})(t.tasks,o,n)+1,0,o),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)}))})(i,t,r,a)},delete i.unshift,i},P.cargo=(t,e)=>A(t,1,e),P.log=I("log"),P.dir=I("dir"),P.memoize=(t,e)=>{var n={},i={},a={}.hasOwnProperty;e=e||r;var o=m((r=>{var o=r.pop(),s=e.apply(null,r);a.call(n,s)?P.setImmediate((()=>{o.apply(null,n[s])})):a.call(i,s)?i[s].push(o):(i[s]=[o],t.apply(null,r.concat([m((t=>{n[s]=t;var e=i[s];delete i[s];for(var r=0,a=e.length;a>r;r++)e[r].apply(null,t)}))])))}));return o.memo=n,o.unmemoized=t,o},P.unmemoize=t=>function(){return(t.unmemoized||t).apply(null,arguments)},P.times=T(P.map),P.timesSeries=T(P.mapSeries),P.timesLimit=(t,e,r,n)=>P.mapLimit(u(t),e,r,n),P.seq=function(){var t=arguments;return m((function(r){var n=this,i=r[r.length-1];"function"==typeof i?r.pop():i=e,P.reduce(t,r,((t,e,r)=>{e.apply(n,t.concat([m(((t,e)=>{r(t,e)}))]))}),((t,e)=>{i.apply(n,[t].concat(e))}))}))},P.compose=function(){return P.seq.apply(null,[].reverse.call(arguments))},P.applyEach=L(P.eachOf),P.applyEachSeries=L(P.eachOfSeries),P.forever=(t,r)=>{var n=a(r||e),i=C(t);!function t(e){if(e)return n(e);i(t)}()},P.ensureAsync=C,P.constant=m((function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}})),P.wrapSync=P.asyncify=function(t){return m((function(e){var r,n,i,a=e.pop();try{r=t.apply(this,e)}catch(t){return a(t)}("function"==(i=typeof(n=r))||"object"===i&&n)&&"function"==typeof r.then?r.then((t=>{a(null,t)})).catch((t=>{a(t.message?t:Error(t))})):a(null,r)}))},t.exports?t.exports=P:M.async=P}()})),fi=parseInt("0777",8),hi=Zt.mkdirp=Zt.mkdirP=Zt; +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function e(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var a=Array(e+1);for(i=0;e>i;i++)a[i]=arguments[i];return a[e]=n,t.apply(this,a)}}function r(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function n(t){return null===t}function i(t){return void 0===t}function a(t){return!0===t||!1===t||"[object Boolean]"===zr.call(t)}function o(t){return!(!t||1!==t.nodeType)}function s(t){return e=>zr.call(e)==="[object "+t+"]"}function c(t,e){return null!=t&&qr.call(t,e)}function l(t){return!rn(t)&&Vr(t)&&!isNaN(parseFloat(t))}function u(t){return Yr(t)&&Wr(t)}function f(t){return()=>t}function h(t){return e=>{var r=t(e);return"number"==typeof r&&r>=0&&Zr>=r}}function p(t){return e=>null==e?void 0:e[t]}function d(t){return Hr?Hr(t)&&!ln(t):vn(t)&&gn.test(zr.call(t))}function m(t){for(var e={},r=t.length,n=0;r>n;++n)e[t[n]]=!0;return{contains:t=>e[t],push:r=>(e[r]=!0,t.push(r))}}function y(t,e){e=m(e);var r=Qr.length,n=t.constructor,i=pn(n)&&n.prototype||Mr,a="constructor";for(c(t,a)&&!e.contains(a)&&e.push(a);r--;)(a=Qr[r])in t&&t[a]!==i[a]&&!e.contains(a)&&e.push(a)}function v(t){if(!r(t))return[];if($r)return $r(t);var e=[];for(var n in t)c(t,n)&&e.push(n);return Kr&&y(t,e),e}function g(t){return null==t||(wn(t)&&(un(t)||Xr(t)||mn(t))?0===t.length:0===v(t).length)}function b(t,e){var r=v(e),n=r.length;if(null==t)return!n;for(var i=Object(t),a=0;n>a;a++){var o=r[a];if(e[o]!==i[o]||!(o in i))return!1}return!0}function E(t){return t instanceof E?t:this instanceof E?void(this._wrapped=t):new E(t)}function w(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"===i||"object"===i||"object"==typeof e)&&S(t,e,r,n)}function S(t,e,r,n){t instanceof E&&(t=t._wrapped),e instanceof E&&(e=e._wrapped);var i=zr.call(t);if(i!==zr.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return Dr.valueOf.call(t)===Dr.valueOf.call(e);case"[object ArrayBuffer]":return S(new DataView(t),new DataView(e),r,n);case"[object DataView]":var a=yn(t);if(a!==yn(e))return!1;for(;a--;)if(t.getUint8(a)!==e.getUint8(a))return!1;return!0}if(bn(t))return S(new DataView(t.buffer),new DataView(e.buffer),r,n);var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var s=t.constructor,l=e.constructor;if(s!==l&&!(pn(s)&&s instanceof s&&pn(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}n=n||[];for(var u=(r=r||[]).length;u--;)if(r[u]===t)return n[u]===e;if(r.push(t),n.push(e),o){if((u=t.length)!==e.length)return!1;for(;u--;)if(!w(t[u],e[u],r,n))return!1}else{var f,h=v(t);if(u=h.length,v(e).length!==u)return!1;for(;u--;)if(!c(e,f=h[u])||!w(t[f],e[f],r,n))return!1}return r.pop(),n.pop(),!0}function k(t,e){return w(t,e)}function O(t){if(!r(t))return[];var e=[];for(var n in t)e.push(n);return Kr&&y(t,e),e}function _(t){for(var e=v(t),r=e.length,n=Array(r),i=0;r>i;i++)n[i]=t[e[i]];return n}function j(t){for(var e=v(t),r=e.length,n=Array(r),i=0;r>i;i++)n[i]=[e[i],t[e[i]]];return n}function x(t){for(var e={},r=v(t),n=0,i=r.length;i>n;n++)e[t[r[n]]]=r[n];return e}function A(t){var e=[];for(var r in t)pn(t[r])&&e.push(r);return e.sort()}function I(t,e){return function(r){var n=arguments.length;if(e&&(r=Object(r)),2>n||null==r)return r;for(var i=1;n>i;i++)for(var a=arguments[i],o=t(a),s=o.length,c=0;s>c;c++){var l=o[c];e&&void 0!==r[l]||(r[l]=a[l])}return r}}function T(){return()=>{}}function L(t){if(!r(t))return{};if(Ur)return Ur(t);var e=T();e.prototype=t;var n=new e;return e.prototype=null,n}function C(t,e){var r=L(t);return e&&kn(r,e),r}function N(t){return r(t)?un(t)?t.slice():Sn({},t):t}function P(t,e){return e(t),t}function M(t,e){if(!un(e))return c(t,e);for(var r=e.length,n=0;r>n;n++){var i=e[n];if(null==t||!qr.call(t,i))return!1;t=t[i]}return!!r}function D(t){return t}function R(t){return t=kn({},t),e=>b(e,t)}function F(t,e){for(var r=e.length,n=0;r>n;n++){if(null==t)return;t=t[e[n]]}return r?t:void 0}function z(t){return un(t)?e=>F(e,t):p(t)}function q(t,e,r){if(void 0===e)return t;switch(null==r?3:r){case 1:return r=>t.call(e,r);case 3:return(r,n,i)=>t.call(e,r,n,i);case 4:return(r,n,i,a)=>t.call(e,r,n,i,a)}return function(){return t.apply(e,arguments)}}function B(t,e,n){return null==t?D:pn(t)?q(t,e,n):r(t)&&!un(t)?R(t):z(t)}function G(t,e){return B(t,e,1/0)}function $(t,e,r){return E.iteratee!==G?E.iteratee(t,e):B(t,e,r)}function U(t,e,r){e=$(e,r);for(var n=v(t),i=n.length,a={},o=0;i>o;o++){var s=n[o];a[s]=e(t[s],s,t)}return a}function H(){}function W(t){return null==t?()=>{}:e=>un(e)?F(t,e):t[e]}function V(t,e,r){var n=Array(Math.max(0,t));e=q(e,r,1);for(var i=0;t>i;i++)n[i]=e(i);return n}function K(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}function Q(t){var e=e=>t[e],r="(?:"+v(t).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return t=>n.test(t=null==t?"":""+t)?t.replace(i,e):t}function Z(t){return"\\"+Cn[t]}function X(t,e,r){!e&&r&&(e=r),e=On({},e,E.templateSettings);var n,i=RegExp([(e.escape||Ln).source,(e.interpolate||Ln).source,(e.evaluate||Ln).source].join("|")+"|$","g"),a=0,o="__p+='";t.replace(i,((e,r,n,i,s)=>(o+=t.slice(a,s).replace(Nn,Z),a=s+e.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(o+="';\n"+i+"\n__p+='"),e))),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return n.call(this,t,E)};return s.source="function("+(e.variable||"obj")+"){\n"+o+"}",s}function Y(t,e,r){un(e)||(e=[e]);var n=e.length;if(!n)return pn(r)?r.call(t):r;for(var i=0;n>i;i++){var a=null==t?void 0:t[e[i]];void 0===a&&(a=r,i=n),t=pn(a)?a.call(t):a}return t}function J(t){var e=++Pn+"";return t?t+e:e}function tt(t){var e=E(t);return e._chain=!0,e}function et(t,e,n,i,a){if(!(i instanceof e))return t.apply(n,a);var o=L(t.prototype),s=t.apply(o,a);return r(s)?s:o}function rt(t,e,r,n){if(n=n||[],e||0===e){if(0>=e)return n.concat(t)}else e=1/0;for(var i=n.length,a=0,o=En(t);o>a;a++){var s=t[a];if(wn(s)&&(un(s)||mn(s)))if(e>1)rt(s,e-1,r,n),i=n.length;else for(var c=0,l=s.length;l>c;)n[i++]=s[c++];else r||(n[i++]=s)}return n}function nt(t,e){var r=function(n){var i=r.cache,a=""+(e?e.apply(this,arguments):n);return c(i,a)||(i[a]=t.apply(this,arguments)),i[a]};return r.cache={},r}function it(t,e,r){var n,i,a,o,s=0;r||(r={});var c=()=>{s=!1===r.leading?0:_n(),n=null,o=t.apply(i,a),n||(i=a=null)},l=function(){var l=_n();s||!1!==r.leading||(s=l);var u=e-(l-s);return i=this,a=arguments,0>=u||u>e?(n&&(clearTimeout(n),n=null),s=l,o=t.apply(i,a),n||(i=a=null)):n||!1===r.trailing||(n=setTimeout(c,u)),o};return l.cancel=()=>{clearTimeout(n),s=0,n=i=a=null},l}function at(t,r,n){var i,a,o=(e,r)=>{i=null,r&&(a=t.apply(e,r))},s=e((function(e){if(i&&clearTimeout(i),n){var s=!i;i=setTimeout(o,r),s&&(a=t.apply(this,e))}else i=Fn(o,r,this,e);return a}));return s.cancel=()=>{clearTimeout(i),i=null},s}function ot(t,e){return Mn(e,t)}function st(t){return function(){return!t.apply(this,arguments)}}function ct(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function lt(t,e){return function(){if(1>--t)return e.apply(this,arguments)}}function ut(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t>1||(e=null),r}}function ft(t,e,r){e=$(e,r);for(var n,i=v(t),a=0,o=i.length;o>a;a++)if(e(t[n=i[a]],n,t))return n}function ht(t){return(e,r,n)=>{r=$(r,n);for(var i=En(e),a=t>0?0:i-1;a>=0&&i>a;a+=t)if(r(e[a],a,e))return a;return-1}}function pt(t,e,r,n){for(var i=(r=$(r,n,1))(e),a=0,o=En(t);o>a;){var s=Math.floor((a+o)/2);r(t[s]){var o=0,s=En(n);if("number"==typeof a)t>0?o=0>a?Math.max(a+s,o):a:s=0>a?a+s+1:Math.min(a+1,s);else if(r&&a&&s)return n[a=r(n,i)]===i?a:-1;if(i!=i)return 0>(a=e(Fr.call(n,o,s),u))?-1:a+o;for(a=t>0?o:s-1;a>=0&&s>a;a+=t)if(n[a]===i)return a;return-1}}function mt(t,e,r){var n=(wn(t)?Bn:ft)(t,e,r);if(void 0!==n&&-1!==n)return t[n]}function yt(t,e){return mt(t,R(e))}function vt(t,e,r){var n,i;if(e=q(e,r),wn(t))for(n=0,i=t.length;i>n;n++)e(t[n],n,t);else{var a=v(t);for(n=0,i=a.length;i>n;n++)e(t[a[n]],a[n],t)}return t}function gt(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=Array(i),o=0;i>o;o++){var s=n?n[o]:o;a[o]=e(t[s],s,t)}return a}function bt(t){var e=(e,r,n,i)=>{var a=!wn(e)&&v(e),o=(a||e).length,s=t>0?0:o-1;for(i||(n=e[a?a[s]:s],s+=t);s>=0&&o>s;s+=t){var c=a?a[s]:s;n=r(n,e[c],c,e)}return n};return function(t,r,n,i){var a=arguments.length>=3;return e(t,q(r,i,4),n,a)}}function Et(t,e,r){var n=[];return e=$(e,r),vt(t,((t,r,i)=>{e(t,r,i)&&n.push(t)})),n}function wt(t,e,r){return Et(t,st($(e)),r)}function St(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=0;i>a;a++){var o=n?n[a]:a;if(!e(t[o],o,t))return!1}return!0}function kt(t,e,r){e=$(e,r);for(var n=!wn(t)&&v(t),i=(n||t).length,a=0;i>a;a++){var o=n?n[a]:a;if(e(t[o],o,t))return!0}return!1}function Ot(t,e,r,n){return wn(t)||(t=_(t)),("number"!=typeof r||n)&&(r=0),$n(t,e,r)>=0}function _t(t,e){return gt(t,z(e))}function jt(t,e){return Et(t,R(e))}function xt(t,e,r){var n,i,a=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=wn(t)?t:_(t)).length;c>s;s++)null!=(n=t[s])&&n>a&&(a=n);else e=$(e,r),vt(t,((t,r,n)=>{((i=e(t,r,n))>o||i===-1/0&&a===-1/0)&&(a=t,o=i)}));return a}function At(t,e,r){var n,i,a=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,c=(t=wn(t)?t:_(t)).length;c>s;s++)null!=(n=t[s])&&a>n&&(a=n);else e=$(e,r),vt(t,((t,r,n)=>{i=e(t,r,n),(o>i||i===1/0&&a===1/0)&&(a=t,o=i)}));return a}function It(t,e,r){if(null==e||r)return wn(t)||(t=_(t)),t[K(t.length-1)];var n=wn(t)?N(t):_(t),i=En(n);e=Math.max(Math.min(e,i),0);for(var a=i-1,o=0;e>o;o++){var s=K(o,a),c=n[o];n[o]=n[s],n[s]=c}return n.slice(0,e)}function Tt(t){return It(t,1/0)}function Lt(t,e,r){var n=0;return e=$(e,r),_t(gt(t,((t,r,i)=>({value:t,index:n++,criteria:e(t,r,i)}))).sort(((t,e)=>{var r=t.criteria,n=e.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(n>r||void 0===n)return-1}return t.index-e.index})),"value")}function Ct(t,e){return(r,n,i)=>{var a=e?[[],[]]:{};return n=$(n,i),vt(r,((e,i)=>{var o=n(e,i,r);t(a,e,o)})),a}}function Nt(t){return t?un(t)?Fr.call(t):Xr(t)?t.match(Yn):wn(t)?gt(t,D):_(t):[]}function Pt(t){return null==t?0:wn(t)?t.length:v(t).length}function Mt(t,e,r){return e in r}function Dt(t,e,r){return Fr.call(t,0,Math.max(0,t.length-(null==e||r?1:e)))}function Rt(t,e,r){return null==t||1>t.length?null==e||r?void 0:[]:null==e||r?t[0]:Dt(t,t.length-e)}function Ft(t,e,r){return Fr.call(t,null==e||r?1:e)}function zt(t,e,r){return null==t||1>t.length?null==e||r?void 0:[]:null==e||r?t[t.length-1]:Ft(t,Math.max(0,t.length-e))}function qt(t){return Et(t,Boolean)}function Bt(t,e){return rt(t,e,!1)}function Gt(t,e,r,n){a(e)||(n=r,r=e,e=!1),null!=r&&(r=$(r,n));for(var i=[],o=[],s=0,c=En(t);c>s;s++){var l=t[s],u=r?r(l,s,t):l;e&&!r?(s&&o===u||i.push(l),o=u):r?Ot(o,u)||(o.push(u),i.push(l)):Ot(i,l)||i.push(l)}return i}function $t(t){for(var e=[],r=arguments.length,n=0,i=En(t);i>n;n++){var a=t[n];if(!Ot(e,a)){var o;for(o=1;r>o&&Ot(arguments[o],a);o++);o===r&&e.push(a)}}return e}function Ut(t){for(var e=t&&xt(t,En).length||0,r=Array(e),n=0;e>n;n++)r[n]=_t(t,n);return r}function Ht(t,e){for(var r={},n=0,i=En(t);i>n;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r}function Wt(t,e,r){null==e&&(e=t||0,t=0),r||(r=t>e?-1:1);for(var n=Math.max(Math.ceil((e-t)/r),0),i=Array(n),a=0;n>a;a++,t+=r)i[a]=t;return i}function Vt(t,e){if(null==e||1>e)return[];for(var r=[],n=0,i=t.length;i>n;)r.push(Fr.call(t,n,n+=e));return r}function Kt(t,e){return t._chain?E(e).chain():e}function Qt(t){return vt(A(t),(function(e){var r=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return Rr.apply(t,arguments),Kt(this,r.apply(E,t))}})),E}function Zt(t,e,r,n){"function"==typeof e?(r=e,e={}):e&&"object"==typeof e||(e={mode:e});var i=e.mode,a=e.fs||jr.default;void 0===i&&(i=fi),n||(n=null);var o=r||(()=>{});t=_r.default.resolve(t),a.mkdir(t,i,(r=>{if(!r)return o(null,n=n||t);switch(r.code){case"ENOENT":if(_r.default.dirname(t)===t)return o(r);Zt(_r.default.dirname(t),e,((r,n)=>{r?o(r,n):Zt(t,e,o,n)}));break;default:a.stat(t,((t,e)=>{t||!e.isDirectory()?o(r,n):o(null,n)}))}}))}function Xt(){function t(t){if(t){if(process.throwDeprecation)throw t;if(!process.noDeprecation){var e="fs: missing callback "+(t.stack||t.message);process.traceDeprecation?console.trace(e):console.error(e)}}}var e;if(di){var r=Error();e=e=>{e&&(r.message=e.message,t(e=r))}}else e=t;return e}function Yt(t){return"function"==typeof t?t:Xt()}function Jt(t){return t&&"realpath"===t.syscall&&("ELOOP"===t.code||"ENOMEM"===t.code||"ENAMETOOLONG"===t.code)}function te(t,e,r){if(_i)return Si(t,e,r);"function"==typeof e&&(r=e,e=null),Si(t,e,((n,i)=>{Jt(n)?Ei.realpath(t,e,r):r(n,i)}))}function ee(t,e){if(_i)return ki(t,e);try{return ki(t,e)}catch(r){if(Jt(r))return Ei.realpathSync(t,e);throw r}}function re(){jr.default.realpath=te,jr.default.realpathSync=ee}function ne(){jr.default.realpath=Si,jr.default.realpathSync=ki}function ie(t,e,r){t instanceof RegExp&&(t=ae(t,r)),e instanceof RegExp&&(e=ae(e,r));var n=oe(t,e,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+t.length,n[1]),post:r.slice(n[1]+e.length)}}function ae(t,e){var r=e.match(t);return r?r[0]:null}function oe(t,e,r){var n,i,a,o,s,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){for(n=[],a=r.length;u>=0&&!s;)u==c?(n.push(u),c=r.indexOf(t,u+1)):1==n.length?s=[n.pop(),l]:(a>(i=n.pop())&&(a=i,o=l),l=r.indexOf(e,u+1)),u=l>c&&c>=0?c:l;n.length&&(s=[a,o])}return s}function se(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function ce(t){return t.split("\\\\").join(Ti).split("\\{").join(Li).split("\\}").join(Ci).split("\\,").join(Ni).split("\\.").join(Pi)}function le(t){return t.split(Ti).join("\\").split(Li).join("{").split(Ci).join("}").split(Ni).join(",").split(Pi).join(".")}function ue(t){if(!t)return[""];var e=[],r=Ai("{","}",t);if(!r)return t.split(",");var n=r.body,i=r.post,a=r.pre.split(",");a[a.length-1]+="{"+n+"}";var o=ue(i);return i.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function fe(t){return t?("{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2)),ye(ce(t),!0).map(le)):[]}function he(t){return"{"+t+"}"}function pe(t){return/^-?0\d/.test(t)}function de(t,e){return e>=t}function me(t,e){return t>=e}function ye(t,e){var r=[],n=Ai("{","}",t);if(!n||/\$$/.test(n.pre))return[t];var i,a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),s=a||o,c=n.body.indexOf(",")>=0;if(!s&&!c)return n.post.match(/,.*\}/)?ye(t=n.pre+"{"+n.body+Ci+n.post):[t];if(s)i=n.body.split(/\.\./);else if(1===(i=ue(n.body)).length&&1===(i=ye(i[0],!1).map(he)).length)return(f=n.post.length?ye(n.post,!1):[""]).map((t=>n.pre+i[0]+t));var l,u=n.pre,f=n.post.length?ye(n.post,!1):[""];if(s){var h=se(i[0]),p=se(i[1]),d=Math.max(i[0].length,i[1].length),m=3==i.length?Math.abs(se(i[2])):1,y=de;h>p&&(m*=-1,y=me);var v=i.some(pe);l=[];for(var g=h;y(g,p);g+=m){var b;if(o)"\\"===(b=String.fromCharCode(g))&&(b="");else if(b=g+"",v){var E=d-b.length;if(E>0){var w=Array(E+1).join("0");b=0>g?"-"+w+b.slice(1):w+b}}l.push(b)}}else l=ji(i,(t=>ye(t,!1)));for(var S=0;l.length>S;S++)for(var k=0;f.length>k;k++){var O=u+l[S]+f[k];(!e||s||O)&&r.push(O)}return r}function ve(t){return t.split("").reduce(((t,e)=>(t[e]=!0,t)),{})}function ge(t,e){return e=e||{},(r,n,i)=>Ee(r,t,e)}function be(t,e){t=t||{};var r={};return Object.keys(e=e||{}).forEach((t=>{r[t]=e[t]})),Object.keys(t).forEach((e=>{r[e]=t[e]})),r}function Ee(t,e,r){if("string"!=typeof e)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new we(e,r).match(t))}function we(t,e){if(!(this instanceof we))return new we(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),t=t.trim(),"/"!==Di.sep&&(t=t.split(Di.sep).join("/")),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function Se(){if(!this._made){var t=this.pattern,e=this.options;if(e.nocomment||"#"!==t.charAt(0))if(t){this.parseNegate();var r=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,r),r=this.globParts=r.map((t=>t.split(Ui))),this.debug(this.pattern,r),r=r.map((function(t,e,r){return t.map(this.parse,this)}),this),this.debug(this.pattern,r),r=r.filter((t=>-1===t.indexOf(!1))),this.debug(this.pattern,r),this.set=r}else this.empty=!0;else this.comment=!0}}function ke(){var t=this.pattern,e=!1,r=0;if(!this.options.nonegate){for(var n=0,i=t.length;i>n&&"!"===t.charAt(n);n++)e=!e,r++;r&&(this.pattern=t.substr(r)),this.negate=e}}function Oe(t,e){if(e||(e=this instanceof we?this.options:{}),void 0===(t=void 0===t?this.pattern:t))throw new TypeError("undefined pattern");return e.nobrace||!t.match(/\{.*\}/)?[t]:Ii(t)}function _e(t,e){function r(){if(i){switch(i){case"*":o+=qi,s=!0;break;case"?":o+=zi,s=!0;break;default:o+="\\"+i}m.debug("clearStateChar %j %j",i,o),i=!1}}if(t.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===t)return Ri;if(""===t)return"";for(var i,a,o="",s=!!n.nocase,c=!1,l=[],u=[],f=!1,h=-1,p=-1,d="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this,y=0,v=t.length;v>y&&(a=t.charAt(y));y++)if(this.debug("%s\t%s %s %j",t,y,o,a),c&&$i[a])o+="\\"+a,c=!1;else switch(a){case"/":return!1;case"\\":r(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,y,o,a),f){this.debug(" in class"),"!"===a&&y===p+1&&(a="^"),o+=a;continue}m.debug("call clearStateChar %j",i),r(),i=a,n.noext&&r();continue;case"(":if(f){o+="(";continue}if(!i){o+="\\(";continue}l.push({type:i,start:y-1,reStart:o.length,open:Fi[i].open,close:Fi[i].close}),this.debug("plType %j %j",i,o+="!"===i?"(?:(?!(?:":"(?:"),i=!1;continue;case")":if(f||!l.length){o+="\\)";continue}r(),s=!0;var g=l.pop();o+=g.close,"!"===g.type&&u.push(g),g.reEnd=o.length;continue;case"|":if(f||!l.length||c){o+="\\|",c=!1;continue}r(),o+="|";continue;case"[":if(r(),f){o+="\\"+a;continue}f=!0,p=y,h=o.length,o+=a;continue;case"]":if(y===p+1||!f){o+="\\"+a,c=!1;continue}if(f){var b=t.substring(p+1,y);try{RegExp("["+b+"]")}catch(t){var E=this.parse(b,Hi);o=o.substr(0,h)+"\\["+E[0]+"\\]",s=s||E[1],f=!1;continue}}s=!0,f=!1,o+=a;continue;default:r(),c?c=!1:!$i[a]||"^"===a&&f||(o+="\\"),o+=a}for(f&&(b=t.substr(p+1),E=this.parse(b,Hi),o=o.substr(0,h)+"\\["+E[0],s=s||E[1]),g=l.pop();g;g=l.pop()){var w=o.slice(g.reStart+g.open.length);this.debug("setting tail",o,g),w=w.replace(/((?:\\{2}){0,64})(\\?)\|/g,((t,e,r)=>(r||(r="\\"),e+e+r+"|"))),this.debug("tail=%j\n %s",w,w,g,o);var S="*"===g.type?qi:"?"===g.type?zi:"\\"+g.type;s=!0,o=o.slice(0,g.reStart)+S+"\\("+w}r(),c&&(o+="\\\\");var k=!1;switch(o.charAt(0)){case".":case"[":case"(":k=!0}for(var O=u.length-1;O>-1;O--){var _=u[O],j=o.slice(0,_.reStart),x=o.slice(_.reStart,_.reEnd-8),A=o.slice(_.reEnd-8,_.reEnd),I=o.slice(_.reEnd);A+=I;var T=j.split("(").length-1,L=I;for(y=0;T>y;y++)L=L.replace(/\)[+*?]?/,"");var C="";""===(I=L)&&e!==Hi&&(C="$"),o=j+x+I+C+A}if(""!==o&&s&&(o="(?=.)"+o),k&&(o=d+o),e===Hi)return[o,s];if(!s)return Ae(t);var N=n.nocase?"i":"";try{var P=RegExp("^"+o+"$",N)}catch(t){return/$./}return P._glob=t,P._src=o,P}function je(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1,this.regexp;var e=this.options,r=e.noglobstar?qi:e.dot?Bi:Gi,n=e.nocase?"i":"",i=t.map((t=>t.map((t=>t===Ri?r:"string"==typeof t?Ie(t):t._src)).join("\\/"))).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{this.regexp=RegExp(i,n)}catch(t){this.regexp=!1}return this.regexp}function xe(t,e){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var r=this.options;"/"!==Di.sep&&(t=t.split(Di.sep).join("/")),t=t.split(Ui),this.debug(this.pattern,"split",t);var n,i,a=this.set;for(this.debug(this.pattern,"set",a),i=t.length-1;i>=0&&!(n=t[i]);i--);for(i=0;a.length>i;i++){var o=a[i],s=t;if(r.matchBase&&1===o.length&&(s=[n]),this.matchOne(s,o,e))return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate}function Ae(t){return t.replace(/\\(.)/g,"$1")}function Ie(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function Te(t){return"/"===t.charAt(0)}function Le(t){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(t),r=e[1]||"",n=!(!r||":"===r.charAt(1));return!(!e[2]&&!n)}function Ce(t,e){return{}.hasOwnProperty.call(t,e)}function Ne(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())}function Pe(t,e){return t.localeCompare(e)}function Me(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]),t.ignore.length&&(t.ignore=t.ignore.map(De))}function De(t){var e=null;if("/**"===t.slice(-3)){var r=t.replace(/(\/\*\*)+$/,"");e=new oa(r,{dot:!0})}return{matcher:new oa(t,{dot:!0}),gmatcher:e}}function Re(t,e,r){if(r||(r={}),r.matchBase&&-1===e.indexOf("/")){if(r.noglobstar)throw Error("base matching requires globstar");e="**/"+e}t.silent=!!r.silent,t.pattern=e,t.strict=!1!==r.strict,t.realpath=!!r.realpath,t.realpathCache=r.realpathCache||Object.create(null),t.follow=!!r.follow,t.dot=!!r.dot,t.mark=!!r.mark,t.nodir=!!r.nodir,t.nodir&&(t.mark=!0),t.sync=!!r.sync,t.nounique=!!r.nounique,t.nonull=!!r.nonull,t.nosort=!!r.nosort,t.nocase=!!r.nocase,t.stat=!!r.stat,t.noprocess=!!r.noprocess,t.absolute=!!r.absolute,t.maxLength=r.maxLength||1/0,t.cache=r.cache||Object.create(null),t.statCache=r.statCache||Object.create(null),t.symlinks=r.symlinks||Object.create(null),Me(t,r),t.changedCwd=!1;var n=process.cwd();Ce(r,"cwd")?(t.cwd=_r.default.resolve(r.cwd),t.changedCwd=t.cwd!==n):t.cwd=n,t.root=r.root||_r.default.resolve(t.cwd,"/"),t.root=_r.default.resolve(t.root),"win32"===process.platform&&(t.root=t.root.replace(/\\/g,"/")),t.cwdAbs=Ki(t.cwd)?t.cwd:qe(t,t.cwd),"win32"===process.platform&&(t.cwdAbs=t.cwdAbs.replace(/\\/g,"/")),t.nomount=!!r.nomount,r.nonegate=!0,r.nocomment=!0,t.minimatch=new oa(e,r),t.options=t.minimatch.options}function Fe(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;i>n;n++){var a=t.matches[n];if(a&&0!==Object.keys(a).length){var o=Object.keys(a);e?r.push.apply(r,o):o.forEach((t=>{r[t]=!0}))}else if(t.nonull){var s=t.minimatch.globSet[n];e?r.push(s):r[s]=!0}}if(e||(r=Object.keys(r)),t.nosort||(r=r.sort(t.nocase?Ne:Pe)),t.mark){for(n=0;r.length>n;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter((e=>{var r=!/\/$/.test(e),n=t.cache[e]||t.cache[qe(t,e)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r})))}t.ignore.length&&(r=r.filter((e=>!Be(t,e)))),t.found=r}function ze(t,e){var r=qe(t,e),n=t.cache[r],i=e;if(n){var a="DIR"===n||Array.isArray(n),o="/"===e.slice(-1);if(a&&!o?i+="/":!a&&o&&(i=i.slice(0,-1)),i!==e){var s=qe(t,i);t.statCache[s]=t.statCache[r],t.cache[s]=t.cache[r]}}return i}function qe(t,e){var r=e;return r="/"===e.charAt(0)?_r.default.join(t.root,e):Ki(e)||""===e?e:t.changedCwd?_r.default.resolve(t.cwd,e):_r.default.resolve(e),"win32"===process.platform&&(r=r.replace(/\\/g,"/")),r}function Be(t,e){return!!t.ignore.length&&t.ignore.some((t=>t.matcher.match(e)||!(!t.gmatcher||!t.gmatcher.match(e))))}function Ge(t,e){return!!t.ignore.length&&t.ignore.some((t=>!(!t.gmatcher||!t.gmatcher.match(e))))}function $e(t,e){if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new Ue(t,e).found}function Ue(t,e){if(!t)throw Error("must provide pattern");if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof Ue))return new Ue(t,e);if(la(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=Array(r);for(var n=0;r>n;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}function He(t,e){function r(){for(var e=Array(arguments.length),r=0;e.length>r;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((t=>{n[t]=i[t]})),n}if(t&&e)return He(t)(e);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((e=>{r[e]=t[e]})),r}function We(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function Ve(t){var e=function(){if(e.called)throw Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)};return e.onceError=(t.name||"Function wrapped with `once`")+" shouldn't be called more than once",e.called=!1,e}function Ke(t,e){return ya[t]?(ya[t].push(e),null):(ya[t]=[e],Qe(t))}function Qe(t){return da((function e(){var r=ya[t],n=r.length,i=Ze(arguments);try{for(var a=0;n>a;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick((()=>{e.apply(null,i)}))):delete ya[t]}}))}function Ze(t){for(var e=t.length,r=[],n=0;e>n;n++)r[n]=t[n];return r}function Xe(t,e,r){if("function"==typeof e&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return ca(t,e)}return new Je(t,e,r)}function Ye(t,e){if(null===e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function Je(t,e,r){function n(){--a._processing,a._processing>0||a._finish()}if("function"==typeof e&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new Oa(t,e)}if(!(this instanceof Je))return new Je(t,e,r);Ea(this,t,e),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=Array(i),"function"==typeof r&&(r=da(r),this.on("error",r),this.on("end",(t=>{r(null,t)})));var a=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===i)return n();for(var o=0;i>o;o++)this._process(this.minimatch.set[o],o,!1,n)}function tr(t,e,r){return(n,i)=>{n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}function er(t){if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((e=>{t[e]=t[e]||jr.default[e],t[e+="Sync"]=t[e]||jr.default[e]})),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,!1===t.glob&&(t.disableGlob=!0),!0!==t.disableGlob&&void 0===ja)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");t.disableGlob=t.disableGlob||!1,t.glob=t.glob||Aa}function rr(t,e,r){function n(t,n){return t?r(t):0===(o=n.length)?r():void n.forEach((t=>{nr(t,e,(function n(s){if(s){if(("EBUSY"===s.code||"ENOTEMPTY"===s.code||"EPERM"===s.code)&&e.maxBusyTries>i)return i++,setTimeout((()=>{nr(t,e,n)}),100*i);if("EMFILE"===s.code&&e.emfileWait>Ia)return setTimeout((()=>{nr(t,e,n)}),Ia++);"ENOENT"===s.code&&(s=null)}Ia=0,(t=>{a=a||t,0==--o&&r(a)})(s)}))}))}"function"==typeof e&&(r=e,e={}),Ar.default(t,"rimraf: missing path"),Ar.default.equal(typeof t,"string","rimraf: path should be a string"),Ar.default.equal(typeof r,"function","rimraf: callback function required"),Ar.default(e,"rimraf: invalid options argument provided"),Ar.default.equal(typeof e,"object","rimraf: options should be object"),er(e);var i=0,a=null,o=0;if(e.disableGlob||!ja.hasMagic(t))return n(null,[t]);e.lstat(t,((r,i)=>{if(!r)return n(null,[t]);ja(t,e.glob,n)}))}function nr(t,e,r){Ar.default(t),Ar.default(e),Ar.default("function"==typeof r),e.lstat(t,((n,i)=>n&&"ENOENT"===n.code?r(null):(n&&"EPERM"===n.code&&Ta&&ir(t,e,n,r),i&&i.isDirectory()?or(t,e,n,r):void e.unlink(t,(n=>{if(n){if("ENOENT"===n.code)return r(null);if("EPERM"===n.code)return Ta?ir(t,e,n,r):or(t,e,n,r);if("EISDIR"===n.code)return or(t,e,n,r)}return r(n)})))))}function ir(t,e,r,n){Ar.default(t),Ar.default(e),Ar.default("function"==typeof n),r&&Ar.default(r instanceof Error),e.chmod(t,xa,(i=>{i?n("ENOENT"===i.code?null:r):e.stat(t,((i,a)=>{i?n("ENOENT"===i.code?null:r):a.isDirectory()?or(t,e,r,n):e.unlink(t,n)}))}))}function ar(t,e,r){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error);try{e.chmodSync(t,xa)}catch(t){if("ENOENT"===t.code)return;throw r}try{var n=e.statSync(t)}catch(t){if("ENOENT"===t.code)return;throw r}n.isDirectory()?lr(t,e,r):e.unlinkSync(t)}function or(t,e,r,n){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error),Ar.default("function"==typeof n),e.rmdir(t,(i=>{!i||"ENOTEMPTY"!==i.code&&"EEXIST"!==i.code&&"EPERM"!==i.code?n(i&&"ENOTDIR"===i.code?r:i):sr(t,e,n)}))}function sr(t,e,r){Ar.default(t),Ar.default(e),Ar.default("function"==typeof r),e.readdir(t,((n,i)=>{if(n)return r(n);var a,o=i.length;if(0===o)return e.rmdir(t,r);i.forEach((n=>{rr(_r.default.join(t,n),e,(n=>{if(!a)return n?r(a=n):void(0==--o&&e.rmdir(t,r))}))}))}))}function cr(t,e){var r;if(er(e=e||{}),Ar.default(t,"rimraf: missing path"),Ar.default.equal(typeof t,"string","rimraf: path should be a string"),Ar.default(e,"rimraf: missing options"),Ar.default.equal(typeof e,"object","rimraf: options should be object"),e.disableGlob||!ja.hasMagic(t))r=[t];else try{e.lstatSync(t),r=[t]}catch(n){r=ja.sync(t,e.glob)}if(r.length)for(var n=0;r.length>n;n++){t=r[n];try{var i=e.lstatSync(t)}catch(r){if("ENOENT"===r.code)return;"EPERM"===r.code&&Ta&&ar(t,e,r)}try{i&&i.isDirectory()?lr(t,e,null):e.unlinkSync(t)}catch(r){if("ENOENT"===r.code)return;if("EPERM"===r.code)return Ta?ar(t,e,r):lr(t,e,r);if("EISDIR"!==r.code)throw r;lr(t,e,r)}}}function lr(t,e,r){Ar.default(t),Ar.default(e),r&&Ar.default(r instanceof Error);try{e.rmdirSync(t)}catch(n){if("ENOENT"===n.code)return;if("ENOTDIR"===n.code)throw r;"ENOTEMPTY"!==n.code&&"EEXIST"!==n.code&&"EPERM"!==n.code||ur(t,e)}}function ur(t,e){Ar.default(t),Ar.default(e),e.readdirSync(t).forEach((r=>{cr(_r.default.join(t,r),e)}));for(var r=Ta?100:1,n=0;;){var i=!0;try{var a=e.rmdirSync(t,e);return i=!1,a}finally{if(++n"function"==typeof t||!1);const pn=fn;var dn=s("Arguments");!function(){dn(arguments)||(dn=t=>c(t,"callee"))}();const mn=dn,yn=p("byteLength"),vn=h(yn);var gn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const bn=Br?d:f(!1),En=p("length"),wn=h(En);E.VERSION=Cr,E.prototype.value=function(){return this._wrapped},E.prototype.valueOf=E.prototype.toJSON=E.prototype.value,E.prototype.toString=function(){return this._wrapped+""};const Sn=I(O),kn=I(v),On=I(O,!0);E.iteratee=G;const _n=Date.now||(()=>(new Date).getTime()),jn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},xn=Q(jn),An=x(jn),In=Q(An),Tn=E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Ln=/(.)^/,Cn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Nn=/\\|'|\r|\n|\u2028|\u2029/g,Pn=0,Mn=e((function(t,e){var r=Mn.placeholder,n=function(){for(var i=0,a=e.length,o=Array(a),s=0;a>s;s++)o[s]=e[s]===r?arguments[i++]:e[s];for(;arguments.length>i;)o.push(arguments[i++]);return et(t,n,this,this,o)};return n}));Mn.placeholder=E;const Dn=e((function(t,r,n){if(!pn(t))throw new TypeError("Bind must be called on a function");var i=e((function(e){return et(t,i,r,this,n.concat(e))}));return i})),Rn=e(((t,e)=>{var r=(e=rt(e,!1,!1)).length;if(1>r)throw Error("bindAll must be passed function names");for(;r--;){var n=e[r];t[n]=Dn(t[n],t)}return t})),Fn=e(((t,e,r)=>setTimeout((()=>t.apply(null,r)),e))),zn=Mn(Fn,E,1),qn=Mn(ut,2),Bn=ht(1),Gn=ht(-1),$n=dt(1,Bn,pt),Un=dt(-1,Gn),Hn=bt(1),Wn=bt(-1),Vn=e(((t,e,r)=>{var n,i;return pn(e)?i=e:un(e)&&(n=e.slice(0,-1),e=e[e.length-1]),gt(t,(t=>{var a=i;if(!a){if(n&&n.length&&(t=F(t,n)),null==t)return;a=t[e]}return null==a?a:a.apply(t,r)}))})),Kn=Ct(((t,e,r)=>{c(t,r)?t[r].push(e):t[r]=[e]})),Qn=Ct(((t,e,r)=>{t[r]=e})),Zn=Ct(((t,e,r)=>{c(t,r)?t[r]++:t[r]=1})),Xn=Ct(((t,e,r)=>{t[r?0:1].push(e)}),!0);var Yn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;const Jn=e(((t,e)=>{var r={},n=e[0];if(null==t)return r;pn(n)?(e.length>1&&(n=q(n,e[1])),e=O(t)):(n=Mt,e=rt(e,!1,!1),t=Object(t));for(var i=0,a=e.length;a>i;i++){var o=e[i],s=t[o];n(s,o,t)&&(r[o]=s)}return r})),ti=e(((t,e)=>{var r,n=e[0];return pn(n)?(n=st(n),e.length>1&&(r=e[1])):(e=gt(rt(e,!1,!1),String),n=(t,r)=>!Ot(e,r)),Jn(t,n,r)})),ei=e(((t,e)=>(e=rt(e,!0,!0),Et(t,(t=>!Ot(e,t)))))),ri=e(((t,e)=>ei(t,e))),ni=e((t=>Gt(rt(t,!0,!0)))),ii=e(Ut);vt(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=Pr[t];E.prototype[t]=function(){var r=this._wrapped;return null!=r&&(e.apply(r,arguments),"shift"!==t&&"splice"!==t||0!==r.length||delete r[0]),Kt(this,r)}})),vt(["concat","join","slice"],(function(t){var e=Pr[t];E.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Kt(this,t)}}));const ai=Object.freeze({__proto__:null,VERSION:Cr,restArguments:e,isObject:r,isNull:n,isUndefined:i,isBoolean:a,isElement:o,isString:Xr,isNumber:Yr,isDate:Jr,isRegExp:tn,isError:en,isSymbol:rn,isMap:nn,isWeakMap:an,isSet:on,isWeakSet:sn,isArrayBuffer:cn,isDataView:ln,isArray:un,isFunction:pn,isArguments:mn,isFinite:l,isNaN:u,isTypedArray:bn,isEmpty:g,isMatch:b,isEqual:k,keys:v,allKeys:O,values:_,pairs:j,invert:x,functions:A,methods:A,extend:Sn,extendOwn:kn,assign:kn,defaults:On,create:C,clone:N,tap:P,has:M,mapObject:U,identity:D,constant:f,noop:H,property:z,propertyOf:W,matcher:R,matches:R,times:V,random:K,now:_n,escape:xn,unescape:In,templateSettings:Tn,template:X,result:Y,uniqueId:J,chain:tt,iteratee:G,partial:Mn,bind:Dn,bindAll:Rn,memoize:nt,delay:Fn,defer:zn,throttle:it,debounce:at,wrap:ot,negate:st,compose:ct,after:lt,before:ut,once:qn,findKey:ft,findIndex:Bn,findLastIndex:Gn,sortedIndex:pt,indexOf:$n,lastIndexOf:Un,find:mt,detect:mt,findWhere:yt,each:vt,forEach:vt,map:gt,collect:gt,reduce:Hn,foldl:Hn,inject:Hn,reduceRight:Wn,foldr:Wn,filter:Et,select:Et,reject:wt,every:St,all:St,some:kt,any:kt,contains:Ot,includes:Ot,include:Ot,invoke:Vn,pluck:_t,where:jt,max:xt,min:At,shuffle:Tt,sample:It,sortBy:Lt,groupBy:Kn,indexBy:Qn,countBy:Zn,partition:Xn,toArray:Nt,size:Pt,pick:Jn,omit:ti,first:Rt,head:Rt,take:Rt,initial:Dt,last:zt,rest:Ft,tail:Ft,drop:Ft,compact:qt,flatten:Bt,without:ri,uniq:Gt,unique:Gt,union:ni,intersection:$t,difference:ei,unzip:Ut,transpose:Ut,zip:ii,object:Ht,range:Wt,chunk:Vt,mixin:Qt,default:E});var oi=Qt(ai);oi._=oi;const si=Object.freeze({__proto__:null,default:oi,VERSION:Cr,restArguments:e,isObject:r,isNull:n,isUndefined:i,isBoolean:a,isElement:o,isString:Xr,isNumber:Yr,isDate:Jr,isRegExp:tn,isError:en,isSymbol:rn,isMap:nn,isWeakMap:an,isSet:on,isWeakSet:sn,isArrayBuffer:cn,isDataView:ln,isArray:un,isFunction:pn,isArguments:mn,isFinite:l,isNaN:u,isTypedArray:bn,isEmpty:g,isMatch:b,isEqual:k,keys:v,allKeys:O,values:_,pairs:j,invert:x,functions:A,methods:A,extend:Sn,extendOwn:kn,assign:kn,defaults:On,create:C,clone:N,tap:P,has:M,mapObject:U,identity:D,constant:f,noop:H,property:z,propertyOf:W,matcher:R,matches:R,times:V,random:K,now:_n,escape:xn,unescape:In,templateSettings:Tn,template:X,result:Y,uniqueId:J,chain:tt,iteratee:G,partial:Mn,bind:Dn,bindAll:Rn,memoize:nt,delay:Fn,defer:zn,throttle:it,debounce:at,wrap:ot,negate:st,compose:ct,after:lt,before:ut,once:qn,findKey:ft,findIndex:Bn,findLastIndex:Gn,sortedIndex:pt,indexOf:$n,lastIndexOf:Un,find:mt,detect:mt,findWhere:yt,each:vt,forEach:vt,map:gt,collect:gt,reduce:Hn,foldl:Hn,inject:Hn,reduceRight:Wn,foldr:Wn,filter:Et,select:Et,reject:wt,every:St,all:St,some:kt,any:kt,contains:Ot,includes:Ot,include:Ot,invoke:Vn,pluck:_t,where:jt,max:xt,min:At,shuffle:Tt,sample:It,sortBy:Lt,groupBy:Kn,indexBy:Qn,countBy:Zn,partition:Xn,toArray:Nt,size:Pt,pick:Jn,omit:ti,first:Rt,head:Rt,take:Rt,initial:Dt,last:zt,rest:Ft,tail:Ft,drop:Ft,compact:qt,flatten:Bt,without:ri,uniq:Gt,unique:Gt,union:ni,intersection:$t,difference:ei,unzip:Ut,transpose:Ut,zip:ii,object:Ht,range:Wt,chunk:Vt,mixin:Qt}),ci=vr.getAugmentedNamespace(si);var li=vr.createCommonjsModule((function(t){!function(){var e,r,n,i,a,o,s,c,l=[].slice;n={cmd:"⌘",ctrl:"⌃",alt:"⌥",option:"⌥",shift:"⇧",enter:"⏎",left:"←",right:"→",up:"↑",down:"↓"},i={cmd:"Cmd",ctrl:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",enter:"Enter",left:"Left",right:"Right",up:"Up",down:"Down"},o={"~":"`",_:"-","+":"=","|":"\\","{":"[","}":"]",":":";",'"':"'","<":",",">":".","?":"/"},s=t=>{var e,r,n,i,a;if(n=0,r=[],null==t)return r;for(e=i=0,a=t.length;a>i;e=++i)"."!==t[e]||0!==e&&"\\"===t[e-1]||(r.push(t.substring(n,e)),n=e+1);return r.push(t.substr(n,t.length)),r},r=t=>c.isObject(t)&&!c.isArray(t),a={adviseBefore(t,e,r){var n;return n=t[e],t[e]=function(){var t;if(t=1>arguments.length?[]:l.call(arguments,0),!1!==r.apply(this,t))return n.apply(this,t)}},camelize:t=>t?t.replace(/[_-]+(\w)/g,(t=>t[1].toUpperCase())):"",capitalize:t=>t?"github"===t.toLowerCase()?"GitHub":t[0].toUpperCase()+t.slice(1):"",compactObject(t){var e,r,n;for(e in r={},t)null!=(n=t[e])&&(r[e]=n);return r},dasherize:t=>t?(t=t[0].toLowerCase()+t.slice(1)).replace(/([A-Z])|(_)/g,((t,e)=>e?"-"+e.toLowerCase():"-")):"",deepClone:t=>c.isArray(t)?t.map((t=>a.deepClone(t))):c.isObject(t)&&!c.isFunction(t)?a.mapObject(t,((t,e)=>[t,a.deepClone(e)])):t,deepExtend(t){var e,n,i,o,s,c,l;for(o=t,e=0;++es;s++)o[n=l[s]]=a.deepExtend(o[n],i[n]);else o=a.deepClone(i);return o},deepContains(t,e){var r,n;if(null==t)return!1;for(r=0,n=t.length;n>r;r++)if(c.isEqual(t[r],e))return!0;return!1},endsWith:(t,e)=>(null==e&&(e=""),!!t&&-1!==t.indexOf(e,t.length-e.length)),escapeAttribute:t=>t?t.replace(/"/g,""").replace(/\n/g,"").replace(/\\/g,"-"):"",escapeRegExp:t=>t?t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"):"",humanizeEventName(t,e){var r,n,i,o;return n=(o=t.split(":"))[0],null==(r=o[1])?a.undasherize(n):(i=a.undasherize(n),null==e&&(e=a.undasherize(r)),i+": "+e)},humanizeKey(t,e){var r;return null==e&&(e=process.platform),t?(r="darwin"===e?n:i)[t]?r[t]:1===t.length&&null!=o[t]?[r.shift,o[t]]:1===t.length&&t===t.toUpperCase()&&t.toUpperCase()!==t.toLowerCase()?[r.shift,t.toUpperCase()]:1===t.length||/f[0-9]{1,2}/.test(t)?t.toUpperCase():"darwin"===e?t:a.capitalize(t):t},humanizeKeystroke(t,e){var r,n,i,o,s,l,u,f,h,p;if(null==e&&(e=process.platform),!t)return t;for(r=[],u=0,h=(s=t.split(" ")).length;h>u;u++){for(o=[],n=f=0,p=(l=(t=s[u]).split("-")).length;p>f;n=++f)""===(i=l[n])&&""===l[n-1]&&(i="-"),i&&o.push(a.humanizeKey(i,e));o=(o=c.uniq(c.flatten(o))).join("darwin"===e?"":"+"),r.push(o)}return r.join(" ")},isSubset:(t,e)=>c.every(t,(t=>c.include(e,t))),losslessInvert(t){var e,r,n;for(r in e={},t)null==e[n=t[r]]&&(e[n]=[]),e[n].push(r);return e},mapObject(t,e){var r,n,i,a,o,s;for(n={},i=0,a=(o=Object.keys(t)).length;a>i;i++)n[r=(s=e(r=o[i],t[r]))[0]]=s[1];return n},multiplyString(t,e){var r,n;for(r="",n=0;e>n;)r+=t,n++;return r},pluralize:(t,e,r)=>(null==t&&(t=0),null==r&&(r=e+"s"),1===t?t+" "+e:t+" "+r),remove(t,e){var r;return 0>(r=t.indexOf(e))||t.splice(r,1),t},setValueForKeyPath(t,e,r){var n,i;for(i=s(e);i.length>1;)null==t[n=i.shift()]&&(t[n]={}),t=t[n];return null!=r?t[i.shift()]=r:delete t[i.shift()]},hasKeyPath(t,e){var r,n,i,a;for(i=0,a=(n=s(e)).length;a>i;i++){if(!t.hasOwnProperty(r=n[i]))return!1;t=t[r]}return!0},spliceWithArray(t,e,r,n,i){var a,o,s,c;if(null==i&&(i=1e5),i>n.length)return t.splice.apply(t,[e,r].concat(l.call(n)));for(t.splice(e,r),c=[],a=o=0,s=n.length;i>0?s>=o:o>=s;a=o+=i)c.push(t.splice.apply(t,[e+a,0].concat(l.call(n.slice(a,a+i)))));return c},sum(t){var e,r,n;for(e=0,r=0,n=t.length;n>r;r++)e+=t[r];return e},uncamelcase(t){var e;return t?(e=t.replace(/([A-Z])|_+/g,((t,e)=>(null==e&&(e="")," "+e))),a.capitalize(e.trim())):""},undasherize:t=>t?t.split("-").map(a.capitalize).join(" "):"",underscore:t=>t?(t=t[0].toLowerCase()+t.slice(1)).replace(/([A-Z])|-+/g,((t,e)=>(null==e&&(e=""),"_"+e.toLowerCase()))):"",valueForKeyPath(t,e){var r,n,i;for(n=0,i=(r=s(e)).length;i>n;n++)if(null==(t=t[r[n]]))return;return t},isEqual:(t,r,n,i)=>c.isArray(n)&&c.isArray(i)?e(t,r,n,i):e(t,r),isEqualForProperties(){var t,e,r,n,i,a;for(t=arguments[0],e=arguments[1],i=0,a=(r=3>arguments.length?[]:l.call(arguments,2)).length;a>i;i++)if(!c.isEqual(t[n=r[i]],e[n]))return!1;return!0}},e=(t,r,n,i)=>{var a,o,s,l,u,f,h,p,d,m,y,v,g;if(null==n&&(n=[]),null==i&&(i=[]),t===r)return c.isEqual(t,r);if(c.isFunction(t)||c.isFunction(r))return c.isEqual(t,r);for(y=n.length;y--;)if(n[y]===t)return i[y]===r;if(n.push(t),i.push(r),p=!1,c.isFunction(null!=t?t.isEqual:void 0))p=t.isEqual(r,n,i);else if(c.isFunction(null!=r?r.isEqual:void 0))p=r.isEqual(t,i,n);else if(c.isArray(t)&&c.isArray(r)&&t.length===r.length){for(p=!0,d=v=0,g=t.length;g>v;d=++v)if(!e(t[d],r[d],n,i)){p=!1;break}}else if(c.isRegExp(t)&&c.isRegExp(r))p=c.isEqual(t,r);else if(c.isElement(t)&&c.isElement(r))p=t===r;else if(c.isObject(t)&&c.isObject(r))if(u=r.constructor,o=c.isFunction(a=t.constructor)&&a instanceof a,f=c.isFunction(u)&&u instanceof u,a===u||o&&f){for(m in s=0,p=!0,t)if(l=t[m],c.has(t,m)&&(s++,!c.has(r,m)||!e(l,r[m],n,i))){p=!1;break}if(p){for(m in h=0,r)c.has(r,m)&&h++;p=s===h}}else p=!1;else p=c.isEqual(t,r);return n.pop(),i.pop(),p},t.exports=(c=ci).extend({},c,a)}()})),ui=vr.createCommonjsModule((function(t){!function(){function e(){}function r(t){return t}function n(t){return!!t}function i(t){return!t}function a(t){return function(){if(null===t)throw Error("Callback was already called.");t.apply(this,arguments),t=null}}function o(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}function s(t){return R(t)||"number"==typeof t.length&&t.length>=0&&t.length%1==0}function c(t,e){for(var r=-1,n=t.length;++re))}function f(t,e,r){return c(t,((t,n,i)=>{r=e(r,t,n,i)})),r}function h(t,e){c(F(t),(r=>{e(t[r],r)}))}function p(t,e){for(var r=0;t.length>r;r++)if(t[r]===e)return r;return-1}function d(t){var e,r,n=-1;return s(t)?(e=t.length,()=>(n++,e>n?n:null)):(r=F(t),e=r.length,()=>(n++,e>n?r[n]:null))}function m(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),i=0;r>i;i++)n[i]=arguments[i+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n)}}}function y(t){return(e,r,n)=>t(e,n)}function v(t){return(r,n,i)=>{i=o(i||e);var s=d(r=r||[]);if(0>=t)return i(null);var c=!1,l=0,u=!1;!function e(){if(c&&0>=l)return i(null);for(;t>l&&!u;){var o=s();if(null===o)return c=!0,void(l>0||i(null));l+=1,n(r[o],o,a((t=>{l-=1,t?(i(t),u=!0):e()})))}}()}}function g(t){return(e,r,n)=>t(P.eachOf,e,r,n)}function b(t){return(e,r,n,i)=>t(v(r),e,n,i)}function E(t){return(e,r,n)=>t(P.eachOfSeries,e,r,n)}function w(t,r,n,i){i=o(i||e);var a=s(r=r||[])?[]:{};t(r,((t,e,r)=>{n(t,((t,n)=>{a[e]=n,r(t)}))}),(t=>{i(t,a)}))}function S(t,e,r,n){var i=[];t(e,((t,e,n)=>{r(t,(r=>{r&&i.push({index:e,value:t}),n()}))}),(()=>{n(l(i.sort(((t,e)=>t.index-e.index)),(t=>t.value)))}))}function k(t,e,r,n){S(t,e,((t,e)=>{r(t,(t=>{e(!t)}))}),n)}function O(t,e,r){return function(n,i,a,o){function s(){o&&o(r(!1,void 0))}function c(t,n,i){if(!o)return i();a(t,(n=>{o&&e(n)&&(o(r(!0,t)),o=a=!1),i()}))}arguments.length>3?t(n,i,c,s):(o=a,a=i,t(n,c,s))}}function _(t,e){return e}function j(t,r,n){n=n||e;var i=s(r)?[]:{};t(r,((t,e,r)=>{t(m(((t,n)=>{n.length>1||(n=n[0]),i[e]=n,r(t)})))}),(t=>{n(t,i)}))}function x(t,e,r,n){var i=[];t(e,((t,e,n)=>{r(t,((t,e)=>{i=i.concat(e||[]),n(t)}))}),(t=>{n(t,i)}))}function A(t,r,n){function i(t,r,n,i){if(null!=i&&"function"!=typeof i)throw Error("task callback must be a function");if(t.started=!0,R(r)||(r=[r]),0===r.length&&t.idle())return P.setImmediate((()=>{t.drain()}));c(r,(r=>{var a={data:r,callback:i||e};n?t.tasks.unshift(a):t.tasks.push(a),t.tasks.length===t.concurrency&&t.saturated()})),P.setImmediate(t.process)}function o(t,e){return function(){s-=1;var r=!1,n=arguments;c(e,(t=>{c(u,((e,n)=>{e!==t||r||(u.splice(n,1),r=!0)})),t.callback.apply(t,n)})),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==r)r=1;else if(0===r)throw Error("Concurrency must not be zero");var s=0,u=[],f={tasks:[],concurrency:r,payload:n,saturated:e,empty:e,drain:e,started:!1,paused:!1,push(t,e){i(f,t,!1,e)},kill(){f.drain=e,f.tasks=[]},unshift(t,e){i(f,t,!0,e)},process(){for(;!f.paused&&f.concurrency>s&&f.tasks.length;){var e=f.tasks.splice(0,f.payload?f.payload:f.tasks.length),r=l(e,(t=>t.data));0===f.tasks.length&&f.empty(),s+=1,u.push(e[0]);var n=a(o(f,e));t(r,n)}},length:()=>f.tasks.length,running:()=>s,workersList:()=>u,idle:()=>f.tasks.length+s===0,pause(){f.paused=!0},resume(){if(!1!==f.paused){f.paused=!1;for(var t=Math.min(f.concurrency,f.tasks.length),e=1;t>=e;e++)P.setImmediate(f.process)}}};return f}function I(t){return m(((e,r)=>{e.apply(null,r.concat([m(((e,r)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,(e=>{console[t](e)})))}))]))}))}function T(t){return(e,r,n)=>{t(u(e),r,n)}}function L(t){return m((function(e,r){var n=m((function(r){var n=this,i=r.pop();return t(e,((t,e,i)=>{t.apply(n,r.concat([i]))}),i)}));return r.length?n.apply(this,r):n}))}function C(t){return m((function(e){var r=e.pop();e.push((function(){var t=arguments;n?P.setImmediate((()=>{r.apply(null,t)})):r.apply(null,t)}));var n=!0;t.apply(this,e),n=!1}))}var N,P={},M="object"==typeof self&&self.self===self&&self||"object"==typeof vr.commonjsGlobal&&vr.commonjsGlobal.global===vr.commonjsGlobal&&vr.commonjsGlobal||this;null!=M&&(N=M.async),P.noConflict=()=>(M.async=N,P);var D={}.toString,R=Array.isArray||(t=>"[object Array]"===D.call(t)),F=Object.keys||(t=>{var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}),z="function"==typeof setImmediate&&setImmediate,q=z?t=>{z(t)}:t=>{setTimeout(t,0)};P.nextTick="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:q,P.setImmediate=z?q:P.nextTick,P.forEach=P.each=(t,e,r)=>P.eachOf(t,y(e),r),P.forEachSeries=P.eachSeries=(t,e,r)=>P.eachOfSeries(t,y(e),r),P.forEachLimit=P.eachLimit=(t,e,r,n)=>v(e)(t,y(r),n),P.forEachOf=P.eachOf=(t,r,n)=>{function i(t){l--,t?n(t):null!==s||l>0||n(null)}n=o(n||e);for(var s,c=d(t=t||[]),l=0;null!=(s=c());)l+=1,r(t[s],s,a(i));0===l&&n(null)},P.forEachOfSeries=P.eachOfSeries=(t,r,n)=>{n=o(n||e);var i=d(t=t||[]),s=i();!function e(){var o=!0;if(null===s)return n(null);r(t[s],s,a((t=>{if(t)n(t);else{if(null===(s=i()))return n(null);o?P.setImmediate(e):e()}}))),o=!1}()},P.forEachOfLimit=P.eachOfLimit=(t,e,r,n)=>{v(e)(t,r,n)},P.map=g(w),P.mapSeries=E(w),P.mapLimit=b(w),P.inject=P.foldl=P.reduce=(t,e,r,n)=>{P.eachOfSeries(t,((t,n,i)=>{r(e,t,((t,r)=>{e=r,i(t)}))}),(t=>{n(t,e)}))},P.foldr=P.reduceRight=(t,e,n,i)=>{var a=l(t,r).reverse();P.reduce(a,e,n,i)},P.transform=function(t,e,r,n){3===arguments.length&&(n=r,r=e,e=R(t)?[]:{}),P.eachOf(t,((t,n,i)=>{r(e,t,n,i)}),(t=>{n(t,e)}))},P.select=P.filter=g(S),P.selectLimit=P.filterLimit=b(S),P.selectSeries=P.filterSeries=E(S),P.reject=g(k),P.rejectLimit=b(k),P.rejectSeries=E(k),P.any=P.some=O(P.eachOf,n,r),P.someLimit=O(P.eachOfLimit,n,r),P.all=P.every=O(P.eachOf,i,i),P.everyLimit=O(P.eachOfLimit,i,i),P.detect=O(P.eachOf,r,_),P.detectSeries=O(P.eachOfSeries,r,_),P.detectLimit=O(P.eachOfLimit,r,_),P.sortBy=(t,e,r)=>{function n(t,e){var r=t.criteria,n=e.criteria;return n>r?-1:r>n?1:0}P.map(t,((t,r)=>{e(t,((e,n)=>{e?r(e):r(null,{value:t,criteria:n})}))}),((t,e)=>{if(t)return r(t);r(null,l(e.sort(n),(t=>t.value)))}))},P.auto=function(t,r,n){function i(t){g.unshift(t)}function a(t){var e=p(g,t);0>e||g.splice(e,1)}function s(){u--,c(g.slice(0),(t=>{t()}))}"function"==typeof arguments[1]&&(n=r,r=null),n=o(n||e);var l=F(t),u=l.length;if(!u)return n(null);r||(r=u);var d={},y=0,v=!1,g=[];i((()=>{u||n(null,d)})),c(l,(e=>{function o(){return r>y&&f(g,((t,e)=>t&&d.hasOwnProperty(e)),!0)&&!d.hasOwnProperty(e)}if(!v){for(var c,l=R(t[e])?t[e]:[t[e]],u=m(((t,r)=>{if(y--,r.length>1||(r=r[0]),t){var i={};h(d,((t,e)=>{i[e]=t})),i[e]=r,v=!0,n(t,i)}else d[e]=r,P.setImmediate(s)})),g=l.slice(0,l.length-1),b=g.length;b--;){if(!(c=t[g[b]]))throw Error("Has nonexistent dependency in "+g.join(", "));if(R(c)&&p(c,e)>=0)throw Error("Has cyclic dependencies")}o()?(y++,l[l.length-1](u,d)):i((function t(){o()&&(y++,a(t),l[l.length-1](u,d))}))}}))},P.retry=function(t,e,r){function n(t,e){if("number"==typeof e)t.times=parseInt(e,10)||a;else{if("object"!=typeof e)throw Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||a,t.interval=parseInt(e.interval,10)||o}}function i(t,e){function r(t,r){return n=>{t(((t,e)=>{n(!t||r,{err:t,result:e})}),e)}}function n(t){return e=>{setTimeout((()=>{e(null)}),t)}}for(;c.times;){var i=!(c.times-=1);s.push(r(c.task,i)),!i&&c.interval>0&&s.push(n(c.interval))}P.series(s,((e,r)=>{(t||c.callback)((r=r[r.length-1]).err,r.result)}))}var a=5,o=0,s=[],c={times:a,interval:o},l=arguments.length;if(1>l||l>3)throw Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return l>2||"function"!=typeof t||(r=e,e=t),"function"!=typeof t&&n(c,t),c.callback=r,c.task=e,c.callback?i():i},P.waterfall=(t,r)=>(r=o(r||e),R(t)?t.length?void function t(e){return m(((n,i)=>{if(n)r.apply(null,[n].concat(i));else{var a=e.next();i.push(a?t(a):r),C(e).apply(null,i)}}))}(P.iterator(t))():r():r(Error("First argument to waterfall must be an array of functions"))),P.parallel=(t,e)=>{j(P.eachOf,t,e)},P.parallelLimit=(t,e,r)=>{j(v(e),t,r)},P.series=(t,e)=>{j(P.eachOfSeries,t,e)},P.iterator=t=>function e(r){function n(){return t.length&&t[r].apply(null,arguments),n.next()}return n.next=()=>t.length-1>r?e(r+1):null,n}(0),P.apply=m(((t,e)=>m((r=>t.apply(null,e.concat(r)))))),P.concat=g(x),P.concatSeries=E(x),P.whilst=function(t,r,n){if(n=n||e,t()){var i=m((function(e,a){e?n(e):t.apply(this,a)?r(i):n.apply(null,[null].concat(a))}));r(i)}else n(null)},P.doWhilst=function(t,e,r){var n=0;return P.whilst((function(){return 1>=++n||e.apply(this,arguments)}),t,r)},P.until=function(t,e,r){return P.whilst((function(){return!t.apply(this,arguments)}),e,r)},P.doUntil=function(t,e,r){return P.doWhilst(t,(function(){return!e.apply(this,arguments)}),r)},P.during=function(t,r,n){n=n||e;var i=m((function(e,r){e?n(e):(r.push(a),t.apply(this,r))})),a=(t,e)=>{t?n(t):e?r(i):n(null)};t(a)},P.doDuring=function(t,e,r){var n=0;P.during((function(t){1>n++?t(null,!0):e.apply(this,arguments)}),t,r)},P.queue=(t,e)=>A(((e,r)=>{t(e[0],r)}),e,1),P.priorityQueue=(t,r)=>{function n(t,e){return t.priority-e.priority}var i=P.queue(t,r);return i.push=(t,r,a)=>{((t,r,i,a)=>{if(null!=a&&"function"!=typeof a)throw Error("task callback must be a function");if(t.started=!0,R(r)||(r=[r]),0===r.length)return P.setImmediate((()=>{t.drain()}));c(r,(r=>{var o={data:r,priority:i,callback:"function"==typeof a?a:e};t.tasks.splice(((t,e,r)=>{for(var n=-1,i=t.length-1;i>n;){var a=n+(i-n+1>>>1);0>r(e,t[a])?i=a-1:n=a}return n})(t.tasks,o,n)+1,0,o),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)}))})(i,t,r,a)},delete i.unshift,i},P.cargo=(t,e)=>A(t,1,e),P.log=I("log"),P.dir=I("dir"),P.memoize=(t,e)=>{var n={},i={},a={}.hasOwnProperty;e=e||r;var o=m((r=>{var o=r.pop(),s=e.apply(null,r);a.call(n,s)?P.setImmediate((()=>{o.apply(null,n[s])})):a.call(i,s)?i[s].push(o):(i[s]=[o],t.apply(null,r.concat([m((t=>{n[s]=t;var e=i[s];delete i[s];for(var r=0,a=e.length;a>r;r++)e[r].apply(null,t)}))])))}));return o.memo=n,o.unmemoized=t,o},P.unmemoize=t=>function(){return(t.unmemoized||t).apply(null,arguments)},P.times=T(P.map),P.timesSeries=T(P.mapSeries),P.timesLimit=(t,e,r,n)=>P.mapLimit(u(t),e,r,n),P.seq=function(){var t=arguments;return m((function(r){var n=this,i=r[r.length-1];"function"==typeof i?r.pop():i=e,P.reduce(t,r,((t,e,r)=>{e.apply(n,t.concat([m(((t,e)=>{r(t,e)}))]))}),((t,e)=>{i.apply(n,[t].concat(e))}))}))},P.compose=function(){return P.seq.apply(null,[].reverse.call(arguments))},P.applyEach=L(P.eachOf),P.applyEachSeries=L(P.eachOfSeries),P.forever=(t,r)=>{var n=a(r||e),i=C(t);!function t(e){if(e)return n(e);i(t)}()},P.ensureAsync=C,P.constant=m((function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}})),P.wrapSync=P.asyncify=function(t){return m((function(e){var r,n,i,a=e.pop();try{r=t.apply(this,e)}catch(t){return a(t)}("function"==(i=typeof(n=r))||"object"===i&&n)&&"function"==typeof r.then?r.then((t=>{a(null,t)})).catch((t=>{a(t.message?t:Error(t))})):a(null,r)}))},t.exports?t.exports=P:M.async=P}()})),fi=parseInt("0777",8),hi=Zt.mkdirp=Zt.mkdirP=Zt; /*! * async * https://github.com/caolan/async @@ -6,4 +6,4 @@ * Copyright 2010-2014 Caolan McMahon * Released under the MIT license */Zt.sync=function t(e,r,n){r&&"object"==typeof r||(r={mode:r});var i=r.mode,a=r.fs||jr.default;void 0===i&&(i=fi),n||(n=null),e=_r.default.resolve(e);try{a.mkdirSync(e,i),n=n||e}catch(i){switch(i.code){case"ENOENT":n=t(_r.default.dirname(e),r,n),t(e,r,n);break;default:var o;try{o=a.statSync(e)}catch(t){throw i}if(!o.isDirectory())throw i}}return n};var pi="win32"===process.platform,di=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG),mi=_r.default.normalize;if(pi)var yi=/(.*?)(?:[\/\\]+|$)/g;else yi=/(.*?)(?:[\/]+|$)/g;if(pi)var vi=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else vi=/^[\/]*/;var gi=(t,e)=>{function r(){var e=vi.exec(t);n=e[0].length,i=e[0],a=e[0],o="",pi&&!l[a]&&(jr.default.lstatSync(a),l[a]=!0)}if(t=_r.default.resolve(t),e&&{}.hasOwnProperty.call(e,t))return e[t];var n,i,a,o,s=t,c={},l={};for(r();t.length>n;){yi.lastIndex=n;var u=yi.exec(t);if(o=i,i+=u[0],n=yi.lastIndex,!(l[a=o+u[1]]||e&&e[a]===a)){var f;if(e&&{}.hasOwnProperty.call(e,a))f=e[a];else{var h=jr.default.lstatSync(a);if(!h.isSymbolicLink()){l[a]=!0,e&&(e[a]=a);continue}var p=null;if(!pi){var d=h.dev.toString(32)+":"+h.ino.toString(32);c.hasOwnProperty(d)&&(p=c[d])}null===p&&(jr.default.statSync(a),p=jr.default.readlinkSync(a)),f=_r.default.resolve(o,p),e&&(e[a]=f),pi||(c[d]=p)}t=_r.default.resolve(f,t.slice(n)),r()}}return e&&(e[s]=t),t},bi=(t,e,r)=>{function n(){var e=vi.exec(t);c=e[0].length,l=e[0],u=e[0],f="",pi&&!d[u]?jr.default.lstat(u,(t=>{if(t)return r(t);d[u]=!0,i()})):process.nextTick(i)}function i(){if(c>=t.length)return e&&(e[h]=t),r(null,t);yi.lastIndex=c;var n=yi.exec(t);return f=l,l+=n[0],c=yi.lastIndex,d[u=f+n[1]]||e&&e[u]===u?process.nextTick(i):e&&{}.hasOwnProperty.call(e,u)?s(e[u]):jr.default.lstat(u,a)}function a(t,n){if(t)return r(t);if(!n.isSymbolicLink())return d[u]=!0,e&&(e[u]=u),process.nextTick(i);if(!pi){var a=n.dev.toString(32)+":"+n.ino.toString(32);if(p.hasOwnProperty(a))return o(null,p[a],u)}jr.default.stat(u,(t=>{if(t)return r(t);jr.default.readlink(u,((t,e)=>{pi||(p[a]=e),o(t,e)}))}))}function o(t,n,i){if(t)return r(t);var a=_r.default.resolve(f,n);e&&(e[i]=a),s(a)}function s(e){t=_r.default.resolve(e,t.slice(c)),n()}if("function"!=typeof r&&(r=Yt(e),e=null),t=_r.default.resolve(t),e&&{}.hasOwnProperty.call(e,t))return process.nextTick(r.bind(null,null,e[t]));var c,l,u,f,h=t,p={},d={};n()},Ei={realpathSync:gi,realpath:bi},wi=te;te.realpath=te,te.sync=ee,te.realpathSync=ee,te.monkeypatch=re,te.unmonkeypatch=ne;var Si=jr.default.realpath,ki=jr.default.realpathSync,Oi=process.version,_i=/^v[0-5]\./.test(Oi),ji=(t,e)=>{for(var r=[],n=0;t.length>n;n++){var i=e(t[n],n);xi(i)?r.push.apply(r,i):r.push(i)}return r},xi=Array.isArray||(t=>"[object Array]"==={}.toString.call(t)),Ai=ie;ie.range=oe;var Ii=fe,Ti="\0SLASH"+Math.random()+"\0",Li="\0OPEN"+Math.random()+"\0",Ci="\0CLOSE"+Math.random()+"\0",Ni="\0COMMA"+Math.random()+"\0",Pi="\0PERIOD"+Math.random()+"\0",Mi=Ee;Ee.Minimatch=we;var Di={sep:"/"};try{Di=_r.default}catch(t){}var Ri=Ee.GLOBSTAR=we.GLOBSTAR={},Fi={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},zi="[^/]",qi=zi+"*?",Bi="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Gi="(?:(?!(?:\\/|^)\\.).)*?",$i=ve("().*{}+?[]^$\\!"),Ui=/\/+/;Ee.filter=ge,Ee.defaults=t=>{if(!t||!Object.keys(t).length)return Ee;var e=Ee,r=(r,n,i)=>e.minimatch(r,n,be(t,i));return r.Minimatch=(r,n)=>new e.Minimatch(r,be(t,n)),r},we.defaults=t=>t&&Object.keys(t).length?Ee.defaults(t).Minimatch:we,we.prototype.debug=()=>{},we.prototype.make=Se,we.prototype.parseNegate=ke,Ee.braceExpand=(t,e)=>Oe(t,e),we.prototype.braceExpand=Oe,we.prototype.parse=_e;var Hi={};Ee.makeRe=(t,e)=>new we(t,e||{}).makeRe(),we.prototype.makeRe=je,Ee.match=(t,e,r)=>{var n=new we(e,r=r||{});return t=t.filter((t=>n.match(t))),n.options.nonull&&!t.length&&t.push(e),t},we.prototype.match=xe,we.prototype.matchOne=function(t,e,r){var n=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var i=0,a=0,o=t.length,s=e.length;o>i&&s>a;i++,a++){this.debug("matchOne loop");var c,l=e[a],u=t[i];if(this.debug(e,l,u),!1===l)return!1;if(l===Ri){this.debug("GLOBSTAR",[e,l,u]);var f=i,h=a+1;if(h===s){for(this.debug("** at the end");o>i;i++)if("."===t[i]||".."===t[i]||!n.dot&&"."===t[i].charAt(0))return!1;return!0}for(;o>f;){var p=t[f];if(this.debug("\nglobstar while",t,f,e,h,p),this.matchOne(t.slice(f),e.slice(h),r))return this.debug("globstar found match!",f,o,p),!0;if("."===p||".."===p||!n.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,f,e,h);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!r||(this.debug("\n>>> no match, partial?",t,f,e,h),f!==o))}if("string"==typeof l?(c=n.nocase?u.toLowerCase()===l.toLowerCase():u===l,this.debug("string match",l,u,c)):(c=u.match(l),this.debug("pattern match",l,u,c)),!c)return!1}if(i===o&&a===s)return!0;if(i===o)return r;if(a===s)return i===o-1&&""===t[i];throw Error("wtf?")};var Wi=vr.createCommonjsModule((t=>{t.exports="function"==typeof Object.create?(t,e)=>{e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:(t,e)=>{if(e){t.super_=e;var r=()=>{};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}})),Vi=vr.createCommonjsModule((t=>{try{var e=Ir.default;if("function"!=typeof e.inherits)throw"";t.exports=e.inherits}catch(e){t.exports=Wi}})),Ki="win32"===process.platform?Le:Te,Qi=Te,Zi=Le;Ki.posix=Qi,Ki.win32=Zi;var Xi=Pe,Yi=Ne,Ji=Re,ta=Ce,ea=qe,ra=Fe,na=ze,ia=Be,aa=Ge,oa=Mi.Minimatch,sa={alphasort:Xi,alphasorti:Yi,setopts:Ji,ownProp:ta,makeAbs:ea,finish:ra,mark:na,isIgnored:ia,childrenIgnored:aa},ca=$e;$e.GlobSync=Ue;var la=sa.setopts,ua=sa.ownProp,fa=sa.childrenIgnored,ha=sa.isIgnored;Ue.prototype._finish=function(){if(Ar.default(this instanceof Ue),this.realpath){var t=this;this.matches.forEach(((e,r)=>{var n=t.matches[r]=Object.create(null);for(var i in e)try{i=t._makeAbs(i),n[wi.realpathSync(i,t.realpathCache)]=!0}catch(e){if("stat"!==e.syscall)throw e;n[t._makeAbs(i)]=!0}}))}sa.finish(this)},Ue.prototype._process=function(t,e,r){Ar.default(this instanceof Ue);for(var n,i=0;"string"==typeof t[i];)i++;switch(i){case t.length:return void this._processSimple(t.join("/"),e);case 0:n=null;break;default:n=t.slice(0,i).join("/")}var a,o=t.slice(i);null===n?a=".":Ki(n)||Ki(t.join("/"))?(n&&Ki(n)||(n="/"+n),a=n):a=n;var s=this._makeAbs(a);fa(this,a)||(o[0]===Mi.GLOBSTAR?this._processGlobStar(n,a,s,o,e,r):this._processReaddir(n,a,s,o,e,r))},Ue.prototype._processReaddir=function(t,e,r,n,i,a){var o=this._readdir(r,a);if(o){for(var s=n[0],c=!!this.minimatch.negate,l=this.dot||"."===s._glob.charAt(0),u=[],f=0;o.length>f;f++)("."!==(p=o[f]).charAt(0)||l)&&(c&&!t?!p.match(s):p.match(s))&&u.push(p);var h=u.length;if(0!==h)if(1!==n.length||this.mark||this.stat)for(n.shift(),f=0;h>f;f++)p=u[f],this._process((t?[t,p]:[p]).concat(n),i,a);else{this.matches[i]||(this.matches[i]=Object.create(null));for(f=0;h>f;f++){var p=u[f];t&&(p="/"!==t.slice(-1)?t+"/"+p:t+p),"/"!==p.charAt(0)||this.nomount||(p=_r.default.join(this.root,p)),this._emitMatch(i,p)}}}},Ue.prototype._emitMatch=function(t,e){if(!ha(this,e)){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}}},Ue.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r;try{r=jr.default.lstatSync(t)}catch(t){if("ENOENT"===t.code)return null}var n=r&&r.isSymbolicLink();return this.symlinks[t]=n,n||!r||r.isDirectory()?e=this._readdir(t,!1):this.cache[t]="FILE",e},Ue.prototype._readdir=function(t,e){if(e&&!ua(this.symlinks,t))return this._readdirInGlobStar(t);if(ua(this.cache,t)){var r=this.cache[t];if(!r||"FILE"===r)return null;if(Array.isArray(r))return r}try{return this._readdirEntries(t,jr.default.readdirSync(t))}catch(e){return this._readdirError(t,e),null}},Ue.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;e.length>r;r++){var n=e[r];this.cache[n="/"===t?t+n:t+"/"+n]=!0}return this.cache[t]=e,e},Ue.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(t);if(this.cache[r]="FILE",r===this.cwdAbs){var n=Error(e.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=e.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e)}},Ue.prototype._processGlobStar=function(t,e,r,n,i,a){var o=this._readdir(r,a);if(o){var s=n.slice(1),c=t?[t]:[],l=c.concat(s);this._process(l,i,!1);var u=o.length;if(!this.symlinks[r]||!a)for(var f=0;u>f;f++)if("."!==o[f].charAt(0)||this.dot){var h=c.concat(o[f],s);this._process(h,i,!0);var p=c.concat(o[f],n);this._process(p,i,!0)}}},Ue.prototype._processSimple=function(t,e){var r=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),r){if(t&&Ki(t)&&!this.nomount){var n=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=_r.default.join(this.root,t):(t=_r.default.resolve(this.root,t),n&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t)}},Ue.prototype._stat=function(t){var e=this._makeAbs(t),r="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&ua(this.cache,e)){if(Array.isArray(a=this.cache[e])&&(a="DIR"),!r||"DIR"===a)return a;if(r&&"FILE"===a)return!1}var n=this.statCache[e];if(!n){var i;try{i=jr.default.lstatSync(e)}catch(t){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[e]=!1,!1}if(i&&i.isSymbolicLink())try{n=jr.default.statSync(e)}catch(t){n=i}else n=i}this.statCache[e]=n;var a=!0;return n&&(a=n.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||a,(!r||"FILE"!==a)&&a},Ue.prototype._mark=function(t){return sa.mark(this,t)},Ue.prototype._makeAbs=function(t){return sa.makeAbs(this,t)};var pa=He,da=pa(We),ma=pa(Ve);We.proto=We((function(){Object.defineProperty(Function.prototype,"once",{value(){return We(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value(){return Ve(this)},configurable:!0})})),da.strict=ma;var ya=Object.create(null),va=pa(Ke),ga=Xe,ba=Tr.default.EventEmitter,Ea=sa.setopts,wa=sa.ownProp,Sa=sa.childrenIgnored,ka=sa.isIgnored;Xe.sync=ca;var Oa=Xe.GlobSync=ca.GlobSync;Xe.glob=Xe,Xe.hasMagic=(t,e)=>{var r=Ye({},e);r.noprocess=!0;var n=new Je(t,r).minimatch.set;if(!t)return!1;if(n.length>1)return!0;for(var i=0;n[0].length>i;i++)if("string"!=typeof n[0][i])return!0;return!1},Xe.Glob=Je,Vi(Je,ba),Je.prototype._finish=function(){if(Ar.default(this instanceof Je),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();sa.finish(this),this.emit("end",this.found)}},Je.prototype._realpath=function(){function t(){0==--e&&r._finish()}if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var r=this,n=0;this.matches.length>n;n++)this._realpathSet(n,t)}},Je.prototype._realpathSet=function(t,e){var r=this.matches[t];if(!r)return e();var n=Object.keys(r),i=this,a=n.length;if(0===a)return e();var o=this.matches[t]=Object.create(null);n.forEach(((r,n)=>{r=i._makeAbs(r),wi.realpath(r,i.realpathCache,((n,s)=>{n?"stat"===n.syscall?o[r]=!0:i.emit("error",n):o[s]=!0,0==--a&&(i.matches[t]=o,e())}))}))},Je.prototype._mark=function(t){return sa.mark(this,t)},Je.prototype._makeAbs=function(t){return sa.makeAbs(this,t)},Je.prototype.abort=function(){this.aborted=!0,this.emit("abort")},Je.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},Je.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;t.length>e;e++){var r=t[e];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);for(this._processQueue.length=0,e=0;n.length>e;e++){var i=n[e];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},Je.prototype._process=function(t,e,r,n){if(Ar.default(this instanceof Je),Ar.default("function"==typeof n),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([t,e,r,n]);else{for(var i,a=0;"string"==typeof t[a];)a++;switch(a){case t.length:return void this._processSimple(t.join("/"),e,n);case 0:i=null;break;default:i=t.slice(0,a).join("/")}var o,s=t.slice(a);null===i?o=".":Ki(i)||Ki(t.join("/"))?(i&&Ki(i)||(i="/"+i),o=i):o=i;var c=this._makeAbs(o);if(Sa(this,o))return n();s[0]===Mi.GLOBSTAR?this._processGlobStar(i,o,c,s,e,r,n):this._processReaddir(i,o,c,s,e,r,n)}},Je.prototype._processReaddir=function(t,e,r,n,i,a,o){var s=this;this._readdir(r,a,((c,l)=>s._processReaddir2(t,e,r,n,i,a,l,o)))},Je.prototype._processReaddir2=function(t,e,r,n,i,a,o,s){if(!o)return s();for(var c=n[0],l=!!this.minimatch.negate,u=this.dot||"."===c._glob.charAt(0),f=[],h=0;o.length>h;h++)("."!==(d=o[h]).charAt(0)||u)&&(l&&!t?!d.match(c):d.match(c))&&f.push(d);var p=f.length;if(0===p)return s();if(1===n.length&&!this.mark&&!this.stat){for(this.matches[i]||(this.matches[i]=Object.create(null)),h=0;p>h;h++){var d=f[h];t&&(d="/"!==t?t+"/"+d:t+d),"/"!==d.charAt(0)||this.nomount||(d=_r.default.join(this.root,d)),this._emitMatch(i,d)}return s()}for(n.shift(),h=0;p>h;h++)d=f[h],t&&(d="/"!==t?t+"/"+d:t+d),this._process([d].concat(n),i,a,s);s()},Je.prototype._emitMatch=function(t,e){if(!this.aborted&&!ka(this,e))if(this.paused)this._emitQueue.push([t,e]);else{var r=Ki(e)?e:this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0;var i=this.statCache[r];i&&this.emit("stat",e,i),this.emit("match",e)}}},Je.prototype._readdirInGlobStar=function(t,e){if(!this.aborted){if(this.follow)return this._readdir(t,!1,e);var r=this,n=va("lstat\0"+t,((n,i)=>{if(n&&"ENOENT"===n.code)return e();var a=i&&i.isSymbolicLink();r.symlinks[t]=a,a||!i||i.isDirectory()?r._readdir(t,!1,e):(r.cache[t]="FILE",e())}));n&&jr.default.lstat(t,n)}},Je.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=va("readdir\0"+t+"\0"+e,r))){if(e&&!wa(this.symlinks,t))return this._readdirInGlobStar(t,r);if(wa(this.cache,t)){var n=this.cache[t];if(!n||"FILE"===n)return r();if(Array.isArray(n))return r(null,n)}jr.default.readdir(t,tr(this,t,r))}},Je.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;e.length>n;n++){var i=e[n];this.cache[i="/"===t?t+i:t+"/"+i]=!0}return this.cache[t]=e,r(null,e)}},Je.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(t);if(this.cache[n]="FILE",n===this.cwdAbs){var i=Error(e.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=e.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e)}return r()}},Je.prototype._processGlobStar=function(t,e,r,n,i,a,o){var s=this;this._readdir(r,a,((c,l)=>{s._processGlobStar2(t,e,r,n,i,a,l,o)}))},Je.prototype._processGlobStar2=function(t,e,r,n,i,a,o,s){if(!o)return s();var c=n.slice(1),l=t?[t]:[],u=l.concat(c);this._process(u,i,!1,s);var f=o.length;if(this.symlinks[r]&&a)return s();for(var h=0;f>h;h++)if("."!==o[h].charAt(0)||this.dot){var p=l.concat(o[h],c);this._process(p,i,!0,s);var d=l.concat(o[h],n);this._process(d,i,!0,s)}s()},Je.prototype._processSimple=function(t,e,r){var n=this;this._stat(t,((i,a)=>{n._processSimple2(t,e,i,a,r)}))},Je.prototype._processSimple2=function(t,e,r,n,i){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return i();if(t&&Ki(t)&&!this.nomount){var a=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=_r.default.join(this.root,t):(t=_r.default.resolve(this.root,t),a&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),i()},Je.prototype._stat=function(t,e){var r=this._makeAbs(t),n="/"===t.slice(-1);if(t.length>this.maxLength)return e();if(!this.stat&&wa(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return e(null,i);if(n&&"FILE"===i)return e()}var a=this.statCache[r];if(void 0!==a){if(!1===a)return e(null,a);var o=a.isDirectory()?"DIR":"FILE";return n&&"FILE"===o?e():e(null,o,a)}var s=this,c=va("stat\0"+r,((n,i)=>{if(i&&i.isSymbolicLink())return jr.default.stat(r,((n,a)=>{n?s._stat2(t,r,null,i,e):s._stat2(t,r,n,a,e)}));s._stat2(t,r,n,i,e)}));c&&jr.default.lstat(r,c)},Je.prototype._stat2=function(t,e,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[e]=!1,i();var a="/"===t.slice(-1);if(this.statCache[e]=n,"/"===e.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||o,a&&"FILE"===o?i():i(null,o,n)};var _a=rr;rr.sync=cr;var ja=void 0;try{ja=ga}catch(t){}var xa=parseInt("666",8),Aa={nosort:!0,silent:!0},Ia=0,Ta="win32"===process.platform,La=vr.createCommonjsModule((t=>{(()=>{var e,r,n,i,a,o,s,c,l,u,f,h,p,d,m,y,v,g,b,E=[].slice;c=jr.default,a=xr.default,y=_r.default,b=li,o=ui,m=hi,v=_a,l={__esModule:!1,getHomeDirectory:()=>"win32"!==process.platform||process.env.HOME?process.env.HOME:process.env.USERPROFILE,absolute(t){if(null==t)return null;t=l.resolveHome(t);try{return c.realpathSync(t)}catch(e){return t}},normalize:t=>null==t?null:l.resolveHome(y.normalize(""+t)),resolveHome:t=>"~"===t?l.getHomeDirectory():0===t.indexOf("~"+y.sep)?""+l.getHomeDirectory()+t.substring(1):t,tildify(t){var e,r;return"win32"===process.platform?t:(r=l.normalize(t),null==(e=l.getHomeDirectory())?t:r===e?"~":r.startsWith(y.join(e,y.sep))?y.join("~",y.sep,r.substring(e.length+1)):t)},getAppDataDirectory(){switch(process.platform){case"darwin":return l.absolute(y.join("~","Library","Application Support"));case"linux":return"/var/lib";case"win32":return process.env.APPDATA;default:return null}},isAbsolute:t=>(null==t&&(t=""),"win32"!==process.platform?"/"===t[0]:":"===t[1]||"\\"===t[0]&&"\\"===t[1]),existsSync:t=>p(t)&&!1!==g(t),isDirectorySync(t){var e;return!!p(t)&&!!(e=g(t))&&e.isDirectory()},isDirectory:(t,e)=>p(t)?c.stat(t,((t,r)=>e(null==t&&r.isDirectory()))):e(!1),isFileSync(t){var e;return!!p(t)&&!!(e=g(t))&&e.isFile()},isSymbolicLinkSync(t){var e;return!!p(t)&&!!(e=d(t))&&e.isSymbolicLink()},isSymbolicLink:(t,e)=>p(t)?c.lstat(t,((t,r)=>"function"==typeof e?e(null!=r&&r.isSymbolicLink()):void 0)):process.nextTick((()=>"function"==typeof e?e(!1):void 0)),isExecutableSync(t){var e;return!!p(t)&&!!(e=g(t))&&0!=(1&e.mode)},getSizeSync(t){var e;return p(t)&&null!=(e=g(t).size)?e:-1},listSync(t,e){var r;return l.isDirectorySync(t)?(r=c.readdirSync(t),e&&(r=l.filterExtensions(r,e)),r=(r=r.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())))).map((e=>y.join(t,e)))):[]},list(){var t,e,r,n;return n=arguments[0],(r=2>arguments.length?[]:E.call(arguments,1)).length>1&&(e=r.shift()),t=r.shift(),c.readdir(n,((r,i)=>null!=r?t(r):(e&&(i=l.filterExtensions(i,e)),i=(i=i.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase())))).map((t=>y.join(n,t))),t(null,i))))},filterExtensions:(t,e)=>(e=e.map((t=>""===t?t:"."+t.replace(/^\./,""))),t.filter((t=>b.include(e,y.extname(t))))),listTreeSync(t){var e,r;return r=[],l.traverseTreeSync(t,e=t=>(r.push(t),!0),e),r},move:(t,e,r)=>f(t,e,((n,i)=>{var a,o;if(!n)return i?(o=y.dirname(e),c.exists(o,(n=>{if(!n)return l.makeTree(o,(n=>{if(!n)return c.rename(t,e,r);r(n)}));c.rename(t,e,r)}))):((a=Error("'"+e+"' already exists.")).code="EEXIST",void r(a));r(n)})),moveSync(t,e){var r,n;if(!h(t,e))throw(r=Error("'"+e+"' already exists.")).code="EEXIST",r;return n=y.dirname(e),c.existsSync(n)||l.makeTreeSync(n),c.renameSync(t,e)},removeSync:t=>v.sync(t),remove:(t,e)=>v(t,e),writeFileSync:(t,e,r)=>(m.sync(y.dirname(t)),c.writeFileSync(t,e,r)),writeFile(t,e,r,n){return n=b.last(arguments),m(y.dirname(t),(i=>null!=i?"function"==typeof n?n(i):void 0:c.writeFile(t,e,r,n)))},copy:(t,e,r)=>m(y.dirname(e),(n=>{var i,a;if(null==n)return(a=c.createReadStream(t)).on("error",(t=>("function"==typeof r&&r(t),r=null))),(i=c.createWriteStream(e)).on("error",(t=>("function"==typeof r&&r(t),r=null))),i.on("close",(()=>("function"==typeof r&&r(),r=null))),a.pipe(i);"function"==typeof r&&r(n)})),copySync(t,e){var r,n,i,a,o,s,u;for(a=c.readdirSync(t),m.sync(e),u=[],o=0,s=a.length;s>o;o++)i=y.join(t,n=a[o]),r=y.join(e,n),l.isDirectorySync(i)?u.push(l.copySync(i,r)):u.push(l.copyFileSync(i,r));return u},copyFileSync(t,e,r){var n,i,a,o,s,l;null==r&&(r=16384),m.sync(y.dirname(e)),o=null,s=null;try{for(o=c.openSync(t,"r"),s=c.openSync(e,"w"),i=1,a=0,l=[];i>0;)n=new Buffer(r),i=c.readSync(o,n,0,n.length,a),c.writeSync(s,n,0,i,a),l.push(a+=i);return l}finally{null!=o&&c.closeSync(o),null!=s&&c.closeSync(s)}},makeTreeSync(t){if(!l.isDirectorySync(t))return m.sync(t)},makeTree:(t,e)=>l.isDirectory(t,(r=>r?"function"==typeof e?e():void 0:m(t,(t=>"function"==typeof e?e(t):void 0)))),traverseTreeSync(t,e,r){var n;if(null==r&&(r=e),l.isDirectorySync(t))return(n=(t,e,r)=>{var i,a,o,s,l,u;for(s=0,l=(u=c.readdirSync(t)).length;l>s;s++)i=y.join(t,u[s]),(o=c.lstatSync(i)).isSymbolicLink()&&(a=g(i))&&(o=a),o.isDirectory()?r(i)&&n(i,e,r):o.isFile()&&e(i)})(t,e,r)},traverseTree:(t,e,r,n)=>c.readdir(t,((i,a)=>{var s,l,u,f;if(i)return"function"==typeof n?n():void 0;for((s=o.queue(((t,n)=>c.stat(t,((i,a)=>i?n(i):a.isFile()?(e(t),n()):a.isDirectory()&&r(t)?c.readdir(t,((e,r)=>{var i,a;if(e)return n(e);for(i=0,a=r.length;a>i;i++)s.unshift(y.join(t,r[i]));return n()})):n()))))).concurrency=1,s.drain=n,f=[],l=0,u=a.length;u>l;l++)f.push(s.push(y.join(t,a[l])));return f})),md5ForPath(t){var e;return e=c.readFileSync(t),Lr.default.createHash("md5").update(e).digest("hex")},resolve(){var t,e,r,n,i,a,o,s,c;if(t=1>arguments.length?[]:E.call(arguments,0),b.isArray(b.last(t))&&(r=t.pop()),i=null!=(c=t.pop())?""+c:void 0,n=t,i){if(l.isAbsolute(i)){if(r&&(a=l.resolveExtension(i,r)))return a;if(l.existsSync(i))return i}for(o=0,s=n.length;s>o;o++)if(e=y.join(n[o],i),r){if(a=l.resolveExtension(e,r))return a}else if(l.existsSync(e))return l.absolute(e)}},resolveOnLoadPath(){var e,r,n;return e=1>arguments.length?[]:E.call(arguments,0),null,n=null!=t.paths?t.paths:process.resourcesPath?[y.join(process.resourcesPath,"app","node_modules")]:[],r=a.globalPaths.concat(n),l.resolve.apply(l,E.call(r).concat(E.call(e)))},resolveExtension(t,e){var r,n,i,a;for(i=0,a=e.length;a>i;i++)if(""===(r=e[i])){if(l.existsSync(t))return l.absolute(t)}else if(n=t+"."+r.replace(/^\./,""),l.existsSync(n))return l.absolute(n)},isCompressedExtension:t=>null!=t&&r.hasOwnProperty(t.toLowerCase()),isImageExtension:t=>null!=t&&n.hasOwnProperty(t.toLowerCase()),isPdfExtension:t=>".pdf"===(null!=t?t.toLowerCase():void 0),isBinaryExtension:t=>null!=t&&e.hasOwnProperty(t.toLowerCase()),isReadmePath(t){var e;return e=y.extname(t),"readme"===y.basename(t,e).toLowerCase()&&(""===e||l.isMarkdownExtension(e))},isMarkdownExtension:t=>null!=t&&i.hasOwnProperty(t.toLowerCase()),isCaseInsensitive(){var t,e;return null==l.caseInsensitiveFs&&(t=g(process.execPath.toLowerCase()),e=g(process.execPath.toUpperCase()),l.caseInsensitiveFs=!(!t||!e)&&t.dev===e.dev&&t.ino===e.ino),l.caseInsensitiveFs},isCaseSensitive:()=>!l.isCaseInsensitive(),statSyncNoException(){var t;return t=1>arguments.length?[]:E.call(arguments,0),g.apply(null,t)},lstatSyncNoException(){var t;return t=1>arguments.length?[]:E.call(arguments,0),d.apply(null,t)}},u=null,s=()=>(null===u&&(u=process.versions.electron&&2>=parseInt(process.versions.electron.split(".")[0])),u),g=function(){var t;if(t=1>arguments.length?[]:E.call(arguments,0),c.statSyncNoException&&s())return c.statSyncNoException.apply(c,t);try{return c.statSync.apply(c,t)}catch(t){return!1}},d=function(){var t;if(t=1>arguments.length?[]:E.call(arguments,0),c.lstatSyncNoException&&s())return c.lstatSyncNoException.apply(c,t);try{return c.lstatSync.apply(c,t)}catch(t){return!1}},e={".ds_store":!0,".a":!0,".exe":!0,".o":!0,".pyc":!0,".pyo":!0,".so":!0,".woff":!0},r={".bz2":!0,".egg":!0,".epub":!0,".gem":!0,".gz":!0,".jar":!0,".lz":!0,".lzma":!0,".lzo":!0,".rar":!0,".tar":!0,".tgz":!0,".war":!0,".whl":!0,".xpi":!0,".xz":!0,".z":!0,".zip":!0},n={".gif":!0,".ico":!0,".jpeg":!0,".jpg":!0,".png":!0,".tif":!0,".tiff":!0,".webp":!0},i={".markdown":!0,".md":!0,".mdown":!0,".mkd":!0,".mkdown":!0,".rmd":!0,".ron":!0},p=t=>null!=t&&"string"==typeof t&&t.length>0,f=(t,e,r)=>c.stat(t,((n,i)=>{if(!n)return c.stat(e,((n,a)=>{if(!n||"ENOENT"!==n.code)return r(void 0,t.toLowerCase()===e.toLowerCase()&&i.dev===a.dev&&i.ino===a.ino);r(void 0,!0)}));r(n)})),h=(t,e)=>{var r,n;return n=g(t),r=g(e),!n||!r||t.toLowerCase()===e.toLowerCase()&&n.dev===r.dev&&n.ino===r.ino},t.exports=new Proxy({},{get(t,e){var r;return null!=(r=l[e])?r:c[e]},set:(t,e,r)=>l[e]=r})})()}));class Ca{static initClass(){return this.registerCommands(),vr.element(this,"minimap-plugin-generator")}static registerCommands(){atom.commands.add("minimap-plugin-generator",{"core:confirm"(){this.confirm()},"core:cancel"(){this.detach()}})}createdCallback(){this.previouslyFocusedElement=null,this.mode=null,this.modal=document.createElement("atom-panel"),this.modal.classList.add("minimap-plugin-generator"),this.modal.classList.add("modal"),this.modal.classList.add("overlay"),this.modal.classList.add("from-top"),this.editor=atom.workspace.buildTextEditor({mini:!0}),this.editorElement=atom.views.getView(this.editor),this.error=document.createElement("div"),this.error.classList.add("error"),this.message=document.createElement("div"),this.message.classList.add("message"),this.modal.appendChild(this.editorElement),this.modal.appendChild(this.error),this.modal.appendChild(this.message),this.appendChild(this.modal)}attachedCallback(){this.previouslyFocusedElement=document.activeElement,this.message.textContent="Enter plugin path",this.setPathText("my-minimap-plugin"),this.editorElement.focus()}attach(){atom.views.getView(atom.workspace).appendChild(this)}setPathText(t,e){e||(e=[0,t.length]);const r=pr();this.editor.setText(_r.default.join(r,t));const n=this.editor.getText().length-t.length;this.editor.setSelectedBufferRange([[0,n+e[0]],[0,n+e[1]]])}detach(){this.parentNode&&(this.previouslyFocusedElement&&this.previouslyFocusedElement.focus(),this.parentNode.removeChild(this))}confirm(){this.validPackagePath()&&(this.removeChild(this.modal),this.message.innerHTML=`\n \n Generate plugin at ${this.getPackagePath()}\n `,this.createPackageFiles((()=>{const t=this.getPackagePath();atom.open({pathsToOpen:[t],devMode:atom.config.get("minimap.createPluginInDevMode")}),this.message.innerHTML='Plugin successfully generated, opening it now...',setTimeout((()=>{this.detach()}),2e3)})))}getPackagePath(){const t=this.editor.getText(),e=vr.dasherize(_r.default.basename(t));return _r.default.join(_r.default.dirname(t),e)}validPackagePath(){return!La.existsSync(this.getPackagePath())||(this.error.textContent=`Path already exists at '${this.getPackagePath()}'`,this.error.style.display="block",!1)}initPackage(t,e){const r=_r.default.resolve(__dirname,_r.default.join("..","templates","plugin-"+this.template));mr(atom.packages.getApmPath(),["init","-p",""+t,"--template",r],e)}createPackageFiles(t){const e=this.getPackagePath();dr(e)?this.initPackage(e,(()=>{hr(e,t)})):this.initPackage(e,(()=>{fr(e,(()=>{hr(e,t)}))}))}}const Na=Ca.initClass();exports.default=Na; -//# sourceMappingURL=minimap-plugin-generator-element-d36805fc.js.map +//# sourceMappingURL=minimap-plugin-generator-element-27adcab9.js.map diff --git a/dist/minimap-plugin-generator-element-d36805fc.js.map b/dist/minimap-plugin-generator-element-27adcab9.js.map similarity index 99% rename from dist/minimap-plugin-generator-element-d36805fc.js.map rename to dist/minimap-plugin-generator-element-27adcab9.js.map index bc083863..e5637c45 100644 --- a/dist/minimap-plugin-generator-element-d36805fc.js.map +++ b/dist/minimap-plugin-generator-element-27adcab9.js.map @@ -1 +1 @@ -{"version":3,"file":"minimap-plugin-generator-element-d36805fc.js","sources":["../node_modules/underscore/modules/restArguments.js","../node_modules/underscore/modules/isObject.js","../node_modules/underscore/modules/isNull.js","../node_modules/underscore/modules/isUndefined.js","../node_modules/underscore/modules/isBoolean.js","../node_modules/underscore/modules/isElement.js","../node_modules/underscore/modules/_tagTester.js","../node_modules/underscore/modules/_has.js","../node_modules/underscore/modules/isFinite.js","../node_modules/underscore/modules/isNaN.js","../node_modules/underscore/modules/constant.js","../node_modules/underscore/modules/_createSizePropertyCheck.js","../node_modules/underscore/modules/_shallowProperty.js","../node_modules/underscore/modules/isTypedArray.js","../node_modules/underscore/modules/_collectNonEnumProps.js","../node_modules/underscore/modules/keys.js","../node_modules/underscore/modules/isEmpty.js","../node_modules/underscore/modules/isMatch.js","../node_modules/underscore/modules/underscore.js","../node_modules/underscore/modules/isEqual.js","../node_modules/underscore/modules/allKeys.js","../node_modules/underscore/modules/values.js","../node_modules/underscore/modules/pairs.js","../node_modules/underscore/modules/invert.js","../node_modules/underscore/modules/functions.js","../node_modules/underscore/modules/_createAssigner.js","../node_modules/underscore/modules/_baseCreate.js","../node_modules/underscore/modules/create.js","../node_modules/underscore/modules/clone.js","../node_modules/underscore/modules/tap.js","../node_modules/underscore/modules/has.js","../node_modules/underscore/modules/identity.js","../node_modules/underscore/modules/matcher.js","../node_modules/underscore/modules/_deepGet.js","../node_modules/underscore/modules/property.js","../node_modules/underscore/modules/_optimizeCb.js","../node_modules/underscore/modules/_baseIteratee.js","../node_modules/underscore/modules/iteratee.js","../node_modules/underscore/modules/_cb.js","../node_modules/underscore/modules/mapObject.js","../node_modules/underscore/modules/noop.js","../node_modules/underscore/modules/propertyOf.js","../node_modules/underscore/modules/times.js","../node_modules/underscore/modules/random.js","../node_modules/underscore/modules/_createEscaper.js","../node_modules/underscore/modules/template.js","../node_modules/underscore/modules/result.js","../node_modules/underscore/modules/uniqueId.js","../node_modules/underscore/modules/chain.js","../node_modules/underscore/modules/_executeBound.js","../node_modules/underscore/modules/_flatten.js","../node_modules/underscore/modules/memoize.js","../node_modules/underscore/modules/throttle.js","../node_modules/underscore/modules/debounce.js","../node_modules/underscore/modules/wrap.js","../node_modules/underscore/modules/negate.js","../node_modules/underscore/modules/compose.js","../node_modules/underscore/modules/after.js","../node_modules/underscore/modules/before.js","../node_modules/underscore/modules/findKey.js","../node_modules/underscore/modules/_createPredicateIndexFinder.js","../node_modules/underscore/modules/sortedIndex.js","../node_modules/underscore/modules/_createIndexFinder.js","../node_modules/underscore/modules/find.js","../node_modules/underscore/modules/findWhere.js","../node_modules/underscore/modules/each.js","../node_modules/underscore/modules/map.js","../node_modules/underscore/modules/_createReduce.js","../node_modules/underscore/modules/filter.js","../node_modules/underscore/modules/reject.js","../node_modules/underscore/modules/every.js","../node_modules/underscore/modules/some.js","../node_modules/underscore/modules/contains.js","../node_modules/underscore/modules/pluck.js","../node_modules/underscore/modules/where.js","../node_modules/underscore/modules/max.js","../node_modules/underscore/modules/min.js","../node_modules/underscore/modules/sample.js","../node_modules/underscore/modules/shuffle.js","../node_modules/underscore/modules/sortBy.js","../node_modules/underscore/modules/_group.js","../node_modules/underscore/modules/toArray.js","../node_modules/underscore/modules/size.js","../node_modules/underscore/modules/_keyInObj.js","../node_modules/underscore/modules/initial.js","../node_modules/underscore/modules/first.js","../node_modules/underscore/modules/rest.js","../node_modules/underscore/modules/last.js","../node_modules/underscore/modules/compact.js","../node_modules/underscore/modules/flatten.js","../node_modules/underscore/modules/uniq.js","../node_modules/underscore/modules/intersection.js","../node_modules/underscore/modules/unzip.js","../node_modules/underscore/modules/object.js","../node_modules/underscore/modules/range.js","../node_modules/underscore/modules/chunk.js","../node_modules/underscore/modules/_chainResult.js","../node_modules/underscore/modules/mixin.js","../node_modules/mkdirp/index.js","../node_modules/fs.realpath/old.js","../node_modules/fs.realpath/index.js","../node_modules/balanced-match/index.js","../node_modules/brace-expansion/index.js","../node_modules/minimatch/minimatch.js","../node_modules/path-is-absolute/index.js","../node_modules/glob/common.js","../node_modules/glob/sync.js","../node_modules/wrappy/wrappy.js","../node_modules/once/once.js","../node_modules/inflight/inflight.js","../node_modules/glob/glob.js","../node_modules/rimraf/rimraf.js","../lib/minimap-plugin-generator-element.js","../node_modules/underscore/modules/_setup.js","../node_modules/underscore/modules/isString.js","../node_modules/underscore/modules/isNumber.js","../node_modules/underscore/modules/isDate.js","../node_modules/underscore/modules/isRegExp.js","../node_modules/underscore/modules/isError.js","../node_modules/underscore/modules/isSymbol.js","../node_modules/underscore/modules/isMap.js","../node_modules/underscore/modules/isWeakMap.js","../node_modules/underscore/modules/isSet.js","../node_modules/underscore/modules/isWeakSet.js","../node_modules/underscore/modules/isArrayBuffer.js","../node_modules/underscore/modules/isDataView.js","../node_modules/underscore/modules/isArray.js","../node_modules/underscore/modules/isFunction.js","../node_modules/underscore/modules/isArguments.js","../node_modules/underscore/modules/_getByteLength.js","../node_modules/underscore/modules/_isBufferLike.js","../node_modules/underscore/modules/_getLength.js","../node_modules/underscore/modules/_isArrayLike.js","../node_modules/underscore/modules/extend.js","../node_modules/underscore/modules/extendOwn.js","../node_modules/underscore/modules/defaults.js","../node_modules/underscore/modules/now.js","../node_modules/underscore/modules/_escapeMap.js","../node_modules/underscore/modules/escape.js","../node_modules/underscore/modules/_unescapeMap.js","../node_modules/underscore/modules/unescape.js","../node_modules/underscore/modules/templateSettings.js","../node_modules/underscore/modules/partial.js","../node_modules/underscore/modules/bind.js","../node_modules/underscore/modules/bindAll.js","../node_modules/underscore/modules/delay.js","../node_modules/underscore/modules/defer.js","../node_modules/underscore/modules/once.js","../node_modules/underscore/modules/findIndex.js","../node_modules/underscore/modules/findLastIndex.js","../node_modules/underscore/modules/indexOf.js","../node_modules/underscore/modules/lastIndexOf.js","../node_modules/underscore/modules/reduce.js","../node_modules/underscore/modules/reduceRight.js","../node_modules/underscore/modules/invoke.js","../node_modules/underscore/modules/groupBy.js","../node_modules/underscore/modules/indexBy.js","../node_modules/underscore/modules/countBy.js","../node_modules/underscore/modules/partition.js","../node_modules/underscore/modules/pick.js","../node_modules/underscore/modules/omit.js","../node_modules/underscore/modules/difference.js","../node_modules/underscore/modules/without.js","../node_modules/underscore/modules/union.js","../node_modules/underscore/modules/zip.js","../node_modules/underscore/modules/underscore-array-methods.js","../node_modules/underscore/modules/index-default.js","../node_modules/underscore-plus/lib/underscore-plus.js","../node_modules/async/lib/async.js","../node_modules/concat-map/index.js","../node_modules/inherits/inherits_browser.js","../node_modules/inherits/inherits.js","../node_modules/fs-plus/lib/fs-plus.js"],"sourcesContent":["// Some functions take a variable number of arguments, or a few expected\n// arguments at the beginning and then a variable number of values to operate\n// on. This helper accumulates all remaining arguments past the function’s\n// argument length (or an explicit `startIndex`), into an array that becomes\n// the last argument. Similar to ES6’s \"rest parameter\".\nexport default function restArguments(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n}\n","// Is a given variable an object?\nexport default function isObject(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n}\n","// Is a given value equal to null?\nexport default function isNull(obj) {\n return obj === null;\n}\n","// Is a given variable undefined?\nexport default function isUndefined(obj) {\n return obj === void 0;\n}\n","import { toString } from './_setup.js';\n\n// Is a given value a boolean?\nexport default function isBoolean(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n}\n","// Is a given value a DOM element?\nexport default function isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}\n","import { toString } from './_setup.js';\n\n// Internal function for creating a `toString`-based type tester.\nexport default function tagTester(name) {\n return function(obj) {\n return toString.call(obj) === '[object ' + name + ']';\n };\n}\n","import { hasOwnProperty } from './_setup.js';\n\n// Internal function to check whether `key` is an own property name of `obj`.\nexport default function has(obj, key) {\n return obj != null && hasOwnProperty.call(obj, key);\n}\n","import { _isFinite } from './_setup.js';\nimport isSymbol from './isSymbol.js';\n\n// Is a given object a finite number?\nexport default function isFinite(obj) {\n return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));\n}\n","import { _isNaN } from './_setup.js';\nimport isNumber from './isNumber.js';\n\n// Is the given value `NaN`?\nexport default function isNaN(obj) {\n return isNumber(obj) && _isNaN(obj);\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function constant(value) {\n return function() {\n return value;\n };\n}\n","import { MAX_ARRAY_INDEX } from './_setup.js';\n\n// Common internal logic for `isArrayLike` and `isBufferLike`.\nexport default function createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n","// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n","import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js';\nimport isDataView from './isDataView.js';\nimport constant from './constant.js';\nimport isBufferLike from './_isBufferLike.js';\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nfunction isTypedArray(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :\n isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n}\n\nexport default supportsArrayBuffer ? isTypedArray : constant(false);\n","import { nonEnumerableProps, ObjProto } from './_setup.js';\nimport isFunction from './isFunction.js';\nimport has from './_has.js';\n\n// Internal helper to create a simple lookup structure.\n// `collectNonEnumProps` used to depend on `_.contains`, but this led to\n// circular imports. `emulatedSet` is a one-off solution that only works for\n// arrays of strings.\nfunction emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key]; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n}\n\n// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't\n// be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n// needed.\nexport default function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = isFunction(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n}\n","import isObject from './isObject.js';\nimport { nativeKeys, hasEnumBug } from './_setup.js';\nimport has from './_has.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve the names of an object's own properties.\n// Delegates to **ECMAScript 5**'s native `Object.keys`.\nexport default function keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport isArray from './isArray.js';\nimport isString from './isString.js';\nimport isArguments from './isArguments.js';\nimport keys from './keys.js';\n\n// Is a given array, string, or object empty?\n// An \"empty\" object has no enumerable own-properties.\nexport default function isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n if (isArrayLike(obj) && (isArray(obj) || isString(obj) || isArguments(obj))) return obj.length === 0;\n return keys(obj).length === 0;\n}\n","import keys from './keys.js';\n\n// Returns whether an object has a given set of `key:value` pairs.\nexport default function isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n","import { VERSION } from './_setup.js';\n\n// If Underscore is called as a function, it returns a wrapped object that can\n// be used OO-style. This wrapper holds altered versions of all functions added\n// through `_.mixin`. Wrapped objects may be chained.\nexport default function _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n_.VERSION = VERSION;\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxies for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n","import _ from './underscore.js';\nimport { toString, SymbolProto } from './_setup.js';\nimport getByteLength from './_getByteLength.js';\nimport isTypedArray from './isTypedArray.js';\nimport isFunction from './isFunction.js';\nimport keys from './keys.js';\nimport has from './_has.js';\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n // Coerce to `DataView` so we can fall through to the next case.\n return deepEq(new DataView(a), new DataView(b), aStack, bStack);\n case '[object DataView]':\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) {\n return false;\n }\n while (byteLength--) {\n if (a.getUint8(byteLength) !== b.getUint8(byteLength)) {\n return false;\n }\n }\n return true;\n }\n\n if (isTypedArray(a)) {\n // Coerce typed arrays to `DataView`.\n return deepEq(new DataView(a.buffer), new DataView(b.buffer), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\n isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nexport default function isEqual(a, b) {\n return eq(a, b);\n}\n","import isObject from './isObject.js';\nimport { hasEnumBug } from './_setup.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve all the enumerable property names of an object.\nexport default function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import keys from './keys.js';\n\n// Retrieve the values of an object's properties.\nexport default function values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n","import keys from './keys.js';\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of `_.object` with one argument.\nexport default function pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n","import keys from './keys.js';\n\n// Invert the keys and values of an object. The values must be serializable.\nexport default function invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n","import isFunction from './isFunction.js';\n\n// Return a sorted list of the function names available on the object.\nexport default function functions(obj) {\n var names = [];\n for (var key in obj) {\n if (isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\n","// An internal function for creating assigner functions.\nexport default function createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n","import isObject from './isObject.js';\nimport { nativeCreate } from './_setup.js';\n\n// Create a naked function reference for surrogate-prototype-swapping.\nfunction ctor() {\n return function(){};\n}\n\n// An internal function for creating a new object that inherits from another.\nexport default function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n","import baseCreate from './_baseCreate.js';\nimport extendOwn from './extendOwn.js';\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nexport default function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n","import isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport extend from './extend.js';\n\n// Create a (shallow-cloned) duplicate of an object.\nexport default function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n","// Invokes `interceptor` with the `obj` and then returns `obj`.\n// The primary purpose of this method is to \"tap into\" a method chain, in\n// order to perform operations on intermediate results within the chain.\nexport default function tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n","import isArray from './isArray.js';\nimport _has from './_has.js';\nimport { hasOwnProperty } from './_setup.js';\n\n// Shortcut function for checking if an object has a given property directly on\n// itself (in other words, not on a prototype). Unlike the internal `has`\n// function, this public version can also traverse nested properties.\nexport default function has(obj, path) {\n if (!isArray(path)) {\n return _has(obj, path);\n }\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (obj == null || !hasOwnProperty.call(obj, key)) {\n return false;\n }\n obj = obj[key];\n }\n return !!length;\n}\n","// Keep the identity function around for default iteratees.\nexport default function identity(value) {\n return value;\n}\n","import extendOwn from './extendOwn.js';\nimport isMatch from './isMatch.js';\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nexport default function matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\n","// Internal function to obtain a nested property in `obj` along `path`.\nexport default function deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n","import isArray from './isArray.js';\nimport shallowProperty from './_shallowProperty.js';\nimport deepGet from './_deepGet.js';\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indices.\nexport default function property(path) {\n if (!isArray(path)) {\n return shallowProperty(path);\n }\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n","// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nexport default function optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n","import identity from './identity.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport matcher from './matcher.js';\nimport property from './property.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `_.identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nexport default function baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only `argCount` argument.\nexport default function iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n_.iteratee = iteratee;\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\nimport iteratee from './iteratee.js';\n\n// The function we call internally to generate a callback. It invokes\n// `_.iteratee` if overridden, otherwise `baseIteratee`.\nexport default function cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the results of applying the `iteratee` to each element of `obj`.\n// In contrast to `_.map` it returns an object.\nexport default function mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function noop(){}\n","import isArray from './isArray.js';\nimport deepGet from './_deepGet.js';\n\n// Generates a function for a given object that returns a given property.\nexport default function propertyOf(obj) {\n if (obj == null) {\n return function(){};\n }\n return function(path) {\n return !isArray(path) ? obj[path] : deepGet(obj, path);\n };\n}\n","import optimizeCb from './_optimizeCb.js';\n\n// Run a function **n** times.\nexport default function times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n","// Return a random integer between `min` and `max` (inclusive).\nexport default function random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n","import keys from './keys.js';\n\n// Internal helper to generate functions for escaping and unescaping strings\n// to/from HTML interpolation.\nexport default function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\n","import defaults from './defaults.js';\nimport _ from './underscore.js';\nimport './templateSettings.js';\n\n// When customizing `_.templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\nvar escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\nfunction escapeChar(match) {\n return '\\\\' + escapes[match];\n}\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nexport default function template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n var argument = settings.variable || 'obj';\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n}\n","import isArray from './isArray.js';\nimport isFunction from './isFunction.js';\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nexport default function result(obj, path, fallback) {\n if (!isArray(path)) path = [path];\n var length = path.length;\n if (!length) {\n return isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n","// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nexport default function uniqueId(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n","import _ from './underscore.js';\n\n// Start chaining a wrapped Underscore object.\nexport default function chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n","import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n// Internal function to execute `sourceFunc` bound to `context` with optional\n// `args`. Determines whether to execute a function as a constructor or as a\n// normal function.\nexport default function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n","import getLength from './_getLength.js';\nimport isArrayLike from './_isArrayLike.js';\nimport isArray from './isArray.js';\nimport isArguments from './isArguments.js';\n\n// Internal implementation of a recursive `flatten` function.\nexport default function flatten(input, depth, strict, output) {\n output = output || [];\n if (!depth && depth !== 0) {\n depth = Infinity;\n } else if (depth <= 0) {\n return output.concat(input);\n }\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (isArray(value) || isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (depth > 1) {\n flatten(value, depth - 1, strict, output);\n idx = output.length;\n } else {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n","import has from './_has.js';\n\n// Memoize an expensive function by storing its results.\nexport default function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n","import now from './now.js';\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you'd like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nexport default function throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n","import restArguments from './restArguments.js';\nimport delay from './delay.js';\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequence is defined by the `wait`\n// parameter. If `immediate` is passed, the argument function will be\n// triggered at the beginning of the sequence instead of at the end.\nexport default function debounce(func, wait, immediate) {\n var timeout, result;\n\n var later = function(context, args) {\n timeout = null;\n if (args) result = func.apply(context, args);\n };\n\n var debounced = restArguments(function(args) {\n if (timeout) clearTimeout(timeout);\n if (immediate) {\n var callNow = !timeout;\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(this, args);\n } else {\n timeout = delay(later, wait, this, args);\n }\n\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = null;\n };\n\n return debounced;\n}\n","import partial from './partial.js';\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nexport default function wrap(func, wrapper) {\n return partial(wrapper, func);\n}\n","// Returns a negated version of the passed-in predicate.\nexport default function negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n","// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nexport default function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n","// Returns a function that will only be executed on and after the Nth call.\nexport default function after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n","// Returns a function that will only be executed up to (but not including) the\n// Nth call.\nexport default function before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the first key on an object that passes a truth test.\nexport default function findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Internal function to generate `_.findIndex` and `_.findLastIndex`.\nexport default function createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nexport default function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n","import getLength from './_getLength.js';\nimport { slice } from './_setup.js';\nimport isNaN from './isNaN.js';\n\n// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\nexport default function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n","import isArrayLike from './_isArrayLike.js';\nimport findIndex from './findIndex.js';\nimport findKey from './findKey.js';\n\n// Return the first value which passes a truth test.\nexport default function find(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\n","import find from './find.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.find`: getting the first\n// object containing specific `key:value` pairs.\nexport default function findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n","import optimizeCb from './_optimizeCb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// The cornerstone for collection functions, an `each`\n// implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nexport default function each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the results of applying the iteratee to each element.\nexport default function map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// Internal helper to create a reducing function, iterating left or right.\nexport default function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// Return all the elements that pass a truth test.\nexport default function filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\n","import filter from './filter.js';\nimport negate from './negate.js';\nimport cb from './_cb.js';\n\n// Return all the elements for which a truth test fails.\nexport default function reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine whether all of the elements pass a truth test.\nexport default function every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine if at least one element in the object passes a truth test.\nexport default function some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport indexOf from './indexOf.js';\n\n// Determine if the array or object contains a given item (using `===`).\nexport default function contains(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\n","import map from './map.js';\nimport property from './property.js';\n\n// Convenience version of a common use case of `_.map`: fetching a property.\nexport default function pluck(obj, key) {\n return map(obj, property(key));\n}\n","import filter from './filter.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.filter`: selecting only\n// objects containing specific `key:value` pairs.\nexport default function where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the maximum element (or element-based computation).\nexport default function max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the minimum element (or element-based computation).\nexport default function min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport clone from './clone.js';\nimport values from './values.js';\nimport getLength from './_getLength.js';\nimport random from './random.js';\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `_.map`.\nexport default function sample(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = isArrayLike(obj) ? clone(obj) : values(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n","import sample from './sample.js';\n\n// Shuffle a collection.\nexport default function shuffle(obj) {\n return sample(obj, Infinity);\n}\n","import cb from './_cb.js';\nimport pluck from './pluck.js';\nimport map from './map.js';\n\n// Sort the object's values by a criterion produced by an iteratee.\nexport default function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n}\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// An internal function used for aggregate \"group by\" operations.\nexport default function group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n","import isArray from './isArray.js';\nimport { slice } from './_setup.js';\nimport isString from './isString.js';\nimport isArrayLike from './_isArrayLike.js';\nimport map from './map.js';\nimport identity from './identity.js';\nimport values from './values.js';\n\n// Safely create a real, live array from anything iterable.\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\nexport default function toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together.\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the number of elements in a collection.\nexport default function size(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n","// Internal `_.pick` helper function to determine whether `key` is an enumerable\n// property name of `obj`.\nexport default function keyInObj(value, key, obj) {\n return key in obj;\n}\n","import { slice } from './_setup.js';\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nexport default function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n","import initial from './initial.js';\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `_.map`.\nexport default function first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\n","import { slice } from './_setup.js';\n\n// Returns everything but the first entry of the `array`. Especially useful on\n// the `arguments` object. Passing an **n** will return the rest N values in the\n// `array`.\nexport default function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\n","import rest from './rest.js';\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nexport default function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n","import filter from './filter.js';\n\n// Trim out all falsy values from an array.\nexport default function compact(array) {\n return filter(array, Boolean);\n}\n","import _flatten from './_flatten.js';\n\n// Flatten out an array, either recursively (by default), or up to `depth`.\n// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\nexport default function flatten(array, depth) {\n return _flatten(array, depth, false);\n}\n","import isBoolean from './isBoolean.js';\nimport cb from './_cb.js';\nimport getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nexport default function uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\n","import getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nexport default function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n","import max from './max.js';\nimport getLength from './_getLength.js';\nimport pluck from './pluck.js';\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array's elements on shared indices.\nexport default function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n","import getLength from './_getLength.js';\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of `_.pairs`.\nexport default function object(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n","// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nexport default function range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","import _ from './underscore.js';\n\n// Helper function to continue chaining intermediate results.\nexport default function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport functions from './functions.js';\nimport { push } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add your own custom functions to the Underscore object.\nexport default function mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n","var path = require('path');\nvar fs = require('fs');\nvar _0777 = parseInt('0777', 8);\n\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\n\nfunction mkdirP (p, opts, f, made) {\n if (typeof opts === 'function') {\n f = opts;\n opts = {};\n }\n else if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n \n var cb = f || function () {};\n p = path.resolve(p);\n \n xfs.mkdir(p, mode, function (er) {\n if (!er) {\n made = made || p;\n return cb(null, made);\n }\n switch (er.code) {\n case 'ENOENT':\n if (path.dirname(p) === p) return cb(er);\n mkdirP(path.dirname(p), opts, function (er, made) {\n if (er) cb(er, made);\n else mkdirP(p, opts, cb, made);\n });\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n xfs.stat(p, function (er2, stat) {\n // if the stat fails, then that's super weird.\n // let the original error be the failure reason.\n if (er2 || !stat.isDirectory()) cb(er, made)\n else cb(null, made);\n });\n break;\n }\n });\n}\n\nmkdirP.sync = function sync (p, opts, made) {\n if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n\n p = path.resolve(p);\n\n try {\n xfs.mkdirSync(p, mode);\n made = made || p;\n }\n catch (err0) {\n switch (err0.code) {\n case 'ENOENT' :\n made = sync(path.dirname(p), opts, made);\n sync(p, opts, made);\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n var stat;\n try {\n stat = xfs.statSync(p);\n }\n catch (err1) {\n throw err0;\n }\n if (!stat.isDirectory()) throw err0;\n break;\n }\n }\n\n return made;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar pathModule = require('path');\nvar isWindows = process.platform === 'win32';\nvar fs = require('fs');\n\n// JavaScript implementation of realpath, ported from node pre-v6\n\nvar DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);\n\nfunction rethrow() {\n // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and\n // is fairly slow to generate.\n var callback;\n if (DEBUG) {\n var backtrace = new Error;\n callback = debugCallback;\n } else\n callback = missingCallback;\n\n return callback;\n\n function debugCallback(err) {\n if (err) {\n backtrace.message = err.message;\n err = backtrace;\n missingCallback(err);\n }\n }\n\n function missingCallback(err) {\n if (err) {\n if (process.throwDeprecation)\n throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs\n else if (!process.noDeprecation) {\n var msg = 'fs: missing callback ' + (err.stack || err.message);\n if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n }\n }\n }\n}\n\nfunction maybeCallback(cb) {\n return typeof cb === 'function' ? cb : rethrow();\n}\n\nvar normalize = pathModule.normalize;\n\n// Regexp that finds the next partion of a (partial) path\n// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']\nif (isWindows) {\n var nextPartRe = /(.*?)(?:[\\/\\\\]+|$)/g;\n} else {\n var nextPartRe = /(.*?)(?:[\\/]+|$)/g;\n}\n\n// Regex to find the device root, including trailing slash. E.g. 'c:\\\\'.\nif (isWindows) {\n var splitRootRe = /^(?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/][^\\\\\\/]+)?[\\\\\\/]*/;\n} else {\n var splitRootRe = /^[\\/]*/;\n}\n\nexports.realpathSync = function realpathSync(p, cache) {\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return cache[p];\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstatSync(base);\n knownHard[base] = true;\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n // NB: p.length changes.\n while (pos < p.length) {\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n continue;\n }\n\n var resolvedLink;\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // some known symbolic link. no need to stat again.\n resolvedLink = cache[base];\n } else {\n var stat = fs.lstatSync(base);\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n continue;\n }\n\n // read the link if it wasn't read before\n // dev/ino always return 0 on windows, so skip the check.\n var linkTarget = null;\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n linkTarget = seenLinks[id];\n }\n }\n if (linkTarget === null) {\n fs.statSync(base);\n linkTarget = fs.readlinkSync(base);\n }\n resolvedLink = pathModule.resolve(previous, linkTarget);\n // track this, if given a cache.\n if (cache) cache[base] = resolvedLink;\n if (!isWindows) seenLinks[id] = linkTarget;\n }\n\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n\n if (cache) cache[original] = p;\n\n return p;\n};\n\n\nexports.realpath = function realpath(p, cache, cb) {\n if (typeof cb !== 'function') {\n cb = maybeCallback(cache);\n cache = null;\n }\n\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return process.nextTick(cb.bind(null, null, cache[p]));\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstat(base, function(err) {\n if (err) return cb(err);\n knownHard[base] = true;\n LOOP();\n });\n } else {\n process.nextTick(LOOP);\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }\n\n function gotStat(err, stat) {\n if (err) return cb(err);\n\n // if not a symlink, skip to the next path part\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n return process.nextTick(LOOP);\n }\n\n // stat & read the link if not read before\n // call gotTarget as soon as the link target is known\n // dev/ino always return 0 on windows, so skip the check.\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n return gotTarget(null, seenLinks[id], base);\n }\n }\n fs.stat(base, function(err) {\n if (err) return cb(err);\n\n fs.readlink(base, function(err, target) {\n if (!isWindows) seenLinks[id] = target;\n gotTarget(err, target);\n });\n });\n }\n\n function gotTarget(err, target, base) {\n if (err) return cb(err);\n\n var resolvedLink = pathModule.resolve(previous, target);\n if (cache) cache[base] = resolvedLink;\n gotResolvedLink(resolvedLink);\n }\n\n function gotResolvedLink(resolvedLink) {\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n};\n","module.exports = realpath\nrealpath.realpath = realpath\nrealpath.sync = realpathSync\nrealpath.realpathSync = realpathSync\nrealpath.monkeypatch = monkeypatch\nrealpath.unmonkeypatch = unmonkeypatch\n\nvar fs = require('fs')\nvar origRealpath = fs.realpath\nvar origRealpathSync = fs.realpathSync\n\nvar version = process.version\nvar ok = /^v[0-5]\\./.test(version)\nvar old = require('./old.js')\n\nfunction newError (er) {\n return er && er.syscall === 'realpath' && (\n er.code === 'ELOOP' ||\n er.code === 'ENOMEM' ||\n er.code === 'ENAMETOOLONG'\n )\n}\n\nfunction realpath (p, cache, cb) {\n if (ok) {\n return origRealpath(p, cache, cb)\n }\n\n if (typeof cache === 'function') {\n cb = cache\n cache = null\n }\n origRealpath(p, cache, function (er, result) {\n if (newError(er)) {\n old.realpath(p, cache, cb)\n } else {\n cb(er, result)\n }\n })\n}\n\nfunction realpathSync (p, cache) {\n if (ok) {\n return origRealpathSync(p, cache)\n }\n\n try {\n return origRealpathSync(p, cache)\n } catch (er) {\n if (newError(er)) {\n return old.realpathSync(p, cache)\n } else {\n throw er\n }\n }\n}\n\nfunction monkeypatch () {\n fs.realpath = realpath\n fs.realpathSync = realpathSync\n}\n\nfunction unmonkeypatch () {\n fs.realpath = origRealpath\n fs.realpathSync = origRealpathSync\n}\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n\nfunction posix(path) {\n\treturn path.charAt(0) === '/';\n}\n\nfunction win32(path) {\n\t// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56\n\tvar splitDeviceRe = /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\tvar result = splitDeviceRe.exec(path);\n\tvar device = result[1] || '';\n\tvar isUnc = Boolean(device && device.charAt(1) !== ':');\n\n\t// UNC paths are always absolute\n\treturn Boolean(result[2] || isUnc);\n}\n\nmodule.exports = process.platform === 'win32' ? win32 : posix;\nmodule.exports.posix = posix;\nmodule.exports.win32 = win32;\n","exports.alphasort = alphasort\nexports.alphasorti = alphasorti\nexports.setopts = setopts\nexports.ownProp = ownProp\nexports.makeAbs = makeAbs\nexports.finish = finish\nexports.mark = mark\nexports.isIgnored = isIgnored\nexports.childrenIgnored = childrenIgnored\n\nfunction ownProp (obj, field) {\n return Object.prototype.hasOwnProperty.call(obj, field)\n}\n\nvar path = require(\"path\")\nvar minimatch = require(\"minimatch\")\nvar isAbsolute = require(\"path-is-absolute\")\nvar Minimatch = minimatch.Minimatch\n\nfunction alphasorti (a, b) {\n return a.toLowerCase().localeCompare(b.toLowerCase())\n}\n\nfunction alphasort (a, b) {\n return a.localeCompare(b)\n}\n\nfunction setupIgnores (self, options) {\n self.ignore = options.ignore || []\n\n if (!Array.isArray(self.ignore))\n self.ignore = [self.ignore]\n\n if (self.ignore.length) {\n self.ignore = self.ignore.map(ignoreMap)\n }\n}\n\n// ignore patterns are always in dot:true mode.\nfunction ignoreMap (pattern) {\n var gmatcher = null\n if (pattern.slice(-3) === '/**') {\n var gpattern = pattern.replace(/(\\/\\*\\*)+$/, '')\n gmatcher = new Minimatch(gpattern, { dot: true })\n }\n\n return {\n matcher: new Minimatch(pattern, { dot: true }),\n gmatcher: gmatcher\n }\n}\n\nfunction setopts (self, pattern, options) {\n if (!options)\n options = {}\n\n // base-matching: just use globstar for that.\n if (options.matchBase && -1 === pattern.indexOf(\"/\")) {\n if (options.noglobstar) {\n throw new Error(\"base matching requires globstar\")\n }\n pattern = \"**/\" + pattern\n }\n\n self.silent = !!options.silent\n self.pattern = pattern\n self.strict = options.strict !== false\n self.realpath = !!options.realpath\n self.realpathCache = options.realpathCache || Object.create(null)\n self.follow = !!options.follow\n self.dot = !!options.dot\n self.mark = !!options.mark\n self.nodir = !!options.nodir\n if (self.nodir)\n self.mark = true\n self.sync = !!options.sync\n self.nounique = !!options.nounique\n self.nonull = !!options.nonull\n self.nosort = !!options.nosort\n self.nocase = !!options.nocase\n self.stat = !!options.stat\n self.noprocess = !!options.noprocess\n self.absolute = !!options.absolute\n\n self.maxLength = options.maxLength || Infinity\n self.cache = options.cache || Object.create(null)\n self.statCache = options.statCache || Object.create(null)\n self.symlinks = options.symlinks || Object.create(null)\n\n setupIgnores(self, options)\n\n self.changedCwd = false\n var cwd = process.cwd()\n if (!ownProp(options, \"cwd\"))\n self.cwd = cwd\n else {\n self.cwd = path.resolve(options.cwd)\n self.changedCwd = self.cwd !== cwd\n }\n\n self.root = options.root || path.resolve(self.cwd, \"/\")\n self.root = path.resolve(self.root)\n if (process.platform === \"win32\")\n self.root = self.root.replace(/\\\\/g, \"/\")\n\n // TODO: is an absolute `cwd` supposed to be resolved against `root`?\n // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')\n self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)\n if (process.platform === \"win32\")\n self.cwdAbs = self.cwdAbs.replace(/\\\\/g, \"/\")\n self.nomount = !!options.nomount\n\n // disable comments and negation in Minimatch.\n // Note that they are not supported in Glob itself anyway.\n options.nonegate = true\n options.nocomment = true\n\n self.minimatch = new Minimatch(pattern, options)\n self.options = self.minimatch.options\n}\n\nfunction finish (self) {\n var nou = self.nounique\n var all = nou ? [] : Object.create(null)\n\n for (var i = 0, l = self.matches.length; i < l; i ++) {\n var matches = self.matches[i]\n if (!matches || Object.keys(matches).length === 0) {\n if (self.nonull) {\n // do like the shell, and spit out the literal glob\n var literal = self.minimatch.globSet[i]\n if (nou)\n all.push(literal)\n else\n all[literal] = true\n }\n } else {\n // had matches\n var m = Object.keys(matches)\n if (nou)\n all.push.apply(all, m)\n else\n m.forEach(function (m) {\n all[m] = true\n })\n }\n }\n\n if (!nou)\n all = Object.keys(all)\n\n if (!self.nosort)\n all = all.sort(self.nocase ? alphasorti : alphasort)\n\n // at *some* point we statted all of these\n if (self.mark) {\n for (var i = 0; i < all.length; i++) {\n all[i] = self._mark(all[i])\n }\n if (self.nodir) {\n all = all.filter(function (e) {\n var notDir = !(/\\/$/.test(e))\n var c = self.cache[e] || self.cache[makeAbs(self, e)]\n if (notDir && c)\n notDir = c !== 'DIR' && !Array.isArray(c)\n return notDir\n })\n }\n }\n\n if (self.ignore.length)\n all = all.filter(function(m) {\n return !isIgnored(self, m)\n })\n\n self.found = all\n}\n\nfunction mark (self, p) {\n var abs = makeAbs(self, p)\n var c = self.cache[abs]\n var m = p\n if (c) {\n var isDir = c === 'DIR' || Array.isArray(c)\n var slash = p.slice(-1) === '/'\n\n if (isDir && !slash)\n m += '/'\n else if (!isDir && slash)\n m = m.slice(0, -1)\n\n if (m !== p) {\n var mabs = makeAbs(self, m)\n self.statCache[mabs] = self.statCache[abs]\n self.cache[mabs] = self.cache[abs]\n }\n }\n\n return m\n}\n\n// lotta situps...\nfunction makeAbs (self, f) {\n var abs = f\n if (f.charAt(0) === '/') {\n abs = path.join(self.root, f)\n } else if (isAbsolute(f) || f === '') {\n abs = f\n } else if (self.changedCwd) {\n abs = path.resolve(self.cwd, f)\n } else {\n abs = path.resolve(f)\n }\n\n if (process.platform === 'win32')\n abs = abs.replace(/\\\\/g, '/')\n\n return abs\n}\n\n\n// Return true, if pattern ends with globstar '**', for the accompanying parent directory.\n// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents\nfunction isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n\nfunction childrenIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n","module.exports = globSync\nglobSync.GlobSync = GlobSync\n\nvar fs = require('fs')\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar Glob = require('./glob.js').Glob\nvar util = require('util')\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar common = require('./common.js')\nvar alphasort = common.alphasort\nvar alphasorti = common.alphasorti\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nfunction globSync (pattern, options) {\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n return new GlobSync(pattern, options).found\n}\n\nfunction GlobSync (pattern, options) {\n if (!pattern)\n throw new Error('must provide pattern')\n\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n if (!(this instanceof GlobSync))\n return new GlobSync(pattern, options)\n\n setopts(this, pattern, options)\n\n if (this.noprocess)\n return this\n\n var n = this.minimatch.set.length\n this.matches = new Array(n)\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false)\n }\n this._finish()\n}\n\nGlobSync.prototype._finish = function () {\n assert(this instanceof GlobSync)\n if (this.realpath) {\n var self = this\n this.matches.forEach(function (matchset, index) {\n var set = self.matches[index] = Object.create(null)\n for (var p in matchset) {\n try {\n p = self._makeAbs(p)\n var real = rp.realpathSync(p, self.realpathCache)\n set[real] = true\n } catch (er) {\n if (er.syscall === 'stat')\n set[self._makeAbs(p)] = true\n else\n throw er\n }\n }\n })\n }\n common.finish(this)\n}\n\n\nGlobSync.prototype._process = function (pattern, index, inGlobStar) {\n assert(this instanceof GlobSync)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // See if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip processing\n if (childrenIgnored(this, read))\n return\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar)\n}\n\n\nGlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {\n var entries = this._readdir(abs, inGlobStar)\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix.slice(-1) !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix)\n newPattern = [prefix, e]\n else\n newPattern = [e]\n this._process(newPattern.concat(remain), index, inGlobStar)\n }\n}\n\n\nGlobSync.prototype._emitMatch = function (index, e) {\n if (isIgnored(this, e))\n return\n\n var abs = this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute) {\n e = abs\n }\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n if (this.stat)\n this._stat(e)\n}\n\n\nGlobSync.prototype._readdirInGlobStar = function (abs) {\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false)\n\n var entries\n var lstat\n var stat\n try {\n lstat = fs.lstatSync(abs)\n } catch (er) {\n if (er.code === 'ENOENT') {\n // lstat failed, doesn't exist\n return null\n }\n }\n\n var isSym = lstat && lstat.isSymbolicLink()\n this.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory())\n this.cache[abs] = 'FILE'\n else\n entries = this._readdir(abs, false)\n\n return entries\n}\n\nGlobSync.prototype._readdir = function (abs, inGlobStar) {\n var entries\n\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return null\n\n if (Array.isArray(c))\n return c\n }\n\n try {\n return this._readdirEntries(abs, fs.readdirSync(abs))\n } catch (er) {\n this._readdirError(abs, er)\n return null\n }\n}\n\nGlobSync.prototype._readdirEntries = function (abs, entries) {\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n\n // mark and cache dir-ness\n return entries\n}\n\nGlobSync.prototype._readdirError = function (f, er) {\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n throw error\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict)\n throw er\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n}\n\nGlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {\n\n var entries = this._readdir(abs, inGlobStar)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false)\n\n var len = entries.length\n var isSym = this.symlinks[abs]\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true)\n }\n}\n\nGlobSync.prototype._processSimple = function (prefix, index) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var exists = this._stat(prefix)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlobSync.prototype._stat = function (f) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return false\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return c\n\n if (needDir && c === 'FILE')\n return false\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (!stat) {\n var lstat\n try {\n lstat = fs.lstatSync(abs)\n } catch (er) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return false\n }\n }\n\n if (lstat && lstat.isSymbolicLink()) {\n try {\n stat = fs.statSync(abs)\n } catch (er) {\n stat = lstat\n }\n } else {\n stat = lstat\n }\n }\n\n this.statCache[abs] = stat\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return false\n\n return c\n}\n\nGlobSync.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlobSync.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","var wrappy = require('wrappy')\nvar reqs = Object.create(null)\nvar once = require('once')\n\nmodule.exports = wrappy(inflight)\n\nfunction inflight (key, cb) {\n if (reqs[key]) {\n reqs[key].push(cb)\n return null\n } else {\n reqs[key] = [cb]\n return makeres(key)\n }\n}\n\nfunction makeres (key) {\n return once(function RES () {\n var cbs = reqs[key]\n var len = cbs.length\n var args = slice(arguments)\n\n // XXX It's somewhat ambiguous whether a new callback added in this\n // pass should be queued for later execution if something in the\n // list of callbacks throws, or if it should just be discarded.\n // However, it's such an edge case that it hardly matters, and either\n // choice is likely as surprising as the other.\n // As it happens, we do go ahead and schedule it for later execution.\n try {\n for (var i = 0; i < len; i++) {\n cbs[i].apply(null, args)\n }\n } finally {\n if (cbs.length > len) {\n // added more in the interim.\n // de-zalgo, just in case, but don't call again.\n cbs.splice(0, len)\n process.nextTick(function () {\n RES.apply(null, args)\n })\n } else {\n delete reqs[key]\n }\n }\n })\n}\n\nfunction slice (args) {\n var length = args.length\n var array = []\n\n for (var i = 0; i < length; i++) array[i] = args[i]\n return array\n}\n","// Approach:\n//\n// 1. Get the minimatch set\n// 2. For each pattern in the set, PROCESS(pattern, false)\n// 3. Store matches per-set, then uniq them\n//\n// PROCESS(pattern, inGlobStar)\n// Get the first [n] items from pattern that are all strings\n// Join these together. This is PREFIX.\n// If there is no more remaining, then stat(PREFIX) and\n// add to matches if it succeeds. END.\n//\n// If inGlobStar and PREFIX is symlink and points to dir\n// set ENTRIES = []\n// else readdir(PREFIX) as ENTRIES\n// If fail, END\n//\n// with ENTRIES\n// If pattern[n] is GLOBSTAR\n// // handle the case where the globstar match is empty\n// // by pruning it out, and testing the resulting pattern\n// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)\n// // handle other cases.\n// for ENTRY in ENTRIES (not dotfiles)\n// // attach globstar + tail onto the entry\n// // Mark that this entry is a globstar match\n// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)\n//\n// else // not globstar\n// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)\n// Test ENTRY against pattern[n]\n// If fails, continue\n// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])\n//\n// Caveat:\n// Cache all stats and readdirs results to minimize syscall. Since all\n// we ever care about is existence and directory-ness, we can just keep\n// `true` for files, and [children,...] for directories, or `false` for\n// things that don't exist.\n\nmodule.exports = glob\n\nvar fs = require('fs')\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar inherits = require('inherits')\nvar EE = require('events').EventEmitter\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar globSync = require('./sync.js')\nvar common = require('./common.js')\nvar alphasort = common.alphasort\nvar alphasorti = common.alphasorti\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar inflight = require('inflight')\nvar util = require('util')\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nvar once = require('once')\n\nfunction glob (pattern, options, cb) {\n if (typeof options === 'function') cb = options, options = {}\n if (!options) options = {}\n\n if (options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return globSync(pattern, options)\n }\n\n return new Glob(pattern, options, cb)\n}\n\nglob.sync = globSync\nvar GlobSync = glob.GlobSync = globSync.GlobSync\n\n// old api surface\nglob.glob = glob\n\nfunction extend (origin, add) {\n if (add === null || typeof add !== 'object') {\n return origin\n }\n\n var keys = Object.keys(add)\n var i = keys.length\n while (i--) {\n origin[keys[i]] = add[keys[i]]\n }\n return origin\n}\n\nglob.hasMagic = function (pattern, options_) {\n var options = extend({}, options_)\n options.noprocess = true\n\n var g = new Glob(pattern, options)\n var set = g.minimatch.set\n\n if (!pattern)\n return false\n\n if (set.length > 1)\n return true\n\n for (var j = 0; j < set[0].length; j++) {\n if (typeof set[0][j] !== 'string')\n return true\n }\n\n return false\n}\n\nglob.Glob = Glob\ninherits(Glob, EE)\nfunction Glob (pattern, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n\n if (options && options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return new GlobSync(pattern, options)\n }\n\n if (!(this instanceof Glob))\n return new Glob(pattern, options, cb)\n\n setopts(this, pattern, options)\n this._didRealPath = false\n\n // process each pattern in the minimatch set\n var n = this.minimatch.set.length\n\n // The matches are stored as {: true,...} so that\n // duplicates are automagically pruned.\n // Later, we do an Object.keys() on these.\n // Keep them as a list so we can fill in when nonull is set.\n this.matches = new Array(n)\n\n if (typeof cb === 'function') {\n cb = once(cb)\n this.on('error', cb)\n this.on('end', function (matches) {\n cb(null, matches)\n })\n }\n\n var self = this\n this._processing = 0\n\n this._emitQueue = []\n this._processQueue = []\n this.paused = false\n\n if (this.noprocess)\n return this\n\n if (n === 0)\n return done()\n\n var sync = true\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false, done)\n }\n sync = false\n\n function done () {\n --self._processing\n if (self._processing <= 0) {\n if (sync) {\n process.nextTick(function () {\n self._finish()\n })\n } else {\n self._finish()\n }\n }\n }\n}\n\nGlob.prototype._finish = function () {\n assert(this instanceof Glob)\n if (this.aborted)\n return\n\n if (this.realpath && !this._didRealpath)\n return this._realpath()\n\n common.finish(this)\n this.emit('end', this.found)\n}\n\nGlob.prototype._realpath = function () {\n if (this._didRealpath)\n return\n\n this._didRealpath = true\n\n var n = this.matches.length\n if (n === 0)\n return this._finish()\n\n var self = this\n for (var i = 0; i < this.matches.length; i++)\n this._realpathSet(i, next)\n\n function next () {\n if (--n === 0)\n self._finish()\n }\n}\n\nGlob.prototype._realpathSet = function (index, cb) {\n var matchset = this.matches[index]\n if (!matchset)\n return cb()\n\n var found = Object.keys(matchset)\n var self = this\n var n = found.length\n\n if (n === 0)\n return cb()\n\n var set = this.matches[index] = Object.create(null)\n found.forEach(function (p, i) {\n // If there's a problem with the stat, then it means that\n // one or more of the links in the realpath couldn't be\n // resolved. just return the abs value in that case.\n p = self._makeAbs(p)\n rp.realpath(p, self.realpathCache, function (er, real) {\n if (!er)\n set[real] = true\n else if (er.syscall === 'stat')\n set[p] = true\n else\n self.emit('error', er) // srsly wtf right here\n\n if (--n === 0) {\n self.matches[index] = set\n cb()\n }\n })\n })\n}\n\nGlob.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlob.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n\nGlob.prototype.abort = function () {\n this.aborted = true\n this.emit('abort')\n}\n\nGlob.prototype.pause = function () {\n if (!this.paused) {\n this.paused = true\n this.emit('pause')\n }\n}\n\nGlob.prototype.resume = function () {\n if (this.paused) {\n this.emit('resume')\n this.paused = false\n if (this._emitQueue.length) {\n var eq = this._emitQueue.slice(0)\n this._emitQueue.length = 0\n for (var i = 0; i < eq.length; i ++) {\n var e = eq[i]\n this._emitMatch(e[0], e[1])\n }\n }\n if (this._processQueue.length) {\n var pq = this._processQueue.slice(0)\n this._processQueue.length = 0\n for (var i = 0; i < pq.length; i ++) {\n var p = pq[i]\n this._processing--\n this._process(p[0], p[1], p[2], p[3])\n }\n }\n }\n}\n\nGlob.prototype._process = function (pattern, index, inGlobStar, cb) {\n assert(this instanceof Glob)\n assert(typeof cb === 'function')\n\n if (this.aborted)\n return\n\n this._processing++\n if (this.paused) {\n this._processQueue.push([pattern, index, inGlobStar, cb])\n return\n }\n\n //console.error('PROCESS %d', this._processing, pattern)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // see if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index, cb)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip _processing\n if (childrenIgnored(this, read))\n return cb()\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)\n}\n\nGlob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\nGlob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return cb()\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return cb()\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return cb()\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n this._process([e].concat(remain), index, inGlobStar, cb)\n }\n cb()\n}\n\nGlob.prototype._emitMatch = function (index, e) {\n if (this.aborted)\n return\n\n if (isIgnored(this, e))\n return\n\n if (this.paused) {\n this._emitQueue.push([index, e])\n return\n }\n\n var abs = isAbsolute(e) ? e : this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute)\n e = abs\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n var st = this.statCache[abs]\n if (st)\n this.emit('stat', e, st)\n\n this.emit('match', e)\n}\n\nGlob.prototype._readdirInGlobStar = function (abs, cb) {\n if (this.aborted)\n return\n\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false, cb)\n\n var lstatkey = 'lstat\\0' + abs\n var self = this\n var lstatcb = inflight(lstatkey, lstatcb_)\n\n if (lstatcb)\n fs.lstat(abs, lstatcb)\n\n function lstatcb_ (er, lstat) {\n if (er && er.code === 'ENOENT')\n return cb()\n\n var isSym = lstat && lstat.isSymbolicLink()\n self.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory()) {\n self.cache[abs] = 'FILE'\n cb()\n } else\n self._readdir(abs, false, cb)\n }\n}\n\nGlob.prototype._readdir = function (abs, inGlobStar, cb) {\n if (this.aborted)\n return\n\n cb = inflight('readdir\\0'+abs+'\\0'+inGlobStar, cb)\n if (!cb)\n return\n\n //console.error('RD %j %j', +inGlobStar, abs)\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs, cb)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return cb()\n\n if (Array.isArray(c))\n return cb(null, c)\n }\n\n var self = this\n fs.readdir(abs, readdirCb(this, abs, cb))\n}\n\nfunction readdirCb (self, abs, cb) {\n return function (er, entries) {\n if (er)\n self._readdirError(abs, er, cb)\n else\n self._readdirEntries(abs, entries, cb)\n }\n}\n\nGlob.prototype._readdirEntries = function (abs, entries, cb) {\n if (this.aborted)\n return\n\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n return cb(null, entries)\n}\n\nGlob.prototype._readdirError = function (f, er, cb) {\n if (this.aborted)\n return\n\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n this.emit('error', error)\n this.abort()\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict) {\n this.emit('error', er)\n // If the error is handled, then we abort\n // if not, we threw out of here\n this.abort()\n }\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n\n return cb()\n}\n\nGlob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\n\nGlob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n //console.error('pgs2', prefix, remain[0], entries)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return cb()\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false, cb)\n\n var isSym = this.symlinks[abs]\n var len = entries.length\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return cb()\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true, cb)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true, cb)\n }\n\n cb()\n}\n\nGlob.prototype._processSimple = function (prefix, index, cb) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var self = this\n this._stat(prefix, function (er, exists) {\n self._processSimple2(prefix, index, er, exists, cb)\n })\n}\nGlob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {\n\n //console.error('ps2', prefix, exists)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return cb()\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n cb()\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlob.prototype._stat = function (f, cb) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return cb()\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return cb(null, c)\n\n if (needDir && c === 'FILE')\n return cb()\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (stat !== undefined) {\n if (stat === false)\n return cb(null, stat)\n else {\n var type = stat.isDirectory() ? 'DIR' : 'FILE'\n if (needDir && type === 'FILE')\n return cb()\n else\n return cb(null, type, stat)\n }\n }\n\n var self = this\n var statcb = inflight('stat\\0' + abs, lstatcb_)\n if (statcb)\n fs.lstat(abs, statcb)\n\n function lstatcb_ (er, lstat) {\n if (lstat && lstat.isSymbolicLink()) {\n // If it's a symlink, then treat it as the target, unless\n // the target does not exist, then treat it as a file.\n return fs.stat(abs, function (er, stat) {\n if (er)\n self._stat2(f, abs, null, lstat, cb)\n else\n self._stat2(f, abs, er, stat, cb)\n })\n } else {\n self._stat2(f, abs, er, lstat, cb)\n }\n }\n}\n\nGlob.prototype._stat2 = function (f, abs, er, stat, cb) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return cb()\n }\n\n var needDir = f.slice(-1) === '/'\n this.statCache[abs] = stat\n\n if (abs.slice(-1) === '/' && stat && !stat.isDirectory())\n return cb(null, false, stat)\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return cb()\n\n return cb(null, c, stat)\n}\n","module.exports = rimraf\nrimraf.sync = rimrafSync\n\nvar assert = require(\"assert\")\nvar path = require(\"path\")\nvar fs = require(\"fs\")\nvar glob = undefined\ntry {\n glob = require(\"glob\")\n} catch (_err) {\n // treat glob as optional.\n}\nvar _0666 = parseInt('666', 8)\n\nvar defaultGlobOpts = {\n nosort: true,\n silent: true\n}\n\n// for EMFILE handling\nvar timeout = 0\n\nvar isWindows = (process.platform === \"win32\")\n\nfunction defaults (options) {\n var methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(function(m) {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n options.emfileWait = options.emfileWait || 1000\n if (options.glob === false) {\n options.disableGlob = true\n }\n if (options.disableGlob !== true && glob === undefined) {\n throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')\n }\n options.disableGlob = options.disableGlob || false\n options.glob = options.glob || defaultGlobOpts\n}\n\nfunction rimraf (p, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert.equal(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n var busyTries = 0\n var errState = null\n var n = 0\n\n if (options.disableGlob || !glob.hasMagic(p))\n return afterGlob(null, [p])\n\n options.lstat(p, function (er, stat) {\n if (!er)\n return afterGlob(null, [p])\n\n glob(p, options.glob, afterGlob)\n })\n\n function next (er) {\n errState = errState || er\n if (--n === 0)\n cb(errState)\n }\n\n function afterGlob (er, results) {\n if (er)\n return cb(er)\n\n n = results.length\n if (n === 0)\n return cb()\n\n results.forEach(function (p) {\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === \"EBUSY\" || er.code === \"ENOTEMPTY\" || er.code === \"EPERM\") &&\n busyTries < options.maxBusyTries) {\n busyTries ++\n var time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(function () {\n rimraf_(p, options, CB)\n }, time)\n }\n\n // this one won't happen if graceful-fs is used.\n if (er.code === \"EMFILE\" && timeout < options.emfileWait) {\n return setTimeout(function () {\n rimraf_(p, options, CB)\n }, timeout ++)\n }\n\n // already gone\n if (er.code === \"ENOENT\") er = null\n }\n\n timeout = 0\n next(er)\n })\n })\n }\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, function (er, st) {\n if (er && er.code === \"ENOENT\")\n return cb(null)\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === \"EPERM\" && isWindows)\n fixWinEPERM(p, options, er, cb)\n\n if (st && st.isDirectory())\n return rmdir(p, options, er, cb)\n\n options.unlink(p, function (er) {\n if (er) {\n if (er.code === \"ENOENT\")\n return cb(null)\n if (er.code === \"EPERM\")\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n if (er.code === \"EISDIR\")\n return rmdir(p, options, er, cb)\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n if (er)\n assert(er instanceof Error)\n\n options.chmod(p, _0666, function (er2) {\n if (er2)\n cb(er2.code === \"ENOENT\" ? null : er)\n else\n options.stat(p, function(er3, stats) {\n if (er3)\n cb(er3.code === \"ENOENT\" ? null : er)\n else if (stats.isDirectory())\n rmdir(p, options, er, cb)\n else\n options.unlink(p, cb)\n })\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n assert(p)\n assert(options)\n if (er)\n assert(er instanceof Error)\n\n try {\n options.chmodSync(p, _0666)\n } catch (er2) {\n if (er2.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n try {\n var stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n if (stats.isDirectory())\n rmdirSync(p, options, er)\n else\n options.unlinkSync(p)\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n if (originalEr)\n assert(originalEr instanceof Error)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, function (er) {\n if (er && (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\"))\n rmkids(p, options, cb)\n else if (er && er.code === \"ENOTDIR\")\n cb(originalEr)\n else\n cb(er)\n })\n}\n\nfunction rmkids(p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, function (er, files) {\n if (er)\n return cb(er)\n var n = files.length\n if (n === 0)\n return options.rmdir(p, cb)\n var errState\n files.forEach(function (f) {\n rimraf(path.join(p, f), options, function (er) {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (--n === 0)\n options.rmdir(p, cb)\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n var results\n\n if (options.disableGlob || !glob.hasMagic(p)) {\n results = [p]\n } else {\n try {\n options.lstatSync(p)\n results = [p]\n } catch (er) {\n results = glob.sync(p, options.glob)\n }\n }\n\n if (!results.length)\n return\n\n for (var i = 0; i < results.length; i++) {\n var p = results[i]\n\n try {\n var st = options.lstatSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === \"EPERM\" && isWindows)\n fixWinEPERMSync(p, options, er)\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory())\n rmdirSync(p, options, null)\n else\n options.unlinkSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"EPERM\")\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n if (er.code !== \"EISDIR\")\n throw er\n\n rmdirSync(p, options, er)\n }\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n if (originalEr)\n assert(originalEr instanceof Error)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"ENOTDIR\")\n throw originalEr\n if (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\")\n rmkidsSync(p, options)\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(function (f) {\n rimrafSync(path.join(p, f), options)\n })\n\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n var retries = isWindows ? 100 : 1\n var i = 0\n do {\n var threw = true\n try {\n var ret = options.rmdirSync(p, options)\n threw = false\n return ret\n } finally {\n if (++i < retries && threw)\n continue\n }\n } while (true)\n}\n","'use strict'\n\nimport { dasherize } from './deps/underscore-plus'\nimport { getHomeDirectory, existsSync } from 'fs-plus'\nimport path from 'path'\nimport { BufferedProcess } from 'atom'\nimport element from './decorators/element'\n\n/**\n * @access private\n */\nclass MinimapPluginGeneratorElement {\n static initClass () {\n this.registerCommands()\n return element(this, 'minimap-plugin-generator')\n }\n\n static registerCommands () {\n atom.commands.add('minimap-plugin-generator', {\n 'core:confirm' () { this.confirm() },\n 'core:cancel' () { this.detach() }\n })\n }\n\n createdCallback () {\n this.previouslyFocusedElement = null\n this.mode = null\n\n this.modal = document.createElement('atom-panel')\n\n this.modal.classList.add('minimap-plugin-generator')\n this.modal.classList.add('modal')\n this.modal.classList.add('overlay')\n this.modal.classList.add('from-top')\n\n this.editor = atom.workspace.buildTextEditor({ mini: true })\n this.editorElement = atom.views.getView(this.editor)\n\n this.error = document.createElement('div')\n this.error.classList.add('error')\n\n this.message = document.createElement('div')\n this.message.classList.add('message')\n\n this.modal.appendChild(this.editorElement)\n this.modal.appendChild(this.error)\n this.modal.appendChild(this.message)\n\n this.appendChild(this.modal)\n }\n\n attachedCallback () {\n this.previouslyFocusedElement = document.activeElement\n this.message.textContent = 'Enter plugin path'\n this.setPathText('my-minimap-plugin')\n this.editorElement.focus()\n }\n\n attach () {\n atom.views.getView(atom.workspace).appendChild(this)\n }\n\n setPathText (placeholderName, rangeToSelect) {\n if (!rangeToSelect) { rangeToSelect = [0, placeholderName.length] }\n\n const packagesDirectory = getPackagesDirectory()\n\n this.editor.setText(path.join(packagesDirectory, placeholderName))\n\n const pathLength = this.editor.getText().length\n const endOfDirectoryIndex = pathLength - placeholderName.length\n\n this.editor.setSelectedBufferRange([\n [0, endOfDirectoryIndex + rangeToSelect[0]],\n [0, endOfDirectoryIndex + rangeToSelect[1]]\n ])\n }\n\n detach () {\n if (!this.parentNode) { return }\n\n if (this.previouslyFocusedElement) {\n this.previouslyFocusedElement.focus()\n }\n\n this.parentNode.removeChild(this)\n }\n\n confirm () {\n if (this.validPackagePath()) {\n this.removeChild(this.modal)\n this.message.innerHTML = `\n \n Generate plugin at ${this.getPackagePath()}\n `\n\n this.createPackageFiles(() => {\n const packagePath = this.getPackagePath()\n atom.open({ pathsToOpen: [packagePath], devMode: atom.config.get('minimap.createPluginInDevMode') })\n\n this.message.innerHTML = 'Plugin successfully generated, opening it now...'\n\n setTimeout(() => { this.detach() }, 2000)\n })\n }\n }\n\n getPackagePath () {\n const packagePath = this.editor.getText()\n const packageName = dasherize(path.basename(packagePath))\n\n return path.join(path.dirname(packagePath), packageName)\n }\n\n validPackagePath () {\n if (existsSync(this.getPackagePath())) {\n this.error.textContent = `Path already exists at '${this.getPackagePath()}'`\n this.error.style.display = 'block'\n return false\n } else {\n return true\n }\n }\n\n initPackage (packagePath, callback) {\n const templatePath = path.resolve(__dirname, path.join('..', 'templates', `plugin-${this.template}`))\n runCommand(atom.packages.getApmPath(), ['init', '-p', `${packagePath}`, '--template', templatePath], callback)\n }\n\n createPackageFiles (callback) {\n const packagePath = this.getPackagePath()\n\n if (isStoredInDotAtom(packagePath)) {\n this.initPackage(packagePath, () => {\n installPackage(packagePath, callback)\n })\n } else {\n this.initPackage(packagePath, () => {\n linkPackage(packagePath, () => {\n installPackage(packagePath, callback)\n })\n })\n }\n }\n}\n\nconst minimapPluginGeneratorElement = MinimapPluginGeneratorElement.initClass()\nexport default minimapPluginGeneratorElement\n\nfunction linkPackage (packagePath, callback) {\n const args = ['link']\n if (atom.config.get('minimap.createPluginInDevMode')) { args.push('--dev') }\n args.push(packagePath.toString())\n\n runCommand(atom.packages.getApmPath(), args, callback)\n}\n\nfunction installPackage (packagePath, callback) {\n const args = ['install']\n\n runCommand(atom.packages.getApmPath(), args, callback, { cwd: packagePath })\n}\n\nfunction getPackagesDirectory () {\n return atom.config.get('core.projectHome') ||\n process.env.ATOM_REPOS_HOME ||\n path.join(getHomeDirectory(), 'github')\n}\n\nfunction isStoredInDotAtom (packagePath) {\n const packagesPath = path.join(atom.getConfigDirPath(), 'packages', path.sep)\n if (packagePath.indexOf(packagesPath) === 0) { return true }\n\n const devPackagesPath = path.join(atom.getConfigDirPath(), 'dev', 'packages', path.sep)\n\n return packagePath.indexOf(devPackagesPath) === 0\n}\n\nfunction runCommand (command, args, exit, options = {}) {\n return new BufferedProcess({ command, args, exit, options })\n}\n","// Current version.\nexport var VERSION = '1.11.0';\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nexport var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n Function('return this')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nexport var ArrayProto = Array.prototype, ObjProto = Object.prototype;\nexport var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nexport var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nexport var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nexport var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nexport var _isNaN = isNaN,\n _isFinite = isFinite;\n\n// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\nexport var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\nexport var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n// The largest integer that can be represented exactly.\nexport var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('String');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Number');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Date');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('RegExp');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Error');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Symbol');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Map');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('WeakMap');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('Set');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('WeakSet');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('ArrayBuffer');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('DataView');\n","import { nativeIsArray } from './_setup.js';\nimport tagTester from './_tagTester.js';\n\n// Is a given value an array?\n// Delegates to ECMA5's native `Array.isArray`.\nexport default nativeIsArray || tagTester('Array');\n","import tagTester from './_tagTester.js';\nimport { root } from './_setup.js';\n\nvar isFunction = tagTester('Function');\n\n// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old\n// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\nvar nodelist = root.document && root.document.childNodes;\nif (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n}\n\nexport default isFunction;\n","import tagTester from './_tagTester.js';\nimport has from './_has.js';\n\nvar isArguments = tagTester('Arguments');\n\n// Define a fallback version of the method in browsers (ahem, IE < 9), where\n// there isn't any inspectable \"Arguments\" type.\n(function() {\n if (!isArguments(arguments)) {\n isArguments = function(obj) {\n return has(obj, 'callee');\n };\n }\n}());\n\nexport default isArguments;\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `byteLength` property of an object.\nexport default shallowProperty('byteLength');\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getByteLength from './_getByteLength.js';\n\n// Internal helper to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\nexport default createSizePropertyCheck(getByteLength);\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `length` property of an object.\nexport default shallowProperty('length');\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getLength from './_getLength.js';\n\n// Internal helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\nexport default createSizePropertyCheck(getLength);\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Extend a given object with all the properties in passed-in object(s).\nexport default createAssigner(allKeys);\n","import createAssigner from './_createAssigner.js';\nimport keys from './keys.js';\n\n// Assigns a given object with all the own properties in the passed-in\n// object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\nexport default createAssigner(keys);\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Fill in a given object with default properties.\nexport default createAssigner(allKeys, true);\n","// A (possibly faster) way to get the current timestamp as an integer.\nexport default Date.now || function() {\n return new Date().getTime();\n};\n","// Internal list of HTML entities for escaping.\nexport default {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n","import createEscaper from './_createEscaper.js';\nimport escapeMap from './_escapeMap.js';\n\n// Function for escaping strings to HTML interpolation.\nexport default createEscaper(escapeMap);\n","import invert from './invert.js';\nimport escapeMap from './_escapeMap.js';\n\n// Internal list of HTML entities for unescaping.\nexport default invert(escapeMap);\n","import createEscaper from './_createEscaper.js';\nimport unescapeMap from './_unescapeMap.js';\n\n// Function for unescaping strings from HTML interpolation.\nexport default createEscaper(unescapeMap);\n","import _ from './underscore.js';\n\n// By default, Underscore uses ERB-style template delimiters. Change the\n// following template settings to use alternative delimiters.\nexport default _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n};\n","import restArguments from './restArguments.js';\nimport executeBound from './_executeBound.js';\nimport _ from './underscore.js';\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. `_` acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\nvar partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\nexport default partial;\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport executeBound from './_executeBound.js';\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally).\nexport default restArguments(function(func, context, args) {\n if (!isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n});\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport bind from './bind.js';\n\n// Bind a number of an object's methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\nexport default restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n});\n","import restArguments from './restArguments.js';\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\nexport default restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n});\n","import partial from './partial.js';\nimport delay from './delay.js';\nimport _ from './underscore.js';\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\nexport default partial(delay, _, 1);\n","import partial from './partial.js';\nimport before from './before.js';\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\nexport default partial(before, 2);\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the first index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(1);\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the last index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(-1);\n","import sortedIndex from './sortedIndex.js';\nimport findIndex from './findIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\nexport default createIndexFinder(1, findIndex, sortedIndex);\n","import findLastIndex from './findLastIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the last occurrence of an item in an array,\n// or -1 if the item is not included in the array.\nexport default createIndexFinder(-1, findLastIndex);\n","import createReduce from './_createReduce.js';\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\nexport default createReduce(1);\n","import createReduce from './_createReduce.js';\n\n// The right-associative version of reduce, also known as `foldr`.\nexport default createReduce(-1);\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport isArray from './isArray.js';\nimport map from './map.js';\nimport deepGet from './_deepGet.js';\n\n// Invoke a method (with arguments) on every item in a collection.\nexport default restArguments(function(obj, path, args) {\n var contextPath, func;\n if (isFunction(path)) {\n func = path;\n } else if (isArray(path)) {\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n});\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Groups the object's values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n});\n","import group from './_group.js';\n\n// Indexes the object's values by a criterion, similar to `_.groupBy`, but for\n// when you know that your index values will be unique.\nexport default group(function(result, value, key) {\n result[key] = value;\n});\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n});\n","import group from './_group.js';\n\n// Split a collection into two arrays: one whose elements all pass the given\n// truth test, and one whose elements all do not pass the truth test.\nexport default group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true);\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport optimizeCb from './_optimizeCb.js';\nimport allKeys from './allKeys.js';\nimport keyInObj from './_keyInObj.js';\nimport flatten from './_flatten.js';\n\n// Return a copy of the object only containing the allowed properties.\nexport default restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n});\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport negate from './negate.js';\nimport map from './map.js';\nimport flatten from './_flatten.js';\nimport contains from './contains.js';\nimport pick from './pick.js';\n\n// Return a copy of the object without the disallowed properties.\nexport default restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(keys, key);\n };\n }\n return pick(obj, iteratee, context);\n});\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport filter from './filter.js';\nimport contains from './contains.js';\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\nexport default restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n});\n","import restArguments from './restArguments.js';\nimport difference from './difference.js';\n\n// Return a version of the array that does not contain the specified value(s).\nexport default restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n});\n","import restArguments from './restArguments.js';\nimport uniq from './uniq.js';\nimport flatten from './_flatten.js';\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\nexport default restArguments(function(arrays) {\n return uniq(flatten(arrays, true, true));\n});\n","import restArguments from './restArguments.js';\nimport unzip from './unzip.js';\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\nexport default restArguments(unzip);\n","import _ from './underscore.js';\nimport each from './each.js';\nimport { ArrayProto } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add all mutator `Array` functions to the wrapper.\neach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor `Array` functions to the wrapper.\neach(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\nexport default _;\n","// Default Export\n// ==============\n// In this module, we mix our bundled exports into the `_` object and export\n// the result. This is analogous to setting `module.exports = _` in CommonJS.\n// Hence, this module is also the entry point of our UMD bundle and the package\n// entry point for CommonJS and AMD users. In other words, this is (the source\n// of) the module you are interfacing with when you do any of the following:\n//\n// ```js\n// // CommonJS\n// var _ = require('underscore');\n//\n// // AMD\n// define(['underscore'], function(_) {...});\n//\n// // UMD in the browser\n// // _ is available as a global variable\n// ```\nimport * as allExports from './index.js';\nimport { mixin } from './index.js';\n\n// Add all of the Underscore functions to the wrapper object.\nvar _ = mixin(allExports);\n// Legacy Node.js API.\n_._ = _;\n// Export the Underscore API.\nexport default _;\n","(function() {\n var isEqual, isPlainObject, macModifierKeyMap, nonMacModifierKeyMap, plus, shiftKeyMap, splitKeyPath, _,\n __slice = [].slice;\n\n _ = require('underscore');\n\n macModifierKeyMap = {\n cmd: '\\u2318',\n ctrl: '\\u2303',\n alt: '\\u2325',\n option: '\\u2325',\n shift: '\\u21e7',\n enter: '\\u23ce',\n left: '\\u2190',\n right: '\\u2192',\n up: '\\u2191',\n down: '\\u2193'\n };\n\n nonMacModifierKeyMap = {\n cmd: 'Cmd',\n ctrl: 'Ctrl',\n alt: 'Alt',\n option: 'Alt',\n shift: 'Shift',\n enter: 'Enter',\n left: 'Left',\n right: 'Right',\n up: 'Up',\n down: 'Down'\n };\n\n shiftKeyMap = {\n '~': '`',\n '_': '-',\n '+': '=',\n '|': '\\\\',\n '{': '[',\n '}': ']',\n ':': ';',\n '\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/'\n };\n\n splitKeyPath = function(keyPath) {\n var char, i, keyPathArray, startIndex, _i, _len;\n startIndex = 0;\n keyPathArray = [];\n if (keyPath == null) {\n return keyPathArray;\n }\n for (i = _i = 0, _len = keyPath.length; _i < _len; i = ++_i) {\n char = keyPath[i];\n if (char === '.' && (i === 0 || keyPath[i - 1] !== '\\\\')) {\n keyPathArray.push(keyPath.substring(startIndex, i));\n startIndex = i + 1;\n }\n }\n keyPathArray.push(keyPath.substr(startIndex, keyPath.length));\n return keyPathArray;\n };\n\n isPlainObject = function(value) {\n return _.isObject(value) && !_.isArray(value);\n };\n\n plus = {\n adviseBefore: function(object, methodName, advice) {\n var original;\n original = object[methodName];\n return object[methodName] = function() {\n var args;\n args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];\n if (advice.apply(this, args) !== false) {\n return original.apply(this, args);\n }\n };\n },\n camelize: function(string) {\n if (string) {\n return string.replace(/[_-]+(\\w)/g, function(m) {\n return m[1].toUpperCase();\n });\n } else {\n return '';\n }\n },\n capitalize: function(word) {\n if (!word) {\n return '';\n }\n if (word.toLowerCase() === 'github') {\n return 'GitHub';\n } else {\n return word[0].toUpperCase() + word.slice(1);\n }\n },\n compactObject: function(object) {\n var key, newObject, value;\n newObject = {};\n for (key in object) {\n value = object[key];\n if (value != null) {\n newObject[key] = value;\n }\n }\n return newObject;\n },\n dasherize: function(string) {\n if (!string) {\n return '';\n }\n string = string[0].toLowerCase() + string.slice(1);\n return string.replace(/([A-Z])|(_)/g, function(m, letter) {\n if (letter) {\n return \"-\" + letter.toLowerCase();\n } else {\n return \"-\";\n }\n });\n },\n deepClone: function(object) {\n if (_.isArray(object)) {\n return object.map(function(value) {\n return plus.deepClone(value);\n });\n } else if (_.isObject(object) && !_.isFunction(object)) {\n return plus.mapObject(object, (function(_this) {\n return function(key, value) {\n return [key, plus.deepClone(value)];\n };\n })(this));\n } else {\n return object;\n }\n },\n deepExtend: function(target) {\n var i, key, object, result, _i, _len, _ref;\n result = target;\n i = 0;\n while (++i < arguments.length) {\n object = arguments[i];\n if (isPlainObject(result) && isPlainObject(object)) {\n _ref = Object.keys(object);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n key = _ref[_i];\n result[key] = plus.deepExtend(result[key], object[key]);\n }\n } else {\n result = plus.deepClone(object);\n }\n }\n return result;\n },\n deepContains: function(array, target) {\n var object, _i, _len;\n if (array == null) {\n return false;\n }\n for (_i = 0, _len = array.length; _i < _len; _i++) {\n object = array[_i];\n if (_.isEqual(object, target)) {\n return true;\n }\n }\n return false;\n },\n endsWith: function(string, suffix) {\n if (suffix == null) {\n suffix = '';\n }\n if (string) {\n return string.indexOf(suffix, string.length - suffix.length) !== -1;\n } else {\n return false;\n }\n },\n escapeAttribute: function(string) {\n if (string) {\n return string.replace(/\"/g, '"').replace(/\\n/g, '').replace(/\\\\/g, '-');\n } else {\n return '';\n }\n },\n escapeRegExp: function(string) {\n if (string) {\n return string.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n } else {\n return '';\n }\n },\n humanizeEventName: function(eventName, eventDoc) {\n var event, namespace, namespaceDoc, _ref;\n _ref = eventName.split(':'), namespace = _ref[0], event = _ref[1];\n if (event == null) {\n return plus.undasherize(namespace);\n }\n namespaceDoc = plus.undasherize(namespace);\n if (eventDoc == null) {\n eventDoc = plus.undasherize(event);\n }\n return \"\" + namespaceDoc + \": \" + eventDoc;\n },\n humanizeKey: function(key, platform) {\n var modifierKeyMap;\n if (platform == null) {\n platform = process.platform;\n }\n if (!key) {\n return key;\n }\n modifierKeyMap = platform === 'darwin' ? macModifierKeyMap : nonMacModifierKeyMap;\n if (modifierKeyMap[key]) {\n return modifierKeyMap[key];\n } else if (key.length === 1 && (shiftKeyMap[key] != null)) {\n return [modifierKeyMap.shift, shiftKeyMap[key]];\n } else if (key.length === 1 && key === key.toUpperCase() && key.toUpperCase() !== key.toLowerCase()) {\n return [modifierKeyMap.shift, key.toUpperCase()];\n } else if (key.length === 1 || /f[0-9]{1,2}/.test(key)) {\n return key.toUpperCase();\n } else {\n if (platform === 'darwin') {\n return key;\n } else {\n return plus.capitalize(key);\n }\n }\n },\n humanizeKeystroke: function(keystroke, platform) {\n var humanizedKeystrokes, index, key, keys, keystrokes, splitKeystroke, _i, _j, _len, _len1;\n if (platform == null) {\n platform = process.platform;\n }\n if (!keystroke) {\n return keystroke;\n }\n keystrokes = keystroke.split(' ');\n humanizedKeystrokes = [];\n for (_i = 0, _len = keystrokes.length; _i < _len; _i++) {\n keystroke = keystrokes[_i];\n keys = [];\n splitKeystroke = keystroke.split('-');\n for (index = _j = 0, _len1 = splitKeystroke.length; _j < _len1; index = ++_j) {\n key = splitKeystroke[index];\n if (key === '' && splitKeystroke[index - 1] === '') {\n key = '-';\n }\n if (key) {\n keys.push(plus.humanizeKey(key, platform));\n }\n }\n keys = _.uniq(_.flatten(keys));\n if (platform === 'darwin') {\n keys = keys.join('');\n } else {\n keys = keys.join('+');\n }\n humanizedKeystrokes.push(keys);\n }\n return humanizedKeystrokes.join(' ');\n },\n isSubset: function(potentialSubset, potentialSuperset) {\n return _.every(potentialSubset, function(element) {\n return _.include(potentialSuperset, element);\n });\n },\n losslessInvert: function(hash) {\n var inverted, key, value;\n inverted = {};\n for (key in hash) {\n value = hash[key];\n if (inverted[value] == null) {\n inverted[value] = [];\n }\n inverted[value].push(key);\n }\n return inverted;\n },\n mapObject: function(object, iterator) {\n var key, newObject, value, _i, _len, _ref, _ref1;\n newObject = {};\n _ref = Object.keys(object);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n key = _ref[_i];\n _ref1 = iterator(key, object[key]), key = _ref1[0], value = _ref1[1];\n newObject[key] = value;\n }\n return newObject;\n },\n multiplyString: function(string, n) {\n var finalString, i;\n finalString = \"\";\n i = 0;\n while (i < n) {\n finalString += string;\n i++;\n }\n return finalString;\n },\n pluralize: function(count, singular, plural) {\n if (count == null) {\n count = 0;\n }\n if (plural == null) {\n plural = singular + 's';\n }\n if (count === 1) {\n return \"\" + count + \" \" + singular;\n } else {\n return \"\" + count + \" \" + plural;\n }\n },\n remove: function(array, element) {\n var index;\n index = array.indexOf(element);\n if (index >= 0) {\n array.splice(index, 1);\n }\n return array;\n },\n setValueForKeyPath: function(object, keyPath, value) {\n var key, keys;\n keys = splitKeyPath(keyPath);\n while (keys.length > 1) {\n key = keys.shift();\n if (object[key] == null) {\n object[key] = {};\n }\n object = object[key];\n }\n if (value != null) {\n return object[keys.shift()] = value;\n } else {\n return delete object[keys.shift()];\n }\n },\n hasKeyPath: function(object, keyPath) {\n var key, keys, _i, _len;\n keys = splitKeyPath(keyPath);\n for (_i = 0, _len = keys.length; _i < _len; _i++) {\n key = keys[_i];\n if (!object.hasOwnProperty(key)) {\n return false;\n }\n object = object[key];\n }\n return true;\n },\n spliceWithArray: function(originalArray, start, length, insertedArray, chunkSize) {\n var chunkStart, _i, _ref, _results;\n if (chunkSize == null) {\n chunkSize = 100000;\n }\n if (insertedArray.length < chunkSize) {\n return originalArray.splice.apply(originalArray, [start, length].concat(__slice.call(insertedArray)));\n } else {\n originalArray.splice(start, length);\n _results = [];\n for (chunkStart = _i = 0, _ref = insertedArray.length; chunkSize > 0 ? _i <= _ref : _i >= _ref; chunkStart = _i += chunkSize) {\n _results.push(originalArray.splice.apply(originalArray, [start + chunkStart, 0].concat(__slice.call(insertedArray.slice(chunkStart, chunkStart + chunkSize)))));\n }\n return _results;\n }\n },\n sum: function(array) {\n var elt, sum, _i, _len;\n sum = 0;\n for (_i = 0, _len = array.length; _i < _len; _i++) {\n elt = array[_i];\n sum += elt;\n }\n return sum;\n },\n uncamelcase: function(string) {\n var result;\n if (!string) {\n return '';\n }\n result = string.replace(/([A-Z])|_+/g, function(match, letter) {\n if (letter == null) {\n letter = '';\n }\n return \" \" + letter;\n });\n return plus.capitalize(result.trim());\n },\n undasherize: function(string) {\n if (string) {\n return string.split('-').map(plus.capitalize).join(' ');\n } else {\n return '';\n }\n },\n underscore: function(string) {\n if (!string) {\n return '';\n }\n string = string[0].toLowerCase() + string.slice(1);\n return string.replace(/([A-Z])|-+/g, function(match, letter) {\n if (letter == null) {\n letter = '';\n }\n return \"_\" + (letter.toLowerCase());\n });\n },\n valueForKeyPath: function(object, keyPath) {\n var key, keys, _i, _len;\n keys = splitKeyPath(keyPath);\n for (_i = 0, _len = keys.length; _i < _len; _i++) {\n key = keys[_i];\n object = object[key];\n if (object == null) {\n return;\n }\n }\n return object;\n },\n isEqual: function(a, b, aStack, bStack) {\n if (_.isArray(aStack) && _.isArray(bStack)) {\n return isEqual(a, b, aStack, bStack);\n } else {\n return isEqual(a, b);\n }\n },\n isEqualForProperties: function() {\n var a, b, properties, property, _i, _len;\n a = arguments[0], b = arguments[1], properties = 3 <= arguments.length ? __slice.call(arguments, 2) : [];\n for (_i = 0, _len = properties.length; _i < _len; _i++) {\n property = properties[_i];\n if (!_.isEqual(a[property], b[property])) {\n return false;\n }\n }\n return true;\n }\n };\n\n isEqual = function(a, b, aStack, bStack) {\n var aCtor, aCtorValid, aElement, aKeyCount, aValue, bCtor, bCtorValid, bKeyCount, bValue, equal, i, key, stackIndex, _i, _len;\n if (aStack == null) {\n aStack = [];\n }\n if (bStack == null) {\n bStack = [];\n }\n if (a === b) {\n return _.isEqual(a, b);\n }\n if (_.isFunction(a) || _.isFunction(b)) {\n return _.isEqual(a, b);\n }\n stackIndex = aStack.length;\n while (stackIndex--) {\n if (aStack[stackIndex] === a) {\n return bStack[stackIndex] === b;\n }\n }\n aStack.push(a);\n bStack.push(b);\n equal = false;\n if (_.isFunction(a != null ? a.isEqual : void 0)) {\n equal = a.isEqual(b, aStack, bStack);\n } else if (_.isFunction(b != null ? b.isEqual : void 0)) {\n equal = b.isEqual(a, bStack, aStack);\n } else if (_.isArray(a) && _.isArray(b) && a.length === b.length) {\n equal = true;\n for (i = _i = 0, _len = a.length; _i < _len; i = ++_i) {\n aElement = a[i];\n if (!isEqual(aElement, b[i], aStack, bStack)) {\n equal = false;\n break;\n }\n }\n } else if (_.isRegExp(a) && _.isRegExp(b)) {\n equal = _.isEqual(a, b);\n } else if (_.isElement(a) && _.isElement(b)) {\n equal = a === b;\n } else if (_.isObject(a) && _.isObject(b)) {\n aCtor = a.constructor;\n bCtor = b.constructor;\n aCtorValid = _.isFunction(aCtor) && aCtor instanceof aCtor;\n bCtorValid = _.isFunction(bCtor) && bCtor instanceof bCtor;\n if (aCtor !== bCtor && !(aCtorValid && bCtorValid)) {\n equal = false;\n } else {\n aKeyCount = 0;\n equal = true;\n for (key in a) {\n aValue = a[key];\n if (!_.has(a, key)) {\n continue;\n }\n aKeyCount++;\n if (!(_.has(b, key) && isEqual(aValue, b[key], aStack, bStack))) {\n equal = false;\n break;\n }\n }\n if (equal) {\n bKeyCount = 0;\n for (key in b) {\n bValue = b[key];\n if (_.has(b, key)) {\n bKeyCount++;\n }\n }\n equal = aKeyCount === bKeyCount;\n }\n }\n } else {\n equal = _.isEqual(a, b);\n }\n aStack.pop();\n bStack.pop();\n return equal;\n };\n\n module.exports = _.extend({}, _, plus);\n\n}).call(this);\n","/*!\n * async\n * https://github.com/caolan/async\n *\n * Copyright 2010-2014 Caolan McMahon\n * Released under the MIT license\n */\n(function () {\n\n var async = {};\n function noop() {}\n function identity(v) {\n return v;\n }\n function toBool(v) {\n return !!v;\n }\n function notId(v) {\n return !v;\n }\n\n // global on the server, window in the browser\n var previous_async;\n\n // Establish the root object, `window` (`self`) in the browser, `global`\n // on the server, or `this` in some virtual machines. We use `self`\n // instead of `window` for `WebWorker` support.\n var root = typeof self === 'object' && self.self === self && self ||\n typeof global === 'object' && global.global === global && global ||\n this;\n\n if (root != null) {\n previous_async = root.async;\n }\n\n async.noConflict = function () {\n root.async = previous_async;\n return async;\n };\n\n function only_once(fn) {\n return function() {\n if (fn === null) throw new Error(\"Callback was already called.\");\n fn.apply(this, arguments);\n fn = null;\n };\n }\n\n function _once(fn) {\n return function() {\n if (fn === null) return;\n fn.apply(this, arguments);\n fn = null;\n };\n }\n\n //// cross-browser compatiblity functions ////\n\n var _toString = Object.prototype.toString;\n\n var _isArray = Array.isArray || function (obj) {\n return _toString.call(obj) === '[object Array]';\n };\n\n // Ported from underscore.js isObject\n var _isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n };\n\n function _isArrayLike(arr) {\n return _isArray(arr) || (\n // has a positive integer length property\n typeof arr.length === \"number\" &&\n arr.length >= 0 &&\n arr.length % 1 === 0\n );\n }\n\n function _arrayEach(arr, iterator) {\n var index = -1,\n length = arr.length;\n\n while (++index < length) {\n iterator(arr[index], index, arr);\n }\n }\n\n function _map(arr, iterator) {\n var index = -1,\n length = arr.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iterator(arr[index], index, arr);\n }\n return result;\n }\n\n function _range(count) {\n return _map(Array(count), function (v, i) { return i; });\n }\n\n function _reduce(arr, iterator, memo) {\n _arrayEach(arr, function (x, i, a) {\n memo = iterator(memo, x, i, a);\n });\n return memo;\n }\n\n function _forEachOf(object, iterator) {\n _arrayEach(_keys(object), function (key) {\n iterator(object[key], key);\n });\n }\n\n function _indexOf(arr, item) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n }\n\n var _keys = Object.keys || function (obj) {\n var keys = [];\n for (var k in obj) {\n if (obj.hasOwnProperty(k)) {\n keys.push(k);\n }\n }\n return keys;\n };\n\n function _keyIterator(coll) {\n var i = -1;\n var len;\n var keys;\n if (_isArrayLike(coll)) {\n len = coll.length;\n return function next() {\n i++;\n return i < len ? i : null;\n };\n } else {\n keys = _keys(coll);\n len = keys.length;\n return function next() {\n i++;\n return i < len ? keys[i] : null;\n };\n }\n }\n\n // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)\n // This accumulates the arguments passed into an array, after a given index.\n // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).\n function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }\n\n function _withoutIndex(iterator) {\n return function (value, index, callback) {\n return iterator(value, callback);\n };\n }\n\n //// exported async module functions ////\n\n //// nextTick implementation with browser-compatible fallback ////\n\n // capture the global reference to guard against fakeTimer mocks\n var _setImmediate = typeof setImmediate === 'function' && setImmediate;\n\n var _delay = _setImmediate ? function(fn) {\n // not a direct alias for IE10 compatibility\n _setImmediate(fn);\n } : function(fn) {\n setTimeout(fn, 0);\n };\n\n if (typeof process === 'object' && typeof process.nextTick === 'function') {\n async.nextTick = process.nextTick;\n } else {\n async.nextTick = _delay;\n }\n async.setImmediate = _setImmediate ? _delay : async.nextTick;\n\n\n async.forEach =\n async.each = function (arr, iterator, callback) {\n return async.eachOf(arr, _withoutIndex(iterator), callback);\n };\n\n async.forEachSeries =\n async.eachSeries = function (arr, iterator, callback) {\n return async.eachOfSeries(arr, _withoutIndex(iterator), callback);\n };\n\n\n async.forEachLimit =\n async.eachLimit = function (arr, limit, iterator, callback) {\n return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);\n };\n\n async.forEachOf =\n async.eachOf = function (object, iterator, callback) {\n callback = _once(callback || noop);\n object = object || [];\n\n var iter = _keyIterator(object);\n var key, completed = 0;\n\n while ((key = iter()) != null) {\n completed += 1;\n iterator(object[key], key, only_once(done));\n }\n\n if (completed === 0) callback(null);\n\n function done(err) {\n completed--;\n if (err) {\n callback(err);\n }\n // Check key is null in case iterator isn't exhausted\n // and done resolved synchronously.\n else if (key === null && completed <= 0) {\n callback(null);\n }\n }\n };\n\n async.forEachOfSeries =\n async.eachOfSeries = function (obj, iterator, callback) {\n callback = _once(callback || noop);\n obj = obj || [];\n var nextKey = _keyIterator(obj);\n var key = nextKey();\n function iterate() {\n var sync = true;\n if (key === null) {\n return callback(null);\n }\n iterator(obj[key], key, only_once(function (err) {\n if (err) {\n callback(err);\n }\n else {\n key = nextKey();\n if (key === null) {\n return callback(null);\n } else {\n if (sync) {\n async.setImmediate(iterate);\n } else {\n iterate();\n }\n }\n }\n }));\n sync = false;\n }\n iterate();\n };\n\n\n\n async.forEachOfLimit =\n async.eachOfLimit = function (obj, limit, iterator, callback) {\n _eachOfLimit(limit)(obj, iterator, callback);\n };\n\n function _eachOfLimit(limit) {\n\n return function (obj, iterator, callback) {\n callback = _once(callback || noop);\n obj = obj || [];\n var nextKey = _keyIterator(obj);\n if (limit <= 0) {\n return callback(null);\n }\n var done = false;\n var running = 0;\n var errored = false;\n\n (function replenish () {\n if (done && running <= 0) {\n return callback(null);\n }\n\n while (running < limit && !errored) {\n var key = nextKey();\n if (key === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iterator(obj[key], key, only_once(function (err) {\n running -= 1;\n if (err) {\n callback(err);\n errored = true;\n }\n else {\n replenish();\n }\n }));\n }\n })();\n };\n }\n\n\n function doParallel(fn) {\n return function (obj, iterator, callback) {\n return fn(async.eachOf, obj, iterator, callback);\n };\n }\n function doParallelLimit(fn) {\n return function (obj, limit, iterator, callback) {\n return fn(_eachOfLimit(limit), obj, iterator, callback);\n };\n }\n function doSeries(fn) {\n return function (obj, iterator, callback) {\n return fn(async.eachOfSeries, obj, iterator, callback);\n };\n }\n\n function _asyncMap(eachfn, arr, iterator, callback) {\n callback = _once(callback || noop);\n arr = arr || [];\n var results = _isArrayLike(arr) ? [] : {};\n eachfn(arr, function (value, index, callback) {\n iterator(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n }\n\n async.map = doParallel(_asyncMap);\n async.mapSeries = doSeries(_asyncMap);\n async.mapLimit = doParallelLimit(_asyncMap);\n\n // reduce only has a series version, as doing reduce in parallel won't\n // work in many situations.\n async.inject =\n async.foldl =\n async.reduce = function (arr, memo, iterator, callback) {\n async.eachOfSeries(arr, function (x, i, callback) {\n iterator(memo, x, function (err, v) {\n memo = v;\n callback(err);\n });\n }, function (err) {\n callback(err, memo);\n });\n };\n\n async.foldr =\n async.reduceRight = function (arr, memo, iterator, callback) {\n var reversed = _map(arr, identity).reverse();\n async.reduce(reversed, memo, iterator, callback);\n };\n\n async.transform = function (arr, memo, iterator, callback) {\n if (arguments.length === 3) {\n callback = iterator;\n iterator = memo;\n memo = _isArray(arr) ? [] : {};\n }\n\n async.eachOf(arr, function(v, k, cb) {\n iterator(memo, v, k, cb);\n }, function(err) {\n callback(err, memo);\n });\n };\n\n function _filter(eachfn, arr, iterator, callback) {\n var results = [];\n eachfn(arr, function (x, index, callback) {\n iterator(x, function (v) {\n if (v) {\n results.push({index: index, value: x});\n }\n callback();\n });\n }, function () {\n callback(_map(results.sort(function (a, b) {\n return a.index - b.index;\n }), function (x) {\n return x.value;\n }));\n });\n }\n\n async.select =\n async.filter = doParallel(_filter);\n\n async.selectLimit =\n async.filterLimit = doParallelLimit(_filter);\n\n async.selectSeries =\n async.filterSeries = doSeries(_filter);\n\n function _reject(eachfn, arr, iterator, callback) {\n _filter(eachfn, arr, function(value, cb) {\n iterator(value, function(v) {\n cb(!v);\n });\n }, callback);\n }\n async.reject = doParallel(_reject);\n async.rejectLimit = doParallelLimit(_reject);\n async.rejectSeries = doSeries(_reject);\n\n function _createTester(eachfn, check, getResult) {\n return function(arr, limit, iterator, cb) {\n function done() {\n if (cb) cb(getResult(false, void 0));\n }\n function iteratee(x, _, callback) {\n if (!cb) return callback();\n iterator(x, function (v) {\n if (cb && check(v)) {\n cb(getResult(true, x));\n cb = iterator = false;\n }\n callback();\n });\n }\n if (arguments.length > 3) {\n eachfn(arr, limit, iteratee, done);\n } else {\n cb = iterator;\n iterator = limit;\n eachfn(arr, iteratee, done);\n }\n };\n }\n\n async.any =\n async.some = _createTester(async.eachOf, toBool, identity);\n\n async.someLimit = _createTester(async.eachOfLimit, toBool, identity);\n\n async.all =\n async.every = _createTester(async.eachOf, notId, notId);\n\n async.everyLimit = _createTester(async.eachOfLimit, notId, notId);\n\n function _findGetResult(v, x) {\n return x;\n }\n async.detect = _createTester(async.eachOf, identity, _findGetResult);\n async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);\n async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);\n\n async.sortBy = function (arr, iterator, callback) {\n async.map(arr, function (x, callback) {\n iterator(x, function (err, criteria) {\n if (err) {\n callback(err);\n }\n else {\n callback(null, {value: x, criteria: criteria});\n }\n });\n }, function (err, results) {\n if (err) {\n return callback(err);\n }\n else {\n callback(null, _map(results.sort(comparator), function (x) {\n return x.value;\n }));\n }\n\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n };\n\n async.auto = function (tasks, concurrency, callback) {\n if (typeof arguments[1] === 'function') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = _once(callback || noop);\n var keys = _keys(tasks);\n var remainingTasks = keys.length;\n if (!remainingTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = remainingTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n\n var hasError = false;\n\n var listeners = [];\n function addListener(fn) {\n listeners.unshift(fn);\n }\n function removeListener(fn) {\n var idx = _indexOf(listeners, fn);\n if (idx >= 0) listeners.splice(idx, 1);\n }\n function taskComplete() {\n remainingTasks--;\n _arrayEach(listeners.slice(0), function (fn) {\n fn();\n });\n }\n\n addListener(function () {\n if (!remainingTasks) {\n callback(null, results);\n }\n });\n\n _arrayEach(keys, function (k) {\n if (hasError) return;\n var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];\n var taskCallback = _restParam(function(err, args) {\n runningTasks--;\n if (args.length <= 1) {\n args = args[0];\n }\n if (err) {\n var safeResults = {};\n _forEachOf(results, function(val, rkey) {\n safeResults[rkey] = val;\n });\n safeResults[k] = args;\n hasError = true;\n\n callback(err, safeResults);\n }\n else {\n results[k] = args;\n async.setImmediate(taskComplete);\n }\n });\n var requires = task.slice(0, task.length - 1);\n // prevent dead-locks\n var len = requires.length;\n var dep;\n while (len--) {\n if (!(dep = tasks[requires[len]])) {\n throw new Error('Has nonexistent dependency in ' + requires.join(', '));\n }\n if (_isArray(dep) && _indexOf(dep, k) >= 0) {\n throw new Error('Has cyclic dependencies');\n }\n }\n function ready() {\n return runningTasks < concurrency && _reduce(requires, function (a, x) {\n return (a && results.hasOwnProperty(x));\n }, true) && !results.hasOwnProperty(k);\n }\n if (ready()) {\n runningTasks++;\n task[task.length - 1](taskCallback, results);\n }\n else {\n addListener(listener);\n }\n function listener() {\n if (ready()) {\n runningTasks++;\n removeListener(listener);\n task[task.length - 1](taskCallback, results);\n }\n }\n });\n };\n\n\n\n async.retry = function(times, task, callback) {\n var DEFAULT_TIMES = 5;\n var DEFAULT_INTERVAL = 0;\n\n var attempts = [];\n\n var opts = {\n times: DEFAULT_TIMES,\n interval: DEFAULT_INTERVAL\n };\n\n function parseTimes(acc, t){\n if(typeof t === 'number'){\n acc.times = parseInt(t, 10) || DEFAULT_TIMES;\n } else if(typeof t === 'object'){\n acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;\n acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;\n } else {\n throw new Error('Unsupported argument type for \\'times\\': ' + typeof t);\n }\n }\n\n var length = arguments.length;\n if (length < 1 || length > 3) {\n throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');\n } else if (length <= 2 && typeof times === 'function') {\n callback = task;\n task = times;\n }\n if (typeof times !== 'function') {\n parseTimes(opts, times);\n }\n opts.callback = callback;\n opts.task = task;\n\n function wrappedTask(wrappedCallback, wrappedResults) {\n function retryAttempt(task, finalAttempt) {\n return function(seriesCallback) {\n task(function(err, result){\n seriesCallback(!err || finalAttempt, {err: err, result: result});\n }, wrappedResults);\n };\n }\n\n function retryInterval(interval){\n return function(seriesCallback){\n setTimeout(function(){\n seriesCallback(null);\n }, interval);\n };\n }\n\n while (opts.times) {\n\n var finalAttempt = !(opts.times-=1);\n attempts.push(retryAttempt(opts.task, finalAttempt));\n if(!finalAttempt && opts.interval > 0){\n attempts.push(retryInterval(opts.interval));\n }\n }\n\n async.series(attempts, function(done, data){\n data = data[data.length - 1];\n (wrappedCallback || opts.callback)(data.err, data.result);\n });\n }\n\n // If a callback is passed, run this as a controll flow\n return opts.callback ? wrappedTask() : wrappedTask;\n };\n\n async.waterfall = function (tasks, callback) {\n callback = _once(callback || noop);\n if (!_isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n function wrapIterator(iterator) {\n return _restParam(function (err, args) {\n if (err) {\n callback.apply(null, [err].concat(args));\n }\n else {\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n }\n else {\n args.push(callback);\n }\n ensureAsync(iterator).apply(null, args);\n }\n });\n }\n wrapIterator(async.iterator(tasks))();\n };\n\n function _parallel(eachfn, tasks, callback) {\n callback = callback || noop;\n var results = _isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, function (task, key, callback) {\n task(_restParam(function (err, args) {\n if (args.length <= 1) {\n args = args[0];\n }\n results[key] = args;\n callback(err);\n }));\n }, function (err) {\n callback(err, results);\n });\n }\n\n async.parallel = function (tasks, callback) {\n _parallel(async.eachOf, tasks, callback);\n };\n\n async.parallelLimit = function(tasks, limit, callback) {\n _parallel(_eachOfLimit(limit), tasks, callback);\n };\n\n async.series = function(tasks, callback) {\n _parallel(async.eachOfSeries, tasks, callback);\n };\n\n async.iterator = function (tasks) {\n function makeCallback(index) {\n function fn() {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n }\n fn.next = function () {\n return (index < tasks.length - 1) ? makeCallback(index + 1): null;\n };\n return fn;\n }\n return makeCallback(0);\n };\n\n async.apply = _restParam(function (fn, args) {\n return _restParam(function (callArgs) {\n return fn.apply(\n null, args.concat(callArgs)\n );\n });\n });\n\n function _concat(eachfn, arr, fn, callback) {\n var result = [];\n eachfn(arr, function (x, index, cb) {\n fn(x, function (err, y) {\n result = result.concat(y || []);\n cb(err);\n });\n }, function (err) {\n callback(err, result);\n });\n }\n async.concat = doParallel(_concat);\n async.concatSeries = doSeries(_concat);\n\n async.whilst = function (test, iterator, callback) {\n callback = callback || noop;\n if (test()) {\n var next = _restParam(function(err, args) {\n if (err) {\n callback(err);\n } else if (test.apply(this, args)) {\n iterator(next);\n } else {\n callback.apply(null, [null].concat(args));\n }\n });\n iterator(next);\n } else {\n callback(null);\n }\n };\n\n async.doWhilst = function (iterator, test, callback) {\n var calls = 0;\n return async.whilst(function() {\n return ++calls <= 1 || test.apply(this, arguments);\n }, iterator, callback);\n };\n\n async.until = function (test, iterator, callback) {\n return async.whilst(function() {\n return !test.apply(this, arguments);\n }, iterator, callback);\n };\n\n async.doUntil = function (iterator, test, callback) {\n return async.doWhilst(iterator, function() {\n return !test.apply(this, arguments);\n }, callback);\n };\n\n async.during = function (test, iterator, callback) {\n callback = callback || noop;\n\n var next = _restParam(function(err, args) {\n if (err) {\n callback(err);\n } else {\n args.push(check);\n test.apply(this, args);\n }\n });\n\n var check = function(err, truth) {\n if (err) {\n callback(err);\n } else if (truth) {\n iterator(next);\n } else {\n callback(null);\n }\n };\n\n test(check);\n };\n\n async.doDuring = function (iterator, test, callback) {\n var calls = 0;\n async.during(function(next) {\n if (calls++ < 1) {\n next(null, true);\n } else {\n test.apply(this, arguments);\n }\n }, iterator, callback);\n };\n\n function _queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n function _insert(q, data, pos, callback) {\n if (callback != null && typeof callback !== \"function\") {\n throw new Error(\"task callback must be a function\");\n }\n q.started = true;\n if (!_isArray(data)) {\n data = [data];\n }\n if(data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n return async.setImmediate(function() {\n q.drain();\n });\n }\n _arrayEach(data, function(task) {\n var item = {\n data: task,\n callback: callback || noop\n };\n\n if (pos) {\n q.tasks.unshift(item);\n } else {\n q.tasks.push(item);\n }\n\n if (q.tasks.length === q.concurrency) {\n q.saturated();\n }\n });\n async.setImmediate(q.process);\n }\n function _next(q, tasks) {\n return function(){\n workers -= 1;\n\n var removed = false;\n var args = arguments;\n _arrayEach(tasks, function (task) {\n _arrayEach(workersList, function (worker, index) {\n if (worker === task && !removed) {\n workersList.splice(index, 1);\n removed = true;\n }\n });\n\n task.callback.apply(task, args);\n });\n if (q.tasks.length + workers === 0) {\n q.drain();\n }\n q.process();\n };\n }\n\n var workers = 0;\n var workersList = [];\n var q = {\n tasks: [],\n concurrency: concurrency,\n payload: payload,\n saturated: noop,\n empty: noop,\n drain: noop,\n started: false,\n paused: false,\n push: function (data, callback) {\n _insert(q, data, false, callback);\n },\n kill: function () {\n q.drain = noop;\n q.tasks = [];\n },\n unshift: function (data, callback) {\n _insert(q, data, true, callback);\n },\n process: function () {\n while(!q.paused && workers < q.concurrency && q.tasks.length){\n\n var tasks = q.payload ?\n q.tasks.splice(0, q.payload) :\n q.tasks.splice(0, q.tasks.length);\n\n var data = _map(tasks, function (task) {\n return task.data;\n });\n\n if (q.tasks.length === 0) {\n q.empty();\n }\n workers += 1;\n workersList.push(tasks[0]);\n var cb = only_once(_next(q, tasks));\n worker(data, cb);\n }\n },\n length: function () {\n return q.tasks.length;\n },\n running: function () {\n return workers;\n },\n workersList: function () {\n return workersList;\n },\n idle: function() {\n return q.tasks.length + workers === 0;\n },\n pause: function () {\n q.paused = true;\n },\n resume: function () {\n if (q.paused === false) { return; }\n q.paused = false;\n var resumeCount = Math.min(q.concurrency, q.tasks.length);\n // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= resumeCount; w++) {\n async.setImmediate(q.process);\n }\n }\n };\n return q;\n }\n\n async.queue = function (worker, concurrency) {\n var q = _queue(function (items, cb) {\n worker(items[0], cb);\n }, concurrency, 1);\n\n return q;\n };\n\n async.priorityQueue = function (worker, concurrency) {\n\n function _compareTasks(a, b){\n return a.priority - b.priority;\n }\n\n function _binarySearch(sequence, item, compare) {\n var beg = -1,\n end = sequence.length - 1;\n while (beg < end) {\n var mid = beg + ((end - beg + 1) >>> 1);\n if (compare(item, sequence[mid]) >= 0) {\n beg = mid;\n } else {\n end = mid - 1;\n }\n }\n return beg;\n }\n\n function _insert(q, data, priority, callback) {\n if (callback != null && typeof callback !== \"function\") {\n throw new Error(\"task callback must be a function\");\n }\n q.started = true;\n if (!_isArray(data)) {\n data = [data];\n }\n if(data.length === 0) {\n // call drain immediately if there are no tasks\n return async.setImmediate(function() {\n q.drain();\n });\n }\n _arrayEach(data, function(task) {\n var item = {\n data: task,\n priority: priority,\n callback: typeof callback === 'function' ? callback : noop\n };\n\n q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);\n\n if (q.tasks.length === q.concurrency) {\n q.saturated();\n }\n async.setImmediate(q.process);\n });\n }\n\n // Start with a normal queue\n var q = async.queue(worker, concurrency);\n\n // Override push to accept second parameter representing priority\n q.push = function (data, priority, callback) {\n _insert(q, data, priority, callback);\n };\n\n // Remove unshift function\n delete q.unshift;\n\n return q;\n };\n\n async.cargo = function (worker, payload) {\n return _queue(worker, 1, payload);\n };\n\n function _console_fn(name) {\n return _restParam(function (fn, args) {\n fn.apply(null, args.concat([_restParam(function (err, args) {\n if (typeof console === 'object') {\n if (err) {\n if (console.error) {\n console.error(err);\n }\n }\n else if (console[name]) {\n _arrayEach(args, function (x) {\n console[name](x);\n });\n }\n }\n })]));\n });\n }\n async.log = _console_fn('log');\n async.dir = _console_fn('dir');\n /*async.info = _console_fn('info');\n async.warn = _console_fn('warn');\n async.error = _console_fn('error');*/\n\n async.memoize = function (fn, hasher) {\n var memo = {};\n var queues = {};\n var has = Object.prototype.hasOwnProperty;\n hasher = hasher || identity;\n var memoized = _restParam(function memoized(args) {\n var callback = args.pop();\n var key = hasher.apply(null, args);\n if (has.call(memo, key)) { \n async.setImmediate(function () {\n callback.apply(null, memo[key]);\n });\n }\n else if (has.call(queues, key)) {\n queues[key].push(callback);\n }\n else {\n queues[key] = [callback];\n fn.apply(null, args.concat([_restParam(function (args) {\n memo[key] = args;\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i].apply(null, args);\n }\n })]));\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n };\n\n async.unmemoize = function (fn) {\n return function () {\n return (fn.unmemoized || fn).apply(null, arguments);\n };\n };\n\n function _times(mapper) {\n return function (count, iterator, callback) {\n mapper(_range(count), iterator, callback);\n };\n }\n\n async.times = _times(async.map);\n async.timesSeries = _times(async.mapSeries);\n async.timesLimit = function (count, limit, iterator, callback) {\n return async.mapLimit(_range(count), limit, iterator, callback);\n };\n\n async.seq = function (/* functions... */) {\n var fns = arguments;\n return _restParam(function (args) {\n var that = this;\n\n var callback = args[args.length - 1];\n if (typeof callback == 'function') {\n args.pop();\n } else {\n callback = noop;\n }\n\n async.reduce(fns, args, function (newargs, fn, cb) {\n fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {\n cb(err, nextargs);\n })]));\n },\n function (err, results) {\n callback.apply(that, [err].concat(results));\n });\n });\n };\n\n async.compose = function (/* functions... */) {\n return async.seq.apply(null, Array.prototype.reverse.call(arguments));\n };\n\n\n function _applyEach(eachfn) {\n return _restParam(function(fns, args) {\n var go = _restParam(function(args) {\n var that = this;\n var callback = args.pop();\n return eachfn(fns, function (fn, _, cb) {\n fn.apply(that, args.concat([cb]));\n },\n callback);\n });\n if (args.length) {\n return go.apply(this, args);\n }\n else {\n return go;\n }\n });\n }\n\n async.applyEach = _applyEach(async.eachOf);\n async.applyEachSeries = _applyEach(async.eachOfSeries);\n\n\n async.forever = function (fn, callback) {\n var done = only_once(callback || noop);\n var task = ensureAsync(fn);\n function next(err) {\n if (err) {\n return done(err);\n }\n task(next);\n }\n next();\n };\n\n function ensureAsync(fn) {\n return _restParam(function (args) {\n var callback = args.pop();\n args.push(function () {\n var innerArgs = arguments;\n if (sync) {\n async.setImmediate(function () {\n callback.apply(null, innerArgs);\n });\n } else {\n callback.apply(null, innerArgs);\n }\n });\n var sync = true;\n fn.apply(this, args);\n sync = false;\n });\n }\n\n async.ensureAsync = ensureAsync;\n\n async.constant = _restParam(function(values) {\n var args = [null].concat(values);\n return function (callback) {\n return callback.apply(this, args);\n };\n });\n\n async.wrapSync =\n async.asyncify = function asyncify(func) {\n return _restParam(function (args) {\n var callback = args.pop();\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (_isObject(result) && typeof result.then === \"function\") {\n result.then(function(value) {\n callback(null, value);\n })[\"catch\"](function(err) {\n callback(err.message ? err : new Error(err));\n });\n } else {\n callback(null, result);\n }\n });\n };\n\n // Node.js\n if (typeof module === 'object' && module.exports) {\n module.exports = async;\n }\n // AMD / RequireJS\n else if (typeof define === 'function' && define.amd) {\n define([], function () {\n return async;\n });\n }\n // included directly via