diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..dafac6d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# 1.0.0 (2021-07-15) + + +### Bug Fixes + +* add dependencies - use atom-community packages ([d9d7164](https://github.com/atom-community/atom-ide-code-format/commit/d9d7164db25df401bd76d80dc96f6254d57a54e0)) +* adopt template - add build scripts ([1019c71](https://github.com/atom-community/atom-ide-code-format/commit/1019c71d454ea2a01446869ac4628b15834f33de)) +* do not bundle rxjs-compat/bundles/rxjs-compat.umd.min.js ([933b58f](https://github.com/atom-community/atom-ide-code-format/commit/933b58fb298936eaabe4756612354a1e9d40ce27)) +* eslint fix ([feef034](https://github.com/atom-community/atom-ide-code-format/commit/feef034e679201f68653066c367b04feb16c2d39)) +* export package functions directly ([dd924fb](https://github.com/atom-community/atom-ide-code-format/commit/dd924fb939f8955c1dc3814cedc52d89e06af9a7)) +* free _checkContentsAreSame ([669f20a](https://github.com/atom-community/atom-ide-code-format/commit/669f20a0a24578c50f4cceee0ab29e2412214653)) +* free _getEditorEventStream ([72586af](https://github.com/atom-community/atom-ide-code-format/commit/72586af562a3e01ccc3ffe0c577c96e30ceef24c)) +* more strict tsconfig ([df4ecdd](https://github.com/atom-community/atom-ide-code-format/commit/df4ecdd185976e606a94d2c30e5ceb0168189dd8)) +* move config to config.json ([32260d5](https://github.com/atom-community/atom-ide-code-format/commit/32260d5622dfecc6a76a7a20478c0c4cf75e51cf)) + + +### Features + +* convert to Typescript ([0506e74](https://github.com/atom-community/atom-ide-code-format/commit/0506e743f6482493d87eb40449c24c43c4db155f)) diff --git a/dist/main.js b/dist/main.js new file mode 100644 index 0000000..c400905 --- /dev/null +++ b/dist/main.js @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("rxjs-compat/bundles/rxjs-compat.umd.min.js"),t=require("assert"),r=require("log4js"),n=require("atom"),o=require("path"),i=require("os");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),u=a(t),l=a(r),c=a(n),f=a(o),p=a(i);var d={};Object.defineProperty(d,"__esModule",{value:!0});var h=d.default=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")},m={},g={},b={};Object.defineProperty(b,"__esModule",{value:!0}),b.default=function(e){if("string"==typeof e.displayName&&""!==e.displayName)return e.displayName;if("string"==typeof e.name&&""!==e.name)return e.name;return"Unknown"};var y={};Object.defineProperty(y,"__esModule",{value:!0});var v=y.default=void 0;class _{constructor(...e){this.disposed=void 0,this.teardowns=void 0,this.teardowns=new Set,this.disposed=!1,e.length&&this.add(...e)}add(...e){if(this.disposed)throw new Error("Cannot add to an already disposed UniversalDisposable!");for(let t=0;t{r.dispose(),this.remove(r)})));this.add(r)}remove(e){this.disposed||this.teardowns.delete(e)}dispose(){this.disposed||(this.disposed=!0,this.teardowns.forEach((e=>{"function"==typeof e.dispose?e.dispose():"function"==typeof e.unsubscribe?e.unsubscribe():"function"==typeof e.destroy?e.destroy():"function"==typeof e&&e()})),this.teardowns=null)}unsubscribe(){this.dispose()}clear(){this.disposed||this.teardowns.clear()}}function w(e){if("function"!=typeof e.dispose&&"function"!=typeof e.unsubscribe&&"function"!=typeof e.destroy&&"function"!=typeof e)throw new TypeError("Arguments to UniversalDisposable.add must be disposable")}v=y.default=_;var E={};Object.defineProperty(E,"__esModule",{value:!0}),E.sleep=T,E.nextTick=function(){return new Promise((e=>{process.nextTick(e)}))},E.triggerAfterWait=async function(e,t,r,n){const o=setTimeout(r,t);try{return await e}finally{clearTimeout(o),n&&n()}},E.timeoutPromise=S,E.createDeadline=function(e){return Date.now()+e},E.timeoutAfterDeadline=function(e,t){const r=e-Date.now();return S(t,r<0?0:r)},E.retryLimit=async function(e,t,r,n=0){let o=null,i=0,a=null;for(;0===i||i{const t=e();return r=t.then((()=>r=null),(()=>r=null)),t},o=()=>(t=null,n());return()=>null==r?n():(null==t&&((0,P.default)(r,"pendingCall must not be null!"),t=r.then(o,o)),t)},E.asyncFind=function(e,t,r){let n=e;return new Promise(((e,o)=>{n=n.slice();const i=n.length,a=async function(o){if(o===i)return void e(null);const s=n[o],u=await t.call(r,s);null!=u?e(u):a(o+1)};a(0)}))},E.denodeify=function(e){return function(...t){return new Promise(((r,n)=>{e.apply(this,t.concat([function(e,t){e?n(e):r(t)}]))}))}},E.asyncLimit=R,E.asyncFilter=async function(e,t,r){const n=[];return await R(e,r||e.length,(async e=>{await t(e)&&n.push(e)})),n},E.asyncObjFilter=async function(e,t,r){const n=Object.keys(e),o={};return await R(n,r||n.length,(async r=>{const n=e[r];await t(n,r)&&(o[r]=n)})),o},E.asyncSome=async function(e,t,r){let n=!1;return await R(e,r||e.length,(async e=>{n||await t(e)&&(n=!0)})),n},E.isPromise=function(e){return Boolean(e)&&"object"==typeof e&&"function"==typeof e.then},E.lastly=function(e,t){return e.then((e=>Promise.resolve(t()).then((()=>e))),(e=>Promise.resolve(t()).then((()=>Promise.reject(e)))))},E.delayTime=function(e){return new Promise(((t,r)=>{setTimeout(t,e)}))},E.PromiseWithState=E.Deferred=E.TimedOutError=E.RequestSerializer=void 0;var O,P=(O=u.default)&&O.__esModule?O:{default:O};function T(e){return new Promise((t=>{setTimeout(t,e)}))}E.RequestSerializer=class{constructor(){this._lastDispatchedOp=void 0,this._lastFinishedOp=void 0,this._latestPromise=void 0,this._waitResolve=void 0,this._lastDispatchedOp=0,this._lastFinishedOp=0,this._latestPromise=new Promise(((e,t)=>{this._waitResolve=e}))}async run(e){const t=this._lastDispatchedOp+1;this._lastDispatchedOp=t,this._latestPromise=e,this._waitResolve();const r=await e;return this._lastFinishedOp{this._waitResolve=e,this._latestPromise.then(e)}));return t}isRunInProgress(){return this._lastDispatchedOp>this._lastFinishedOp}};class x extends Error{constructor(e){super(`Timed out after ${String(e)} ms`),this.timeout=void 0,this.timeout=e}}function S(e,t){return new Promise(((r,n)=>{let o=setTimeout((()=>{o=null,n(new x(t))}),t);e.then((e=>{null!=o&&clearTimeout(o),r(e)})).catch((e=>{null!=o&&clearTimeout(o),n(e)}))}))}E.TimedOutError=x;function R(e,t,r){const n=new Array(e.length);let o=0,i=0,a=Math.min(t,e.length)||1;return new Promise(((t,s)=>{const u=async()=>{if(i===e.length)return void(0===o&&t(n));++o;const a=i++;try{n[a]=await r(e[a])}catch(e){s(e)}--o,u()};for(;a--;)u()}))}E.Deferred=class{constructor(){this.promise=void 0,this.resolve=void 0,this.reject=void 0,this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}};E.PromiseWithState=class{constructor(e){this._promise=void 0,this._state=void 0,this._state={kind:"pending"},this._promise=e.then((e=>(this._state={kind:"fulfilled",value:e},e)),(e=>{throw this._state={kind:"rejected",error:e},e}))}getPromise(){return this._promise}getState(){return this._state}};var A={};Object.defineProperty(A,"__esModule",{value:!0}),A.default=void 0;var j="undefined"!=typeof performance?()=>performance.now():()=>{const[e,t]=process.hrtime();return 1e3*e+t/1e6};A.default=j,Object.defineProperty(g,"__esModule",{value:!0}),g.track=U,g.isTrackSupported=function(){return N.isTrackSupported()},g.trackImmediate=function(e,t){return N.track(e,t||{},!0)||Promise.resolve()},g.trackEvent=F,g.trackEvents=function(e){return new I.default(e.subscribe(F))},g.trackSampled=L,g.startTracking=W,g.trackTiming=q,g.decorateTrackTiming=z,g.trackTimingSampled=V,g.decorateTrackTimingSampled=H,g.setRawAnalyticsService=function(e,t){e.setApplicationSessionObservable(t),N=e},g.default=g.TimingTracker=void 0;var M=D(b),I=D(y),k=E,C=D(A);function D(e){return e&&e.__esModule?e:{default:e}}let N={track(){},isTrackSupported:()=>!1,setApplicationSessionObservable:e=>{}};function U(e,t){N.track(e,t||{})}function F(e){U(e.type,e.data)}function L(e,t,r){Math.random()*t<=1&&N.track(e,{...r,sample_rate:t})}const B="undefined"!=typeof performance;class ${constructor(e,t){this._eventName=void 0,this._startTime=void 0,this._startMark=void 0,this._values=void 0,this._eventName=e,this._startMark=`${this._eventName}_${$.eventCount++}_start`,this._startTime=(0,C.default)(),this._values=t,B&&performance.mark(this._startMark)}onError(e){this._trackTimingEvent(e)}onCancel(){this._trackTimingEvent(null,!0)}onSuccess(){this._trackTimingEvent(null)}_trackTimingEvent(e,t=!1){B&&(performance.measure(this._eventName,this._startMark),performance.clearMarks(this._startMark),performance.clearMeasures(this._eventName)),U("performance",{...this._values,duration:Math.round((0,C.default)()-this._startTime).toString(),eventName:this._eventName,error:e?"1":"0",exception:e?e.toString():"",canceled:t})}}function W(e,t={}){return new $(e,t)}function q(e,t,r={}){const n=W(e,r);try{const e=t();return(0,k.isPromise)(e)?e.then((e=>(n.onSuccess(),e)),(e=>(n.onError(e instanceof Error?e:new Error(e)),Promise.reject(e)))):(n.onSuccess(),e)}catch(e){throw n.onError(e),e}}function z(e,t={}){const r=(0,M.default)(e);function n(...n){return q(r,e.bind(this,...n),t)}return n.displayName=`trackTiming(${r})`,n}function V(e,t,r,n={}){return Math.random()*r<=1?q(e,t,{...n,sample_rate:r}):t()}function H(e,t,r={}){const n=(0,M.default)(e);function o(...o){return V(n,e.bind(this,...o),t,r)}return o.displayName=`trackTimingSampled(${n})`,o}g.TimingTracker=$,$.eventCount=0;var G={track:U,trackSampled:L,trackEvent:F,trackTiming:q,trackTimingSampled:V,startTracking:W,TimingTracker:$,decorateTrackTiming:z,decorateTrackTimingSampled:H};g.default=G;var K={};Object.defineProperty(K,"__esModule",{value:!0});var X=K.default=void 0,Y=function(e){return e&&e.__esModule?e:{default:e}}(y);X=K.default=class{constructor(){this._providers=void 0,this._providers=[]}addProvider(e){const t=this._providers.findIndex((t=>e.priority>t.priority));return-1===t?this._providers.push(e):this._providers.splice(t,0,e),new Y.default((()=>{this.removeProvider(e)}))}removeProvider(e){const t=this._providers.indexOf(e);-1!==t&&this._providers.splice(t,1)}getProviderForEditor(e){const t=e.getGrammar().scopeName;return this.findProvider(t)}getAllProvidersForEditor(e){const t=e.getGrammar().scopeName;return this.findAllProviders(t)}findProvider(e){for(const t of this.findAllProviders(e))return t;return null}*findAllProviders(e){for(const t of this._providers)null!=t.grammarScopes&&-1===t.grammarScopes.indexOf(e)||(yield t)}};var Z={},J={},Q={};Object.defineProperty(Q,"__esModule",{value:!0}),Q.attachEvent=function(e,t,r){return e.addListener(t,r),new te.default((()=>{e.removeListener(t,r)}))};var ee=Q.observableFromSubscribeFunction=function(e){return re.Observable.create((t=>new te.default(e(t.next.bind(t)))))},te=function(e){return e&&e.__esModule?e:{default:e}}(y),re=s.default;Object.defineProperty(J,"__esModule",{value:!0}),J.existingEditorForUri=function(e){for(const t of atom.workspace.getTextEditors())if(t.getPath()===e)return t;return null},J.existingEditorForBuffer=function(e){for(const t of atom.workspace.getTextEditors())if(t.getBuffer()===e)return t;return null},J.getViewOfEditor=ue,J.getScrollTop=function(e){return ue(e).getScrollTop()},J.setScrollTop=le,J.setPositionAndScroll=function(e,t,r){e.setCursorBufferPosition(t,{autoscroll:!1}),le(e,r)},J.getCursorPositions=function(e){return ae.Observable.defer((()=>{const t=e.getCursors()[0];return(0,oe.default)(null!=t),ae.Observable.merge(ae.Observable.of(t.getBufferPosition()),(0,se.observableFromSubscribeFunction)(t.onDidChangePosition.bind(t)).map((e=>e.newBufferPosition)))}))};var ne=J.observeEditorDestroy=function(e){return(0,se.observableFromSubscribeFunction)(e.onDidDestroy.bind(e)).map((t=>e)).take(1)};J.enforceReadOnlyEditor=function(e,t=["append","setText"]){return e.getElement().setAttribute("readonly",""),{dispose(){e.getElement().removeAttribute("readonly")}}},J.enforceSoftWrap=function(e,t){return e.setSoftWrapped(t),e.onDidChangeSoftWrapped((r=>{r!==t&&process.nextTick((()=>{e.isDestroyed()||e.setSoftWrapped(t)}))}))},J.isValidTextEditor=function(e){return e instanceof ie.TextEditor},J.centerScrollToBufferLine=function(e,t){const r=e.getModel(),n=e.pixelPositionForBufferPosition([t,0]).top+r.getLineHeightInPixels()/2-e.clientHeight/2;e.setScrollTop(Math.max(n,1)),e.focus(),r.setCursorBufferPosition([t,0],{autoscroll:!1})};var oe=function(e){return e&&e.__esModule?e:{default:e}}(u.default),ie=c.default,ae=s.default,se=Q;function ue(e){return atom.views.getView(e)}function le(e,t){ue(e).setScrollTop(t)}var ce={};Object.defineProperty(ce,"__esModule",{value:!0}),ce.goToLocation=async function(e,t){var r,n,o;const i=null===(r=null==t?void 0:t.center)||void 0===r||r,a=null===(n=null==t?void 0:t.moveCursor)||void 0===n||n,s=null===(o=null==t?void 0:t.activatePane)||void 0===o||o,u=null==t?void 0:t.activateItem,l=null==t?void 0:t.line,c=null==t?void 0:t.column,f=null==t?void 0:t.pending,p=atom.workspace.getActiveTextEditor();if(null!=p&&p.getPath()===e){const e=atom.workspace.paneContainerForItem(p);return(0,de.default)(null!=e),s&&e.activate(),null!=l?me(p,{line:l,column:null==c?0:c,center:i,moveCursor:a}):(0,de.default)(null==c,"goToLocation: Cannot specify just column"),p}{const t=await atom.workspace.open(e,{initialLine:l,initialColumn:c,searchAllPanes:!0,activatePane:s,activateItem:u,pending:f});if(null==t){const t={};Error.captureStackTrace(t);const r=Error(`atom.workspace.open returned null on ${e}`);throw(0,fe.getLogger)("goToLocation").error(r),r}return i&&null!=l&&t.scrollToBufferPosition([l,c],{center:!0}),t}},ce.goToLocationInEditor=me,ce.observeNavigatingEditors=function(){return he};var fe=l.default,pe=s.default,de=function(e){return e&&e.__esModule?e:{default:e}}(u.default);const he=new pe.Subject;function me(e,t){const r=null==t.center||t.center,n=null==t.moveCursor||t.moveCursor,{line:o,column:i}=t;n&&e.setCursorBufferPosition([o,i]),r&&e.scrollToBufferPosition([o,i],{center:!0}),he.next(e)}Object.defineProperty(Z,"__esModule",{value:!0}),Z.applyTextEditsForMultipleFiles=async function(e){const t=Array.from(e.keys()),r=(await Promise.all(t.map((async e=>(0,_e.goToLocation)(e))))).map((e=>{(0,be.default)(null!=e);const t=e.getBuffer();return[t,t.createCheckpoint()]})),n=t.reduce(((t,r)=>{const n=e.get(r);return t&&null!=n&&we(r,...n)}),!0);n||r.forEach((([e,t])=>(e.revertToCheckpoint(t),!1)));return n},Z.applyTextEdits=we;var ge=Z.applyTextEditsToBuffer=function(e,t){return Ee(e,Pe(t))},be=function(e){return e&&e.__esModule?e:{default:e}}(u.default),ye=l.default,ve=J,_e=ce;function we(e,...t){const r=Pe(t),n=(0,ve.existingEditorForUri)(e);return(0,be.default)(null!=n),Ee(n.getBuffer(),r)}function Ee(e,t){if(function(e){for(let t=0;t=0;n--){if(!Oe(e,t[n]))return e.revertToCheckpoint(r),!1}return e.groupChangesSinceCheckpoint(r),!0}function Oe(e,t){if(t.oldRange.start.row===t.oldRange.end.row){const r=e.lineLengthForRow(t.oldRange.start.row);if(t.oldRange.end.column>r)return!1}if(null!=t.oldText){if(e.getTextInRange(t.oldRange)!==t.oldText)return!1}return e.setTextInRange(t.oldRange,t.newText),!0}function Pe(e){return e.map(((e,t)=>[e,t])).sort((([e,t],[r,n])=>e.oldRange.start.compare(r.oldRange.start)||e.oldRange.end.compare(r.oldRange.end)||t-n)).map((([e])=>e))}Object.defineProperty(m,"__esModule",{value:!0});var Te=m.registerOnWillSave=function(e){return Ie.addProvider(e)};m.observeTextEditors=function(){const e=new je.default;return e.add(atom.workspace.observeTextEditors((t=>{e.add(function(e){const t=e.save,r=e;return r.save=async()=>{const n=new Date;n.setTime(n.getTime()+5e3);try{await function(e){if(null==e.getPath())return xe.Observable.empty();const t=Array.from(Ie.getAllProvidersForEditor(e));return xe.Observable.concat(...t.map((t=>t.callback(e).toArray().race(xe.Observable.of([]).delay(t.timeout)).map((t=>(0,Ae.applyTextEditsToBuffer)(e.getBuffer(),t))))))}(r).timeout(n).toPromise()}catch(t){const n=Array.from(Ie.getAllProvidersForEditor(r));(0,Se.track)("timeout-on-save",{uri:e.getPath(),providers:n})}finally{await t.call(e)}},new je.default((()=>{r.save=t}))}(t))}))),e};var xe=s.default,Se=g,Re=Me(K),Ae=Z,je=Me(y);function Me(e){return e&&e.__esModule?e:{default:e}}const Ie=new Re.default;var ke={},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var De=function(e){return e&&e.__esModule?e:{default:e}}(u.default),Ne=s.default;Ce.default=class{constructor(e){this._packageName=void 0,this._config=void 0,this._config=e}getConfig(){return this._config}setPackageName(e){this._packageName=e}getPackageName(){return(0,De.default)(null!=this._packageName,"No package name available"),this._packageName}formatKeyPath(e){return null==this._packageName?e:`${this._packageName}.${e}`}get(e,t){return this._config.get(this.formatKeyPath(e),...null==t?[]:[t])}getWithDefaults(e,t,r){const n=this.get(e,r);return null==n?t:n}getSchema(e){return this._config.getSchema(this.formatKeyPath(e))}observe(e,t,r){return this._config.observe(this.formatKeyPath(e),...Array.prototype.slice.call(arguments,1))}observeAsStream(e,t={}){return Ne.Observable.create((r=>{const n=this.observe(e,t,r.next.bind(r));return n.dispose.bind(n)}))}onDidChange(e,t,r){return this._config.onDidChange(this.formatKeyPath(e),...Array.prototype.slice.call(arguments,1))}set(e,t,r){return this._config.set(this.formatKeyPath(e),...Array.prototype.slice.call(arguments,1))}setSchema(e,t){return this._config.setSchema(this.formatKeyPath(e),...Array.prototype.slice.call(arguments,1))}unset(e,t){return this._config.unset(this.formatKeyPath(e),...Array.prototype.slice.call(arguments,1))}isFeatureDisabled(e){return null==this._packageName?atom.packages.isPackageDisabled(e):atom.packages.isPackageDisabled(this._packageName)||!this._config.get(`${this._packageName}.use.${e}`)}},Object.defineProperty(ke,"__esModule",{value:!0});var Ue=ke.default=void 0;var Fe=new(function(e){return e&&e.__esModule?e:{default:e}}(Ce).default)(atom.config);Ue=ke.default=Fe;var Le,Be,$e={},We={exports:{}};Le=We,void 0!==(Be=function(e,t){function r(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return encodeURIComponent(e).replace(/[!'()*]/g,r)}function o(e){return e.replace(/[#?]/,r)}Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(){this._scheme=e._empty,this._authority=e._empty,this._path=e._empty,this._query=e._empty,this._fragment=e._empty,this._formatted=null,this._fsPath=null}return e.isUri=function(t){return t instanceof e||!!t&&"string"==typeof t.authority&&"string"==typeof t.fragment&&"string"==typeof t.path&&"string"==typeof t.query&&"string"==typeof t.scheme},Object.defineProperty(e.prototype,"scheme",{get:function(){return this._scheme},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"authority",{get:function(){return this._authority},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._path},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fragment",{get:function(){return this._fragment},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fsPath",{get:function(){var t;return this._fsPath||(t=this._authority&&this._path&&"file"===this.scheme?"//"+this._authority+this._path:e._driveLetterPath.test(this._path)?this._path[1].toLowerCase()+this._path.substr(2):this._path,i&&(t=t.replace(/\//g,"\\")),this._fsPath=t),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.with=function(t){if(!t)return this;var r=t.scheme,n=t.authority,o=t.path,i=t.query,a=t.fragment;if(void 0===r?r=this.scheme:null===r&&(r=""),void 0===n?n=this.authority:null===n&&(n=""),void 0===o?o=this.path:null===o&&(o=""),void 0===i?i=this.query:null===i&&(i=""),void 0===a?a=this.fragment:null===a&&(a=""),r===this.scheme&&n===this.authority&&o===this.path&&i===this.query&&a===this.fragment)return this;var s=new e;return s._scheme=r,s._authority=n,s._path=o,s._query=i,s._fragment=a,e._validate(s),s},e.parse=function(t){var r=new e,n=e._parseComponents(t);return r._scheme=n.scheme,r._authority=decodeURIComponent(n.authority),r._path=decodeURIComponent(n.path),r._query=decodeURIComponent(n.query),r._fragment=decodeURIComponent(n.fragment),e._validate(r),r},e.file=function(t){var r=new e;if(r._scheme="file",i&&(t=t.replace(/\\/g,e._slash)),t[0]===e._slash&&t[0]===t[1]){var n=t.indexOf(e._slash,2);-1===n?r._authority=t.substring(2):(r._authority=t.substring(2,n),r._path=t.substring(n))}else r._path=t;return r._path[0]!==e._slash&&(r._path=e._slash+r._path),e._validate(r),r},e._parseComponents=function(t){var r={scheme:e._empty,authority:e._empty,path:e._empty,query:e._empty,fragment:e._empty},n=e._regexp.exec(t);return n&&(r.scheme=n[2]||r.scheme,r.authority=n[4]||r.authority,r.path=n[5]||r.path,r.query=n[7]||r.query,r.fragment=n[9]||r.fragment),r},e.from=function(t){return(new e).with(t)},e._validate=function(t){if(t.scheme&&!e._schemePattern.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path)if(t.authority){if(!e._singleSlashStart.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(e._doubleSlashStart.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')},e.prototype.toString=function(t){return void 0===t&&(t=!1),t?e._asFormatted(this,!0):(this._formatted||(this._formatted=e._asFormatted(this,!1)),this._formatted)},e._asFormatted=function(t,r){var i=r?o:n,a=[],s=t.scheme,u=t.authority,l=t.path,c=t.query,f=t.fragment;if(s&&a.push(s,":"),(u||"file"===s)&&a.push("//"),u&&(-1===(h=(u=u.toLowerCase()).indexOf(":"))?a.push(i(u)):a.push(i(u.substr(0,h)),u.substr(h))),l){var p=e._upperCaseDrive.exec(l);p&&(l=p[1]?"/"+p[2].toLowerCase()+l.substr(3):p[2].toLowerCase()+l.substr(2));for(var d=0;;){var h;if(-1===(h=l.indexOf(e._slash,d))){a.push(i(l.substring(d)));break}a.push(i(l.substring(d,h)),e._slash),d=h+1}}return c&&a.push("?",i(c)),f&&a.push("#",i(f)),a.join(e._empty)},e.prototype.toJSON=function(){var e={fsPath:this.fsPath,external:this.toString(),$mid:1};return this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},e.revive=function(t){var r=new e;return r._scheme=t.scheme||e._empty,r._authority=t.authority||e._empty,r._path=t.path||e._empty,r._query=t.query||e._empty,r._fragment=t.fragment||e._empty,r._fsPath=t.fsPath,r._formatted=t.external,e._validate(r),r},e}();if(a._empty="",a._slash="/",a._regexp=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,a._driveLetterPath=/^\/[a-zA-z]:/,a._upperCaseDrive=/^(\/)?([A-Z]:)/,a._schemePattern=/^\w[\w\d+.-]*$/,a._singleSlashStart=/^\//,a._doubleSlashStart=/^\/\//,t.default=a,"object"==typeof process)i="win32"===process.platform;else if("object"==typeof navigator){var s=navigator.userAgent;i=s.indexOf("Windows")>=0}}(0,We.exports))&&(Le.exports=Be);for(var qe={},ze={quote:function(e){return e.map((function(e){return e&&"object"==typeof e?e.op.replace(/(.)/g,"\\$1"):/["\s]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['\\])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([#!"$&'()*,:;<=>?@\[\\\]^`{|}])/g,"\\$1")})).join(" ")}},Ve="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","[&;()|<>]"].join("|")+")",He="(\\\\['\"|&;()<> \\t]|[^\\s'\"|&;()<> \\t])+",Ge="",Ke=0;Ke<4;Ke++)Ge+=(Math.pow(16,8)*Math.random()).toString(16);ze.parse=function(e,t,r){var n=function(e,t,r){var n=new RegExp(["("+Ve+")","("+He+"|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')*"].join("|"),"g"),o=e.match(n).filter(Boolean),i=!1;if(!o)return[];t||(t={});r||(r={});return o.map((function(e,t){if(!i){if("#"===e.charAt(0))return i=!0,{comment:e.substr(1)+o.slice(t+1).join(" ")};if(RegExp("^"+Ve+"$").test(e))return{op:e};for(var n="'",s='"',u="$",l=r.escape||"\\",c=!1,f=!1,p="",d=!1,h=0,m=e.length;h/g,">")},qe.ZERO_WIDTH_SPACE=qe.ELLIPSIS_CHAR=qe.URL_REGEX=void 0;var Xe=function(e){return e&&e.__esModule?e:{default:e}}(u.default),Ye=ze;const Ze=36e5,Je=24*Ze,Qe=7*Je,et=365*Je,tt=et/12,rt=[[42e3,"now"],[9e4,"1m"],[36e5,"m",6e4],[54e5,"1h"],[Je,"h",Ze],[2*Je,"1d"],[7*Je,"d",Je],[1.5*Qe,"1w"],[tt,"w",Qe],[1.5*tt,"1mo"],[et,"mo",tt],[1.5*et,"1y"],[Number.MAX_VALUE,"y",et]],nt=[[42e3,"just now"],[9e4,"a minute ago"],[36e5,"minutes ago",6e4],[54e5,"an hour ago"],[Je,"hours ago",Ze],[2*Je,"yesterday"],[7*Je,"days ago",Je],[1.5*Qe,"a week ago"],[tt,"weeks ago",Qe],[1.5*tt,"a month ago"],[et,"months ago",tt],[1.5*et,"a year ago"],[Number.MAX_VALUE,"years ago",et]],ot=[[42e3,"just now"],[9e4,"1 minute ago"],[36e5,"minutes ago",6e4],[54e5,"1 hour ago"],[Je,"hours ago",Ze],[2*Je,"yesterday"],[7*Je,"days ago",Je],[1.5*Qe,"1 week ago"],[tt,"weeks ago",Qe],[1.5*tt,"1 month ago"],[et,"months ago",tt],[1.5*et,"1 year ago"],[Number.MAX_VALUE,"years ago",et]];qe.URL_REGEX=/(https?:\/\/(?:www\.)?[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b[-\w@:%+.~#?&/=!]*|www\.[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b[-\w@:%+.~#?&/=!]*)/;qe.ELLIPSIS_CHAR="…";qe.ZERO_WIDTH_SPACE="​",Object.defineProperty($e,"__esModule",{value:!0}),$e.__TEST__=Vt=$e.default=void 0;var it=ct(We.exports),at=ct(u.default),st=ct(f.default),ut=ct(p.default),lt=qe;function ct(e){return e&&e.__esModule?e:{default:e}}const ft=[],pt=/^[A-Za-z0-9_-]+:\/\/.*/;function dt(e){return e.startsWith("nuclide://")}function ht(e){return e.startsWith("atom://")}function mt(e,t){return(0,at.default)(null!=t&&""!==t,"NuclideUri must include a path."),`nuclide://${e}${t}`}function gt(e){if(e.startsWith("nuclide://")){const t=e.substr("nuclide://".length),r=t.indexOf("/");(0,at.default)(-1!==r,`Remote URIs must contain a hostname and a path. Failed to parse ${e}`);const n=t.substr(0,r);(0,at.default)(""!==n,`Remote URIs must contain a hostname. Failed to parse ${e}`);const o=t.substr(r);return(0,at.default)(!Bt(e),`Path cannot end with archive separator. Failed to parse ${e}`),{hostname:n,path:o}}return(0,at.default)(!Bt(e),`Path cannot end with archive separator. Failed to parse ${e}`),{hostname:null,path:e}}function bt(e){if(!dt(e))throw new Error("Expected remote uri. Got "+e);const t=gt(e);return(0,at.default)(t.hostname,`Remote Nuclide URIs must contain hostnames, '${(0,lt.maybeToString)(t.hostname)}' found while parsing '${e}'`),{hostname:t.hostname,path:t.path}}function yt(e){return gt(e).path}function vt(e){return bt(e).hostname}function _t(e,...t){return wt(e,t)}function wt(e,t){Wt(e);const r=Dt(e);if(dt(e)){const{hostname:n,path:o}=bt(e);return t.splice(0,0,o),Nt(r,t),Ft(r,mt(n,r.join.apply(null,t)))}return t.splice(0,0,e),Nt(r,t),Ft(r,r.join.apply(null,t))}function Et(e){Wt(e);const t=Dt(e);if(dt(e)){const{hostname:r,path:n}=bt(e);return mt(r,Ft(t,t.normalize(Ut(t,n))))}return Ft(t,t.normalize(Ut(t,e)))}function Ot(e,t=""){Wt(e);const r=Dt(e);return Ft(r,r.basename(Ut(r,yt(e)),t))}function Pt(e){Wt(e);const t=Dt(e);if(dt(e)){const{hostname:r,path:n}=bt(e);return mt(r,Ft(t,t.dirname(Ut(t,n))))}return Ft(t,t.dirname(Ut(t,e)))}function Tt(e){Wt(e);const t=Dt(e);return Ft(t,t.extname(Ut(t,yt(e))))}function xt(e){const t="file://";if(!e.startsWith(t))return null;const r=e.substr(t.length);return function(e){return Dt(e)===st.default.win32}(r)?r:null}function St(e,t){if(Wt(e),Wt(t),t.length{const r=t(e);return null!=r&&""!==r?r:e}),e)}function jt(e){return Wt(e),dt(e)?At(vt(e)):e}function Mt(e){Wt(e);const t=Dt(e);return e.endsWith(t.sep)?e:e+t.sep}function It(e){Wt(e);const t=Dt(e);return e.endsWith(t.sep)}function kt(e){if(Wt(e),dt(e))return!0;return Dt(e).isAbsolute(e)}function Ct(e){return Wt(e),Pt(e)===e}function Dt(e){return(0,at.default)(!Bt(e),`Path cannot end with archive separator. Failed to determine path module for ${e}`),e.startsWith(st.default.posix.sep)||e.indexOf("://")>-1?st.default.posix:":"===e[1]&&e[2]===st.default.win32.sep||e.split(st.default.win32.sep).length>e.split(st.default.posix.sep).length?st.default.win32:st.default.posix}function Nt(e,t){return t.forEach(((t,r,n)=>n[r]=Ut(e,t))),t}function Ut(e,t){return t.indexOf("!")<0?t:ft.reduce(((t,r)=>t.replace(`${r}!`,`${r}!${e.sep}`)),t)}function Ft(e,t){return t.indexOf("!")<0?t:Bt(r=ft.reduce(((t,r)=>t.replace(`${r}!${e.sep}`,`${r}!`)),t))?r.substring(0,r.length-"!".length):r;var r}function Lt(e,t){return e.lengtht&&"!"===e.charAt(t)&&ft.some((r=>{const n=t-r.length;return e.indexOf(r,n)===n}))}function Wt(e){if(null!=e&&Bt(e))throw new Error(`Path operation invoked on URI ending with !: ${e}`)}const qt=new Set([".bmp",".gif",".ico",".jpeg",".jpg",".png",".webp"]);var zt={basename:Ot,dirname:Pt,extname:Tt,stripExtension:function(e){Wt(e);const t=Tt(e);return 0===t.length?e:e.slice(0,-1*t.length)},isRemote:dt,isLocal:function(e){return!dt(e)&&!function(e){return pt.test(e)}(e)&&!ht(e)},createRemoteUri:mt,isInArchive:function(e){if(ht(e)||e.indexOf("!")<0)return!1;for(let t=e.indexOf("!");t>=0;t=e.indexOf("!",t+1))if($t(e,t))return!0;return!1},ancestorOutsideArchive:function(e){for(let t=e.indexOf("!");t>=0;t=e.indexOf("!",t+1))if($t(e,t))return e.substring(0,t);return e},parse:gt,parseRemoteUri:bt,validate:function(e,t){(0,at.default)(null!=e,"Unexpected null NuclideUri"),(0,at.default)("string"==typeof e,`Unexpected NuclideUri type: ${String(e)}`),dt(e)?(gt(e),(0,at.default)(!1!==t,"Expected remote NuclideUri")):((0,at.default)(""!==e,"NuclideUri must contain a non-empty path"),(0,at.default)(!0!==t,"Expected local NuclideUri"))},getPath:yt,getHostname:vt,getHostnameOpt:function(e){return null!=e&&dt(e)?vt(e):null},join:_t,joinArray:wt,archiveJoin:function(e,t){if(Wt(e),!ft.some((t=>e.endsWith(t))))throw new Error(`Cannot archiveJoin with non-archive ${e} and ${t}`);return e+"!"+t},relative:function(e,t){Wt(e);const r=Dt(e),n=dt(e);if(n!==dt(t)||n&&vt(e)!==vt(t))throw new Error(`Cannot relative urls on different hosts: ${e} and ${t}`);const o=Ut(r,n?yt(e):e),i=Ut(r,n?yt(t):t);return Ft(r,r.relative(Lt(o,i),Lt(i,o)))},looksLikeImageUri:function(e){const t=Tt(e).toLowerCase();return qt.has(t)},normalize:Et,normalizeDir:function(e){return Mt(Et(e))},getParent:function(e){return Et(_t(e,".."))},uriToNuclideUri:function(e){const t=xt(e);if(null!=t)return t;const r=it.default.parse(e);return"file"===r.scheme&&r.path?r.fsPath:dt(e)?e:null},nuclideUriToUri:function(e){return Wt(e),dt(e)?e:it.default.file(e).toString()},contains:St,collapse:function(e){return e.filter((t=>!e.some((e=>St(e,t)&&e!==t))))},nuclideUriToDisplayString:function(e){return Wt(e),dt(e)?`${jt(e)}:${yt(e)}`:e},nuclideUriToDisplayHostname:jt,hostnameToDisplayHostname:At,registerHostnameFormatter:function(e){return Rt.push(e),{dispose:()=>{const t=Rt.indexOf(e);t>=0&&Rt.splice(t,1)}}},ensureTrailingSeparator:Mt,trimTrailingSeparator:function(e){Wt(e);const t=Dt(e);let r=e;for(;r.endsWith(t.sep)&&!Ct(r);)r=r.slice(0,-1*t.sep.length);return r},endsWithSeparator:It,endsWithEdenDir:function(e){return Wt(e),e.endsWith(".eden")},isAbsolute:kt,isHomeRelative:function(e){return Wt(e),e.startsWith("~")},resolve:function(e,...t){Wt(e);const r=Dt(e);if(dt(e)){const{hostname:n,path:o}=bt(e);return t.splice(0,0,o),Nt(r,t),mt(n,Ft(r,r.resolve.apply(null,t)))}return t.splice(0,0,e),Nt(r,t),Ft(r,r.resolve.apply(null,t))},expandHomeDir:function(e){if(Wt(e),!e.startsWith("~"))return e;const{HOME:t,UserProfile:r}=process.env,n=!dt(e)&&"win32"===ut.default.platform(),o=n?r:t;return(0,at.default)(null!=o),"~"===e?o:e.startsWith("~/")||n&&e.startsWith("~\\")?st.default.resolve(o,e.replace("~",".")):e},splitPathList:function(e){(0,at.default)(e.indexOf("nuclide://")<0,"Splitting remote URIs is not supported");const t=Dt(e);return e.split(t.delimiter)},joinPathList:function(e){if(0===e.length)return"";(0,at.default)(e.every((e=>!dt(e))),"Joining of remote URIs is not supported");const t=Dt(e[0]);return e.join(t.delimiter)},ensureLocalPrefix:function(e){Wt(e);const t=Dt(e);(0,at.default)(!dt(e),"Local prefix can not be added to a remote path"),(0,at.default)(!kt(e),"Local prefix can not be added to an absolute path");const r=`.${t.sep}`;return e.startsWith(r)?e:r+e},isRoot:Ct,parsePath:function(e){Wt(e);const t=Dt(e),r=t.parse(Ut(t,yt(e)));return{root:Ft(t,r.root),dir:Ft(t,r.dir),base:Ft(t,r.base),ext:Ft(t,r.ext),name:Ft(t,r.name)}},split:function(e){const t=[];let r=e,n=Pt(r);for(;r!==n;)t.push(Ot(r)),r=n,n=Pt(r);return kt(e)&&t.push(n),t.reverse(),t},pathSeparatorFor:function(e){return Dt(e).sep},hasKnownArchiveExtension:function(e){return ft.some((t=>e.endsWith(t)))},ARCHIVE_SEPARATOR:"!",KNOWN_ARCHIVE_EXTENSIONS:ft,NUCLIDE_URI_TYPE_NAME:"NuclideUri"},Vt=$e.default=zt;const Ht={_pathModuleFor:Dt};$e.__TEST__=Ht;var Gt={},Kt={exports:{}},Xt={exports:{}},Yt={};!function(e){function t(e,t){return`${t&&t.context?t.context:"Value"} ${e}.`}function r(e){return o(Math.trunc(e))}function n(e){return e<0?-1:1}function o(e){return 0===e?0:e}function i(e,i){const a=!i.unsigned;let s,u;64===e?(u=Math.pow(2,53)-1,s=a?1-Math.pow(2,53):0):a?(s=-Math.pow(2,e-1),u=Math.pow(2,e-1)-1):(s=0,u=Math.pow(2,e)-1);const l=Math.pow(2,e),c=Math.pow(2,e-1);return(e,i)=>{void 0===i&&(i={});let f=+e;if(f=o(f),i.enforceRange){if(!Number.isFinite(f))throw new TypeError(t("is not a finite number",i));if(f=r(f),fu)throw new TypeError(t(`is outside the accepted range of ${s} to ${u}, inclusive`,i));return f}return!Number.isNaN(f)&&i.clamp?(f=Math.min(Math.max(f,s),u),f=function(e){return o(e>0&&e%1==.5&&0==(1&e)||e<0&&e%1==-.5&&1==(1&e)?Math.floor(e):Math.round(e))}(f),f):Number.isFinite(f)&&0!==f?(f=r(f),f>=s&&f<=u?f:(f=function(e,t){const r=e%t;return n(t)!==n(r)?r+t:r}(f,l),a&&f>=c?f-l:f)):0}}function a(e,r){if("function"!=typeof e)throw new TypeError(t("is not a function",r));return e}e.any=e=>e,e.void=function(){},e.boolean=function(e){return!!e},e.byte=i(8,{unsigned:!1}),e.octet=i(8,{unsigned:!0}),e.short=i(16,{unsigned:!1}),e["unsigned short"]=i(16,{unsigned:!0}),e.long=i(32,{unsigned:!1}),e["unsigned long"]=i(32,{unsigned:!0}),e["long long"]=i(64,{unsigned:!1}),e["unsigned long long"]=i(64,{unsigned:!0}),e.double=(e,r)=>{const n=+e;if(!Number.isFinite(n))throw new TypeError(t("is not a finite floating-point value",r));return n},e["unrestricted double"]=e=>+e,e.float=(e,r)=>{const n=+e;if(!Number.isFinite(n))throw new TypeError(t("is not a finite floating-point value",r));if(Object.is(n,-0))return n;const o=Math.fround(n);if(!Number.isFinite(o))throw new TypeError(t("is outside the range of a single-precision floating-point value",r));return o},e["unrestricted float"]=e=>{const t=+e;return isNaN(t)||Object.is(t,-0)?t:Math.fround(t)},e.DOMString=function(e,r){if(void 0===r&&(r={}),r.treatNullAsEmptyString&&null===e)return"";if("symbol"==typeof e)throw new TypeError(t("is a symbol, which cannot be converted to a string",r));return String(e)},e.ByteString=(r,n)=>{const o=e.DOMString(r,n);let i;for(let e=0;void 0!==(i=o.codePointAt(e));++e)if(i>255)throw new TypeError(t("is not a valid ByteString",n));return o},e.USVString=(t,r)=>{const n=e.DOMString(t,r),o=n.length,i=[];for(let e=0;e57343)i.push(String.fromCodePoint(t));else if(56320<=t&&t<=57343)i.push(String.fromCodePoint(65533));else if(e===o-1)i.push(String.fromCodePoint(65533));else{const r=n.charCodeAt(e+1);if(56320<=r&&r<=57343){const n=1023&t,o=1023&r;i.push(String.fromCodePoint(65536+1024*n+o)),++e}else i.push(String.fromCodePoint(65533))}}return i.join("")},e.object=(e,r)=>{if("Object"!==function(e){if(null===e)return"Null";switch(typeof e){case"undefined":return"Undefined";case"boolean":return"Boolean";case"number":return"Number";case"string":return"String";case"symbol":return"Symbol";case"object":case"function":default:return"Object"}}(e))throw new TypeError(t("is not an object",r));return e},[Error,ArrayBuffer,DataView,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Uint8ClampedArray,Float32Array,Float64Array].forEach((r=>{const n=r.name,o=/^[AEIOU]/.test(n)?"an":"a";e[n]=(e,i)=>{if(!(e instanceof r))throw new TypeError(t(`is not ${o} ${n} object`,i));return e}})),e.ArrayBufferView=(e,r)=>{if(!ArrayBuffer.isView(e))throw new TypeError(t("is not a view on an ArrayBuffer object",r));return e},e.BufferSource=(e,r)=>{if(!(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))throw new TypeError(t("is not an ArrayBuffer object or a view on one",r));return e},e.DOMTimeStamp=e["unsigned long long"],e.Function=a,e.VoidFunction=a}(Yt);var Zt={exports:{}};!function(e,t){function r(e){return Object.getPrototypeOf(e)===Buffer.prototype?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength)}const n=Symbol("wrapper"),o=Symbol("impl"),i=Symbol("SameObject caches");function a(e){return e?e[n]:null}function s(e){return e?e[o]:null}const u=Symbol("internal"),l=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));e.exports={isObject:function(e){return"object"==typeof e&&null!==e||"function"==typeof e},getReferenceToBytes:r,getCopyToBytes:function(e){return Buffer.from(r(e))},mixin:function(e,t){const r=Object.getOwnPropertyNames(t);for(let n=0;n{if(Error.captureStackTrace){const t=er.wrapperForImpl(e);Error.captureStackTrace(t,t.constructor)}},function(e){const t=Yt,r=Zt.exports,n=r.implSymbol;function o(){const e=[];for(let t=0;t0){const e=new Array(arguments.length);for(let t=0;t=0&&e.splice(r,1)},sr.arrayEqual=lr,sr.arrayCompact=function(e){const t=[];for(const r of e)null!=r&&t.push(r);return t},sr.arrayFlatten=function(e){const t=[];for(const r of e)for(const e of r)t.push(e);return t},sr.arrayUnique=function(e){return Array.from(new Set(e))},sr.arrayFindLastIndex=function(e,t,r){for(let n=e.length-1;n>=0;n--)if(t.call(r,e[n],n,e))return n;return-1},sr.findSubArrayIndex=function(e,t){return e.findIndex(((r,n)=>lr(e.slice(n,n+t.length),t)))},sr.arrayPartition=function(e,t){const r=[],n=[];return e.forEach((e=>t(e)?r.push(e):n.push(e))),[r,n]},sr.mapUnion=function(...e){const t=new Map;for(const r of e)for(const[e,n]of r)t.set(e,n);return t},sr.mapCompact=function(e){const t=new Map;for(const[r,n]of e)null!=n&&t.set(r,n);return t},sr.mapFilter=function(e,t){const r=new Map;for(const[n,o]of e)t(n,o)&&r.set(n,o);return r},sr.mapTransform=function(e,t){const r=new Map;for(const[n,o]of e)r.set(n,t(o,n));return r},sr.mapEqual=function(e,t,r){if(e.size!==t.size)return!1;const n=r||((e,t)=>e===t);for(const[r,o]of e)if(!t.has(r)||!n(o,t.get(r)))return!1;return!0},sr.mapGetWithDefault=function(e,t,r){return e.has(t)?e.get(t):r},sr.areSetsEqual=function(e,t){return e.size===t.size&&cr(e,(e=>t.has(e)))},sr.every=cr,sr.setIntersect=function(e,t){return fr(e,(e=>t.has(e)))},sr.setUnion=function(...e){if(e.length<1)return new Set;return e.reduce(((e,t)=>function(e,t){const r=new Set(e);return t.forEach((e=>{r.add(e)})),r}(e,t)))},sr.setDifference=function(e,t,r){if(0===e.size)return new Set;if(0===t.size)return new Set(e);const n=new Set,o=r||(e=>e),i=null==r?t:new Set(Array.from(t.values()).map(o));return e.forEach((e=>{i.has(o(e))||n.add(e)})),n},sr.setFilter=fr,sr.isEmpty=function(e){for(const t in e)return!1;return!0},sr.keyMirror=function(e){const t={};return Object.keys(e).forEach((e=>{t[e]=e})),t},sr.collect=function(e){const t=new Map;for(const r of e){const[e,n]=r;let o=t.get(e);null==o&&(o=[],t.set(e,o)),o.push(n)}return t},sr.objectFromPairs=function(e){const t={};for(const[r,n]of e)t[r]=n;return t},sr.objectMapValues=function(e,t){const r={};return Object.keys(e).forEach((n=>{r[n]=t(e[n],n)})),r},sr.objectValues=function(e){return Object.keys(e).map((t=>e[t]))},sr.objectEntries=pr,sr.objectFromMap=function(e){const t={};return e.forEach(((e,r)=>{t[r]=e})),t},sr.concatIterators=function*(...e){for(const t of e)for(const e of t)yield e},sr.someOfIterable=function(e,t){for(const r of e)if(t(r))return!0;return!1},sr.findInIterable=dr,sr.filterIterable=hr,sr.mapIterable=function*(e,t){for(const r of e)yield t(r)},sr.takeIterable=function*(e,t){let r=0;for(const n of e){if(++r>t)break;yield n}},sr.range=function*(e,t,r=1){(0,ur.default)(r>0);for(let n=e;n!0))},sr.iterableIsEmpty=mr,sr.iterableContains=function(e,t){return!mr(hr(e,(e=>e===t)))},sr.count=function(e){let t=0;for(const r of e)t++;return t},sr.isIterable=function(e){return"function"==typeof e[Symbol.iterator]},sr.insideOut=function*(e,t){if(0===e.length)return;let r=null==t?Math.floor(e.length/2):Math.min(e.length,Math.max(0,t)),n=r-1;for(;r=0;)r=0&&(yield[e[n],n],n--)},sr.mapFromObject=function(e){return new Map(pr(e))},sr.lastFromArray=function(e){return e[e.length-1]},sr.distinct=function(e,t){if(null==t)return Array.from(new Set(e));const r=new Set;return e.filter((e=>{const n=t(e);return!r.has(n)&&(r.add(n),!0)}))},sr.findTopRanked=function(e,t,r){let n,o=0;for(const i of e){const e=t(i);if(e===r)return i;e>0&&e>o&&(o=e,n=i)}return n},sr.DefaultWeakMap=sr.DefaultMap=sr.MultiMap=void 0;var ur=function(e){return e&&e.__esModule?e:{default:e}}(u.default);function lr(e,t,r){if(e===t)return!0;if(e.length!==t.length)return!1;const n=r||((e,t)=>e===t);return e.every(((e,r)=>n(e,t[r])))}function cr(e,t){for(const r of e)if(!t(r))return!1;return!0}function fr(e,t){const r=new Set;for(const n of e)t(n)&&r.add(n);return r}function pr(e){if(null==e)throw new TypeError;const t=[];for(const r in e)e.hasOwnProperty(r)&&Object.prototype.propertyIsEnumerable.call(e,r)&&t.push([r,e[r]]);return t}function dr(e,t){for(const r of e)if(t(r))return r;return null}function*hr(e,t){for(const r of e)t(r)&&(yield r)}function mr(e){for(const t of e)return!1;return!0}sr.MultiMap=class{constructor(){this._map=void 0,this.size=void 0,this._map=new Map,this.size=0}get(e){const t=this._map.get(e);return null==t?new Set:t}add(e,t){let r=this._map.get(e);return null==r&&(r=new Set,this._map.set(e,r)),r.has(t)||(r.add(t),this.size++),this}set(e,t){this.deleteAll(e);const r=new Set(t);0!==r.size&&(this._map.set(e,r),this.size+=r.size)}delete(e,t){const r=this.get(e),n=r.delete(t);return 0===r.size&&this._map.delete(e),n&&this.size--,n}deleteAll(e){const t=this.get(e);return this.size-=t.size,this._map.delete(e)}clear(){this._map.clear(),this.size=0}has(e,t){return this.get(e).has(t)}hasAny(e){return this._map.has(e)}*values(){for(const e of this._map.values())yield*e}forEach(e){this._map.forEach(((t,r)=>t.forEach((t=>e(t,r,this)))))}};class gr extends Map{constructor(e,t){super(t),this._factory=void 0,this._factory=e}get(e){if(!this.has(e)){const t=this._factory(e);return this.set(e,t),t}return super.get(e)}}sr.DefaultMap=gr;class br extends WeakMap{constructor(e,t){super(t),this._factory=void 0,this._factory=e}get(e){if(!this.has(e)){const t=this._factory(e);return this.set(e,t),t}return super.get(e)}}sr.DefaultWeakMap=br;var yr={};Object.defineProperty(yr,"__esModule",{value:!0}),yr.default=function(e,t,r=!1){let n,o,i,a,s=0;const u=function(){const l=Date.now()-s;l=0?n=setTimeout(u,t-l):(n=null,r||((0,vr.default)(null!=o),a=e.apply(i,o),n||(i=o=null)))},l=function(...l){i=this,o=l,s=Date.now();const c=r&&!n;return n||(n=setTimeout(u,t)),c&&(a=e.apply(i,o),i=o=null),a};return l.dispose=()=>{n&&(clearTimeout(n),n=i=o=null)},l};var vr=function(e){return e&&e.__esModule?e:{default:e}}(u.default);Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.splitStream=function(e,t=!0){return Pr.Observable.create((r=>{let n="";function o(){""!==n&&(r.next(n),n="")}return e.subscribe((e=>{const o=e.split("\n");o[0]=n+o[0],n=o.pop(),t?o.forEach((e=>r.next(e+"\n"))):o.forEach((e=>r.next(e)))}),(e=>{o(),r.error(e)}),(()=>{o(),r.complete()}))}))},Gt.bufferUntil=function(e){return t=>Pr.Observable.create((r=>{let n=null;const o=()=>{null!=n&&(r.next(n),n=null)};return t.subscribe((t=>{null==n&&(n=[]),n.push(t),e(t,n)&&o()}),(e=>{o(),r.error(e)}),(()=>{o(),r.complete()}))}))},Gt.cacheWhileSubscribed=function(e){return e.multicast((()=>new Pr.ReplaySubject(1))).refCount()},Gt.diffSets=Ar,Gt.reconcileSetDiffs=jr,Gt.reconcileSets=function(e,t,r){return jr(e.let(Ar(r)),t,r)},Gt.toggle=function(e){return t=>e.distinctUntilChanged().switchMap((e=>e?t:Pr.Observable.empty()))},Gt.compact=function(e){return e.filter((e=>null!=e))},Gt.takeWhileInclusive=function(e){return t=>Pr.Observable.create((r=>t.subscribe((t=>{r.next(t),e(t)||r.complete()}),(e=>{r.error(e)}),(()=>{r.complete()}))))},Gt.concatLatest=function(...e){const t=e.map(((e,t)=>e.map((e=>[e,t]))));return Pr.Observable.merge(...t).scan(((e,[t,r])=>(e[r]=t,e)),e.map((e=>[]))).map((e=>[].concat(...e)))},Gt.throttle=function(e,t={leading:!0}){let r;switch(typeof e){case"number":r=()=>Pr.Observable.timer(e);break;case"function":r=e;break;case"object":r=()=>e;break;default:throw new Error(`Invalid delay: ${e}`)}return function(e){return Pr.Observable.create((n=>{const{leading:o=!0}=t,i=new Pr.Subject;let a=Mr,s=!1,u=!1;const l=()=>{if(!u&&a!==Mr){a=a;const e=a;u=!0,!o&&s||(a=Mr,n.next(e)),i.next(e)}},c=new Pr.Subscription;return c.add(i.switchMap((e=>{const t=r(e);return t instanceof Pr.Observable?t.take(1):t})).subscribe((()=>{u=!1,s=!1,l()}))),c.add(e.subscribe({next:e=>{a=e,s=!0,l()},error:e=>{n.error(e)},complete:()=>{a=Mr,n.complete()}})),c}))}};var _r=Gt.completingSwitchMap=function(e){const t=Symbol("completed");return r=>Pr.Observable.concat(r,Pr.Observable.of(t)).switchMap(((r,n)=>r===t?Pr.Observable.empty():e(r,n)))};Gt.mergeUntilAnyComplete=function(...e){return Pr.Observable.merge(...e.map((e=>e.materialize()))).dematerialize()},Gt.fastDebounce=function(e){return t=>Pr.Observable.create((r=>{const n=(0,Sr.default)((e=>r.next(e)),e),o=t.subscribe(n,r.error.bind(r),r.complete.bind(r));return new wr.default(o,n)}))},Gt.fromAbortablePromise=function(e){return Pr.Observable.create((t=>{let r=!1;const n=new Tr.default;return e(n.signal).then((e=>{r=!0,t.next(e),t.complete()}),(e=>{r=!0,t.error(e)})),()=>{r||n.abort()}}))},Gt.toAbortablePromise=Nr,Gt.takeUntilAbort=function(e){return t=>Pr.Observable.defer((()=>e.aborted?Pr.Observable.empty():t.takeUntil(Pr.Observable.fromEvent(e,"abort"))))},Gt.poll=function(e){return t=>Pr.Observable.defer((()=>{const r=new Pr.Subject;return r.switchMap((e=>Pr.Observable.timer(e))).merge(Pr.Observable.of(null)).switchMap((()=>{const n=Date.now();return t.do({complete:()=>{const t=Date.now()-n;r.next(Math.max(0,e-t))}})}))}))},Gt.SingletonExecutor=Gt.nextAnimationFrame=Gt.macrotask=kr=Gt.microtask=void 0;var wr=Rr(y),Er=Rr(u.default),Or=Rr(Kt.exports),Pr=s.default,Tr=Rr(tr),xr=sr,Sr=Rr(yr);function Rr(e){return e&&e.__esModule?e:{default:e}}function Ar(e){return t=>Pr.Observable.concat(Pr.Observable.of(new Set),t).pairwise().map((([t,r])=>({added:(0,xr.setDifference)(r,t,e),removed:(0,xr.setDifference)(t,r,e)}))).filter((e=>e.added.size>0||e.removed.size>0))}function jr(e,t,r){const n=r||(e=>e),o=new Map,i=e=>{const t=o.get(n(e));(0,Er.default)(null!=t),t.dispose(),o.delete(e)};return new wr.default(e.subscribe((e=>{e.added.forEach((e=>{o.set(n(e),t(e))})),e.removed.forEach(i)})),(()=>{o.forEach((e=>{e.dispose()})),o.clear()}))}const Mr={};const Ir=Pr.Observable.create((e=>{process.nextTick((()=>{e.next(),e.complete()}))}));var kr=Gt.microtask=Ir;const Cr=Pr.Observable.create((e=>{const t=setImmediate((()=>{e.next(),e.complete()}));return()=>{clearImmediate(t)}}));Gt.macrotask=Cr;const Dr=Pr.Observable.create((e=>{if("undefined"==typeof requestAnimationFrame)throw new Error("This util can only be used in Atom");const t=requestAnimationFrame((()=>{e.next(),e.complete()}));return()=>{cancelAnimationFrame(t)}}));function Nr(e,t){return null==t?e.toPromise():t.aborted?Promise.reject((0,Or.default)("Aborted","AbortError")):e.race(Pr.Observable.fromEvent(t,"abort").map((()=>{throw new Or.default("Aborted","AbortError")}))).toPromise()}Gt.nextAnimationFrame=Dr;Gt.SingletonExecutor=class{constructor(){this._abortController=null}async execute(e){this.cancel();const t=new Tr.default;this._abortController=t;try{return await Nr(e,t.signal)}finally{t===this._abortController&&(this._abortController=null)}}isExecuting(){return null!=this._abortController}cancel(){null!=this._abortController&&(this._abortController.abort(),this._abortController=null)}};class Ur{constructor(){this._subscriptions=new v(this._subscribeToEvents(),Te(this._onWillSaveProvider())),this._rangeProviders=new X,this._fileProviders=new X,this._onTypeProviders=new X,this._onSaveProviders=new X}_subscribeToEvents(){const t=ee((e=>atom.commands.add("atom-text-editor","code-format:format-code",e))).switchMap((()=>{const t=atom.workspace.getActiveTextEditor();return t?e.Observable.of({type:"command",editor:t}):e.Observable.empty()})),r=ee((e=>atom.workspace.observeTextEditors(e))).mergeMap((t=>function(t){const r=ee((e=>t.getBuffer().onDidChangeText(e))),n=ee((e=>atom.workspace.onWillDestroyPaneItem(e))).filter((e=>e.item===t));return e.Observable.merge(r.map((e=>({type:"type",editor:t,edit:e})))).takeUntil(e.Observable.merge(ne(t),n))}(t)));return e.Observable.merge(t,r).groupBy((e=>e.editor.getBuffer()),(e=>e),(e=>ee((t=>e.key.onDidDestroy(t))))).mergeMap((e=>e.let(_r((e=>this._handleEvent(e)))))).subscribe()}_handleEvent(t){const{editor:n}=t;switch(t.type){case"command":return this._formatCodeInTextEditor(n).do((e=>{ge(n.getBuffer(),e)})).map((e=>{if(!e)throw new Error("No code formatting providers found!")})).catch((t=>(atom.notifications.addError(`Failed to format code: ${t.message}`,{detail:t.detail}),e.Observable.empty())));case"type":return this._formatCodeOnTypeInTextEditor(n,t.edit).catch((t=>(r.getLogger("code-format").warn("Failed to format code on type:",t),e.Observable.empty())));default:return e.Observable.throw(`unknown event type ${t.type}`)}}_formatCodeInTextEditor(t,r){return e.Observable.defer((()=>{const o=t.getBuffer(),i=r||t.getSelectedBufferRange(),{start:a,end:s}=i;let u;u=i.isEmpty()?o.getRange():new n.Range([a.row,0],0===s.column?s:[s.row+1,0]);const l=[...this._rangeProviders.getAllProvidersForEditor(t)],c=[...this._fileProviders.getAllProvidersForEditor(t)],f=t.getText(),p=e.Observable.defer((()=>this._reportBusy(t,Promise.all(l.map((e=>e.formatCode(t,u))))))).switchMap((t=>{const r=t.find((e=>e.length>0));return null==r?e.Observable.empty():e.Observable.of(r)})),d=e.Observable.defer((()=>this._reportBusy(t,Promise.all(c.map((e=>e.formatEntireFile(t,u))))))).switchMap((t=>{const r=t.find((e=>null!=e));return null==r?e.Observable.empty():e.Observable.of(r)})).map((({formatted:e})=>[{oldRange:t.getBuffer().getRange(),newText:e,oldText:f}]));return(u.isEqual(o.getRange())?d.concat(p):p.concat(d)).first(Boolean,[])}))}_formatCodeOnTypeInTextEditor(t,r){return e.Observable.defer((()=>{if(1!==r.changes.length)return e.Observable.empty();const n=r.changes[0];if(!function(e){if(""!==e.oldText)return!1;if(""===e.oldText&&""===e.newText)return!1;if(e.newText.length>1&&!function(e){if(null==atom.packages.getActivePackage("bracket-matcher"))return!1;return atom.config.get("bracket-matcher.autocompleteCharacters").includes(e)}(e.newText))return!1;return!0}(n)||!Ue.getWithDefaults("atom-ide-code-format.formatOnType",!1))return e.Observable.empty();const o=n.newText[n.newText.length-1],i=[...this._onTypeProviders.getAllProvidersForEditor(t)];if(0===i.length)return e.Observable.empty();const a=t.getText(),s=t.getCursorBufferPosition().copy();return kr.switchMap((()=>Promise.all(i.map((e=>e.formatAtPosition(t,t.getCursorBufferPosition(),o)))))).switchMap((t=>{const r=t.findIndex((e=>e.length>0));return-1===r?e.Observable.empty():e.Observable.of({edits:h(t[r]),provider:i[r]})})).do((({edits:e,provider:r})=>{if(0!==e.length){if(function(e,t){if(e!==t)throw new Error("The file contents were changed before formatting was complete.")}(a,t.getText()),!ge(t.getBuffer(),e))throw new Error("Could not apply edits to text buffer.");r.keepCursorPosition&&t.setCursorBufferPosition(s)}})).map((({edits:e})=>e))}))}_onWillSaveProvider(){return{priority:0,timeout:2500,callback:this._formatCodeOnSaveInTextEditor.bind(this)}}_formatCodeOnSaveInTextEditor(t){const r=[...this._onSaveProviders.getAllProvidersForEditor(t)];return r.length>0?e.Observable.defer((()=>this._reportBusy(t,Promise.all(r.map((e=>e.formatOnSave(t)))),!1))).switchMap((t=>{const r=t.find((e=>e.length>0));return null==r?e.Observable.empty():e.Observable.of(r)})).flatMap((t=>e.Observable.of(...t))):function(e){const t=Ue.get("atom-ide-code-format.formatOnSave",{scope:e.getRootScopeDescriptor()});return null!=t&&t}(t)?this._formatCodeInTextEditor(t,t.getBuffer().getRange()).flatMap((t=>e.Observable.of(...t))):e.Observable.empty()}_reportBusy(e,t,r=!0){const n=this._busySignalService;if(null!=n){const o=e.getPath(),i=null!=o?Vt.basename(o):"";return n.reportBusyWhile(`Formatting code in ${i}`,(()=>t),{revealTooltip:r})}return t}addRangeProvider(e){return this._rangeProviders.addProvider(e)}addFileProvider(e){return this._fileProviders.addProvider(e)}addOnTypeProvider(e){return this._onTypeProviders.addProvider(e)}addOnSaveProvider(e){return this._onSaveProviders.addProvider(e)}consumeBusySignal(e){return this._busySignalService=e,new v((()=>{this._busySignalService=null}))}dispose(){this._subscriptions.dispose()}}var Fr={formatOnSave:{title:"Format on Save",type:"boolean",default:!1,description:"Automatically format code upon saving for supported languages."},formatOnType:{title:"Format on Type",type:"boolean",default:!0,description:"Automatically format code as you type it for supported languages."}};let Lr;function Br(e){return Lr.addRangeProvider(e)}function $r(e){return Lr.addFileProvider(e)}function Wr(e){return Lr.addOnTypeProvider(e)}function qr(e){return Lr.addOnSaveProvider(e)}exports.activate=function(){Lr=new Ur},exports.config=Fr,exports.consumeBusySignal=function(e){return Lr.consumeBusySignal(e)},exports.consumeFileProvider=$r,exports.consumeLegacyProvider=function(e){if(e.grammarScopes=e.grammarScopes||(null!=e.selector?e.selector.split(", "):null),e.priority=null!=e.priority?e.priority:null!=e.inclusionPriority?e.inclusionPriority:0,"formatCode"in e)return Br(e);if("formatEntireFile"in e)return $r(e);if("formatAtPosition"in e)return Wr(e);if("formatOnSave"in e)return qr(e);throw new Error("Invalid code format provider")},exports.consumeOnSaveProvider=qr,exports.consumeOnTypeProvider=Wr,exports.consumeRangeProvider=Br,exports.deactivate=function(){Lr.dispose()}; +//# sourceMappingURL=main.js.map diff --git a/dist/main.js.map b/dist/main.js.map new file mode 100644 index 0000000..f317194 --- /dev/null +++ b/dist/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sources":["../node_modules/nullthrows/nullthrows.js","../node_modules/nuclide/nuclide-commons/getDisplayName.js","../node_modules/nuclide/nuclide-commons/UniversalDisposable.js","../node_modules/nuclide/nuclide-commons/promise.js","../node_modules/nuclide/nuclide-commons/performanceNow.js","../node_modules/nuclide/nuclide-commons/analytics.js","../node_modules/nuclide/nuclide-commons-atom/ProviderRegistry.js","../node_modules/nuclide/nuclide-commons/event.js","../node_modules/nuclide/nuclide-commons-atom/text-editor.js","../node_modules/nuclide/nuclide-commons-atom/go-to-location.js","../node_modules/nuclide/nuclide-commons-atom/text-edit.js","../node_modules/nuclide/nuclide-commons-atom/FileEventHandlers.js","../node_modules/nuclide/nuclide-commons-atom/ConfigManager.js","../node_modules/nuclide/nuclide-commons-atom/feature-config.js","../node_modules/vscode-uri/lib/index.js","../node_modules/nuclide/nuclide-commons/_shell-quote.js","../node_modules/nuclide/nuclide-commons/string.js","../node_modules/nuclide/nuclide-commons/nuclideUri.js","../node_modules/webidl-conversions/lib/index.js","../node_modules/domexception/lib/utils.js","../node_modules/domexception/lib/DOMException-impl.js","../node_modules/domexception/lib/DOMException.js","../node_modules/domexception/lib/public-api.js","../node_modules/event-target-shim/src/event.mjs","../node_modules/event-target-shim/src/event-target.mjs","../node_modules/nuclide/nuclide-commons/AbortController.js","../node_modules/nuclide/nuclide-commons/collection.js","../node_modules/nuclide/nuclide-commons/debounce.js","../node_modules/nuclide/nuclide-commons/observable.js","../../src/CodeFormatManager.ts","../../src/config.ts","../../src/main.ts","../../src/legacy-provider.ts"],"sourcesContent":["'use strict';\n\nObject.defineProperty(exports, '__esModule', {value: true});\n\nexports.default = function nullthrows(x) {\n if (x != null) {\n return x;\n }\n throw new Error('Got unexpected null or undefined');\n};\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nexport default function getDisplayName(\r\n functionOrClass: Function | Class<*>,\r\n): string {\r\n if (\r\n typeof functionOrClass.displayName === 'string' &&\r\n functionOrClass.displayName !== ''\r\n ) {\r\n return functionOrClass.displayName;\r\n } else if (\r\n typeof functionOrClass.name === 'string' &&\r\n functionOrClass.name !== ''\r\n ) {\r\n return functionOrClass.name;\r\n }\r\n\r\n return 'Unknown';\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nexport type IDestructible = {\r\n destroy(): void,\r\n onDidDestroy(callback: () => mixed): IDisposable,\r\n};\r\n\r\nexport type AnyTeardown =\r\n | (() => mixed)\r\n | rxjs$ISubscription\r\n | IDisposable\r\n | IDestructible;\r\n\r\n/**\r\n * Like a CompositeDisposable, but in addition to Disposable instances it can\r\n * also accept plain functions and Rx subscriptions.\r\n */\r\nexport default class UniversalDisposable {\r\n disposed: boolean;\r\n teardowns: Set;\r\n\r\n constructor(...teardowns: Array) {\r\n this.teardowns = new Set();\r\n this.disposed = false;\r\n if (teardowns.length) {\r\n this.add(...teardowns);\r\n }\r\n }\r\n\r\n add(...teardowns: Array): void {\r\n if (this.disposed) {\r\n throw new Error('Cannot add to an already disposed UniversalDisposable!');\r\n }\r\n for (let i = 0; i < teardowns.length; i++) {\r\n assertTeardown(teardowns[i]);\r\n this.teardowns.add(teardowns[i]);\r\n }\r\n }\r\n\r\n /**\r\n * Adds a list of teardowns but also ties them to the lifetime of `destructible`.\r\n * When `destructible` is destroyed (or `this.dispose()` gets called, whichever comes first),\r\n * all `teardowns` provided are also disposed.\r\n *\r\n * This is a subtle pattern to get right because of two factors:\r\n * - we need to make sure that all teardowns are also removed on destroy\r\n * - we also need to ensure that we don't leak the onDidDestroy disposable\r\n */\r\n addUntilDestroyed(\r\n destructible: IDestructible,\r\n ...teardowns: Array\r\n ) {\r\n if (this.disposed) {\r\n throw new Error('Cannot add to an already disposed UniversalDisposable!');\r\n }\r\n const destroyDisposable = new UniversalDisposable(\r\n ...teardowns,\r\n destructible.onDidDestroy(() => {\r\n destroyDisposable.dispose();\r\n this.remove(destroyDisposable);\r\n }),\r\n );\r\n this.add(destroyDisposable);\r\n }\r\n\r\n remove(teardown: AnyTeardown): void {\r\n if (!this.disposed) {\r\n this.teardowns.delete(teardown);\r\n }\r\n }\r\n\r\n dispose(): void {\r\n if (!this.disposed) {\r\n this.disposed = true;\r\n this.teardowns.forEach(teardown => {\r\n if (typeof teardown.dispose === 'function') {\r\n teardown.dispose();\r\n } else if (typeof teardown.unsubscribe === 'function') {\r\n teardown.unsubscribe();\r\n } else if (typeof teardown.destroy === 'function') {\r\n teardown.destroy();\r\n } else if (typeof teardown === 'function') {\r\n teardown();\r\n }\r\n });\r\n this.teardowns = (null: any);\r\n }\r\n }\r\n\r\n unsubscribe(): void {\r\n this.dispose();\r\n }\r\n\r\n clear(): void {\r\n if (!this.disposed) {\r\n this.teardowns.clear();\r\n }\r\n }\r\n}\r\n\r\nfunction assertTeardown(teardown: AnyTeardown): void {\r\n if (\r\n typeof teardown.dispose === 'function' ||\r\n typeof teardown.unsubscribe === 'function' ||\r\n typeof teardown.destroy === 'function' ||\r\n typeof teardown === 'function'\r\n ) {\r\n return;\r\n }\r\n throw new TypeError(\r\n 'Arguments to UniversalDisposable.add must be disposable',\r\n );\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport invariant from 'assert';\r\n\r\ntype RunReturn =\r\n | {\r\n status: 'success',\r\n result: T,\r\n }\r\n | {\r\n status: 'outdated',\r\n };\r\n\r\n/**\r\n * Allows a caller to ensure that the results it receives from consecutive\r\n * promise resolutions are never outdated. Usage:\r\n *\r\n * var requestSerializer = new RequestSerializer();\r\n *\r\n * // in some later loop:\r\n *\r\n * // note that you do not await the async function here -- you must pass the\r\n * // promise it returns to `run`\r\n * var result = await requestSerializer.run(someAsyncFunction())\r\n *\r\n * if (result.status === 'success') {\r\n * ....\r\n * result.result\r\n * } else if (result.status === 'outdated') {\r\n * ....\r\n * }\r\n *\r\n * The contract is that the status is 'success' if and only if this was the most\r\n * recently dispatched call of 'run'. For example, if you call run(promise1) and\r\n * then run(promise2), and promise2 resolves first, the second callsite would\r\n * receive a 'success' status. If promise1 later resolved, the first callsite\r\n * would receive an 'outdated' status.\r\n */\r\nexport class RequestSerializer {\r\n _lastDispatchedOp: number;\r\n _lastFinishedOp: number;\r\n _latestPromise: Promise;\r\n _waitResolve: Function;\r\n\r\n constructor() {\r\n this._lastDispatchedOp = 0;\r\n this._lastFinishedOp = 0;\r\n this._latestPromise = new Promise((resolve, reject) => {\r\n this._waitResolve = resolve;\r\n });\r\n }\r\n\r\n async run(promise: Promise): Promise> {\r\n const thisOp = this._lastDispatchedOp + 1;\r\n this._lastDispatchedOp = thisOp;\r\n this._latestPromise = promise;\r\n this._waitResolve();\r\n const result = await promise;\r\n if (this._lastFinishedOp < thisOp) {\r\n this._lastFinishedOp = thisOp;\r\n return {\r\n status: 'success',\r\n result,\r\n };\r\n } else {\r\n return {\r\n status: 'outdated',\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Returns a Promise that resolves to the last result of `run`,\r\n * as soon as there are no more outstanding `run` calls.\r\n */\r\n async waitForLatestResult(): Promise {\r\n let lastPromise = null;\r\n let result: any = null;\r\n while (lastPromise !== this._latestPromise) {\r\n lastPromise = this._latestPromise;\r\n // Wait for the current last know promise to resolve, or a next run have started.\r\n // eslint-disable-next-line no-await-in-loop\r\n result = await new Promise((resolve, reject) => {\r\n this._waitResolve = resolve;\r\n this._latestPromise.then(resolve);\r\n });\r\n }\r\n return (result: T);\r\n }\r\n\r\n isRunInProgress(): boolean {\r\n return this._lastDispatchedOp > this._lastFinishedOp;\r\n }\r\n}\r\n\r\n/*\r\n * Returns a promise that will resolve after `milliSeconds` milli seconds.\r\n * this can be used to pause execution asynchronously.\r\n * e.g. await sleep(1000), pauses the async flow execution for 1 second.\r\n */\r\nexport function sleep(milliSeconds: number): Promise {\r\n return new Promise(resolve => {\r\n setTimeout(resolve, milliSeconds);\r\n });\r\n}\r\n\r\nexport function nextTick(): Promise {\r\n return new Promise(resolve => {\r\n process.nextTick(resolve);\r\n });\r\n}\r\n\r\n/**\r\n * Executes a provided callback only if a promise takes longer than\r\n * `milliSeconds` milliseconds to resolve.\r\n *\r\n * @param `promise` the promise to wait on.\r\n * @param `milliSeconds` max amount of time that `promise` can take to resolve\r\n * before timeoutFn is fired.\r\n * @param `timeoutFn` the function to execute when a promise takes longer than\r\n * `milliSeconds` ms to resolve.\r\n * @param `cleanupFn` the cleanup function to execute after the promise resolves.\r\n */\r\nexport async function triggerAfterWait(\r\n promise: Promise,\r\n milliSeconds: number,\r\n timeoutFn: () => void,\r\n cleanupFn?: () => void,\r\n): Promise {\r\n const timeout = setTimeout(timeoutFn, milliSeconds);\r\n try {\r\n return await promise;\r\n } finally {\r\n clearTimeout(timeout);\r\n if (cleanupFn) {\r\n cleanupFn();\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Thrown by `timeoutPromise` if the timer fires before the promise resolves/rejects.\r\n */\r\nexport class TimedOutError extends Error {\r\n timeout: number;\r\n constructor(milliseconds: number) {\r\n super(`Timed out after ${String(milliseconds)} ms`);\r\n this.timeout = milliseconds;\r\n }\r\n}\r\n\r\n/**\r\n * Returns a Promise that resolves to the same value as the given promise, or rejects with\r\n * `TimedOutError` if it takes longer than `milliseconds` milliseconds.\r\n */\r\nexport function timeoutPromise(\r\n promise: Promise,\r\n milliseconds: number,\r\n): Promise {\r\n return new Promise((resolve, reject) => {\r\n let timeout = setTimeout(() => {\r\n timeout = null;\r\n reject(new TimedOutError(milliseconds));\r\n // This gives useless error.stack results.\r\n // We could capture the stack pre-emptively at the start\r\n // of this method if we wanted useful ones.\r\n }, milliseconds);\r\n promise\r\n .then(value => {\r\n if (timeout != null) {\r\n clearTimeout(timeout);\r\n }\r\n resolve(value);\r\n })\r\n .catch(value => {\r\n if (timeout != null) {\r\n clearTimeout(timeout);\r\n }\r\n reject(value);\r\n });\r\n });\r\n}\r\n\r\n// An DeadlineRequest parameter to an async method is a way of *requesting* that\r\n// method to throw a TimedOutError if it doesn't complete in a certain time.\r\n// It's just a request -- the async method will typically honor the request\r\n// by passing the parameter on to ALL subsidiary async methods that it awaits,\r\n// or by calling expirePromise to enforce a timeout, or similar.\r\n//\r\n// In cases where a method supports DeadlineRequest but you don't trust it, do\r\n// `await timeoutAfterDeadline(deadline, untrusted.foo(deadline-1000))` so you\r\n// ask it nicely but if it doesn't give its own more-specific deadline message\r\n// within a 1000ms grace period then you force matters.\r\n//\r\n// Under the hood an DeadlineRequest is just a timestamp of the time by which\r\n// the operation should complete. This makes it compositional (better than\r\n// \"delay\" parameters) and safely remotable (better than \"CancellationToken\"\r\n// parameters) so long as clocks are in sync. In all other respects it's less\r\n// versatile than CancellationTokens.\r\nexport type DeadlineRequest = number;\r\n\r\nexport function createDeadline(delay: number): DeadlineRequest {\r\n return Date.now() + delay;\r\n}\r\n\r\nexport function timeoutAfterDeadline(\r\n deadline: DeadlineRequest,\r\n promise: Promise,\r\n): Promise {\r\n const delay = deadline - Date.now();\r\n return timeoutPromise(promise, delay < 0 ? 0 : delay);\r\n}\r\n\r\n/**\r\n * Call an async function repeatedly with a maximum number of trials limit,\r\n * until a valid result that's defined by a validation function.\r\n * A failed call can result from an async thrown exception, or invalid result.\r\n *\r\n * @param `retryFunction` the async logic that's wanted to be retried.\r\n * @param `validationFunction` the validation function that decides whether a response is valid.\r\n * @param `maximumTries` the number of times the `retryFunction` can fail to get a valid\r\n * response before the `retryLimit` is terminated reporting an error.\r\n * @param `retryIntervalMs` optional, the number of milliseconds to wait between trials, if wanted.\r\n *\r\n * If an exception is encountered on the last trial, the exception is thrown.\r\n * If no valid response is found, an exception is thrown.\r\n */\r\nexport async function retryLimit(\r\n retryFunction: () => Promise,\r\n validationFunction: (result: T) => boolean,\r\n maximumTries: number,\r\n retryIntervalMs?: number = 0,\r\n): Promise {\r\n let result = null;\r\n let tries = 0;\r\n let lastError = null;\r\n while (tries === 0 || tries < maximumTries) {\r\n try {\r\n // eslint-disable-next-line no-await-in-loop\r\n result = await retryFunction();\r\n lastError = null;\r\n if (validationFunction(result)) {\r\n return result;\r\n }\r\n } catch (error) {\r\n lastError = error;\r\n result = null;\r\n }\r\n\r\n if (++tries < maximumTries && retryIntervalMs !== 0) {\r\n // eslint-disable-next-line no-await-in-loop\r\n await sleep(retryIntervalMs);\r\n }\r\n }\r\n if (lastError != null) {\r\n throw lastError;\r\n } else if (tries === maximumTries) {\r\n throw new Error('No valid response found!');\r\n } else {\r\n return ((result: any): T);\r\n }\r\n}\r\n\r\n/**\r\n * Limits async function execution parallelism to only one at a time.\r\n * Hence, if a call is already running, it will wait for it to finish,\r\n * then start the next async execution, but if called again while not finished,\r\n * it will return the scheduled execution promise.\r\n *\r\n * Sample Usage:\r\n * ```\r\n * let i = 1;\r\n * const oneExecAtATime = oneParallelAsyncCall(() => {\r\n * return next Promise((resolve, reject) => {\r\n * setTimeout(200, () => resolve(i++));\r\n * });\r\n * });\r\n *\r\n * const result1Promise = oneExecAtATime(); // Start an async, and resolve to 1 in 200 ms.\r\n * const result2Promise = oneExecAtATime(); // Schedule the next async, and resolve to 2 in 400 ms.\r\n * const result3Promise = oneExecAtATime(); // Reuse scheduled promise and resolve to 2 in 400 ms.\r\n * ```\r\n */\r\nexport function serializeAsyncCall(\r\n asyncFun: () => Promise,\r\n): () => Promise {\r\n let scheduledCall = null;\r\n let pendingCall = null;\r\n const startAsyncCall = () => {\r\n const resultPromise = asyncFun();\r\n pendingCall = resultPromise.then(\r\n () => (pendingCall = null),\r\n () => (pendingCall = null),\r\n );\r\n return resultPromise;\r\n };\r\n const callNext = () => {\r\n scheduledCall = null;\r\n return startAsyncCall();\r\n };\r\n const scheduleNextCall = () => {\r\n if (scheduledCall == null) {\r\n invariant(pendingCall, 'pendingCall must not be null!');\r\n scheduledCall = pendingCall.then(callNext, callNext);\r\n }\r\n return scheduledCall;\r\n };\r\n return () => {\r\n if (pendingCall == null) {\r\n return startAsyncCall();\r\n } else {\r\n return scheduleNextCall();\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Provides a promise along with methods to change its state. Our version of the non-standard\r\n * `Promise.defer()`.\r\n *\r\n * IMPORTANT: This should almost never be used!! Instead, use the Promise constructor. See\r\n * \r\n */\r\nexport class Deferred {\r\n promise: Promise;\r\n resolve: (value: T) => void;\r\n reject: (error: Error) => void;\r\n\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve;\r\n this.reject = reject;\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Returns a value derived asynchronously from an element in the items array.\r\n * The test function is applied sequentially to each element in items until\r\n * one returns a Promise that resolves to a non-null value. When this happens,\r\n * the Promise returned by this method will resolve to that non-null value. If\r\n * no such Promise is produced, then the Promise returned by this function\r\n * will resolve to null.\r\n *\r\n * @param items Array of elements that will be passed to test, one at a time.\r\n * @param test Will be called with each item and must return either:\r\n * (1) A \"thenable\" (i.e, a Promise or promise-like object) that resolves\r\n * to a derived value (that will be returned) or null.\r\n * (2) null.\r\n * In both cases where null is returned, test will be applied to the next\r\n * item in the array.\r\n * @param thisArg Receiver that will be used when test is called.\r\n * @return Promise that resolves to an asynchronously derived value or null.\r\n */\r\nexport function asyncFind(\r\n items_: Array,\r\n test: (t: T) => ?Promise,\r\n thisArg?: mixed,\r\n): Promise {\r\n let items = items_;\r\n return new Promise((resolve, reject) => {\r\n // Create a local copy of items to defend against the caller modifying the\r\n // array before this Promise is resolved.\r\n items = items.slice();\r\n const numItems = items.length;\r\n\r\n const next = async function(index) {\r\n if (index === numItems) {\r\n resolve(null);\r\n return;\r\n }\r\n\r\n const item = items[index];\r\n const result = await test.call(thisArg, item);\r\n if (result != null) {\r\n resolve(result);\r\n } else {\r\n next(index + 1);\r\n }\r\n };\r\n\r\n next(0);\r\n });\r\n}\r\n\r\nexport function denodeify(\r\n f: (...args: Array) => any,\r\n): (...args: Array) => Promise {\r\n return function(...args: Array) {\r\n return new Promise((resolve, reject) => {\r\n function callback(error, result) {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve(result);\r\n }\r\n }\r\n f.apply(this, args.concat([callback]));\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * A Promise utility that runs a maximum of limit async operations at a time\r\n * iterating over an array and returning the result of executions.\r\n * e.g. to limit the number of file reads to 5,\r\n * replace the code:\r\n * var fileContents = await Promise.all(filePaths.map(fsPromise.readFile))\r\n * with:\r\n * var fileContents = await asyncLimit(filePaths, 5, fsPromise.readFile)\r\n *\r\n * This is particulrily useful to limit IO operations to a configurable maximum (to avoid\r\n * blocking), while enjoying the configured level of parallelism.\r\n *\r\n * @param array the array of items for iteration.\r\n * @param limit the configurable number of parallel async operations.\r\n * @param mappingFunction the async Promise function that could return a useful result.\r\n */\r\nexport function asyncLimit(\r\n array: Array,\r\n limit: number,\r\n mappingFunction: (item: T) => Promise,\r\n): Promise> {\r\n const result: Array = new Array(array.length);\r\n let parallelPromises = 0;\r\n let index = 0;\r\n\r\n let parallelLimit = Math.min(limit, array.length) || 1;\r\n\r\n return new Promise((resolve, reject) => {\r\n const runPromise = async () => {\r\n if (index === array.length) {\r\n if (parallelPromises === 0) {\r\n resolve(result);\r\n }\r\n return;\r\n }\r\n ++parallelPromises;\r\n const i = index++;\r\n try {\r\n result[i] = await mappingFunction(array[i]);\r\n } catch (e) {\r\n reject(e);\r\n }\r\n --parallelPromises;\r\n runPromise();\r\n };\r\n\r\n while (parallelLimit--) {\r\n runPromise();\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * `filter` Promise utility that allows filtering an array with an async Promise function.\r\n * It's an alternative to `Array.prototype.filter` that accepts an async function.\r\n * You can optionally configure a limit to set the maximum number of async operations at a time.\r\n *\r\n * Previously, with the `Promise.all` primitive, we can't set the parallelism limit and we have to\r\n * `filter`, so, we replace the old `filter` code:\r\n * var existingFilePaths = [];\r\n * await Promise.all(filePaths.map(async (filePath) => {\r\n * if (await fsPromise.exists(filePath)) {\r\n * existingFilePaths.push(filePath);\r\n * }\r\n * }));\r\n * with limit 5 parallel filesystem operations at a time:\r\n * var existingFilePaths = await asyncFilter(filePaths, fsPromise.exists, 5);\r\n *\r\n * @param array the array of items for `filter`ing.\r\n * @param filterFunction the async `filter` function that returns a Promise that resolves to a\r\n * boolean.\r\n * @param limit the configurable number of parallel async operations.\r\n */\r\nexport async function asyncFilter(\r\n array: Array,\r\n filterFunction: (item: T) => Promise,\r\n limit?: number,\r\n): Promise> {\r\n const filteredList = [];\r\n // flowlint-next-line sketchy-null-number:off\r\n await asyncLimit(array, limit || array.length, async (item: T) => {\r\n if (await filterFunction(item)) {\r\n filteredList.push(item);\r\n }\r\n });\r\n return filteredList;\r\n}\r\n\r\nexport async function asyncObjFilter(\r\n obj: {[key: string]: T},\r\n filterFunction: (item: T, key: string) => Promise,\r\n limit?: number,\r\n): Promise<{[key: string]: T}> {\r\n const keys = Object.keys(obj);\r\n const filteredObj = {};\r\n // flowlint-next-line sketchy-null-number:off\r\n await asyncLimit(keys, limit || keys.length, async (key: string) => {\r\n const item = obj[key];\r\n if (await filterFunction(item, key)) {\r\n filteredObj[key] = item;\r\n }\r\n });\r\n return filteredObj;\r\n}\r\n\r\n/**\r\n * `some` Promise utility that allows `some` an array with an async Promise some function.\r\n * It's an alternative to `Array.prototype.some` that accepts an async some function.\r\n * You can optionally configure a limit to set the maximum number of async operations at a time.\r\n *\r\n * Previously, with the Promise.all primitive, we can't set the parallelism limit and we have to\r\n * `some`, so, we replace the old `some` code:\r\n * var someFileExist = false;\r\n * await Promise.all(filePaths.map(async (filePath) => {\r\n * if (await fsPromise.exists(filePath)) {\r\n * someFileExist = true;\r\n * }\r\n * }));\r\n * with limit 5 parallel filesystem operations at a time:\r\n * var someFileExist = await asyncSome(filePaths, fsPromise.exists, 5);\r\n *\r\n * @param array the array of items for `some`ing.\r\n * @param someFunction the async `some` function that returns a Promise that resolves to a\r\n * boolean.\r\n * @param limit the configurable number of parallel async operations.\r\n */\r\nexport async function asyncSome(\r\n array: Array,\r\n someFunction: (item: T) => Promise,\r\n limit?: number,\r\n): Promise {\r\n let resolved = false;\r\n // flowlint-next-line sketchy-null-number:off\r\n await asyncLimit(array, limit || array.length, async (item: T) => {\r\n if (resolved) {\r\n // We don't need to call the someFunction anymore or wait any longer.\r\n return;\r\n }\r\n if (await someFunction(item)) {\r\n resolved = true;\r\n }\r\n });\r\n return resolved;\r\n}\r\n\r\n/**\r\n * Check if an object is Promise by testing if it has a `then` function property.\r\n */\r\nexport function isPromise(object: any): boolean {\r\n return (\r\n Boolean(object) &&\r\n typeof object === 'object' &&\r\n typeof object.then === 'function'\r\n );\r\n}\r\n\r\n/**\r\n * We can't name a function 'finally', so use lastly instead.\r\n * fn() will be executed (and completed) after the provided promise resolves/rejects.\r\n */\r\nexport function lastly(\r\n promise: Promise,\r\n fn: () => Promise | mixed,\r\n): Promise {\r\n return promise.then(\r\n ret => {\r\n return Promise.resolve(fn()).then(() => ret);\r\n },\r\n err => {\r\n return Promise.resolve(fn()).then(() => Promise.reject(err));\r\n },\r\n );\r\n}\r\n\r\n/**\r\n * With a pure promise object, there's no way to tell synchronously\r\n * whether or not it has 'settled' (i.e. been fulfilled or rejected).\r\n * Here we provide a wrapper that provides that information.\r\n */\r\nexport type PromiseState =\r\n | {kind: 'pending'}\r\n | {kind: 'fulfilled', value: T}\r\n | {kind: 'rejected', error: any};\r\n\r\nexport class PromiseWithState {\r\n _promise: Promise;\r\n _state: PromiseState;\r\n\r\n constructor(promise: Promise) {\r\n this._state = {kind: 'pending'};\r\n this._promise = promise.then(\r\n value => {\r\n this._state = {kind: 'fulfilled', value};\r\n return value;\r\n },\r\n error => {\r\n this._state = {kind: 'rejected', error};\r\n throw error;\r\n },\r\n );\r\n }\r\n\r\n getPromise(): Promise {\r\n return this._promise;\r\n }\r\n\r\n getState(): PromiseState {\r\n return this._state;\r\n }\r\n}\r\n\r\nexport function delayTime(ms: number): Promise {\r\n return new Promise((resolve, reject) => {\r\n setTimeout(resolve, ms);\r\n });\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow strict\r\n * @format\r\n */\r\n\r\n/* global performance */\r\n\r\n/**\r\n * Polyfill for performance.now that works both on Atom (chrome) and node.\r\n * It returns a monotonically increasing timer in milliseconds.\r\n *\r\n * Usage:\r\n * const now = performanceNow();\r\n * // ... code you want to benchmark ...\r\n * const timeItTookInMilliseconds = performanceNow() - now;\r\n */\r\n\r\nexport default (typeof performance !== 'undefined'\r\n ? (): number => performance.now()\r\n : (): number => {\r\n const [seconds, nanoseconds] = process.hrtime();\r\n return seconds * 1000 + nanoseconds / 1000000;\r\n });\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport type {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\n\r\nimport getDisplayName from './getDisplayName';\r\nimport UniversalDisposable from './UniversalDisposable';\r\nimport {isPromise} from './promise';\r\nimport performanceNow from './performanceNow';\r\n\r\nexport type SessionInfo = {\r\n id: string,\r\n start: number,\r\n};\r\n\r\nexport type RawAnalyticsService = {\r\n track(\r\n eventName: string,\r\n values?: {[key: string]: mixed},\r\n immediate?: boolean,\r\n ): ?Promise,\r\n isTrackSupported: () => boolean,\r\n setApplicationSessionObservable: (Observable) => void,\r\n};\r\n\r\nlet rawAnalyticsService: RawAnalyticsService = {\r\n track(): ?Promise {},\r\n isTrackSupported: () => false,\r\n setApplicationSessionObservable: (ob: Observable) => {},\r\n};\r\n\r\nexport type TrackingEvent = {\r\n type: string,\r\n data?: Object,\r\n};\r\n\r\nexport type TrackEvent = {\r\n key: string,\r\n values: {[key: string]: mixed},\r\n};\r\n\r\n/**\r\n * Track a set of values against a named event.\r\n * Analytics will be batched and processed asynchronously in the background.\r\n *\r\n * @param eventName Name of the event to be tracked.\r\n * @param values The object containing the data to track.\r\n */\r\nexport function track(\r\n eventName: string,\r\n values?: {[key: string]: mixed},\r\n): void {\r\n rawAnalyticsService.track(eventName, values || {});\r\n}\r\n\r\nexport function isTrackSupported(): boolean {\r\n return rawAnalyticsService.isTrackSupported();\r\n}\r\n\r\n/**\r\n * Same as `track`, except this is guaranteed to send immediately.\r\n * The returned promise will resolve when the request completes (or reject on failure).\r\n */\r\nexport function trackImmediate(\r\n eventName: string,\r\n values?: {[key: string]: mixed},\r\n): Promise {\r\n return (\r\n rawAnalyticsService.track(eventName, values || {}, true) ||\r\n Promise.resolve()\r\n );\r\n}\r\n\r\n/**\r\n * An alternative interface for `track` that accepts a single event object. This is particularly\r\n * useful when dealing with streams (Observables).\r\n */\r\nexport function trackEvent(event: TrackingEvent): void {\r\n track(event.type, event.data);\r\n}\r\n\r\n/**\r\n * Track each event in a stream of TrackingEvents.\r\n */\r\nexport function trackEvents(events: Observable): IDisposable {\r\n return new UniversalDisposable(events.subscribe(trackEvent));\r\n}\r\n\r\n/**\r\n * A sampled version of track that only tracks every 1/sampleRate calls.\r\n */\r\nexport function trackSampled(\r\n eventName: string,\r\n sampleRate: number,\r\n values?: {[key: string]: mixed},\r\n): void {\r\n if (Math.random() * sampleRate <= 1) {\r\n rawAnalyticsService.track(eventName, {\r\n ...values,\r\n sample_rate: sampleRate,\r\n });\r\n }\r\n}\r\n\r\nconst PERFORMANCE_EVENT = 'performance';\r\nconst canMeasure = typeof performance !== 'undefined';\r\nexport class TimingTracker {\r\n static eventCount = 0;\r\n\r\n _eventName: string;\r\n _startTime: number;\r\n _startMark: string;\r\n _values: {[key: string]: mixed};\r\n\r\n constructor(eventName: string, values: {[key: string]: mixed}) {\r\n this._eventName = eventName;\r\n this._startMark = `${this._eventName}_${TimingTracker.eventCount++}_start`;\r\n this._startTime = performanceNow();\r\n this._values = values;\r\n if (canMeasure) {\r\n // eslint-disable-next-line no-undef\r\n performance.mark(this._startMark);\r\n }\r\n }\r\n\r\n onError(error: Error): void {\r\n this._trackTimingEvent(error);\r\n }\r\n\r\n onCancel(): void {\r\n this._trackTimingEvent(/* error */ null, true);\r\n }\r\n\r\n onSuccess(): void {\r\n this._trackTimingEvent(/* error */ null);\r\n }\r\n\r\n _trackTimingEvent(exception: ?Error, canceled: boolean = false): void {\r\n if (canMeasure) {\r\n /* eslint-disable no-undef */\r\n // call measure to add this information to the devtools timeline in the\r\n // case the profiler is running.\r\n performance.measure(this._eventName, this._startMark);\r\n // then clear all the marks and measurements to avoid growing the\r\n // performance entry buffer\r\n performance.clearMarks(this._startMark);\r\n performance.clearMeasures(this._eventName);\r\n /* eslint-enable no-undef */\r\n }\r\n\r\n track(PERFORMANCE_EVENT, {\r\n ...this._values,\r\n duration: Math.round(performanceNow() - this._startTime).toString(),\r\n eventName: this._eventName,\r\n error: exception ? '1' : '0',\r\n exception: exception ? exception.toString() : '',\r\n canceled,\r\n });\r\n }\r\n}\r\n\r\nexport function startTracking(\r\n eventName: string,\r\n values?: {[key: string]: any} = {},\r\n): TimingTracker {\r\n return new TimingTracker(eventName, values);\r\n}\r\n\r\n/**\r\n * Reports analytics including timing for a single operation.\r\n *\r\n * Usage:\r\n *\r\n * analytics.trackTiming('my-package-some-long-operation' () => doit());\r\n *\r\n * Returns (or throws) the result of the operation.\r\n */\r\nexport function trackTiming(\r\n eventName: string,\r\n operation: () => T,\r\n values?: {[key: string]: any} = {},\r\n): T {\r\n const tracker = startTracking(eventName, values);\r\n\r\n try {\r\n const result = operation();\r\n\r\n if (isPromise(result)) {\r\n // Atom uses a different Promise implementation than Nuclide, so the following is not true:\r\n // invariant(result instanceof Promise);\r\n\r\n // For the method returning a Promise, track the time after the promise is resolved/rejected.\r\n return (result: any).then(\r\n value => {\r\n tracker.onSuccess();\r\n return value;\r\n },\r\n reason => {\r\n tracker.onError(reason instanceof Error ? reason : new Error(reason));\r\n return Promise.reject(reason);\r\n },\r\n );\r\n } else {\r\n tracker.onSuccess();\r\n return result;\r\n }\r\n } catch (error) {\r\n tracker.onError(error);\r\n throw error;\r\n }\r\n}\r\n\r\nexport function decorateTrackTiming, T>(\r\n fn: (...args: U) => T,\r\n values?: {[key: string]: any} = {},\r\n): (...args: U) => T {\r\n const name = getDisplayName(fn);\r\n function decoratedTrackTiming(...args: U) {\r\n return trackTiming(name, fn.bind(this, ...args), values);\r\n }\r\n decoratedTrackTiming.displayName = `trackTiming(${name})`;\r\n return decoratedTrackTiming;\r\n}\r\n\r\n/**\r\n * A sampled version of trackTiming that only tracks every 1/sampleRate calls.\r\n */\r\nexport function trackTimingSampled(\r\n eventName: string,\r\n operation: () => T,\r\n sampleRate: number,\r\n values?: {[key: string]: any} = {},\r\n): T {\r\n if (Math.random() * sampleRate <= 1) {\r\n return trackTiming(eventName, operation, {\r\n ...values,\r\n sample_rate: sampleRate,\r\n });\r\n }\r\n return operation();\r\n}\r\n\r\nexport function decorateTrackTimingSampled, T>(\r\n fn: (...args: U) => T,\r\n sampleRate: number,\r\n values?: {[key: string]: any} = {},\r\n): (...args: U) => T {\r\n const name = getDisplayName(fn);\r\n function decoratedTrackTimingSampled(...args: U) {\r\n return trackTimingSampled(name, fn.bind(this, ...args), sampleRate, values);\r\n }\r\n decoratedTrackTimingSampled.displayName = `trackTimingSampled(${name})`;\r\n return decoratedTrackTimingSampled;\r\n}\r\n\r\nexport function setRawAnalyticsService(\r\n analyticsService: RawAnalyticsService,\r\n ob: Observable,\r\n): void {\r\n analyticsService.setApplicationSessionObservable(ob);\r\n rawAnalyticsService = analyticsService;\r\n}\r\n\r\nexport default {\r\n track,\r\n trackSampled,\r\n trackEvent,\r\n trackTiming,\r\n trackTimingSampled,\r\n startTracking,\r\n TimingTracker,\r\n decorateTrackTiming,\r\n decorateTrackTimingSampled,\r\n};\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport UniversalDisposable from '@atom-ide-community/nuclide-commons/UniversalDisposable';\r\n\r\nexport type Provider = {\r\n // Providers with higher priorities will be preferred over lower ones.\r\n priority: number,\r\n // Omitting grammarScopes implies that the provider applies to all grammars.\r\n +grammarScopes?: Array,\r\n};\r\n\r\nexport default class ProviderRegistry {\r\n _providers: Array;\r\n\r\n constructor() {\r\n this._providers = [];\r\n }\r\n\r\n addProvider(provider: T): IDisposable {\r\n const index = this._providers.findIndex(\r\n p => provider.priority > p.priority,\r\n );\r\n if (index === -1) {\r\n this._providers.push(provider);\r\n } else {\r\n this._providers.splice(index, 0, provider);\r\n }\r\n return new UniversalDisposable(() => {\r\n this.removeProvider(provider);\r\n });\r\n }\r\n\r\n removeProvider(provider: T): void {\r\n const index = this._providers.indexOf(provider);\r\n if (index !== -1) {\r\n this._providers.splice(index, 1);\r\n }\r\n }\r\n\r\n // TODO deprecate since there can be N providers.\r\n getProviderForEditor(editor: atom$TextEditor): ?T {\r\n const grammar = editor.getGrammar().scopeName;\r\n return this.findProvider(grammar);\r\n }\r\n\r\n // TODO create an ordering or priority aware util to prefer instead.\r\n getAllProvidersForEditor(editor: atom$TextEditor): Iterable {\r\n const grammar = editor.getGrammar().scopeName;\r\n return this.findAllProviders(grammar);\r\n }\r\n\r\n findProvider(grammar: string): ?T {\r\n for (const provider of this.findAllProviders(grammar)) {\r\n return provider;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Iterates over all providers matching the grammar, in priority order.\r\n */\r\n *findAllProviders(grammar: string): Iterable {\r\n for (const provider of this._providers) {\r\n if (\r\n provider.grammarScopes == null ||\r\n provider.grammarScopes.indexOf(grammar) !== -1\r\n ) {\r\n yield provider;\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport UniversalDisposable from './UniversalDisposable';\r\nimport {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\n\r\n/**\r\n * Add an event listener an return a disposable for removing it. Note that this function assumes\r\n * node EventEmitter semantics: namely, that adding the same combination of eventName and callback\r\n * adds a second listener.\r\n */\r\nexport function attachEvent(\r\n emitter: events$EventEmitter,\r\n eventName: string,\r\n callback: Function,\r\n): IDisposable {\r\n emitter.addListener(eventName, callback);\r\n return new UniversalDisposable(() => {\r\n emitter.removeListener(eventName, callback);\r\n });\r\n}\r\n\r\ntype SubscribeCallback = (item: T) => any;\r\ntype SubscribeFunction = (\r\n callback: SubscribeCallback,\r\n) => IDisposable | (() => mixed);\r\n\r\nexport function observableFromSubscribeFunction(\r\n fn: SubscribeFunction,\r\n): Observable {\r\n return Observable.create(\r\n observer => new UniversalDisposable(fn(observer.next.bind(observer))),\r\n );\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport type {NuclideUri} from '@atom-ide-community/nuclide-commons/nuclideUri';\r\n\r\nimport invariant from 'assert';\r\nimport {TextEditor} from 'atom';\r\nimport {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\n\r\nimport {observableFromSubscribeFunction} from '@atom-ide-community/nuclide-commons/event';\r\n\r\n/**\r\n * Returns a text editor that has the given path open, or null if none exists. If there are multiple\r\n * text editors for this path, one is chosen arbitrarily.\r\n */\r\nexport function existingEditorForUri(path: NuclideUri): ?atom$TextEditor {\r\n // This isn't ideal but realistically iterating through even a few hundred editors shouldn't be a\r\n // real problem. And if you have more than a few hundred you probably have bigger problems.\r\n for (const editor of atom.workspace.getTextEditors()) {\r\n if (editor.getPath() === path) {\r\n return editor;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Returns a text editor that has the given buffer open, or null if none exists. If there are\r\n * multiple text editors for this buffer, one is chosen arbitrarily.\r\n */\r\nexport function existingEditorForBuffer(\r\n buffer: atom$TextBuffer,\r\n): ?atom$TextEditor {\r\n // This isn't ideal but realistically iterating through even a few hundred editors shouldn't be a\r\n // real problem. And if you have more than a few hundred you probably have bigger problems.\r\n for (const editor of atom.workspace.getTextEditors()) {\r\n if (editor.getBuffer() === buffer) {\r\n return editor;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function getViewOfEditor(\r\n editor: atom$TextEditor,\r\n): atom$TextEditorElement {\r\n return atom.views.getView(editor);\r\n}\r\n\r\nexport function getScrollTop(editor: atom$TextEditor): number {\r\n return getViewOfEditor(editor).getScrollTop();\r\n}\r\n\r\nexport function setScrollTop(editor: atom$TextEditor, scrollTop: number): void {\r\n getViewOfEditor(editor).setScrollTop(scrollTop);\r\n}\r\n\r\n/**\r\n * Does a best effort to set an editor pane to a given cursor position & scroll.\r\n * Does not ensure that the current cursor position is visible.\r\n *\r\n * Can be used with editor.getCursorBufferPosition() & getScrollTop() to restore\r\n * an editors cursor and scroll.\r\n */\r\nexport function setPositionAndScroll(\r\n editor: atom$TextEditor,\r\n position: atom$Point,\r\n scrollTop: number,\r\n): void {\r\n editor.setCursorBufferPosition(position, {autoscroll: false});\r\n setScrollTop(editor, scrollTop);\r\n}\r\n\r\nexport function getCursorPositions(\r\n editor: atom$TextEditor,\r\n): Observable {\r\n return Observable.defer(() => {\r\n // This will behave strangely in the face of multiple cursors. Consider supporting multiple\r\n // cursors in the future.\r\n const cursor = editor.getCursors()[0];\r\n invariant(cursor != null);\r\n return Observable.merge(\r\n Observable.of(cursor.getBufferPosition()),\r\n observableFromSubscribeFunction(\r\n cursor.onDidChangePosition.bind(cursor),\r\n ).map(event => event.newBufferPosition),\r\n );\r\n });\r\n}\r\n\r\nexport function observeEditorDestroy(\r\n editor: atom$TextEditor,\r\n): Observable {\r\n return observableFromSubscribeFunction(editor.onDidDestroy.bind(editor))\r\n .map(event => editor)\r\n .take(1);\r\n}\r\n\r\n// Use atom readOnly attribute to set read-only state.\r\nexport function enforceReadOnlyEditor(\r\n textEditor: atom$TextEditor,\r\n readOnlyExceptions?: Array = ['append', 'setText'],\r\n): IDisposable {\r\n textEditor.getElement().setAttribute('readonly', '');\r\n return {\r\n dispose() {\r\n textEditor.getElement().removeAttribute('readonly');\r\n },\r\n };\r\n}\r\n\r\n// Turn off soft wrap setting for these editors so diffs properly align.\r\n// Some text editor register sometimes override the set soft wrapping\r\n// after mounting an editor to the workspace - here, that's watched and reset to `false`.\r\nexport function enforceSoftWrap(\r\n editor: atom$TextEditor,\r\n enforcedSoftWrap: boolean,\r\n): IDisposable {\r\n editor.setSoftWrapped(enforcedSoftWrap);\r\n return editor.onDidChangeSoftWrapped(softWrapped => {\r\n if (softWrapped !== enforcedSoftWrap) {\r\n // Reset the overridden softWrap to `false` once the operation completes.\r\n process.nextTick(() => {\r\n if (!editor.isDestroyed()) {\r\n editor.setSoftWrapped(enforcedSoftWrap);\r\n }\r\n });\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Checks if an object (typically an Atom pane) is a TextEditor.\r\n * Could be replaced with atom.workspace.isValidTextEditor,\r\n * but Flow doesn't support %checks in methods yet.\r\n */\r\nexport function isValidTextEditor(item: mixed): boolean %checks {\r\n return item instanceof TextEditor;\r\n}\r\n\r\nexport function centerScrollToBufferLine(\r\n textEditorElement: atom$TextEditorElement,\r\n bufferLineNumber: number,\r\n): void {\r\n const textEditor = textEditorElement.getModel();\r\n const pixelPositionTop = textEditorElement.pixelPositionForBufferPosition([\r\n bufferLineNumber,\r\n 0,\r\n ]).top;\r\n // Manually calculate the scroll location, instead of using\r\n // `textEditor.scrollToBufferPosition([lineNumber, 0], {center: true})`\r\n // because that API to wouldn't center the line if it was in the visible screen range.\r\n const scrollTop =\r\n pixelPositionTop +\r\n textEditor.getLineHeightInPixels() / 2 -\r\n textEditorElement.clientHeight / 2;\r\n textEditorElement.setScrollTop(Math.max(scrollTop, 1));\r\n\r\n textEditorElement.focus();\r\n\r\n textEditor.setCursorBufferPosition([bufferLineNumber, 0], {\r\n autoscroll: false,\r\n });\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow strict-local\r\n * @format\r\n */\r\n\r\nimport type {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\n\r\nimport {getLogger} from 'log4js';\r\nimport {Subject} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\nimport invariant from 'assert';\r\n\r\nexport type GoToLocationOptions = {|\r\n line?: number,\r\n column?: number,\r\n center?: boolean,\r\n activateItem?: boolean,\r\n activatePane?: boolean,\r\n pending?: boolean,\r\n moveCursor?: boolean,\r\n|};\r\n\r\n/**\r\n * Opens the given file.\r\n *\r\n * Optionally include a line and column to navigate to. If a line is given, by default it will\r\n * center it in the opened text editor.\r\n *\r\n * This should be preferred over `atom.workspace.open()` in typical cases. The motivations are:\r\n * - We call `atom.workspace.open()` with the `searchAllPanes` option. This looks in other panes for\r\n * the current file, rather just opening a new copy in the current pane. People often forget this\r\n * option which typically leads to a subpar experience for people who use multiple panes.\r\n * - When moving around in the current file, `goToLocation` explicitly publishes events that the nav\r\n * stack uses.\r\n *\r\n * Currently, `atom.workspace.open()` should be used only in these cases:\r\n * - When the URI to open is not a file URI. For example, if we want to open some tool like find\r\n * references in a pane.\r\n * - When we want to open an untitled file (providing no file argument). Currently, goToLocation\r\n * requires a file to open.\r\n * - When we want to open a file as a pending pane item. Currently goToLocation cannot do this.\r\n *\r\n * In these cases, you may disable the lint rule against `atom.workspace.open` by adding the\r\n * following comment above its use:\r\n * // eslint-disable-next-line nuclide-internal/atom-apis\r\n */\r\nexport async function goToLocation(\r\n file: string,\r\n options?: ?GoToLocationOptions,\r\n): Promise {\r\n const center = options?.center ?? true;\r\n const moveCursor = options?.moveCursor ?? true;\r\n const activatePane = options?.activatePane ?? true;\r\n const activateItem = options?.activateItem;\r\n const line = options?.line;\r\n const column = options?.column;\r\n const pending = options?.pending;\r\n\r\n // Prefer going to the current editor rather than the leftmost editor.\r\n const currentEditor = atom.workspace.getActiveTextEditor();\r\n if (currentEditor != null && currentEditor.getPath() === file) {\r\n const paneContainer = atom.workspace.paneContainerForItem(currentEditor);\r\n invariant(paneContainer != null);\r\n if (activatePane) {\r\n paneContainer.activate();\r\n }\r\n if (line != null) {\r\n goToLocationInEditor(currentEditor, {\r\n line,\r\n column: column == null ? 0 : column,\r\n center,\r\n moveCursor,\r\n });\r\n } else {\r\n invariant(column == null, 'goToLocation: Cannot specify just column');\r\n }\r\n return currentEditor;\r\n } else {\r\n // Obviously, calling goToLocation isn't a viable alternative here :P\r\n // eslint-disable-next-line nuclide-internal/atom-apis\r\n const editor = await atom.workspace.open(file, {\r\n initialLine: line,\r\n initialColumn: column,\r\n searchAllPanes: true,\r\n activatePane,\r\n activateItem,\r\n pending,\r\n });\r\n // TODO(T28305560) Investigate offenders for this error\r\n if (editor == null) {\r\n const tmp = {};\r\n Error.captureStackTrace(tmp);\r\n const error = Error(`atom.workspace.open returned null on ${file}`);\r\n getLogger('goToLocation').error(error);\r\n throw error;\r\n }\r\n\r\n if (center && line != null) {\r\n editor.scrollToBufferPosition([line, column], {center: true});\r\n }\r\n return editor;\r\n }\r\n}\r\n\r\nconst goToLocationSubject = new Subject();\r\n\r\ntype GotoLocationInEditorOptions = {|\r\n line: number,\r\n column: number,\r\n center?: boolean,\r\n moveCursor?: boolean,\r\n|};\r\n\r\n// Scrolls to the given line/column at the given editor\r\n// broadcasts the editor instance on an observable (subject) available\r\n// through the getGoToLocation\r\nexport function goToLocationInEditor(\r\n editor: atom$TextEditor,\r\n options: GotoLocationInEditorOptions,\r\n): void {\r\n const center = options.center == null ? true : options.center;\r\n const moveCursor = options.moveCursor == null ? true : options.moveCursor;\r\n const {line, column} = options;\r\n\r\n if (moveCursor) {\r\n editor.setCursorBufferPosition([line, column]);\r\n }\r\n if (center) {\r\n editor.scrollToBufferPosition([line, column], {center: true});\r\n }\r\n\r\n goToLocationSubject.next(editor);\r\n}\r\n\r\nexport function observeNavigatingEditors(): Observable {\r\n return goToLocationSubject;\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow strict-local\r\n * @format\r\n */\r\n\r\nimport type {NuclideUri} from '@atom-ide-community/nuclide-commons/nuclideUri';\r\n\r\nimport invariant from 'assert';\r\nimport {getLogger} from 'log4js';\r\n\r\nimport {existingEditorForUri} from './text-editor';\r\nimport {goToLocation} from './go-to-location';\r\n\r\nexport type TextEdit = {\r\n oldRange: atom$Range,\r\n newText: string,\r\n // If included, this will be used to verify that the edit still applies cleanly.\r\n oldText?: string,\r\n};\r\n\r\n/**\r\n * Attempts to apply the given patches for multiple files. Accepts a Map as input\r\n * with file paths as keys and a corresponding array of TextEdits as values.\r\n *\r\n * It is an error to send overlapping text-edits. All text-edits describe changes\r\n * made to the initial document version. The order of the edits does not matter\r\n * as they will be sorted before they are applied.\r\n *\r\n * All changes will be applied to the buffers but not saved. If a file is not\r\n * currently open, it will be opened.\r\n *\r\n * If a change is undone (Cmd+Z), only the changes of the current\r\n * file will be undone. All of the changes for that file will be undone at once.\r\n *\r\n * Returns true if the application was successful, otherwise false. If any of\r\n * the changes fail, for ANY file, then none of the changes are applied.\r\n */\r\nexport async function applyTextEditsForMultipleFiles(\r\n changes: Map>,\r\n): Promise {\r\n const paths = Array.from(changes.keys());\r\n\r\n // NOTE: There is a race here. If the file contents change while the\r\n // editors are being opened, then the ranges of the TextEdits will be off.\r\n // However, currently this is only used to applyEdits to open files.\r\n const editors = await Promise.all(\r\n paths.map(async path => goToLocation(path)),\r\n );\r\n const checkpoints = editors.map(editor => {\r\n invariant(editor != null);\r\n const buffer = editor.getBuffer();\r\n return [buffer, buffer.createCheckpoint()];\r\n });\r\n const allOkay = paths.reduce((successSoFar, path) => {\r\n const edits = changes.get(path);\r\n return successSoFar && edits != null && applyTextEdits(path, ...edits);\r\n }, true);\r\n if (!allOkay) {\r\n checkpoints.forEach(([buffer, checkPoint]) => {\r\n buffer.revertToCheckpoint(checkPoint);\r\n return false;\r\n });\r\n }\r\n return allOkay;\r\n}\r\n\r\n/**\r\n * Attempts to apply the given patches to the given file.\r\n *\r\n * It is an error to send overlapping edits. The order of the edits does not\r\n * matter (they will be sorted before they are applied).\r\n *\r\n * The file must be currently open in Atom, and the changes will be applied to the buffer but not\r\n * saved.\r\n *\r\n * Returns true if the application was successful, otherwise false (e.g. if the oldText did not\r\n * match).\r\n */\r\nexport function applyTextEdits(\r\n path: NuclideUri,\r\n ...edits: Array\r\n): boolean {\r\n const sortedEdits = sortEdits(edits);\r\n const editor = existingEditorForUri(path);\r\n invariant(editor != null);\r\n return applySortedTextEditsToBuffer(editor.getBuffer(), sortedEdits);\r\n}\r\n\r\nexport function applyTextEditsToBuffer(\r\n buffer: atom$TextBuffer | simpleTextBuffer$TextBuffer,\r\n edits: Array,\r\n): boolean {\r\n return applySortedTextEditsToBuffer(buffer, sortEdits(edits));\r\n}\r\n\r\nfunction applySortedTextEditsToBuffer(\r\n buffer: atom$TextBuffer | simpleTextBuffer$TextBuffer,\r\n edits: Array,\r\n): boolean {\r\n // For every edit, the start of its range will be after the end of the\r\n // previous edit's range.\r\n if (editsOverlap(edits)) {\r\n getLogger('text-edit').warn(\r\n 'applyTextEdits was called with overlapping edits.',\r\n );\r\n return false;\r\n }\r\n // Special-case whole-buffer changes to minimize disruption.\r\n if (edits.length === 1 && edits[0].oldRange.isEqual(buffer.getRange())) {\r\n if (edits[0].oldText != null && edits[0].oldText !== buffer.getText()) {\r\n return false;\r\n }\r\n buffer.setTextViaDiff(edits[0].newText);\r\n return true;\r\n }\r\n\r\n const checkpoint = buffer.createCheckpoint();\r\n\r\n // Iterate through in reverse order. Edits earlier in the file can move around text later in the\r\n // file, so to avoid conflicts edits should be applied last first.\r\n for (let i = edits.length - 1; i >= 0; i--) {\r\n const edit = edits[i];\r\n const success = applyToBuffer(buffer, edit);\r\n if (!success) {\r\n buffer.revertToCheckpoint(checkpoint);\r\n return false;\r\n }\r\n }\r\n\r\n buffer.groupChangesSinceCheckpoint(checkpoint);\r\n return true;\r\n}\r\n\r\nfunction applyToBuffer(\r\n buffer: atom$TextBuffer | simpleTextBuffer$TextBuffer,\r\n edit: TextEdit,\r\n): boolean {\r\n if (edit.oldRange.start.row === edit.oldRange.end.row) {\r\n // A little extra validation when the old range spans only one line. In particular, this helps\r\n // when the old range is empty so there is no old text for us to compare against. We can at\r\n // least abort if the line isn't long enough.\r\n const lineLength = buffer.lineLengthForRow(edit.oldRange.start.row);\r\n if (edit.oldRange.end.column > lineLength) {\r\n return false;\r\n }\r\n }\r\n if (edit.oldText != null) {\r\n const currentText = buffer.getTextInRange(edit.oldRange);\r\n if (currentText !== edit.oldText) {\r\n return false;\r\n }\r\n }\r\n buffer.setTextInRange(edit.oldRange, edit.newText);\r\n return true;\r\n}\r\n\r\n// Returns whether an array of sorted TextEdits contain an overlapping range.\r\nfunction editsOverlap(sortedEdits: Array): boolean {\r\n for (let i = 0; i < sortedEdits.length - 1; i++) {\r\n if (\r\n sortedEdits[i].oldRange.end.isGreaterThan(\r\n sortedEdits[i + 1].oldRange.start,\r\n )\r\n ) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction sortEdits(edits: Array): Array {\r\n // stable sort (preserve order of edits starting in the same location)\r\n return edits\r\n .map((edit, i) => [edit, i])\r\n .sort(\r\n ([e1, i1], [e2, i2]) =>\r\n e1.oldRange.start.compare(e2.oldRange.start) ||\r\n e1.oldRange.end.compare(e2.oldRange.end) ||\r\n i1 - i2,\r\n )\r\n .map(([edit]) => edit);\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport type {Provider} from './ProviderRegistry';\r\nimport type {TextEdit} from './text-edit';\r\n\r\nimport {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\nimport {track} from '@atom-ide-community/nuclide-commons/analytics';\r\nimport ProviderRegistry from './ProviderRegistry';\r\nimport {applyTextEditsToBuffer} from './text-edit';\r\nimport UniversalDisposable from '@atom-ide-community/nuclide-commons/UniversalDisposable';\r\n\r\nexport type FileEventHandlersConfig = {|\r\n supportsOnWillSave: boolean,\r\n onWillSaveTimeout?: number,\r\n onWillSavePriority?: number,\r\n|};\r\n\r\ntype OnWillSaveProvider = Provider & {\r\n timeout: number,\r\n callback: (e: atom$TextEditor) => Observable,\r\n};\r\n\r\n// Timeouts if providers don't all finish in 5 seconds.\r\nconst GLOBAL_SAVE_TIMEOUT_MS = 5000;\r\nconst onWillSaveProviders: ProviderRegistry<\r\n OnWillSaveProvider,\r\n> = new ProviderRegistry();\r\n\r\n// Returns an observable of booleans, each of which indicates whether the\r\n// formatting text edits from a given provider was successfully applied or not.\r\nfunction onWillSave(editor: atom$TextEditor): Observable {\r\n if (editor.getPath() == null) {\r\n return Observable.empty();\r\n }\r\n\r\n const providers = Array.from(\r\n onWillSaveProviders.getAllProvidersForEditor(editor),\r\n );\r\n // NOTE: concat() is used here to subscribe to providers sequentially and\r\n // apply their text edits in order.\r\n return Observable.concat(\r\n ...providers.map((provider: OnWillSaveProvider) =>\r\n provider\r\n .callback(editor)\r\n .toArray()\r\n .race(Observable.of([]).delay(provider.timeout))\r\n .map(edits => {\r\n const success = applyTextEditsToBuffer(editor.getBuffer(), edits);\r\n return success;\r\n }),\r\n ),\r\n );\r\n}\r\n\r\n// HACK: intercept the real TextEditor.save and handle it ourselves.\r\n// Atom has no way of injecting content into the buffer asynchronously\r\n// before a save operation.\r\n// If we try to format after the save, and then save again,\r\n// it's a poor user experience (and also races the text buffer's reload).\r\nfunction patchEditorSave(editor: atom$TextEditor): IDisposable {\r\n const realSave = editor.save;\r\n const editor_ = (editor: any);\r\n editor_.save = async () => {\r\n const timeout = new Date();\r\n timeout.setTime(timeout.getTime() + GLOBAL_SAVE_TIMEOUT_MS);\r\n try {\r\n await onWillSave(editor_)\r\n .timeout(timeout)\r\n .toPromise();\r\n } catch (e) {\r\n const providers = Array.from(\r\n onWillSaveProviders.getAllProvidersForEditor(editor_),\r\n );\r\n track('timeout-on-save', {\r\n uri: editor.getPath(),\r\n providers,\r\n });\r\n } finally {\r\n await realSave.call(editor);\r\n }\r\n };\r\n return new UniversalDisposable(() => {\r\n editor_.save = realSave;\r\n });\r\n}\r\n\r\nexport function registerOnWillSave(provider: OnWillSaveProvider): IDisposable {\r\n return onWillSaveProviders.addProvider(provider);\r\n}\r\n\r\nexport function observeTextEditors(): IDisposable {\r\n const disposables = new UniversalDisposable();\r\n disposables.add(\r\n atom.workspace.observeTextEditors(editor => {\r\n disposables.add(patchEditorSave(editor));\r\n }),\r\n );\r\n return disposables;\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport invariant from 'assert';\r\nimport {Observable} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\n\r\n/**\r\n * A wrapper over the specified Atom's config functions.\r\n * Each individual loaded package's config is a subconfig of the root package.\r\n */\r\n\r\nexport default class ConfigManager {\r\n _packageName: ?string;\r\n _config: atom$Config;\r\n\r\n constructor(config: atom$Config) {\r\n this._config = config;\r\n }\r\n\r\n getConfig(): atom$Config {\r\n return this._config;\r\n }\r\n\r\n /**\r\n * Sets the root package name.\r\n * This gets automatically called from FeatureLoader.\r\n */\r\n setPackageName(name: string): void {\r\n this._packageName = name;\r\n }\r\n\r\n getPackageName(): string {\r\n invariant(this._packageName != null, 'No package name available');\r\n return this._packageName;\r\n }\r\n\r\n formatKeyPath(keyPath: string): string {\r\n if (this._packageName == null) {\r\n return keyPath;\r\n }\r\n return `${this._packageName}.${keyPath}`;\r\n }\r\n\r\n /*\r\n * Returns the value of a setting for a Nuclide feature key. Takes and returns the same types as\r\n * `atom.config.get` except `keyPath` is not optional. To get the entire config object, use\r\n * `atom.config.get`.\r\n *\r\n * Note: This is intentionally typed as mixed, this way each call site has to\r\n * first cast it as any and it is obvious that this is an area that is not safe\r\n * and flow will not proceed if the callsite doesn't do it.\r\n *\r\n * Example:\r\n * const config: MyConfigType = (featureConfig.get('config-name'): any);\r\n */\r\n get(\r\n keyPath: string,\r\n options?: {\r\n excludeSources?: Array,\r\n sources?: Array,\r\n scope?: atom$ScopeDescriptorLike,\r\n },\r\n ): mixed {\r\n // atom.config.get will crash if the second arg is present and undefined.\r\n // It does not crash if the second arg is missing.\r\n return this._config.get(\r\n this.formatKeyPath(keyPath),\r\n ...(options == null ? [] : [options]),\r\n );\r\n }\r\n\r\n getWithDefaults(\r\n keyPath: string,\r\n defaults: T,\r\n options?: {\r\n excludeSources?: Array,\r\n sources?: Array,\r\n scope?: atom$ScopeDescriptorLike,\r\n },\r\n ): T {\r\n const current: any = this.get(keyPath, options);\r\n return current == null ? defaults : current;\r\n }\r\n\r\n /*\r\n * Gets the schema of a setting for a Nuclide feature key. Takes and returns the same types as\r\n * `atom.config.getSchema`.\r\n */\r\n getSchema(keyPath: string): atom$ConfigSchema {\r\n return this._config.getSchema(this.formatKeyPath(keyPath));\r\n }\r\n\r\n /*\r\n * Similar to `atom.config.observe` except arguments are required, and options cannot be given.\r\n *\r\n * To observe changes on the entire config, use `atom.config.observe`.\r\n */\r\n observe(\r\n keyPath: string,\r\n optionsOrCallback?:\r\n | {scope?: atom$ScopeDescriptorLike}\r\n | ((value: any) => mixed),\r\n callback?: (value: any) => mixed,\r\n ): IDisposable {\r\n return this._config.observe(\r\n this.formatKeyPath(keyPath),\r\n ...Array.prototype.slice.call(arguments, 1),\r\n );\r\n }\r\n\r\n /*\r\n * Behaves similarly to the `observe` function, but returns a stream of values, rather\r\n * than receiving a callback.\r\n */\r\n observeAsStream(\r\n keyPath: string,\r\n options?: {scope?: atom$ScopeDescriptorLike} = {},\r\n ): Observable {\r\n return Observable.create(observer => {\r\n const disposable = this.observe(\r\n keyPath,\r\n options,\r\n observer.next.bind(observer),\r\n );\r\n return disposable.dispose.bind(disposable);\r\n });\r\n }\r\n\r\n /*\r\n * Takes and returns the same types as `atom.config.onDidChange` except `keyPath` is not optional.\r\n * To listen to changes on all key paths, use `atom.config.onDidChange`.\r\n */\r\n onDidChange(\r\n keyPath: string,\r\n optionsOrCallback?:\r\n | {scope?: atom$ScopeDescriptorLike}\r\n | ((event: {oldValue: mixed, newValue: mixed}) => mixed),\r\n callback?: (event: {oldValue: mixed, newValue: mixed}) => mixed,\r\n ): IDisposable {\r\n return this._config.onDidChange(\r\n this.formatKeyPath(keyPath),\r\n ...Array.prototype.slice.call(arguments, 1),\r\n );\r\n }\r\n\r\n /*\r\n * Sets the value of a setting for a Nuclide feature key. Takes and returns the same types as\r\n * `atom.config.set`.\r\n */\r\n set(\r\n keyPath: string,\r\n value: ?mixed,\r\n options?: {\r\n scopeSelector?: string,\r\n source?: string,\r\n },\r\n ): boolean {\r\n return this._config.set(\r\n this.formatKeyPath(keyPath),\r\n ...Array.prototype.slice.call(arguments, 1),\r\n );\r\n }\r\n\r\n /*\r\n * Sets the schema of a setting for a Nuclide feature key. Takes and returns the same types as\r\n * `atom.config.setSchema`.\r\n */\r\n setSchema(keyPath: string, schema: Object): void {\r\n return this._config.setSchema(\r\n this.formatKeyPath(keyPath),\r\n ...Array.prototype.slice.call(arguments, 1),\r\n );\r\n }\r\n\r\n /*\r\n * Restores a setting for a Nuclide feature key to its default value. Takes and returns the same\r\n * types as `atom.config.set`.\r\n */\r\n unset(\r\n keyPath: string,\r\n options?: {\r\n scopeSelector?: string,\r\n source?: string,\r\n },\r\n ): void {\r\n return this._config.unset(\r\n this.formatKeyPath(keyPath),\r\n ...Array.prototype.slice.call(arguments, 1),\r\n );\r\n }\r\n\r\n /**\r\n * Returns `true` if the feature with the given name is disabled either directly or because the\r\n * container package itself is disabled.\r\n */\r\n isFeatureDisabled(name: string): boolean {\r\n if (this._packageName == null) {\r\n return atom.packages.isPackageDisabled(name);\r\n }\r\n return (\r\n atom.packages.isPackageDisabled(this._packageName) ||\r\n // $FlowFixMe flow doesn't register this._packageName as non-null here\r\n !this._config.get(`${this._packageName}.use.${name}`)\r\n );\r\n }\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow strict-local\r\n * @format\r\n */\r\n\r\n/**\r\n * A wrapper over Atom's config functions for use with FeatureLoader.\r\n * Each individual loaded package's config is a subconfig of the root package.\r\n */\r\n\r\nimport ConfigManager from './ConfigManager';\r\n\r\nconst featureConfigManager = new ConfigManager(atom.config);\r\n\r\nexport default featureConfigManager;\r\n","(function (factory) {\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n var v = factory(require, exports);\n if (v !== undefined) module.exports = v;\n }\n else if (typeof define === \"function\" && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n /*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n 'use strict';\n Object.defineProperty(exports, \"__esModule\", { value: true });\n function _encode(ch) {\n return '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n }\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n function encodeURIComponent2(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, _encode);\n }\n function encodeNoop(str) {\n return str.replace(/[#?]/, _encode);\n }\n /**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component paths\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n *\n *\n */\n var URI = (function () {\n function URI() {\n this._scheme = URI._empty;\n this._authority = URI._empty;\n this._path = URI._empty;\n this._query = URI._empty;\n this._fragment = URI._empty;\n this._formatted = null;\n this._fsPath = null;\n }\n URI.isUri = function (thing) {\n if (thing instanceof URI) {\n return true;\n }\n if (!thing) {\n return false;\n }\n return typeof thing.authority === 'string'\n && typeof thing.fragment === 'string'\n && typeof thing.path === 'string'\n && typeof thing.query === 'string'\n && typeof thing.scheme === 'string';\n };\n Object.defineProperty(URI.prototype, \"scheme\", {\n /**\n * scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.\n * The part before the first colon.\n */\n get: function () {\n return this._scheme;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"authority\", {\n /**\n * authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.\n * The part between the first double slashes and the next slash.\n */\n get: function () {\n return this._authority;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"path\", {\n /**\n * path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.\n */\n get: function () {\n return this._path;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"query\", {\n /**\n * query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.\n */\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"fragment\", {\n /**\n * fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.\n */\n get: function () {\n return this._fragment;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(URI.prototype, \"fsPath\", {\n // ---- filesystem path -----------------------\n /**\n * Returns a string representing the corresponding file system path of this URI.\n * Will handle UNC paths and normalize windows drive letters to lower-case. Also\n * uses the platform specific path separator. Will *not* validate the path for\n * invalid characters and semantics. Will *not* look at the scheme of this URI.\n */\n get: function () {\n if (!this._fsPath) {\n var value;\n if (this._authority && this._path && this.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = \"//\" + this._authority + this._path;\n }\n else if (URI._driveLetterPath.test(this._path)) {\n // windows drive letter: file:///c:/far/boo\n value = this._path[1].toLowerCase() + this._path.substr(2);\n }\n else {\n // other path\n value = this._path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n this._fsPath = value;\n }\n return this._fsPath;\n },\n enumerable: true,\n configurable: true\n });\n // ---- modify to new -------------------------\n URI.prototype.with = function (change) {\n if (!change) {\n return this;\n }\n var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;\n if (scheme === void 0) {\n scheme = this.scheme;\n }\n else if (scheme === null) {\n scheme = '';\n }\n if (authority === void 0) {\n authority = this.authority;\n }\n else if (authority === null) {\n authority = '';\n }\n if (path === void 0) {\n path = this.path;\n }\n else if (path === null) {\n path = '';\n }\n if (query === void 0) {\n query = this.query;\n }\n else if (query === null) {\n query = '';\n }\n if (fragment === void 0) {\n fragment = this.fragment;\n }\n else if (fragment === null) {\n fragment = '';\n }\n if (scheme === this.scheme\n && authority === this.authority\n && path === this.path\n && query === this.query\n && fragment === this.fragment) {\n return this;\n }\n var ret = new URI();\n ret._scheme = scheme;\n ret._authority = authority;\n ret._path = path;\n ret._query = query;\n ret._fragment = fragment;\n URI._validate(ret);\n return ret;\n };\n // ---- parse & validate ------------------------\n URI.parse = function (value) {\n var ret = new URI();\n var data = URI._parseComponents(value);\n ret._scheme = data.scheme;\n ret._authority = decodeURIComponent(data.authority);\n ret._path = decodeURIComponent(data.path);\n ret._query = decodeURIComponent(data.query);\n ret._fragment = decodeURIComponent(data.fragment);\n URI._validate(ret);\n return ret;\n };\n URI.file = function (path) {\n var ret = new URI();\n ret._scheme = 'file';\n // normalize to fwd-slashes on windows,\n // on other systems bwd-slaches are valid\n // filename character, eg /f\\oo/ba\\r.txt\n if (isWindows) {\n path = path.replace(/\\\\/g, URI._slash);\n }\n // check for authority as used in UNC shares\n // or use the path as given\n if (path[0] === URI._slash && path[0] === path[1]) {\n var idx = path.indexOf(URI._slash, 2);\n if (idx === -1) {\n ret._authority = path.substring(2);\n }\n else {\n ret._authority = path.substring(2, idx);\n ret._path = path.substring(idx);\n }\n }\n else {\n ret._path = path;\n }\n // Ensure that path starts with a slash\n // or that it is at least a slash\n if (ret._path[0] !== URI._slash) {\n ret._path = URI._slash + ret._path;\n }\n URI._validate(ret);\n return ret;\n };\n URI._parseComponents = function (value) {\n var ret = {\n scheme: URI._empty,\n authority: URI._empty,\n path: URI._empty,\n query: URI._empty,\n fragment: URI._empty,\n };\n var match = URI._regexp.exec(value);\n if (match) {\n ret.scheme = match[2] || ret.scheme;\n ret.authority = match[4] || ret.authority;\n ret.path = match[5] || ret.path;\n ret.query = match[7] || ret.query;\n ret.fragment = match[9] || ret.fragment;\n }\n return ret;\n };\n URI.from = function (components) {\n return new URI().with(components);\n };\n URI._validate = function (ret) {\n // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n if (ret.scheme && !URI._schemePattern.test(ret.scheme)) {\n throw new Error('[UriError]: Scheme contains illegal characters.');\n }\n // path, http://tools.ietf.org/html/rfc3986#section-3.3\n // If a URI contains an authority component, then the path component\n // must either be empty or begin with a slash (\"/\") character. If a URI\n // does not contain an authority component, then the path cannot begin\n // with two slash characters (\"//\").\n if (ret.path) {\n if (ret.authority) {\n if (!URI._singleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n }\n }\n else {\n if (URI._doubleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n }\n }\n }\n };\n // ---- printing/externalize ---------------------------\n /**\n *\n * @param skipEncoding Do not encode the result, default is `false`\n */\n URI.prototype.toString = function (skipEncoding) {\n if (skipEncoding === void 0) { skipEncoding = false; }\n if (!skipEncoding) {\n if (!this._formatted) {\n this._formatted = URI._asFormatted(this, false);\n }\n return this._formatted;\n }\n else {\n // we don't cache that\n return URI._asFormatted(this, true);\n }\n };\n URI._asFormatted = function (uri, skipEncoding) {\n var encoder = !skipEncoding\n ? encodeURIComponent2\n : encodeNoop;\n var parts = [];\n var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;\n if (scheme) {\n parts.push(scheme, ':');\n }\n if (authority || scheme === 'file') {\n parts.push('//');\n }\n if (authority) {\n authority = authority.toLowerCase();\n var idx = authority.indexOf(':');\n if (idx === -1) {\n parts.push(encoder(authority));\n }\n else {\n parts.push(encoder(authority.substr(0, idx)), authority.substr(idx));\n }\n }\n if (path) {\n // lower-case windows drive letters in /C:/fff or C:/fff\n var m = URI._upperCaseDrive.exec(path);\n if (m) {\n if (m[1]) {\n path = '/' + m[2].toLowerCase() + path.substr(3); // \"/c:\".length === 3\n }\n else {\n path = m[2].toLowerCase() + path.substr(2); // // \"c:\".length === 2\n }\n }\n // encode every segement but not slashes\n // make sure that # and ? are always encoded\n // when occurring in paths - otherwise the result\n // cannot be parsed back again\n var lastIdx = 0;\n while (true) {\n var idx = path.indexOf(URI._slash, lastIdx);\n if (idx === -1) {\n parts.push(encoder(path.substring(lastIdx)));\n break;\n }\n parts.push(encoder(path.substring(lastIdx, idx)), URI._slash);\n lastIdx = idx + 1;\n }\n ;\n }\n if (query) {\n parts.push('?', encoder(query));\n }\n if (fragment) {\n parts.push('#', encoder(fragment));\n }\n return parts.join(URI._empty);\n };\n URI.prototype.toJSON = function () {\n var res = {\n fsPath: this.fsPath,\n external: this.toString(),\n $mid: 1\n };\n if (this.path) {\n res.path = this.path;\n }\n if (this.scheme) {\n res.scheme = this.scheme;\n }\n if (this.authority) {\n res.authority = this.authority;\n }\n if (this.query) {\n res.query = this.query;\n }\n if (this.fragment) {\n res.fragment = this.fragment;\n }\n return res;\n };\n URI.revive = function (data) {\n var result = new URI();\n result._scheme = data.scheme || URI._empty;\n result._authority = data.authority || URI._empty;\n result._path = data.path || URI._empty;\n result._query = data.query || URI._empty;\n result._fragment = data.fragment || URI._empty;\n result._fsPath = data.fsPath;\n result._formatted = data.external;\n URI._validate(result);\n return result;\n };\n return URI;\n }());\n URI._empty = '';\n URI._slash = '/';\n URI._regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n URI._driveLetterPath = /^\\/[a-zA-z]:/;\n URI._upperCaseDrive = /^(\\/)?([A-Z]:)/;\n URI._schemePattern = /^\\w[\\w\\d+.-]*$/;\n URI._singleSlashStart = /^\\//;\n URI._doubleSlashStart = /^\\/\\//;\n exports.default = URI;\n var isWindows;\n if (typeof process === 'object') {\n isWindows = process.platform === 'win32';\n }\n else if (typeof navigator === 'object') {\n var userAgent = navigator.userAgent;\n isWindows = userAgent.indexOf('Windows') >= 0;\n }\n});\n","/**\r\nModified from https://github.com/substack/node-shell-quote/commit/72fb5a8.\r\nIncludes https://github.com/substack/node-shell-quote/pull/29, with minor\r\nmodifications to remove the unnecessary Array polyfills.\r\n\r\nUse the typed wrappers in ./string.js to access these functions.\r\n\r\nThe MIT License\r\n\r\nCopyright (c) 2013 James Halliday (mail@substack.net)\r\n\r\nPermission is hereby granted, free of charge,\r\nto any person obtaining a copy of this software and\r\nassociated documentation files (the \"Software\"), to\r\ndeal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify,\r\nmerge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom\r\nthe Software is furnished to do so,\r\nsubject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice\r\nshall be included in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\r\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR\r\nANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n@noflow\r\n*/\r\n\r\n/* eslint-disable */\r\n\r\nexports.quote = function (xs) {\r\n return xs.map(function (s) {\r\n if (s && typeof s === 'object') {\r\n return s.op.replace(/(.)/g, '\\\\$1');\r\n }\r\n else if (/[\"\\s]/.test(s) && !/'/.test(s)) {\r\n return \"'\" + s.replace(/(['\\\\])/g, '\\\\$1') + \"'\";\r\n }\r\n else if (/[\"'\\s]/.test(s)) {\r\n return '\"' + s.replace(/([\"\\\\$`!])/g, '\\\\$1') + '\"';\r\n }\r\n else {\r\n return String(s).replace(/([#!\"$&'()*,:;<=>?@\\[\\\\\\]^`{|}])/g, '\\\\$1');\r\n }\r\n }).join(' ');\r\n};\r\n\r\nvar CONTROL = '(?:' + [\r\n '\\\\|\\\\|', '\\\\&\\\\&', ';;', '\\\\|\\\\&', '[&;()|<>]'\r\n].join('|') + ')';\r\nvar META = '|&;()<> \\\\t';\r\nvar BAREWORD = '(\\\\\\\\[\\'\"' + META + ']|[^\\\\s\\'\"' + META + '])+';\r\nvar SINGLE_QUOTE = '\"((\\\\\\\\\"|[^\"])*?)\"';\r\nvar DOUBLE_QUOTE = '\\'((\\\\\\\\\\'|[^\\'])*?)\\'';\r\n\r\nvar TOKEN = '';\r\nfor (var i = 0; i < 4; i++) {\r\n TOKEN += (Math.pow(16,8)*Math.random()).toString(16);\r\n}\r\n\r\nexports.parse = function (s, env, opts) {\r\n var mapped = parse(s, env, opts);\r\n if (typeof env !== 'function') return mapped;\r\n return mapped.reduce(function (acc, s) {\r\n if (typeof s === 'object') return acc.concat(s);\r\n var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));\r\n if (xs.length === 1) return acc.concat(xs[0]);\r\n return acc.concat(xs.filter(Boolean).map(function (x) {\r\n if (RegExp('^' + TOKEN).test(x)) {\r\n return JSON.parse(x.split(TOKEN)[1]); }\r\n else return x;\r\n }));\r\n }, []);\r\n};\r\n\r\nfunction parse (s, env, opts) {\r\n var chunker = new RegExp([\r\n '(' + CONTROL + ')', // control chars\r\n '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')*'\r\n ].join('|'), 'g');\r\n var match = s.match(chunker).filter(Boolean);\r\n var commented = false;\r\n\r\n if (!match) return [];\r\n if (!env) env = {};\r\n if (!opts) opts = {};\r\n return match.map(function (s, j) {\r\n if (commented) {\r\n return;\r\n }\r\n if (s.charAt(0) === '#') {\r\n commented = true;\r\n return { comment: s.substr(1) + match.slice(j+1).join(' ') };\r\n }\r\n if (RegExp('^' + CONTROL + '$').test(s)) {\r\n return { op: s };\r\n }\r\n\r\n // Hand-written scanner/parser for Bash quoting rules:\r\n //\r\n // 1. inside single quotes, all characters are printed literally.\r\n // 2. inside double quotes, all characters are printed literally\r\n // except variables prefixed by '$' and backslashes followed by\r\n // either a double quote or another backslash.\r\n // 3. outside of any quotes, backslashes are treated as escape\r\n // characters and not printed (unless they are themselves escaped)\r\n // 4. quote context can switch mid-token if there is no whitespace\r\n // between the two quote contexts (e.g. all'one'\"token\" parses as\r\n // \"allonetoken\")\r\n var SQ = \"'\";\r\n var DQ = '\"';\r\n var DS = '$';\r\n var BS = opts.escape || '\\\\';\r\n var quote = false;\r\n var esc = false;\r\n var out = '';\r\n var isGlob = false;\r\n\r\n for (var i = 0, len = s.length; i < len; i++) {\r\n var c = s.charAt(i);\r\n isGlob = isGlob || (!quote && (c === '*' || c === '?'));\r\n if (esc) {\r\n out += c;\r\n esc = false;\r\n }\r\n else if (quote) {\r\n if (c === quote) {\r\n quote = false;\r\n }\r\n else if (quote == SQ) {\r\n out += c;\r\n }\r\n else { // Double quote\r\n if (c === BS) {\r\n i += 1;\r\n c = s.charAt(i);\r\n if (c === DQ || c === BS || c === DS) {\r\n out += c;\r\n } else {\r\n out += BS + c;\r\n }\r\n }\r\n else if (c === DS) {\r\n out += parseEnvVar();\r\n }\r\n else {\r\n out += c;\r\n }\r\n }\r\n }\r\n else if (c === DQ || c === SQ) {\r\n quote = c;\r\n }\r\n else if (RegExp('^' + CONTROL + '$').test(c)) {\r\n return { op: s };\r\n }\r\n else if (c === BS) {\r\n esc = true;\r\n }\r\n else if (c === DS) {\r\n out += parseEnvVar();\r\n }\r\n else out += c;\r\n }\r\n\r\n if (isGlob) return {op: 'glob', pattern: out};\r\n\r\n return out;\r\n\r\n function parseEnvVar() {\r\n i += 1;\r\n var varend, varname;\r\n //debugger\r\n if (s.charAt(i) === '{') {\r\n i += 1;\r\n if (s.charAt(i) === '}') {\r\n throw new Error(\"Bad substitution: \" + s.substr(i - 2, 3));\r\n }\r\n varend = s.indexOf('}', i);\r\n if (varend < 0) {\r\n throw new Error(\"Bad substitution: \" + s.substr(i));\r\n }\r\n varname = s.substr(i, varend - i);\r\n i = varend;\r\n }\r\n else if (/[*@#?$!_\\-]/.test(s.charAt(i))) {\r\n varname = s.charAt(i);\r\n i += 1;\r\n }\r\n else {\r\n varend = s.substr(i).match(/[^\\w\\d_]/);\r\n if (!varend) {\r\n varname = s.substr(i);\r\n i = s.length;\r\n } else {\r\n varname = s.substr(i, varend.index);\r\n i += varend.index - 1;\r\n }\r\n }\r\n return getVar(null, '', varname);\r\n }\r\n })\r\n // finalize parsed aruments\r\n .reduce(function(prev, arg){\r\n if (arg === undefined){\r\n return prev;\r\n }\r\n return prev.concat(arg);\r\n },[]);\r\n\r\n function getVar (_, pre, key) {\r\n var r = typeof env === 'function' ? env(key) : env[key];\r\n if (r === undefined) r = '';\r\n\r\n if (typeof r === 'object') {\r\n return pre + TOKEN + JSON.stringify(r) + TOKEN;\r\n }\r\n else return pre + r;\r\n }\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport invariant from 'assert';\r\nimport {parse, quote} from './_shell-quote';\r\n\r\nexport function stringifyError(error: Error): string {\r\n return `name: ${error.name}, message: ${error.message}, stack: ${\r\n error.stack\r\n }.`;\r\n}\r\n\r\n// As of Flow v0.28, Flow does not alllow implicit string coercion of null or undefined. Use this to\r\n// make it explicit.\r\nexport function maybeToString(str: ?string): string {\r\n // We don't want to encourage the use of this function directly because it coerces anything to a\r\n // string. We get stricter typechecking by using maybeToString, so it should generally be\r\n // preferred.\r\n return String(str);\r\n}\r\n\r\n/**\r\n * Originally adapted from https://github.com/azer/relative-date.\r\n * We're including it because of https://github.com/npm/npm/issues/12012\r\n */\r\nconst SECOND = 1000;\r\nconst MINUTE = 60 * SECOND;\r\nconst HOUR = 60 * MINUTE;\r\nconst DAY = 24 * HOUR;\r\nconst WEEK = 7 * DAY;\r\nconst YEAR = DAY * 365;\r\nconst MONTH = YEAR / 12;\r\n\r\nconst shortFormats = [\r\n [0.7 * MINUTE, 'now'],\r\n [1.5 * MINUTE, '1m'],\r\n [60 * MINUTE, 'm', MINUTE],\r\n [1.5 * HOUR, '1h'],\r\n [DAY, 'h', HOUR],\r\n [2 * DAY, '1d'],\r\n [7 * DAY, 'd', DAY],\r\n [1.5 * WEEK, '1w'],\r\n [MONTH, 'w', WEEK],\r\n [1.5 * MONTH, '1mo'],\r\n [YEAR, 'mo', MONTH],\r\n [1.5 * YEAR, '1y'],\r\n [Number.MAX_VALUE, 'y', YEAR],\r\n];\r\n\r\nconst longFormats = [\r\n [0.7 * MINUTE, 'just now'],\r\n [1.5 * MINUTE, 'a minute ago'],\r\n [60 * MINUTE, 'minutes ago', MINUTE],\r\n [1.5 * HOUR, 'an hour ago'],\r\n [DAY, 'hours ago', HOUR],\r\n [2 * DAY, 'yesterday'],\r\n [7 * DAY, 'days ago', DAY],\r\n [1.5 * WEEK, 'a week ago'],\r\n [MONTH, 'weeks ago', WEEK],\r\n [1.5 * MONTH, 'a month ago'],\r\n [YEAR, 'months ago', MONTH],\r\n [1.5 * YEAR, 'a year ago'],\r\n [Number.MAX_VALUE, 'years ago', YEAR],\r\n];\r\n\r\nconst longFormatsNumbers = [\r\n [0.7 * MINUTE, 'just now'],\r\n [1.5 * MINUTE, '1 minute ago'],\r\n [60 * MINUTE, 'minutes ago', MINUTE],\r\n [1.5 * HOUR, '1 hour ago'],\r\n [DAY, 'hours ago', HOUR],\r\n [2 * DAY, 'yesterday'],\r\n [7 * DAY, 'days ago', DAY],\r\n [1.5 * WEEK, '1 week ago'],\r\n [MONTH, 'weeks ago', WEEK],\r\n [1.5 * MONTH, '1 month ago'],\r\n [YEAR, 'months ago', MONTH],\r\n [1.5 * YEAR, '1 year ago'],\r\n [Number.MAX_VALUE, 'years ago', YEAR],\r\n];\r\n\r\nexport function relativeDate(\r\n input_: number | Date,\r\n reference_?: number | Date,\r\n useShortVariant?: boolean = false,\r\n useNumbersOnly?: boolean = false,\r\n): string {\r\n let input = input_;\r\n let reference = reference_;\r\n if (input instanceof Date) {\r\n input = input.getTime();\r\n }\r\n // flowlint-next-line sketchy-null-number:off\r\n if (!reference) {\r\n reference = new Date().getTime();\r\n }\r\n if (reference instanceof Date) {\r\n reference = reference.getTime();\r\n }\r\n\r\n const delta = reference - input;\r\n const formats = useShortVariant\r\n ? shortFormats\r\n : useNumbersOnly\r\n ? longFormatsNumbers\r\n : longFormats;\r\n for (const [limit, relativeFormat, remainder] of formats) {\r\n if (delta < limit) {\r\n if (typeof remainder === 'number') {\r\n return (\r\n Math.round(delta / remainder) +\r\n (useShortVariant ? '' : ' ') +\r\n relativeFormat\r\n );\r\n } else {\r\n return relativeFormat;\r\n }\r\n }\r\n }\r\n\r\n throw new Error('This should never be reached.');\r\n}\r\n\r\n/**\r\n * Count the number of occurrences of `char` in `str`.\r\n * `char` must be a string of length 1.\r\n */\r\nexport function countOccurrences(haystack: string, char: string) {\r\n invariant(char.length === 1, 'char must be a string of length 1');\r\n\r\n let count = 0;\r\n const code = char.charCodeAt(0);\r\n for (let i = 0; i < haystack.length; i++) {\r\n if (haystack.charCodeAt(i) === code) {\r\n count++;\r\n }\r\n }\r\n return count;\r\n}\r\n\r\n/**\r\n * shell-quote's parse allows pipe operators and comments.\r\n * Generally users don't care about this, so throw if we encounter any operators.\r\n */\r\nexport function shellParse(str: string, env?: Object): Array {\r\n const result = parse(str, env);\r\n for (let i = 0; i < result.length; i++) {\r\n if (typeof result[i] !== 'string') {\r\n if (result[i].op != null) {\r\n throw new Error(\r\n `Unexpected operator \"${result[i].op}\" provided to shellParse`,\r\n );\r\n } else {\r\n throw new Error(\r\n `Unexpected comment \"${result[i].comment}\" provided to shellParse`,\r\n );\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * shell-quote's parse allows pipe operators and comments and globs\r\n * We treat glob patterns as normal strings. For the other operators, we throw.\r\n */\r\nexport function shellParseWithGlobs(str: string, env?: Object): Array {\r\n const result = parse(str, env);\r\n for (let i = 0; i < result.length; i++) {\r\n if (typeof result[i] !== 'string') {\r\n if (result[i].op === 'glob') {\r\n result[i] = result[i].pattern;\r\n } else if (result[i].op != null) {\r\n throw new Error(\r\n `Unexpected operator \"${result[i].op}\" provided to shellParse`,\r\n );\r\n } else {\r\n throw new Error(\r\n `Unexpected comment \"${result[i].comment}\" provided to shellParse`,\r\n );\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Technically you can pass in { operator: string } here,\r\n * but we don't use that in most APIs.\r\n */\r\nexport function shellQuote(args: Array): string {\r\n return quote(args);\r\n}\r\n\r\nexport function removeCommonPrefix(a: string, b: string): [string, string] {\r\n let i = 0;\r\n while (a[i] === b[i] && i < a.length && i < b.length) {\r\n i++;\r\n }\r\n return [a.substring(i), b.substring(i)];\r\n}\r\n\r\nexport function removeCommonSuffix(a: string, b: string): [string, string] {\r\n let i = 0;\r\n while (\r\n a[a.length - 1 - i] === b[b.length - 1 - i] &&\r\n i < a.length &&\r\n i < b.length\r\n ) {\r\n i++;\r\n }\r\n return [a.substring(0, a.length - i), b.substring(0, b.length - i)];\r\n}\r\n\r\nexport function shorten(\r\n str: string,\r\n maxLength: number,\r\n suffix?: string,\r\n): string {\r\n return str.length < maxLength\r\n ? str\r\n : str.slice(0, maxLength) + (suffix || '');\r\n}\r\n\r\n/**\r\n * Like String.split, but only splits once.\r\n */\r\nexport function splitOnce(str: string, separator: string): [string, ?string] {\r\n const index = str.indexOf(separator);\r\n return index === -1\r\n ? [str, null]\r\n : [str.slice(0, index), str.slice(index + separator.length)];\r\n}\r\n\r\n/**\r\n * Indents each line by the specified number of characters.\r\n */\r\nexport function indent(\r\n str: string,\r\n level: number = 2,\r\n char: string = ' ',\r\n): string {\r\n return str.replace(/^([^\\n])/gm, char.repeat(level) + '$1');\r\n}\r\n\r\nexport function pluralize(noun: string, count: number) {\r\n return count === 1 ? noun : noun + 's';\r\n}\r\n\r\nexport function capitalize(str: string): string {\r\n return str.length === 0\r\n ? str\r\n : str\r\n .charAt(0)\r\n .toUpperCase()\r\n .concat(str.slice(1));\r\n}\r\n\r\ntype MatchRange = [/* start */ number, /* end */ number];\r\n\r\n/**\r\n * Returns a list of ranges where needle occurs in haystack.\r\n * This will *not* return overlapping matches; i.e. the returned list will be disjoint.\r\n * This makes it easier to use for e.g. highlighting matches in a UI.\r\n */\r\nexport function getMatchRanges(\r\n haystack: string,\r\n needle: string,\r\n): Array {\r\n if (needle === '') {\r\n // Not really a valid use.\r\n return [];\r\n }\r\n\r\n const ranges = [];\r\n let matchIndex = 0;\r\n while ((matchIndex = haystack.indexOf(needle, matchIndex)) !== -1) {\r\n const prevRange = ranges[ranges.length - 1];\r\n if (prevRange != null && prevRange[1] === matchIndex) {\r\n prevRange[1] += needle.length;\r\n } else {\r\n ranges.push([matchIndex, matchIndex + needle.length]);\r\n }\r\n matchIndex += needle.length;\r\n }\r\n return ranges;\r\n}\r\n\r\nexport function escapeMarkdown(markdown: string): string {\r\n // Which characters can be backslash-escaped?\r\n // markdown: ! # ()*+ -. [\\] _`{ } https://daringfireball.net/projects/markdown/syntax#backslash\r\n // commonMark: !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ https://spec.commonmark.org/0.28/#backslash-escapes\r\n // We'll only backslash-escape the lowest common denominator.\r\n const slashEscaped = markdown.replace(/[#!()*+\\-.[\\\\\\]_`{}]/g, '\\\\$&');\r\n // And HTML tags need to be < > escaped.\r\n return slashEscaped.replace(//g, '>');\r\n}\r\n\r\n// Originally copied from:\r\n// http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url\r\n// But adopted to match `www.` urls as well as `https?` urls\r\n// and `!` as acceptable url piece.\r\n// Then optimized with https://www.npmjs.com/package/regexp-tree.\r\n// Added a single matching group for use with String.split.\r\n// eslint-disable-next-line max-len\r\nexport const URL_REGEX = /(https?:\\/\\/(?:www\\.)?[-\\w@:%.+~#=]{2,256}\\.[a-z]{2,6}\\b[-\\w@:%+.~#?&/=!]*|www\\.[-\\w@:%.+~#=]{2,256}\\.[a-z]{2,6}\\b[-\\w@:%+.~#?&/=!]*)/;\r\n\r\nexport const ELLIPSIS_CHAR = '\\u2026';\r\nexport const ZERO_WIDTH_SPACE = '\\u200B';\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow strict-local\r\n * @format\r\n */\r\n\r\n// NuclideUri's are either a local file path, or a URI\r\n// of the form nuclide://\r\n//\r\n// This package creates, queries and decomposes NuclideUris.\r\n\r\nimport LspUri from 'vscode-uri';\r\n\r\nexport type NuclideUri = string;\r\n\r\ntype ParsedUrl = {\r\n hostname: ?string,\r\n path: string,\r\n};\r\n\r\ntype ParsedRemoteUrl = {\r\n hostname: string,\r\n path: string,\r\n};\r\n\r\ntype ParsedPath = {\r\n root: string,\r\n dir: string,\r\n base: string,\r\n ext: string,\r\n name: string,\r\n};\r\n\r\nimport invariant from 'assert';\r\n// eslint-disable-next-line nuclide-internal/prefer-nuclide-uri\r\nimport pathModule from 'path';\r\n\r\nimport os from 'os';\r\nimport {maybeToString} from './string';\r\n\r\nconst ARCHIVE_SEPARATOR = '!';\r\nconst KNOWN_ARCHIVE_EXTENSIONS = [];\r\n\r\nconst REMOTE_PATH_URI_PREFIX = 'nuclide://';\r\n// TODO(ljw): following regex is incorrect. A URI scheme must start with\r\n// [A-Za-z] not [0-9_-]. Also, not all schemes require // after them.\r\nconst URI_PREFIX_REGEX = /^[A-Za-z0-9_-]+:\\/\\/.*/;\r\n\r\nfunction isRemote(uri: NuclideUri): boolean {\r\n return uri.startsWith(REMOTE_PATH_URI_PREFIX);\r\n}\r\n\r\n// Atom often puts its URIs in places where we'd expect to see Nuclide URIs (or plain paths)\r\nfunction isAtomUri(uri: NuclideUri): boolean {\r\n return uri.startsWith('atom://');\r\n}\r\n\r\nfunction isUri(uri: string): boolean {\r\n return URI_PREFIX_REGEX.test(uri);\r\n}\r\n\r\nfunction isLocal(uri: NuclideUri): boolean {\r\n return !isRemote(uri) && !isUri(uri) && !isAtomUri(uri);\r\n}\r\n\r\nfunction createRemoteUri(hostname: string, remotePath: string): string {\r\n invariant(\r\n remotePath != null && remotePath !== '',\r\n 'NuclideUri must include a path.',\r\n );\r\n return `nuclide://${hostname}${remotePath}`;\r\n}\r\n\r\nfunction isInArchive(uri: NuclideUri): boolean {\r\n if (isAtomUri(uri) || uri.indexOf(ARCHIVE_SEPARATOR) < 0) {\r\n return false;\r\n }\r\n for (\r\n let i = uri.indexOf(ARCHIVE_SEPARATOR);\r\n i >= 0;\r\n i = uri.indexOf(ARCHIVE_SEPARATOR, i + 1)\r\n ) {\r\n if (_isArchiveSeparator(uri, i)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction ancestorOutsideArchive(uri: NuclideUri): NuclideUri {\r\n for (\r\n let i = uri.indexOf(ARCHIVE_SEPARATOR);\r\n i >= 0;\r\n i = uri.indexOf(ARCHIVE_SEPARATOR, i + 1)\r\n ) {\r\n if (_isArchiveSeparator(uri, i)) {\r\n return uri.substring(0, i);\r\n }\r\n }\r\n return uri;\r\n}\r\n\r\n/**\r\n * Parses valid Nuclide URIs into the hostname and path components.\r\n * Throws an Error on invalid URIs. Invalid URIs are:\r\n * 1) Any URI that does not start with 'nuclide://' protocol.\r\n * 2) A URI starting with 'nuclide://' that doesn't contain either a hostname or a path\r\n *\r\n * Everything that does not contain a '://' is assumed to be a local path. Both POSIX and Windows\r\n * paths are legal\r\n */\r\nfunction parse(uri: NuclideUri): ParsedUrl {\r\n if (uri.startsWith(REMOTE_PATH_URI_PREFIX)) {\r\n const hostAndPath = uri.substr(REMOTE_PATH_URI_PREFIX.length);\r\n const hostSep = hostAndPath.indexOf('/');\r\n\r\n invariant(\r\n hostSep !== -1,\r\n `Remote URIs must contain a hostname and a path. Failed to parse ${uri}`,\r\n );\r\n\r\n const hostname = hostAndPath.substr(0, hostSep);\r\n invariant(\r\n hostname !== '',\r\n `Remote URIs must contain a hostname. Failed to parse ${uri}`,\r\n );\r\n\r\n const path = hostAndPath.substr(hostSep);\r\n invariant(\r\n !_endsWithArchiveSeparator(uri),\r\n `Path cannot end with archive separator. Failed to parse ${uri}`,\r\n );\r\n return {hostname, path};\r\n }\r\n\r\n invariant(\r\n !_endsWithArchiveSeparator(uri),\r\n `Path cannot end with archive separator. Failed to parse ${uri}`,\r\n );\r\n return {hostname: null, path: uri};\r\n}\r\n\r\nfunction parseRemoteUri(remoteUri: NuclideUri): ParsedRemoteUrl {\r\n if (!isRemote(remoteUri)) {\r\n throw new Error('Expected remote uri. Got ' + remoteUri);\r\n }\r\n const parsedUri = parse(remoteUri);\r\n invariant(\r\n // flowlint-next-line sketchy-null-string:off\r\n parsedUri.hostname,\r\n `Remote Nuclide URIs must contain hostnames, '${maybeToString(\r\n parsedUri.hostname,\r\n )}' found while parsing '${remoteUri}'`,\r\n );\r\n\r\n // Explicitly copying object properties appeases Flow's \"maybe\" type handling. Using the `...`\r\n // operator causes null/undefined errors, and `Object.assign` bypasses type checking.\r\n return {\r\n hostname: parsedUri.hostname,\r\n path: parsedUri.path,\r\n };\r\n}\r\n\r\nfunction getPath(uri: NuclideUri): string {\r\n return parse(uri).path;\r\n}\r\n\r\nfunction getHostname(remoteUri: NuclideUri): string {\r\n return parseRemoteUri(remoteUri).hostname;\r\n}\r\n\r\nfunction getHostnameOpt(remoteUri: ?NuclideUri): ?string {\r\n if (remoteUri == null || !isRemote(remoteUri)) {\r\n return null;\r\n }\r\n\r\n return getHostname(remoteUri);\r\n}\r\n\r\nfunction join(uri: NuclideUri, ...relativePath: Array): NuclideUri {\r\n return joinArray(uri, relativePath);\r\n}\r\n\r\nfunction joinArray(uri: NuclideUri, relativePath: Array): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n if (isRemote(uri)) {\r\n const {hostname, path} = parseRemoteUri(uri);\r\n relativePath.splice(0, 0, path);\r\n _archiveEncodeArrayInPlace(uriPathModule, relativePath);\r\n return _archiveDecode(\r\n uriPathModule,\r\n createRemoteUri(hostname, uriPathModule.join.apply(null, relativePath)),\r\n );\r\n } else {\r\n relativePath.splice(0, 0, uri);\r\n _archiveEncodeArrayInPlace(uriPathModule, relativePath);\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.join.apply(null, relativePath),\r\n );\r\n }\r\n}\r\n\r\nfunction archiveJoin(uri: NuclideUri, path: string): NuclideUri {\r\n _testForIllegalUri(uri);\r\n if (!KNOWN_ARCHIVE_EXTENSIONS.some(ext => uri.endsWith(ext))) {\r\n throw new Error(`Cannot archiveJoin with non-archive ${uri} and ${path}`);\r\n }\r\n return uri + ARCHIVE_SEPARATOR + path;\r\n}\r\n\r\nfunction normalize(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n if (isRemote(uri)) {\r\n const {hostname, path} = parseRemoteUri(uri);\r\n const normal = _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.normalize(_archiveEncode(uriPathModule, path)),\r\n );\r\n return createRemoteUri(hostname, normal);\r\n } else {\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.normalize(_archiveEncode(uriPathModule, uri)),\r\n );\r\n }\r\n}\r\n\r\nfunction normalizeDir(uri: NuclideUri): NuclideUri {\r\n return ensureTrailingSeparator(normalize(uri));\r\n}\r\n\r\nfunction getParent(uri: NuclideUri): NuclideUri {\r\n // TODO: Is this different than dirname?\r\n return normalize(join(uri, '..'));\r\n}\r\n\r\nfunction relative(uri: NuclideUri, other: NuclideUri): string {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n const remote = isRemote(uri);\r\n if (\r\n remote !== isRemote(other) ||\r\n (remote && getHostname(uri) !== getHostname(other))\r\n ) {\r\n throw new Error(\r\n `Cannot relative urls on different hosts: ${uri} and ${other}`,\r\n );\r\n }\r\n const uriEncode = _archiveEncode(uriPathModule, remote ? getPath(uri) : uri);\r\n const otherEncode = _archiveEncode(\r\n uriPathModule,\r\n remote ? getPath(other) : other,\r\n );\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.relative(\r\n _matchTrailingArchive(uriEncode, otherEncode),\r\n _matchTrailingArchive(otherEncode, uriEncode),\r\n ),\r\n );\r\n}\r\n\r\nfunction basename(uri: NuclideUri, ext: string = ''): string {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.basename(_archiveEncode(uriPathModule, getPath(uri)), ext),\r\n );\r\n}\r\n\r\nfunction dirname(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n if (isRemote(uri)) {\r\n const {hostname, path} = parseRemoteUri(uri);\r\n return createRemoteUri(\r\n hostname,\r\n _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.dirname(_archiveEncode(uriPathModule, path)),\r\n ),\r\n );\r\n } else {\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.dirname(_archiveEncode(uriPathModule, uri)),\r\n );\r\n }\r\n}\r\n\r\nfunction extname(uri: NuclideUri): string {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.extname(_archiveEncode(uriPathModule, getPath(uri))),\r\n );\r\n}\r\n\r\nfunction stripExtension(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const ext = extname(uri);\r\n if (ext.length === 0) {\r\n return uri;\r\n }\r\n\r\n return uri.slice(0, -1 * ext.length);\r\n}\r\n\r\nfunction _isWindowsPath(path: string): boolean {\r\n return _pathModuleFor(path) === pathModule.win32;\r\n}\r\n\r\nfunction _getWindowsPathFromWindowsFileUri(uri: string): ?string {\r\n const prefix = 'file://';\r\n if (!uri.startsWith(prefix)) {\r\n return null;\r\n }\r\n\r\n const path = uri.substr(prefix.length);\r\n return _isWindowsPath(path) ? path : null;\r\n}\r\n\r\n/**\r\n * uri is either a file: uri, or a nuclide: uri.\r\n * must convert file: uri's to just a path for atom.\r\n *\r\n * Returns null if not a valid file: URI.\r\n */\r\nfunction uriToNuclideUri(uri: string): ?string {\r\n // file:// URIs should never normally contain Windows backslashes:\r\n // e.g. vscode-uri escapes C:\\abc to file:///c:/abc.\r\n // This just handles any hacky users that simply prepended 'file://'.\r\n // (vscode-uri does not know how to handle file://C:\\abc.)\r\n const windowsPathFromUri = _getWindowsPathFromWindowsFileUri(uri);\r\n if (windowsPathFromUri != null) {\r\n return windowsPathFromUri;\r\n }\r\n\r\n const lspUri = LspUri.parse(uri);\r\n if (lspUri.scheme === 'file' && lspUri.path) {\r\n // only handle real files for now.\r\n return lspUri.fsPath;\r\n } else if (isRemote(uri)) {\r\n return uri;\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Converts local paths to file: URI's. Leaves remote URI's alone.\r\n */\r\nfunction nuclideUriToUri(uri: NuclideUri): string {\r\n _testForIllegalUri(uri);\r\n if (isRemote(uri)) {\r\n return uri;\r\n } else {\r\n return LspUri.file(uri).toString();\r\n }\r\n}\r\n\r\n/**\r\n * Returns true if child is equal to, or is a proper descendant of parent.\r\n */\r\nfunction contains(parent: NuclideUri, child: NuclideUri): boolean {\r\n _testForIllegalUri(parent);\r\n _testForIllegalUri(child);\r\n\r\n // Can't just do startsWith here. If this directory is \"www\" and you\r\n // are trying to check \"www-base\", just using startsWith would return\r\n // true, even though \"www-base\" is at the same level as \"Www\", not\r\n // contained in it.\r\n // Also, there's an issue with a trailing separator ambiguity. A path\r\n // like /abc/ does contain /abc\r\n // This function is used in some performance-sensitive parts, so we\r\n // want to avoid doing unnecessary string copy, as those that would\r\n // result from an ensureTrailingSeparator() call\r\n //\r\n // First we'll check the lengths.\r\n // Then check startsWith. If so, then if the two path lengths are\r\n // equal OR if the next character in the path to check is a path\r\n // separator, then we know the checked path is in this path.\r\n\r\n if (child.length < parent.length) {\r\n // A strong indication of false\r\n // It could be a matter of a trailing separator, though\r\n if (child.length < parent.length - 1) {\r\n // It must be more than just the separator\r\n return false;\r\n }\r\n\r\n return (\r\n parent.startsWith(child) &&\r\n (endsWithSeparator(parent) || _isArchiveSeparator(child, parent.length))\r\n );\r\n }\r\n\r\n if (!child.startsWith(parent)) {\r\n return false;\r\n }\r\n\r\n if (endsWithSeparator(parent) || parent.length === child.length) {\r\n return true;\r\n }\r\n\r\n const uriPathModule = _pathModuleFor(child);\r\n\r\n return (\r\n _isArchiveSeparator(child, parent.length) ||\r\n child.slice(parent.length).startsWith(uriPathModule.sep)\r\n );\r\n}\r\n\r\n/**\r\n * Filter an array of paths to contain only the collapsed root paths, e.g.\r\n * [a/b/c, a/, c/d/, c/d/e] collapses to [a/, c/d/]\r\n */\r\nfunction collapse(paths: Array): Array {\r\n return paths.filter(p => !paths.some(fp => contains(fp, p) && fp !== p));\r\n}\r\n\r\nconst hostFormatters = [];\r\n\r\n// A formatter which may shorten hostnames.\r\n// Returns null if the formatter won't shorten the hostname.\r\nexport type HostnameFormatter = (uri: NuclideUri) => ?string;\r\n\r\n// Registers a host formatter for nuclideUriToDisplayString\r\nfunction registerHostnameFormatter(formatter: HostnameFormatter): IDisposable {\r\n hostFormatters.push(formatter);\r\n return {\r\n dispose: () => {\r\n const index = hostFormatters.indexOf(formatter);\r\n if (index >= 0) {\r\n hostFormatters.splice(index, 1);\r\n }\r\n },\r\n };\r\n}\r\n\r\nfunction hostnameToDisplayHostname(hostname: string): string {\r\n return hostFormatters.reduce((current, formatter) => {\r\n const next = formatter(current);\r\n if (next != null && next !== '') {\r\n return next;\r\n } else {\r\n return current;\r\n }\r\n }, hostname);\r\n}\r\n\r\nfunction nuclideUriToDisplayHostname(uri: NuclideUri): string {\r\n _testForIllegalUri(uri);\r\n return isRemote(uri) ? hostnameToDisplayHostname(getHostname(uri)) : uri;\r\n}\r\n\r\n/**\r\n * NuclideUris should never be shown to humans.\r\n * This function returns a human usable string.\r\n */\r\nfunction nuclideUriToDisplayString(uri: NuclideUri): string {\r\n _testForIllegalUri(uri);\r\n return isRemote(uri)\r\n ? `${nuclideUriToDisplayHostname(uri)}:${getPath(uri)}`\r\n : uri;\r\n}\r\n\r\nfunction ensureTrailingSeparator(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n if (uri.endsWith(uriPathModule.sep)) {\r\n return uri;\r\n }\r\n\r\n return uri + uriPathModule.sep;\r\n}\r\n\r\nfunction trimTrailingSeparator(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n let stripped = uri;\r\n\r\n while (stripped.endsWith(uriPathModule.sep) && !isRoot(stripped)) {\r\n stripped = stripped.slice(0, -1 * uriPathModule.sep.length);\r\n }\r\n\r\n return stripped;\r\n}\r\n\r\nfunction endsWithSeparator(uri: NuclideUri): boolean {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n return uri.endsWith(uriPathModule.sep);\r\n}\r\n\r\nfunction endsWithEdenDir(uri: NuclideUri): boolean {\r\n _testForIllegalUri(uri);\r\n return uri.endsWith('.eden');\r\n}\r\n\r\nfunction isAbsolute(uri: NuclideUri): boolean {\r\n _testForIllegalUri(uri);\r\n if (isRemote(uri)) {\r\n return true;\r\n } else {\r\n const uriPathModule = _pathModuleFor(uri);\r\n return uriPathModule.isAbsolute(uri);\r\n }\r\n}\r\n\r\nfunction resolve(uri: NuclideUri, ...paths: Array): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n if (isRemote(uri)) {\r\n const {hostname, path} = parseRemoteUri(uri);\r\n paths.splice(0, 0, path);\r\n _archiveEncodeArrayInPlace(uriPathModule, paths);\r\n return createRemoteUri(\r\n hostname,\r\n _archiveDecode(uriPathModule, uriPathModule.resolve.apply(null, paths)),\r\n );\r\n } else {\r\n paths.splice(0, 0, uri);\r\n _archiveEncodeArrayInPlace(uriPathModule, paths);\r\n return _archiveDecode(\r\n uriPathModule,\r\n uriPathModule.resolve.apply(null, paths),\r\n );\r\n }\r\n}\r\n\r\nfunction isHomeRelative(uri: NuclideUri): boolean {\r\n _testForIllegalUri(uri);\r\n return uri.startsWith('~');\r\n}\r\n\r\nfunction expandHomeDir(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n\r\n // Do not expand non home relative uris\r\n if (!uri.startsWith('~')) {\r\n return uri;\r\n }\r\n\r\n // \"home\" on Windows is %UserProfile%. Note that Windows environment variables\r\n // are NOT case sensitive, but process.env is a magic object that wraps GetEnvironmentVariableW\r\n // on Windows, so asking for any case is expected to work.\r\n const {HOME, UserProfile} = process.env;\r\n\r\n const isWindows = !isRemote(uri) && os.platform() === 'win32';\r\n const homePath = isWindows ? UserProfile : HOME;\r\n invariant(homePath != null);\r\n\r\n if (uri === '~') {\r\n return homePath;\r\n }\r\n\r\n // Uris like ~abc should not be expanded\r\n if (!uri.startsWith('~/') && (!isWindows || !uri.startsWith('~\\\\'))) {\r\n return uri;\r\n }\r\n\r\n return pathModule.resolve(homePath, uri.replace('~', '.'));\r\n}\r\n\r\n/**\r\n * Splits a string containing local paths by an OS-specific path delimiter\r\n * Useful for splitting env variables such as PATH\r\n *\r\n * Since remote URI might contain the delimiter, only local paths are allowed.\r\n */\r\nfunction splitPathList(paths: string): Array {\r\n invariant(\r\n paths.indexOf(REMOTE_PATH_URI_PREFIX) < 0,\r\n 'Splitting remote URIs is not supported',\r\n );\r\n const uriPathModule = _pathModuleFor(paths);\r\n\r\n return paths.split(uriPathModule.delimiter);\r\n}\r\n\r\n/**\r\n * Joins an array of local paths with an OS-specific path delimiter into a single string.\r\n * Useful for constructing env variables such as PATH\r\n *\r\n * Since remote URI might contain the delimiter, only local paths are allowed.\r\n */\r\nfunction joinPathList(paths: Array): string {\r\n if (paths.length === 0) {\r\n return '';\r\n }\r\n\r\n invariant(\r\n paths.every(path => !isRemote(path)),\r\n 'Joining of remote URIs is not supported',\r\n );\r\n\r\n const uriPathModule = _pathModuleFor(paths[0]);\r\n return paths.join(uriPathModule.delimiter);\r\n}\r\n\r\n/**\r\n * This function prepends the given relative path with a \"current-folder\" prefix\r\n * which is `./` on *nix and .\\ on Windows\r\n */\r\nfunction ensureLocalPrefix(uri: NuclideUri): NuclideUri {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n\r\n invariant(!isRemote(uri), 'Local prefix can not be added to a remote path');\r\n invariant(\r\n !isAbsolute(uri),\r\n 'Local prefix can not be added to an absolute path',\r\n );\r\n\r\n const localPrefix = `.${uriPathModule.sep}`;\r\n if (uri.startsWith(localPrefix)) {\r\n return uri;\r\n }\r\n\r\n return localPrefix + uri;\r\n}\r\n\r\nfunction isRoot(uri: NuclideUri): boolean {\r\n _testForIllegalUri(uri);\r\n return dirname(uri) === uri;\r\n}\r\n\r\nfunction parsePath(uri: NuclideUri): ParsedPath {\r\n _testForIllegalUri(uri);\r\n const uriPathModule = _pathModuleFor(uri);\r\n const parsed = uriPathModule.parse(\r\n _archiveEncode(uriPathModule, getPath(uri)),\r\n );\r\n return {\r\n root: _archiveDecode(uriPathModule, parsed.root),\r\n dir: _archiveDecode(uriPathModule, parsed.dir),\r\n base: _archiveDecode(uriPathModule, parsed.base),\r\n ext: _archiveDecode(uriPathModule, parsed.ext),\r\n name: _archiveDecode(uriPathModule, parsed.name),\r\n };\r\n}\r\n\r\nfunction pathSeparatorFor(uri: NuclideUri): string {\r\n return _pathModuleFor(uri).sep;\r\n}\r\n\r\nfunction split(uri: NuclideUri): Array {\r\n const parts = [];\r\n let current = uri;\r\n let parent = dirname(current);\r\n\r\n while (current !== parent) {\r\n parts.push(basename(current));\r\n\r\n current = parent;\r\n parent = dirname(current);\r\n }\r\n\r\n if (isAbsolute(uri)) {\r\n parts.push(parent);\r\n }\r\n parts.reverse();\r\n return parts;\r\n}\r\n\r\nfunction hasKnownArchiveExtension(uri: NuclideUri): boolean {\r\n return KNOWN_ARCHIVE_EXTENSIONS.some(ext => uri.endsWith(ext));\r\n}\r\n\r\nfunction _pathModuleFor(uri: NuclideUri): typeof pathModule {\r\n invariant(\r\n !_endsWithArchiveSeparator(uri),\r\n `Path cannot end with archive separator. Failed to determine path module for ${uri}`,\r\n );\r\n if (uri.startsWith(pathModule.posix.sep)) {\r\n return pathModule.posix;\r\n }\r\n if (uri.indexOf('://') > -1) {\r\n return pathModule.posix;\r\n }\r\n if (uri[1] === ':' && uri[2] === pathModule.win32.sep) {\r\n return pathModule.win32;\r\n }\r\n\r\n // This little russian roulette here is blocking T29990593. I didn't\r\n // clean it because we might see posix paths on windows and vice versa.\r\n if (\r\n uri.split(pathModule.win32.sep).length >\r\n uri.split(pathModule.posix.sep).length\r\n ) {\r\n return pathModule.win32;\r\n } else {\r\n return pathModule.posix;\r\n }\r\n}\r\n\r\n// Runs _archiveEncode in-place on array, and returns argument for convenience.\r\nfunction _archiveEncodeArrayInPlace(\r\n uriPathModule: typeof pathModule,\r\n array: Array,\r\n): Array {\r\n array.forEach((uri, i, a) => (a[i] = _archiveEncode(uriPathModule, uri)));\r\n return array;\r\n}\r\n\r\n// This adds a native separator after every archive separator\r\n// so that the native path handling code sees them.\r\nfunction _archiveEncode(\r\n uriPathModule: typeof pathModule,\r\n uri: NuclideUri,\r\n): NuclideUri {\r\n if (uri.indexOf(ARCHIVE_SEPARATOR) < 0) {\r\n return uri;\r\n }\r\n return KNOWN_ARCHIVE_EXTENSIONS.reduce(\r\n (acc, ext) =>\r\n acc.replace(\r\n `${ext}${ARCHIVE_SEPARATOR}`,\r\n `${ext}${ARCHIVE_SEPARATOR}${uriPathModule.sep}`,\r\n ),\r\n uri,\r\n );\r\n}\r\n\r\n// This is the inverse of `encodeArchiveSeparators()` to put things\r\n// back after the native path handler has run.\r\nfunction _archiveDecode(\r\n uriPathModule: typeof pathModule,\r\n uri: NuclideUri,\r\n): NuclideUri {\r\n if (uri.indexOf(ARCHIVE_SEPARATOR) < 0) {\r\n return uri;\r\n }\r\n return _trimArchiveSuffix(\r\n KNOWN_ARCHIVE_EXTENSIONS.reduce(\r\n (acc, ext) =>\r\n acc.replace(\r\n `${ext}${ARCHIVE_SEPARATOR}${uriPathModule.sep}`,\r\n `${ext}${ARCHIVE_SEPARATOR}`,\r\n ),\r\n uri,\r\n ),\r\n );\r\n}\r\n\r\n// When working with encoded uri's, the archive separator is part of the name\r\n// so we can manipulate paths with uriPathModule. However, in `relative` if\r\n// one uri contains the other, we need the names seen by uriPathModule to agree\r\n// on whether there is an archive separator or not. E.g. if we have:\r\n// /etc/file.zip\r\n// /etc/file.zip!abc\r\n// When we encode these, we get:\r\n// /etc/file.zip\r\n// /etc/file.zip!/abc\r\n// We need to add a trailing '!' to the first one so uriPathModule can see that\r\n// the first contains the second.\r\nfunction _matchTrailingArchive(uri: string, other: string): string {\r\n if (\r\n uri.length < other.length &&\r\n other.startsWith(uri) &&\r\n _isArchiveSeparator(other, uri.length)\r\n ) {\r\n return uri + ARCHIVE_SEPARATOR;\r\n } else {\r\n return uri;\r\n }\r\n}\r\n\r\nfunction _trimArchiveSuffix(path: string): string {\r\n if (_endsWithArchiveSeparator(path)) {\r\n return path.substring(0, path.length - ARCHIVE_SEPARATOR.length);\r\n } else {\r\n return path;\r\n }\r\n}\r\n\r\nfunction _endsWithArchiveSeparator(path: string): boolean {\r\n return _isArchiveSeparator(path, path.length - 1);\r\n}\r\n\r\nfunction _isArchiveSeparator(path: string, index: number): boolean {\r\n return (\r\n path.length > index &&\r\n path.charAt(index) === ARCHIVE_SEPARATOR &&\r\n KNOWN_ARCHIVE_EXTENSIONS.some(ext => {\r\n const extStart = index - ext.length;\r\n return path.indexOf(ext, extStart) === extStart;\r\n })\r\n );\r\n}\r\n\r\nfunction _testForIllegalUri(uri: ?NuclideUri): void {\r\n if (uri != null) {\r\n if (_endsWithArchiveSeparator(uri)) {\r\n throw new Error(\r\n `Path operation invoked on URI ending with ${ARCHIVE_SEPARATOR}: ${uri}`,\r\n );\r\n }\r\n }\r\n}\r\n\r\nconst NUCLIDE_URI_TYPE_NAME = 'NuclideUri';\r\n\r\n// If mustBeRemote is present then remote-ness must match, otherwise remote-ness\r\n// is ignored.\r\nfunction validate(uri: NuclideUri, mustBeRemote?: boolean): void {\r\n // Be a little extra paranoid to catch places where the type system may be weak.\r\n invariant(uri != null, 'Unexpected null NuclideUri');\r\n invariant(\r\n typeof uri === 'string',\r\n `Unexpected NuclideUri type: ${String(uri)}`,\r\n );\r\n\r\n if (isRemote(uri)) {\r\n parse(uri);\r\n invariant(mustBeRemote !== false, 'Expected remote NuclideUri');\r\n } else {\r\n invariant(uri !== '', 'NuclideUri must contain a non-empty path');\r\n invariant(mustBeRemote !== true, 'Expected local NuclideUri');\r\n }\r\n}\r\n\r\nconst IMAGE_EXTENSIONS = new Set([\r\n '.bmp',\r\n '.gif',\r\n '.ico',\r\n '.jpeg',\r\n '.jpg',\r\n '.png',\r\n '.webp',\r\n]);\r\n\r\n/**\r\n * Returns true if this filename looks like an image that Nuclide can open; otherwise false.\r\n */\r\nfunction looksLikeImageUri(uri: NuclideUri): boolean {\r\n const ext = extname(uri).toLowerCase();\r\n return IMAGE_EXTENSIONS.has(ext);\r\n}\r\n\r\nexport default {\r\n basename,\r\n dirname,\r\n extname,\r\n stripExtension,\r\n isRemote,\r\n isLocal,\r\n createRemoteUri,\r\n isInArchive,\r\n ancestorOutsideArchive,\r\n parse,\r\n parseRemoteUri,\r\n validate,\r\n getPath,\r\n getHostname,\r\n getHostnameOpt,\r\n join,\r\n joinArray,\r\n archiveJoin,\r\n relative,\r\n looksLikeImageUri,\r\n normalize,\r\n normalizeDir,\r\n getParent,\r\n uriToNuclideUri,\r\n nuclideUriToUri,\r\n contains,\r\n collapse,\r\n nuclideUriToDisplayString,\r\n nuclideUriToDisplayHostname,\r\n hostnameToDisplayHostname,\r\n registerHostnameFormatter,\r\n ensureTrailingSeparator,\r\n trimTrailingSeparator,\r\n endsWithSeparator,\r\n endsWithEdenDir,\r\n isAbsolute,\r\n isHomeRelative,\r\n resolve,\r\n expandHomeDir,\r\n splitPathList,\r\n joinPathList,\r\n ensureLocalPrefix,\r\n isRoot,\r\n parsePath,\r\n split,\r\n pathSeparatorFor,\r\n hasKnownArchiveExtension,\r\n ARCHIVE_SEPARATOR,\r\n KNOWN_ARCHIVE_EXTENSIONS,\r\n NUCLIDE_URI_TYPE_NAME,\r\n};\r\n\r\nexport const __TEST__ = {\r\n _pathModuleFor,\r\n};\r\n","\"use strict\";\n\nfunction _(message, opts) {\n return `${opts && opts.context ? opts.context : \"Value\"} ${message}.`;\n}\n\nfunction type(V) {\n if (V === null) {\n return \"Null\";\n }\n switch (typeof V) {\n case \"undefined\":\n return \"Undefined\";\n case \"boolean\":\n return \"Boolean\";\n case \"number\":\n return \"Number\";\n case \"string\":\n return \"String\";\n case \"symbol\":\n return \"Symbol\";\n case \"object\":\n // Falls through\n case \"function\":\n // Falls through\n default:\n // Per ES spec, typeof returns an implemention-defined value that is not any of the existing ones for\n // uncallable non-standard exotic objects. Yet Type() which the Web IDL spec depends on returns Object for\n // such cases. So treat the default case as an object.\n return \"Object\";\n }\n}\n\n// Round x to the nearest integer, choosing the even integer if it lies halfway between two.\nfunction evenRound(x) {\n // There are four cases for numbers with fractional part being .5:\n //\n // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example\n // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0\n // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2\n // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0\n // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2\n // (where n is a non-negative integer)\n //\n // Branch here for cases 1 and 4\n if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) ||\n (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) {\n return censorNegativeZero(Math.floor(x));\n }\n\n return censorNegativeZero(Math.round(x));\n}\n\nfunction integerPart(n) {\n return censorNegativeZero(Math.trunc(n));\n}\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction modulo(x, y) {\n // https://tc39.github.io/ecma262/#eqn-modulo\n // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos\n const signMightNotMatch = x % y;\n if (sign(y) !== sign(signMightNotMatch)) {\n return signMightNotMatch + y;\n }\n return signMightNotMatch;\n}\n\nfunction censorNegativeZero(x) {\n return x === 0 ? 0 : x;\n}\n\nfunction createIntegerConversion(bitLength, typeOpts) {\n const isSigned = !typeOpts.unsigned;\n\n let lowerBound;\n let upperBound;\n if (bitLength === 64) {\n upperBound = Math.pow(2, 53) - 1;\n lowerBound = !isSigned ? 0 : -Math.pow(2, 53) + 1;\n } else if (!isSigned) {\n lowerBound = 0;\n upperBound = Math.pow(2, bitLength) - 1;\n } else {\n lowerBound = -Math.pow(2, bitLength - 1);\n upperBound = Math.pow(2, bitLength - 1) - 1;\n }\n\n const twoToTheBitLength = Math.pow(2, bitLength);\n const twoToOneLessThanTheBitLength = Math.pow(2, bitLength - 1);\n\n return (V, opts) => {\n if (opts === undefined) {\n opts = {};\n }\n\n let x = +V;\n x = censorNegativeZero(x); // Spec discussion ongoing: https://github.com/heycam/webidl/issues/306\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite number\", opts));\n }\n\n x = integerPart(x);\n\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(_(\n `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, opts));\n }\n\n return x;\n }\n\n if (!Number.isNaN(x) && opts.clamp) {\n x = Math.min(Math.max(x, lowerBound), upperBound);\n x = evenRound(x);\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n x = integerPart(x);\n\n // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if\n // possible. Hopefully it's an optimization for the non-64-bitLength cases too.\n if (x >= lowerBound && x <= upperBound) {\n return x;\n }\n\n // These will not work great for bitLength of 64, but oh well. See the README for more details.\n x = modulo(x, twoToTheBitLength);\n if (isSigned && x >= twoToOneLessThanTheBitLength) {\n return x - twoToTheBitLength;\n }\n return x;\n };\n}\n\nexports.any = V => {\n return V;\n};\n\nexports.void = function () {\n return undefined;\n};\n\nexports.boolean = function (val) {\n return !!val;\n};\n\nexports.byte = createIntegerConversion(8, { unsigned: false });\nexports.octet = createIntegerConversion(8, { unsigned: true });\n\nexports.short = createIntegerConversion(16, { unsigned: false });\nexports[\"unsigned short\"] = createIntegerConversion(16, { unsigned: true });\n\nexports.long = createIntegerConversion(32, { unsigned: false });\nexports[\"unsigned long\"] = createIntegerConversion(32, { unsigned: true });\n\nexports[\"long long\"] = createIntegerConversion(64, { unsigned: false });\nexports[\"unsigned long long\"] = createIntegerConversion(64, { unsigned: true });\n\nexports.double = (V, opts) => {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite floating-point value\", opts));\n }\n\n return x;\n};\n\nexports[\"unrestricted double\"] = V => {\n const x = +V;\n\n return x;\n};\n\nexports.float = (V, opts) => {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(_(\"is not a finite floating-point value\", opts));\n }\n\n if (Object.is(x, -0)) {\n return x;\n }\n\n const y = Math.fround(x);\n\n if (!Number.isFinite(y)) {\n throw new TypeError(_(\"is outside the range of a single-precision floating-point value\", opts));\n }\n\n return y;\n};\n\nexports[\"unrestricted float\"] = V => {\n const x = +V;\n\n if (isNaN(x)) {\n return x;\n }\n\n if (Object.is(x, -0)) {\n return x;\n }\n\n return Math.fround(x);\n};\n\nexports.DOMString = function (V, opts) {\n if (opts === undefined) {\n opts = {};\n }\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n if (typeof V === \"symbol\") {\n throw new TypeError(_(\"is a symbol, which cannot be converted to a string\", opts));\n }\n\n return String(V);\n};\n\nexports.ByteString = (V, opts) => {\n const x = exports.DOMString(V, opts);\n let c;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(_(\"is not a valid ByteString\", opts));\n }\n }\n\n return x;\n};\n\nexports.USVString = (V, opts) => {\n const S = exports.DOMString(V, opts);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n\n return U.join(\"\");\n};\n\nexports.object = (V, opts) => {\n if (type(V) !== \"Object\") {\n throw new TypeError(_(\"is not an object\", opts));\n }\n\n return V;\n};\n\n// Not exported, but used in Function and VoidFunction.\n\n// Neither Function nor VoidFunction is defined with [TreatNonObjectAsNull], so\n// handling for that is omitted.\nfunction convertCallbackFunction(V, opts) {\n if (typeof V !== \"function\") {\n throw new TypeError(_(\"is not a function\", opts));\n }\n return V;\n}\n\n[\n Error,\n ArrayBuffer, // The IsDetachedBuffer abstract operation is not exposed in JS\n DataView, Int8Array, Int16Array, Int32Array, Uint8Array,\n Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array\n].forEach(func => {\n const name = func.name;\n const article = /^[AEIOU]/.test(name) ? \"an\" : \"a\";\n exports[name] = (V, opts) => {\n if (!(V instanceof func)) {\n throw new TypeError(_(`is not ${article} ${name} object`, opts));\n }\n\n return V;\n };\n});\n\n// Common definitions\n\nexports.ArrayBufferView = (V, opts) => {\n if (!ArrayBuffer.isView(V)) {\n throw new TypeError(_(\"is not a view on an ArrayBuffer object\", opts));\n }\n\n return V;\n};\n\nexports.BufferSource = (V, opts) => {\n if (!(ArrayBuffer.isView(V) || V instanceof ArrayBuffer)) {\n throw new TypeError(_(\"is not an ArrayBuffer object or a view on one\", opts));\n }\n\n return V;\n};\n\nexports.DOMTimeStamp = exports[\"unsigned long long\"];\n\nexports.Function = convertCallbackFunction;\n\nexports.VoidFunction = convertCallbackFunction;\n","\"use strict\";\n\n// Returns \"Type(value) is Object\" in ES terminology.\nfunction isObject(value) {\n return typeof value === \"object\" && value !== null || typeof value === \"function\";\n}\n\nfunction getReferenceToBytes(bufferSource) {\n // Node.js' Buffer does not allow subclassing for now, so we can get away with a prototype object check for perf.\n if (Object.getPrototypeOf(bufferSource) === Buffer.prototype) {\n return bufferSource;\n }\n if (bufferSource instanceof ArrayBuffer) {\n return Buffer.from(bufferSource);\n }\n return Buffer.from(bufferSource.buffer, bufferSource.byteOffset, bufferSource.byteLength);\n}\n\nfunction getCopyToBytes(bufferSource) {\n return Buffer.from(getReferenceToBytes(bufferSource));\n}\n\nfunction mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n if (keys[i] in target) {\n continue;\n }\n\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n}\n\nconst wrapperSymbol = Symbol(\"wrapper\");\nconst implSymbol = Symbol(\"impl\");\nconst sameObjectCaches = Symbol(\"SameObject caches\");\n\nfunction getSameObject(wrapper, prop, creator) {\n if (!wrapper[sameObjectCaches]) {\n wrapper[sameObjectCaches] = Object.create(null);\n }\n\n if (prop in wrapper[sameObjectCaches]) {\n return wrapper[sameObjectCaches][prop];\n }\n\n wrapper[sameObjectCaches][prop] = creator();\n return wrapper[sameObjectCaches][prop];\n}\n\nfunction wrapperForImpl(impl) {\n return impl ? impl[wrapperSymbol] : null;\n}\n\nfunction implForWrapper(wrapper) {\n return wrapper ? wrapper[implSymbol] : null;\n}\n\nfunction tryWrapperForImpl(impl) {\n const wrapper = wrapperForImpl(impl);\n return wrapper ? wrapper : impl;\n}\n\nfunction tryImplForWrapper(wrapper) {\n const impl = implForWrapper(wrapper);\n return impl ? impl : wrapper;\n}\n\nconst iterInternalSymbol = Symbol(\"internal\");\nconst IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));\n\nmodule.exports = exports = {\n isObject,\n getReferenceToBytes,\n getCopyToBytes,\n mixin,\n wrapperSymbol,\n implSymbol,\n getSameObject,\n wrapperForImpl,\n implForWrapper,\n tryWrapperForImpl,\n tryImplForWrapper,\n iterInternalSymbol,\n IteratorPrototype\n};\n","\"use strict\";\nconst legacyErrorCodes = require(\"./legacy-error-codes.json\");\nconst idlUtils = require(\"./utils.js\");\n\nexports.implementation = class DOMExceptionImpl {\n constructor([message, name]) {\n this.name = name;\n this.message = message;\n }\n\n get code() {\n return legacyErrorCodes[this.name] || 0;\n }\n};\n\n// A proprietary V8 extension that causes the stack property to appear.\nexports.init = impl => {\n if (Error.captureStackTrace) {\n const wrapper = idlUtils.wrapperForImpl(impl);\n Error.captureStackTrace(wrapper, wrapper.constructor);\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\n\nconst impl = utils.implSymbol;\n\nfunction DOMException() {\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n\n if (args[0] !== undefined) {\n args[0] = conversions[\"DOMString\"](args[0], { context: \"Failed to construct 'DOMException': parameter 1\" });\n } else {\n args[0] = \"\";\n }\n\n if (args[1] !== undefined) {\n args[1] = conversions[\"DOMString\"](args[1], { context: \"Failed to construct 'DOMException': parameter 2\" });\n } else {\n args[1] = \"Error\";\n }\n\n iface.setup(this, args);\n}\n\nObject.defineProperty(DOMException, \"prototype\", {\n value: DOMException.prototype,\n writable: false,\n enumerable: false,\n configurable: false\n});\n\nObject.defineProperty(DOMException.prototype, \"name\", {\n get() {\n return this[impl][\"name\"];\n },\n\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(DOMException.prototype, \"message\", {\n get() {\n return this[impl][\"message\"];\n },\n\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(DOMException.prototype, \"code\", {\n get() {\n return this[impl][\"code\"];\n },\n\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(DOMException, \"INDEX_SIZE_ERR\", {\n value: 1,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INDEX_SIZE_ERR\", {\n value: 1,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"DOMSTRING_SIZE_ERR\", {\n value: 2,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"DOMSTRING_SIZE_ERR\", {\n value: 2,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"HIERARCHY_REQUEST_ERR\", {\n value: 3,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"HIERARCHY_REQUEST_ERR\", {\n value: 3,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"WRONG_DOCUMENT_ERR\", {\n value: 4,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"WRONG_DOCUMENT_ERR\", {\n value: 4,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INVALID_CHARACTER_ERR\", {\n value: 5,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INVALID_CHARACTER_ERR\", {\n value: 5,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NO_DATA_ALLOWED_ERR\", {\n value: 6,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NO_DATA_ALLOWED_ERR\", {\n value: 6,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NO_MODIFICATION_ALLOWED_ERR\", {\n value: 7,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NO_MODIFICATION_ALLOWED_ERR\", {\n value: 7,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NOT_FOUND_ERR\", {\n value: 8,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NOT_FOUND_ERR\", {\n value: 8,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NOT_SUPPORTED_ERR\", {\n value: 9,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NOT_SUPPORTED_ERR\", {\n value: 9,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INUSE_ATTRIBUTE_ERR\", {\n value: 10,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INUSE_ATTRIBUTE_ERR\", {\n value: 10,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INVALID_STATE_ERR\", {\n value: 11,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INVALID_STATE_ERR\", {\n value: 11,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"SYNTAX_ERR\", {\n value: 12,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"SYNTAX_ERR\", {\n value: 12,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INVALID_MODIFICATION_ERR\", {\n value: 13,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INVALID_MODIFICATION_ERR\", {\n value: 13,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NAMESPACE_ERR\", {\n value: 14,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NAMESPACE_ERR\", {\n value: 14,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INVALID_ACCESS_ERR\", {\n value: 15,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INVALID_ACCESS_ERR\", {\n value: 15,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"VALIDATION_ERR\", {\n value: 16,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"VALIDATION_ERR\", {\n value: 16,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"TYPE_MISMATCH_ERR\", {\n value: 17,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"TYPE_MISMATCH_ERR\", {\n value: 17,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"SECURITY_ERR\", {\n value: 18,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"SECURITY_ERR\", {\n value: 18,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"NETWORK_ERR\", {\n value: 19,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"NETWORK_ERR\", {\n value: 19,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"ABORT_ERR\", {\n value: 20,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"ABORT_ERR\", {\n value: 20,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"URL_MISMATCH_ERR\", {\n value: 21,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"URL_MISMATCH_ERR\", {\n value: 21,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"QUOTA_EXCEEDED_ERR\", {\n value: 22,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"QUOTA_EXCEEDED_ERR\", {\n value: 22,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"TIMEOUT_ERR\", {\n value: 23,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"TIMEOUT_ERR\", {\n value: 23,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"INVALID_NODE_TYPE_ERR\", {\n value: 24,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"INVALID_NODE_TYPE_ERR\", {\n value: 24,\n enumerable: true\n});\n\nObject.defineProperty(DOMException, \"DATA_CLONE_ERR\", {\n value: 25,\n enumerable: true\n});\nObject.defineProperty(DOMException.prototype, \"DATA_CLONE_ERR\", {\n value: 25,\n enumerable: true\n});\n\nObject.defineProperty(DOMException.prototype, Symbol.toStringTag, {\n value: \"DOMException\",\n writable: false,\n enumerable: false,\n configurable: true\n});\n\nconst iface = {\n mixedInto: [],\n is(obj) {\n if (obj) {\n if (obj[impl] instanceof Impl.implementation) {\n return true;\n }\n for (let i = 0; i < module.exports.mixedInto.length; ++i) {\n if (obj instanceof module.exports.mixedInto[i]) {\n return true;\n }\n }\n }\n return false;\n },\n isImpl(obj) {\n if (obj) {\n if (obj instanceof Impl.implementation) {\n return true;\n }\n\n const wrapper = utils.wrapperForImpl(obj);\n for (let i = 0; i < module.exports.mixedInto.length; ++i) {\n if (wrapper instanceof module.exports.mixedInto[i]) {\n return true;\n }\n }\n }\n return false;\n },\n convert(obj, { context = \"The provided value\" } = {}) {\n if (module.exports.is(obj)) {\n return utils.implForWrapper(obj);\n }\n throw new TypeError(`${context} is not of type 'DOMException'.`);\n },\n\n create(constructorArgs, privateData) {\n let obj = Object.create(DOMException.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n createImpl(constructorArgs, privateData) {\n let obj = Object.create(DOMException.prototype);\n this.setup(obj, constructorArgs, privateData);\n return utils.implForWrapper(obj);\n },\n _internalSetup(obj) {},\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n\n privateData.wrapper = obj;\n\n this._internalSetup(obj);\n Object.defineProperty(obj, impl, {\n value: new Impl.implementation(constructorArgs, privateData),\n writable: false,\n enumerable: false,\n configurable: true\n });\n obj[impl][utils.wrapperSymbol] = obj;\n if (Impl.init) {\n Impl.init(obj[impl], privateData);\n }\n },\n interface: DOMException,\n expose: {\n Window: { DOMException },\n Worker: { DOMException }\n }\n}; // iface\nmodule.exports = iface;\n\nconst Impl = require(\".//DOMException-impl.js\");\n","\"use strict\";\n\nmodule.exports = require(\"./DOMException\").interface;\n\nObject.setPrototypeOf(module.exports.prototype, Error.prototype);\n","/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(retv != null, \"'this' is expected an Event object, but got\", event)\n return retv\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n const data = pd(this)\n if (data.passiveListener != null) {\n console.warn(\"Event#preventDefault() was called from a passive listener:\", data.passiveListener)\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", { value: Event, configurable: true, writable: true })\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = (typeof descriptor.value === \"function\")\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the stopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).stopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import { isStopped, setCurrentTarget, setEventPhase, setPassiveListener, wrapEvent } from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\"'this' is expected an EventTarget object, but got another value.\")\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n }\n else if (node.next !== null) {\n listeners.set(eventName, node.next)\n }\n else {\n listeners.delete(eventName)\n }\n }\n else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n }\n else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(eventTargetPrototype, `on${eventName}`, defineEventAttributeDescriptor(eventName))\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: { value: CustomEventTarget, configurable: true, writable: true },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n * \n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n * \n * For example:\n * \n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {boolean} `true` if the listener was added actually.\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return false\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options)\n const listenerType = (capture ? CAPTURE : BUBBLE)\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return true\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (node.listener === listener && node.listenerType === listenerType) {\n // Should ignore duplication.\n return false\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n return true\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {boolean} `true` if the listener was removed actually.\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return false\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options) ? Boolean(options.capture) : Boolean(options)\n const listenerType = (capture ? CAPTURE : BUBBLE)\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listener === listener && node.listenerType === listenerType) {\n if (prev !== null) {\n prev.next = node.next\n }\n else if (node.next !== null) {\n listeners.set(eventName, node.next)\n }\n else {\n listeners.delete(eventName)\n }\n return true\n }\n\n prev = node\n node = node.next\n }\n\n return false\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError(\"\\\"event.type\\\" should be a string.\")\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n }\n else if (node.next !== null) {\n listeners.set(eventName, node.next)\n }\n else {\n listeners.delete(eventName)\n }\n }\n else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(wrappedEvent, (node.passive ? node.listener : null))\n if (typeof node.listener === \"function\") {\n node.listener.call(this, wrappedEvent)\n }\n else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === \"function\") {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", { value: EventTarget, configurable: true, writable: true })\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (typeof window !== \"undefined\" && typeof window.EventTarget !== \"undefined\") {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\n/**\r\n * This implements polyfills for AbortSignal and AbortController\r\n * from the whatwg spec: https://dom.spec.whatwg.org/#aborting-ongoing-activities\r\n * These will become available in Chrome 66.\r\n */\r\n\r\n// Shim of EventTarget usable in Node.\r\n// Note that even in Chrome, EventTarget also isn't instantiable until version 64.\r\nimport {\r\n EventTarget as EventTargetShim,\r\n defineEventAttribute,\r\n} from 'event-target-shim';\r\n\r\nexport class AbortSignal extends (EventTargetShim: typeof EventTarget) {\r\n aborted: boolean = false;\r\n // Defined via defineEventAttribute below.\r\n onabort: ?(event: Event) => mixed;\r\n\r\n // $FlowIssue: Computed properties are not supported\r\n get [Symbol.toStringTag]() {\r\n return 'AbortSignal';\r\n }\r\n}\r\n\r\ndefineEventAttribute(AbortSignal.prototype, 'abort');\r\n\r\nexport default class AbortController {\r\n signal = new AbortSignal();\r\n\r\n abort() {\r\n // From whatwg spec, section 3.2:\r\n // If signal’s aborted flag is set, then return.\r\n if (this.signal.aborted) {\r\n return;\r\n }\r\n // Set signal’s aborted flag.\r\n this.signal.aborted = true;\r\n // Fire an event named abort at signal.\r\n // Note: event-target-shim converts objects to Events.\r\n this.signal.dispatchEvent(({type: 'abort'}: any));\r\n }\r\n\r\n // $FlowIssue: Computed properties are not supported\r\n get [Symbol.toStringTag]() {\r\n return 'AbortController';\r\n }\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport invariant from 'assert';\r\n\r\nexport function ensureArray(x: Array | T): Array {\r\n return Array.isArray(x) ? x : [x];\r\n}\r\n\r\nexport function arrayRemove(array: Array, element: T): void {\r\n const index = array.indexOf(element);\r\n if (index >= 0) {\r\n array.splice(index, 1);\r\n }\r\n}\r\n\r\nexport function arrayEqual(\r\n array1: $ReadOnlyArray,\r\n array2: $ReadOnlyArray,\r\n equalComparator?: (a: T, b: T) => boolean,\r\n): boolean {\r\n if (array1 === array2) {\r\n return true;\r\n }\r\n if (array1.length !== array2.length) {\r\n return false;\r\n }\r\n const equalFunction = equalComparator || ((a: T, b: T) => a === b);\r\n return array1.every((item1, i) => equalFunction(item1, array2[i]));\r\n}\r\n\r\n/**\r\n * Returns a copy of the input Array with all `null` and `undefined` values filtered out.\r\n * Allows Flow to typecheck the common `filter(x => x != null)` pattern.\r\n */\r\nexport function arrayCompact(array: $ReadOnlyArray): Array {\r\n const result = [];\r\n for (const elem of array) {\r\n if (elem != null) {\r\n result.push(elem);\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Flattens an Array> into just an Array\r\n */\r\nexport function arrayFlatten(\r\n array: $ReadOnlyArray<$ReadOnlyArray>,\r\n): Array {\r\n const result = [];\r\n for (const subArray of array) {\r\n for (const element of subArray) {\r\n result.push(element);\r\n }\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Removes duplicates from Array.\r\n * Uses SameValueZero for equality purposes, which is like '===' except it deems\r\n * two NaNs equal. http://www.ecma-international.org/ecma-262/6.0/#sec-samevaluezero\r\n */\r\nexport function arrayUnique(array: $ReadOnlyArray): Array {\r\n return Array.from(new Set(array));\r\n}\r\n\r\n/**\r\n * Returns the last index in the input array that matches the predicate.\r\n * Returns -1 if no match is found.\r\n */\r\nexport function arrayFindLastIndex(\r\n array: $ReadOnlyArray,\r\n predicate: (elem: T, index: number, array: $ReadOnlyArray) => boolean,\r\n thisArg?: any,\r\n): number {\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n if (predicate.call(thisArg, array[i], i, array)) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n}\r\n\r\n/**\r\n * Return the first index in array where subarray is equal to the next\r\n * subarray-sized slice of array. Return -1 if no match is found.\r\n */\r\nexport function findSubArrayIndex(\r\n array: $ReadOnlyArray,\r\n subarr: $ReadOnlyArray,\r\n): number {\r\n return array.findIndex((_, offset) =>\r\n arrayEqual(array.slice(offset, offset + subarr.length), subarr),\r\n );\r\n}\r\n\r\n/**\r\n * Separates an array into two subarrays -- the first contains all elements that\r\n * match the predicate and the latter contains all the rest that fail.\r\n */\r\nexport function arrayPartition(\r\n array: $ReadOnlyArray,\r\n predicate: (elem: T) => boolean,\r\n): [Array, Array] {\r\n const pass = [];\r\n const fail = [];\r\n array.forEach(elem => (predicate(elem) ? pass.push(elem) : fail.push(elem)));\r\n return [pass, fail];\r\n}\r\n\r\n/**\r\n * Merges a given arguments of maps into one Map, with the latest maps\r\n * overriding the values of the prior maps.\r\n */\r\nexport function mapUnion(...maps: $ReadOnlyArray>): Map {\r\n const unionMap = new Map();\r\n for (const map of maps) {\r\n for (const [key, value] of map) {\r\n unionMap.set(key, value);\r\n }\r\n }\r\n return unionMap;\r\n}\r\n\r\nexport function mapCompact(map: Map): Map {\r\n const selected = new Map();\r\n for (const [key, value] of map) {\r\n if (value != null) {\r\n selected.set(key, value);\r\n }\r\n }\r\n return selected;\r\n}\r\n\r\nexport function mapFilter(\r\n map: Map,\r\n selector: (key: T, value: X) => boolean,\r\n): Map {\r\n const selected = new Map();\r\n for (const [key, value] of map) {\r\n if (selector(key, value)) {\r\n selected.set(key, value);\r\n }\r\n }\r\n return selected;\r\n}\r\n\r\nexport function mapTransform(\r\n src: Map,\r\n transform: (value: V1, key: T) => V2,\r\n): Map {\r\n const result = new Map();\r\n for (const [key, value] of src) {\r\n result.set(key, transform(value, key));\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapEqual(\r\n map1: Map,\r\n map2: Map,\r\n equalComparator?: (val1: X, val2: X, key?: T) => boolean,\r\n) {\r\n if (map1.size !== map2.size) {\r\n return false;\r\n }\r\n const equalFunction = equalComparator || ((a: X, b: X) => a === b);\r\n for (const [key, value1] of map1) {\r\n if (!map2.has(key) || !equalFunction(value1, (map2.get(key): any))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport function mapGetWithDefault(\r\n map: Map,\r\n key: K,\r\n default_: V,\r\n): V {\r\n if (map.has(key)) {\r\n // Cast through `any` since map.get's return is a maybe type. We can't just get the value and\r\n // check it against `null`, since null/undefined may inhabit V. We know this is safe since we\r\n // just checked that the map has the key.\r\n return (map.get(key): any);\r\n } else {\r\n return default_;\r\n }\r\n}\r\n\r\nexport function areSetsEqual(a: Set, b: Set): boolean {\r\n return a.size === b.size && every(a, element => b.has(element));\r\n}\r\n\r\n// Array.every but for any iterable.\r\nexport function every(\r\n values: Iterable,\r\n predicate: (element: T) => boolean,\r\n): boolean {\r\n for (const element of values) {\r\n if (!predicate(element)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n\r\nexport function setIntersect(a: Set, b: Set): Set {\r\n return setFilter(a, e => b.has(e));\r\n}\r\n\r\nfunction setUnionTwo(a: Set, b: Set): Set {\r\n // Avoids the extra Array allocations that `new Set([...a, ...b])` would incur. Some quick tests\r\n // indicate it would be about 60% slower.\r\n const result = new Set(a);\r\n b.forEach(x => {\r\n result.add(x);\r\n });\r\n return result;\r\n}\r\n\r\nexport function setUnion(...sets: $ReadOnlyArray>): Set {\r\n if (sets.length < 1) {\r\n return new Set();\r\n }\r\n\r\n const setReducer = (accumulator: Set, current: Set): Set => {\r\n return setUnionTwo(accumulator, current);\r\n };\r\n\r\n return sets.reduce(setReducer);\r\n}\r\n\r\nexport function setDifference(\r\n a: Set,\r\n b: Set,\r\n hash_?: (v: T) => any,\r\n): Set {\r\n if (a.size === 0) {\r\n return new Set();\r\n } else if (b.size === 0) {\r\n return new Set(a);\r\n }\r\n const result = new Set();\r\n const hash = hash_ || (x => x);\r\n const bHashes = hash_ == null ? b : new Set(Array.from(b.values()).map(hash));\r\n a.forEach(value => {\r\n if (!bHashes.has(hash(value))) {\r\n result.add(value);\r\n }\r\n });\r\n return result;\r\n}\r\n\r\nexport function setFilter(\r\n set: Set,\r\n predicate: (value: T) => boolean,\r\n): Set {\r\n const out = new Set();\r\n for (const item of set) {\r\n if (predicate(item)) {\r\n out.add(item);\r\n }\r\n }\r\n\r\n return out;\r\n}\r\n\r\n/**\r\n * O(1)-check if a given object is empty (has no properties, inherited or not)\r\n */\r\nexport function isEmpty(obj: Object): boolean {\r\n for (const key in obj) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Constructs an enumeration with keys equal to their value.\r\n * e.g. keyMirror({a: null, b: null}) => {a: 'a', b: 'b'}\r\n *\r\n * Based off the equivalent function in www.\r\n */\r\nexport function keyMirror(obj: T): $ObjMapi(k: K) => K> {\r\n const ret = {};\r\n Object.keys(obj).forEach(key => {\r\n ret[key] = key;\r\n });\r\n return ret;\r\n}\r\n\r\n/**\r\n * Given an array of [key, value] pairs, construct a map where the values for\r\n * each key are collected into an array of values, in order.\r\n */\r\nexport function collect(pairs: $ReadOnlyArray<[K, V]>): Map> {\r\n const result = new Map();\r\n for (const pair of pairs) {\r\n const [k, v] = pair;\r\n let list = result.get(k);\r\n if (list == null) {\r\n list = [];\r\n result.set(k, list);\r\n }\r\n list.push(v);\r\n }\r\n return result;\r\n}\r\n\r\nexport function objectFromPairs(\r\n iterable: Iterable<[T, U]>,\r\n): {[T]: U} {\r\n const result = {};\r\n for (const [key, value] of iterable) {\r\n result[key] = value;\r\n }\r\n return result;\r\n}\r\n\r\nexport function objectMapValues(\r\n object: {[T: string]: U},\r\n project: (value: U, key: T) => V,\r\n): {[T]: V} {\r\n const result = {};\r\n Object.keys(object).forEach(key => {\r\n result[key] = project(object[key], ((key: any): T));\r\n });\r\n return result;\r\n}\r\n\r\nexport class MultiMap {\r\n // Invariant: no empty sets. They should be removed instead.\r\n _map: Map>;\r\n\r\n // TODO may be worth defining a getter but no setter, to mimic Map. But please just behave and\r\n // don't mutate this from outside this class.\r\n //\r\n // Invariant: equal to the sum of the sizes of all the sets contained in this._map\r\n /* The total number of key-value bindings contained */\r\n size: number;\r\n\r\n constructor() {\r\n this._map = new Map();\r\n this.size = 0;\r\n }\r\n\r\n /*\r\n * Returns the set of values associated with the given key. Do not mutate the given set. Copy it\r\n * if you need to store it past the next operation on this MultiMap.\r\n */\r\n get(key: K): Set {\r\n const set = this._map.get(key);\r\n if (set == null) {\r\n return new Set();\r\n }\r\n return set;\r\n }\r\n\r\n /*\r\n * Mimics the Map.prototype.set interface. Deliberately did not choose \"set\" as the name since the\r\n * implication is that it removes the previous binding.\r\n */\r\n add(key: K, value: V): MultiMap {\r\n let set = this._map.get(key);\r\n if (set == null) {\r\n set = new Set();\r\n this._map.set(key, set);\r\n }\r\n if (!set.has(value)) {\r\n set.add(value);\r\n this.size++;\r\n }\r\n return this;\r\n }\r\n\r\n /*\r\n * Mimics the Map.prototype.set interface. Replaces the previous binding with new values.\r\n */\r\n set(key: K, values: Iterable): void {\r\n this.deleteAll(key);\r\n const newSet = new Set(values);\r\n if (newSet.size !== 0) {\r\n this._map.set(key, newSet);\r\n this.size += newSet.size;\r\n }\r\n }\r\n\r\n /*\r\n * Deletes a single binding. Returns true iff the binding existed.\r\n */\r\n delete(key: K, value: V): boolean {\r\n const set = this.get(key);\r\n const didRemove = set.delete(value);\r\n if (set.size === 0) {\r\n this._map.delete(key);\r\n }\r\n if (didRemove) {\r\n this.size--;\r\n }\r\n return didRemove;\r\n }\r\n\r\n /*\r\n * Deletes all bindings associated with the given key. Returns true iff any bindings were deleted.\r\n */\r\n deleteAll(key: K): boolean {\r\n const set = this.get(key);\r\n this.size -= set.size;\r\n return this._map.delete(key);\r\n }\r\n\r\n clear(): void {\r\n this._map.clear();\r\n this.size = 0;\r\n }\r\n\r\n has(key: K, value: V): boolean {\r\n return this.get(key).has(value);\r\n }\r\n\r\n hasAny(key: K): boolean {\r\n return this._map.has(key);\r\n }\r\n\r\n *values(): Iterable {\r\n for (const set of this._map.values()) {\r\n yield* set;\r\n }\r\n }\r\n\r\n forEach(callback: (value: V, key: K, obj: MultiMap) => void): void {\r\n this._map.forEach((values, key) =>\r\n values.forEach(value => callback(value, key, this)),\r\n );\r\n }\r\n}\r\n\r\nexport function objectValues(obj: {[key: string]: T}): Array {\r\n return Object.keys(obj).map(key => obj[key]);\r\n}\r\n\r\nexport function objectEntries(obj: ?{[key: string]: T}): Array<[string, T]> {\r\n if (obj == null) {\r\n throw new TypeError();\r\n }\r\n const entries = [];\r\n for (const key in obj) {\r\n if (\r\n obj.hasOwnProperty(key) &&\r\n Object.prototype.propertyIsEnumerable.call(obj, key)\r\n ) {\r\n entries.push([key, obj[key]]);\r\n }\r\n }\r\n return entries;\r\n}\r\n\r\nexport function objectFromMap(map: Map): {[key: string]: T} {\r\n const obj = {};\r\n map.forEach((v, k) => {\r\n obj[k] = v;\r\n });\r\n return obj;\r\n}\r\n\r\nexport function* concatIterators(\r\n ...iterators: $ReadOnlyArray>\r\n): Iterator {\r\n for (const iterator of iterators) {\r\n for (const element of iterator) {\r\n yield element;\r\n }\r\n }\r\n}\r\n\r\nexport function someOfIterable(\r\n iterable: Iterable,\r\n predicate: (element: T) => boolean,\r\n): boolean {\r\n for (const element of iterable) {\r\n if (predicate(element)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function findInIterable(\r\n iterable: Iterable,\r\n predicate: (element: T) => boolean,\r\n): ?T {\r\n for (const element of iterable) {\r\n if (predicate(element)) {\r\n return element;\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nexport function* filterIterable(\r\n iterable: Iterable,\r\n predicate: (element: T) => boolean,\r\n): Iterable {\r\n for (const element of iterable) {\r\n if (predicate(element)) {\r\n yield element;\r\n }\r\n }\r\n}\r\n\r\nexport function* mapIterable(\r\n iterable: Iterable,\r\n projectorFn: (element: T) => M,\r\n): Iterable {\r\n for (const element of iterable) {\r\n yield projectorFn(element);\r\n }\r\n}\r\n\r\nexport function* takeIterable(\r\n iterable: Iterable,\r\n limit: number,\r\n): Iterable {\r\n let i = 0;\r\n for (const element of iterable) {\r\n if (++i > limit) {\r\n break;\r\n }\r\n yield element;\r\n }\r\n}\r\n\r\n// Return an iterable of the numbers start (inclusive) through stop (exclusive)\r\nexport function* range(\r\n start: number,\r\n stop: number,\r\n step?: number = 1,\r\n): Iterable {\r\n // We don't currently support negative step values.\r\n invariant(step > 0);\r\n for (let i = start; i < stop; i += step) {\r\n yield i;\r\n }\r\n}\r\n\r\nexport function firstOfIterable(iterable: Iterable): ?T {\r\n return findInIterable(iterable, () => true);\r\n}\r\n\r\nexport function iterableIsEmpty(iterable: Iterable): boolean {\r\n // eslint-disable-next-line no-unused-vars\r\n for (const element of iterable) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nexport function iterableContains(iterable: Iterable, value: T): boolean {\r\n return !iterableIsEmpty(\r\n filterIterable(iterable, element => element === value),\r\n );\r\n}\r\n\r\nexport function count(iterable: Iterable): number {\r\n let size = 0;\r\n // eslint-disable-next-line no-unused-vars\r\n for (const element of iterable) {\r\n size++;\r\n }\r\n return size;\r\n}\r\n\r\nexport function isIterable(obj: any): boolean {\r\n return typeof obj[Symbol.iterator] === 'function';\r\n}\r\n\r\n// Traverse an array from the inside out, starting at the specified index.\r\nexport function* insideOut(\r\n arr: $ReadOnlyArray,\r\n startingIndex?: number,\r\n): Iterable<[T, number]> {\r\n if (arr.length === 0) {\r\n return;\r\n }\r\n\r\n let i =\r\n startingIndex == null\r\n ? Math.floor(arr.length / 2)\r\n : Math.min(arr.length, Math.max(0, startingIndex));\r\n let j = i - 1;\r\n\r\n while (i < arr.length || j >= 0) {\r\n if (i < arr.length) {\r\n yield [arr[i], i];\r\n i++;\r\n }\r\n if (j >= 0) {\r\n yield [arr[j], j];\r\n j--;\r\n }\r\n }\r\n}\r\n\r\nexport function mapFromObject(obj: {[key: string]: T}): Map {\r\n return new Map(objectEntries(obj));\r\n}\r\n\r\nexport function lastFromArray(arr: $ReadOnlyArray): T {\r\n return arr[arr.length - 1];\r\n}\r\n\r\nexport function distinct(array: T[], keyFn?: (t: T) => string): T[] {\r\n if (keyFn == null) {\r\n return Array.from(new Set(array));\r\n }\r\n\r\n const seenKeys = new Set();\r\n return array.filter(elem => {\r\n const key = keyFn(elem);\r\n if (seenKeys.has(key)) {\r\n return false;\r\n }\r\n seenKeys.add(key);\r\n return true;\r\n });\r\n}\r\n\r\nexport class DefaultMap extends Map {\r\n _factory: K => V;\r\n\r\n constructor(factory: K => V, iterable: ?Iterable<[K, V]>) {\r\n super(iterable);\r\n this._factory = factory;\r\n }\r\n\r\n get(key: K): V {\r\n if (!this.has(key)) {\r\n const value = this._factory(key);\r\n this.set(key, value);\r\n return value;\r\n }\r\n // If the key is present we must have a value of type V.\r\n return (super.get(key): any);\r\n }\r\n}\r\n\r\nexport class DefaultWeakMap extends WeakMap {\r\n _factory: K => V;\r\n\r\n constructor(factory: K => V, iterable: ?Iterable<[K, V]>) {\r\n super(iterable);\r\n this._factory = factory;\r\n }\r\n\r\n get(key: K): V {\r\n if (!this.has(key)) {\r\n const value = this._factory(key);\r\n this.set(key, value);\r\n return value;\r\n }\r\n // If the key is present we must have a value of type V.\r\n return (super.get(key): any);\r\n }\r\n}\r\n\r\n/**\r\n * Return the highest ranked item in a list, according to the provided ranking function. A max rank\r\n * may optionally be provided so the whole list doesn't have to be iterated. Items with ranks of\r\n * zero or less are never returned.\r\n */\r\nexport function findTopRanked(\r\n items: Iterable,\r\n ranker: T => number,\r\n maxRank?: number,\r\n): ?T {\r\n let maxSeenRank = 0;\r\n let maxRankedItem;\r\n for (const item of items) {\r\n const rank = ranker(item);\r\n if (rank === maxRank) {\r\n return item;\r\n }\r\n if (rank > 0 && rank > maxSeenRank) {\r\n maxSeenRank = rank;\r\n maxRankedItem = item;\r\n }\r\n }\r\n return maxRankedItem;\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\nimport invariant from 'assert';\r\n\r\nexport default function debounce<\r\n T,\r\n TArgs: Array,\r\n TReturn,\r\n TFunc: (...TArgs) => TReturn, // eslint-disable-line space-before-function-paren\r\n>(\r\n func: TFunc,\r\n wait: number,\r\n immediate?: boolean = false,\r\n): {\r\n (...TArgs): TReturn | void,\r\n dispose(): void,\r\n} {\r\n // Taken from: https://github.com/jashkenas/underscore/blob/b10b2e6d72/underscore.js#L815.\r\n let timeout: ?TimeoutID;\r\n let args: ?TArgs;\r\n let context: any;\r\n let timestamp = 0;\r\n let result: TReturn | void;\r\n\r\n const later = function() {\r\n const last = Date.now() - timestamp;\r\n\r\n if (last < wait && last >= 0) {\r\n timeout = setTimeout(later, wait - last);\r\n } else {\r\n timeout = null;\r\n if (!immediate) {\r\n invariant(args != null);\r\n result = func.apply(context, args);\r\n if (!timeout) {\r\n context = args = null;\r\n }\r\n }\r\n }\r\n };\r\n\r\n const debounced = function(...args_: TArgs): TReturn | void {\r\n context = this;\r\n args = args_;\r\n timestamp = Date.now();\r\n const callNow = immediate && !timeout;\r\n if (!timeout) {\r\n timeout = setTimeout(later, wait);\r\n }\r\n if (callNow) {\r\n result = func.apply(context, args);\r\n context = args = null;\r\n }\r\n\r\n return result;\r\n };\r\n\r\n debounced.dispose = () => {\r\n if (timeout) {\r\n clearTimeout(timeout);\r\n timeout = context = args = null;\r\n }\r\n };\r\n\r\n return debounced;\r\n}\r\n","/**\r\n * Copyright (c) 2017-present, Facebook, Inc.\r\n * All rights reserved.\r\n *\r\n * This source code is licensed under the BSD-style license found in the\r\n * LICENSE file in the root directory of this source tree. An additional grant\r\n * of patent rights can be found in the PATENTS file in the same directory.\r\n *\r\n * @flow\r\n * @format\r\n */\r\n\r\n/* global requestAnimationFrame, cancelAnimationFrame */\r\n\r\n// NOTE: Custom operators that require arguments should be written as higher-order functions. That\r\n// is, they should accept the arguments and return a function that accepts only an observable. This\r\n// allows a nice ergonomic way of using them with '.let()' (or a potential future pipe operator):\r\n//\r\n// const makeExciting = (excitementLevel: number = 1) =>\r\n// (source: Observable) =>\r\n// source.map(x => x + '!'.repeat(excitementLevel));\r\n//\r\n// Observable.of('hey', 'everybody')\r\n// .let(makeExciting())\r\n// .subscribe(x => console.log(x));\r\n\r\nimport type {AbortSignal} from './AbortController';\r\n\r\nimport UniversalDisposable from './UniversalDisposable';\r\nimport invariant from 'assert';\r\n// Note: DOMException is usable in Chrome but not in Node.\r\nimport DOMException from 'domexception';\r\nimport {Observable, ReplaySubject, Subject, Subscription} from 'rxjs-compat/bundles/rxjs-compat.umd.min.js';\r\nimport AbortController from './AbortController';\r\nimport {setDifference} from './collection';\r\nimport debounce from './debounce';\r\n\r\n/**\r\n * Splits a stream of strings on newlines.\r\n * Includes the newlines in the resulting stream (if includeNewlines is true).\r\n * Sends any non-newline terminated data before closing.\r\n * Does not ensure a trailing newline.\r\n */\r\nexport function splitStream(\r\n input: Observable,\r\n includeNewlines?: boolean = true,\r\n): Observable {\r\n return Observable.create(observer => {\r\n let current: string = '';\r\n\r\n function onEnd() {\r\n if (current !== '') {\r\n observer.next(current);\r\n current = '';\r\n }\r\n }\r\n\r\n return input.subscribe(\r\n value => {\r\n const lines = value.split('\\n');\r\n lines[0] = current + lines[0];\r\n current = lines.pop();\r\n if (includeNewlines) {\r\n lines.forEach(line => observer.next(line + '\\n'));\r\n } else {\r\n lines.forEach(line => observer.next(line));\r\n }\r\n },\r\n error => {\r\n onEnd();\r\n observer.error(error);\r\n },\r\n () => {\r\n onEnd();\r\n observer.complete();\r\n },\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Buffers until the predicate matches an element, then opens a new buffer.\r\n *\r\n * @param stream - The observable to buffer\r\n * @param predicate - A function that will be called every time an element is emitted from the\r\n * source. The predicate is passed the current element as well as the buffer at that point\r\n * (which includes the element). IMPORTANT: DO NOT MUTATE THE BUFFER. It returns a boolean\r\n * specifying whether to complete the buffer (and begin a new one).\r\n */\r\nexport function bufferUntil(\r\n condition: (item: T, buffer: Array) => boolean,\r\n): (Observable) => Observable> {\r\n return (stream: Observable) =>\r\n Observable.create(observer => {\r\n let buffer = null;\r\n const flush = () => {\r\n if (buffer != null) {\r\n observer.next(buffer);\r\n buffer = null;\r\n }\r\n };\r\n return stream.subscribe(\r\n x => {\r\n if (buffer == null) {\r\n buffer = [];\r\n }\r\n buffer.push(x);\r\n if (condition(x, buffer)) {\r\n flush();\r\n }\r\n },\r\n err => {\r\n flush();\r\n observer.error(err);\r\n },\r\n () => {\r\n flush();\r\n observer.complete();\r\n },\r\n );\r\n });\r\n}\r\n\r\n/**\r\n * Caches the latest element as long as there are subscribers. This is useful so that if consumers\r\n * unsubscribe and then subscribe much later, they do not get an ancient cached value.\r\n *\r\n * This is intended to be used with cold Observables. If you have a hot Observable, `cache(1)` will\r\n * be just fine because the hot Observable will continue producing values even when there are no\r\n * subscribers, so you can be assured that the cached values are up-to-date.\r\n */\r\nexport function cacheWhileSubscribed(input: Observable): Observable {\r\n return input.multicast(() => new ReplaySubject(1)).refCount();\r\n}\r\n\r\ntype Diff = {\r\n added: Set,\r\n removed: Set,\r\n};\r\n\r\n/**\r\n * Given a stream of sets, return a stream of diffs.\r\n * **IMPORTANT:** These sets are assumed to be immutable by convention. Don't mutate them!\r\n */\r\nexport function diffSets(\r\n hash?: (v: T) => any,\r\n): (Observable>) => Observable> {\r\n return (sets: Observable>) =>\r\n Observable.concat(\r\n Observable.of(new Set()), // Always start with no items with an empty set\r\n sets,\r\n )\r\n .pairwise()\r\n .map(([previous, next]) => ({\r\n added: setDifference(next, previous, hash),\r\n removed: setDifference(previous, next, hash),\r\n }))\r\n .filter(diff => diff.added.size > 0 || diff.removed.size > 0);\r\n}\r\n\r\n/**\r\n * Give a stream of diffs, perform an action for each added item and dispose of the returned\r\n * disposable when the item is removed.\r\n */\r\nexport function reconcileSetDiffs(\r\n diffs: Observable>,\r\n addAction: (addedItem: T) => IDisposable,\r\n hash_?: (v: T) => any,\r\n): IDisposable {\r\n const hash = hash_ || (x => x);\r\n const itemsToDisposables = new Map();\r\n const disposeItem = item => {\r\n const disposable = itemsToDisposables.get(hash(item));\r\n invariant(disposable != null);\r\n disposable.dispose();\r\n itemsToDisposables.delete(item);\r\n };\r\n const disposeAll = () => {\r\n itemsToDisposables.forEach(disposable => {\r\n disposable.dispose();\r\n });\r\n itemsToDisposables.clear();\r\n };\r\n\r\n return new UniversalDisposable(\r\n diffs.subscribe(diff => {\r\n // For every item that got added, perform the add action.\r\n diff.added.forEach(item => {\r\n itemsToDisposables.set(hash(item), addAction(item));\r\n });\r\n\r\n // \"Undo\" the add action for each item that got removed.\r\n diff.removed.forEach(disposeItem);\r\n }),\r\n disposeAll,\r\n );\r\n}\r\n\r\n/**\r\n * Given a stream of sets, perform a side-effect whenever an item is added (i.e. is present in a\r\n * set but wasn't in the previous set in the stream), and a corresponding cleanup when it's removed.\r\n * **IMPORTANT:** These sets are assumed to be immutable by convention. Don't mutate them!\r\n *\r\n * Example:\r\n *\r\n * const dogs = Observable.of(\r\n * new Set([{name: 'Winston', id: 1}, {name: 'Penelope', id: 2}]),\r\n * new Set([{name: 'Winston', id: 1}]),\r\n * );\r\n * const disposable = reconcileSets(\r\n * dogs,\r\n * dog => {\r\n * const notification = atom.notifications.addSuccess(\r\n * `${dog.name} was added!`,\r\n * {dismissable: true},\r\n * );\r\n * return new Disposable(() => { notification.dismiss(); });\r\n * },\r\n * dog => dog.id,\r\n * );\r\n *\r\n * The above code will first add notifications saying \"Winston was added!\" and \"Penelope was\r\n * added!\", then dismiss the \"Penelope\" notification. Since the Winston object is in the final set\r\n * of the dogs observable, his notification will remain until `disposable.dispose()` is called, at\r\n * which point the cleanup for all remaining items will be performed.\r\n */\r\nexport function reconcileSets(\r\n sets: Observable>,\r\n addAction: (addedItem: T) => IDisposable,\r\n hash?: (v: T) => any,\r\n): IDisposable {\r\n const diffs = sets.let(diffSets(hash));\r\n return reconcileSetDiffs(diffs, addAction, hash);\r\n}\r\n\r\nexport function toggle(\r\n toggler: Observable,\r\n): (Observable) => Observable {\r\n return (source: Observable) =>\r\n toggler\r\n .distinctUntilChanged()\r\n .switchMap(enabled => (enabled ? source : Observable.empty()));\r\n}\r\n\r\nexport function compact(source: Observable): Observable {\r\n // Flow does not understand the semantics of `filter`\r\n return (source.filter(x => x != null): any);\r\n}\r\n\r\n/**\r\n * Like `takeWhile`, but includes the first item that doesn't match the predicate.\r\n */\r\nexport function takeWhileInclusive(\r\n predicate: (value: T) => boolean,\r\n): (Observable) => Observable {\r\n return (source: Observable) =>\r\n Observable.create(observer =>\r\n source.subscribe(\r\n x => {\r\n observer.next(x);\r\n if (!predicate(x)) {\r\n observer.complete();\r\n }\r\n },\r\n err => {\r\n observer.error(err);\r\n },\r\n () => {\r\n observer.complete();\r\n },\r\n ),\r\n );\r\n}\r\n\r\n// Concatenate the latest values from each input observable into one big list.\r\n// Observables who have not emitted a value yet are treated as empty.\r\nexport function concatLatest(\r\n ...observables: Array>>\r\n): Observable> {\r\n // First, tag all input observables with their index.\r\n // Flow errors with ambiguity without the explicit annotation.\r\n const tagged: Array, number]>> = observables.map(\r\n (observable, index) => observable.map(list => [list, index]),\r\n );\r\n return Observable.merge(...tagged)\r\n .scan((accumulator, [list, index]) => {\r\n accumulator[index] = list;\r\n return accumulator;\r\n }, observables.map(x => []))\r\n .map(accumulator => [].concat(...accumulator));\r\n}\r\n\r\n// Use a sentinel so we can distinguish between when `null` is emitted and when\r\n// nothing is.\r\nconst NONE = {};\r\n\r\ntype ThrottleOptions = {|\r\n leading?: boolean,\r\n|};\r\n\r\nexport function throttle(\r\n delay:\r\n | number\r\n | ((value: T) => Observable | Promise)\r\n | Observable\r\n | Promise,\r\n options?: ThrottleOptions = {leading: true},\r\n): (observable: Observable) => Observable {\r\n let getDelay: (value: T) => Observable | Promise;\r\n switch (typeof delay) {\r\n case 'number':\r\n getDelay = () => Observable.timer(delay);\r\n break;\r\n case 'function':\r\n getDelay = delay;\r\n break;\r\n case 'object':\r\n getDelay = () => delay;\r\n break;\r\n default:\r\n throw new Error(`Invalid delay: ${delay}`);\r\n }\r\n\r\n return function doThrottle(source: Observable): Observable {\r\n return Observable.create(observer => {\r\n const {leading = true} = options;\r\n const timerStarts = new Subject();\r\n let latestValue = NONE;\r\n let latestValueIsLeading = false;\r\n let shouldIgnore = false;\r\n\r\n const checkShouldNext = () => {\r\n if (!shouldIgnore && latestValue !== NONE) {\r\n // At this point, latestValue must be of type T\r\n latestValue = ((latestValue: any): T);\r\n\r\n const valueToDispatch = latestValue;\r\n shouldIgnore = true;\r\n\r\n if (leading || !latestValueIsLeading) {\r\n latestValue = NONE;\r\n observer.next(valueToDispatch);\r\n }\r\n timerStarts.next(valueToDispatch);\r\n }\r\n };\r\n\r\n const sub = new Subscription();\r\n sub.add(\r\n timerStarts\r\n .switchMap(x => {\r\n const timer = getDelay(x);\r\n if (timer instanceof Observable) {\r\n return timer.take(1);\r\n } else {\r\n return timer;\r\n }\r\n })\r\n .subscribe(() => {\r\n shouldIgnore = false;\r\n latestValueIsLeading = false;\r\n checkShouldNext();\r\n }),\r\n );\r\n sub.add(\r\n source.subscribe({\r\n next: x => {\r\n latestValue = x;\r\n latestValueIsLeading = true;\r\n checkShouldNext();\r\n },\r\n error: err => {\r\n observer.error(err);\r\n },\r\n complete: () => {\r\n // Ensure we don't hold a reference to the last value.\r\n latestValue = NONE;\r\n observer.complete();\r\n },\r\n }),\r\n );\r\n\r\n return sub;\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * Returns a new function which takes an `observable` and returns\r\n * `observable.switchMap(project)`, except that it completes\r\n * when the outer observable completes.\r\n *\r\n * Example:\r\n *\r\n * Observable.of(1)\r\n * .let(completingSwitchMap(x => Observable.never()))\r\n *\r\n * ends up returning an Observable that completes immediately.\r\n * With a regular switchMap, this would never terminate.\r\n */\r\nexport function completingSwitchMap(\r\n project: (input: T, index: number) => rxjs$ObservableInput,\r\n): (Observable) => Observable {\r\n // An alternative implementation is to materialize the input observable,\r\n // but this avoids the creation of extra notifier objects.\r\n const completedSymbol = Symbol('completed');\r\n return (observable: Observable) =>\r\n Observable.concat(\r\n observable,\r\n Observable.of((completedSymbol: any)),\r\n ).switchMap((input, index) => {\r\n if (input === completedSymbol) {\r\n return Observable.empty();\r\n }\r\n return project(input, index);\r\n });\r\n}\r\n\r\n/**\r\n * Returns a new observable consisting of the merged values from the passed\r\n * observables and completes when the first inner observable completes.\r\n */\r\nexport function mergeUntilAnyComplete(\r\n ...observables: Array>\r\n): Observable {\r\n const notifications = Observable.merge(\r\n ...observables.map(o => o.materialize()),\r\n );\r\n // $FlowFixMe add dematerialize to rxjs Flow types\r\n return notifications.dematerialize();\r\n}\r\n\r\n/**\r\n * RxJS's debounceTime is actually fairly inefficient:\r\n * on each event, it always clears its interval and [creates a new one][1].\r\n * Until this is fixed, this uses our debounce implementation which\r\n * reuses a timeout and just sets a timestamp when possible.\r\n *\r\n * This may seem like a micro-optimization but we often use debounces\r\n * for very hot events, like keypresses. Exceeding the frame budget can easily lead\r\n * to increased key latency!\r\n *\r\n * [1]: https://github.com/ReactiveX/rxjs/blob/master/src/operators/debounceTime.ts#L106\r\n */\r\nexport function fastDebounce(\r\n delay: number,\r\n): (Observable) => Observable {\r\n return (observable: Observable) =>\r\n Observable.create(observer => {\r\n const debouncedNext = debounce((x: T) => observer.next(x), delay);\r\n const subscription = observable.subscribe(\r\n debouncedNext,\r\n observer.error.bind(observer),\r\n observer.complete.bind(observer),\r\n );\r\n return new UniversalDisposable(subscription, debouncedNext);\r\n });\r\n}\r\n\r\nexport const microtask = Observable.create(observer => {\r\n process.nextTick(() => {\r\n observer.next();\r\n observer.complete();\r\n });\r\n});\r\n\r\nexport const macrotask = Observable.create(observer => {\r\n const timerId = setImmediate(() => {\r\n observer.next();\r\n observer.complete();\r\n });\r\n return () => {\r\n clearImmediate(timerId);\r\n };\r\n});\r\n\r\nexport const nextAnimationFrame = Observable.create(observer => {\r\n if (typeof requestAnimationFrame === 'undefined') {\r\n throw new Error('This util can only be used in Atom');\r\n }\r\n const id = requestAnimationFrame(() => {\r\n observer.next();\r\n observer.complete();\r\n });\r\n return () => {\r\n cancelAnimationFrame(id);\r\n };\r\n});\r\n\r\n/**\r\n * Creates an Observable around an abortable promise.\r\n * Unsubscriptions are forwarded to the AbortController as an `abort()`.\r\n * Example usage (with an abortable fetch):\r\n *\r\n * fromPromise(signal => fetch(url, {...options, signal}))\r\n * .switchMap(....)\r\n *\r\n * Note that this can take a normal `() => Promise` too\r\n * (in which case this acts as just a plain `Observable.defer`).\r\n */\r\nexport function fromAbortablePromise(\r\n func: (signal: AbortSignal) => Promise,\r\n): Observable {\r\n return Observable.create(observer => {\r\n let completed = false;\r\n const abortController = new AbortController();\r\n func(abortController.signal).then(\r\n value => {\r\n completed = true;\r\n observer.next(value);\r\n observer.complete();\r\n },\r\n error => {\r\n completed = true;\r\n observer.error(error);\r\n },\r\n );\r\n return () => {\r\n if (!completed) {\r\n abortController.abort();\r\n // If the promise adheres to the spec, it should throw.\r\n // The error will be captured above but go into the void.\r\n }\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Converts an observable + AbortSignal into a cancellable Promise,\r\n * which rejects with an AbortError DOMException on abort.\r\n * Useful when writing the internals of a cancellable promise.\r\n *\r\n * Usage:\r\n *\r\n * function abortableFunction(arg1: blah, options?: {signal?: AbortSignal}): Promise {\r\n * return toPromise(\r\n * observableFunction(arg1, options),\r\n * options && options.signal,\r\n * );\r\n * }\r\n *\r\n * Could eventually be replaced by Observable.first if\r\n * https://github.com/whatwg/dom/issues/544 goes through.\r\n *\r\n * It's currently unclear if this should be usable with let/pipe:\r\n * https://github.com/ReactiveX/rxjs/issues/3445\r\n */\r\nexport function toAbortablePromise(\r\n observable: Observable,\r\n signal?: ?AbortSignal,\r\n): Promise {\r\n if (signal == null) {\r\n return observable.toPromise();\r\n }\r\n if (signal.aborted) {\r\n return Promise.reject(DOMException('Aborted', 'AbortError'));\r\n }\r\n return observable\r\n .race(\r\n Observable.fromEvent(signal, 'abort').map(() => {\r\n throw new DOMException('Aborted', 'AbortError');\r\n }),\r\n )\r\n .toPromise();\r\n}\r\n\r\n/**\r\n * When using Observables with AbortSignals, be sure to use this -\r\n * it's really easy to miss the case when the signal is already aborted!\r\n * Recommended to use this with let/pipe:\r\n *\r\n * myObservable\r\n * .let(takeUntilAbort(signal))\r\n */\r\nexport function takeUntilAbort(\r\n signal: AbortSignal,\r\n): (Observable) => Observable {\r\n return observable =>\r\n Observable.defer(() => {\r\n if (signal.aborted) {\r\n return Observable.empty();\r\n }\r\n return observable.takeUntil(Observable.fromEvent(signal, 'abort'));\r\n });\r\n}\r\n\r\n// Executes tasks. Ensures that at most one task is running at a time.\r\n// This class is handy for expensive tasks like processes, provided\r\n// you never want the result of a previous task after a new task has started.\r\nexport class SingletonExecutor {\r\n _abortController: ?AbortController = null;\r\n\r\n // Executes(subscribes to) the task.\r\n // Will terminate(unsubscribe) to any previously executing task.\r\n // Subsequent executes() will terminate this task if called before\r\n // this task completes.\r\n async execute(createTask: Observable): Promise {\r\n // Kill any previously running processes\r\n this.cancel();\r\n\r\n // Start a new process\r\n const controller = new AbortController();\r\n this._abortController = controller;\r\n\r\n // Wait for the process to complete or be canceled ...\r\n try {\r\n return await toAbortablePromise(createTask, controller.signal);\r\n } finally {\r\n // ... and always clean up if we haven't been canceled already.\r\n if (controller === this._abortController) {\r\n this._abortController = null;\r\n }\r\n }\r\n }\r\n\r\n isExecuting(): boolean {\r\n return this._abortController != null;\r\n }\r\n\r\n // Cancels any currently executing tasks.\r\n cancel(): void {\r\n if (this._abortController != null) {\r\n this._abortController.abort();\r\n this._abortController = null;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Repeatedly subscribe to an observable every `delay` milliseconds, waiting for the observable to\r\n * complete each time. This is preferable to, say, `Observable.interval(d).switchMap(() => source)`\r\n * because, in the case that `source` takes longer than `d` milliseconds to produce a value, that\r\n * formulation will never produce a value (while continuing to incur the overhead of subscribing to\r\n * source).\r\n *\r\n * Example:\r\n *\r\n * // Ask what time it is every second until it's Friday.\r\n * runCommand('date')\r\n * .let(poll(1000))\r\n * .filter(output => output.startsWith('Fri'))\r\n * .take(1)\r\n * .subscribe(() => {\r\n * console.log(\"IT'S FRIDAY!!\")\r\n * });\r\n *\r\n */\r\nexport function poll(delay: number): (Observable) => Observable {\r\n return (source: Observable) =>\r\n Observable.defer(() => {\r\n const delays = new Subject();\r\n return delays\r\n .switchMap(n => Observable.timer(n))\r\n .merge(Observable.of(null))\r\n .switchMap(() => {\r\n const subscribedAt = Date.now();\r\n return source.do({\r\n complete: () => {\r\n const timeElapsed = Date.now() - subscribedAt;\r\n delays.next(Math.max(0, delay - timeElapsed));\r\n },\r\n });\r\n });\r\n });\r\n}\r\n","import type { TextEditor, TextChange, Disposable } from \"atom\"\n// TODO add to @types/atom\ntype AggregatedTextChange = {\n changes: Array\n}\nimport type { TextEdit } from \"@atom-ide-community/nuclide-commons-atom/text-edit\"\nimport type { BusySignalService } from \"atom-ide-base\"\nimport type {\n FileCodeFormatProvider,\n OnSaveCodeFormatProvider,\n OnTypeCodeFormatProvider,\n RangeCodeFormatProvider,\n} from \"./types\"\n\nimport nullthrows from \"nullthrows\"\nimport { registerOnWillSave } from \"@atom-ide-community/nuclide-commons-atom/FileEventHandlers\"\nimport { getFormatOnSave, getFormatOnType } from \"./config\"\nimport { Range } from \"atom\"\nimport { getLogger } from \"log4js\"\nimport ProviderRegistry from \"@atom-ide-community/nuclide-commons-atom/ProviderRegistry\"\nimport { applyTextEditsToBuffer } from \"@atom-ide-community/nuclide-commons-atom/text-edit\"\nimport { observeEditorDestroy } from \"@atom-ide-community/nuclide-commons-atom/text-editor\"\nimport { observableFromSubscribeFunction } from \"@atom-ide-community/nuclide-commons/event\"\nimport nuclideUri from \"@atom-ide-community/nuclide-commons/nuclideUri\"\nimport { completingSwitchMap, microtask } from \"@atom-ide-community/nuclide-commons/observable\"\nimport UniversalDisposable from \"@atom-ide-community/nuclide-commons/UniversalDisposable\"\nimport { Observable } from \"rxjs-compat/bundles/rxjs-compat.umd.min.js\"\nimport type { Subscription } from \"rxjs\"\n\n// Save events are critical, so don't allow providers to block them.\nexport const SAVE_TIMEOUT = 2500\n\ntype FormatEvent =\n | {\n type: \"command\" | \"save\" | \"new-save\"\n editor: TextEditor\n }\n | {\n type: \"type\"\n editor: TextEditor\n edit: AggregatedTextChange\n }\n\nexport default class CodeFormatManager {\n _subscriptions: UniversalDisposable\n _rangeProviders: ProviderRegistry\n _fileProviders: ProviderRegistry\n _onTypeProviders: ProviderRegistry\n _onSaveProviders: ProviderRegistry\n _busySignalService: BusySignalService | undefined | null\n\n constructor() {\n this._subscriptions = new UniversalDisposable(\n this._subscribeToEvents(),\n registerOnWillSave(this._onWillSaveProvider())\n )\n this._rangeProviders = new ProviderRegistry()\n this._fileProviders = new ProviderRegistry()\n this._onTypeProviders = new ProviderRegistry()\n this._onSaveProviders = new ProviderRegistry()\n }\n\n /**\n * Subscribe to all formatting events (commands, saves, edits) and dispatch formatters as necessary. By handling all\n * events in a central location, we ensure that no buffer runs into race conditions with simultaneous formatters.\n */\n _subscribeToEvents(): Subscription {\n // Events from the explicit Atom command.\n const commandEvents = observableFromSubscribeFunction((callback) =>\n atom.commands.add(\"atom-text-editor\", \"code-format:format-code\", callback)\n ).switchMap(() => {\n const editor = atom.workspace.getActiveTextEditor()\n if (!editor) {\n return Observable.empty()\n }\n return Observable.of({ type: \"command\", editor })\n })\n\n // Events from editor actions (saving, typing).\n const editorEvents = observableFromSubscribeFunction((cb) => atom.workspace.observeTextEditors(cb)).mergeMap(\n (editor) => _getEditorEventStream(editor)\n )\n\n return (\n Observable.merge(commandEvents, editorEvents)\n // Group events by buffer to prevent simultaneous formatting operations.\n .groupBy(\n (event) => event.editor.getBuffer(),\n (event) => event,\n (grouped) => observableFromSubscribeFunction((callback) => grouped.key.onDidDestroy(callback))\n )\n .mergeMap((events) =>\n // Make sure we halt everything when the editor gets destroyed.\n events.let(completingSwitchMap((event) => this._handleEvent(event)))\n )\n .subscribe()\n )\n }\n\n _handleEvent(event: FormatEvent): Observable {\n const { editor } = event\n switch (event.type) {\n case \"command\":\n return this._formatCodeInTextEditor(editor)\n .do((edits) => {\n applyTextEditsToBuffer(editor.getBuffer(), edits)\n })\n .map((result) => {\n if (!result) {\n throw new Error(\"No code formatting providers found!\")\n }\n })\n .catch((err) => {\n atom.notifications.addError(`Failed to format code: ${err.message}`, {\n detail: err.detail,\n })\n return Observable.empty()\n })\n case \"type\":\n return this._formatCodeOnTypeInTextEditor(editor, event.edit).catch((err) => {\n getLogger(\"code-format\").warn(\"Failed to format code on type:\", err)\n return Observable.empty()\n })\n default:\n return Observable.throw(`unknown event type ${event.type}`)\n }\n }\n\n // Return the text edits used to format code in the editor specified.\n _formatCodeInTextEditor(editor: TextEditor, range?: Range): Observable> {\n return Observable.defer(() => {\n const buffer = editor.getBuffer()\n const selectionRange = range || editor.getSelectedBufferRange()\n const { start: selectionStart, end: selectionEnd } = selectionRange\n let formatRange: Range\n if (selectionRange.isEmpty()) {\n // If no selection is done, then, the whole file is wanted to be formatted.\n formatRange = buffer.getRange()\n } else {\n // Format selections should start at the beginning of the line,\n // and include the last selected line end.\n // (If the user has already selected complete rows, then depending on how they\n // did it, their caret might be either (1) at the end of their last selected line\n // or (2) at the first column of the line AFTER their selection. In both cases\n // we snap the formatRange to end at the first column of the line after their\n // selection.)\n formatRange = new Range(\n [selectionStart.row, 0],\n selectionEnd.column === 0 ? selectionEnd : [selectionEnd.row + 1, 0]\n )\n }\n const rangeProviders = [...this._rangeProviders.getAllProvidersForEditor(editor)]\n const fileProviders = [...this._fileProviders.getAllProvidersForEditor(editor)]\n const contents = editor.getText()\n const rangeEdits = Observable.defer(() =>\n this._reportBusy(editor, Promise.all(rangeProviders.map((p) => p.formatCode(editor, formatRange))))\n ).switchMap((allEdits) => {\n const firstNonEmpty = allEdits.find((edits) => edits.length > 0)\n if (firstNonEmpty == null) {\n return Observable.empty()\n } else {\n return Observable.of(firstNonEmpty)\n }\n })\n const fileEdits = Observable.defer(() =>\n this._reportBusy(editor, Promise.all(fileProviders.map((p) => p.formatEntireFile(editor, formatRange))))\n )\n .switchMap((allResults) => {\n const firstNonNull = allResults.find((result) => result != null)\n if (firstNonNull == null) {\n return Observable.empty()\n } else {\n return Observable.of(firstNonNull)\n }\n })\n .map(({ formatted }) => {\n return [\n {\n oldRange: editor.getBuffer().getRange(),\n newText: formatted,\n oldText: contents,\n },\n ]\n })\n // When formatting the entire file, prefer file-based providers.\n const preferFileEdits = formatRange.isEqual(buffer.getRange())\n const edits = preferFileEdits ? fileEdits.concat(rangeEdits) : rangeEdits.concat(fileEdits)\n return edits.first(Boolean, [])\n })\n }\n\n _formatCodeOnTypeInTextEditor(\n editor: TextEditor,\n aggregatedEvent: AggregatedTextChange\n ): Observable> {\n return Observable.defer(() => {\n // Don't try to format changes with multiple cursors.\n if (aggregatedEvent.changes.length !== 1) {\n return Observable.empty()\n }\n const event = aggregatedEvent.changes[0]\n // This also ensures the non-emptiness of event.newText for below.\n if (!shouldFormatOnType(event) || !getFormatOnType()) {\n return Observable.empty()\n }\n // In the case of bracket-matching, we use the last character because that's\n // the character that will usually cause a reformat (i.e. `}` instead of `{`).\n const character = event.newText[event.newText.length - 1]\n\n const providers = [...this._onTypeProviders.getAllProvidersForEditor(editor)]\n if (providers.length === 0) {\n return Observable.empty()\n }\n\n const contents = editor.getText()\n const cursorPosition = editor.getCursorBufferPosition().copy()\n\n // The bracket-matching package basically overwrites\n //\n // editor.insertText('{');\n //\n // with\n //\n // editor.insertText('{}');\n // cursor.moveLeft();\n //\n // We want to wait until the cursor has actually moved before we issue a\n // format request, so that we format at the right position (and potentially\n // also let any other event handlers have their go).\n return microtask\n .switchMap(() =>\n Promise.all(providers.map((p) => p.formatAtPosition(editor, editor.getCursorBufferPosition(), character)))\n )\n .switchMap((allEdits) => {\n const firstNonEmptyIndex = allEdits.findIndex((edits) => edits.length > 0)\n if (firstNonEmptyIndex === -1) {\n return Observable.empty()\n } else {\n return Observable.of({\n edits: nullthrows(allEdits[firstNonEmptyIndex]),\n provider: providers[firstNonEmptyIndex],\n })\n }\n })\n .do(({ edits, provider }) => {\n if (edits.length === 0) {\n return\n }\n _checkContentsAreSame(contents, editor.getText())\n // Note that this modification is not in a transaction, so it applies as a\n // separate editing event than the character typing. This means that you\n // can undo just the formatting by attempting to undo once, and then undo\n // your actual code by undoing again.\n if (!applyTextEditsToBuffer(editor.getBuffer(), edits)) {\n throw new Error(\"Could not apply edits to text buffer.\")\n }\n\n if (provider.keepCursorPosition) {\n editor.setCursorBufferPosition(cursorPosition)\n }\n })\n .map(({ edits }) => edits)\n })\n }\n\n _onWillSaveProvider() {\n return {\n priority: 0,\n timeout: SAVE_TIMEOUT,\n callback: this._formatCodeOnSaveInTextEditor.bind(this),\n }\n }\n\n _formatCodeOnSaveInTextEditor(editor: TextEditor): Observable {\n const saveProviders = [...this._onSaveProviders.getAllProvidersForEditor(editor)]\n if (saveProviders.length > 0) {\n return Observable.defer(() =>\n this._reportBusy(editor, Promise.all(saveProviders.map((p) => p.formatOnSave(editor))), false)\n )\n .switchMap((allEdits) => {\n const firstNonEmpty = allEdits.find((edits) => edits.length > 0)\n if (firstNonEmpty == null) {\n return Observable.empty()\n } else {\n return Observable.of(firstNonEmpty)\n }\n })\n .flatMap((edits) => Observable.of(...edits))\n } else if (getFormatOnSave(editor)) {\n return this._formatCodeInTextEditor(editor, editor.getBuffer().getRange()).flatMap((edits) =>\n Observable.of(...edits)\n )\n }\n return Observable.empty()\n }\n\n _reportBusy(editor: TextEditor, promise: Promise, revealTooltip: boolean = true): Promise {\n const busySignalService = this._busySignalService\n if (busySignalService != null) {\n const path = editor.getPath()\n const displayPath = path != null ? nuclideUri.basename(path) : \"\"\n return busySignalService.reportBusyWhile(`Formatting code in ${displayPath}`, () => promise, { revealTooltip })\n }\n return promise\n }\n\n addRangeProvider(provider: RangeCodeFormatProvider): Disposable {\n return this._rangeProviders.addProvider(provider)\n }\n\n addFileProvider(provider: FileCodeFormatProvider): Disposable {\n return this._fileProviders.addProvider(provider)\n }\n\n addOnTypeProvider(provider: OnTypeCodeFormatProvider): Disposable {\n return this._onTypeProviders.addProvider(provider)\n }\n\n addOnSaveProvider(provider: OnSaveCodeFormatProvider): Disposable {\n return this._onSaveProviders.addProvider(provider)\n }\n\n consumeBusySignal(busySignalService: BusySignalService): Disposable {\n this._busySignalService = busySignalService\n return new UniversalDisposable(() => {\n this._busySignalService = null\n })\n }\n\n dispose() {\n this._subscriptions.dispose()\n }\n}\n\nfunction shouldFormatOnType(event: TextChange): boolean {\n // There's not a direct way to figure out what caused this edit event. There\n // are three cases that we want to pay attention to:\n //\n // 1) The user typed a character.\n // 2) The user typed a character, and bracket-matching kicked in, causing\n // there to be two characters typed.\n // 3) The user pasted a string.\n //\n // We only want to trigger autoformatting in the first two cases. However,\n // we can only look at what new string was inserted, and not what actually\n // caused the event, so we just use some heuristics to determine which of\n // these the event probably was depending on what was typed. This means, for\n // example, we may issue spurious format requests when the user pastes a\n // single character, but this is acceptable.\n if (event.oldText !== \"\") {\n // We either just deleted something or replaced a selection. For the time\n // being, we're not going to issue a reformat in that case.\n return false\n } else if (event.oldText === \"\" && event.newText === \"\") {\n // Not sure what happened here; why did we get an event in this case? Bail\n // for safety.\n return false\n } else if (event.newText.length > 1 && !isBracketPair(event.newText)) {\n return false\n }\n return true\n}\n\n/**\n * We can't tell the difference between a paste and the bracket-matcher package inserting an extra bracket, so we just\n * assume that any pair of brackets that bracket-matcher recognizes was a pair matched by the package.\n */\nfunction isBracketPair(typedText: string): boolean {\n if (atom.packages.getActivePackage(\"bracket-matcher\") == null) {\n return false\n }\n const validBracketPairs: Array = atom.config.get(\"bracket-matcher.autocompleteCharacters\") as any\n return validBracketPairs.includes(typedText)\n}\n\n// Checks whether contents are same in the buffer post-format, throwing if\n// anything has changed.\nfunction _checkContentsAreSame(before: string, after: string): void {\n if (before !== after) {\n throw new Error(\"The file contents were changed before formatting was complete.\")\n }\n}\n\n/** Returns a stream of all typing and saving operations from the editor. */\nfunction _getEditorEventStream(editor: TextEditor): Observable {\n const changeEvents = observableFromSubscribeFunction((callback) => editor.getBuffer().onDidChangeText(callback))\n\n // We need to capture when editors are about to be destroyed in order to\n // interrupt any pending formatting operations. (Otherwise, we may end up\n // attempting to save a destroyed editor!)\n const willDestroyEvents = observableFromSubscribeFunction((cb) => atom.workspace.onWillDestroyPaneItem(cb)).filter(\n (event) => event.item === editor\n )\n\n return Observable.merge(changeEvents.map((edit) => ({ type: \"type\", editor, edit }))).takeUntil(\n Observable.merge(observeEditorDestroy(editor), willDestroyEvents)\n )\n}\n","import type { TextEditor } from \"atom\"\nimport featureConfig from \"@atom-ide-community/nuclide-commons-atom/feature-config\"\n\nexport function getFormatOnSave(editor: TextEditor): boolean {\n const formatOnSave = featureConfig.get(\"atom-ide-code-format.formatOnSave\", {\n scope: editor.getRootScopeDescriptor(),\n }) as any\n return formatOnSave == null ? false : formatOnSave\n}\n\nexport function getFormatOnType(): boolean {\n return featureConfig.getWithDefaults(\"atom-ide-code-format.formatOnType\", false)\n}\n","import type { Disposable } from \"atom\"\nimport type { BusySignalService } from \"atom-ide-base\"\nimport type {\n RangeCodeFormatProvider,\n FileCodeFormatProvider,\n OnTypeCodeFormatProvider,\n OnSaveCodeFormatProvider,\n} from \"./types\"\n\nimport CodeFormatManager from \"./CodeFormatManager\"\n\nexport { default as config } from \"./config.json\"\n\nlet codeFormatManager: CodeFormatManager\n\nexport function activate() {\n codeFormatManager = new CodeFormatManager()\n}\n\nexport function consumeRangeProvider(provider: RangeCodeFormatProvider): Disposable {\n return codeFormatManager.addRangeProvider(provider)\n}\n\nexport function consumeFileProvider(provider: FileCodeFormatProvider): Disposable {\n return codeFormatManager.addFileProvider(provider)\n}\n\nexport function consumeOnTypeProvider(provider: OnTypeCodeFormatProvider): Disposable {\n return codeFormatManager.addOnTypeProvider(provider)\n}\n\nexport function consumeOnSaveProvider(provider: OnSaveCodeFormatProvider): Disposable {\n return codeFormatManager.addOnSaveProvider(provider)\n}\n\nexport function consumeBusySignal(busySignalService: BusySignalService): Disposable {\n return codeFormatManager.consumeBusySignal(busySignalService)\n}\n\nexport function deactivate() {\n codeFormatManager.dispose()\n}\n\n// TODO remove\nexport { consumeLegacyProvider } from \"./legacy-provider\"\n","// TODO Remove\n\nimport type { Disposable } from \"atom\"\nimport { consumeRangeProvider, consumeFileProvider, consumeOnSaveProvider, consumeOnTypeProvider } from \"./main\"\nimport type { CodeFormatProvider } from \"./types\"\n\nexport function consumeLegacyProvider(provider: CodeFormatProvider): Disposable {\n // Legacy providers used `selector` / `inclusionPriority`.\n // @ts-ignore legacy API compatability.\n provider.grammarScopes =\n provider.grammarScopes ||\n // @ts-ignore\n (provider.selector != null ? provider.selector.split(\", \") : null)\n provider.priority =\n provider.priority != null\n ? provider.priority\n : // @ts-ignore\n provider.inclusionPriority != null\n ? // @ts-ignore\n provider.inclusionPriority\n : 0\n if (\"formatCode\" in provider) {\n return consumeRangeProvider(provider)\n } else if (\"formatEntireFile\" in provider) {\n return consumeFileProvider(provider)\n } else if (\"formatAtPosition\" in provider) {\n return consumeOnTypeProvider(provider)\n } else if (\"formatOnSave\" in provider) {\n return consumeOnSaveProvider(provider)\n }\n throw new Error(\"Invalid code format provider\")\n}\n"],"names":["Object","defineProperty","nullthrows","value","x","Error","functionOrClass","displayName","name","UniversalDisposable","constructor","teardowns","disposed","Set","length","add","this","i","assertTeardown","addUntilDestroyed","destructible","destroyDisposable","onDidDestroy","dispose","remove","teardown","delete","forEach","unsubscribe","destroy","clear","TypeError","Promise","resolve","process","nextTick","async","promise","milliSeconds","timeoutFn","cleanupFn","timeout","setTimeout","clearTimeout","delay","Date","now","deadline","timeoutPromise","retryFunction","validationFunction","maximumTries","retryIntervalMs","result","tries","lastError","error","sleep","asyncFun","scheduledCall","pendingCall","startAsyncCall","resultPromise","then","callNext","items_","test","thisArg","items","reject","slice","numItems","next","index","item","call","f","args","apply","concat","array","filterFunction","limit","filteredList","asyncLimit","push","obj","keys","filteredObj","key","someFunction","resolved","object","Boolean","fn","ret","err","ms","_lastDispatchedOp","_lastFinishedOp","_latestPromise","_waitResolve","thisOp","status","lastPromise","isRunInProgress","TimedOutError","milliseconds","String","catch","mappingFunction","Array","parallelPromises","parallelLimit","Math","min","runPromise","e","_promise","_state","kind","getPromise","getState","performance","seconds","nanoseconds","hrtime","rawAnalyticsService","isTrackSupported","eventName","values","track","events","subscribe","trackEvent","analyticsService","ob","setApplicationSessionObservable","event","type","data","trackSampled","sampleRate","random","sample_rate","canMeasure","TimingTracker","_eventName","_startTime","_startMark","_values","eventCount","mark","onError","_trackTimingEvent","onCancel","onSuccess","exception","canceled","measure","clearMarks","clearMeasures","duration","round","toString","startTracking","trackTiming","operation","tracker","reason","decorateTrackTiming","decoratedTrackTiming","bind","trackTimingSampled","decorateTrackTimingSampled","decoratedTrackTimingSampled","_providers","addProvider","provider","findIndex","p","priority","splice","removeProvider","indexOf","getProviderForEditor","editor","grammar","getGrammar","scopeName","findProvider","getAllProvidersForEditor","findAllProviders","grammarScopes","emitter","callback","addListener","removeListener","Observable","create","observer","path","atom","workspace","getTextEditors","getPath","buffer","getBuffer","getViewOfEditor","getScrollTop","position","scrollTop","setCursorBufferPosition","autoscroll","setScrollTop","defer","cursor","getCursors","merge","of","getBufferPosition","onDidChangePosition","map","newBufferPosition","take","textEditor","readOnlyExceptions","getElement","setAttribute","removeAttribute","enforcedSoftWrap","setSoftWrapped","onDidChangeSoftWrapped","softWrapped","isDestroyed","TextEditor","textEditorElement","bufferLineNumber","getModel","pixelPositionForBufferPosition","top","getLineHeightInPixels","clientHeight","max","focus","views","getView","file","options","center","moveCursor","activatePane","activateItem","line","column","pending","currentEditor","getActiveTextEditor","paneContainer","paneContainerForItem","activate","goToLocationInEditor","open","initialLine","initialColumn","searchAllPanes","tmp","captureStackTrace","scrollToBufferPosition","goToLocationSubject","Subject","changes","paths","from","checkpoints","all","createCheckpoint","allOkay","reduce","successSoFar","edits","get","applyTextEdits","checkPoint","revertToCheckpoint","applySortedTextEditsToBuffer","sortEdits","sortedEdits","oldRange","end","isGreaterThan","start","editsOverlap","warn","isEqual","getRange","oldText","getText","setTextViaDiff","newText","checkpoint","applyToBuffer","groupChangesSinceCheckpoint","edit","row","lineLength","lineLengthForRow","getTextInRange","setTextInRange","sort","e1","i1","e2","i2","compare","onWillSaveProviders","disposables","observeTextEditors","realSave","save","editor_","setTime","getTime","empty","providers","toArray","race","onWillSave","toPromise","uri","patchEditorSave","ProviderRegistry","config","_packageName","_config","getConfig","setPackageName","getPackageName","formatKeyPath","keyPath","getWithDefaults","defaults","current","getSchema","observe","optionsOrCallback","prototype","arguments","observeAsStream","disposable","onDidChange","set","setSchema","schema","unset","isFeatureDisabled","packages","isPackageDisabled","v","undefined","require","exports","_encode","ch","charCodeAt","toUpperCase","encodeURIComponent2","str","encodeURIComponent","replace","encodeNoop","isWindows","URI","_scheme","_empty","_authority","_path","_query","_fragment","_formatted","_fsPath","isUri","thing","authority","fragment","query","scheme","enumerable","configurable","_driveLetterPath","toLowerCase","substr","with","change","_validate","parse","_parseComponents","decodeURIComponent","_slash","idx","substring","match","_regexp","exec","components","_schemePattern","_singleSlashStart","_doubleSlashStart","skipEncoding","_asFormatted","encoder","parts","m","_upperCaseDrive","lastIdx","join","toJSON","res","fsPath","external","$mid","revive","default","platform","navigator","userAgent","factory","module","xs","s","op","CONTROL","BAREWORD","TOKEN","pow","env","opts","mapped","chunker","RegExp","filter","commented","j","charAt","comment","SQ","DQ","DS","BS","escape","quote","esc","out","isGlob","len","c","parseEnvVar","pattern","varend","varname","getVar","prev","arg","_","pre","r","JSON","stringify","acc","split","message","stack","input_","reference_","useShortVariant","useNumbersOnly","input","reference","delta","formats","shortFormats","longFormatsNumbers","longFormats","relativeFormat","remainder","haystack","char","count","code","a","b","maxLength","suffix","separator","level","repeat","noun","needle","ranges","matchIndex","prevRange","markdown","HOUR","DAY","WEEK","YEAR","MONTH","Number","MAX_VALUE","KNOWN_ARCHIVE_EXTENSIONS","URI_PREFIX_REGEX","isRemote","startsWith","isAtomUri","createRemoteUri","hostname","remotePath","hostAndPath","hostSep","_endsWithArchiveSeparator","parseRemoteUri","remoteUri","parsedUri","getHostname","relativePath","joinArray","_testForIllegalUri","uriPathModule","_pathModuleFor","_archiveEncodeArrayInPlace","_archiveDecode","normalize","_archiveEncode","basename","ext","dirname","extname","_getWindowsPathFromWindowsFileUri","prefix","pathModule","win32","_isWindowsPath","contains","parent","child","endsWithSeparator","_isArchiveSeparator","sep","hostFormatters","hostnameToDisplayHostname","formatter","nuclideUriToDisplayHostname","ensureTrailingSeparator","endsWith","isAbsolute","isRoot","posix","_matchTrailingArchive","other","some","extStart","IMAGE_EXTENSIONS","stripExtension","isLocal","isInArchive","ancestorOutsideArchive","validate","mustBeRemote","getHostnameOpt","archiveJoin","relative","remote","uriEncode","otherEncode","looksLikeImageUri","has","normalizeDir","getParent","uriToNuclideUri","windowsPathFromUri","lspUri","LspUri","nuclideUriToUri","collapse","fp","nuclideUriToDisplayString","registerHostnameFormatter","trimTrailingSeparator","stripped","endsWithEdenDir","isHomeRelative","expandHomeDir","HOME","UserProfile","os","homePath","splitPathList","delimiter","joinPathList","every","ensureLocalPrefix","localPrefix","parsePath","parsed","root","dir","base","reverse","pathSeparatorFor","hasKnownArchiveExtension","ARCHIVE_SEPARATOR","NUCLIDE_URI_TYPE_NAME","__TEST__","context","integerPart","n","censorNegativeZero","trunc","sign","createIntegerConversion","bitLength","typeOpts","isSigned","unsigned","lowerBound","upperBound","twoToTheBitLength","twoToOneLessThanTheBitLength","V","enforceRange","isFinite","isNaN","clamp","floor","evenRound","y","signMightNotMatch","modulo","convertCallbackFunction","val","is","fround","treatNullAsEmptyString","DOMString","codePointAt","S","U","fromCodePoint","d","ArrayBuffer","DataView","Int8Array","Int16Array","Int32Array","Uint8Array","Uint16Array","Uint32Array","Uint8ClampedArray","Float32Array","Float64Array","func","article","isView","getReferenceToBytes","bufferSource","getPrototypeOf","Buffer","byteOffset","byteLength","wrapperSymbol","Symbol","implSymbol","sameObjectCaches","wrapperForImpl","impl","implForWrapper","wrapper","iterInternalSymbol","IteratorPrototype","iterator","isObject","getCopyToBytes","mixin","target","source","getOwnPropertyNames","getOwnPropertyDescriptor","getSameObject","prop","creator","tryWrapperForImpl","tryImplForWrapper","legacyErrorCodes","idlUtils","require$$1","conversions","require$$0","utils","DOMException","iface","setup","writable","toStringTag","mixedInto","Impl","implementation","isImpl","convert","constructorArgs","privateData","createImpl","_internalSetup","init","interface","expose","Window","Worker","require$$2","setPrototypeOf","WeakMap","wrappers","pd","retv","console","assert","Event","eventTarget","eventPhase","currentTarget","stopped","passiveListener","timeStamp","defineRedirectDescriptor","defineCallDescriptor","getWrapper","proto","BaseEvent","CustomEvent","isFunc","defineWrapper","isStopped","setPassiveListener","composedPath","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","stopPropagation","stopImmediatePropagation","bubbles","cancelable","preventDefault","defaultPrevented","composed","window","listenersMap","getListeners","listeners","defineEventAttribute","eventTargetPrototype","node","listenerType","listener","newNode","passive","once","defineEventAttributeDescriptor","defineCustomEventTarget","eventNames","CustomEventTarget","EventTarget","isArray","types","Map","addEventListener","optionsIsObj","capture","removeEventListener","dispatchEvent","wrappedEvent","wrapEvent","handleEvent","setEventPhase","setCurrentTarget","AbortSignal","EventTargetShim","aborted","onabort","signal","abort","element","elem","subArray","predicate","subarr","offset","arrayEqual","pass","fail","maps","unionMap","selected","selector","src","transform","map1","map2","equalComparator","size","equalFunction","value1","default_","setFilter","sets","accumulator","setUnionTwo","hash_","hash","bHashes","pairs","pair","k","list","iterable","project","iterators","projectorFn","stop","step","findInIterable","iterableIsEmpty","filterIterable","arr","startingIndex","objectEntries","keyFn","seenKeys","ranker","maxRank","maxRankedItem","maxSeenRank","rank","array1","array2","item1","entries","hasOwnProperty","propertyIsEnumerable","_map","deleteAll","newSet","didRemove","hasAny","DefaultMap","_factory","super","DefaultWeakMap","wait","immediate","timestamp","later","last","debounced","args_","callNow","includeNewlines","onEnd","lines","pop","complete","condition","stream","flush","multicast","ReplaySubject","refCount","addAction","reconcileSetDiffs","let","diffSets","toggler","distinctUntilChanged","switchMap","enabled","observables","tagged","observable","scan","leading","getDelay","timer","timerStarts","latestValue","latestValueIsLeading","shouldIgnore","checkShouldNext","valueToDispatch","sub","Subscription","completedSymbol","o","materialize","dematerialize","debouncedNext","subscription","completed","abortController","AbortController","takeUntil","fromEvent","delays","subscribedAt","do","timeElapsed","pairwise","previous","added","removed","diff","diffs","itemsToDisposables","disposeItem","microtask","macrotask","timerId","setImmediate","clearImmediate","nextAnimationFrame","requestAnimationFrame","id","cancelAnimationFrame","toAbortablePromise","_abortController","createTask","cancel","controller","isExecuting","CodeFormatManager","_subscriptions","_subscribeToEvents","registerOnWillSave","_onWillSaveProvider","_rangeProviders","_fileProviders","_onTypeProviders","_onSaveProviders","commandEvents","observableFromSubscribeFunction","commands","editorEvents","cb","mergeMap","changeEvents","onDidChangeText","willDestroyEvents","onWillDestroyPaneItem","observeEditorDestroy","_getEditorEventStream","groupBy","grouped","completingSwitchMap","_handleEvent","_formatCodeInTextEditor","applyTextEditsToBuffer","notifications","addError","detail","_formatCodeOnTypeInTextEditor","getLogger","throw","range","selectionRange","getSelectedBufferRange","selectionStart","selectionEnd","formatRange","isEmpty","Range","rangeProviders","fileProviders","contents","rangeEdits","_reportBusy","formatCode","allEdits","firstNonEmpty","find","fileEdits","formatEntireFile","allResults","firstNonNull","formatted","first","aggregatedEvent","typedText","getActivePackage","includes","isBracketPair","shouldFormatOnType","featureConfig","character","cursorPosition","getCursorBufferPosition","copy","formatAtPosition","firstNonEmptyIndex","before","after","_checkContentsAreSame","keepCursorPosition","_formatCodeOnSaveInTextEditor","saveProviders","formatOnSave","flatMap","scope","getRootScopeDescriptor","getFormatOnSave","revealTooltip","busySignalService","_busySignalService","displayPath","nuclideUri","reportBusyWhile","addRangeProvider","addFileProvider","addOnTypeProvider","addOnSaveProvider","consumeBusySignal","codeFormatManager","consumeRangeProvider","consumeFileProvider","consumeOnTypeProvider","consumeOnSaveProvider","inclusionPriority"],"mappings":"2VAEAA,OAAOC,eAAeC,EAAS,aAAc,CAACC,OAAO,IAErD,gBAAkB,SAAoBC,GACpC,GAAS,MAALA,EACF,OAAOA,EAET,MAAM,IAAIC,MAAM,+GCIH,SACbC,MAGyC,iBAAhCA,EAAgBC,aACS,KAAhCD,EAAgBC,mBAETD,EAAgBC,YAClB,GAC2B,iBAAzBD,EAAgBE,MACE,KAAzBF,EAAgBE,YAETF,EAAgBE,WAGlB,4FCAM,MAAMC,EAInBC,eAAeC,QAHfC,qBACAD,sBAGOA,UAAY,IAAIE,SAChBD,UAAW,EACZD,EAAUG,aACPC,OAAOJ,GAIhBI,OAAOJ,MACDK,KAAKJ,eACD,IAAIP,MAAM,8DAEb,IAAIY,EAAI,EAAGA,EAAIN,EAAUG,OAAQG,IACpCC,EAAeP,EAAUM,SACpBN,UAAUI,IAAIJ,EAAUM,IAajCE,kBACEC,KACGT,MAECK,KAAKJ,eACD,IAAIP,MAAM,gEAEZgB,EAAoB,IAAIZ,KACzBE,EACHS,EAAaE,cAAa,KACxBD,EAAkBE,eACbC,OAAOH,YAGXN,IAAIM,GAGXG,OAAOC,GACAT,KAAKJ,eACHD,UAAUe,OAAOD,GAI1BF,UACOP,KAAKJ,gBACHA,UAAW,OACXD,UAAUgB,SAAQF,IACW,mBAArBA,EAASF,QAClBE,EAASF,UACgC,mBAAzBE,EAASG,YACzBH,EAASG,cAC4B,mBAArBH,EAASI,QACzBJ,EAASI,UACoB,mBAAbJ,GAChBA,YAGCd,UAAa,MAItBiB,mBACOL,UAGPO,QACOd,KAAKJ,e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cg1B,kBAAkBh1B,GAChB,OAAOlK,KAAKi6B,iBAAiBhwB,YAAYC,GAG3Ci1B,kBAAkBT,GAEhB,OADA1+B,KAAK2+B,mBAAqBD,EACnB,IAAIj/B,GAAoB,KAC7BO,KAAK2+B,mBAAqB,QAI9Bp+B,UACEP,KAAK05B,eAAen5B,iTE7TxB,IAAI6+B,YAMYC,GAAqBn1B,GACnC,OAAOk1B,GAAkBL,iBAAiB70B,YAG5Bo1B,GAAoBp1B,GAClC,OAAOk1B,GAAkBJ,gBAAgB90B,YAG3Bq1B,GAAsBr1B,GACpC,OAAOk1B,GAAkBH,kBAAkB/0B,YAG7Bs1B,GAAsBt1B,GACpC,OAAOk1B,GAAkBF,kBAAkBh1B,+BAhB3Ck1B,GAAoB,IAAI3F,yDAmBQiF,GAChC,OAAOU,GAAkBD,kBAAkBT,0EC9BPx0B,GAepC,GAZAA,EAASe,cACPf,EAASe,gBAEa,MAArBf,EAASgnB,SAAmBhnB,EAASgnB,SAAS7U,MAAM,MAAQ,MAC/DnS,EAASG,SACc,MAArBH,EAASG,SACLH,EAASG,SAEmB,MAA9BH,EAASu1B,kBAEPv1B,EAASu1B,kBACT,EACF,eAAgBv1B,EAClB,OAAOm1B,GAAqBn1B,GACvB,GAAI,qBAAsBA,EAC/B,OAAOo1B,GAAoBp1B,GACtB,GAAI,qBAAsBA,EAC/B,OAAOq1B,GAAsBr1B,GACxB,GAAI,iBAAkBA,EAC3B,OAAOs1B,GAAsBt1B,GAE/B,MAAM,IAAI7K,MAAM,iKDUhB+/B,GAAkB7+B"} \ No newline at end of file diff --git a/dist/spec/CodeFormatManager-spec.d.ts b/dist/spec/CodeFormatManager-spec.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/spec/CodeFormatManager-spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/spec/runner.d.ts b/dist/spec/runner.d.ts new file mode 100644 index 0000000..db5a99f --- /dev/null +++ b/dist/spec/runner.d.ts @@ -0,0 +1,2 @@ +declare const _default: import("atom").TestRunner; +export default _default; diff --git a/dist/spec/utils.d.ts b/dist/spec/utils.d.ts new file mode 100644 index 0000000..e824b19 --- /dev/null +++ b/dist/spec/utils.d.ts @@ -0,0 +1,4 @@ +/** Wait until a function returns true */ +export declare function waitFor(fn: (...args: any[]) => boolean, timeout?: number): any; +/** Sleep for ms */ +export declare function sleep(ms: any): Promise; diff --git a/dist/src/CodeFormatManager.d.ts b/dist/src/CodeFormatManager.d.ts new file mode 100644 index 0000000..9a8aedc --- /dev/null +++ b/dist/src/CodeFormatManager.d.ts @@ -0,0 +1,52 @@ +import type { TextEditor, TextChange, Disposable } from "atom"; +declare type AggregatedTextChange = { + changes: Array; +}; +import type { TextEdit } from "@atom-ide-community/nuclide-commons-atom/text-edit"; +import type { BusySignalService } from "atom-ide-base"; +import type { FileCodeFormatProvider, OnSaveCodeFormatProvider, OnTypeCodeFormatProvider, RangeCodeFormatProvider } from "./types"; +import { Range } from "atom"; +import ProviderRegistry from "@atom-ide-community/nuclide-commons-atom/ProviderRegistry"; +import UniversalDisposable from "@atom-ide-community/nuclide-commons/UniversalDisposable"; +import { Observable } from "rxjs-compat/bundles/rxjs-compat.umd.min.js"; +import type { Subscription } from "rxjs"; +export declare const SAVE_TIMEOUT = 2500; +declare type FormatEvent = { + type: "command" | "save" | "new-save"; + editor: TextEditor; +} | { + type: "type"; + editor: TextEditor; + edit: AggregatedTextChange; +}; +export default class CodeFormatManager { + _subscriptions: UniversalDisposable; + _rangeProviders: ProviderRegistry; + _fileProviders: ProviderRegistry; + _onTypeProviders: ProviderRegistry; + _onSaveProviders: ProviderRegistry; + _busySignalService: BusySignalService | undefined | null; + constructor(); + /** + * Subscribe to all formatting events (commands, saves, edits) and dispatch formatters as necessary. By handling all + * events in a central location, we ensure that no buffer runs into race conditions with simultaneous formatters. + */ + _subscribeToEvents(): Subscription; + _handleEvent(event: FormatEvent): Observable; + _formatCodeInTextEditor(editor: TextEditor, range?: Range): Observable>; + _formatCodeOnTypeInTextEditor(editor: TextEditor, aggregatedEvent: AggregatedTextChange): Observable>; + _onWillSaveProvider(): { + priority: number; + timeout: number; + callback: (editor: TextEditor) => any; + }; + _formatCodeOnSaveInTextEditor(editor: TextEditor): Observable; + _reportBusy(editor: TextEditor, promise: Promise, revealTooltip?: boolean): Promise; + addRangeProvider(provider: RangeCodeFormatProvider): Disposable; + addFileProvider(provider: FileCodeFormatProvider): Disposable; + addOnTypeProvider(provider: OnTypeCodeFormatProvider): Disposable; + addOnSaveProvider(provider: OnSaveCodeFormatProvider): Disposable; + consumeBusySignal(busySignalService: BusySignalService): Disposable; + dispose(): void; +} +export {}; diff --git a/dist/src/config.d.ts b/dist/src/config.d.ts new file mode 100644 index 0000000..ad97428 --- /dev/null +++ b/dist/src/config.d.ts @@ -0,0 +1,3 @@ +import type { TextEditor } from "atom"; +export declare function getFormatOnSave(editor: TextEditor): boolean; +export declare function getFormatOnType(): boolean; diff --git a/dist/src/legacy-provider.d.ts b/dist/src/legacy-provider.d.ts new file mode 100644 index 0000000..499efee --- /dev/null +++ b/dist/src/legacy-provider.d.ts @@ -0,0 +1,3 @@ +import type { Disposable } from "atom"; +import type { CodeFormatProvider } from "./types"; +export declare function consumeLegacyProvider(provider: CodeFormatProvider): Disposable; diff --git a/dist/src/main.d.ts b/dist/src/main.d.ts new file mode 100644 index 0000000..a31a5a7 --- /dev/null +++ b/dist/src/main.d.ts @@ -0,0 +1,12 @@ +import type { Disposable } from "atom"; +import type { BusySignalService } from "atom-ide-base"; +import type { RangeCodeFormatProvider, FileCodeFormatProvider, OnTypeCodeFormatProvider, OnSaveCodeFormatProvider } from "./types"; +export { default as config } from "./config.json"; +export declare function activate(): void; +export declare function consumeRangeProvider(provider: RangeCodeFormatProvider): Disposable; +export declare function consumeFileProvider(provider: FileCodeFormatProvider): Disposable; +export declare function consumeOnTypeProvider(provider: OnTypeCodeFormatProvider): Disposable; +export declare function consumeOnSaveProvider(provider: OnSaveCodeFormatProvider): Disposable; +export declare function consumeBusySignal(busySignalService: BusySignalService): Disposable; +export declare function deactivate(): void; +export { consumeLegacyProvider } from "./legacy-provider"; diff --git a/dist/src/types.d.ts b/dist/src/types.d.ts new file mode 100644 index 0000000..8e470f6 --- /dev/null +++ b/dist/src/types.d.ts @@ -0,0 +1,57 @@ +import type { TextEditor, Range, Point } from "atom"; +import type { TextEdit } from "@atom-ide-community/nuclide-commons-atom/text-edit"; +/** + * A brief overview of the different code formatting providers: + * + * == Range formatters == These accept a range to format and return a list of edits to apply. These will always be + * preferred over file formatters when a range is selected. + * + * == File formatters == These always return the result of formatting the entire file. To compensate, they can return a + * custom cursor position to avoid disruption. These will be preferred over range formatters for whole-file formatting. + * + * == onType formatters == These are run after every typing event in a selected editor. + * + * == onSave formatters == These are run whenever a selected editor is saved. If the global format-on-save option is + * enabled, then file/range formatters will be triggered on save (even if no save formatters are provided). Obviously, + * save formatters are preferred in this case. + */ +/** + * Formats the range specified, and returns a list of text edits to apply. Text edits must be non-overlapping and + * preferably in reverse-sorted order. + */ +export declare type RangeCodeFormatProvider = { + formatCode: (editor: TextEditor, range: Range) => Promise>; + priority: number; + readonly grammarScopes?: Array; +}; +/** + * Formats the range specified, but returns the entire file (along with the new cursor position). Useful for + * less-flexible providers like clang-format. + */ +export declare type FileCodeFormatProvider = { + formatEntireFile: (editor: TextEditor, range: Range) => Promise<{ + newCursor?: number; + formatted: string; + } | undefined | null>; + priority: number; + readonly grammarScopes?: Array; +}; +/** + * Formats around the given position, and returns a list of text edits to apply, similar to `formatCode`. The provider + * determines the exact range to format based on what's at that position. + * + * This will automatically triggered after every typing event. + */ +export declare type OnTypeCodeFormatProvider = { + formatAtPosition: (editor: TextEditor, position: Point, triggerCharacter: string) => Promise>; + priority: number; + readonly grammarScopes?: Array; + keepCursorPosition: boolean; +}; +/** Formats files after save events. */ +export declare type OnSaveCodeFormatProvider = { + formatOnSave: (editor: TextEditor) => Promise>; + priority: number; + readonly grammarScopes?: Array; +}; +export declare type CodeFormatProvider = RangeCodeFormatProvider | FileCodeFormatProvider | OnTypeCodeFormatProvider | OnSaveCodeFormatProvider; diff --git a/dist/tsconfig.tsbuildinfo b/dist/tsconfig.tsbuildinfo new file mode 100644 index 0000000..44c3211 --- /dev/null +++ b/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/tslib/tslib.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostic_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/ts3.6/base.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/base.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/atom/src/atom-environment.d.ts","../node_modules/@types/atom/src/text-editor-element.d.ts","../node_modules/@types/atom/dependencies/event-kit/index.d.ts","../node_modules/@types/atom/dependencies/first-mate/src/grammar.d.ts","../node_modules/@types/atom/dependencies/first-mate/src/first-mate.d.ts","../node_modules/@types/atom/dependencies/first-mate/index.d.ts","../node_modules/@types/atom/dependencies/pathwatcher/src/file.d.ts","../node_modules/@types/atom/dependencies/pathwatcher/src/directory.d.ts","../node_modules/@types/atom/dependencies/pathwatcher/src/main.d.ts","../node_modules/@types/atom/dependencies/pathwatcher/index.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/display-marker.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/display-marker-layer.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/helpers.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/marker.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/marker-layer.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/point.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/range.d.ts","../node_modules/@types/atom/dependencies/text-buffer/src/text-buffer.d.ts","../node_modules/@types/atom/dependencies/text-buffer/index.d.ts","../node_modules/@types/atom/src/buffered-node-process.d.ts","../node_modules/@types/atom/src/buffered-process.d.ts","../node_modules/@types/atom/src/clipboard.d.ts","../node_modules/@types/atom/src/color.d.ts","../node_modules/@types/atom/src/command-registry.d.ts","../node_modules/@types/atom/src/config.d.ts","../node_modules/@types/atom/src/config-schema.d.ts","../node_modules/@types/atom/src/context-menu-manager.d.ts","../node_modules/@types/atom/src/cursor.d.ts","../node_modules/@types/atom/src/decoration.d.ts","../node_modules/@types/atom/src/deserializer-manager.d.ts","../node_modules/@types/atom/src/dock.d.ts","../node_modules/@types/atom/src/get-window-load-settings.d.ts","../node_modules/@types/atom/src/git-repository.d.ts","../node_modules/@types/atom/src/grammar-registry.d.ts","../node_modules/@types/atom/src/gutter.d.ts","../node_modules/@types/atom/src/history-manager.d.ts","../node_modules/@types/atom/src/keymap-extensions.d.ts","../node_modules/@types/atom/src/layer-decoration.d.ts","../node_modules/@types/atom/src/menu-manager.d.ts","../node_modules/@types/atom/src/notification.d.ts","../node_modules/@types/atom/src/notification-manager.d.ts","../node_modules/@types/atom/src/other-types.d.ts","../node_modules/@types/atom/src/package.d.ts","../node_modules/@types/atom/src/package-manager.d.ts","../node_modules/@types/atom/src/pane.d.ts","../node_modules/@types/atom/src/panel.d.ts","../node_modules/@types/atom/src/path-watcher.d.ts","../node_modules/@types/atom/src/project.d.ts","../node_modules/@types/atom/src/scope-descriptor.d.ts","../node_modules/@types/atom/src/selection.d.ts","../node_modules/@types/atom/src/style-manager.d.ts","../node_modules/@types/atom/src/task.d.ts","../node_modules/@types/atom/src/text-editor.d.ts","../node_modules/@types/atom/src/text-editor-component.d.ts","../node_modules/@types/atom/src/text-editor-registry.d.ts","../node_modules/@types/atom/src/theme-manager.d.ts","../node_modules/@types/atom/src/tooltip.d.ts","../node_modules/@types/atom/src/tooltip-manager.d.ts","../node_modules/@types/atom/src/view-registry.d.ts","../node_modules/@types/atom/src/workspace.d.ts","../node_modules/@types/atom/src/workspace-center.d.ts","../node_modules/@types/atom/index.d.ts","../node_modules/atom-ide-base/types-packages/uri.d.ts","../node_modules/atom-ide-base/types-packages/busy-signal.d.ts","../node_modules/atom-ide-base/types-packages/call-hierarchy.d.ts","../node_modules/@types/atom/linter/config.d.ts","../node_modules/@types/atom/linter/index.d.ts","../node_modules/atom-ide-base/types-packages/code-actions.d.ts","../node_modules/atom-ide-base/types-packages/code-highlight.d.ts","../node_modules/atom-ide-base/types-packages/datatip.d.ts","../node_modules/atom-ide-base/types-packages/definitions.d.ts","../node_modules/atom-ide-base/types-packages/find-references.d.ts","../node_modules/atom-ide-base/types-packages/hyperclick.d.ts","../node_modules/atom-ide-base/types-packages/outline.d.ts","../node_modules/atom-ide-base/types-packages/sig-help.d.ts","../node_modules/@types/trusted-types/lib/index.d.ts","../node_modules/@types/trusted-types/index.d.ts","../node_modules/@types/dompurify/index.d.ts","../node_modules/atom-ide-base/types-packages/markdown-service.d.ts","../node_modules/atom-ide-base/types-packages/text-edit.d.ts","../node_modules/atom-ide-base/types-packages/code-format.d.ts","../node_modules/atom-ide-base/types-packages/refactor.d.ts","../node_modules/atom-ide-base/types-packages/console.d.ts","../node_modules/atom-ide-base/types-packages/main.d.ts","../src/types.ts","../src/config.ts","../node_modules/rxjs/internal/Subscription.d.ts","../node_modules/rxjs/internal/types.d.ts","../node_modules/rxjs/internal/Subscriber.d.ts","../node_modules/rxjs/internal/Operator.d.ts","../node_modules/rxjs/internal/observable/iif.d.ts","../node_modules/rxjs/internal/observable/throwError.d.ts","../node_modules/rxjs/internal/Observable.d.ts","../node_modules/rxjs/internal/Subject.d.ts","../node_modules/rxjs/internal/observable/ConnectableObservable.d.ts","../node_modules/rxjs/internal/operators/groupBy.d.ts","../node_modules/rxjs/internal/symbol/observable.d.ts","../node_modules/rxjs/internal/BehaviorSubject.d.ts","../node_modules/rxjs/internal/ReplaySubject.d.ts","../node_modules/rxjs/internal/AsyncSubject.d.ts","../node_modules/rxjs/internal/Scheduler.d.ts","../node_modules/rxjs/internal/scheduler/Action.d.ts","../node_modules/rxjs/internal/scheduler/AsyncScheduler.d.ts","../node_modules/rxjs/internal/scheduler/AsyncAction.d.ts","../node_modules/rxjs/internal/scheduler/AsapScheduler.d.ts","../node_modules/rxjs/internal/scheduler/asap.d.ts","../node_modules/rxjs/internal/scheduler/async.d.ts","../node_modules/rxjs/internal/scheduler/QueueScheduler.d.ts","../node_modules/rxjs/internal/scheduler/queue.d.ts","../node_modules/rxjs/internal/scheduler/AnimationFrameScheduler.d.ts","../node_modules/rxjs/internal/scheduler/animationFrame.d.ts","../node_modules/rxjs/internal/scheduler/VirtualTimeScheduler.d.ts","../node_modules/rxjs/internal/Notification.d.ts","../node_modules/rxjs/internal/util/pipe.d.ts","../node_modules/rxjs/internal/util/noop.d.ts","../node_modules/rxjs/internal/util/identity.d.ts","../node_modules/rxjs/internal/util/isObservable.d.ts","../node_modules/rxjs/internal/util/ArgumentOutOfRangeError.d.ts","../node_modules/rxjs/internal/util/EmptyError.d.ts","../node_modules/rxjs/internal/util/ObjectUnsubscribedError.d.ts","../node_modules/rxjs/internal/util/UnsubscriptionError.d.ts","../node_modules/rxjs/internal/util/TimeoutError.d.ts","../node_modules/rxjs/internal/observable/bindCallback.d.ts","../node_modules/rxjs/internal/observable/bindNodeCallback.d.ts","../node_modules/rxjs/internal/InnerSubscriber.d.ts","../node_modules/rxjs/internal/OuterSubscriber.d.ts","../node_modules/rxjs/internal/observable/combineLatest.d.ts","../node_modules/rxjs/internal/observable/concat.d.ts","../node_modules/rxjs/internal/observable/defer.d.ts","../node_modules/rxjs/internal/observable/empty.d.ts","../node_modules/rxjs/internal/observable/forkJoin.d.ts","../node_modules/rxjs/internal/observable/from.d.ts","../node_modules/rxjs/internal/observable/fromEvent.d.ts","../node_modules/rxjs/internal/observable/fromEventPattern.d.ts","../node_modules/rxjs/internal/observable/generate.d.ts","../node_modules/rxjs/internal/observable/interval.d.ts","../node_modules/rxjs/internal/observable/merge.d.ts","../node_modules/rxjs/internal/observable/never.d.ts","../node_modules/rxjs/internal/observable/of.d.ts","../node_modules/rxjs/internal/observable/onErrorResumeNext.d.ts","../node_modules/rxjs/internal/observable/pairs.d.ts","../node_modules/rxjs/internal/observable/partition.d.ts","../node_modules/rxjs/internal/observable/race.d.ts","../node_modules/rxjs/internal/observable/range.d.ts","../node_modules/rxjs/internal/observable/timer.d.ts","../node_modules/rxjs/internal/observable/using.d.ts","../node_modules/rxjs/internal/observable/zip.d.ts","../node_modules/rxjs/internal/scheduled/scheduled.d.ts","../node_modules/rxjs/internal/config.d.ts","../node_modules/rxjs/index.d.ts","../src/CodeFormatManager.ts","../src/config.json","../src/main.ts","../src/legacy-provider.ts","../spec/utils.ts","../spec/CodeFormatManager-spec.ts","../node_modules/@types/jasmine/index.d.ts","../node_modules/atom-jasmine3-test-runner/types/index.d.ts","../spec/runner.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/unist/index.d.ts","../node_modules/@types/mdast/index.d.ts","../node_modules/@types/parse-json/index.d.ts","../node_modules/@types/prop-types/index.d.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/scheduler/tracing.d.ts","../node_modules/@types/react/index.d.ts","../node_modules/@types/react-dom/index.d.ts","../node_modules/@types/resolve/index.d.ts","../node_modules/@types/scheduler/index.d.ts"],"fileInfos":[{"version":"ac3a8c4040e183ce38da69d23b96939112457d1936198e6542672b7963cf0fce","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84",{"version":"1dad4fe1561d99dfd6709127608b99a76e5c2643626c800434f99c48038567ee","affectsGlobalScope":true},{"version":"cce43d02223f8049864f8568bed322c39424013275cd3bcc3f51492d8b546cb3","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"8dff1b4c2df638fcd976cbb0e636f23ab5968e836cd45084cc31d47d1ab19c49","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"8f4c9f651c8294a2eb1cbd12581fe25bfb901ab1d474bb93cd38c7e2f4be7a30","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"60761e6ea886034af0f294f025a7199360ce4e2c8ba4ec6408bc049cf9b89799","affectsGlobalScope":true},{"version":"506b80b9951c9381dc5f11897b31fca5e2a65731d96ddefa19687fbc26b23c6e","affectsGlobalScope":true},"4576b4e61049f5ffd7c9e935cf88832e089265bdb15ffc35077310042cbbbeea","f5a6d1a8e21751af6fd0a8422d72ba825c15bce9a1af9d02fc0d992406f18f5f",{"version":"bf629ebbac2c65601bcb5c032644023a2b4b3b1151c0d1bf60ced7c35cc81b5d","affectsGlobalScope":true},"9d07804fffa0680a15b100ea9312078ffd9779429719240d3576bb592511bf31",{"version":"c9ed7a82b6c15c29dd1f0350d5c8bd5b9b30fb07a8572c9e6addebf05944e160","affectsGlobalScope":true},"e5cca775079552250e94c7dbbe3ac1a4fa91caae98fd83fb488440d478a5537c","8528e5fe802d788d89df3169c7a7cde25943d1cee6748a26d4210cf37d79baba",{"version":"a4565a5ce32bca81a0bf56c71168e0ca1e0941ccc15f896f808ccc7a71ba6fa8","affectsGlobalScope":true},"3111079f3cb5f2b9c812ca3f46161562bce5bfb355e915f46ed46c41714dc1c3","087a6c005a7aa76ca849cdc25a00de881291278f84361decb42701b8aff52f49","4481cd6e85120ea80d71866890faa032687d29ad820640a2b8547f04b80ed3ba","b6c2782fb0c0f113cc1c38745c57ab499dd4f459d4f76a2c083c9f6609919df0","6ac7d92ba8f420f89f63ad99af8b146a5bbfe6522be2cd7a179cb5e066975825","3996fc0e7ecec3111a208c9f3389f15381907ccfc0804f89839ec3bfdf630576","cea1624c6870349293bb4d5a4fe7b1e963392b50d34fa916a830dac5cd186ab0",{"version":"6189edcaa78cba8c1dfd1d12a8928fe0603e646009ffb9ddfa92eff0d824ce2c","affectsGlobalScope":true},"8123b4a3b707b071088f581a21f01738c7d390a28d5d712ec396d3f411e23037","4ef819c9ddb82d8e8c841c7ba9db2729915a97a0addfcda6a6a9f852b4a2a128","eb83d39b9e8404d7c73adf30bc666894028d9e567384fbf42cbae805058e24aa","99827736d6a22022a5a4c9ad847900667704560e8b10964bdd36d4412c1eb587","ec7606080747d7e424af23f9b69b02cc47855f045edafbdb2552ccdff9556b4f","ef70156b46b854df342204565597787b04ea8067c1bfd673279fc859bcae42b7",{"version":"6583daa9760bda81669417e393cf1fb9208422fdbcb4991569e59347e93f3e34","affectsGlobalScope":true},"ab108213eabd2bb2ea48db3f43ed77ca2965b22b22ad5a3d0c3b13576c60902e","e1aea0bae8186fee1b966d4e4e2a167ed0edd86668c609b1440ed0e81247462d","d15d11ea31228ad0c57cda43b406f7bb1712c6c8fe6dd9c27a90dbfc7a8d6117","ddbc96f468abfe7c1965eb69f75d267b4493a27a8eaa76ea25f8d8ef87fec846",{"version":"6fe3ec84b325c68a572b7febee0446ddccafa67a5c0701857f26acc4fec0801e","affectsGlobalScope":true},"b89ea948a92ce598bac83e0fd39ab4dd1f938b337287abe33d756950bfe31bd7","e09cc4f66a6cf31c2224129e990b91ca00b25b0826989264fbc4aaa7bf9f6460","85df3d396d50cf6706e8a7fdc94402adbfe636ff758ced46cdd8de906957ca1d","e72c97f28066c9d46cb3fe23f2978ef3a4cedee77ff1fd70634654d7df13bc25","7b9958476fc2d098848bad9eb338d0471dc90799235b3c81286da7ed904bcdcd","328b0780f9ea2c65b5811fb3de14122c00b0a6ebe5b9581e8892decd83b1f8a8","c55b1e6bee98c27c3ff8477a47ef182841cbf7883c0e8b47c76506532366c34c",{"version":"34085490aa2954356441cf6e769f2fab1ba11800264cbdcfd9ee10d70fe1ea47","affectsGlobalScope":true},"a7d28061d1dd9315187b6be305be679c0600a335f4921ce66af79b35104e0bbe","1a3649e06d4244990d2c19e0b3a13330b30747818604cdc0ef19318df80a2b3f","5367052357620c6e14cf2a53f7ede9f8d85f4a9dab6facc3da6ae445541b7372","bb0ef00324f06a878b5c102a6b9670d3562126c7a7a09b5318d5c2113974ce1c","1bc668fc53967b5d4071a9094110b20445a5992f9a226874b2c9ac4e904ad033","5c067020e59677ac77cad8b01bdd01361f5315f289bcc50331e5750b4f29f5b7","45e9d7a11405d31fbb49e5d4fbad5c2d7dc9780f64338af388ba7ea9280b468f","6e25f951f1c64dc1fdda83ad3183b4af572b95218e736bf454185ac0c8abdf41","485a02812f947eb6011e70c44b3e815566b354efc90d4c2c5ac9d7bb3b948a42","b5cc8a2bdfe0163d116852650429c0a49ea75211dfaf66b7b0349fee7b3e8d83",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"f87509fed855ba8d77bcc1bbdd1acb8380a8092373c2caf3f04e5a8f8f3c5e5b","7e28b18588869fdeb3ff70581047ea017bae32c0baf1464b5b501c1ae00a96e0","c279f541b15691f99c82e130c9897740adf4584442b3610c5634f5684c1f5b60","e61a21e9418f279bc480394a94d1581b2dee73747adcbdef999b6737e34d721b","06b4e032b397f9bad48024b5f942595d2b8c398ab462fd0ba961c5203efb8a55","2b898bb5b99899af6de62cd5b3cf5be9ed2668eb94974dbdb402458e80c27edd","d2104c54b34158356c4c17dd37c7dd29e1c7dc4c77d9077e921f37d0b0f5cb87","8989b83d1d34dc4ef1100cbcc0f983f69d63118aeca3de5947e1c431ccd21ccc","35c935b77ca1da8fbf901931e0d8f25bff1cdedc9cbc01d98180cb496c445c21","3d1ffbc8fc8790ce6eef1e4ce1e79bfd5e9d0bc7d4f7cac0e95c54a7e1141875","128307a9785a229de861f811864e872ccc7b98da7953f6a67168addf64164fae","79d8197c490b07c732957dfc053b0a1bceaeba6cca9d3de6ce784d6b949fca4b","a49b47dfb004f10f3b23bb790de0c74667dfd053f7eda02ac831c351c7875498","5af3737dddb6e952a498672892404be1105ec2751b09467fbb5fd4b95efbd99b","9a1aef5196a946220a7ef874a7bc7424efef78d23ba8ff20df281b36ef62837a","29dd86bbc67e36427086391040eac56c43aff45b34687f4d4e39a9d3e9f2d87b","00b7ef8d8dae6570963d4f3e3027a27bda0d61285ced3ab3c81136c8899b6224","05d99f695e6424963c16f8a990e2fd0b703a8079baa1445ef2915fe525efc85b","ab77be6fc48fb908db04f842e47d944176ac3cc76020c15f382738bd437eed90","575c279d939c1c61b48798fbd747c80871dc3d4c18fcfcdb9924a950ff67cb88","88d9da0dab92c994d171a7999ca48974be8f99c041622a78d0b1f3ff27588fc1","dc172eb5106eefa395d091bdb0d8b1963a86aae82a6a7192c1910e7f11083ccd","79e09e77f7f0e0283ca443ba0eb14243a8a654cb25db6c5250caf4d840cca6ad","2cb11a971470a03e828df7520b3153e514bfc5065597d0690a0439f7a5e4284a","839f9c729f3bfd673257683bb86879ba1c3f8b41f01c2a6a33295ebf14927ab5","ef9084c118d3a104aebed6b88b07149fa5a491652a9ff90d52140cda9f7b317e","4d74b98b593856085848bde7d83f400ad2fe5a2c36ac9dfe863f96ac206ae55d","27656836bf9547d24ed317c044fe1a3feeb58aff8433ba7813d50e8f69088034","e43548a7d9030b2986c73fca5260a49e9246663148eec940c6440772c80da7ba","cdd0d39a4cb0a5adb8e38f542603e3db4bd0ccfde5c69996dd50c9b9a94cd453","a204b31c3672914ff68bb20bfdaae933bf7f8f943687c371b0fd32a3482fc5d4","f152d699e59e304c05779b97a5f518ba9abb8bd24c0b424802bf02b62c919b0f","269c4bd8cb3780736254bb151db215ef3a65af93a900ca3af00cb9b1d8c346b9","be2d0f15d3277a1dd83829a07610da07d4ba584ece64b7292b27f90ab704a7c8","ef048a1d0f1a5f33453b2481987a0f5011e158b757fe4f4def16a2a31efd4623","0534a685ecb1022ec62f19fe7252137f652dde0d86404723e021ed714d44c442","86e61b70ff3e5019f9c85b63a56e8160f9fa712e0e7fe7b4cb7c88f0384ab76a","346bbbe2467175e499c5b1aaa5f665092612ce4a49c2bdc74495e912edc15bbe","429c0ccb47f85fab9f0096859a31f2bc20e2b8a814022cd71f6e5cc88ee550f1","c55319dbab484742322d62bfabe07964e7ea8ae0aafab4476a5467888ed64e7d","6c83ec67f9e4afb6ca82b7be9548cc004e8d9ef6ac6aa29b2a6846cb9e5adb5d","1c8b2d3ff03331ade04d4ec13f9359308bbf481464938107ca40095b8246a229","f50fa063598d47694feba8f4d91f9fcac813b2c6fdaa5981c6ff466952faaf48","1be418e203655427389cd8500372de61fd17cc8a43e1692f2d49df842656b9fd","0a6ec175b75a23cdc119a124d6d16f66338767544afc31ecf35a8ed09d75c98c","b193ed7441b78595000bcd07c92bfa1b36493910579f1c33daafe42a90600537","5ee59e94ca202bace5b0525861270943a8e087f73cd32d75ccf11f9660f8f9cb","e3d78def8d4e6bb8397b25068fdae6eac9d181a75c78dcf20227a251ee00bce3","0d70c986f1a71c38bf3c3c6b54425c4ba624642231ea8471a21adcd69ecbdd4d","f35e1e9878ed539da642f82e325bbfdfd6478a4146e9c6293e6bf9cbf5850c44","3a46c481fc512cce568b39ab364bb02ec588fc276240caf34e015444a5fd26d2","9098640c076d1bdbe6daf7b48d08bb2200ac28cce6db7d08118ae676a99406c9","ff79f90c32d4c308ed74a2a13834785d64d0ad0451aa72c6db55094ca73d43ed","7916e7c886d2088f3a9cad90c7967426d23a92930baf4f9e3b027cb904bc5c09","35cdcc6eb65ef5c7725e1d9744c4bdb59253b283b539df1d3e2727383809bd6c","c6e2264465eb2e8cb2e12b67adc878e3a397efd6328e550b0a1a5bffabcad66d","048f40812b2a786d92fc8db2f174d35fa64581859cef090087a0f392d4010a3d","2fbb3b8172720d956fc349d791f4a89274cdd6f794083bf933fdeed6f8a3863b","2163bfddb0e1569e330731191e593feb3582cd0d27518993b6970aa8d62016ed","d302ecc0b3d2c60e6408fd2469e726967c7114d5f89b97d82f316feb8557c69d","4782235ebc38ab1dada9c9bb80ee43982f076c6d420bb0772c40fe615901889c","74d0e861aeeb84c692dbc8de307d62adcfabf56d916747f09b81b1f9110e8d99","a319dda4a8637ce94901abfb5275e653d0d8c5e6323656218c51257ab6f82456","26062553cec8ef883a3617e98d29b395419287e48f4102105a2ee80c1997bac1","08ef92144166ad7d52329793b355ddd7f437e7c8d1d3743fcbb2d2c68cdb7e7a","f2b32e966e35467d563af676842b4e0718f1cd634f2dfdce3972ae101e5a8564",{"version":"00ef4a4324556eab6e45809e757354899d1ded0f5b2134465ee10e450f9c8d61","affectsGlobalScope":true},"56e9508f9d3e8c96d3a3f1658371293e8bc04f814da40ab3fde1b41edce4c5dd","ccf9692fd3d341b32687f940ad0fe5ce7a66e90b496fe480f666e5a364a4f191","f6da04ced79d25ce77eab9ea71a2983e26dd66314aaa654816567785b7fe2dee","e149341309d7f08a73ade2b661a2f127ba560b7ea1780e85acfe3cdcb3d92be0","4f873a462f3653de5ac9ac1dc5a8e3c124efb25990972db81b8abee3ebae3f0a","24ba650ab9f65272df767eeee4290eade7025e5133f2f0ab68105cf9e334d301","87dd41b85c6a3d3325a8b3ab428c9c1f76bc6d1b651c879fa97d59223451cdcd","eb71b8b3341c222f144cf32f42f9b9148d7b627e5b3c6103a5f3ac56c560a158","ef99471758dc73c45801a60d26307bb516d10f89e5903c91c5eff672e932ccb1","bdb4c178a8f8ff60adafd15d70fdf6b46d3c6f81f6df1e3e7a28591f469a387d","347038ff8218327f04a203e94b4d6aa0880e03c595d8b216f5d937d0cf399fd2","fd0f0447797aed4a9ca12bc550431dc5e3abfd8457ae4aa097d8f33edee28e98","a31b2eb749842299eea366c746b942d1b701d10468e3fea0d5d4ec995d26247b","2fcd2d22b1f30555e785105597cd8f57ed50300e213c4f1bbca6ae149f782c38",{"version":"bb4248c7f953233ac52332088fac897d62b82be07244e551d87c5049600b6cf7","affectsGlobalScope":true},"86fd1a4f883c8f923441b8e6c87a2dca5e9821686034bc16ff2fa47a78d490e6","f6b34ae1d3cb81d3c650290d01bc9c594b8fc04cfbc36d80d53cdf383f2e1233","bfe6237b2761c335b61c7fe90fa3e451e582d5ff1109b9225f1e188dd59efd57","a494399a814393efdcd4066904822d0292e7b999bca3fc91478b0f4bad64967b","74e89ad35934a9146c55e67657e23447a56f06ee0273eb44ddf0d248e9d67fcd","3077b10aeb84262b97adbd643e603ee5db682f2fdb8ea7b61fbc44bf3513462c","06ed91e3b43a8b7a1c2fe5ae698244083a09573c55eb2817b469f92bbd69900e","520b1072e09d4c9d3bd8d8b614d34ca0a9a69a68e59d2e36b6655f40c219255a","b3651686d9b2b02f2e8551916dbb402720a7e27b767c41669568a6f0996162aa","6cb35d83d21a7e72bd00398c93302749bcd38349d0cc5e76ff3a90c6d1498a4d",{"version":"369dd7668d0e6c91550bce0c325f37ce6402e5dd40ecfca66fbb5283e23e559d","affectsGlobalScope":true},"2632057d8b983ee33295566088c080384d7d69a492bc60b008d6a6dfd3508d6b","4bf71cf2a94492fc71e97800bdf2bcb0a9a0fa5fce921c8fe42c67060780cbfa","0996ff06f64cb05b6dac158a6ada2e16f8c2ccd20f9ff6f3c3e871f1ba5fb6d9","5c492d01a19fea5ebfff9d27e786bc533e5078909521ca17ae41236f16f9686a","a6ee930b81c65ec79aca49025b797817dde6f2d2e9b0e0106f0844e18e2cc819","84fce15473e993e6b656db9dd3c9196b80f545647458e6621675e840fd700d29","7d5336ee766aa72dffb1cc2a515f61d18a4fb61b7a2757cbccfb7b286b783dfb","63e96248ab63f6e7a86e31aa3e654ed6de1c3f99e3b668e04800df05874e8b77","80da0f61195385d22b666408f6cccbc261c066d401611a286f07dfddf7764017","06a20cc7d937074863861ea1159ac783ff97b13952b4b5d1811c7d8ab5c94776","ab6de4af0e293eae73b67dad251af097d7bcc0b8b62de84e3674e831514cb056","18cbd79079af97af66c9c07c61b481fce14a4e7282eca078c474b40c970ba1d0","e7b45405689d87e745a217b648d3646fb47a6aaba9c8d775204de90c7ea9ff35","669b754ec246dd7471e19b655b73bda6c2ca5bb7ccb1a4dff44a9ae45b6a716a","bcfaca4a8ff50f57fd36df91fba5d34056883f213baff7192cbfc4d3805d2084","76a564b360b267502219a89514953058494713ee0923a63b2024e542c18b40e5","8f62cbd3afbd6a07bb8c934294b6bfbe437021b89e53a4da7de2648ecfc7af25","a20629551ed7923f35f7556c4c15d0c8b2ebe7afaa68ceaab079a1707ba64be2","d6de66600c97cd499526ddecea6e12166ab1c0e8d9bf36fb2339fd39c8b3372a","8e7a5b8f867b99cc8763c0b024068fb58e09f7da2c4810c12833e1ca6eb11c4f","a8932876de2e3138a5a27f9426b225a4d27f0ba0a1e2764ba20930b4c3faf4b9","df877050b04c29b9f8409aa10278d586825f511f0841d1ec41b6554f8362092b","027d600e00c5f5e1816c207854285d736f2f5fa28276e2829db746d5d6811ba1","5443113a16ef378446e08d6500bb48b35de582426459abdb5c9704f5c7d327d9","0fb581ecb53304a3c95bb930160b4fa610537470cce850371cbaad5a458ca0d9","7da4e290c009d7967343a7f8c3f145a3d2c157c62483362183ba9f637a536489","eb21ddc3a8136a12e69176531197def71dc28ffaf357b74d4bf83407bd845991","914560d0c4c6aa947cfe7489fe970c94ba25383c414bbe0168b44fd20dbf0df4","4fb3405055b54566dea2135845c3a776339e7e170d692401d97fd41ad9a20e5d","8d607832a6ef0eac30657173441367dd76c96bf7800d77193428b922e060c3af","20ff7207f0bb5cdde5fee8e83315ade7e5b8100cfa2087d20d39069a3d7d06f4","7ca4c534eab7cff43d81327e369a23464bc37ef38ce5337ceff24a42c6c84eb2","5252dec18a34078398be4e321dee884dc7f47930e5225262543a799b591b36d2","23caed4dff98bd28157d2b798b43f1dfefe727f18641648c01ce4e0e929a1630","f67e013d5374826596d7c23dbae1cdb14375a27cd72e16c5fb46a4b445059329","ea3401b70e2302683bbf4c18b69ef2292b60f4d8f8e6d920413b81fb7bde0f65","71afe26642c0fb86b9f8b1af4af5deb5181b43b6542a3ff2314871b53d04c749","0d7f01634e6234d84cf0106508efdb8ae00e5ed126eff9606d37b031ac1de654","f8d209086bad78af6bd7fef063c1ed449c815e6f8d36058115f222d9f788b848","3ad003278d569d1953779e2f838f7798f02e793f6a1eceac8e0065f1a202669b","fb2c5eceffcd918dbb86332afa0199f5e7b6cf6ee42809e930a827b28ef25afe","f664aaff6a981eeca68f1ff2d9fd21b6664f47bf45f3ae19874df5a6683a8d8a","ce066f85d73e09e9adbd0049bcf6471c7eefbfc2ec4b5692b5bcef1e36babd2a","09d302513cacfbcc54b67088739bd8ac1c3c57917f83f510b2d1adcb99fd7d2a","3faa54e978b92a6f726440c13fe3ab35993dc74d697c7709681dc1764a25219f","2bd0489e968925eb0c4c0fb12ef090be5165c86bd088e1e803102c38d4a717d8","88924207132b9ba339c1adb1ed3ea07e47b3149ff8a2e21a3ea1f91cee68589d","b8800b93d8ab532f8915be73f8195b9d4ef06376d8a82e8cdc17c400553172d6","d7d469703b78beba76d511957f8c8b534c3bbb02bea7ab4705c65ef573532fb8","74c8c3057669c03264263d911d0f82e876cef50b05be21c54fef23c900de0420","b303eda2ff2d582a9c3c5ecb708fb57355cdc25e8c8197a9f66d4d1bf09fda19","4e5dc89fa22ff43da3dee1db97d5add0591ebaff9e4adef6c8b6f0b41f0f60f0","ec4e82cb42a902fe83dc13153c7a260bee95684541f8d7ef26cb0629a2f4ca31","5f36e24cd92b0ff3e2a243685a8a780c9413941c36739f04b428cc4e15de629d","40a26494e6ab10a91851791169582ab77fed4fbd799518968177e7eefe08c7a9","208e125b45bc561765a74f6f1019d88e44e94678769824cf93726e1bac457961","b3985971de086ef3aa698ef19009a53527b72e65851b782dc188ac341a1e1390","c81d421aabb6113cd98b9d4f11e9a03273b363b841f294b457f37c15d513151d","30063e3a184ff31254bbafa782c78a2d6636943dfe59e1a34f451827fd7a68dc","c05d4cae0bceed02c9d013360d3e65658297acb1b7a90252fe366f2bf4f9ccc9","6f14b92848889abba03a474e0750f7350cc91fc190c107408ca48679a03975ae","a588d0765b1d18bf00a498b75a83e095aef75a9300b6c1e91cbf39e408f2fe2f","ecb360061d8a54f533c812f080a2455f5b69afe46117c3dd5c388562c02c9adc",{"version":"fda5829d5c6e487f99b90fd73ae23df160971c8942ed707ec262ada0516fab25","affectsGlobalScope":true},"58a16eaa92a162dfc251db07f04b8511e6a07eaf558563634b3c8ecc7d908d5b","128871d766b4ce78cdd5ba772e30b699ff69f5e38954101654f9deb25a6df454","f726c565fa43df3f3d8f44aa920434fa417898d72fda1b51ba98f91e42e039ce","ccf4459c9b3a8443fad5a944b6d7c0867ad95e054967d5859a41178ae6022b56",{"version":"109b47aaf8cff564cce2606003778b2b688d849196656e34e134287b08d45ad8","affectsGlobalScope":true},"3210eb31e629ed09089bdc47a79fe368a7458f7a357fe4ed06089dccadc95446","057a2169f1a05182e4fa5f10b170e4d0c5182ff9dc67e3a428e39fe616cf3c11","89ccbe04e737ce613f5f04990271cfa84901446350b8551b0555ddf19319723b","a185ebc69c9f6798ebd67bfdfd72a37457dc67c23459784783c7128ae9bd5250","cddf5c26907c0b8378bc05543161c11637b830da9fadf59e02a11e675d11e180","36b374bda8f87b67816ce80a538b52350b37357b77b6baf9b5b48cfe54ca540d","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380",{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"4ee363f83d7be2202f34fcd84c44da71bf3a9329fee8a05f976f75083a52ea94","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"2f1fdc948954bec1253759db6b57952133e38ebb33c990c8d2c81d8ee0b8eea7","affectsGlobalScope":true},"b4dfafe583b829a382edccbe32303535d0785f0c02ba7f04418e2a81de97af8a","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"declaration":true,"downlevelIteration":true,"emitDeclarationOnly":false,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSourceMap":false,"inlineSources":true,"module":99,"noEmitHelpers":true,"noEmitOnError":false,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":true,"strict":true,"strictNullChecks":true,"target":5},"fileIdsList":[[69,70],[69,70,90],[69,70,89],[69,70,147],[69,70,94],[69,70,92,147],[50,69,70,93,147],[69,70,92,93],[69,70,103],[69,70,103,147],[50,69,70,96,97,98,99,100,101,102,103,147],[69,70,85,86,87,88,91,95,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146],[69,70,111,147],[69,70,147,151],[39,69,70,147],[69,70,162],[69,70,247],[69,70,83],[35,69,70,83],[37,69,70],[69,70,82,83],[38,43,69,70],[39,49,50,57,66,69,70],[39,40,49,57,69,70],[41,69,70,75],[42,43,50,58,69,70],[43,66,69,70,71],[44,46,49,57,69,70],[45,69,70],[46,47,69,70],[48,49,69,70],[49,69,70],[49,50,51,66,69,70,74],[49,50,51,66,69,70],[52,57,66,69,70,74],[49,50,52,53,57,66,69,70,71,74],[52,54,69,70,71,74],[69,70,84],[49,55,69,70],[56,69,70,74],[46,49,57,66,69,70],[58,69,70],[59,69,70],[37,60,69,70],[61,69,70,73,78],[62,69,70],[63,69,70],[49,64,69,70],[64,65,69,70,75,77],[49,66,67,69,70],[66,67,69,70],[68,69,70],[69],[43,57,69,70,71],[69,70,72],[35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81],[57,69,70,73],[52,63,69,70,74],[43,69,70,75],[66,69,70,76],[69,70,77],[69,70,81],[38,43,49,51,60,66,69,70,74,77,78],[66,69,70,79],[69,70,254],[69,70,250,251,252,253],[69,70,85],[69,70,161],[69,70,148],[69,70,147,148],[69,70,147,152],[69,70,147,165],[69,70,148,149,150,153,154,155,156,157,158,159,160,164,165,166,167,168],[69,70,163],[69,70,147,148,165],[69,70,147,242],[69,70,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,191,192,194,196,197,198,199,200,201,202,203,204,205,206,207,208,209,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234],[69,70,172,174,179],[69,70,174,211],[69,70,173,178],[69,70,172,173,174,175,176,177],[69,70,173,174],[69,70,174,210],[69,70,172,173,174,179],[69,70,172,173,187],[69,70,172,173,174,175,178],[69,70,172,173],[69,70,173],[69,70,172,174,178,179],[69,70,173,174,175,178,211],[69,70,178],[69,70,178,218],[69,70,172,173,174,178],[69,70,173,174,175,178],[69,70,172,173,174,178,179],[69,70,235],[69,70,172,173,186],[69,70,188,189],[69,70,172,173,187,188],[69,70,172,173,186,187,189],[69,70,188],[69,70,172,173,188,189],[69,70,195],[69,70,190],[69,70,193],[69,70,172,178],[34,69,70,147,171,236,240],[34,69,70,243],[34,69,70],[34,69,70,147,169,170,171,235],[34,69,70,147],[34,69,70,147,170,238],[34,69,70,147,169,170,236,237,239]],"referencedMap":[[88,1],[91,2],[90,3],[89,4],[95,5],[93,6],[92,7],[94,8],[104,9],[97,10],[96,10],[98,9],[100,10],[99,10],[101,1],[102,9],[103,11],[147,12],[151,13],[152,14],[86,4],[105,4],[106,15],[107,1],[108,1],[109,4],[111,14],[110,4],[112,4],[113,4],[114,4],[115,4],[116,4],[117,1],[118,4],[119,4],[120,4],[121,4],[122,4],[123,4],[124,4],[126,4],[125,4],[127,4],[129,4],[128,4],[130,4],[131,4],[132,4],[133,4],[134,1],[135,4],[136,4],[137,4],[139,4],[87,4],[140,4],[138,4],[141,4],[143,4],[142,1],[144,4],[146,4],[145,4],[163,16],[245,1],[242,1],[246,1],[248,17],[83,18],[35,19],[37,20],[84,21],[38,22],[39,23],[40,24],[41,25],[42,26],[43,27],[44,28],[45,29],[46,30],[47,30],[48,31],[49,32],[50,33],[51,34],[36,1],[80,1],[52,35],[53,36],[54,37],[85,38],[55,39],[56,40],[57,41],[58,42],[59,43],[60,44],[61,45],[62,46],[63,47],[64,48],[65,49],[66,50],[67,51],[68,52],[69,32],[70,53],[71,54],[72,55],[82,56],[73,57],[74,58],[75,59],[76,60],[77,61],[81,62],[78,63],[79,64],[249,1],[250,1],[255,65],[251,1],[254,66],[256,67],[257,1],[253,1],[162,68],[161,1],[247,1],[149,69],[150,70],[153,71],[166,72],[154,4],[168,1],[155,4],[156,70],[157,70],[158,4],[169,73],[164,74],[159,4],[167,75],[160,4],[165,4],[148,1],[243,76],[252,1],[235,77],[185,78],[183,78],[210,79],[198,80],[178,81],[175,82],[211,83],[184,84],[186,85],[179,86],[174,87],[172,88],[234,1],[180,89],[208,80],[209,80],[212,90],[213,80],[214,80],[215,80],[216,80],[217,80],[218,91],[219,92],[220,80],[176,80],[221,80],[222,80],[223,91],[224,80],[225,80],[226,93],[227,80],[228,90],[229,80],[177,80],[230,80],[231,80],[232,94],[181,95],[233,96],[187,97],[195,98],[190,98],[189,99],[188,100],[193,101],[197,102],[196,103],[191,104],[192,101],[194,105],[182,1],[173,106],[203,1],[204,1],[205,1],[207,1],[206,1],[201,1],[202,91],[200,1],[199,88],[34,1],[7,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[4,1],[21,1],[18,1],[19,1],[20,1],[22,1],[23,1],[24,1],[5,1],[25,1],[26,1],[27,1],[28,1],[6,1],[29,1],[30,1],[31,1],[32,1],[1,1],[33,1],[241,107],[244,108],[240,109],[236,110],[237,109],[171,111],[239,112],[238,113],[170,111]],"exportedModulesMap":[[88,1],[91,2],[90,3],[89,4],[95,5],[93,6],[92,7],[94,8],[104,9],[97,10],[96,10],[98,9],[100,10],[99,10],[101,1],[102,9],[103,11],[147,12],[151,13],[152,14],[86,4],[105,4],[106,15],[107,1],[108,1],[109,4],[111,14],[110,4],[112,4],[113,4],[114,4],[115,4],[116,4],[117,1],[118,4],[119,4],[120,4],[121,4],[122,4],[123,4],[124,4],[126,4],[125,4],[127,4],[129,4],[128,4],[130,4],[131,4],[132,4],[133,4],[134,1],[135,4],[136,4],[137,4],[139,4],[87,4],[140,4],[138,4],[141,4],[143,4],[142,1],[144,4],[146,4],[145,4],[163,16],[245,1],[242,1],[246,1],[248,17],[83,18],[35,19],[37,20],[84,21],[38,22],[39,23],[40,24],[41,25],[42,26],[43,27],[44,28],[45,29],[46,30],[47,30],[48,31],[49,32],[50,33],[51,34],[36,1],[80,1],[52,35],[53,36],[54,37],[85,38],[55,39],[56,40],[57,41],[58,42],[59,43],[60,44],[61,45],[62,46],[63,47],[64,48],[65,49],[66,50],[67,51],[68,52],[69,32],[70,53],[71,54],[72,55],[82,56],[73,57],[74,58],[75,59],[76,60],[77,61],[81,62],[78,63],[79,64],[249,1],[250,1],[255,65],[251,1],[254,66],[256,67],[257,1],[253,1],[162,68],[161,1],[247,1],[149,69],[150,70],[153,71],[166,72],[154,4],[168,1],[155,4],[156,70],[157,70],[158,4],[169,73],[164,74],[159,4],[167,75],[160,4],[165,4],[148,1],[243,76],[252,1],[235,77],[185,78],[183,78],[210,79],[198,80],[178,81],[175,82],[211,83],[184,84],[186,85],[179,86],[174,87],[172,88],[234,1],[180,89],[208,80],[209,80],[212,90],[213,80],[214,80],[215,80],[216,80],[217,80],[218,91],[219,92],[220,80],[176,80],[221,80],[222,80],[223,91],[224,80],[225,80],[226,93],[227,80],[228,90],[229,80],[177,80],[230,80],[231,80],[232,94],[181,95],[233,96],[187,97],[195,98],[190,98],[189,99],[188,100],[193,101],[197,102],[196,103],[191,104],[192,101],[194,105],[182,1],[173,106],[203,1],[204,1],[205,1],[207,1],[206,1],[201,1],[202,91],[200,1],[199,88],[34,1],[7,1],[9,1],[8,1],[2,1],[10,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[3,1],[4,1],[21,1],[18,1],[19,1],[20,1],[22,1],[23,1],[24,1],[5,1],[25,1],[26,1],[27,1],[28,1],[6,1],[29,1],[30,1],[31,1],[32,1],[1,1],[33,1],[241,107],[244,108],[240,109],[236,110],[237,109],[171,111],[239,112],[238,113],[170,111]],"semanticDiagnosticsPerFile":[88,91,90,89,95,93,92,94,104,97,96,98,100,99,101,102,103,147,151,152,86,105,106,107,108,109,111,110,112,113,114,115,116,117,118,119,120,121,122,123,124,126,125,127,129,128,130,131,132,133,134,135,136,137,139,87,140,138,141,143,142,144,146,145,163,245,242,246,248,83,35,37,84,38,39,40,41,42,43,44,45,46,47,48,49,50,51,36,80,52,53,54,85,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,82,73,74,75,76,77,81,78,79,249,250,255,251,254,256,257,253,162,161,247,149,150,153,166,154,168,155,156,157,158,169,164,159,167,160,165,148,243,252,235,185,183,210,198,178,175,211,184,186,179,174,172,234,180,208,209,212,213,214,215,216,217,218,219,220,176,221,222,223,224,225,226,227,228,229,177,230,231,232,181,233,187,195,190,189,188,193,197,196,191,192,194,182,173,203,204,205,207,206,201,202,200,199,34,7,9,8,2,10,11,12,13,14,15,16,17,3,4,21,18,19,20,22,23,24,5,25,26,27,28,6,29,30,31,32,1,33,241,244,240,236,237,171,239,238,170]},"version":"4.3.5"} \ No newline at end of file diff --git a/package.json b/package.json index f1d8406..fd3724c 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Code Formatting for Atom IDE", "repository": "https://github.com/atom-community/atom-ide-code-format", "main": "./dist/main.js", - "version": "0.0.0", + "version": "1.0.0", "description": "Provides a code-formatting provider API", "scripts": { "format": "prettier --write .",